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


Python WeaponGlobals.isFriendlyFireWeapon方法代码示例

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


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

示例1: takeAim

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import isFriendlyFireWeapon [as 别名]
 def takeAim(self, av, skillId = None, ammoSkillId = None):
     if not self.aimTrav:
         return (None, None)
     
     self.aimTrav.traverse(render)
     numEntries = self.aimQueue.getNumEntries()
     if numEntries == 0:
         return (None, None)
     
     self.aimQueue.sortEntries()
     avTeam = av.getTeam()
     (currentWeaponId, isWeaponDrawn) = av.getCurrentWeapon()
     friendlyWeapon = WeaponGlobals.isFriendlyFireWeapon(currentWeaponId)
     if skillId:
         friendlySkill = WeaponGlobals.isFriendlyFire(skillId, ammoSkillId)
     
     for i in range(numEntries):
         entry = self.aimQueue.getEntry(i)
         targetColl = entry.getIntoNodePath()
         if targetColl.node().getIntoCollideMask().hasBitsInCommon(PiratesGlobals.BattleAimOccludeBitmask):
             break
         
         target = self.getObjectFromNodepath(targetColl)
         if target:
             if targetColl.hasNetPythonTag('MonstrousObject'):
                 dist = entry.getSurfacePoint(localAvatar)[1]
             else:
                 dist = target.getY(av)
             targetTeam = target.getTeam()
             if target.gameFSM.state == 'Death':
                 continue
             
             if dist < 0:
                 continue
             
             if not TeamUtils.damageAllowed(target, localAvatar):
                 if not friendlyWeapon:
                     continue
                 
                 if skillId and not friendlySkill:
                     continue
                 
             
             if not self.cr.battleMgr.obeysPirateCode(av, target):
                 if ItemGlobals.getSubtype(av.currentWeaponId) != ItemGlobals.BAYONET:
                     localAvatar.guiMgr.showPirateCode()
                     continue
                 
             
             return (target, dist)
             continue
         continue
     
     return (None, None)
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:56,代码来源:TargetManager.py


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