当前位置: 首页>>代码示例>>Python>>正文


Python WeaponGlobals.getAttackReactionDelay方法代码示例

本文整理汇总了Python中pirates.battle.WeaponGlobals.getAttackReactionDelay方法的典型用法代码示例。如果您正苦于以下问题:Python WeaponGlobals.getAttackReactionDelay方法的具体用法?Python WeaponGlobals.getAttackReactionDelay怎么用?Python WeaponGlobals.getAttackReactionDelay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pirates.battle.WeaponGlobals的用法示例。


在下文中一共展示了WeaponGlobals.getAttackReactionDelay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: targetedWeaponHit

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getAttackReactionDelay [as 别名]
 def targetedWeaponHit(self, skillId, ammoSkillId, skillResult, targetEffects, attacker, pos, charge = 0, delay = None, multihit = 0, itemEffects = []):
     if self == attacker:
         if not targetEffects[0] and targetEffects[1] and targetEffects[2] and targetEffects[3] > 0:
             pass
         if not targetEffects[4] and not WeaponGlobals.isSelfUseSkill(skillId):
             return None
         
     if not delay:
         (targetPos, time, impactT) = self.getProjectileInfo(skillId, attacker)
         if impactT:
             delay = impactT
         else:
             delay = WeaponGlobals.getAttackReactionDelay(skillId, ammoSkillId)
     
     if WeaponGlobals.getIsDollAttackSkill(skillId):
         delay += random.uniform(0.0, 0.5)
     
     if attacker and attacker.isLocal():
         self.localAttackedMe()
         centerEffect = WeaponGlobals.getCenterEffect(skillId, ammoSkillId)
         if self.hasNetPythonTag('MonstrousObject'):
             pass
         elif not centerEffect == 2:
             if not self.avatarType.isA(AvatarTypes.Stump) and self.avatarType.isA(AvatarTypes.FlyTrap) and self.avatarType.isA(AvatarTypes.GiantCrab):
                 pass
             if not self.avatarType.isA(AvatarTypes.CrusherCrab):
                 mult = 0.66600000000000004
                 if self.avatarType.isA(AvatarTypes.GiantCrab) or self.avatarType.isA(AvatarTypes.CrusherCrab):
                     mult = 0.10000000000000001
                 elif self.avatarType.isA(AvatarTypes.RockCrab):
                     mult = 0.20000000000000001
                 
                 pos = Vec3(0, 0, self.height * mult)
             elif centerEffect == 1:
                 newZ = attacker.getZ(self)
                 pos = Vec3(0, 0, newZ + attacker.height * 0.66600000000000004)
             else:
                 newPos = self.cr.targetMgr.getAimHitPos(attacker)
                 if newPos:
                     pos = Vec3(newPos[0], newPos[1], newPos[2] + 1.5)
                 
         else:
             centerEffect = WeaponGlobals.getCenterEffect(skillId, ammoSkillId)
             if centerEffect >= 1:
                 pos = Vec3(0, 0, self.height * 0.66600000000000004)
             
     weaponSubType = None
     if attacker and attacker.currentWeapon:
         weaponType = ItemGlobals.getType(attacker.currentWeapon.itemId)
         if weaponType in [
             ItemGlobals.SWORD]:
             weaponSubType = ItemGlobals.getSubtype(attacker.currentWeapon.itemId)
         elif attacker.currentWeapon.getName() in [
             'sword']:
             weaponSubType = ItemGlobals.CUTLASS
         
     
     if delay > 0.0:
         taskMgr.doMethodLater(delay, self.playHitSound, self.taskName('playHitSoundTask'), extraArgs = [
             skillId,
             ammoSkillId,
             skillResult,
             weaponSubType])
     else:
         self.playHitSound(skillId, ammoSkillId, skillResult, weaponSubType)
     if skillResult in [
         WeaponGlobals.RESULT_HIT,
         WeaponGlobals.RESULT_MISTIMED_HIT,
         WeaponGlobals.RESULT_REFLECTED]:
         bonus = 0
         if bonus:
             targetEffects[0] -= bonus
         
         if skillResult == WeaponGlobals.RESULT_MISTIMED_HIT:
             if type(targetEffects) is types.TupleType:
                 targetEffects = (int(targetEffects[0] * WeaponGlobals.MISTIME_PENALTY),) + targetEffects[1:]
             else:
                 targetEffects[0] = int(targetEffects[0] * WeaponGlobals.MISTIME_PENALTY)
         
         if delay > 0.0:
             taskMgr.doMethodLater(delay, self.playOuch, self.taskName('playOuchTask'), extraArgs = [
                 skillId,
                 ammoSkillId,
                 targetEffects,
                 attacker,
                 pos,
                 itemEffects,
                 multihit,
                 0,
                 skillResult])
         else:
             self.playOuch(skillId, ammoSkillId, targetEffects, attacker, pos, itemEffects, multihit, skillResult = skillResult)
         if bonus:
             taskMgr.doMethodLater(WeaponGlobals.COMBO_DAMAGE_DELAY, self.playOuch, self.taskName('playBonusOuchTask'), extraArgs = [
                 skillId,
                 ammoSkillId,
                 [
                     bonus,
                     0,
                     0,
#.........这里部分代码省略.........
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:103,代码来源:DistributedTargetableObject.py


注:本文中的pirates.battle.WeaponGlobals.getAttackReactionDelay方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。