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); } }
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; }
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); } }
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; }
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); } }
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); }
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); } } }
public void SpeedUp(TimeUpdateEvent e, VulcanWeaponSpeedUpNode vulcan, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud) { hud.component.CurrentEnergyValue = vulcan.vulcanWeaponState.State; }
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); } }
public void OnTankLeaveActiveState(NodeRemoveEvent e, HUDNodes.ActiveSelfTankNode self, [JoinAll, Combine] ItemButtonNode button) { button.itemButton.Disable(); }
public void Idle(TimeUpdateEvent e, VulcanWeaponIdleNode vulcan, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud) { hud.component.CurrentEnergyValue = 0f; }
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; }
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(); } }
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; }
public void Init(SetMagazineReadyEvent e, HammerReadyEnergyNode weapon, [JoinByTank] HUDNodes.ActiveSelfTankNode tank, [JoinAll] SingleNode <MainHUDComponent> hud) { this.SetMagazineAsReady(weapon, hud); }
public void InitHUD(NodeAddedEvent e, HUDNodes.ActiveSelfTankNode tank, SingleNode <MainHUDComponent> hud) { hud.component.Activate(); }
public void EnterEnabledState(NodeAddedEvent e, [Combine] ItemButtonNode button, [Context, JoinByModule] PassiveModuleNode passiveModule, [Context, JoinByModule] SlotWithModuleNode slot, [Context, JoinByTank] HUDNodes.ActiveSelfTankNode self) { button.itemButton.Passive(); }
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; }