public void InitializeCooldownFill(NodeRemoveEvent e, SlotCooldownStateNode slot, [JoinByModule] ItemButtonNode itemButton) { itemButton.itemButton.FinishCooldown(); if (slot.Entity.HasComponent <InventoryEnabledStateComponent>()) { itemButton.itemButton.Enable(); } else { itemButton.itemButton.Disable(); } }
private void StartCooldown(SlotCooldownStateNode slot, ItemButtonComponent item) { float timeInSec = (((float)slot.inventoryCooldownState.CooldownTime) / 1000f) - (Date.Now.UnityTime - slot.inventoryCooldownState.CooldownStartTime.UnityTime); if (!item.isRage) { item.StartCooldown(timeInSec, slot.Entity.HasComponent <InventoryEnabledStateComponent>()); } else { item.StartRageCooldown(timeInSec, slot.Entity.HasComponent <InventoryEnabledStateComponent>()); } }
private void StartCooldown(SlotCooldownStateNode slot, ItemButtonNode itemButton) { float timeInSec = (((float)slot.inventoryCooldownState.CooldownTime) / 1000f) - (Date.Now.UnityTime - slot.inventoryCooldownState.CooldownStartTime.UnityTime); if (itemButton.itemButton.isRage) { itemButton.itemButton.StartRageCooldown(timeInSec, slot.Entity.HasComponent <InventoryEnabledStateComponent>()); } else { itemButton.itemButton.StartCooldown(timeInSec, slot.Entity.HasComponent <InventoryEnabledStateComponent>()); if (itemButton.itemButton.ammunitionCountWasIncreased && ((itemButton.itemButton.MaxItemAmmunitionCount > 1) && (itemButton.itemButton.ItemAmmunitionCount == 1))) { itemButton.itemButton.FinishCooldown(); } } }
public void PlayRageHUDEffect(PlayRageHUDEffectEvent e, TankNode tank, [JoinByUser, Combine] SlotCooldownStateNode slot, [JoinByModule] SingleNode <ItemButtonComponent> hud) { float cutTime = (((float)slot.inventoryCooldownState.CooldownTime) / 1000f) - (Date.Now.UnityTime - slot.inventoryCooldownState.CooldownStartTime.UnityTime); hud.component.CutCooldown(cutTime); }
public void ChangeCooldownSpeedHUDAnimation(BattleUserInventoryCooldownSpeedChangedEvent e, SingleNode <BattleUserInventoryCooldownSpeedComponent> battleUser, [JoinByUser, Combine] SlotCooldownStateNode slot, [JoinByModule] SingleNode <ItemButtonComponent> hud) { float time = (((float)slot.inventoryCooldownState.CooldownTime) / 1000f) - (Date.Now.UnityTime - slot.inventoryCooldownState.CooldownStartTime.UnityTime); hud.component.ChangeCooldown(time, battleUser.component.SpeedCoeff, slot.Entity.HasComponent <InventoryEnabledStateComponent>()); }
public void InitializeCooldownFill(NodeAddedEvent e, SlotCooldownStateNode slot, [Context, JoinByModule] ItemButtonNode itemButton) { this.StartCooldown(slot, itemButton); }