Skip to content

Commit

Permalink
Fixed cursed enemies not dropping gold reward
Browse files Browse the repository at this point in the history
  • Loading branch information
Neoshrimp committed Sep 10, 2021
1 parent 2219ee5 commit 0e9d25a
Show file tree
Hide file tree
Showing 3 changed files with 185 additions and 0 deletions.
68 changes: 68 additions & 0 deletions Cursed-Bosses/Cursed-Bosses.csproj
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>{5CC5D665-CB74-462D-9E97-51835064AB5A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Cursed_Bosses</RootNamespace>
<AssemblyName>Cursed-Bosses</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="CursedBossesPlugin.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>
81 changes: 81 additions & 0 deletions Cursed-Bosses/CursedBossesPlugin.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
}


}
}
36 changes: 36 additions & 0 deletions Cursed-Bosses/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("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")]

0 comments on commit 0e9d25a

Please sign in to comment.