From 0e9d25a068a7b1f7823abe6f79bfff407e383b0f Mon Sep 17 00:00:00 2001 From: Neoshrimp Date: Sat, 11 Sep 2021 00:21:11 +0300 Subject: [PATCH] Fixed cursed enemies not dropping gold reward --- Cursed-Bosses/Cursed-Bosses.csproj | 68 ++++++++++++++++++++ Cursed-Bosses/CursedBossesPlugin.cs | 81 ++++++++++++++++++++++++ Cursed-Bosses/Properties/AssemblyInfo.cs | 36 +++++++++++ 3 files changed, 185 insertions(+) create mode 100644 Cursed-Bosses/Cursed-Bosses.csproj create mode 100644 Cursed-Bosses/CursedBossesPlugin.cs create mode 100644 Cursed-Bosses/Properties/AssemblyInfo.cs diff --git a/Cursed-Bosses/Cursed-Bosses.csproj b/Cursed-Bosses/Cursed-Bosses.csproj new file mode 100644 index 0000000..235c6af --- /dev/null +++ b/Cursed-Bosses/Cursed-Bosses.csproj @@ -0,0 +1,68 @@ + + + + + Debug + AnyCPU + {5CC5D665-CB74-462D-9E97-51835064AB5A} + Library + Properties + Cursed_Bosses + Cursed-Bosses + v4.0 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\CAx64_libs\0Harmony.dll + + + ..\..\..\CAx64_libs\Assembly-CSharp.dll + + + ..\..\..\CAx64_libs\Assembly-CSharp-firstpass.dll + + + ..\..\..\CAx64_libs\BepInEx.dll + + + + + + + + + + ..\..\..\CAx64_libs\UnityEngine.dll + + + ..\..\..\CAx64_libs\UnityEngine.CoreModule.dll + + + + + + + + + copy /Y $(TargetPath) "C:\Program Files (x86)\Steam\steamapps\common\Chrono Ark\x64\Master\BepInEx\scripts" + + \ No newline at end of file diff --git a/Cursed-Bosses/CursedBossesPlugin.cs b/Cursed-Bosses/CursedBossesPlugin.cs new file mode 100644 index 0000000..2302e0c --- /dev/null +++ b/Cursed-Bosses/CursedBossesPlugin.cs @@ -0,0 +1,81 @@ +using BepInEx; +using GameDataEditor; +using HarmonyLib; +using TileTypes; +using UnityEngine; + +namespace Cursed_Bosses +{ + [BepInPlugin(GUID, "Cursed Bosses", version)] + [BepInProcess("ChronoArk.exe")] + public class CursedBossesPlugin : BaseUnityPlugin + { + + public const string GUID = "org.neo.chronoark.runmutators.cursedbosses"; + public const string version = "1.0.0"; + + + private static readonly Harmony harmony = new Harmony(GUID); + + private static BepInEx.Logging.ManualLogSource logger; + + void Awake() + { + logger = Logger; + harmony.PatchAll(); + } + void OnDestroy() + { + if (harmony != null) + harmony.UnpatchAll(GUID); + } + + //todo + //create custom boss curse class which modifies extra attack speed and perhaps damage/debuff chance + //reduce hp, resist bonus + //increase fog timer + //integrate it in stagesyste code. properly display on minimap + //add options to change modifiers + //create transmute curse scroll cards. number of lifting scrolls = number of uses? + //dont regular lifting scrolls + //ban executioner on tank(at least first turn) + //move dorchi to 2-1 + //make tfk transition to phase 2 at half hp + //test twins, pharos leader special attacks + + + // ISSUE particles doesn't disappear after battle + // BIG ISSUE bricks game on area transition. Perhaps patch on destroy + // only visual cursed tile effect +/* [HarmonyPatch(typeof(StageSystem), nameof(StageSystem.InstantiateIsometric))] + class CurseParticlesBossTile + { + [HarmonyPostfix] + static void InstantiateIsometric(HexMap ___Map) + { + ___Map.EventTileList.Find((MapTile map) => map.Info.Type is Boss).Info.Cursed = true; + } + }*/ + + + [HarmonyPatch(typeof(BattleSystem))] + class BattleSystem_Patch + { + [HarmonyPatch(nameof(BattleSystem.CreatEnemy))] + [HarmonyPrefix] + static void CreatEnemyPrefix(string EnemyString, ref bool Curse) + { + if (BattleSystem.instance.TurnNum == 0) + { + GDEEnemyData gdeenemyData = new GDEEnemyData(EnemyString); + if (gdeenemyData.Boss == true) + { + Curse = true; + } + } + } + } + + + } +} diff --git a/Cursed-Bosses/Properties/AssemblyInfo.cs b/Cursed-Bosses/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..75e1d99 --- /dev/null +++ b/Cursed-Bosses/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +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("Cursed-Bosses")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Cursed-Bosses")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[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("5cc5d665-cb74-462d-9e97-51835064ab5a")] + +// 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.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")]