Skip to content

Commit

Permalink
Add elemental trio debuff nerf plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Neoshrimp committed Sep 5, 2021
1 parent 9e9d44e commit 99a9f49
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 5 deletions.
6 changes: 6 additions & 0 deletions ChronoArk-gameplay-plugins.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "More-cursed-battles", "src\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lift-Curse-Card-placement", "src\Lift-Curse-Card-placement\Lift-Curse-Card-placement.csproj", "{36BE8C8A-31CF-48EA-BDAA-370B2566ADFA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Remove-elemental-debuff-persistence", "src\Remove-elemental-debuff-persistence\Remove-elemental-debuff-persistence.csproj", "{4F47122E-A054-4043-B8A6-E73FEEA8A5C8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -33,6 +35,10 @@ Global
{36BE8C8A-31CF-48EA-BDAA-370B2566ADFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36BE8C8A-31CF-48EA-BDAA-370B2566ADFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36BE8C8A-31CF-48EA-BDAA-370B2566ADFA}.Release|Any CPU.Build.0 = Release|Any CPU
{4F47122E-A054-4043-B8A6-E73FEEA8A5C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4F47122E-A054-4043-B8A6-E73FEEA8A5C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4F47122E-A054-4043-B8A6-E73FEEA8A5C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4F47122E-A054-4043-B8A6-E73FEEA8A5C8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
10 changes: 5 additions & 5 deletions src/More-cursed-battles/MoreCursedBattlesPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public class MoreCursedBattlesPlugin : BaseUnityPlugin

void Awake()
{
cursedBattleNumberConf = Config.Bind("Generation config", "number_of_cursed_battles_per_stage", 2, "Maximum number of cursed battles per stage counting default one. Set to 5 to curse all non-boss battles on every stage");
enabledInSanctuary = Config.Bind("Generation config", "cursed_battles_in_Sanctuary", false, "Enables/Disables cursed fight generation in the final area.");
cursedBattleNumberConf = Config.Bind("Generation config", "number_of_cursed_battles_per_stage", 2, "Maximum number of cursed battles per stage counting default one. Set to 4 to curse all non-boss battles on every stage.");
enabledInSanctuary = Config.Bind("Generation config", "cursed_battles_in_Sanctuary", true, "Enables/Disables cursed fight generation in the final area.");

startingLiftingAmountConf = Config.Bind("Item config", "starting_lifting_scroll_amount", 2, "Amount of starting lifting scrolls. Lifting scrolls are identified. Mind that 1-2 cursed fights no longer drop lifting scrolls");
cursedGoldReward = Config.Bind("Item config", "cursed_gold_reward", 150, "Sets the amount of gold commonly rewarded by the cursed enemies. Vanilla amount is 250");
betterCursedRewardsInSanctuary = Config.Bind("Item config", "enable_better_cursed_rewards_in_Sanctuary", true, "Cursed enemies in Sanctuary drop better rewards like potions or rare items");
startingLiftingAmountConf = Config.Bind("Item config", "starting_lifting_scroll_amount", 2, "Amount of starting lifting scrolls. Lifting scrolls are identified. Mind that 1-2 cursed fights no longer drop lifting scrolls.");
cursedGoldReward = Config.Bind("Item config", "cursed_gold_reward", 150, "Sets the amount of gold commonly rewarded by killing cursed enemies. Vanilla amount is 250.");
betterCursedRewardsInSanctuary = Config.Bind("Item config", "enable_better_cursed_rewards_in_Sanctuary", true, "Cursed enemies in Sanctuary drop better rewards like potions or rare items.");

harmony.PatchAll();
}
Expand Down
36 changes: 36 additions & 0 deletions src/Remove-elemental-debuff-persistence/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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("Remove-elemental-debuff-persistence")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Remove-elemental-debuff-persistence")]
[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("4f47122e-a054-4043-b8a6-e73feea8a5c8")]

// 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")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{4F47122E-A054-4043-B8A6-E73FEEA8A5C8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Remove_elemental_debuff_persistence</RootNamespace>
<AssemblyName>Remove-elemental-debuff-persistence</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\..\..\CAx64_libs\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\CAx64_libs\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\..\CAx64_libs\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="BepInEx">
<HintPath>..\..\..\..\CAx64_libs\BepInEx.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\CAx64_libs\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\CAx64_libs\UnityEngine.CoreModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="RemoveElementalDebuffPersistencePlugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy /Y $(TargetPath) "C:\Program Files (x86)\Steam\steamapps\common\Chrono Ark\x64\Master\BepInEx\scripts"</PostBuildEvent>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using BepInEx;
using GameDataEditor;
using HarmonyLib;
using System.Reflection;
using UnityEngine;

namespace Remove_elemental_debuff_persistence
{
[BepInPlugin(GUID, "No more elemental trio debuff persistence", version)]
[BepInProcess("ChronoArk.exe")]
public class RemoveElementalDebuffPersistencePlugin : BaseUnityPlugin
{

public const string GUID = "org.neo.chronoark.qolmods.triodebuffnerfp";
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);
}

[HarmonyPatch(typeof(B_S4_Guard_0_0_T), nameof(B_S4_Guard_0_0_T.Init))]
class ElectricShockNerfPatch
{
static void Postfix(B_S4_Guard_0_0_T __instance)
{
__instance.BuffData.IsFieldBuff = false;
}
}

[HarmonyPatch(typeof(Buff), nameof(Buff.Init))]
class BurtNerfPatch
{
static void Postfix(Buff __instance)
{
if(__instance.BuffData.Key == GDEItemKeys.Buff_B_S4_Guard_1_0_T)
__instance.BuffData.IsFieldBuff = false;
}
}
}
}

0 comments on commit 99a9f49

Please sign in to comment.