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


Python WeaponGlobals.isProjectileSkill方法代码示例

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


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

示例1: _DistributedShipBroadside__requestAttack

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import isProjectileSkill [as 别名]
 def _DistributedShipBroadside__requestAttack(self, index, side, targetPos, flightTime):
     if side == 0:
         if self.leftBroadside and self.leftBroadsideConfig:
             cannonList = self.leftBroadside
             cannonConfig = self.leftBroadsideConfig
         
         skillId = EnemySkills.LEFT_BROADSIDE
     elif side == 1:
         if self.rightBroadside and self.rightBroadsideConfig:
             cannonList = self.rightBroadside
             cannonConfig = self.rightBroadsideConfig
         
         skillId = EnemySkills.RIGHT_BROADSIDE
     
     ammoSkillId = self.ammoType
     if cannonList and cannonConfig:
         cannonList[index].playFire()
         cballSpawnPoint = cannonList[index].locator
         cballSpawnPoint.setP(render, 0)
         self.playFireEffect(cballSpawnPoint, ammoSkillId)
         if not WeaponGlobals.isProjectileSkill(skillId, ammoSkillId):
             return None
         
         pos = cballSpawnPoint.getPos(render) + Vec3(0, -25, 0)
         if targetPos:
             self.playAttack(skillId, ammoSkillId, pos, targetPos = targetPos, flightTime = flightTime)
         else:
             m = cballSpawnPoint.getMat(self)
             power = WeaponGlobals.getAttackProjectilePower(ammoSkillId) * CannonGlobals.BROADSIDE_POWERMOD
             if side == 1:
                 startVel = m.xformVec(Vec3(0, -power, 90))
             else:
                 startVel = m.xformVec(Vec3(0, -power, 90))
             self.playAttack(skillId, ammoSkillId, pos, startVel)
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:36,代码来源:DistributedShipBroadside.py

示例2: playAttack

# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import isProjectileSkill [as 别名]
 def playAttack(self, skillId, ammoSkillId, pos = 0, startVel = 0, targetPos = None, flightTime = 0):
     if not WeaponGlobals.isProjectileSkill(skillId, ammoSkillId):
         if self.localAvatarUsingWeapon:
             localAvatar.composeRequestTargetedSkill(skillId, ammoSkillId)
         
         return None
     
     self.ammoSequence = self.ammoSequence + 1 & 255
     buffs = []
     if self.av:
         buffs = self.av.getSkillEffects()
     
     ammo = self.getProjectile(ammoSkillId, self.projectileHitEvent, buffs)
     ammo.setPos(pos)
     if skillId == EnemySkills.LEFT_BROADSIDE:
         ammo.setH(render, self.ship.getH(render) + 90)
     elif skillId == EnemySkills.RIGHT_BROADSIDE:
         ammo.setH(render, self.ship.getH(render) - 90)
     
     collNode = ammo.getCollNode()
     collNode.reparentTo(render)
     ammo.setTag('ammoSequence', str(self.ammoSequence))
     ammo.setTag('skillId', str(int(skillId)))
     ammo.setTag('ammoSkillId', str(int(ammoSkillId)))
     if self.av:
         ammo.setTag('attackerId', str(self.av.doId))
     
     startPos = pos
     endPlaneZ = -10
     if self.ship:
         ammo.setTag('shipId', str(self.ship.doId))
         self.shotNum += 1
         if self.shotNum > 100000:
             self.shotNum = 0
         
         ammo.setTag('shotNum', str(self.shotNum))
         self.baseVel = self.ship.worldVelocity
     
     if startPos[2] < endPlaneZ:
         self.notify.warning('bad startPos Z: %s' % startPos[2])
         return None
     
     if targetPos is None:
         startVel += self.baseVel
         pi = ProjectileInterval(ammo, startPos = startPos, startVel = startVel, endZ = endPlaneZ, gravityMult = 2.0, collNode = collNode)
     elif self.ship.getNPCship():
         pi = ProjectileInterval(ammo, endZ = endPlaneZ, startPos = startPos, wayPoint = targetPos, timeToWayPoint = flightTime, gravityMult = 0.5, collNode = collNode)
     else:
         pi = ProjectileInterval(ammo, endZ = endPlaneZ, startPos = startPos, wayPoint = targetPos, timeToWayPoint = flightTime, gravityMult = 1.2, collNode = collNode)
     if base.cr.cannonballCollisionDebug == 1 or base.cr.cannonballCollisionDebug == 2:
         addFunc = Func(base.cTrav.addCollider, collNode, ammo.collHandler)
         delFunc = Func(base.cTrav.removeCollider, collNode)
     else:
         addFunc = Wait(0)
         delFunc = Wait(0)
     s = Parallel(Sequence(Wait(0.10000000000000001), addFunc), Sequence(pi, Func(ammo.destroy), delFunc))
     ammo.setIval(s, start = True)
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:59,代码来源:DistributedShipBroadside.py


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