Example #1
0
        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);
        }
Example #2
0
        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);
        }