def printAttackbar(self, color, attr, bgcolor, playerEntity): playerGroupId = self.world.world.component_for_entity( playerEntity, GroupId) playerOffensiveAttack = EntityFinder.findOffensiveAttackByGroupId( self.world.world, playerGroupId.getId()) weaponIdx = 42 self.viewport.addstrStatic(1, weaponIdx, 'W:' + playerOffensiveAttack.getWeaponStr(), color, attr, bg=bgcolor) weaponIdx = 52 self.viewport.addstrStatic(1, weaponIdx, 'APM:' + str(int(apm.getApm() * 60)), color, attr, bg=bgcolor) weaponIdx = 62 self.viewport.addstrStatic(1, weaponIdx, 'DMG/s:' + str(int(damageStat.getDamageStat())), color, attr, bg=bgcolor)
def getPlayerAttack(self): # find player playerEntity = EntityFinder.findPlayer(self.world) if playerEntity is None: return None, None mePlayer = self.world.component_for_entity( playerEntity, system.gamelogic.player.Player) # find characterattack for player meGroupId = self.world.component_for_entity( playerEntity, system.groupid.GroupId) ret = EntityFinder.findOffensiveAttackByGroupId(self.world, meGroupId.getId()) return ret, mePlayer