Exemplo n.º 1
0
 public static void Prefix(Tool __instance, ref object __state)
 {
     if (__instance.UpgradeLevel >= 5)
     {
         __state = new ToolTextureState()
         {
             upgrade = __instance.UpgradeLevel, oldSpritesheet = Game1.toolSpriteSheet
         };
         Mod.instance.Helper.Reflection.GetField <Texture2D>(typeof(Game1), "_toolSpriteSheet").SetValue(__instance.UpgradeLevel == 5 ? Assets.RadioactiveTools : Assets.MythiciteTools);
         __instance.upgradeLevel.Value = 4;
     }
 }
Exemplo n.º 2
0
        public static void Prefix(Farmer f, ref object __state)
        {
            var tool = f.CurrentTool;

            if (tool.UpgradeLevel >= 5)
            {
                __state = new ToolTextureState()
                {
                    upgrade = tool.UpgradeLevel, oldSpritesheet = Game1.toolSpriteSheet
                };
                Mod.instance.Helper.Reflection.GetField <Texture2D>(typeof(Game1), "_toolSpriteSheet").SetValue(tool.UpgradeLevel == 5 ? Assets.RadioactiveTools : Assets.MythiciteTools);
                tool.upgradeLevel.Value = 4;
            }
        }