private static bool Prefix(FuelSourceItem __instance, float normalizedCondition, ref float __result) { GearItem component = __instance.GetComponent <GearItem>(); if (!component) { return(false); } __result = Fire_RV.getModifiedDuration(component); return(false); }
internal static void SaveLastUsedFireRessources(Panel_FireStart instance) { FireStarterItem fireStarter = instance.GetSelectedFireStarter(); FuelSourceItem tinder = instance.GetSelectedTinder(); FuelSourceItem fuel = instance.GetSelectedFuelSource(); FireStarterItem accelerant = instance.GetSelectedAccelerant(); if (fireStarter) { var fireStarterGi = fireStarter.GetComponent <GearItem>(); if (!fireStarterGi.m_TorchItem && !fireStarterGi.m_FlareItem) { LastFireStarterID = fireStarterGi.m_InstanceID; LastFireStarterName = fireStarterGi.m_GearName; } } else { LastFireStarterID = -1; LastFireStarterName = ""; } if (tinder) { LastTinderName = tinder.GetComponent <GearItem>().m_GearName; } else { LastTinderName = ""; } if (fuel) { LastFuelName = fuel.GetComponent <GearItem>().m_GearName; } else { LastFuelName = ""; } if (accelerant) { LastAccelerantName = accelerant.GetComponent <GearItem>().m_GearName; } else { LastAccelerantName = ""; } }
private static bool Prefix(Fire __instance, FuelSourceItem fuel, bool maskTempIncrease, ref float ___m_FuelHeatIncrease, ref float ___m_ElapsedOnTODSeconds, ref float ___m_ElapsedOnTODSecondsUnmodified, ref float ___m_MaxOnTODSeconds, FireState ___m_FireState) { GearItem component = fuel.GetComponent <GearItem>(); if (!component) { return(false); } //Fire_RV.PrintHierarchy(__instance.gameObject); __instance.m_HeatSource.TurnOn(); __instance.m_HeatSource.m_MaskTempIncrease = maskTempIncrease; __instance.m_HeatSource.m_MaxTempIncrease += Fire_RV.getModifiedHeatIncrease(component); __instance.m_HeatSource.m_MaxTempIncreaseInnerRadius = fuel.m_HeatInnerRadius; float outradscale = (float)AccessTools.Method(typeof(Fire), "GetFireOuterRadiusScale").Invoke(__instance, null); HeatReservoir reservoir = Fire_RV.GetHeatReservoir(Utils.GetGuidFromGameObject(__instance.gameObject)); if (reservoir == null) { __instance.m_HeatSource.m_MaxTempIncreaseOuterRadius = fuel.m_HeatOuterRadius * outradscale; } else { __instance.m_HeatSource.m_MaxTempIncreaseOuterRadius = fuel.m_HeatOuterRadius * outradscale + reservoir.heatingsize; } if (__instance.m_FX) { __instance.m_FX.TriggerStage(___m_FireState, true, true); } ___m_FuelHeatIncrease = __instance.m_HeatSource.m_MaxTempIncrease; ___m_ElapsedOnTODSeconds = 0f; ___m_ElapsedOnTODSecondsUnmodified = 0f; ___m_MaxOnTODSeconds = Fire_RV.getStoveDurationModifier(__instance.gameObject) * Fire_RV.getModifiedDuration(component) * 60f * 60f; return(false); }