public Instance(IStateMachineTarget master, GameObject owner) : base(master) { base.sm.owner.Set(owner, base.smi); navigator = owner.GetComponent <Navigator>(); jet_suit_tank = master.GetComponent <JetSuitTank>(); }
protected override void OnStopWork(Worker worker) { operational.SetActive(false, false); if (worker != null) { if (jetSuitTank != null && !jetSuitTank.IsEmpty()) { worker.RemoveTag(GameTags.JetSuitOutOfFuel); } if (leadSuitTank != null) { if (!leadSuitTank.IsEmpty()) { worker.RemoveTag(GameTags.SuitBatteryOut); } if (!leadSuitTank.NeedsRecharging()) { worker.RemoveTag(GameTags.SuitBatteryLow); } } } suitTank = null; jetSuitTank = null; leadSuitTank = null; }
protected override void OnStartWork(Worker worker) { SetWorkTime(float.PositiveInfinity); var suit = worker.GetComponent <MinionIdentity>().GetEquipment().GetAssignable(Db.Get().AssignableSlots.Suit); if (suit != null) { suitTank = suit.GetComponent <SuitTank>(); jetSuitTank = suit.GetComponent <JetSuitTank>(); leadSuitTank = suit.GetComponent <LeadSuitTank>(); } operational.SetActive(true, false); elapsedTime = 0; }
public bool IsFuelTankAboveMinimumLevel() { KPrefabID storedOutfit = GetStoredOutfit(); if ((UnityEngine.Object)storedOutfit != (UnityEngine.Object)null) { JetSuitTank component = storedOutfit.GetComponent <JetSuitTank>(); if ((UnityEngine.Object)component == (UnityEngine.Object)null) { return(true); } return(component.PercentFull() >= TUNING.EQUIPMENT.SUITS.MINIMUM_USABLE_SUIT_CHARGE); } return(false); }
private void FuelSuit(float dt) { KPrefabID storedOutfit = suit_locker.GetStoredOutfit(); if (!((UnityEngine.Object)storedOutfit == (UnityEngine.Object)null)) { GameObject fuel = GetFuel(); if (!((UnityEngine.Object)fuel == (UnityEngine.Object)null)) { PrimaryElement component = fuel.GetComponent <PrimaryElement>(); if (!((UnityEngine.Object)component == (UnityEngine.Object)null)) { JetSuitTank component2 = storedOutfit.GetComponent <JetSuitTank>(); float a = 375f * dt / 600f; a = Mathf.Min(a, 25f - component2.amount); a = Mathf.Min(component.Mass, a); component.Mass -= a; component2.amount += a; } } } }