def add(self, shotID, effectsDescr, gravity, refStartPoint, refVelocity, startPoint, maxDistance, isOwnShoot = False, tracerCameraPos = Math.Vector3(0, 0, 0)): import BattleReplay if BattleReplay.g_replayCtrl.isTimeWarpInProgress: return else: artID = effectsDescr.get('artilleryID') if artID is not None: self.salvo.addProjectile(artID, gravity, refStartPoint, refVelocity) return projectileMotor = self.__ballistics.addProjectile(shotID, gravity, refStartPoint, refVelocity, startPoint, maxDistance, isOwnShoot, ownVehicleGunPositionGetter(), tracerCameraPos) if projectileMotor is None: return projModelName, projModelOwnShotName, projEffects = effectsDescr['projectile'] model = BigWorld.Model(projModelOwnShotName if isOwnShoot else projModelName) proj = {'model': model, 'motor': projectileMotor, 'effectsDescr': effectsDescr, 'showExplosion': False, 'fireMissedTrigger': isOwnShoot, 'autoScaleProjectile': isOwnShoot, 'effectsData': {}} BigWorld.player().addModel(model) model.addMotor(projectileMotor) model.visible = False model.visibleAttachments = True projEffects.attachTo(proj['model'], proj['effectsData'], 'flying') self.__projectiles[shotID] = proj FlockManager.getManager().onProjectile(startPoint) return
def add(self, shotID, effectsDescr, gravity, refStartPoint, refVelocity, startPoint, maxDistance, attackerID = 0, tracerCameraPos = Math.Vector3(0, 0, 0)): import BattleReplay if BattleReplay.g_replayCtrl.isTimeWarpInProgress: return else: if startPoint.distTo(refStartPoint) > ProjectileMover.__START_POINT_MAX_DIFF: startPoint = refStartPoint artID = effectsDescr.get('artilleryID') if artID is not None: self.salvo.addProjectile(artID, gravity, refStartPoint, refVelocity) return projectileMotor = self.__ballistics.addProjectile(shotID, gravity, refStartPoint, refVelocity, startPoint, maxDistance, attackerID, ownVehicleGunPositionGetter(), tracerCameraPos) if projectileMotor is None: return projModelName, projModelOwnShotName, projEffects = effectsDescr['projectile'] isOwnShoot = attackerID == BigWorld.player().playerVehicleID model = BigWorld.Model(projModelOwnShotName if isOwnShoot else projModelName) proj = {'model': model, 'motor': projectileMotor, 'effectsDescr': effectsDescr, 'showExplosion': False, 'fireMissedTrigger': isOwnShoot, 'autoScaleProjectile': isOwnShoot, 'attackerID': attackerID, 'effectsData': {}} if not gEffectsDisabled(): BigWorld.player().addModel(model) model.addMotor(projectileMotor) model.visible = False model.visibleAttachments = True projEffects.attachTo(proj['model'], proj['effectsData'], 'flying', isPlayerVehicle=isOwnShoot, isArtillery=False) self.__projectiles[shotID] = proj FlockManager.getManager().onProjectile(startPoint) return
def onEnterWorld(self, prereqs): self._loadModels(prereqs) for model in self.models: model.visible = False self._switchSounds(False) FlockManager.getManager().addFlock(self.position, self.triggerRadius, self.explosionRadius, self.respawnTime, self)
def onEnterWorld(self, prereqs): self.__loadModels(prereqs) FlockManager.getManager().addFlock(self.position, self.triggerRadius, self.explosionRadius, self.respawnTime, self)
def __notifyProjectileHit(self, hitPosition, proj): caliber = proj['effectsDescr']['caliber'] isOwnShot = proj['autoScaleProjectile'] BigWorld.player().inputHandler.onProjectileHit(hitPosition, caliber, isOwnShot) FlockManager.getManager().onProjectile(hitPosition)