本文整理汇总了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)