commit 98cb63b6fb73335b018192295bbf2ffbccf818a6 Author: ZaneYork Date: Thu Apr 2 22:30:19 2020 +0800 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a9fea54 --- /dev/null +++ b/.gitignore @@ -0,0 +1,254 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +packages/ +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml +**/*.vshistory/ diff --git a/CustomToolEffect.sln b/CustomToolEffect.sln new file mode 100644 index 0000000..bf39bd8 --- /dev/null +++ b/CustomToolEffect.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29911.84 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomToolEffect", "CustomToolEffect\CustomToolEffect.csproj", "{62DD1937-1AFD-4EB9-B5E6-F1C0A9860A33}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {62DD1937-1AFD-4EB9-B5E6-F1C0A9860A33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {62DD1937-1AFD-4EB9-B5E6-F1C0A9860A33}.Debug|Any CPU.Build.0 = Debug|Any CPU + {62DD1937-1AFD-4EB9-B5E6-F1C0A9860A33}.Release|Any CPU.ActiveCfg = Release|Any CPU + {62DD1937-1AFD-4EB9-B5E6-F1C0A9860A33}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4CC46A6E-AED6-4BEF-AF97-D50E81BE8A37} + EndGlobalSection +EndGlobal diff --git a/CustomToolEffect/CustomToolEffect.csproj b/CustomToolEffect/CustomToolEffect.csproj new file mode 100644 index 0000000..fb25ed0 --- /dev/null +++ b/CustomToolEffect/CustomToolEffect.csproj @@ -0,0 +1,63 @@ + + + + + Debug + AnyCPU + {62DD1937-1AFD-4EB9-B5E6-F1C0A9860A33} + Library + Properties + CustomToolEffect + CustomToolEffect + v4.5.2 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x86 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\libs\0Harmony.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CustomToolEffect/ModConfig.cs b/CustomToolEffect/ModConfig.cs new file mode 100644 index 0000000..bdb5d36 --- /dev/null +++ b/CustomToolEffect/ModConfig.cs @@ -0,0 +1,68 @@ +using Microsoft.Xna.Framework; +using System.Collections.Generic; + +namespace CustomToolEffect +{ + public class ModConfig + { + public Dictionary AxeDefine { get; set; } = new Dictionary { + {0, new PowerDefine(1.4f) }, + {1, new PowerDefine(1.4f) }, + {2, new PowerDefine(1.4f) }, + {3, new PowerDefine(1.4f) }, + {4, new PowerDefine(1.4f) } + }; + public Dictionary PickaxeDefine { get; set; } = new Dictionary + { + {0, new PowerDefine(1.4f) }, + {1, new PowerDefine(1.4f) }, + {2, new PowerDefine(1.4f) }, + {3, new PowerDefine(1.4f) }, + {4, new PowerDefine(1.8f) } + }; + public Dictionary HoeDefine { get; set; } = new Dictionary + { + {0, new RangeDefine(new Range(1, 1)) }, + {1, new RangeDefine(new Range(1, 3)) }, + {2, new RangeDefine(new Range(1, 5)) }, + {3, new RangeDefine(new Range(3, 3)) }, + {4, new RangeDefine(new Range(5, 5)) } + }; + public Dictionary WateringCanDefine { get; set; } = new Dictionary + { + {0, new RangeDefine(new Range(1, 1)) }, + {1, new RangeDefine(new Range(1, 3)) }, + {2, new RangeDefine(new Range(1, 5)) }, + {3, new RangeDefine(new Range(3, 3)) }, + {4, new RangeDefine(new Range(5, 5)) } + }; + public class PowerDefine + { + public PowerDefine(float power) + { + Power = power; + } + public float Power { get; set; } + } + + public class RangeDefine + { + public RangeDefine(Range range) + { + Range = range; + } + public Range Range { get; set; } + } + public class Range + { + public Range(int width, int length) + { + Width = width; + Length = length; + } + + public int Length { get; set; } + public int Width { get; set; } + } + } +} diff --git a/CustomToolEffect/ModEntry.cs b/CustomToolEffect/ModEntry.cs new file mode 100644 index 0000000..5274b60 --- /dev/null +++ b/CustomToolEffect/ModEntry.cs @@ -0,0 +1,40 @@ +using Harmony; +using StardewModdingAPI; +using StardewModdingAPI.Mods.CustomLocalization.Rewrites; +using StardewValley; +using StardewValley.TerrainFeatures; +using StardewValley.Tools; + +namespace CustomToolEffect +{ + public class ModEntry : Mod + { + public static ModConfig ModConfig; + public override void Entry(IModHelper helper) + { + ModConfig = helper.ReadConfig(); + helper.WriteConfig(ModConfig); + HarmonyInstance harmony = HarmonyInstance.Create("zaneyork.CustomToolEffect"); + harmony.Patch( + original: AccessTools.DeclaredMethod(typeof(Tree), "performToolAction"), + prefix: new HarmonyMethod(typeof(TreeRewrites.PerformToolActionRewrite), nameof(TreeRewrites.PerformToolActionRewrite.Prefix)) + ); + harmony.Patch( + original: AccessTools.DeclaredMethod(typeof(FruitTree), "performToolAction"), + prefix: new HarmonyMethod(typeof(FruitTreeRewrites.PerformToolActionRewrite), nameof(FruitTreeRewrites.PerformToolActionRewrite.Prefix)) + ); + harmony.Patch( + original: AccessTools.DeclaredMethod(typeof(ResourceClump), "performToolAction"), + prefix: new HarmonyMethod(typeof(ResourceClumpRewrites.PerformToolActionRewrite), nameof(ResourceClumpRewrites.PerformToolActionRewrite.Prefix)) + ); + harmony.Patch( + original: AccessTools.DeclaredMethod(typeof(Pickaxe), "DoFunction"), + prefix: new HarmonyMethod(typeof(PickaxeRewrites.DoFunctionRewrite), nameof(PickaxeRewrites.DoFunctionRewrite.Prefix)) + ); + harmony.Patch( + original: AccessTools.DeclaredMethod(typeof(Tool), "tilesAffected"), + prefix: new HarmonyMethod(typeof(ToolRewrites.TilesAffectedRewrite), nameof(ToolRewrites.TilesAffectedRewrite.Prefix)) + ); + } + } +} diff --git a/CustomToolEffect/Properties/AssemblyInfo.cs b/CustomToolEffect/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..358b07f --- /dev/null +++ b/CustomToolEffect/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CustomToolEffect")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CustomToolEffect")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("bb1441d3-a7e3-48e3-9c86-34798cd71313")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/CustomToolEffect/Rewrites/FruitRewrites.cs b/CustomToolEffect/Rewrites/FruitRewrites.cs new file mode 100644 index 0000000..70ee3d1 --- /dev/null +++ b/CustomToolEffect/Rewrites/FruitRewrites.cs @@ -0,0 +1,51 @@ +using CustomToolEffect; +using Harmony; +using Microsoft.Xna.Framework; +using StardewValley; +using StardewValley.TerrainFeatures; +using StardewValley.Tools; + +namespace StardewModdingAPI.Mods.CustomLocalization.Rewrites +{ + public class TreeRewrites + { + public class PerformToolActionRewrite + { + public static bool Prefix(Tree __instance, Tool t, int explosion, Vector2 tileLocation) + { + if (t == null || !(t is Axe) || explosion > 0) + return true; + float num; + switch (t.UpgradeLevel) + { + case 0: + num = 1f; + break; + case 1: + num = 1.25f; + break; + case 2: + num = 1.67f; + break; + case 3: + num = 2.5f; + break; + case 4: + num = 5f; + break; + default: + num = 5f; + break; + } + if (__instance.growthStage.Value >= 3) { + num *= 2; + } + if(ModEntry.ModConfig.AxeDefine.TryGetValue(t.UpgradeLevel, out ModConfig.ToolDefine define)) + { + __instance.health.Value -= num + define.Power; + } + return true; + } + } + } +} diff --git a/CustomToolEffect/Rewrites/FruitTreeRewrites.cs b/CustomToolEffect/Rewrites/FruitTreeRewrites.cs new file mode 100644 index 0000000..fd52e32 --- /dev/null +++ b/CustomToolEffect/Rewrites/FruitTreeRewrites.cs @@ -0,0 +1,53 @@ +using CustomToolEffect; +using Microsoft.Xna.Framework; +using StardewValley; +using StardewValley.TerrainFeatures; +using StardewValley.Tools; + +namespace StardewModdingAPI.Mods.CustomLocalization.Rewrites +{ + public class FruitTreeRewrites + { + public class PerformToolActionRewrite + { + public static void Prefix(FruitTree __instance, Tool t, int explosion, Vector2 tileLocation) + { + if (t == null || !(t is Axe) || explosion > 0) + return; + float num; + switch (t.UpgradeLevel) + { + case 0: + num = 1f; + break; + case 1: + num = 1.25f; + break; + case 2: + num = 1.67f; + break; + case 3: + num = 2.5f; + break; + case 4: + num = 5f; + break; + default: + num = 5f; + break; + } + if (__instance.growthStage.Value >= 3) { + num *= 2; + } + if(ModEntry.ModConfig.AxeDefine.TryGetValue(t.UpgradeLevel, out ModConfig.PowerDefine define)) + { + if (define.Power < 0) + { + define.Power = 1f; + } + __instance.health.Value -= num * (define.Power - 1); + } + } + } + } +} diff --git a/CustomToolEffect/Rewrites/PickaxeRewrites.cs b/CustomToolEffect/Rewrites/PickaxeRewrites.cs new file mode 100644 index 0000000..75338fa --- /dev/null +++ b/CustomToolEffect/Rewrites/PickaxeRewrites.cs @@ -0,0 +1,30 @@ +using CustomToolEffect; +using Microsoft.Xna.Framework; +using StardewValley; +using StardewValley.Tools; +using System; +using SObject = StardewValley.Object; + +namespace StardewModdingAPI.Mods.CustomLocalization.Rewrites +{ + public class PickaxeRewrites + { + public class DoFunctionRewrite + { + public static void Prefix(Pickaxe __instance, GameLocation location, int x, int y, int power, Farmer who) + { + if (!ModEntry.ModConfig.PickaxeDefine.TryGetValue(__instance.UpgradeLevel, out ModConfig.PowerDefine define)) { + return; + } + if (location.Objects.TryGetValue(new Vector2(x / 0x40, y / 0x40), out SObject obj)) + { + if (obj.Name == "Stone") + { + int num = Math.Max(1, __instance.UpgradeLevel + 1); + obj.MinutesUntilReady -= (int)(num * (define.Power - 1)); + } + } + } + } + } +} diff --git a/CustomToolEffect/Rewrites/ResourceClumpRewrites.cs b/CustomToolEffect/Rewrites/ResourceClumpRewrites.cs new file mode 100644 index 0000000..fc79fb5 --- /dev/null +++ b/CustomToolEffect/Rewrites/ResourceClumpRewrites.cs @@ -0,0 +1,86 @@ +using CustomToolEffect; +using Microsoft.Xna.Framework; +using StardewValley; +using StardewValley.TerrainFeatures; +using StardewValley.Tools; +using System; + +namespace StardewModdingAPI.Mods.CustomLocalization.Rewrites +{ + public class ResourceClumpRewrites + { + public class PerformToolActionRewrite + { + public static void Prefix(ResourceClump __instance, Tool t, int damage, Vector2 tileLocation, GameLocation location) + { + if (t == null || !(t is Axe || t is Pickaxe)) + return;; + switch (__instance.parentSheetIndex.Value) + { + case 0x2f0: + case 0x2f2: + case 0x2f4: + case 0x2f6: + if (t is Pickaxe) + { + break; + } + return;; + + case 0x2a0: + if ((t is Pickaxe) && (t.UpgradeLevel < 2)) + { + return;; + } + if (!(t is Pickaxe)) + { + return;; + } + break; + + case 0x26e: + if ((t is Pickaxe) && (t.UpgradeLevel < 3)) + { + return;; + } + if (!(t is Pickaxe)) + { + return;; + } + break; + + case 600: + if ((t is Axe) && (t.UpgradeLevel < 1)) + { + return;; + } + if (!(t is Axe)) + { + return;; + } + break; + + case 0x25a: + if ((t is Axe) && (t.UpgradeLevel < 2)) + { + return;; + } + if (!(t is Axe)) + { + return;; + } + break; + } + float num = Math.Max((float)1f, (float)(((float)(t.UpgradeLevel + 1)) * 0.75f)); + if(ModEntry.ModConfig.AxeDefine.TryGetValue(t.UpgradeLevel, out ModConfig.PowerDefine define)) + { + if (define.Power < 0) + { + define.Power = 1f; + } + __instance.health.Value -= num * (define.Power - 1); + } + } + } + } +} diff --git a/CustomToolEffect/Rewrites/ToolRewrites.cs b/CustomToolEffect/Rewrites/ToolRewrites.cs new file mode 100644 index 0000000..e015717 --- /dev/null +++ b/CustomToolEffect/Rewrites/ToolRewrites.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using CustomToolEffect; +using Microsoft.Xna.Framework; +using StardewValley; +using StardewValley.Tools; +using static CustomToolEffect.ModConfig; + +namespace StardewModdingAPI.Mods.CustomLocalization.Rewrites +{ + public class ToolRewrites + { + public class TilesAffectedRewrite + { + public static bool Prefix(Tool __instance, Vector2 tileLocation, int power, Farmer who, ref List __result) + { + ModConfig.RangeDefine define = null; + if (__instance is Hoe) + { + ModEntry.ModConfig.HoeDefine.TryGetValue(power, out define); + } + else if (__instance is WateringCan) + { + ModEntry.ModConfig.WateringCanDefine.TryGetValue(power, out define); + } + if (define == null) + { + return true; + } + Range range = define.Range; + __result = new List { + tileLocation + }; + Vector2 directionLength, directionWidth; + switch (who.FacingDirection) + { + case 0: + directionLength = new Vector2(0f, -1f); + directionWidth = new Vector2(1f, 0f); + break; + case 1: + directionLength = new Vector2(1f, 0f); + directionWidth = new Vector2(0f, 1f); + break; + case 2: + directionLength = new Vector2(0f, 1f); + directionWidth = new Vector2(-1f, 0f); + break; + default: + directionLength = new Vector2(-1f, 0f); + directionWidth = new Vector2(0f, -1f); + break; + } + int rangeWidthStart = (int)Math.Ceiling(range.Width / -2.0f); + int rangeWidthEnd = (int)Math.Ceiling(range.Width / 2.0f); + for (int offsetWidth = rangeWidthStart; offsetWidth < rangeWidthEnd; offsetWidth++) + { + for (int offsetLength = 0; offsetLength < range.Length; offsetLength++) + { + __result.Add(directionWidth * offsetWidth + directionLength * offsetLength + tileLocation); + } + } + return false; + } + } + } +} diff --git a/CustomToolEffect/Rewrites/TreeRewrites.cs b/CustomToolEffect/Rewrites/TreeRewrites.cs new file mode 100644 index 0000000..228570c --- /dev/null +++ b/CustomToolEffect/Rewrites/TreeRewrites.cs @@ -0,0 +1,53 @@ +using CustomToolEffect; +using Microsoft.Xna.Framework; +using StardewValley; +using StardewValley.TerrainFeatures; +using StardewValley.Tools; + +namespace StardewModdingAPI.Mods.CustomLocalization.Rewrites +{ + public class TreeRewrites + { + public class PerformToolActionRewrite + { + public static void Prefix(Tree __instance, Tool t, int explosion, Vector2 tileLocation) + { + if (t == null || !(t is Axe) || explosion > 0) + return; + float num; + switch (t.UpgradeLevel) + { + case 0: + num = 1f; + break; + case 1: + num = 1.25f; + break; + case 2: + num = 1.67f; + break; + case 3: + num = 2.5f; + break; + case 4: + num = 5f; + break; + default: + num = 5f; + break; + } + if (__instance.growthStage.Value >= 3) { + num *= 2; + } + if(ModEntry.ModConfig.AxeDefine.TryGetValue(t.UpgradeLevel, out ModConfig.PowerDefine define)) + { + if(define.Power < 0) + { + define.Power = 1f; + } + __instance.health.Value -= num * (define.Power - 1); + } + } + } + } +} diff --git a/CustomToolEffect/manifest.json b/CustomToolEffect/manifest.json new file mode 100644 index 0000000..b413231 --- /dev/null +++ b/CustomToolEffect/manifest.json @@ -0,0 +1,10 @@ +{ + "Name": "Custom Tool Effect", + "Author": "ZaneYork", + "Version": "1.0.2", + "Description": "Custom tool effect range and power", + "UniqueID": "ZaneYork.CustomToolEffect", + "EntryDll": "CustomToolEffect.dll", + "MinimumApiVersion": "3.0.0", + "UpdateKeys": [ "Nexus:5712" ] +} diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..02bbb60 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..88b746a --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# Custom Tool Effect # + +Custom Tool Effect is a Mod for Stardew Valley, it allows you modify Tools effect range and power by edit mod config. + +## Description ## +Mod's config file instructions: + +| Config Name | Description | +| ------------ | ------------ | +| AxeDefine | Define an axe's effect, key-value pair, upgrade level as key | +| PickaxeDefine | Define an pickaxe's effect | +| HoeDefine | Define an hoe's effect | +| WateringCanDefine | Define an watering can's effect | +| Power | The power of this tool when break items, 1.3 means modify to 130% of the origin power | +| Range.Length | The length of effect range | +| Range.Width | The width of effect range |