internal static void Postfix(WaterSupply ws, bool __result) { if (GameManager.GetThirstComponent().IsAddingThirstOverTime()) { return; } LiquidItem liquidItem = ws.GetComponent <LiquidItem>(); if (liquidItem == null) { return; } liquidItem.m_LiquidLiters = ws.m_VolumeInLiters; Object.Destroy(ws); liquidItem.GetComponent <GearItem>().m_WaterSupply = null; }
internal static void Postfix(PlayerManager __instance, float progress) { //WaterSupply waterSupply = AccessTools.Field(__instance.GetType(), "m_WaterSourceToDrinkFrom").GetValue(__instance) as WaterSupply; WaterSupply waterSupply = __instance.m_WaterSourceToDrinkFrom; if (waterSupply == null) { return; } GearItem gearItem = waterSupply.GetComponent <GearItem>(); if (gearItem.m_LiquidItem != null) { gearItem.m_LiquidItem.m_LiquidLiters = waterSupply.m_VolumeInLiters; Object.Destroy(waterSupply); gearItem.m_WaterSupply = null; } if (gearItem.m_CookingPotItem != null) { if (!WaterUtils.IsCooledDown(gearItem.m_CookingPotItem)) { //GameManager.GetPlayerManagerComponent().ApplyFreezingBuff(20 * progress, 0.5f, 1 * progress); GameManager.GetPlayerManagerComponent().ApplyFreezingBuff(20 * progress, 0.5f, 1 * progress, 24f); PlayerDamageEvent.SpawnAfflictionEvent("GAMEPLAY_WarmingUp", "GAMEPLAY_BuffHeader", "ico_injury_warmingUp", InterfaceManager.m_Panel_ActionsRadial.m_FirstAidBuffColor); } WaterUtils.SetWaterAmount(gearItem.m_CookingPotItem, waterSupply.m_VolumeInLiters); Object.Destroy(waterSupply); } if (waterSupply is WaterSourceSupply) { WaterSourceSupply waterSourceSupply = waterSupply as WaterSourceSupply; waterSourceSupply.UpdateWaterSource(); } Water.AdjustWaterSupplyToWater(); }
internal static void Postfix(PlayerManager __instance) { WaterSupply waterSupply = AccessTools.Field(__instance.GetType(), "m_WaterSourceToDrinkFrom").GetValue(__instance) as WaterSupply; if (waterSupply == null) { return; } LiquidItem liquidItem = waterSupply.GetComponent <LiquidItem>(); if (liquidItem == null) { return; } liquidItem.m_LiquidLiters = waterSupply.m_VolumeInLiters; UnityEngine.Object.Destroy(waterSupply); liquidItem.GetComponent <GearItem>().m_WaterSupply = null; Water.AdjustWaterSupplyToWater(); }
internal static void Postfix(PlayerManager __instance, float progress) { WaterSupply waterSupply = AccessTools.Field(__instance.GetType(), "m_WaterSourceToDrinkFrom").GetValue(__instance) as WaterSupply; if (waterSupply == null) { return; } GearItem gearItem = waterSupply.GetComponent <GearItem>(); if (gearItem.m_LiquidItem != null) { gearItem.m_LiquidItem.m_LiquidLiters = waterSupply.m_VolumeInLiters; Object.Destroy(waterSupply); gearItem.m_WaterSupply = null; } if (gearItem.m_CookingPotItem != null) { if (!WaterUtils.IsCooledDown(gearItem.m_CookingPotItem)) { GameManager.GetPlayerManagerComponent().ApplyFreezingBuff(20 * progress, 0.5f, 1 * progress, 1); InterfaceManager.m_Panel_HUD.ShowBuffNotification("GAMEPLAY_WarmingUp", "GAMEPLAY_BuffHeader", InterfaceManager.m_Panel_HUD.m_BuffSpriteFreezingBuff); } WaterUtils.SetWaterAmount(gearItem.m_CookingPotItem, waterSupply.m_VolumeInLiters); Object.Destroy(waterSupply); } if (waterSupply is WaterSourceSupply waterSourceSupply) { waterSourceSupply.UpdateWaterSource(); } Water.AdjustWaterSupplyToWater(); }
internal static bool Prefix(WaterSupply ws, ref bool __result) { __result = ws != null && ws.GetComponent <LiquidItem>() == null; return(false); }
internal static bool Prefix(WaterSupply ws, ref bool __result) { __result = ws != null && ws.GetComponent <LiquidItem>() == null; //the water supply exists but has no liquid component return(false); }
internal static bool Prefix(WaterSupply ws, ref bool __result) { //Implementation.Log("Panel_Container -- IgnoreWaterSupplyItem"); __result = ws != null && ws.GetComponent <LiquidItem>() == null; //the water supply exists but has no liquid component return(false); }