internal static void ExecuteTakeEmbers() { GearItem emberBox = GameManager.GetInventoryComponent().GetBestGearItemWithName("GEAR_EmberBox"); if (emberBox == null) { GameAudioManager.PlayGUIError(); HUDMessage.AddMessage(Localization.Get("GAMEPLAY_ToolRequiredToForceOpen").Replace("{item-name}", Localization.Get("GAMEPLAY_EmberBox")), false); return; } Panel_FeedFire panel = InterfaceManager.m_Panel_FeedFire; Fire fire = Traverse.Create(panel).Field("m_Fire").GetValue <Fire>(); if (fire && !fire.m_IsPerpetual) { fire.ReduceHeatByDegrees(1); } GameManager.GetInventoryComponent().DestroyGear(emberBox.gameObject); GearItem activeEmberBox = GameManager.GetPlayerManagerComponent().InstantiateItemInPlayerInventory("GEAR_ActiveEmberBox"); GearMessage.AddMessage(activeEmberBox, Localization.Get("GAMEPLAY_Harvested"), activeEmberBox.m_DisplayName, false); InterfaceManager.m_Panel_FeedFire.ExitFeedFireInterface(); }
/// <summary> /// Method to send a notification informing the player that water has been lost /// </summary> /// <param name="waterSupply">The water supply the water was lost from</param> /// <param name="name">The localization key for potable or nonpotable water</param> /// <param name="amount">The amount of water lost in liters</param> internal static void ShowLostMessage(WaterSupply waterSupply, string name, float amount) { GearMessage.AddMessage( waterSupply.name, Localization.Get("GAMEPLAY_BWM_Lost"), " " + Localization.Get(name) + " (" + Utils.GetLiquidQuantityStringWithUnitsNoOunces(InterfaceManager.m_Panel_OptionsMenu.m_State.m_Units, amount) + ")", Color.red, false); }
internal static System.Collections.IEnumerator SendDelayedLostMessage(float amount) { yield return(new WaitForSeconds(1f)); GearMessage.AddMessage( "GEAR_JerrycanRusty", Localization.Get("GAMEPLAY_Lost"), " " + Localization.Get("GAMEPLAY_Kerosene") + " (" + Utils.GetLiquidQuantityStringWithUnitsNoOunces(InterfaceManager.m_Panel_OptionsMenu.m_State.m_Units, amount) + ")", Color.red, false); }
private static System.Collections.IEnumerator DelayedLostMessage(WaterSupply waterSupply, string name, float amount) { yield return(new WaitForSeconds(1f)); GearMessage.AddMessage( waterSupply.name, Localization.Get("GAMEPLAY_Lost"), " " + Localization.Get(name) + " (" + Utils.GetLiquidQuantityStringWithUnitsNoOunces(InterfaceManager.m_Panel_OptionsMenu.m_State.m_Units, amount) + ")", Color.red, false); }
public static void AdjustWaterToWaterSupply() { var potableWaterSupply = GameManager.GetInventoryComponent().GetPotableWaterSupply().m_WaterSupply; var potableDelta = potableWaterSupply.m_VolumeInLiters - WATER.ActualPotable; var nonPotableWaterSupply = GameManager.GetInventoryComponent().GetNonPotableWaterSupply().m_WaterSupply; var nonPotableDelta = nonPotableWaterSupply.m_VolumeInLiters - WATER.ActualNonPotable; WATER.Remove(-nonPotableDelta, LiquidQuality.NonPotable); WATER.Remove(-potableDelta, LiquidQuality.Potable); WATER.Add(potableDelta, LiquidQuality.Potable); WATER.Add(nonPotableDelta, LiquidQuality.NonPotable); WATER.UpdateAmounts(); WATER.UpdateBottles(); float potableWaterLost = potableWaterSupply.m_VolumeInLiters - WATER.ActualPotable; potableWaterSupply.m_VolumeInLiters = WATER.ActualPotable; if (!IsNone(potableWaterLost)) { GearMessage.AddMessage( potableWaterSupply.name, Localization.Get("GAMEPLAY_Lost"), " " + Localization.Get("GAMEPLAY_WaterPotable") + " (" + Utils.GetLiquidQuantityStringWithUnitsNoOunces(InterfaceManager.m_Panel_OptionsMenu.m_State.m_Units, potableWaterLost) + ")", Color.red, false); } float nonPotableWaterLost = nonPotableWaterSupply.m_VolumeInLiters - WATER.ActualNonPotable; nonPotableWaterSupply.m_VolumeInLiters = WATER.ActualNonPotable; if (!IsNone(nonPotableWaterLost)) { GearMessage.AddMessage( nonPotableWaterSupply.name, Localization.Get("GAMEPLAY_Lost"), " " + Localization.Get("GAMEPLAY_WaterUnsafe") + " (" + Utils.GetLiquidQuantityStringWithUnitsNoOunces(InterfaceManager.m_Panel_OptionsMenu.m_State.m_Units, nonPotableWaterLost) + ")", Color.red, false); } }