diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..083f401 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,72 @@ +# topmost editorconfig +root: true + +########## +## General formatting +## documentation: http://editorconfig.org +########## +[*] +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 + +[*.{csproj,nuspec,targets}] +indent_size = 2 + +[*.csproj] +insert_final_newline = false + +########## +## C# formatting +## documentation: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference +########## +[*.cs] + +#sort 'system' usings first +dotnet_sort_system_directives_first = true + +# use 'this.' qualifier +dotnet_style_qualification_for_field = true:error +dotnet_style_qualification_for_property = true:error +dotnet_style_qualification_for_method = true:error +dotnet_style_qualification_for_event = true:error + +# use language keywords (like int) instead of type (like Int32) +dotnet_style_predefined_type_for_locals_parameters_members = true:error +dotnet_style_predefined_type_for_member_access = true:error + +# don't use 'var' for language keywords +csharp_style_var_for_built_in_types = false:error + +# suggest modern C# features where simpler +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion +csharp_prefer_simple_default_expression = true:suggestion + +# prefer method block bodies +csharp_style_expression_bodied_methods = false:suggestion +csharp_style_expression_bodied_constructors = false:suggestion + +# prefer property expression bodies +csharp_style_expression_bodied_properties = true:suggestion +csharp_style_expression_bodied_indexers = true:suggestion +csharp_style_expression_bodied_accessors = true:suggestion + +# prefer inline out variables +csharp_style_inlined_variable_declaration = true:warning + +# avoid superfluous braces +csharp_prefer_braces = false:suggestion + +# set block newline conventions +csharp_new_line_before_open_brace = true +csharp_new_line_before_else = false +csharp_new_line_before_catch = false diff --git a/PrismaticTools.sln b/PrismaticTools.sln index 40856f6..45fa01d 100644 --- a/PrismaticTools.sln +++ b/PrismaticTools.sln @@ -1,10 +1,18 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2026 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28803.202 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrismaticTools", "PrismaticTools\PrismaticTools.csproj", "{C24166EE-9341-4760-86B3-F89B326F3FC0}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{7EF5E22B-2A2D-4B4A-9903-6B118B874F64}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .gitignore = .gitignore + LICENSE = LICENSE + README.md = README.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/PrismaticTools.sln.DotSettings b/PrismaticTools.sln.DotSettings new file mode 100644 index 0000000..7cc51a4 --- /dev/null +++ b/PrismaticTools.sln.DotSettings @@ -0,0 +1,3 @@ + + DO_NOT_SHOW + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> \ No newline at end of file diff --git a/PrismaticTools/0Harmony.dll b/PrismaticTools/0Harmony.dll deleted file mode 100644 index 6361942..0000000 Binary files a/PrismaticTools/0Harmony.dll and /dev/null differ diff --git a/PrismaticTools/Framework/AssetEditor.cs b/PrismaticTools/Framework/AssetEditor.cs index 79611c5..086d010 100644 --- a/PrismaticTools/Framework/AssetEditor.cs +++ b/PrismaticTools/Framework/AssetEditor.cs @@ -1,16 +1,15 @@ -using Microsoft.Xna.Framework; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using StardewModdingAPI; using StardewValley; -using System.Collections.Generic; namespace PrismaticTools.Framework { public class AssetEditor : IAssetEditor { - - private string barName = ModEntry.ModHelper.Translation.Get("prismaticBar.name"); - private string barDesc = ModEntry.ModHelper.Translation.Get("prismaticBar.description"); - private string sprinklerName = ModEntry.ModHelper.Translation.Get("prismaticSprinkler.name"); - private string sprinklerDesc = ModEntry.ModHelper.Translation.Get("prismaticSprinkler.description"); + private readonly string barName = ModEntry.ModHelper.Translation.Get("prismaticBar.name"); + private readonly string barDesc = ModEntry.ModHelper.Translation.Get("prismaticBar.description"); + private readonly string sprinklerName = ModEntry.ModHelper.Translation.Get("prismaticSprinkler.name"); + private readonly string sprinklerDesc = ModEntry.ModHelper.Translation.Get("prismaticSprinkler.description"); public bool CanEdit(IAssetInfo asset) { bool canEdit = @@ -24,16 +23,16 @@ public bool CanEdit(IAssetInfo asset) { public void Edit(IAssetData asset) { if (asset.AssetNameEquals("Maps/springobjects")) { - Texture2D bar = ModEntry.ModHelper.Content.Load("Assets/prismaticBar.png", ContentSource.ModFolder); - Texture2D sprinkler = ModEntry.ModHelper.Content.Load("Assets/prismaticSprinkler.png", ContentSource.ModFolder); + Texture2D bar = ModEntry.ModHelper.Content.Load("Assets/prismaticBar.png"); + Texture2D sprinkler = ModEntry.ModHelper.Content.Load("Assets/prismaticSprinkler.png"); Texture2D old = asset.AsImage().Data; asset.ReplaceWith(new Texture2D(Game1.graphics.GraphicsDevice, old.Width, System.Math.Max(old.Height, 1200 / 24 * 16))); asset.AsImage().PatchImage(old); - asset.AsImage().PatchImage(bar, targetArea: Rektangle(PrismaticBarItem.INDEX)); - asset.AsImage().PatchImage(sprinkler, targetArea: Rektangle(PrismaticSprinklerItem.INDEX)); + asset.AsImage().PatchImage(bar, targetArea: this.GetRectangle(PrismaticBarItem.INDEX)); + asset.AsImage().PatchImage(sprinkler, targetArea: this.GetRectangle(PrismaticSprinklerItem.INDEX)); } else if (asset.AssetNameEquals("Data/ObjectInformation")) { - asset.AsDictionary().Data.Add(PrismaticBarItem.INDEX, $"{barName}/{PrismaticBarItem.PRICE}/{PrismaticBarItem.EDIBILITY}/{PrismaticBarItem.TYPE} {PrismaticBarItem.CATEGORY}/{barName}/{barDesc}"); - asset.AsDictionary().Data.Add(PrismaticSprinklerItem.INDEX, $"{sprinklerName}/{PrismaticSprinklerItem.PRICE}/{PrismaticSprinklerItem.EDIBILITY}/{PrismaticSprinklerItem.TYPE} {PrismaticSprinklerItem.CATEGORY}/{sprinklerName}/{sprinklerDesc}"); + asset.AsDictionary().Data.Add(PrismaticBarItem.INDEX, $"{this.barName}/{PrismaticBarItem.PRICE}/{PrismaticBarItem.EDIBILITY}/{PrismaticBarItem.TYPE} {PrismaticBarItem.CATEGORY}/{this.barName}/{this.barDesc}"); + asset.AsDictionary().Data.Add(PrismaticSprinklerItem.INDEX, $"{this.sprinklerName}/{PrismaticSprinklerItem.PRICE}/{PrismaticSprinklerItem.EDIBILITY}/{PrismaticSprinklerItem.TYPE} {PrismaticSprinklerItem.CATEGORY}/{this.sprinklerName}/{this.sprinklerDesc}"); } else if (asset.AssetNameEquals("Data/CraftingRecipes")) { IAssetDataForDictionary oldDict = asset.AsDictionary(); Dictionary newDict = new Dictionary(); @@ -42,7 +41,7 @@ public void Edit(IAssetData asset) { newDict.Add(key, oldDict.Data[key]); if (key.Equals("Iridium Sprinkler")) { if (asset.Locale != "en") - newDict.Add("Prismatic Sprinkler", $"{PrismaticBarItem.INDEX} 2 787 2/Home/{PrismaticSprinklerItem.INDEX}/false/Farming {PrismaticSprinklerItem.CRAFTING_LEVEL}/{sprinklerName}"); + newDict.Add("Prismatic Sprinkler", $"{PrismaticBarItem.INDEX} 2 787 2/Home/{PrismaticSprinklerItem.INDEX}/false/Farming {PrismaticSprinklerItem.CRAFTING_LEVEL}/{this.sprinklerName}"); else newDict.Add("Prismatic Sprinkler", $"{PrismaticBarItem.INDEX} 2 787 2/Home/{PrismaticSprinklerItem.INDEX}/false/Farming {PrismaticSprinklerItem.CRAFTING_LEVEL}"); } @@ -52,12 +51,12 @@ public void Edit(IAssetData asset) { asset.AsDictionary().Data.Add(key, newDict[key]); } } else if (asset.AssetNameEquals("TileSheets\\tools")) { - asset.AsImage().PatchImage(ModEntry.toolsTexture, null, null, PatchMode.Overlay); + asset.AsImage().PatchImage(ModEntry.ToolsTexture, null, null, PatchMode.Overlay); } } - public Rectangle Rektangle(int id) { + public Rectangle GetRectangle(int id) { int x = (id % 24) * 16; int y = (id / 24) * 16; return new Rectangle(x, y, 16, 16); diff --git a/PrismaticTools/Framework/Blacksmith.cs b/PrismaticTools/Framework/Blacksmith.cs index 15f8656..55a7cf5 100644 --- a/PrismaticTools/Framework/Blacksmith.cs +++ b/PrismaticTools/Framework/Blacksmith.cs @@ -1,25 +1,24 @@ -using Microsoft.Xna.Framework.Graphics; +using System.Collections.Generic; using StardewModdingAPI.Events; using StardewValley; using StardewValley.Menus; using StardewValley.Tools; -using System.Collections.Generic; namespace PrismaticTools.Framework { - class BlacksmithInitializer { - - private static int UpgradeCost = ModEntry.Config.PrismaticToolCost; - private static int NumBars = 3; + internal class BlacksmithInitializer { + private static readonly int UpgradeCost = ModEntry.Config.PrismaticToolCost; - public static void Init() { - MenuEvents.MenuChanged += MenuEvents_MenuChanged1; + public static void Init(IModEvents events) { + events.Display.MenuChanged += OnMenuChanged; } - private static void MenuEvents_MenuChanged1(object sender, EventArgsClickableMenuChanged e) { - if (!(e.NewMenu is ShopMenu)) { + /// Raised after a game menu is opened, closed, or replaced. + /// The event sender. + /// The event arguments. + private static void OnMenuChanged(object sender, MenuChangedEventArgs e) { + if (!(e.NewMenu is ShopMenu menu)) { return; } - ShopMenu menu = e.NewMenu as ShopMenu; List categories = ModEntry.ModHelper.Reflection.GetField>(menu, "categoriesToSellHere").GetValue(); if (!categories.Contains(Object.GemCategory) || !categories.Contains(Object.mineralsCategory) || !categories.Contains(Object.metalResources)) { return; @@ -38,22 +37,22 @@ private static void MenuEvents_MenuChanged1(object sender, EventArgsClickableMen if (toolFromName1 != null && toolFromName1.UpgradeLevel == 4) { tool = new Axe { UpgradeLevel = 5 }; forSale.Add(tool); - stock.Add(tool, new int[3] { UpgradeCost, 1, PrismaticBarItem.INDEX }); + stock.Add(tool, new[] { UpgradeCost, 1, PrismaticBarItem.INDEX }); } if (toolFromName2 != null && toolFromName2.UpgradeLevel == 4) { tool = new WateringCan { UpgradeLevel = 5 }; forSale.Add(tool); - stock.Add(tool, new int[3] { UpgradeCost, 1, PrismaticBarItem.INDEX }); + stock.Add(tool, new[] { UpgradeCost, 1, PrismaticBarItem.INDEX }); } if (toolFromName3 != null && toolFromName3.UpgradeLevel == 4) { tool = new Pickaxe { UpgradeLevel = 5 }; forSale.Add(tool); - stock.Add(tool, new int[3] { UpgradeCost, 1, PrismaticBarItem.INDEX }); + stock.Add(tool, new[] { UpgradeCost, 1, PrismaticBarItem.INDEX }); } if (toolFromName4 != null && toolFromName4.UpgradeLevel == 4) { tool = new Hoe { UpgradeLevel = 5 }; forSale.Add(tool); - stock.Add(tool, new int[3] { UpgradeCost, 1, PrismaticBarItem.INDEX }); + stock.Add(tool, new[] { UpgradeCost, 1, PrismaticBarItem.INDEX }); } } } diff --git a/PrismaticTools/Framework/Furnace.cs b/PrismaticTools/Framework/Furnace.cs deleted file mode 100644 index 3f525c3..0000000 --- a/PrismaticTools/Framework/Furnace.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Harmony; -using Microsoft.Xna.Framework; -using StardewValley; - -namespace PrismaticTools.Framework { - [HarmonyPatch(typeof(Farmer), "getTallyOfObject")] - internal class PrismaticGetTallyOfObject { - static public void Postfix(ref int __result, int index, bool bigCraftable) { - if (index == 382 && !bigCraftable) { - if (__result <= 0) { - __result = 666666; - return; - } - } - } - } - - [HarmonyPatch(typeof(Object), "performObjectDropInAction")] - internal class PrismaticPerformObjectDropInAction { - - static public bool Prefix(ref Object __instance, ref bool __result, ref Item dropInItem, bool probe, Farmer who) { - if (!(dropInItem is Object)) - return false; - Object object1 = dropInItem as Object; - - if (object1.ParentSheetIndex != 74) { - return true; - } - - if (__instance.name.Equals("Furnace")) { - if (who.IsLocalPlayer && who.getTallyOfObject(382, false) == 666666) { - if (!probe && who.IsLocalPlayer) - Game1.showRedMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:Object.cs.12772")); - return false; - } - if (__instance.heldObject.Value == null && !probe) { - __instance.heldObject.Value = new Object(PrismaticBarItem.INDEX, 5, false, -1, 0); - __instance.MinutesUntilReady = 2400; - who.currentLocation.playSound("furnace"); - __instance.initializeLightSource(__instance.TileLocation, false); - __instance.showNextIndex.Value = true; - - Multiplayer multiplayer = ModEntry.ModHelper.Reflection.GetField(typeof(Game1), "multiplayer").GetValue(); - multiplayer.broadcastSprites(who.currentLocation, new TemporaryAnimatedSprite[1] { - new TemporaryAnimatedSprite(30, __instance.TileLocation * 64f + new Vector2(0.0f, -16f), Color.White, 4, false, 50f, 10, 64, (float) (((double) __instance.TileLocation.Y + 1.0) * 64.0 / 10000.0 + 9.99999974737875E-05), -1, 0) { - alphaFade = 0.005f - } - }); - for (int index = who.Items.Count - 1; index >= 0; --index) { - if (who.Items[index] is Object && (who.Items[index] as Object).ParentSheetIndex == 382) { - --who.Items[index].Stack; - if (who.Items[index].Stack <= 0) { - who.Items[index] = (Item)null; - break; - } - break; - } - } - object1.Stack -= 1; - __result = object1.Stack <= 0; - return false; - } - if (__instance.heldObject.Value == null & probe) { - if (object1.ParentSheetIndex == 74) { - __instance.heldObject.Value = new Object(); - __result = true; - return false; - } - } - } - __result = false; - return false; - } - } -} \ No newline at end of file diff --git a/PrismaticTools/Framework/PrismaticAPI.cs b/PrismaticTools/Framework/PrismaticAPI.cs index 83e2a37..dc4abcc 100644 --- a/PrismaticTools/Framework/PrismaticAPI.cs +++ b/PrismaticTools/Framework/PrismaticAPI.cs @@ -1,5 +1,5 @@ -using Microsoft.Xna.Framework; using System.Collections.Generic; +using Microsoft.Xna.Framework; namespace PrismaticTools.Framework { public class PrismaticAPI { @@ -9,10 +9,9 @@ public class PrismaticAPI { public bool ArePrismaticSprinklersScarecrows { get; } = ModEntry.Config.UseSprinklersAsScarecrows; public IEnumerable GetSprinklerCoverage(Vector2 origin) { - for (int x = -SprinklerRange; x <= SprinklerRange; x++) { - for (int y = -SprinklerRange; y <= SprinklerRange; y++) { + for (int x = -this.SprinklerRange; x <= this.SprinklerRange; x++) { + for (int y = -this.SprinklerRange; y <= this.SprinklerRange; y++) yield return new Vector2(x, y) + origin; - } } } } diff --git a/PrismaticTools/Framework/PrismaticItems.cs b/PrismaticTools/Framework/PrismaticItems.cs index cec1db7..c29c7a2 100644 --- a/PrismaticTools/Framework/PrismaticItems.cs +++ b/PrismaticTools/Framework/PrismaticItems.cs @@ -1,10 +1,8 @@ -using StardewValley; +using StardewValley; namespace PrismaticTools.Framework { - - public class PrismaticSprinklerItem { + public class PrismaticSprinklerItem { public const int INDEX = 1113; - public const int OLD_INDEX = 813; public const string NAME = "Prismatic Sprinkler"; public const int PRICE = 2000; public const int EDIBILITY = -300; @@ -16,7 +14,6 @@ public class PrismaticSprinklerItem { public class PrismaticBarItem : Object { public const int INDEX = 1112; - public const int OLD_INDEX = 812; public const string NAME = "Prismatic Bar"; public const string DESCRIPTION = "A mystical ingot forged from legend itself."; public const int PRICE = 2500; diff --git a/PrismaticTools/Framework/PrismaticPatches.cs b/PrismaticTools/Framework/PrismaticPatches.cs new file mode 100644 index 0000000..9cc8655 --- /dev/null +++ b/PrismaticTools/Framework/PrismaticPatches.cs @@ -0,0 +1,196 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Netcode; +using StardewValley; +using StardewValley.TerrainFeatures; +using StardewValley.Tools; + +namespace PrismaticTools.Framework { + internal static class PrismaticPatches { + /********* + ** Furnace patches + *********/ + public static void Farmer_GetTallyOfObject(ref int __result, int index, bool bigCraftable) { + if (index == 382 && !bigCraftable) { + if (__result <= 0) { + __result = 666666; + return; + } + } + } + + public static bool Object_PerformObjectDropInAction(ref Object __instance, ref bool __result, ref Item dropInItem, bool probe, Farmer who) { + if (!(dropInItem is Object)) + return false; + Object object1 = dropInItem as Object; + + if (object1.ParentSheetIndex != 74) { + return true; + } + + if (__instance.name.Equals("Furnace")) { + if (who.IsLocalPlayer && who.getTallyOfObject(382, false) == 666666) { + if (!probe && who.IsLocalPlayer) + Game1.showRedMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:Object.cs.12772")); + return false; + } + if (__instance.heldObject.Value == null && !probe) { + __instance.heldObject.Value = new Object(PrismaticBarItem.INDEX, 5, false, -1, 0); + __instance.MinutesUntilReady = 2400; + who.currentLocation.playSound("furnace"); + __instance.initializeLightSource(__instance.TileLocation, false); + __instance.showNextIndex.Value = true; + + Multiplayer multiplayer = ModEntry.ModHelper.Reflection.GetField(typeof(Game1), "multiplayer").GetValue(); + multiplayer.broadcastSprites(who.currentLocation, new TemporaryAnimatedSprite[1] { + new TemporaryAnimatedSprite(30, __instance.TileLocation * 64f + new Vector2(0.0f, -16f), Color.White, 4, false, 50f, 10, 64, (float) (((double) __instance.TileLocation.Y + 1.0) * 64.0 / 10000.0 + 9.99999974737875E-05), -1, 0) { + alphaFade = 0.005f + } + }); + for (int index = who.Items.Count - 1; index >= 0; --index) { + if (who.Items[index] is Object && (who.Items[index] as Object).ParentSheetIndex == 382) { + --who.Items[index].Stack; + if (who.Items[index].Stack <= 0) { + who.Items[index] = (Item)null; + break; + } + break; + } + } + object1.Stack -= 1; + __result = object1.Stack <= 0; + return false; + } + if (__instance.heldObject.Value == null & probe) { + if (object1.ParentSheetIndex == 74) { + __instance.heldObject.Value = new Object(); + __result = true; + return false; + } + } + } + __result = false; + return false; + } + + /********* + ** Sprinkler patches + *********/ + public static bool Farm_AddCrows(ref Farm __instance) { + int num1 = 0; + foreach (KeyValuePair pair in __instance.terrainFeatures.Pairs) { + if (pair.Value is HoeDirt && (pair.Value as HoeDirt).crop != null) + ++num1; + } + List vector2List = new List(); + foreach (KeyValuePair pair in __instance.objects.Pairs) { + if (pair.Value.Name.Contains("arecrow")) { + vector2List.Add(pair.Key); + } + } + int num2 = System.Math.Min(4, num1 / 16); + for (int index1 = 0; index1 < num2; ++index1) { + if (Game1.random.NextDouble() < 1.0) { + for (int index2 = 0; index2 < 10; ++index2) { + Vector2 key = __instance.terrainFeatures.Pairs.ElementAt(Game1.random.Next(__instance.terrainFeatures.Count())).Key; + if (__instance.terrainFeatures[key] is HoeDirt && (__instance.terrainFeatures[key] as HoeDirt).crop != null && ((__instance.terrainFeatures[key] as HoeDirt).crop.currentPhase.Value) > 1) { + bool flag = false; + foreach (Vector2 index3 in vector2List) { + if ((double)Vector2.Distance(index3, key) < 9.0) { + flag = true; + ++__instance.objects[index3].SpecialVariable; + break; + } + } + if (!flag) { + (__instance.terrainFeatures[key] as HoeDirt).crop = (Crop)null; + break; + } + break; + } + } + } + } + return false; + } + + /********* + ** Tool patches + *********/ + public static void Tree_PerformToolAction(ref Tree __instance, Tool t, int explosion) { + if (t is Axe axe && axe.UpgradeLevel == 5 && explosion <= 0 && ModEntry.ModHelper.Reflection.GetField(__instance, "health").GetValue() > -99f) { + __instance.health.Value = 0.0f; + } + } + + public static void FruitTree_PerformToolAction(ref FruitTree __instance, Tool t, int explosion) { + if (t is Axe axe && axe.UpgradeLevel == 5 && explosion <= 0 && ModEntry.ModHelper.Reflection.GetField(__instance, "health").GetValue() > -99f) { + __instance.health.Value = 0.0f; + } + } + + public static void Pickaxe_DoFunction(ref Pickaxe __instance, GameLocation location, int x, int y, int power, Farmer who) { + if (__instance.UpgradeLevel == 5) { + if (location.Objects.TryGetValue(new Vector2(x / 64, y / 64), out Object obj)) { + if (obj.Name == "Stone") { + obj.MinutesUntilReady = 0; + } + } + } + } + + public static void ResourceClump_PerformToolAction(ref ResourceClump __instance, Tool t, int damage, Vector2 tileLocation, GameLocation location) { + if (t is Axe && t.UpgradeLevel == 5 && (__instance.parentSheetIndex.Value == 600 || __instance.parentSheetIndex.Value == 602)) { + __instance.health.Value = 0; + } + } + + public static void Tool_TilesAffected_Postfix(ref List __result, Vector2 tileLocation, int power, Farmer who) { + if (power >= 6) { + __result.Clear(); + Vector2 direction; + Vector2 orth; + int radius = ModEntry.Config.PrismaticToolWidth; + int length = ModEntry.Config.PrismaticToolLength; + switch (who.FacingDirection) { + case 0: direction = new Vector2(0, -1); orth = new Vector2(1, 0); break; + case 1: direction = new Vector2(1, 0); orth = new Vector2(0, 1); break; + case 2: direction = new Vector2(0, 1); orth = new Vector2(-1, 0); break; + case 3: direction = new Vector2(-1, 0); orth = new Vector2(0, -1); break; + default: direction = new Vector2(0, 0); orth = new Vector2(0, 0); break; + } + for (int i = 0; i < length; i++) { + __result.Add(direction * i + tileLocation); + for (int j = 1; j <= radius; j++) { + __result.Add(direction * i + orth * j + tileLocation); + __result.Add(direction * i + orth * -j + tileLocation); + } + } + } + } + + public static bool Tool_Name(Tool __instance, ref string __result) { + if (__instance.UpgradeLevel == 5) { + + switch (__instance.BaseName) { + case "Axe": __result = ModEntry.ModHelper.Translation.Get("prismaticAxe"); break; + case "Pickaxe": __result = ModEntry.ModHelper.Translation.Get("prismaticPickaxe"); break; + case "Watering Can": __result = ModEntry.ModHelper.Translation.Get("prismaticWatercan"); break; + case "Hoe": __result = ModEntry.ModHelper.Translation.Get("prismaticHoe"); break; + } + //__result = "Prismatic " + __instance.BaseName; + //__result = ModEntry.ModHelper.Translation.Get("prismatic.prefix") + " " + Game1.content.LoadString("Strings\\StringsFromCSFiles:Axe.cs.1"); + return false; + } + return true; + } + + public static bool Tool_DisplayName(Tool __instance, ref string __result) { + if (__instance.UpgradeLevel == 5) { + __result = __instance.Name; + return false; + } + return true; + } + } +} diff --git a/PrismaticTools/Framework/Sprinkler.cs b/PrismaticTools/Framework/Sprinkler.cs index 3e520b0..635d4a1 100644 --- a/PrismaticTools/Framework/Sprinkler.cs +++ b/PrismaticTools/Framework/Sprinkler.cs @@ -1,30 +1,29 @@ -using Microsoft.Xna.Framework; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using StardewModdingAPI.Events; using StardewValley; using StardewValley.TerrainFeatures; -using StardewModdingAPI.Events; -using System.Collections.Generic; -using System.Linq; -using Harmony; -using System.Reflection.Emit; +using SObject = StardewValley.Object; namespace PrismaticTools.Framework { - // searches map for any currently placed prismatic sprinklers and: // - waters adjacent tiles // - enables light sources // - optionally makes them act as scarecrows public static class SprinklerInitializer { - - public static void Init() { - TimeEvents.AfterDayStarted += TimeEvents_AfterDayStarted; - SaveEvents.AfterLoad += SaveEvents_AfterLoad; - LocationEvents.ObjectsChanged += LocationEvents_ObjectsChanged; + public static void Init(IModEvents events) { + events.GameLoop.DayStarted += OnDayStarted; + events.GameLoop.SaveLoaded += OnSaveLoaded; + events.World.ObjectListChanged += OnObjectListChanged; } - private static void SaveEvents_AfterLoad(object sender, System.EventArgs e) { + /// Raised after the player loads a save slot and the world is initialised. + /// The event sender. + /// The event arguments. + private static void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { if (ModEntry.Config.UseSprinklersAsScarecrows) { foreach (GameLocation location in Game1.locations) { - foreach (Object obj in location.Objects.Values) { + foreach (SObject obj in location.Objects.Values) { if (obj.ParentSheetIndex == PrismaticSprinklerItem.INDEX) { obj.Name = "Prismatic Scarecrow Sprinkler"; } @@ -32,44 +31,51 @@ private static void SaveEvents_AfterLoad(object sender, System.EventArgs e) { } } - // set light source - if (!ModEntry.Config.UseSprinklersAsLamps) { - return; - } - Object sprinkler; - foreach (GameLocation location in Game1.locations) { - if (location is GameLocation) { - foreach (KeyValuePair pair in location.objects.Pairs) { - if (location.objects[pair.Key].ParentSheetIndex == PrismaticSprinklerItem.INDEX) { - sprinkler = location.objects[pair.Key]; - int id = (int)sprinkler.TileLocation.X * 4000 + (int)sprinkler.TileLocation.Y; - sprinkler.lightSource = new LightSource(4, new Vector2((sprinkler.boundingBox.X + 32), (sprinkler.boundingBox.Y + 32)), 2.0f, Color.Black, id); - location.sharedLights.Add(sprinkler.lightSource.Clone()); - } - } + // set light sources + if (ModEntry.Config.UseSprinklersAsLamps) { + foreach (GameLocation location in Game1.locations) { + foreach (KeyValuePair pair in location.objects.Pairs) + TryEnablePrismaticSprinkler(location, pair.Key, pair.Value); } } } - private static void LocationEvents_ObjectsChanged(object sender, EventArgsLocationObjectsChanged e) { - // adds lightsources to newly placed sprinkler - if (!ModEntry.Config.UseSprinklersAsLamps) { - return; + /// Raised after objects are added or removed in a location. + /// The event sender. + /// The event arguments. + private static void OnObjectListChanged(object sender, ObjectListChangedEventArgs e) { + // adds light sources to newly placed sprinklers + if (ModEntry.Config.UseSprinklersAsLamps) { + foreach (KeyValuePair pair in e.Added) + TryEnablePrismaticSprinkler(e.Location, pair.Key, pair.Value); } - foreach (KeyValuePair pair in e.Added) { - Object obj = pair.Value; - if (obj.ParentSheetIndex == PrismaticSprinklerItem.INDEX) { - int id = (int)obj.TileLocation.X * 4000 + (int)obj.TileLocation.Y; - obj.lightSource = new LightSource(4, new Vector2((obj.boundingBox.X + 32), (obj.boundingBox.Y + 32)), 2.0f, Color.Black, id); - obj.Name = "Prismatic Scarecrow Sprinkler"; - Game1.currentLocation.sharedLights.Add(obj.lightSource.Clone()); - } + } + + /// Try to add the light source for a prismatic sprinkler, if applicable. + /// The location containing the sprinkler. + /// The sprinkler's tile coordinate within the location. + /// The object to check. + private static void TryEnablePrismaticSprinkler(GameLocation location, Vector2 tile, SObject obj) { + if (obj.ParentSheetIndex != PrismaticSprinklerItem.INDEX || !ModEntry.Config.UseSprinklersAsLamps) + return; + + // set name + obj.Name = "Prismatic Scarecrow Sprinkler"; + + // add light source + int id = (int)tile.X * 4000 + (int)tile.Y; + if (!location.sharedLights.ContainsKey(id)) { + obj.lightSource = new LightSource(4, tile * Game1.tileSize, 2.0f, Color.Black, id); + location.sharedLights.Add(id, obj.lightSource); } } - private static void TimeEvents_AfterDayStarted(object sender, System.EventArgs e) { + /// Raised after the game begins a new day (including when the player loads a save). + /// The event sender. + /// The event arguments. + private static void OnDayStarted(object sender, DayStartedEventArgs e) { foreach (GameLocation location in Game1.locations) { - foreach (Object obj in location.Objects.Values) { + foreach (SObject obj in location.Objects.Values) { if (obj.ParentSheetIndex == PrismaticSprinklerItem.INDEX) { // add water spray animation @@ -96,47 +102,5 @@ private static void TimeEvents_AfterDayStarted(object sender, System.EventArgs e } } } - - [HarmonyPatch(typeof(Farm), "addCrows")] - internal class PrismaticAddCrows { - static public bool Prefix(ref Farm __instance) { - int num1 = 0; - foreach (KeyValuePair pair in __instance.terrainFeatures.Pairs) { - if (pair.Value is HoeDirt && (pair.Value as HoeDirt).crop != null) - ++num1; - } - List vector2List = new List(); - foreach (KeyValuePair pair in __instance.objects.Pairs) { - if (pair.Value.Name.Contains("arecrow")) { - vector2List.Add(pair.Key); - } - } - int num2 = System.Math.Min(4, num1 / 16); - for (int index1 = 0; index1 < num2; ++index1) { - if (Game1.random.NextDouble() < 1.0) { - for (int index2 = 0; index2 < 10; ++index2) { - Vector2 key = __instance.terrainFeatures.Pairs.ElementAt(Game1.random.Next(__instance.terrainFeatures.Count())).Key; - if (__instance.terrainFeatures[key] is HoeDirt && (__instance.terrainFeatures[key] as HoeDirt).crop != null && ((__instance.terrainFeatures[key] as HoeDirt).crop.currentPhase.Value) > 1) { - bool flag = false; - foreach (Vector2 index3 in vector2List) { - if ((double)Vector2.Distance(index3, key) < 9.0) { - flag = true; - ++__instance.objects[index3].SpecialVariable; - break; - } - } - if (!flag) { - (__instance.terrainFeatures[key] as HoeDirt).crop = (Crop)null; - break; - } - break; - } - } - } - } - return false; - } - } } } - diff --git a/PrismaticTools/Framework/Tools.cs b/PrismaticTools/Framework/Tools.cs deleted file mode 100644 index 2f8e3b8..0000000 --- a/PrismaticTools/Framework/Tools.cs +++ /dev/null @@ -1,108 +0,0 @@ -using Harmony; -using System.Collections.Generic; -using StardewValley; -using Microsoft.Xna.Framework; - -using StardewValley.TerrainFeatures; -using Netcode; -using StardewValley.Tools; - -namespace PrismaticTools.Framework { - - [HarmonyPatch(typeof(Tree), "performToolAction")] - internal class PrismaticPerformToolActionTree { - static void Prefix(ref Tree __instance, Tool t, int explosion) { - if (t is Axe && (t as Axe).UpgradeLevel == 5 && explosion <= 0 && ModEntry.ModHelper.Reflection.GetField(__instance, "health").GetValue() > -99f) { - __instance.health.Value = 0.0f; - } - } - } - - [HarmonyPatch(typeof(FruitTree), "performToolAction")] - internal class PrismaticPerformToolActionFruitTree { - static void Prefix(ref FruitTree __instance, Tool t, int explosion) { - if (t is Axe && (t as Axe).UpgradeLevel == 5 && explosion <= 0 && ModEntry.ModHelper.Reflection.GetField(__instance, "health").GetValue() > -99f) { - __instance.health.Value = 0.0f; - } - } - } - - [HarmonyPatch(typeof(Pickaxe), "DoFunction")] - internal class PrimaticDoFunction { - static void Prefix(ref Pickaxe __instance, GameLocation location, int x, int y, int power, Farmer who) { - if (__instance.UpgradeLevel == 5) { - if (location.Objects.TryGetValue(new Vector2(x/64, y/64), out Object obj)) { - if (obj.Name == "Stone") { - obj.MinutesUntilReady = 0; - } - } - } - } - } - - [HarmonyPatch(typeof(ResourceClump), "performToolAction")] - internal class PrismaticPerformToolActionResourceClump { - static void Prefix(ref ResourceClump __instance, Tool t, int damage, Vector2 tileLocation, GameLocation location) { - if (t is Axe && t.UpgradeLevel == 5 && (__instance.parentSheetIndex.Value == 600 || __instance.parentSheetIndex.Value == 602)) { - __instance.health.Value = 0; - } - } - } - - [HarmonyPatch(typeof(Tool), "tilesAffected")] - internal class PrismaticTilesAffected { - static void Postfix(ref List __result, Vector2 tileLocation, int power, Farmer who) { - if (power >= 6) { - __result.Clear(); - Vector2 direction; - Vector2 orth; - int radius = ModEntry.Config.PrismaticToolWidth; - int length = ModEntry.Config.PrismaticToolLength; - switch (who.FacingDirection) { - case 0: direction = new Vector2(0, -1); orth = new Vector2(1, 0); break; - case 1: direction = new Vector2(1, 0); orth = new Vector2(0, 1); break; - case 2: direction = new Vector2(0, 1); orth = new Vector2(-1, 0); break; - case 3: direction = new Vector2(-1, 0); orth = new Vector2(0, -1); break; - default: direction = new Vector2(0, 0); orth = new Vector2(0, 0); break; - } - for (int i = 0; i < length; i++) { - __result.Add(direction * i + tileLocation); - for (int j = 1; j <= radius; j++) { - __result.Add(direction * i + orth * j + tileLocation); - __result.Add(direction * i + orth * -j + tileLocation); - } - } - } - } - } - - [HarmonyPatch(typeof(Tool), "get_Name")] - internal class PrismaticGetName { - public static bool Prefix(Tool __instance, ref string __result) { - if (__instance.UpgradeLevel == 5) { - - switch (__instance.BaseName) { - case "Axe": __result = ModEntry.ModHelper.Translation.Get("prismaticAxe"); break; - case "Pickaxe": __result = ModEntry.ModHelper.Translation.Get("prismaticPickaxe"); break; - case "Watering Can": __result = ModEntry.ModHelper.Translation.Get("prismaticWatercan"); break; - case "Hoe": __result = ModEntry.ModHelper.Translation.Get("prismaticHoe"); break; - } - //__result = "Prismatic " + __instance.BaseName; - //__result = ModEntry.ModHelper.Translation.Get("prismatic.prefix") + " " + Game1.content.LoadString("Strings\\StringsFromCSFiles:Axe.cs.1"); - return false; - } - return true; - } - } - - [HarmonyPatch(typeof(Tool), "get_DisplayName")] - internal static class CobaltDisplayNameHook { - public static bool Prefix(Tool __instance, ref string __result) { - if (__instance.UpgradeLevel == 5) { - __result = __instance.Name; - return false; - } - return true; - } - } -} diff --git a/PrismaticTools/ModConfig.cs b/PrismaticTools/ModConfig.cs index 6affd87..6f7efbb 100644 --- a/PrismaticTools/ModConfig.cs +++ b/PrismaticTools/ModConfig.cs @@ -1,20 +1,10 @@ - namespace PrismaticTools.Framework { public class ModConfig { - public bool UseSprinklersAsScarecrows { get; set; } - public bool UseSprinklersAsLamps { get; set; } - public int SprinklerRange { get; set; } - public int PrismaticToolLength { get; set; } - public int PrismaticToolWidth { get; set; } - public int PrismaticToolCost { get; set; } - - public ModConfig() { - UseSprinklersAsScarecrows = true; - UseSprinklersAsLamps = true; - SprinklerRange = 3; - PrismaticToolLength = 7; - PrismaticToolWidth = 2; - PrismaticToolCost = 100000; - } + public bool UseSprinklersAsScarecrows { get; set; } = true; + public bool UseSprinklersAsLamps { get; set; } = true; + public int SprinklerRange { get; set; } = 3; + public int PrismaticToolLength { get; set; } = 7; + public int PrismaticToolWidth { get; set; } = 2; + public int PrismaticToolCost { get; set; } = 100000; } } diff --git a/PrismaticTools/ModEntry.cs b/PrismaticTools/ModEntry.cs index 658c927..4c5d67b 100644 --- a/PrismaticTools/ModEntry.cs +++ b/PrismaticTools/ModEntry.cs @@ -1,73 +1,119 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System.Reflection; - +using System.Collections.Generic; using Harmony; -using StardewValley; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using PrismaticTools.Framework; using StardewModdingAPI; using StardewModdingAPI.Events; - -using PrismaticTools.Framework; -using System.Collections.Generic; -using StardewValley.Objects; -using StardewValley.Locations; +using StardewValley; +using StardewValley.TerrainFeatures; using StardewValley.Tools; namespace PrismaticTools { - public class ModEntry : Mod { - - public static IMonitor mon; public static IModHelper ModHelper; public static ModConfig Config; + public static Texture2D ToolsTexture; - public static Texture2D toolsTexture; - private int colorCycleIndex = 0; - private List colors = new List(); + private int colorCycleIndex; + private readonly List colors = new List(); public override void Entry(IModHelper helper) { - mon = Monitor; ModHelper = helper; - Config = Helper.ReadConfig(); + Config = this.Helper.ReadConfig(); - toolsTexture = ModHelper.Content.Load("Assets/tools.png", ContentSource.ModFolder); + ToolsTexture = ModHelper.Content.Load("Assets/tools.png"); - helper.ConsoleCommands.Add("ptools", "Upgrade all tools to prismatic", UpgradeTools); + helper.ConsoleCommands.Add("ptools", "Upgrade all tools to prismatic", this.UpgradeTools); - SaveEvents.AfterLoad += SaveEvents_AfterLoad; - PlayerEvents.InventoryChanged += PlayerEvents_InventoryChanged; - GameEvents.EighthUpdateTick += GameEvents_EighthUpdateTick; + helper.Events.GameLoop.SaveLoaded += this.OnSaveLoaded; + helper.Events.GameLoop.UpdateTicked += this.OnUpdateTicked; + helper.Events.Player.InventoryChanged += this.OnInventoryChanged; helper.Content.AssetEditors.Add(new AssetEditor()); - SprinklerInitializer.Init(); - BlacksmithInitializer.Init(); + SprinklerInitializer.Init(helper.Events); + BlacksmithInitializer.Init(helper.Events); - InitColors(); + this.InitColors(); var harmony = HarmonyInstance.Create("stokastic.PrismaticTools"); - harmony.PatchAll(Assembly.GetExecutingAssembly()); + this.ApplyPatches(harmony); + } + + private void ApplyPatches(HarmonyInstance harmony) { + // furnaces + harmony.Patch( + original: AccessTools.Method(typeof(Farmer), nameof(Farmer.getTallyOfObject)), + prefix: new HarmonyMethod(typeof(PrismaticPatches), nameof(PrismaticPatches.Farmer_GetTallyOfObject)) + ); + harmony.Patch( + original: AccessTools.Method(typeof(Object), nameof(Object.performObjectDropInAction)), + prefix: new HarmonyMethod(typeof(PrismaticPatches), nameof(PrismaticPatches.Object_PerformObjectDropInAction)) + ); + + // sprinklers + harmony.Patch( + original: AccessTools.Method(typeof(Farm), nameof(Farm.addCrows)), + prefix: new HarmonyMethod(typeof(PrismaticPatches), nameof(PrismaticPatches.Farm_AddCrows)) + ); + + // tools + harmony.Patch( + original: AccessTools.Method(typeof(Tree), nameof(Tree.performToolAction)), + prefix: new HarmonyMethod(typeof(PrismaticPatches), nameof(PrismaticPatches.Tree_PerformToolAction)) + ); + harmony.Patch( + original: AccessTools.Method(typeof(FruitTree), nameof(FruitTree.performToolAction)), + prefix: new HarmonyMethod(typeof(PrismaticPatches), nameof(PrismaticPatches.FruitTree_PerformToolAction)) + ); + harmony.Patch( + original: AccessTools.Method(typeof(Pickaxe), nameof(Pickaxe.DoFunction)), + prefix: new HarmonyMethod(typeof(PrismaticPatches), nameof(PrismaticPatches.Pickaxe_DoFunction)) + ); + harmony.Patch( + original: AccessTools.Method(typeof(ResourceClump), nameof(ResourceClump.performToolAction)), + prefix: new HarmonyMethod(typeof(PrismaticPatches), nameof(PrismaticPatches.ResourceClump_PerformToolAction)) + ); + harmony.Patch( + original: AccessTools.Method(typeof(Tool), "tilesAffected"), + postfix: new HarmonyMethod(typeof(PrismaticPatches), nameof(PrismaticPatches.Tool_TilesAffected_Postfix)) + ); + harmony.Patch( + original: AccessTools.Property(typeof(Tool), nameof(Tool.Name)).GetMethod, + prefix: new HarmonyMethod(typeof(PrismaticPatches), nameof(PrismaticPatches.Tool_Name)) + ); + harmony.Patch( + original: AccessTools.Property(typeof(Tool), nameof(Tool.DisplayName)).GetMethod, + prefix: new HarmonyMethod(typeof(PrismaticPatches), nameof(PrismaticPatches.Tool_DisplayName)) + ); } - private void GameEvents_EighthUpdateTick(object sender, System.EventArgs e) { + /// Raised after the game state is updated (≈60 times per second). + /// The event sender. + /// The event arguments. + private void OnUpdateTicked(object sender, UpdateTickedEventArgs e) { + if (!e.IsMultipleOf(8)) + return; + Farmer farmer = Game1.player; Item item; try { item = farmer.Items[farmer.CurrentToolIndex]; - } catch (System.ArgumentOutOfRangeException) { + } catch (System.ArgumentOutOfRangeException) { return; } - if (item == null || !(item is Object) || !((item as Object).ParentSheetIndex == PrismaticBarItem.INDEX)) { + if (!(item is Object obj) || obj.ParentSheetIndex != PrismaticBarItem.INDEX) { return; } - for (int i=0; iRaised after items are added or removed to a player's inventory. + /// The event sender. + /// The event arguments. + private void OnInventoryChanged(object sender, InventoryChangedEventArgs e) { + if (e.IsLocalPlayer) + this.AddLightsToInventoryItems(); } - private void SaveEvents_AfterLoad(object sender, System.EventArgs e) { + /// Raised after the player loads a save slot and the world is initialised. + /// The event sender. + /// The event arguments. + private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { // force add sprinkler recipe for people who were level 10 before installing mod if (Game1.player.FarmingLevel >= PrismaticSprinklerItem.CRAFTING_LEVEL) { try { @@ -110,73 +163,13 @@ private void SaveEvents_AfterLoad(object sender, System.EventArgs e) { } catch { } } - IndexCompatibilityFix(); - AddLightsToInventoryItems(); - } - - // used to resolve asset conflicts with other mods - private void IndexCompatibilityFix() { - var watch = System.Diagnostics.Stopwatch.StartNew(); - foreach (GameLocation location in Game1.locations) { - if (location is FarmHouse) { - // check fridge - if ((location as FarmHouse).fridge.Value != null) { - foreach (Item item in (location as FarmHouse).fridge.Value.items) { - if (item == null) { - continue; - } - if (item.Name.Contains("Prismatic")) { - SwapIndex(item); - } - } - } - } - foreach (Object obj in location.Objects.Values) { - // check chests, signposts, furnaces, and placed sprinklers - if (obj == null) { - continue; - } - - if (obj is Chest) { - foreach (Item item in (obj as Chest).items) { - if (item.Name.Contains("Prismatic")) { - SwapIndex(item); - } - } - } else if (obj is Sign) { - SwapIndex((obj as Sign).displayItem.Value); - } else if (obj.bigCraftable.Value && obj.name.Equals("Furnace")) { - if (obj.heldObject.Value != null) { - SwapIndex((obj.heldObject.Value)); - } - } else if (obj.ParentSheetIndex == PrismaticBarItem.OLD_INDEX || obj.ParentSheetIndex == PrismaticSprinklerItem.OLD_INDEX) { - SwapIndex(obj); - } - } - } - - foreach (Item item in Game1.player.Items) { - if (item != null && item.Name.Contains("Prismatic")) { - SwapIndex(item); - } - } - watch.Stop(); - Monitor.Log($"IndexCompatibility exec time: {watch.ElapsedMilliseconds} ms", LogLevel.Trace); - } - - private void SwapIndex(Item item) { - if (item.ParentSheetIndex == PrismaticBarItem.OLD_INDEX) { - item.ParentSheetIndex = PrismaticBarItem.INDEX; - } - if (item.ParentSheetIndex == PrismaticSprinklerItem.OLD_INDEX) { - item.ParentSheetIndex = PrismaticSprinklerItem.INDEX; - } + this.AddLightsToInventoryItems(); } private void InitColors() { int n = 24; - for(int i=0; iPrismaticTools v4.5 512 - - true @@ -54,9 +52,10 @@ - - .\0Harmony.dll - + + + + @@ -69,32 +68,19 @@ - + - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - + + + + Always @@ -107,16 +93,6 @@ Always - - PreserveNewest - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - \ No newline at end of file diff --git a/PrismaticTools/i18n/de.json b/PrismaticTools/i18n/de.json index 50be3e0..8197c9d 100644 --- a/PrismaticTools/i18n/de.json +++ b/PrismaticTools/i18n/de.json @@ -1,11 +1,11 @@ -{ - "prismatic.prefix": "Prismatische", - "prismaticBar.name": "Prismatischer Barren", - "prismaticBar.description": "Ein mystischer Barren, der aus der Legende selbst geschmiedet wurde.", - "prismaticHoe": "Prismatische Hacke", - "prismaticWatercan": "Prismatische Gießkanne", - "prismaticPickaxe": "Prismatische Spitzhacke", - "prismaticAxe": "Prismatische Axt", - "prismaticSprinkler.name": "Prismatischer Sprinkler", - "prismaticSprinkler.description": "Bewässert jeden Morgen 48 Felder um sich herum.", -} \ No newline at end of file +{ + "prismatic.prefix": "Prismatische", + "prismaticBar.name": "Prismatischer Barren", + "prismaticBar.description": "Ein mystischer Barren, der aus der Legende selbst geschmiedet wurde.", + "prismaticHoe": "Prismatische Hacke", + "prismaticWatercan": "Prismatische Gießkanne", + "prismaticPickaxe": "Prismatische Spitzhacke", + "prismaticAxe": "Prismatische Axt", + "prismaticSprinkler.name": "Prismatischer Sprinkler", + "prismaticSprinkler.description": "Bewässert jeden Morgen 48 Felder um sich herum.", +} diff --git a/PrismaticTools/i18n/default.json b/PrismaticTools/i18n/default.json index 2bd55da..f17c5d2 100644 --- a/PrismaticTools/i18n/default.json +++ b/PrismaticTools/i18n/default.json @@ -1,11 +1,11 @@ -{ - "prismatic.prefix": "Prismatic", - "prismaticBar.name": "Prismatic Bar", - "prismaticBar.description": "A mystical ingot forged from legend itself.", - "prismaticHoe": "Prismatic Hoe", - "prismaticWatercan": "Prismatic Watering Can", - "prismaticPickaxe": "Prismatic Pickaxe", - "prismaticAxe": "Prismatic Axe", - "prismaticSprinkler.name": "Prismatic Sprinkler", - "prismaticSprinkler.description": "Waters the 48 adjacenet tiles every morning.", -} \ No newline at end of file +{ + "prismatic.prefix": "Prismatic", + "prismaticBar.name": "Prismatic Bar", + "prismaticBar.description": "A mystical ingot forged from legend itself.", + "prismaticHoe": "Prismatic Hoe", + "prismaticWatercan": "Prismatic Watering Can", + "prismaticPickaxe": "Prismatic Pickaxe", + "prismaticAxe": "Prismatic Axe", + "prismaticSprinkler.name": "Prismatic Sprinkler", + "prismaticSprinkler.description": "Waters the 48 adjacenet tiles every morning.", +} diff --git a/PrismaticTools/i18n/zh.json b/PrismaticTools/i18n/zh.json index 1d69964..02589c4 100644 --- a/PrismaticTools/i18n/zh.json +++ b/PrismaticTools/i18n/zh.json @@ -1,11 +1,11 @@ -{ - "prismatic.prefix": "五彩", - "prismaticBar.name": "五彩锭", - "prismaticBar.description": "一个神秘的铸锭,传说是由五彩碎片锻造而成的。", - "prismaticHoe": "五彩锄头", - "prismaticWatercan": "五彩水壶", - "prismaticPickaxe": "五彩镐", - "prismaticAxe": "五彩斧", - "prismaticSprinkler.name": "五彩洒水器", - "prismaticSprinkler.description": "每天早晨自动给附近的48块地浇水。", -} \ No newline at end of file +{ + "prismatic.prefix": "五彩", + "prismaticBar.name": "五彩锭", + "prismaticBar.description": "一个神秘的铸锭,传说是由五彩碎片锻造而成的。", + "prismaticHoe": "五彩锄头", + "prismaticWatercan": "五彩水壶", + "prismaticPickaxe": "五彩镐", + "prismaticAxe": "五彩斧", + "prismaticSprinkler.name": "五彩洒水器", + "prismaticSprinkler.description": "每天早晨自动给附近的48块地浇水。", +} diff --git a/PrismaticTools/manifest.json b/PrismaticTools/manifest.json index 02cbf0e..ae6debc 100644 --- a/PrismaticTools/manifest.json +++ b/PrismaticTools/manifest.json @@ -1,10 +1,10 @@ -{ - "Name": "PrismaticTools", - "Author": "stokastic", - "Version": "1.7.0", - "Description": "Adds prismatic tools and sprinklers to the game.", - "UniqueID": "stokastic.PrismaticTools", - "EntryDll": "PrismaticTools.dll", - "MinimumApiVersion": "2.7", - "UpdateKeys": [ "Nexus:2428" ] -} \ No newline at end of file +{ + "Name": "Prismatic Tools", + "Author": "stokastic", + "Version": "1.7.1", + "Description": "Adds prismatic tools and sprinklers to the game.", + "UniqueID": "stokastic.PrismaticTools", + "EntryDll": "PrismaticTools.dll", + "MinimumApiVersion": "2.10.1", + "UpdateKeys": [ "Nexus:2428" ] +} diff --git a/PrismaticTools/packages.config b/PrismaticTools/packages.config deleted file mode 100644 index d798813..0000000 --- a/PrismaticTools/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file