示例#1
0
            static void Prefix(Smelter __instance)
            {
                SurtlingCoreOverclocking surtlingCoreOverclocking = __instance.GetComponentInParent <SurtlingCoreOverclocking>();

                if (surtlingCoreOverclocking == null)
                {
                    logger.LogInfo("Adding SurtlingCoreOverclocking Component to smelter");
                    __instance.gameObject.AddComponent <SurtlingCoreOverclocking>();
                }
            }
示例#2
0
            static void Prefix(Smelter __instance, ref float fuel)
            {
                SurtlingCoreOverclocking surtlingCoreOverclocking = __instance.GetComponentInParent <SurtlingCoreOverclocking>();

                if (surtlingCoreOverclocking)
                {
                    fuel = surtlingCoreOverclocking.OnSetFuel(fuel);
                }
                else
                {
                    logger.LogWarning("No SurtlingCoreOverclocking component on smelter " + __instance.transform.position);
                }
            }
示例#3
0
            static void Postfix(Smelter __instance, float __result)
            {
                SurtlingCoreOverclocking surtlingCoreOverclocking = __instance.GetComponentInParent <SurtlingCoreOverclocking>();

                if (surtlingCoreOverclocking)
                {
                    surtlingCoreOverclocking.OnGetFuel(__result);
                }
                else
                {
                    logger.LogWarning("No SurtlingCoreOverclocking component on smelter " + __instance.transform.position);
                }
            }
示例#4
0
            static void Prefix(Smelter __instance, string ore, ref int stack)
            {
                SurtlingCoreOverclocking surtlingCoreOverclocking = __instance.GetComponentInParent <SurtlingCoreOverclocking>();

                if (surtlingCoreOverclocking)
                {
                    int aditional = surtlingCoreOverclocking.OnSpawn(ore);
                    stack += aditional;
                }
                else
                {
                    logger.LogWarning("No SurtlingCoreOverclocking component on smelter " + __instance.transform.position);
                }
            }
 public void UpdateDescription()
 {
     if (descriptionTemplate == null)
     {
         descriptionTemplate = Localization.instance.Localize("$" + SurtlingCoreOverclocking.efficiencyCoreKey + "_description");
     }
     Localization.instance.AddWord(
         SurtlingCoreOverclocking.efficiencyCoreKey + "_description",
         InsertWords(descriptionTemplate,
                     SurtlingCoreOverclocking.GetPercentageString(SurtlingCoreOverclocking.m_efficiencyCoreEfficiencyBonus.Value),
                     SurtlingCoreOverclocking.GetPercentageString(SurtlingCoreOverclocking.m_efficiencyCoreSpeedPenalty.Value)
                     )
         );
 }