예제 #1
0
 public void Reload(TimeUpdateEvent e, HammerEnergyNode weapon, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud)
 {
     if (((weapon.cooldownTimer.CooldownTimerSec > 0f) || (weapon.Entity.HasComponent <MagazineReloadStateComponent>() || !weapon.Entity.HasComponent <ShootableComponent>())) && InputManager.GetActionKeyDown(ShotActions.SHOT))
     {
         hud.component.EnergyBlink(false);
     }
 }
예제 #2
0
        public void UpdateEnergy(TimeUpdateEvent e, ShaftEnergyNode weapon, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud)
        {
            CooldownTimerComponent cooldownTimer = weapon.cooldownTimer;

            if ((weapon.weaponEnergy.Energy >= weapon.shaftEnergy.UnloadEnergyPerQuickShot) && ((cooldownTimer.CooldownTimerSec <= 0f) && weapon.Entity.HasComponent <ShootableComponent>()))
            {
                if (!weapon.Entity.HasComponent <BlinkMarkerComponent>())
                {
                    weapon.Entity.AddComponent <BlinkMarkerComponent>();
                    hud.component.EnergyBlink(true);
                }
            }
            else
            {
                if (weapon.Entity.HasComponent <BlinkMarkerComponent>())
                {
                    weapon.Entity.RemoveComponent <BlinkMarkerComponent>();
                }
                if (InputManager.GetActionKeyDown(ShotActions.SHOT))
                {
                    hud.component.EnergyBlink(false);
                }
            }
            hud.component.CurrentEnergyValue = weapon.weaponEnergy.Energy;
        }
예제 #3
0
 public void Energy(TimeUpdateEvent e, StreamEnergyNode weapon, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud)
 {
     hud.component.CurrentEnergyValue = weapon.weaponEnergy.Energy;
     if (InputManager.GetActionKeyDown(ShotActions.SHOT) && !weapon.Entity.HasComponent <ShootableComponent>())
     {
         hud.component.EnergyBlink(false);
     }
 }
예제 #4
0
        public void Reload(TimeUpdateEvent e, HammerReloadingEnergyNode weapon, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud)
        {
            float num3            = weapon.magazineWeapon.ReloadMagazineTimePerSec / ((float)weapon.magazineWeapon.MaxCartridgeCount);
            float currentDuration = weapon.reloadAnimationData.CurrentDuration;
            int   num5            = (int)(currentDuration / num3);

            hud.component.CurrentEnergyValue            = this.EaseInQuad((currentDuration - (num5 * num3)) / num3, (float)num5, 1f);
            weapon.reloadAnimationData.CurrentDuration += e.DeltaTime;
        }
예제 #5
0
        public void Update(TimeUpdateEvent e, RailgunReadyEnergyNode weapon, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud)
        {
            float currentEnergyValue = hud.component.CurrentEnergyValue;

            hud.component.CurrentEnergyValue = weapon.weaponEnergy.Energy;
            if ((hud.component.CurrentEnergyValue == hud.component.MaxEnergyValue) && (currentEnergyValue < hud.component.MaxEnergyValue))
            {
                hud.component.EnergyBlink(true);
            }
        }
예제 #6
0
        public void Working(TimeUpdateEvent e, VulcanWeaponWorkingNode vulcan, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud)
        {
            float temperatureHittingTime = vulcan.vulcanWeapon.TemperatureHittingTime;
            float num3 = temperatureHittingTime - (Date.Now - vulcan.weaponStreamShooting.StartShootingTime);

            if (num3 < 0f)
            {
                num3 = 0f;
                hud.component.EnergyBlink(false);
            }
            hud.component.CurrentEnergyValue = (vulcan.vulcanWeaponState.State + 1f) - (num3 / temperatureHittingTime);
        }
예제 #7
0
        public void SlowDown(NodeAddedEvent e, VulcanWeaponSlowDownNode vulcan, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud)
        {
            hud.component.StopEnergyBlink();
            if (vulcan.Entity.HasComponent <AnimationDataComponent>())
            {
                vulcan.Entity.RemoveComponent <AnimationDataComponent>();
            }
            AnimationDataComponent component = new AnimationDataComponent {
                CooldownScale = hud.component.CurrentEnergyValue
            };

            vulcan.Entity.AddComponent(component);
        }
 public void Energy(TimeUpdateEvent e, DiscreteEnergyNode weapon, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud)
 {
     if (InputManager.GetActionKeyDown(ShotActions.SHOT) && !weapon.Entity.HasComponent <ShootableComponent>())
     {
         hud.component.EnergyBlink(false);
     }
     else
     {
         if ((weapon.weaponEnergy.Energy < weapon.discreteWeaponEnergy.UnloadEnergyPerShot) && InputManager.GetActionKeyDown(ShotActions.SHOT))
         {
             hud.component.EnergyBlink(false);
         }
         float currentEnergyValue = hud.component.CurrentEnergyValue;
         hud.component.CurrentEnergyValue = weapon.weaponEnergy.Energy;
         if ((hud.component.CurrentEnergyValue >= 1f) && (currentEnergyValue < 1f))
         {
             hud.component.EnergyBlink(true);
         }
     }
 }
예제 #9
0
 public void SpeedUp(TimeUpdateEvent e, VulcanWeaponSpeedUpNode vulcan, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud)
 {
     hud.component.CurrentEnergyValue = vulcan.vulcanWeaponState.State;
 }
예제 #10
0
 public void SlowDown(TimeUpdateEvent e, VulcanWeaponSlowDownNode vulcan, [JoinByTank] SingleNode <AnimationDataComponent> animData, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud)
 {
     hud.component.CurrentEnergyValue = vulcan.vulcanWeaponState.State * animData.component.CooldownScale;
     if (InputManager.GetActionKeyDown(ShotActions.SHOT))
     {
         hud.component.EnergyBlink(false);
     }
 }
예제 #11
0
 public void OnTankLeaveActiveState(NodeRemoveEvent e, HUDNodes.ActiveSelfTankNode self, [JoinAll, Combine] ItemButtonNode button)
 {
     button.itemButton.Disable();
 }
예제 #12
0
 public void Idle(TimeUpdateEvent e, VulcanWeaponIdleNode vulcan, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud)
 {
     hud.component.CurrentEnergyValue = 0f;
 }
예제 #13
0
        public void UpdateCharging(TimeUpdateEvent e, RailgunChargingEnergyAnimatedNode weapon, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud)
        {
            float chargingTime = weapon.railgunChargingWeapon.ChargingTime;

            hud.component.CurrentEnergyValue            = this.EaseInQuad(weapon.chargeAnimationData.CurrentDuration / chargingTime, 1f, -1f);
            weapon.chargeAnimationData.CurrentDuration += e.DeltaTime;
        }
예제 #14
0
 public void EnterEnabledState(NodeAddedEvent e, [Combine] ItemButtonNode button, [Context, JoinByModule] EnabledSlotWithModuleNode slotWithModule, [Context, JoinByTank] HUDNodes.ActiveSelfTankNode self)
 {
     if (slotWithModule.Entity.HasComponent <InventorySlotTemporaryBlockedComponent>())
     {
         button.itemButton.Disable();
     }
     else
     {
         button.itemButton.Enable();
     }
 }
예제 #15
0
 public void AddAnimationData(NodeAddedEvent e, HammerReloadEnergyNode weapon, [JoinByTank] HUDNodes.ActiveSelfTankNode tank)
 {
     if (!weapon.Entity.HasComponent <ReloadAnimationDataComponent>())
     {
         weapon.Entity.AddComponent <ReloadAnimationDataComponent>();
     }
     weapon.Entity.GetComponent <ReloadAnimationDataComponent>().CurrentDuration = 0f;
 }
예제 #16
0
 public void Init(SetMagazineReadyEvent e, HammerReadyEnergyNode weapon, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud)
 {
     this.SetMagazineAsReady(weapon, hud);
 }
예제 #17
0
 public void InitHUD(NodeAddedEvent e, HUDNodes.ActiveSelfTankNode tank, SingleNode <MainHUDComponent> hud)
 {
     hud.component.Activate();
 }
예제 #18
0
 public void EnterEnabledState(NodeAddedEvent e, [Combine] ItemButtonNode button, [Context, JoinByModule] PassiveModuleNode passiveModule, [Context, JoinByModule] SlotWithModuleNode slot, [Context, JoinByTank] HUDNodes.ActiveSelfTankNode self)
 {
     button.itemButton.Passive();
 }
예제 #19
0
        public void UpdateOnTrigger(BaseShotEvent evt, HammerReadyEnergyNode hammerEnergy, [JoinByTank] HUDNodes.ActiveSelfTankNode selfNode, [JoinAll] SingleNode <MainHUDComponent> hud)
        {
            float num = hammerEnergy.magazineStorage.CurrentCartridgeCount - 1;

            hud.component.CurrentEnergyValue = num;
        }