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


Python ItemGlobals.getWeaponAttributes方法代码示例

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


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

示例1: playOuch

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getWeaponAttributes [as 别名]
    def playOuch(
        self,
        skillId,
        ammoSkillId,
        targetEffects,
        attacker,
        pos,
        itemEffects=[],
        multihit=0,
        targetBonus=0,
        skillResult=0,
    ):
        if self.isDisabled():
            return None

        if (
            hasattr(attacker, "currentWeaponId")
            and ItemGlobals.getWeaponAttributes(attacker.currentWeaponId, ItemGlobals.ANTI_VOODOO_ZOMBIE)
            and self.avatarType.isA(AvatarTypes.VoodooZombie)
        ):
            self.doAntiEffect()

        DistributedBattleNPC.DistributedBattleNPC.playOuch(
            self,
            skillId,
            ammoSkillId,
            targetEffects,
            attacker,
            pos,
            multihit=multihit,
            targetBonus=targetBonus,
            skillResult=skillResult,
        )
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:35,代码来源:DistributedVoodooZombie.py

示例2: playOuch

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getWeaponAttributes [as 别名]
 def playOuch(self, skillId, ammoSkillId, targetEffects, attacker, pos, itemEffects = [], multihit = 0, targetBonus = 0, skillResult = 0):
     (targetHp, targetPower, targetEffect, targetMojo, targetSwiftness) = targetEffects
     if self.gameFSM.state in ('Injured',):
         return None
     
     if not targetBonus:
         if ammoSkillId:
             effectId = WeaponGlobals.getHitEffect(ammoSkillId)
             skillEffectId = WeaponGlobals.getSkillEffectFlag(ammoSkillId)
         else:
             effectId = WeaponGlobals.getHitEffect(skillId)
             skillEffectId = WeaponGlobals.getSkillEffectFlag(skillId)
     
     if attacker:
         self.addCombo(attacker.getDoId(), attacker.currentWeaponId, skillId, -targetHp, skillResult)
     
     if WeaponGlobals.C_KNOCKDOWN not in self.getSkillEffects() or skillEffectId == WeaponGlobals.C_KNOCKDOWN:
         self.cleanupOuchIval()
     
     if not targetBonus and not (self.NoPain) and not (self.noIntervals) and targetEffects[0] < 0:
         if self.gameFSM.state not in ('Ensnared', 'Knockdown', 'Stunned', 'Rooted', 'NPCInteract', 'ShipBoarding', 'Injured', 'Dying', 'Death') or WeaponGlobals.C_KNOCKDOWN in self.getSkillEffects() or self.gameFSM.state not in ('ShipBoarding', 'Injured', 'Dying', 'Death'):
             if WeaponGlobals.C_KNOCKDOWN not in self.getSkillEffects() or skillEffectId == WeaponGlobals.C_KNOCKDOWN:
                 ouchSfx = None
                 if self.currentWeapon:
                     if not self.avatarType.isA(AvatarTypes.Creature) and skillEffectId == WeaponGlobals.C_KNOCKDOWN and not ItemGlobals.getWeaponAttributes(self.currentWeaponId, ItemGlobals.SURE_FOOTED):
                         if self.isLocal():
                             actorIval = Sequence(self.actorInterval('injured_fall', playRate = 1.5, blendOutT = 0), self.actorInterval('injured_standup', playRate = 1.5, blendInT = 0), Func(messenger.send, 'skillFinished'))
                         else:
                             actorIval = Sequence(self.actorInterval('injured_fall', playRate = 1.5, blendOutT = 0), self.actorInterval('injured_standup', playRate = 1.5, blendInT = 0))
                     elif not self.avatarType.isA(AvatarTypes.Creature) and effectId == WeaponGlobals.VFX_BLIND:
                         actorIval = self.actorInterval('sand_in_eyes_holdweapon_noswing', playRate = random.uniform(0.69999999999999996, 1.5))
                     else:
                         actorIval = self.actorInterval(self.currentWeapon.painAnim, playRate = random.uniform(0.69999999999999996, 1.5))
                         if WeaponGlobals.getIsStaffAttackSkill(skillId):
                             skillInfo = WeaponGlobals.getSkillAnimInfo(skillId)
                             getOuchSfxFunc = skillInfo[WeaponGlobals.OUCH_SFX_INDEX]
                             if getOuchSfxFunc:
                                 ouchSfx = getOuchSfxFunc()
                             
                         else:
                             ouchSfx = self.getSfx('pain')
                 elif not self.avatarType.isA(AvatarTypes.Creature) and skillEffectId == WeaponGlobals.C_KNOCKDOWN:
                     actorIval = Sequence(self.actorInterval('injured_fall', playRate = 1.5, blendOutT = 0), self.actorInterval('injured_standup', playRate = 1.5, blendInT = 0))
                 elif not self.avatarType.isA(AvatarTypes.Creature) and effectId == WeaponGlobals.VFX_BLIND:
                     actorIval = self.actorInterval('sand_in_eyes', playRate = random.uniform(0.69999999999999996, 1.5))
                 else:
                     actorIval = self.actorInterval('idle_hit', playRate = random.uniform(0.69999999999999996, 1.5))
                 if ouchSfx:
                     self.ouchAnim = Sequence(Func(base.playSfx, ouchSfx, node = self, cutoff = 75), actorIval)
                 else:
                     self.ouchAnim = actorIval
                 self.ouchAnim.start()
             
         skillEffectId == WeaponGlobals.C_KNOCKDOWN
     
     if self.combatEffect:
         self.combatEffect.destroy()
         self.combatEffect = None
     
     self.combatEffect = CombatEffect.CombatEffect(effectId, multihit, attacker, skillResult)
     self.combatEffect.reparentTo(self)
     self.combatEffect.setPos(self, pos[0], pos[1], pos[2])
     if not WeaponGlobals.getIsDollAttackSkill(skillId) and not WeaponGlobals.getIsStaffAttackSkill(skillId):
         if not WeaponGlobals.isSelfUseSkill(skillId):
             if attacker and not attacker.isEmpty():
                 self.combatEffect.lookAt(attacker)
             
             self.combatEffect.setH(self.combatEffect, 180)
         
     
     skillEffects = self.getSkillEffects()
     if WeaponGlobals.C_MELEE_SHIELD in skillEffects:
         if WeaponGlobals.getAttackClass(skillId) == WeaponGlobals.AC_COMBAT:
             self.pulseGhostGuardEffect(attacker, Vec4(0, 0, 0, 1), wantBlending = False)
         
     elif WeaponGlobals.C_MISSILE_SHIELD in skillEffects:
         if WeaponGlobals.getAttackClass(skillId) == WeaponGlobals.AC_MISSILE:
             self.pulseGhostGuardEffect(attacker, Vec4(1, 1, 1, 1), wantBlending = True)
         
     elif WeaponGlobals.C_MAGIC_SHIELD in skillEffects:
         if WeaponGlobals.getAttackClass(skillId) == WeaponGlobals.AC_MAGIC:
             self.pulseGhostGuardEffect(attacker, Vec4(0.5, 0.29999999999999999, 1, 1), wantBlending = True)
         
     
     self.combatEffect.play()
     if WeaponGlobals.getIsDollAttackSkill(skillId):
         self.voodooSmokeEffect2 = AttuneSmoke.getEffect()
         if self.voodooSmokeEffect2:
             self.voodooSmokeEffect2.reparentTo(self)
             self.voodooSmokeEffect2.setPos(0, 0, 0.20000000000000001)
             self.voodooSmokeEffect2.play()
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:93,代码来源:DistributedTargetableObject.py


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