コード例 #1
0
 public void UpdateVulcanShootingOnSelfTank(EarlyUpdateEvent evt, VulcanWeaponShootingControllerNode vulcanShooting, [JoinByTank] SelfActiveTankNode tank)
 {
     if (!InputManager.CheckAction(ShotActions.SHOT))
     {
         this.SwitchVulcanFromShootingToSlowDown(vulcanShooting.Entity);
     }
 }
コード例 #2
0
 public void CheckEnergyInjectionSlot(EarlyUpdateEvent e, StreamWeaponEnergyNode weapon, [JoinByTank] ObservationSlotNode slot, [JoinByModule] SingleNode <EnergyInjectionModuleReloadEnergyComponent> module)
 {
     if (this.CheckBlock(weapon.weaponEnergy, module.component, slot.Entity))
     {
         slot.Entity.AddComponentIfAbsent <InventorySlotTemporaryBlockedByClientComponent>();
     }
 }
コード例 #3
0
 public void CheckWorkingState(EarlyUpdateEvent evt, ShaftAimingWorkingWeaponControllerNode weapon)
 {
     if (!this.CheckHandleWeaponIntersectionStatus(weapon.Entity) && !InputManager.CheckAction(ShotActions.SHOT))
     {
         this.MakeAimingShot(weapon.Entity, weapon.shaftAimingWorkingState.WorkingDirection);
     }
 }
コード例 #4
0
 public void UpdateVulcanShootingOnSelfTank(EarlyUpdateEvent evt, VulcanWeaponStreamHitShootingControllerNode vulcanShooting, [JoinByTank] SelfActiveTankNode tank)
 {
     if (vulcanShooting.cooldownTimer.CooldownTimerSec <= 0f)
     {
         base.ScheduleEvent <BeforeShotEvent>(vulcanShooting);
         base.ScheduleEvent <ShotPrepareEvent>(vulcanShooting);
     }
 }
コード例 #5
0
 public void StartShotIfPossible(EarlyUpdateEvent evt, DiscreteWeaponMagazineControllerNode discreteWeaponMagazineController, [JoinByTank] AutopilotTankNode autopilotTank)
 {
     if (autopilotTank.autopilotWeaponController.Fire && (discreteWeaponMagazineController.cooldownTimer.CooldownTimerSec <= 0f))
     {
         base.ScheduleEvent <BeforeShotEvent>(discreteWeaponMagazineController);
         base.ScheduleEvent <ShotPrepareEvent>(discreteWeaponMagazineController);
     }
 }
コード例 #6
0
 public void StartShotIfPossible(EarlyUpdateEvent evt, SelfTankNode selfTank, [JoinByTank] DiscreteWeaponMagazineControllerNode discreteWeaponMagazineController)
 {
     if ((discreteWeaponMagazineController.cooldownTimer.CooldownTimerSec <= 0f) && InputManager.CheckAction(ShotActions.SHOT))
     {
         base.ScheduleEvent <BeforeShotEvent>(discreteWeaponMagazineController);
         base.ScheduleEvent <ShotPrepareEvent>(discreteWeaponMagazineController);
     }
 }
コード例 #7
0
        public void StartStreamWorkingIfPossible(EarlyUpdateEvent evt, StreamWeaponIdleControllerNode idleWeapon, [JoinSelf] SingleNode <ShootableComponent> shootable, [JoinByTank] SelfActiveTankNode selfActiveTank)
        {
            Entity weapon = idleWeapon.Entity;

            if ((idleWeapon.weaponEnergy.Energy > 0f) && InputManager.GetActionKeyDown(ShotActions.SHOT))
            {
                SwitchIdleModeToWorkingMode(weapon);
            }
        }
コード例 #8
0
        public void UpdateSlowDownStateOnSelfTank(EarlyUpdateEvent evt, VulcanWeaponSlowDownControllerNode vulcanSlowDown, [JoinByTank] SelfActiveTankNode tank)
        {
            Entity weapon = vulcanSlowDown.Entity;

            if (vulcanSlowDown.vulcanWeaponState.State <= 0f)
            {
                this.SwitchVulcanFromSlowDownToIdle(weapon);
            }
        }
コード例 #9
0
        public void StartShotIfPossible(EarlyUpdateEvent evt, ReadyRailgunChargingWeaponControllerNode chargingWeaponController, [JoinSelf] SingleNode <ShootableComponent> node, [JoinByTank] ActiveTankNode selfActiveTank)
        {
            CooldownTimerComponent cooldownTimer = chargingWeaponController.cooldownTimer;

            if (((chargingWeaponController.weaponEnergy.Energy >= chargingWeaponController.discreteWeaponEnergy.UnloadEnergyPerShot) && (cooldownTimer.CooldownTimerSec <= 0f)) && InputManager.CheckAction(ShotActions.SHOT))
            {
                base.ScheduleEvent <SelfRailgunChargingShotEvent>(chargingWeaponController);
            }
        }
コード例 #10
0
        public void StartShotIfPossible(EarlyUpdateEvent evt, SelfTankNode selfTank, [JoinByTank] DiscreteWeaponControllerNode discreteWeaponEnergyController)
        {
            CooldownTimerComponent cooldownTimer = discreteWeaponEnergyController.cooldownTimer;

            if (((discreteWeaponEnergyController.weaponEnergy.Energy >= discreteWeaponEnergyController.discreteWeaponEnergy.UnloadEnergyPerShot) && (cooldownTimer.CooldownTimerSec <= 0f)) && (InputManager.GetAxisOrKey(ShotActions.SHOT) != 0f))
            {
                base.ScheduleEvent <BeforeShotEvent>(discreteWeaponEnergyController);
                base.ScheduleEvent <ShotPrepareEvent>(discreteWeaponEnergyController);
                base.ScheduleEvent <PostShotEvent>(discreteWeaponEnergyController);
            }
        }
コード例 #11
0
        public void UpdateSpeedStateUpOnSelfTank(EarlyUpdateEvent evt, VulcanWeaponSpeedUpControllerNode vulcanSpeedUp, [JoinByTank] SelfActiveTankNode tank)
        {
            Entity weapon = vulcanSpeedUp.Entity;

            if (!InputManager.CheckAction(ShotActions.SHOT))
            {
                this.SwitchVulcanFromSpeedUpToSlowDown(weapon);
            }
            else if (vulcanSpeedUp.vulcanWeaponState.State >= 1f)
            {
                this.SwitchVulcanFroomSpeedUpToShooting(weapon);
            }
        }
コード例 #12
0
        public void StartShotIfPossible(EarlyUpdateEvent evt, DiscreteWeaponControllerNode discreteWeaponEnergyController, [JoinByTank] AutopilotTankNode autopilotTank)
        {
            float unloadEnergyPerShot = discreteWeaponEnergyController.discreteWeaponEnergy.UnloadEnergyPerShot;
            float energy = discreteWeaponEnergyController.weaponEnergy.Energy;
            CooldownTimerComponent cooldownTimer = discreteWeaponEnergyController.cooldownTimer;

            if ((autopilotTank.autopilotWeaponController.Fire && (energy >= unloadEnergyPerShot)) && (cooldownTimer.CooldownTimerSec <= 0f))
            {
                base.ScheduleEvent <BeforeShotEvent>(discreteWeaponEnergyController);
                base.ScheduleEvent <ShotPrepareEvent>(discreteWeaponEnergyController);
                base.ScheduleEvent <PostShotEvent>(discreteWeaponEnergyController);
            }
        }
コード例 #13
0
 public void CheckEnergyInjectionSlot(EarlyUpdateEvent e, MagazineNode weapon, [JoinByTank] ObservationSlotNode slot, [JoinByModule] SingleNode <EnergyInjectionModuleReloadEnergyComponent> module)
 {
     if (this.CheckBlock(weapon.cooldownTimer, slot.Entity))
     {
         if (weapon.magazineStorage.CurrentCartridgeCount < weapon.magazineWeapon.MaxCartridgeCount)
         {
             slot.Entity.RemoveComponentIfPresent <InventorySlotTemporaryBlockedByClientComponent>();
         }
         else
         {
             slot.Entity.AddComponentIfAbsent <InventorySlotTemporaryBlockedByClientComponent>();
         }
     }
 }
コード例 #14
0
        public void RunWorkingStream(EarlyUpdateEvent evt, StreamWeaponWorkingControllerNode workingWeapon, [JoinByTank] SelfActiveTankNode selfActiveTank)
        {
            Entity weapon = workingWeapon.Entity;
            CooldownTimerComponent cooldownTimer = workingWeapon.cooldownTimer;

            if (workingWeapon.weaponEnergy.Energy <= 0f)
            {
                SwitchWorkingModeToIdleMode(weapon);
            }
            else if (InputManager.GetActionKeyUp(ShotActions.SHOT))
            {
                SwitchWorkingModeToIdleMode(weapon);
            }
            else if ((cooldownTimer.CooldownTimerSec <= 0f) && workingWeapon.Entity.HasComponent <ShootableComponent>())
            {
                base.ScheduleEvent <BeforeShotEvent>(workingWeapon);
                base.ScheduleEvent <ShotPrepareEvent>(workingWeapon);
            }
        }
コード例 #15
0
 public void CheckCameraVisualIntersection(EarlyUpdateEvent evt, TankPartIntersectionWithCameraMapVisibleNode tank, [JoinAll] CameraNode camera)
 {
     this.CheckCameraVisualIntersection(tank, camera);
 }