def continuePowerRechargeEffect(self): for button in self.tray: if isinstance(self.tray[button], SkillButton) and not self.tray[button].isEmpty(): if (WeaponGlobals.getIsShipSkill(self.tray[button].skillId) or WeaponGlobals.getIsCannonSkill(self.tray[button].skillId)) and self.tray[button].skillId != InventoryType.SailPowerRecharge: self.tray[button].startPowerImpulse() self.tray[button].skillId != InventoryType.SailPowerRecharge
def continuePowerRechargeEffect(self): for button in self.tray: if isinstance(self.tray[button], SkillButton) and not self.tray[button].isEmpty(): if (WeaponGlobals.getIsShipSkill(self.tray[button].skillId) or WeaponGlobals.getIsCannonSkill(self.tray[button].skillId)) and self.tray[button].skillId != InventoryType.SailPowerRecharge: self.tray[button].startPowerImpulse() self.tray[button].skillId != InventoryType.SailPowerRecharge
def updateCharmSkills(self): self.rebuildSkillTray() for button in self.tray: if isinstance(self.tray[button], SkillButton) and not self.tray[button].isEmpty(): if (WeaponGlobals.getIsShipSkill(self.tray[button].skillId) or WeaponGlobals.getIsCannonSkill(self.tray[button].skillId)) and self.tray[button].skillId != InventoryType.SailPowerRecharge: self.tray[button].updateSkillRingIval() self.tray[button].skillId != InventoryType.SailPowerRecharge
def updateCharmSkills(self): self.rebuildSkillTray() for button in self.tray: if isinstance(self.tray[button], SkillButton) and not self.tray[button].isEmpty(): if (WeaponGlobals.getIsShipSkill(self.tray[button].skillId) or WeaponGlobals.getIsCannonSkill(self.tray[button].skillId)) and self.tray[button].skillId != InventoryType.SailPowerRecharge: self.tray[button].updateSkillRingIval() self.tray[button].skillId != InventoryType.SailPowerRecharge
def removePowerRechargeEffect(self): self.isPowerRecharged = False for button in self.tray: if isinstance(self.tray[button], SkillButton) and not self.tray[button].isEmpty(): if (WeaponGlobals.getIsShipSkill(self.tray[button].skillId) or WeaponGlobals.getIsCannonSkill(self.tray[button].skillId)) and self.tray[button].skillId != InventoryType.SailPowerRecharge: self.tray[button].stopPowerImpulse() self.tray[button].updateSkillRingIval() self.tray[button].skillId != InventoryType.SailPowerRecharge
def removePowerRechargeEffect(self): self.isPowerRecharged = False for button in self.tray: if isinstance(self.tray[button], SkillButton) and not self.tray[button].isEmpty(): if (WeaponGlobals.getIsShipSkill(self.tray[button].skillId) or WeaponGlobals.getIsCannonSkill(self.tray[button].skillId)) and self.tray[button].skillId != InventoryType.SailPowerRecharge: self.tray[button].stopPowerImpulse() self.tray[button].updateSkillRingIval() self.tray[button].skillId != InventoryType.SailPowerRecharge
def doAttack(self, attacker, skillId, ammoSkillId, targetId, areaIdList, pos, combo = 0, charge = 0): attacker.battleRandom.advanceAttackSeed() if targetId: if WeaponGlobals.getIsShipSkill(skillId): target = base.cr.doId2do.get(targetId) elif WeaponGlobals.getIsDollAttackSkill(skillId): target = base.cr.doId2do.get(targetId) else: target = base.cr.doId2do.get(targetId) if hasattr(target, 'getSkillEffects'): if WeaponGlobals.C_SPAWN in set(target.getSkillEffects()): return WeaponGlobals.RESULT_MISS if target and not TeamUtils.damageAllowed(localAvatar, target) and not WeaponGlobals.isFriendlyFire(skillId, ammoSkillId): return WeaponGlobals.RESULT_NOT_AVAILABLE else: target = None weaponHit = self.willWeaponHit(attacker, target, skillId, ammoSkillId, charge) if combo == -1: if localAvatar.wantComboTiming: return WeaponGlobals.RESULT_MISS if not WeaponGlobals.getNeedTarget(skillId, ammoSkillId): return WeaponGlobals.RESULT_HIT if not target and not areaIdList: messenger.send('tooFar') return WeaponGlobals.RESULT_MISS if target and not self.obeysPirateCode(attacker, target): if ItemGlobals.getSubtype(localAvatar.currentWeaponId) == ItemGlobals.BAYONET: pass if not (WeaponGlobals.getAttackClass(skillId) == WeaponGlobals.AC_COMBAT): return WeaponGlobals.RESULT_AGAINST_PIRATE_CODE if target and not self.targetInRange(attacker, target, skillId, ammoSkillId, pos): return WeaponGlobals.RESULT_OUT_OF_RANGE if target and isinstance(target, DistributedBattleNPC.DistributedBattleNPC): if target.getGameState()[0] == 'BreakCombat': return WeaponGlobals.RESULT_MISS if target: skillEffects = target.getSkillEffects() if WeaponGlobals.C_SPAWN in skillEffects: return WeaponGlobals.RESULT_MISS messenger.send('properHit') return weaponHit
def doAttack(self, attacker, skillId, ammoSkillId, targetId, areaIdList, pos, combo=0, charge=0): attacker.battleRandom.advanceAttackSeed() if targetId: if WeaponGlobals.getIsShipSkill(skillId): target = base.cr.doId2do.get(targetId) elif WeaponGlobals.getIsDollAttackSkill(skillId): target = base.cr.doId2do.get(targetId) else: target = base.cr.doId2do.get(targetId) if hasattr(target, 'getSkillEffects'): if WeaponGlobals.C_SPAWN in set(target.getSkillEffects()): return WeaponGlobals.RESULT_MISS if target and not TeamUtils.damageAllowed(localAvatar, target) and not WeaponGlobals.isFriendlyFire(skillId, ammoSkillId): return WeaponGlobals.RESULT_NOT_AVAILABLE else: target = None weaponHit = self.willWeaponHit(attacker, target, skillId, ammoSkillId, charge) if combo == -1: if localAvatar.wantComboTiming: return WeaponGlobals.RESULT_MISS if not WeaponGlobals.getNeedTarget(skillId, ammoSkillId): return WeaponGlobals.RESULT_HIT if not target and not areaIdList: messenger.send('tooFar') return WeaponGlobals.RESULT_MISS if target and not self.obeysPirateCode(attacker, target) and not (ItemGlobals.getSubtype(localAvatar.currentWeaponId) == ItemGlobals.BAYONET and WeaponGlobals.getAttackClass(skillId) == WeaponGlobals.AC_COMBAT): return WeaponGlobals.RESULT_AGAINST_PIRATE_CODE if target and not self.targetInRange(attacker, target, skillId, ammoSkillId, pos): return WeaponGlobals.RESULT_OUT_OF_RANGE if target and isinstance(target, DistributedBattleNPC.DistributedBattleNPC): if target.getGameState()[0] == 'BreakCombat': return WeaponGlobals.RESULT_MISS if target: skillEffects = target.getSkillEffects() if WeaponGlobals.C_SPAWN in skillEffects: return WeaponGlobals.RESULT_MISS messenger.send('properHit') return weaponHit