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


Python WeaponGlobals.getSkillResultName方法代码示例

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


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

示例1: targetedWeaponHit

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getSkillResultName [as 别名]

#.........这里部分代码省略.........
                 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,
                     0,
                     0],
                 attacker,
                 pos,
                 itemEffects,
                 multihit,
                 1])
         
         if skillId in WeaponGlobals.BackstabSkills and charge:
             if attacker and attacker.isLocal() and ItemGlobals.getSubtype(attacker.currentWeaponId) == ItemGlobals.DAGGER_SUBTYPE:
                 messenger.send(''.join([
                     'trackBackstab-',
                     str(self.doId)]))
             
         
     elif skillResult == WeaponGlobals.RESULT_MISS and skillResult == WeaponGlobals.RESULT_MISTIMED_MISS and skillResult == WeaponGlobals.RESULT_DODGE and skillResult == WeaponGlobals.RESULT_PARRY and skillResult == WeaponGlobals.RESULT_RESIST or skillResult == WeaponGlobals.RESULT_PROTECT:
         resultString = WeaponGlobals.getSkillResultName(skillResult)
         delay = WeaponGlobals.getAttackReactionDelay(skillId, ammoSkillId)
         if delay > 0.0:
             taskMgr.doMethodLater(delay, self.showHpString, self.taskName('showMissTask'), extraArgs = [
                 resultString,
                 pos])
         else:
             self.showHpString(resultString, pos)
     elif skillResult == WeaponGlobals.RESULT_OUT_OF_RANGE or skillResult == WeaponGlobals.RESULT_BLOCKED:
         pass
     elif skillResult == WeaponGlobals.RESULT_AGAINST_PIRATE_CODE:
         if attacker and attacker.isLocal():
             resultString = WeaponGlobals.getSkillResultName(skillResult)
             self.showHpString(resultString, pos)
         
     elif skillResult == WeaponGlobals.RESULT_NOT_AVAILABLE:
         self.notify.warning('WeaponGlobals.RESULT_NOT_AVAILABLE')
     else:
         self.notify.error('unknown skillResult: %d' % skillResult)
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:104,代码来源:DistributedTargetableObject.py


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