Compare commits
21 Commits
8c4e8b9366
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 97113d199c | |||
| ef557bf939 | |||
| 830980e180 | |||
| 051da59046 | |||
| b8a81179ec | |||
| 8a149d45ec | |||
| c2fe7b0c9e | |||
| 71163fc589 | |||
| 0f2a242b30 | |||
| 4ae13418a6 | |||
| 9583944c69 | |||
| 345f8c4565 | |||
| 66ca370ac2 | |||
| dea5256339 | |||
| f56aae2dbf | |||
| 1e1268cee6 | |||
| 005c1805e9 | |||
| fbcabc90b7 | |||
| f72fcee86c | |||
| 5bde3c20b4 | |||
| 28bb3038c5 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -11,3 +11,6 @@ Projects/CykaOfQud/.vs/
|
||||
|
||||
Projects/CykaOfQud/.vscode/
|
||||
*.suo
|
||||
Projects/BanquetForFools/.vs/BanquetForCyka
|
||||
Projects/InfectionFreeZone/.vs/InfectionFreeZone
|
||||
Projects/Quasimorph/.vs/Quasimorph
|
||||
|
||||
83
.gitmodules
vendored
83
.gitmodules
vendored
@@ -1,14 +1,69 @@
|
||||
[submodule "Projects/CaptainOfIndustry/CaptainOfCheats"]
|
||||
path = Projects/CaptainOfIndustry/CaptainOfCheats
|
||||
url = https://github.com/altmank/CaptainOfCheats
|
||||
url = https://github.com/Keranik/COI-Extended
|
||||
[submodule "Projects/CaptainOfIndustry/DoubleQoLMod"]
|
||||
path = Projects/CaptainOfIndustry/DoubleQoLMod
|
||||
url = https://github.com/PhatDave/DoubleQoLMod
|
||||
url = https://github.com/Keranik/COI-Extended
|
||||
[submodule "Projects/CaptainOfIndustry/COI_MineDumpControl"]
|
||||
path = Projects/CaptainOfIndustry/COI_MineDumpControl
|
||||
url = https://github.com/hreintke/COI_MineDumpControl
|
||||
[submodule "Projects/CaptainOfIndustry/DifficultySettingsMod"]
|
||||
path = Projects/CaptainOfIndustry/DifficultySettingsMod
|
||||
url = https://github.com/KptKosmit91/CaptainOfIndustry-DifficultySettingsMod
|
||||
[submodule "Projects/AgainstTheStorm"]
|
||||
path = Projects/AgainstTheStorm
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-AgainstTheStorm/.git
|
||||
[submodule "Projects/Zompiercer"]
|
||||
path = Projects/Zompiercer
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-Zompiercer/.git
|
||||
[submodule "Projects/WeedShop3"]
|
||||
path = Projects/WeedShop3
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-WeedShop3/.git
|
||||
[submodule "Projects/TerraTech"]
|
||||
path = Projects/TerraTech
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-TerraTech/.git
|
||||
[submodule "Projects/TavernMaster"]
|
||||
path = Projects/TavernMaster
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-TavernMaster/.git
|
||||
[submodule "Projects/SupermarketTogether"]
|
||||
path = Projects/SupermarketTogether
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-SupermarketTogether/.git
|
||||
[submodule "Projects/SupermarketSimulator"]
|
||||
path = Projects/SupermarketSimulator
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-SupermarketSimulator/.git
|
||||
[submodule "Projects/SevenDaysToDie"]
|
||||
path = Projects/SevenDaysToDie
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-SevenDaysToDie/.git
|
||||
[submodule "Projects/Regiments"]
|
||||
path = Projects/Regiments
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-Regiments/.git
|
||||
[submodule "Projects/Quasimorph"]
|
||||
path = Projects/Quasimorph
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-Quasimorph/.git
|
||||
[submodule "Projects/NightRaider"]
|
||||
path = Projects/NightRaider
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-NightRaider/.git
|
||||
[submodule "Projects/MadGamesTycoon2"]
|
||||
path = Projects/MadGamesTycoon2
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-MadGamesTycoon2/.git
|
||||
[submodule "Projects/InfectionFreeZone"]
|
||||
path = Projects/InfectionFreeZone
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-InfectionFreeZone/.git
|
||||
[submodule "Projects/HouseFlipper"]
|
||||
path = Projects/HouseFlipper
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-HouseFlipper/.git
|
||||
[submodule "Projects/Escapists2"]
|
||||
path = Projects/Escapists2
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-Escapists2/.git
|
||||
[submodule "Projects/Ereshor"]
|
||||
path = Projects/Ereshor
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-Ereshor/.git
|
||||
[submodule "Projects/DustlandDelivery"]
|
||||
path = Projects/DustlandDelivery
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-DustlandDelivery/.git
|
||||
[submodule "Projects/CykaOfQud"]
|
||||
path = Projects/CykaOfQud
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-CykaOfQud/.git
|
||||
[submodule "Projects/CarMechanicSimulator2021"]
|
||||
path = Projects/CarMechanicSimulator2021
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-CarMechanicSimulator2021/.git
|
||||
[submodule "Projects/CaptainOfIndustry"]
|
||||
path = Projects/CaptainOfIndustry
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-CaptainOfIndustry/.git
|
||||
[submodule "Projects/BlacksmithMaster"]
|
||||
path = Projects/BlacksmithMaster
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-BlacksmithMaster/.git
|
||||
[submodule "Projects/BanquetForFools"]
|
||||
path = Projects/BanquetForFools
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-BanquetForFools/.git
|
||||
[submodule "Projects/AirportCEO"]
|
||||
path = Projects/AirportCEO
|
||||
url = https://git.site.quack-lab.dev/dave/BepInEx-AirportCEO/.git
|
||||
|
||||
1
Projects/AgainstTheStorm
Submodule
1
Projects/AgainstTheStorm
Submodule
Submodule Projects/AgainstTheStorm added at 8e926bd141
@@ -1,16 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgainstTheStorm", "AgainstTheStorm\AgainstTheStorm.csproj", "{DA9D274E-486F-4F82-84FF-CD9388CB0B09}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,28 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005C0Harmony_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CAssembly_002DCSharp_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CBepInEx_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CMainAssembly_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CUnityEngine_002ECoreModule_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CUnityEngine_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005C0Harmony_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CAssembly_002DCSharp_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CBepInEx_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CConfigurationManager_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CSirenix_002ESerialization_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CUnityEngine_002ECoreModule_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CUnityEngine_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005C0Harmony_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CAssembly_002DCSharp_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CBepInEx_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CConfigurationManager_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CMainAssembly_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CUnityEngine_002ECoreModule_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CUnityEngine_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CProjects_002DRider_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005C0Harmony_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CProjects_002DRider_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CAssembly_002DCSharp_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CProjects_002DRider_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CBepInEx_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CProjects_002DRider_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CConfigurationManager_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CProjects_002DRider_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CSirenix_002ESerialization_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CProjects_002DRider_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CUnityEngine_002ECoreModule_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CProjects_002DRider_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CUnityEngine_002Edll/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
@@ -1,82 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" 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>{DA9D274E-486F-4F82-84FF-CD9388CB0B09}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AgainstTheStorm</RootNamespace>
|
||||
<AssemblyName>AgainstTheStorm</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<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' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<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>libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MainAssembly">
|
||||
<HintPath>libs\MainAssembly.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.Serialization">
|
||||
<HintPath>libs\Sirenix.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>libs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Patches.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Transpiler.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="deploy.sh" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
|
||||
</Project>
|
||||
@@ -1,92 +0,0 @@
|
||||
using System.Linq;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
|
||||
namespace AgainstTheStorm {
|
||||
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
public class Main : BaseUnityPlugin {
|
||||
private const string pluginGuid = "CykaMod";
|
||||
private const string pluginName = "CykaMod";
|
||||
private const string pluginVersion = "1.0.0";
|
||||
|
||||
public static ConfigEntry<int> ProductionMultiplier;
|
||||
public static ConfigEntry<int> DepositChargesMultiplier;
|
||||
public static ConfigEntry<float> VillagerSpeedMultiplier;
|
||||
public static ConfigEntry<float> ProductionSpeedMultiplier;
|
||||
public static ConfigEntry<float> NewcomverRateMultiplier;
|
||||
public static ConfigEntry<int> VillagerCapacityMultiplier;
|
||||
public static ConfigEntry<float> TraderRateMultiplier;
|
||||
public static ConfigEntry<int> TraderMerchMultiplier;
|
||||
public static ConfigEntry<float> HearthRangeMultiplier;
|
||||
public static ConfigEntry<float> HouseCapacityMultiplier;
|
||||
public static ConfigEntry<float> NewcomerBonusMultiplier;
|
||||
public static ConfigEntry<int> GameSpeedMultiplier;
|
||||
public static ConfigEntry<int> AdditionalNewcomerBonus;
|
||||
public static ConfigEntry<float> MetaCurrencyMultiplier;
|
||||
public static ConfigEntry<float> TradeRouteSpeedMultiplier;
|
||||
|
||||
// public static ConfigEntry<float> wheelTorqueMultiplier;
|
||||
// public static ConfigEntry<float> wheelSpeedMultiplier;
|
||||
// public static ConfigEntry<float> jetThrustMultiplier;
|
||||
|
||||
public void Awake() {
|
||||
ProductionMultiplier = Config.Bind("General", "ProductionMultiplier", 1,
|
||||
new ConfigDescription("ProductionMultiplier", new AcceptableValueRange<int>(1, 512)));
|
||||
DepositChargesMultiplier = Config.Bind("General", "DepositChargesMultiplier", 1,
|
||||
new ConfigDescription("DepositChargesMultiplier", new AcceptableValueRange<int>(1, 512)));
|
||||
VillagerSpeedMultiplier = Config.Bind("General", "VillagerSpeedMultiplier", 1f,
|
||||
new ConfigDescription("VillagerSpeedMultiplier", new AcceptableValueRange<float>(1f, 128f)));
|
||||
ProductionSpeedMultiplier = Config.Bind("General", "ProductionSpeedMultiplier", 1f,
|
||||
new ConfigDescription("ProductionSpeedMultiplier", new AcceptableValueRange<float>(1f, 256f)));
|
||||
NewcomverRateMultiplier = Config.Bind("General", "NewcomverRateMultiplier", 1f,
|
||||
new ConfigDescription("NewcomverRateMultiplier", new AcceptableValueRange<float>(1f, 128f)));
|
||||
VillagerCapacityMultiplier = Config.Bind("General", "VillagerCapacityMultiplier", 1,
|
||||
new ConfigDescription("VillagerCapacityMultiplier", new AcceptableValueRange<int>(1, 32)));
|
||||
TraderRateMultiplier = Config.Bind("General", "TraderRateMultiplier", 1f,
|
||||
new ConfigDescription("TraderRateMultiplier", new AcceptableValueRange<float>(1f, 128f)));
|
||||
TraderMerchMultiplier = Config.Bind("General", "TraderMerchMultiplier", 1,
|
||||
new ConfigDescription("TraderMerchMultiplier", new AcceptableValueRange<int>(1, 128)));
|
||||
HearthRangeMultiplier = Config.Bind("General", "HearthRangeMultiplier", 1f,
|
||||
new ConfigDescription("HearthRangeMultiplier", new AcceptableValueRange<float>(1f, 128f)));
|
||||
HouseCapacityMultiplier = Config.Bind("General", "HouseCapacityMultiplier", 1f,
|
||||
new ConfigDescription("HouseCapacityMultiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
NewcomerBonusMultiplier = Config.Bind("General", "NewcomerBonusMultiplier", 1f,
|
||||
new ConfigDescription("NewcomerBonusMultiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
GameSpeedMultiplier = Config.Bind("General", "GameSpeedMultiplier", 1,
|
||||
new ConfigDescription("GameSpeedMultiplier", new AcceptableValueRange<int>(1, 32)));
|
||||
AdditionalNewcomerBonus = Config.Bind("General", "AdditionalNewcomerBonus", 0,
|
||||
new ConfigDescription("AdditionalNewcomerBonus", new AcceptableValueRange<int>(0, 512)));
|
||||
MetaCurrencyMultiplier = Config.Bind("General", "MetaCurrencyMultiplier", 1f,
|
||||
new ConfigDescription("MetaCurrencyMultiplier", new AcceptableValueRange<float>(1f, 512f)));
|
||||
TradeRouteSpeedMultiplier = Config.Bind("General", "TradeRouteSpeedMultiplier", 1f,
|
||||
new ConfigDescription("TradeRouteSpeedMultiplier", new AcceptableValueRange<float>(1f, 512f)));
|
||||
// minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f,
|
||||
// new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f)));
|
||||
//
|
||||
// allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false);
|
||||
|
||||
// shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
|
||||
// energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
|
||||
// magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
// magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
// beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
// beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
// fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
// fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
// wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
// wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
// jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
|
||||
// minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
// minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,458 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Eremite.Buildings;
|
||||
using Eremite.Model;
|
||||
using Eremite.Model.Meta;
|
||||
using Eremite.Services;
|
||||
using HarmonyLib;
|
||||
|
||||
// Patch maxSupPoints in PlatoonSupplyModule
|
||||
// Patch Operational Authority point gain
|
||||
|
||||
namespace AgainstTheStorm {
|
||||
[HarmonyPatch]
|
||||
public class Patches {
|
||||
static Dictionary<string, float> baseValues = new Dictionary<string, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(BonusEmbarkRangeMetaRewardModel), "OnConsume")]
|
||||
static void Test(BonusEmbarkRangeMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(BonusFarmAreaMetaRewardModel), "OnConsume")]
|
||||
static void Test(BonusFarmAreaMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ConstructionSpeedMetaRewardModel), "OnConsume")]
|
||||
static void Test(ConstructionSpeedMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(CornerstonesRerollsMetaRewardModel), "OnConsume")]
|
||||
static void Test(CornerstonesRerollsMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(CurrencyMultiplayerMetaRewardModel), "OnConsume")]
|
||||
static void Test(CurrencyMultiplayerMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(EmbarkGoodsAmountMetaRewardModel), "OnConsume")]
|
||||
static void Test(EmbarkGoodsAmountMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(FarmingRateMetaRewardModel), "OnConsume")]
|
||||
static void Test(FarmingRateMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(FuelRateMetaRewardModel), "OnConsume")]
|
||||
static void Test(FuelRateMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GlobalBuildingStorageMetaRewardModel), "OnConsume")]
|
||||
static void Test(GlobalBuildingStorageMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GlobalCapacityMetaRewardModel), "OnConsume")]
|
||||
static void Test(GlobalCapacityMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GlobalExtraProductionChanceMetaRewardModel), "OnConsume")]
|
||||
static void Test(GlobalExtraProductionChanceMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GlobalProductionSpeedMetaRewardModel), "OnConsume")]
|
||||
static void Test(GlobalProductionSpeedMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GracePeriodMetaRewardModel), "OnConsume")]
|
||||
static void Test(GracePeriodMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GrassAmountMetaRewardModel), "OnConsume")]
|
||||
static void Test(GrassAmountMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(HearthSacraficeTimeRateMetaRewardModel), "OnConsume")]
|
||||
static void Test(HearthSacraficeTimeRateMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(NewcommersGoodsRateMetaRewardModel), "OnConsume")]
|
||||
static void Test(NewcommersGoodsRateMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
// [HarmonyPrefix]
|
||||
// [HarmonyPatch(typeof(PreparationPointsMetaRewardModel), "OnConsume")]
|
||||
// static void Test(PreparationPointsMetaRewardModel __instance) {
|
||||
// DoPatch(__instance);
|
||||
// }
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(RawDepositsChargesMetaRewardModel), "OnConsume")]
|
||||
static void Test(RawDepositsChargesMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(RelicsWorkingSpeedMetaRewardModel), "OnConsume")]
|
||||
static void Test(RelicsWorkingSpeedMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ReputationPenaltyRateMetaRewardModel), "OnConsume")]
|
||||
static void Test(ReputationPenaltyRateMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ReputationRewardPicksMetaRewardModel), "OnConsume")]
|
||||
static void Test(ReputationRewardPicksMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(SeasonRewardsAmountMetaRewardModel), "OnConsume")]
|
||||
static void Test(SeasonRewardsAmountMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TownsVisionRangeMetaRewardModel), "OnConsume")]
|
||||
static void Test(TownsVisionRangeMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TraderIntervalMetaRewardModel), "OnConsume")]
|
||||
static void Test(TraderIntervalMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TraderMerchAmountMetaRewardModel), "OnConsume")]
|
||||
static void Test(TraderMerchAmountMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TraderMerchandisePriceReductionMetaRewardModel), "OnConsume")]
|
||||
static void Test(TraderMerchandisePriceReductionMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TradeRoutesLimitMetaReward), "OnConsume")]
|
||||
static void Test(TradeRoutesLimitMetaReward __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TraderSellPriceMetaRewardModel), "OnConsume")]
|
||||
static void Test(TraderSellPriceMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(VillagersSpeedMetaRewardModel), "OnConsume")]
|
||||
static void Test(VillagersSpeedMetaRewardModel __instance) {
|
||||
DoPatch(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(ProductionCalculator), nameof(ProductionCalculator.GetProductionMultiplier))]
|
||||
static void PatchProductionCalculator(ref int __result) {
|
||||
// Console.WriteLine("ProdMulti {0}", __result);
|
||||
__result *= Main.ProductionMultiplier.Value;
|
||||
}
|
||||
|
||||
// There seems to be a lot of good shit in effetsService!!
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(EffectsService), nameof(EffectsService.GetRawDepositsChargesBonus))]
|
||||
static void PatchEffectsService(ref int __result) {
|
||||
__result *= Main.DepositChargesMultiplier.Value;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(EffectsService), nameof(EffectsService.GetActorSpeed))]
|
||||
static void PatchEffectsService2(ref float __result) {
|
||||
__result *= Main.VillagerSpeedMultiplier.Value;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(EffectsService), nameof(EffectsService.GetBuildingProductionRate))]
|
||||
static void PatchEffectsService3(ref float __result) {
|
||||
__result *= Main.ProductionSpeedMultiplier.Value;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(EffectsService), nameof(EffectsService.GetNewcomersIntervalRate))]
|
||||
static void PatchEffectsService4(ref float __result) {
|
||||
__result *= Main.NewcomverRateMultiplier.Value;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(EffectsService), nameof(EffectsService.GetVillagerCapacity))]
|
||||
static void PatchEffectsService5(ref int __result) {
|
||||
__result *= Main.VillagerCapacityMultiplier.Value;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(EffectsService), nameof(EffectsService.GetTraderIntervalRate))]
|
||||
static void PatchEffectsService6(ref float __result) {
|
||||
__result *= Main.TraderRateMultiplier.Value;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(EffectsService), nameof(EffectsService.GetTraderMerchsAmount))]
|
||||
static void PatchEffectsService7(ref int __result) {
|
||||
__result *= Main.TraderMerchMultiplier.Value;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(EffectsService), nameof(EffectsService.GetHearthRange))]
|
||||
static void PatchEffectsService8(ref float __result) {
|
||||
__result *= Main.HearthRangeMultiplier.Value;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(EffectsService), nameof(EffectsService.GetHouseCapacity), typeof(HouseModel))]
|
||||
static void PatchEffectsService9(ref int __result) {
|
||||
__result = (int)(Main.HouseCapacityMultiplier.Value * __result);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(EffectsService), nameof(EffectsService.GetHouseCapacity), typeof(House))]
|
||||
static void PatchEffectsService9_2(ref int __result) {
|
||||
__result = (int)(Main.HouseCapacityMultiplier.Value * __result);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(EffectsService), nameof(EffectsService.GetNewcomersBonus))]
|
||||
static void PatchEffectsService10(ref int __result) {
|
||||
__result = (int)(Main.NewcomerBonusMultiplier.Value * __result);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(EffectsService), nameof(EffectsService.GetNewcomersRaceBonus))]
|
||||
static void PatchEffectsService11(ref int __result) {
|
||||
__result += Main.AdditionalNewcomerBonus.Value;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(EffectsService), nameof(EffectsService.GetTradeRoutesSpeed))]
|
||||
static void PatchEffectsService12(ref float __result) {
|
||||
__result += Main.TradeRouteSpeedMultiplier.Value;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TimeScaleService), "SetScale")]
|
||||
static void PatchGameSpeeds(ref float scale) {
|
||||
scale *= Main.GameSpeedMultiplier.Value;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(MetaEconomyService), nameof(MetaEconomyService.Add))]
|
||||
static void PatchMetaCurrencyGain(ref MetaCurrency currency) {
|
||||
currency.amount = (int)(currency.amount * Main.MetaCurrencyMultiplier.Value);
|
||||
}
|
||||
|
||||
static void DoPatch(BasePercentageMetaReward model) {
|
||||
string upgName = model.displayName.ToString();
|
||||
if (!baseValues.ContainsKey(upgName)) {
|
||||
Console.WriteLine("Base value does not exist yet for {0} (class: {1}), adding", upgName,
|
||||
model.GetType().Name);
|
||||
baseValues.Add(upgName, model.amount);
|
||||
}
|
||||
|
||||
if (Math.Abs(baseValues[upgName] - model.amount) < 0.01f) {
|
||||
float newValue = baseValues[upgName] * 64;
|
||||
Console.WriteLine("Base value is different for {0}, updating from {1} to {2}", upgName,
|
||||
baseValues[upgName],
|
||||
newValue);
|
||||
baseValues[upgName] = newValue;
|
||||
}
|
||||
else {
|
||||
Console.WriteLine("Base value is the same for {0}, skipping {1}", upgName, baseValues[upgName]);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatch(BaseFlatMetaReward model) {
|
||||
string upgName = model.displayName.ToString();
|
||||
if (!baseValues.ContainsKey(upgName)) {
|
||||
Console.WriteLine("Base value does not exist yet for {0} (class: {1}), adding", upgName,
|
||||
model.GetType().Name);
|
||||
baseValues.Add(upgName, model.amount);
|
||||
}
|
||||
|
||||
if (Math.Abs(baseValues[upgName] - model.amount) < 0.01f) {
|
||||
float newValue = baseValues[upgName] * 64;
|
||||
Console.WriteLine("Base value is different for {0}, updating from {1} to {2}", upgName,
|
||||
baseValues[upgName],
|
||||
newValue);
|
||||
baseValues[upgName] = newValue;
|
||||
}
|
||||
else {
|
||||
Console.WriteLine("Base value is the same for {0}, skipping {1}", upgName, baseValues[upgName]);
|
||||
}
|
||||
}
|
||||
|
||||
// [HarmonyPrefix]
|
||||
// [HarmonyPatch(typeof(TacAidPointsController), "AddTP")]
|
||||
// static void TpMultiplier(ref float val) {
|
||||
// if (val == 0) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// float multiplier = Main.TPMultiplier.Value;
|
||||
// // Console.WriteLine("Multiplying TP {0} by {1}", val, multiplier);
|
||||
// val *= multiplier;
|
||||
// }
|
||||
//
|
||||
// [HarmonyPrefix]
|
||||
// [HarmonyPatch(typeof(MapZoneFactory), "MakeRefitZone")]
|
||||
// static void SupplyAoeMultiplier(ref eSides side, ref Vector3 position, ref float size) {
|
||||
// float multiplier = Main.SupplyAOEMultiplier.Value;
|
||||
// Console.WriteLine("Multiplying supply aoe {0} by {1}", size, multiplier);
|
||||
// size *= multiplier;
|
||||
// }
|
||||
//
|
||||
// [HarmonyPrefix]
|
||||
// [HarmonyPatch(typeof(PlatoonHQVisuals), "Start")]
|
||||
// static void HqAoeMultiplier(PlatoonHQVisuals __instance) {
|
||||
// Console.WriteLine("Patching HQ radius - base range {0}", baseHqValue);
|
||||
// if (baseHqValue == 0) {
|
||||
// baseHqValue = __instance.platoon.parameters.HQRadius;
|
||||
// Console.WriteLine("Base range is 0, assigning new: {0}", baseHqValue);
|
||||
// }
|
||||
//
|
||||
// __instance.platoon.parameters.HQRadius = baseHqValue * Main.HQAOEMultiplier.Value;
|
||||
// Console.WriteLine("HQ radius patched to: {0}", __instance.platoon.parameters.HQRadius);
|
||||
// }
|
||||
//
|
||||
// [HarmonyPrefix]
|
||||
// [HarmonyPatch(typeof(PlatoonSupplyModule), "Start")]
|
||||
// static void SupplyAoeMultiplier(PlatoonSupplyModule __instance) {
|
||||
// Console.WriteLine("Patching supply amount - base amount {0}", baseSupplyValue);
|
||||
// if (baseSupplyValue == 0) {
|
||||
// baseSupplyValue = __instance.platoon.parameters.supplyPointsPerUnit;
|
||||
// Console.WriteLine("Base amount is 0, assigning new: {0}", baseSupplyValue);
|
||||
// }
|
||||
//
|
||||
// __instance.platoon.parameters.supplyPointsPerUnit =
|
||||
// (int)(baseSupplyValue * Main.SupplyAmountMultiplier.Value);
|
||||
// Console.WriteLine("Supply amount patched to: {0}", __instance.platoon.parameters.supplyPointsPerUnit);
|
||||
// }
|
||||
//
|
||||
// [HarmonyPostfix]
|
||||
// [HarmonyPatch(typeof(WeaponAttackBase), "GetReloadInterval")]
|
||||
// static void FireRateMultiplier(ref float __result) {
|
||||
// Console.WriteLine("Patching fire rate");
|
||||
//
|
||||
// __result *= Main.FireRateMultiplier.Value;
|
||||
// Console.WriteLine("Fire rate patched to: {0}", __result);
|
||||
// }
|
||||
//
|
||||
// [HarmonyPostfix]
|
||||
// [HarmonyPatch(typeof(WeaponAttackBase), "GetAimInterval")]
|
||||
// static void AimingIntervalMultiplier(ref float __result) {
|
||||
// Console.WriteLine("Patching aim interval - base amount {0}", baseSupplyValue);
|
||||
//
|
||||
// __result *= Main.AimIntervalMultiplier.Value;
|
||||
// Console.WriteLine("Aim interval patched to: {0}", __result);
|
||||
// }
|
||||
//
|
||||
// [HarmonyPrefix]
|
||||
// [HarmonyPatch(typeof(TimerManager), "GetPersistentTimer")]
|
||||
// static void Transpiler(ref float interval, ref string hint) {
|
||||
// if (hint == "burst") {
|
||||
// Console.WriteLine("Patching burst interval from: {0}", interval);
|
||||
// interval *= Main.FireRateMultiplier.Value;
|
||||
// Console.WriteLine("Burst interval patched to: {0}", interval);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPostfix]
|
||||
// [HarmonyPatch(typeof(RefitZone), "OnRefitStep")]
|
||||
// static void SupplyRateMultiplier(ref float hpVal, ref float ammoVal) {
|
||||
// Console.WriteLine("Patching refit step from: {0} {1}", hpVal, ammoVal);
|
||||
// hpVal *= Main.SupplyRateMultiplier.Value;
|
||||
// ammoVal *= Main.SupplyRateMultiplier.Value;
|
||||
// Console.WriteLine("Patching refit step to: {0} {1}", hpVal, ammoVal);
|
||||
// }
|
||||
//
|
||||
// // [HarmonyPatch(typeof(AdvancedRulesData), "Validate")]
|
||||
// // static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// // var codes = new List<CodeInstruction>(instructions);
|
||||
// //
|
||||
// // foreach (var code in codes) {
|
||||
// // if (code.opcode == OpCodes.Ldc_R4) {
|
||||
// // Console.WriteLine("Changing " + code);
|
||||
// // code.operand = (float)code.operand * 2;
|
||||
// // Console.WriteLine("Changed " + code);
|
||||
// // }
|
||||
// // }
|
||||
// //
|
||||
// // return codes.AsEnumerable();
|
||||
// // }
|
||||
//
|
||||
// // [HarmonyPatch(typeof(AdvancedRulesData), "IsWithinLimits")]
|
||||
// // static IEnumerable<CodeInstruction> Transpiler2(IEnumerable<CodeInstruction> instructions) {
|
||||
// // var codes = new List<CodeInstruction>(instructions);
|
||||
// //
|
||||
// // foreach (var code in codes) {
|
||||
// // if (code.opcode == OpCodes.Ldc_R4) {
|
||||
// // Console.WriteLine("Changing " + code);
|
||||
// // code.operand = (float)code.operand * 2;
|
||||
// // Console.WriteLine("Changed " + code);
|
||||
// // }
|
||||
// // }
|
||||
// //
|
||||
// // return codes.AsEnumerable();
|
||||
// // }
|
||||
//
|
||||
// // private static float baseAccuracy;
|
||||
// //
|
||||
// // [HarmonyPostfix]
|
||||
// // [HarmonyPatch(typeof(SkirmishAdvancedRules), "Update")]
|
||||
// // static void AccuracyPatch(SkirmishAdvancedRules __instance) {
|
||||
// // var accMod = Traverse.Create(__instance).Field("currentARD").Field("accuracyModifier");
|
||||
// // if (baseAccuracy == 0) {
|
||||
// // baseAccuracy = (float)accMod.GetValue();
|
||||
// // Console.WriteLine("Base accuracy set to {0}", baseAccuracy);
|
||||
// // }
|
||||
// //
|
||||
// // accMod.SetValue(baseAccuracy * 4f);
|
||||
// // Console.WriteLine("Accuracy now: {0}", accMod.GetValue());
|
||||
// // }
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
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("Regiments")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Regiments")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[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("DA9D274E-486F-4F82-84FF-CD9388CB0B09")]
|
||||
|
||||
// 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")]
|
||||
@@ -1,274 +0,0 @@
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
// using System.Linq;
|
||||
// using System.Reflection.Emit;
|
||||
// using BepInEx;
|
||||
// using BepInEx.Configuration;
|
||||
// using HarmonyLib;
|
||||
// using HarmonyLib.Tools;
|
||||
//
|
||||
// namespace Regiments {
|
||||
// [BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
// public class Main : BaseUnityPlugin {
|
||||
// private const string pluginGuid = "CykaMod";
|
||||
// private const string pluginName = "CykaMod";
|
||||
// private const string pluginVersion = "1.0.0";
|
||||
//
|
||||
// public static ConfigEntry<float> skillCap;
|
||||
// public static ConfigEntry<float> workSpeed;
|
||||
// public static ConfigEntry<float> workResult;
|
||||
// public static ConfigEntry<bool> alwaysCritical;
|
||||
// public static ConfigEntry<float> gameSpeed;
|
||||
// public static ConfigEntry<int> fans;
|
||||
// public static ConfigEntry<long> money;
|
||||
//
|
||||
// //
|
||||
// // private void Awake()
|
||||
// // {
|
||||
// // configGreeting = Config.Bind("General", // The section under which the option is shown
|
||||
// // "GreetingText", // The key of the configuration option in the configuration file
|
||||
// // "Hello, world!", // The default value
|
||||
// // "A greeting text to show when the game is launched"); // Description of the option to show in the config file
|
||||
// //
|
||||
//
|
||||
// public void Awake() {
|
||||
// skillCap = Config.Bind("General", "Skill Cap", 100f);
|
||||
// workSpeed = Config.Bind("General", "Work Speed Multiplier", 4f);
|
||||
// workResult = Config.Bind("General", "Work Result Multiplier", 4f);
|
||||
// alwaysCritical = Config.Bind("General", "Work Always Critical", false);
|
||||
// gameSpeed = Config.Bind("General", "Game Speed Multiplier", 3f);
|
||||
// fans = Config.Bind("General", "Fans Multiplier", 2);
|
||||
// money = Config.Bind("General", "Money Multiplier", 2L);
|
||||
//
|
||||
// Logger.LogInfo("Cyka mod loaded");
|
||||
// HarmonyFileLog.Enabled = true;
|
||||
// Harmony harmony = new Harmony(pluginGuid);
|
||||
// harmony.PatchAll();
|
||||
// var originalMethods = harmony.GetPatchedMethods();
|
||||
// Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
// }
|
||||
//
|
||||
// public static bool IsMatch(List<CodeInstruction> codes, int index, List<CodeInstruction> matcher) {
|
||||
// for (var i = 0; i < matcher.Count; i++) {
|
||||
// if (codes[index + i].opcode != matcher[i].opcode) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// public static void InsertAt(List<CodeInstruction> codes, int index, List<CodeInstruction> toInsert) {
|
||||
// for (var i = 0; i < toInsert.Count; i++) {
|
||||
// codes.Insert(index + i, toInsert[i]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetSkillCap")]
|
||||
// public class SkillCapPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetSkillCap Postfix! Result is " + __result);
|
||||
// __result = Main.skillCap.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetSkillCap_Skill")]
|
||||
// public class SkillCapSkillPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetSkillCap_Skill Postfix! Result is " + __result);
|
||||
// __result = Main.skillCap.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetWorkSpeed")]
|
||||
// public class GetWorkSpeedPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetWorkSpeed Postfix! Result is " + __result);
|
||||
// __result *= Main.workSpeed.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetWorkResult")]
|
||||
// public class GetWorkResultPatch {
|
||||
// static void Prefix(ref float f) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// f *= Main.workResult.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetCritic")]
|
||||
// public class GetCriticPatch {
|
||||
// static void Postfix(ref bool __result) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// if (Main.alwaysCritical.Value) {
|
||||
// __result = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "SetGameSpeed")]
|
||||
// public class GameSpeedPatch {
|
||||
// static void Prefix(ref float f) {
|
||||
// // Console.WriteLine("SetGameSpeed Prefix! Argument is " + f);
|
||||
// if (f > 1) {
|
||||
// f *= Main.gameSpeed.Value;
|
||||
// // Console.WriteLine("Argument modified to " + f);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "Learn")]
|
||||
// public static class LearnManyPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// for (var i = 0; i < 5; i++) {
|
||||
// if (codes[i].opcode == OpCodes.Ldc_R4) {
|
||||
// Console.WriteLine("Changing " + codes[i]);
|
||||
// codes[i].operand = (float)codes[i].operand * 64;
|
||||
// Console.WriteLine("Changed " + codes[i]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(arbeitsmarkt), "ArbeitsmarktUpdaten")]
|
||||
// public static class ManyEmployeesPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// for (var i = codes.Count - 1; i > 0; i--) {
|
||||
// if (codes[i].opcode == OpCodes.Ldc_I4_3) {
|
||||
// Console.WriteLine("Changing " + codes[i]);
|
||||
// codes[i] = new CodeInstruction(OpCodes.Ldc_I4, 64);
|
||||
// Console.WriteLine("Changed " + codes[i]);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // [HarmonyPatch(typeof(AILerp), "MovementUpdate")]
|
||||
// public class MovementSpeedPatch {
|
||||
// static void Prefix(ref float deltaTime) {
|
||||
// Console.WriteLine("MovementUpdate Prefix! deltaTime is " + deltaTime);
|
||||
// deltaTime *= 16f;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // [HarmonyPatch(typeof(movementScript), "Move")]
|
||||
// public static class EmployeeMovementSpeedPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Mul, null));
|
||||
//
|
||||
// List<CodeInstruction> patch = new List<CodeInstruction>();
|
||||
// patch.Add(new CodeInstruction(OpCodes.Ldc_R4, 8));
|
||||
// patch.Add(new CodeInstruction(OpCodes.Mul, null));
|
||||
//
|
||||
// for (var i = codes.Count - 1; i > 0; i--) {
|
||||
// if (Main.IsMatch(codes, i, matcher)) {
|
||||
// Main.InsertAt(codes, i + 5, patch);
|
||||
// Console.WriteLine("Movement speed patched");
|
||||
// for (var j = 0; j < 15; j++) {
|
||||
// Console.WriteLine(codes[i + j]);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// Console.WriteLine("Return");
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "WochenUpdates")]
|
||||
// public static class ContractWorkAmount {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
// int methodIndex = -1;
|
||||
// List<CodeInstruction> pattern = new List<CodeInstruction>();
|
||||
//
|
||||
// List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldc_I4_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Callvirt, null));
|
||||
//
|
||||
// for (var i = 0; i < codes.Count; i++) {
|
||||
// if (codes[i].operand != null) {
|
||||
// if (codes[i].operand.ToString().Contains("UpdateContractWork")) {
|
||||
// methodIndex = i;
|
||||
// pattern.Add(codes[i - 3]);
|
||||
// pattern.Add(codes[i - 2]);
|
||||
// pattern.Add(codes[i - 1]);
|
||||
// pattern.Add(codes[i]);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// pattern[2].opcode = OpCodes.Ldc_I4_1;
|
||||
//
|
||||
// for (int i = 0; i < 16; i++) {
|
||||
// for (int j = 0; j < pattern.Count; j++) {
|
||||
// codes.Insert(methodIndex + i + j, pattern[j]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(platformScript), "SellPlayer")]
|
||||
// public static class ConsoleProductionReductionPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Call, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Add, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Stfld, null));
|
||||
//
|
||||
// for (var i = 0; i < codes.Count; i++) {
|
||||
// if (Main.IsMatch(codes, i, matcher)) {
|
||||
// codes[i + 3].operand = (float)codes[i + 3].operand * 8f;
|
||||
// codes[i + 4].operand = (float)codes[i + 4].operand * 8f;
|
||||
// Console.WriteLine("ConsoleProductionReductionPatch patched");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "AddFans")]
|
||||
// public static class AddFansPatch {
|
||||
// static void Prefix(ref int i) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// i *= Main.fans.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "Earn")]
|
||||
// public static class AddMoneyPatch {
|
||||
// static void Prefix(ref long amount) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// amount *= Main.money.Value;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@@ -1,2 +0,0 @@
|
||||
echo $(pwd)
|
||||
cp AgainstTheStorm/obj/Release/AgainstTheStorm.dll /c/Games/Against.the.Storm.v1.0.2r/BepInEx/Plugins
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
for lib in $(cat libs.txt); do find $1 -name "$lib" | sed 's|\\|/|g' | xargs -I% -- cp '%' .; done
|
||||
@@ -1,6 +0,0 @@
|
||||
0Harmony.dll
|
||||
Assembly-CSharp.dll
|
||||
BepInEx.dll
|
||||
ConfigurationManager.dll
|
||||
UnityEngine.CoreModule.dll
|
||||
UnityEngine.dll
|
||||
@@ -1,4 +0,0 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
151279b84fdcbaafd9f0fcb1f7663654a57733b1df3836fc5634a1051692a2db
|
||||
@@ -1,14 +0,0 @@
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\AgainstTheStorm.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\AgainstTheStorm.pdb
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\0Harmony.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\Assembly-CSharp.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\BepInEx.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\ConfigurationManager.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\Sirenix.Serialization.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\UnityEngine.CoreModule.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\UnityEngine.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.csproj.AssemblyReference.cache
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.csproj.CoreCompileInputs.cache
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.csproj.CopyComplete
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.pdb
|
||||
@@ -1,4 +0,0 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
4baf00dfc139a92b75b2a9b95a0819a23a33a039ecbb07edab3f692cd134a7da
|
||||
@@ -1,28 +0,0 @@
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\AgainstTheStorm.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\AgainstTheStorm.pdb
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\0Harmony.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\Assembly-CSharp.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\BepInEx.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\ConfigurationManager.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\Sirenix.Serialization.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\UnityEngine.CoreModule.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\UnityEngine.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Release\AgainstTheStorm.csproj.AssemblyReference.cache
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Release\AgainstTheStorm.csproj.CoreCompileInputs.cache
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Release\AgainstTheStorm.csproj.CopyComplete
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Release\AgainstTheStorm.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Release\AgainstTheStorm.pdb
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\AgainstTheStorm.dll
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\AgainstTheStorm.pdb
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\0Harmony.dll
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\Assembly-CSharp.dll
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\BepInEx.dll
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\ConfigurationManager.dll
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\Sirenix.Serialization.dll
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\UnityEngine.CoreModule.dll
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Release\UnityEngine.dll
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Release\AgainstTheStorm.csproj.AssemblyReference.cache
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Release\AgainstTheStorm.csproj.CoreCompileInputs.cache
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Release\AgainstTheStorm.csproj.CopyComplete
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Release\AgainstTheStorm.dll
|
||||
C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Release\AgainstTheStorm.pdb
|
||||
@@ -1,21 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005C0Harmony_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CAssembly_002DCSharp_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CBepInEx_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CMainAssembly_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CUnityEngine_002ECoreModule_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CUnityEngine_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005C0Harmony_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CAssembly_002DCSharp_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CBepInEx_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CConfigurationManager_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CSirenix_002ESerialization_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CUnityEngine_002ECoreModule_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CAgainstTheStorm_005CAgainstTheStorm_005Clibs_005CUnityEngine_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005C0Harmony_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CAssembly_002DCSharp_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CBepInEx_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CConfigurationManager_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CMainAssembly_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CUnityEngine_002ECoreModule_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CJetbrains_005CRiderProjects_005CBepinex_005CProjects_005CRegiments_005CRegiments_005Clibs_005CUnityEngine_002Edll/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
@@ -1 +0,0 @@
|
||||
cp 'C:/Users/Administrator/RiderProjects/Bepinex/Projects/Regiments/Regiments/obj/Release/Regiments.dll' 'C:/Program Files (x86)/Steam/steamapps/common/Regiments/BepInEx/plugins'
|
||||
1
Projects/AirportCEO
Submodule
1
Projects/AirportCEO
Submodule
Submodule Projects/AirportCEO added at fca9a14ad4
@@ -1,16 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AirportCEO", "AirportCEO\AirportCEO.csproj", "{DA9D274E-486F-4F82-84FF-CD9388CB0B09}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,4 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue"><AssemblyExplorer>
|
||||
<Assembly Path="C:\Users\Administrator\RiderProjects\Bepinex\Projects\SupermarketTogether\SupermarketTogether\bin\Release\Assembly-CSharp.dll" />
|
||||
</AssemblyExplorer></s:String></wpf:ResourceDictionary>
|
||||
@@ -1,6 +0,0 @@
|
||||
# CSharp formatting rules:
|
||||
[*.cs]
|
||||
csharp_new_line_before_open_brace = none
|
||||
csharp_new_line_before_else = false
|
||||
csharp_new_line_before_catch = false
|
||||
csharp_new_line_before_finally = false
|
||||
@@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
|
||||
<PropertyGroup>
|
||||
<GAME_DIR>C:/Games/Airport CEO</GAME_DIR>
|
||||
<GAME_MANAGED>$(GAME_DIR)/Airport CEO_Data/Managed</GAME_MANAGED>
|
||||
<GAME_BEPINEX>$(GAME_DIR)/BepInEx</GAME_BEPINEX>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{DA9D274E-486F-4F82-84FF-CD9388CB0B09}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DaveCEO</RootNamespace>
|
||||
<AssemblyName>DaveCEO</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<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' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DaveCEO.cs"/>
|
||||
<Compile Include="Properties\AssemblyInfo.cs"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>$(GAME_BEPINEX)/core/0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>$(GAME_BEPINEX)/core/BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>$(GAME_BEPINEX)/plugins/ConfigurationManager/ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>$(GAME_MANAGED)/Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>$(GAME_MANAGED)/UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>$(GAME_MANAGED)/UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
|
||||
</Project>
|
||||
@@ -1,41 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace DaveCEO {
|
||||
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
public class Main : BaseUnityPlugin {
|
||||
private const string pluginGuid = "DaveCEO";
|
||||
private const string pluginName = "DaveCEO";
|
||||
private const string pluginVersion = "1.0.0";
|
||||
|
||||
public static ConfigEntry<float> moneyMultiplier;
|
||||
|
||||
public void Awake() {
|
||||
moneyMultiplier = Config.Bind("General", "MoneyMultiplier", 1f);
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
foreach (var method in originalMethods) {
|
||||
Logger.LogInfo("Patched " + method.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch]
|
||||
public class Patches {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(EconomyController), "AddFunds")]
|
||||
public static void Prefix(ref float sum) {
|
||||
sum *= Main.moneyMultiplier.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
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("DaveCEO")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DaveCEO")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[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("DA9D274E-486F-4F82-84FF-CD9388CB0B09")]
|
||||
|
||||
// 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")]
|
||||
@@ -1,3 +0,0 @@
|
||||
- source: bin/Release/DaveCEO.dll
|
||||
target: C:\Games\Airport CEO\BepInEx\plugins\DaveCEO.dll
|
||||
delete: true
|
||||
@@ -1,4 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue"><AssemblyExplorer>
|
||||
<Assembly Path="C:\Users\Administrator\RiderProjects\Bepinex\Projects\SupermarketTogether\SupermarketTogether\bin\Release\Assembly-CSharp.dll" />
|
||||
</AssemblyExplorer></s:String></wpf:ResourceDictionary>
|
||||
@@ -1,4 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue"><AssemblyExplorer>
|
||||
<Assembly Path="C:\Users\Administrator\RiderProjects\Bepinex\Projects\SupermarketTogether\SupermarketTogether\bin\Release\Assembly-CSharp.dll" />
|
||||
</AssemblyExplorer></s:String></wpf:ResourceDictionary>
|
||||
1
Projects/BanquetForFools
Submodule
1
Projects/BanquetForFools
Submodule
Submodule Projects/BanquetForFools added at 0ee09b9731
1
Projects/BlacksmithMaster
Submodule
1
Projects/BlacksmithMaster
Submodule
Submodule Projects/BlacksmithMaster added at 1218181813
@@ -1,3 +0,0 @@
|
||||
BasedOnStyle: Google
|
||||
IndentWidth: 4
|
||||
ColumnLimit: 120
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlacksmithMaster", "BlacksmithMaster\BlacksmithMaster.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,94 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build"
|
||||
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>
|
||||
<GAME_DIR>C:\Games\Blacksmith.Master.Early.Access</GAME_DIR>
|
||||
<GAME_MANAGED>$(GAME_DIR)/Blacksmith Master_Data/Managed</GAME_MANAGED>
|
||||
<GAME_BEPINEX>$(GAME_DIR)/BepInEx</GAME_BEPINEX>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>BlacksmithMaster</RootNamespace>
|
||||
<AssemblyName>BlacksmithMaster</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<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' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<!-- <Compile Include="ModuleShieldGeneratorManager.cs" />
|
||||
<Compile Include="ObjectFieldMultiplier.cs" />
|
||||
<Compile Include="Patches.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SeekingProjectileManager.cs" />
|
||||
<Compile Include="ModuleWingManager.cs" />
|
||||
<Compile Include="ModuleBoosterManager.cs" />
|
||||
<Compile Include="ModuleWeaponGunManager.cs" />
|
||||
<Compile Include="ModuleEnergyManager.cs" />
|
||||
<Compile Include="ModuleEnergyStoreManager.cs" />
|
||||
<Compile Include="ModuleGyroManager.cs" />
|
||||
<Compile Include="ModuleItemHolderManager.cs" />
|
||||
<Compile Include="ModuleItemProducerManager.cs" />
|
||||
<Compile Include="ModuleRemoteChargerManager.cs" />
|
||||
<Compile Include="ModuleWheelsManager.cs" />
|
||||
<Compile Include="TankBeamManager.cs" />
|
||||
<Compile Include="ModuleWeaponManager.cs" />
|
||||
<Compile Include="CykUtil.cs" />
|
||||
<Compile Include="ModuleHeartManager.cs" />
|
||||
<Compile Include="ModuleFuelTankManager.cs" />
|
||||
<Compile Include="ProjectilePatch.cs" />
|
||||
<Compile Include="TankManager.cs" />
|
||||
<Compile Include="UISnapshotPanelBuyAll.cs" />
|
||||
<Compile Include="MultiBuy.cs" /> -->
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>$(GAME_BEPINEX)/core/0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>$(GAME_BEPINEX)/core/BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>$(GAME_MANAGED)/UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>$(GAME_MANAGED)/UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>$(GAME_MANAGED)/Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>$(GAME_BEPINEX)/plugins/ConfigurationManager/ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,151 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
using static TavernData;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[BepInPlugin(PluginGuid, PluginName, PluginVersion)]
|
||||
public class Main : BaseUnityPlugin {
|
||||
private const string PluginGuid = "Cykasmith";
|
||||
private const string PluginName = "Cykasmith";
|
||||
private const string PluginVersion = "1.0.0";
|
||||
|
||||
public static ConfigEntry<bool> debug;
|
||||
|
||||
public static ConfigEntry<float> xpMultiplier;
|
||||
public static ConfigEntry<float> moneyMultiplier;
|
||||
public static ConfigEntry<float> researchMultiplier;
|
||||
public static ConfigEntry<float> salaryMultiplier;
|
||||
public static ConfigEntry<float> dailyCustomerMultiplier;
|
||||
public static ConfigEntry<float> decorationAdditionMultiplier;
|
||||
public static ConfigEntry<float> globalSpeedMultiplier;
|
||||
public static ConfigEntry<bool> alwaysEvenly;
|
||||
public static ConfigEntry<bool> alwaysChad;
|
||||
|
||||
public void Awake() {
|
||||
debug = Config.Bind("General", "Debug", false);
|
||||
|
||||
xpMultiplier =
|
||||
Config.Bind("General", "XP Multiplier", 1f,
|
||||
new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(0.01f, 1024f)));
|
||||
moneyMultiplier =
|
||||
Config.Bind("General", "Money Multiplier", 1f,
|
||||
new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(0.01f, 1024f)));
|
||||
researchMultiplier = Config.Bind(
|
||||
"General", "Research Multiplier", 1f,
|
||||
new ConfigDescription("Research Multiplier", new AcceptableValueRange<float>(0.01f, 1024f)));
|
||||
salaryMultiplier =
|
||||
Config.Bind("General", "Salary Multiplier", 1f,
|
||||
new ConfigDescription("Salary Multiplier", new AcceptableValueRange<float>(0.01f, 1024f)));
|
||||
dailyCustomerMultiplier = Config.Bind(
|
||||
"General", "Daily Customer Multiplier", 1f,
|
||||
new ConfigDescription("Daily Customer Multiplier", new AcceptableValueRange<float>(0.01f, 1024f)));
|
||||
decorationAdditionMultiplier = Config.Bind(
|
||||
"General", "Decoration Addition Multiplier", 1f,
|
||||
new ConfigDescription("Decoration Addition Multiplier", new AcceptableValueRange<float>(0.01f, 1024f)));
|
||||
globalSpeedMultiplier = Config.Bind(
|
||||
"General", "Global Speed Multiplier", 1f,
|
||||
new ConfigDescription("Global Speed Multiplier", new AcceptableValueRange<float>(0.01f, 1024f)));
|
||||
alwaysEvenly =
|
||||
Config.Bind("General", "Always Evenly", false,
|
||||
new ConfigDescription("Always Evenly", new AcceptableValueRange<bool>(false, true)));
|
||||
alwaysChad = Config.Bind("General", "Always Chad", false,
|
||||
new ConfigDescription("Always Chad", new AcceptableValueRange<bool>(false, true)));
|
||||
|
||||
Logger.LogInfo("Cykasmith loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(PluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
}
|
||||
|
||||
public static void LogDebug(string message) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine(message);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(StaffBase), "AddXp")]
|
||||
public class TavernData_AddXp {
|
||||
public static void Prefix(ref int amount) {
|
||||
Main.LogDebug("Original XP amount: " + amount);
|
||||
amount = (int)((float)amount * Main.xpMultiplier.Value);
|
||||
Main.LogDebug("Modified XP amount: " + amount);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(TavernModel), "ChangeMoney")]
|
||||
public class TavernModel_ChangeMoney {
|
||||
public static void Prefix(ref int value) {
|
||||
Main.LogDebug("Original money amount: " + value);
|
||||
if (value > 0)
|
||||
value = (int)((float)value * Main.moneyMultiplier.Value);
|
||||
Main.LogDebug("Modified money amount: " + value);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(ResourcesModel), "ChangeResearchPoints")]
|
||||
public class ResourcesModel_ChangeResearchPoints {
|
||||
public static void Prefix(ref int value) {
|
||||
Main.LogDebug("Original research amount: " + value);
|
||||
if (value > 0)
|
||||
value = (int)((float)value * Main.researchMultiplier.Value);
|
||||
Main.LogDebug("Modified research amount: " + value);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(StaffInfo), "Salary", MethodType.Getter)]
|
||||
public class StaffInfo_GetSalary {
|
||||
public static void Postfix(ref int __result) {
|
||||
Main.LogDebug("Original salary: " + __result);
|
||||
__result = (int)((float)__result * Main.salaryMultiplier.Value);
|
||||
Main.LogDebug("Modified salary: " + __result);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(StaffModel), "RefreshGlobalModifiers")]
|
||||
public class StaffModel_RefreshGlobalModifiers {
|
||||
public static void Postfix(StaffModel __instance) {
|
||||
var instanceTrav = Traverse.Create(__instance);
|
||||
|
||||
var globalCustomersPerDayMultiplierField = instanceTrav.Field("GlobalCustomersPerDayMultiplier");
|
||||
var globalDecorationAdditionMultiplierField = instanceTrav.Field("GlobalDecorationAdditionMultiplier");
|
||||
var globalSpeedModifierField = instanceTrav.Field("GlobalSpeedModifier");
|
||||
|
||||
Main.LogDebug("Original daily customer: " + globalCustomersPerDayMultiplierField.GetValue<float>());
|
||||
globalCustomersPerDayMultiplierField.SetValue(globalCustomersPerDayMultiplierField.GetValue<float>() * Main.dailyCustomerMultiplier.Value);
|
||||
Main.LogDebug("Modified daily customer: " + globalCustomersPerDayMultiplierField.GetValue<float>());
|
||||
|
||||
Main.LogDebug("Original decoration addition: " + globalDecorationAdditionMultiplierField.GetValue<float>());
|
||||
globalDecorationAdditionMultiplierField.SetValue(globalDecorationAdditionMultiplierField.GetValue<float>() * Main.decorationAdditionMultiplier.Value);
|
||||
Main.LogDebug("Modified decoration addition: " + globalDecorationAdditionMultiplierField.GetValue<float>());
|
||||
|
||||
Main.LogDebug("Original global speed: " + globalSpeedModifierField.GetValue<float>());
|
||||
globalSpeedModifierField.SetValue(globalSpeedModifierField.GetValue<float>() * Main.globalSpeedMultiplier.Value);
|
||||
Main.LogDebug("Modified global speed: " + globalSpeedModifierField.GetValue<float>());
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(StaffUtil), "FillBasicInfo")]
|
||||
public class StaffUtil_FillBasicInfo {
|
||||
public static void Postfix(TavernData.StaffType staffType, Random rnd, ref TavernData.StaffInfo newPerson) {
|
||||
Main.LogDebug("Setting skill assignment strategy to evenly");
|
||||
if (Main.alwaysEvenly.Value)
|
||||
newPerson.SkillAssignmentStrategy = TavernData.SkillAssignmentStrategyType.Balanced;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(HireData), "GetStaffInfo")]
|
||||
public class TavernData_GetStaffInfo {
|
||||
public static void Prefix(Random rnd, int id, string staffName, bool isMale, ref bool shouldBeSuperWorker,
|
||||
ref EliteTraitType forcedEliteTrait) {
|
||||
Main.LogDebug("Setting shouldBeSuperWorker to true");
|
||||
if (Main.alwaysChad.Value)
|
||||
shouldBeSuperWorker = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
public class CykUtil {
|
||||
public static bool IsPlayerTank(Module module) {
|
||||
if (module == null)
|
||||
return false;
|
||||
TankBlock block = module.block;
|
||||
if (block == null)
|
||||
return false;
|
||||
Tank tank = block.tank;
|
||||
if (tank == null)
|
||||
return false;
|
||||
return tank.ControllableByLocalPlayer;
|
||||
}
|
||||
|
||||
public static Func<object, bool> isObjectPlayerTank = obj => {
|
||||
if (obj == null)
|
||||
return false;
|
||||
try {
|
||||
return IsPlayerTank(obj as Module);
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine("Failed to check if object is a player tank: " + e.Message);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleBoosterManager {
|
||||
private static readonly MultipliedObjectManager<FanJet> FanManager =
|
||||
new MultipliedObjectManager<FanJet>(ConfigureFanThruster);
|
||||
private static readonly MultipliedObjectManager<BoosterJet> JetManager =
|
||||
new MultipliedObjectManager<BoosterJet>(ConfigureJetThruster);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> fanThrustMultiplier;
|
||||
private static ConfigEntry<float> jetThrustMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
float min = 0.01f;
|
||||
float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("Booster", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
fanThrustMultiplier =
|
||||
config.Bind("Booster", "Fan Thrust Multiplier", 1f,
|
||||
new ConfigDescription("Fan Thrust Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
fanThrustMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
jetThrustMultiplier =
|
||||
config.Bind("Booster", "Jet Thrust Multiplier", 1f,
|
||||
new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
jetThrustMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureFanThruster(MultipliedObject<FanJet> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_Force", fanThrustMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static void ConfigureJetThruster(MultipliedObject<BoosterJet> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_Force", jetThrustMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.isObjectPlayerTank(obj);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleBooster), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleBooster __instance) {
|
||||
var trav = Traverse.Create(__instance);
|
||||
var fans = trav.Field("fans").GetValue<List<FanJet>>();
|
||||
var jets = trav.Field("jets").GetValue<List<BoosterJet>>();
|
||||
|
||||
foreach (var fan in fans) FanManager.OnObjectAttached(fan);
|
||||
foreach (var jet in jets) JetManager.OnObjectAttached(jet);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleBooster), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleBooster __instance) {
|
||||
var trav = Traverse.Create(__instance);
|
||||
var fans = trav.Field("fans").GetValue<List<FanJet>>();
|
||||
var jets = trav.Field("jets").GetValue<List<BoosterJet>>();
|
||||
|
||||
foreach (var fan in fans) FanManager.OnObjectDetached(fan);
|
||||
foreach (var jet in jets) JetManager.OnObjectDetached(jet);
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
FanManager.ApplyAll();
|
||||
JetManager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleBooster: {0}", obj);
|
||||
PostfixCreate(obj as ModuleBooster);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
using System;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleEnergyManager {
|
||||
private static readonly MultipliedObjectManager<ModuleEnergy> Manager =
|
||||
new MultipliedObjectManager<ModuleEnergy>(ConfigureModuleEnergy);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> outputMultiplier;
|
||||
private static ConfigEntry<float> powerUpDelayMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
float min = 0.01f;
|
||||
float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("Energy", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
outputMultiplier =
|
||||
config.Bind("Energy", "Output Multiplier", 1f,
|
||||
new ConfigDescription("Output Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
outputMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
powerUpDelayMultiplier = config.Bind(
|
||||
"Energy", "Power Up Delay Multiplier", 1f,
|
||||
new ConfigDescription("Power Up Delay Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
powerUpDelayMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureModuleEnergy(MultipliedObject<ModuleEnergy> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_OutputPerSecond", outputMultiplier, ShouldApply));
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_PowerUpDelay", powerUpDelayMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.IsPlayerTank(obj as Module);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleEnergy), "OnAnchorStatusChanged")]
|
||||
public static void PostfixCreate(ModuleEnergy __instance) {
|
||||
Manager.OnObjectAttached(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleEnergy), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleEnergy __instance) {
|
||||
Manager.OnObjectDetached(__instance);
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
Manager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleEnergy: {0}", obj);
|
||||
PostfixCreate(obj as ModuleEnergy);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
using System;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleEnergyStoreManager {
|
||||
private static readonly MultipliedObjectManager<ModuleEnergyStore> Manager =
|
||||
new MultipliedObjectManager<ModuleEnergyStore>(ConfigureModuleEnergyStore);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> capacityMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
float min = 0.01f;
|
||||
float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("Energy", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
capacityMultiplier =
|
||||
config.Bind("Energy", "Capacity Multiplier", 1f,
|
||||
new ConfigDescription("Capacity Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
capacityMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureModuleEnergyStore(MultipliedObject<ModuleEnergyStore> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_Capacity", capacityMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.IsPlayerTank(obj as Module);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleEnergyStore), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleEnergyStore __instance) {
|
||||
Manager.OnObjectAttached(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleEnergyStore), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleEnergyStore __instance) {
|
||||
Manager.OnObjectDetached(__instance);
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
Manager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleEnergyStore: {0}", obj);
|
||||
PostfixCreate(obj as ModuleEnergyStore);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
using System;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleFuelTankManager {
|
||||
private static readonly MultipliedObjectManager<ModuleFuelTank> Manager =
|
||||
new MultipliedObjectManager<ModuleFuelTank>(ConfigureFuelTank);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> fuelCapacityMultiplier;
|
||||
private static ConfigEntry<float> fuelRefillMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
float min = 0.01f;
|
||||
float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("FuelTank", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
fuelCapacityMultiplier = config.Bind(
|
||||
"FuelTank", "Fuel Capacity Multiplier", 1f,
|
||||
new ConfigDescription("Fuel Capacity Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
fuelCapacityMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
fuelRefillMultiplier =
|
||||
config.Bind("FuelTank", "Fuel Refill Multiplier", 1f,
|
||||
new ConfigDescription("Fuel Refill Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
fuelRefillMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureFuelTank(MultipliedObject<ModuleFuelTank> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_Capacity", fuelCapacityMultiplier, ShouldApply));
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_RefillRate", fuelRefillMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.isObjectPlayerTank(obj);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleFuelTank), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleFuelTank __instance) {
|
||||
Manager.OnObjectAttached(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleFuelTank), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleFuelTank __instance) {
|
||||
Manager.OnObjectDetached(__instance);
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
Manager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleFuelTank: {0}", obj);
|
||||
PostfixCreate(obj as ModuleFuelTank);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
using System;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleGyroManager {
|
||||
private static readonly MultipliedObjectManager<ModuleGyro> Manager =
|
||||
new MultipliedObjectManager<ModuleGyro>(ConfigureModuleGyro);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> activeSpeedMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
float min = 0.01f;
|
||||
float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("Gyro", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
activeSpeedMultiplier = config.Bind(
|
||||
"Gyro", "Active Speed Multiplier", 1f,
|
||||
new ConfigDescription("Active Speed Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
activeSpeedMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureModuleGyro(MultipliedObject<ModuleGyro> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_ActiveSpeed", activeSpeedMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.IsPlayerTank(obj as Module);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleGyro), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleGyro __instance) {
|
||||
Manager.OnObjectAttached(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleGyro), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleGyro __instance) {
|
||||
Manager.OnObjectDetached(__instance);
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
Manager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleGyro: {0}", obj);
|
||||
PostfixCreate(obj as ModuleGyro);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
using System;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleHeartManager {
|
||||
private static readonly MultipliedObjectManager<ModuleHeart> Manager =
|
||||
new MultipliedObjectManager<ModuleHeart>(ConfigureHeart);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> eventHorizonRadiusMultiplier;
|
||||
private static ConfigEntry<float> setupTimeMultiplier;
|
||||
private static ConfigEntry<float> startShrinkingRadiusMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
float min = 0.01f;
|
||||
float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("Heart", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
eventHorizonRadiusMultiplier = config.Bind(
|
||||
"Heart", "Event Horizon Radius Multiplier", 1f,
|
||||
new ConfigDescription("Event Horizon Radius Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
eventHorizonRadiusMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
setupTimeMultiplier =
|
||||
config.Bind("Heart", "Setup Time Multiplier", 1f,
|
||||
new ConfigDescription("Setup Time Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
setupTimeMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
startShrinkingRadiusMultiplier = config.Bind(
|
||||
"Heart", "Start Shrinking Radius Multiplier", 1f,
|
||||
new ConfigDescription("Start Shrinking Radius Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
startShrinkingRadiusMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureHeart(MultipliedObject<ModuleHeart> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_EventHorizonRadius", eventHorizonRadiusMultiplier,
|
||||
ShouldApply));
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_SetupTime", setupTimeMultiplier, ShouldApply));
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_StartShrinkingRadius", startShrinkingRadiusMultiplier,
|
||||
ShouldApply));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.isObjectPlayerTank(obj);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleHeart), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleHeart __instance) {
|
||||
Manager.OnObjectAttached(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleHeart), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleHeart __instance) {
|
||||
Manager.OnObjectDetached(__instance);
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
Manager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleHeart: {0}", obj);
|
||||
PostfixCreate(obj as ModuleHeart);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,164 +0,0 @@
|
||||
using System;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleItemHolderManager {
|
||||
private static readonly MultipliedObjectManager<ModuleItemHolder> BeamManager =
|
||||
new MultipliedObjectManager<ModuleItemHolder>(ConfigureBeam);
|
||||
private static readonly MultipliedObjectManager<ModuleItemHolderBeam> BeamHolderManager =
|
||||
new MultipliedObjectManager<ModuleItemHolderBeam>(ConfigureBeamHolder);
|
||||
private static readonly MultipliedObjectManager<ModuleItemPickup> BeamPickupManager =
|
||||
new MultipliedObjectManager<ModuleItemPickup>(ConfigureBeamPickup);
|
||||
|
||||
private static readonly MultipliedObjectManager<ModuleItemHolderMagnet> MagnetHolderManager =
|
||||
new MultipliedObjectManager<ModuleItemHolderMagnet>(ConfigureMagnetHolder);
|
||||
private static readonly MultipliedObjectManager<ModuleItemPickup> MagnetPickupManager =
|
||||
new MultipliedObjectManager<ModuleItemPickup>(ConfigureMagnetPickup);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> capacityPerStackMultiplier;
|
||||
private static ConfigEntry<float> beamStrengthMultiplier;
|
||||
private static ConfigEntry<float> beamHeightIncrementScaleMultiplier;
|
||||
private static ConfigEntry<float> beamPickupRangeMultiplier;
|
||||
private static ConfigEntry<float> magnetStrengthMultiplier;
|
||||
private static ConfigEntry<float> magnetPickupRangeMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
float min = 0.01f;
|
||||
float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("Item Holder", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
capacityPerStackMultiplier = config.Bind(
|
||||
"Item Holder", "Capacity Per Stack Multiplier", 1f,
|
||||
new ConfigDescription("Capacity Per Stack Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
capacityPerStackMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
beamStrengthMultiplier = config.Bind(
|
||||
"Item Holder", "Beam Strength Multiplier", 1f,
|
||||
new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
beamStrengthMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
beamHeightIncrementScaleMultiplier =
|
||||
config.Bind("Item Holder", "Beam Height Increment Scale Multiplier", 1f,
|
||||
new ConfigDescription("Beam Height Increment Scale Multiplier",
|
||||
new AcceptableValueRange<float>(min, max)));
|
||||
beamHeightIncrementScaleMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
beamPickupRangeMultiplier = config.Bind(
|
||||
"Item Holder", "Beam Pickup Range Multiplier", 1f,
|
||||
new ConfigDescription("Beam Pickup Range Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
beamPickupRangeMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
magnetStrengthMultiplier = config.Bind(
|
||||
"Item Holder", "Magnet Strength Multiplier", 1f,
|
||||
new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
magnetStrengthMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
magnetPickupRangeMultiplier = config.Bind(
|
||||
"Item Holder", "Magnet Pickup Range Multiplier", 1f,
|
||||
new ConfigDescription("Magnet Pickup Range Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
magnetPickupRangeMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureBeam(MultipliedObject<ModuleItemHolder> obj) {
|
||||
obj.AddField(
|
||||
new FieldConfiguration<int, float>("m_CapacityPerStack", capacityPerStackMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static void ConfigureBeamHolder(MultipliedObject<ModuleItemHolderBeam> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_BeamStrength", beamStrengthMultiplier, ShouldApply));
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_HeightIncrementScale",
|
||||
beamHeightIncrementScaleMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static void ConfigureBeamPickup(MultipliedObject<ModuleItemPickup> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_PickupRange", beamPickupRangeMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static void ConfigureMagnetHolder(MultipliedObject<ModuleItemHolderMagnet> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_Strength", magnetStrengthMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static void ConfigureMagnetPickup(MultipliedObject<ModuleItemPickup> obj) {
|
||||
obj.AddField(
|
||||
new FieldConfiguration<float, float>("m_PickupRange", magnetPickupRangeMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.IsPlayerTank(obj as Module);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolder), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleItemHolder __instance) {
|
||||
BeamManager.OnObjectAttached(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolder), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleItemHolder __instance) {
|
||||
BeamManager.OnObjectDetached(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleItemHolderBeam __instance) {
|
||||
var trav = Traverse.Create(__instance);
|
||||
var pickup = trav.Field("m_Pickup").GetValue<ModuleItemPickup>();
|
||||
|
||||
BeamHolderManager.OnObjectAttached(__instance);
|
||||
BeamPickupManager.OnObjectAttached(pickup);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleItemHolderBeam __instance) {
|
||||
var trav = Traverse.Create(__instance);
|
||||
var pickup = trav.Field("m_Pickup").GetValue<ModuleItemPickup>();
|
||||
|
||||
BeamHolderManager.OnObjectDetached(__instance);
|
||||
BeamPickupManager.OnObjectDetached(pickup);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleItemHolderMagnet __instance) {
|
||||
var trav = Traverse.Create(__instance);
|
||||
var pickup = trav.Field("m_Pickup").GetValue<ModuleItemPickup>();
|
||||
|
||||
MagnetHolderManager.OnObjectAttached(__instance);
|
||||
MagnetPickupManager.OnObjectAttached(pickup);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleItemHolderMagnet __instance) {
|
||||
var trav = Traverse.Create(__instance);
|
||||
var pickup = trav.Field("m_Pickup").GetValue<ModuleItemPickup>();
|
||||
|
||||
MagnetHolderManager.OnObjectDetached(__instance);
|
||||
MagnetPickupManager.OnObjectDetached(pickup);
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
BeamManager.ApplyAll();
|
||||
BeamHolderManager.ApplyAll();
|
||||
BeamPickupManager.ApplyAll();
|
||||
MagnetHolderManager.ApplyAll();
|
||||
MagnetPickupManager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleItemHolder: {0}", obj);
|
||||
PostfixCreate(obj as ModuleItemHolder);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
using System;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleItemProducerManager {
|
||||
private static readonly MultipliedObjectManager<ModuleItemProducer> Manager =
|
||||
new MultipliedObjectManager<ModuleItemProducer>(ConfigureModuleItemProducer);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> resourceGroundRadiusMultiplier;
|
||||
private static ConfigEntry<float> minDispenseIntervalMultiplier;
|
||||
private static ConfigEntry<float> secPerItemProducedMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
float min = 0.01f;
|
||||
float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("Item Producer", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
resourceGroundRadiusMultiplier = config.Bind(
|
||||
"Item Producer", "Resource Ground Radius Multiplier", 1f,
|
||||
new ConfigDescription("Resource Ground Radius Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
resourceGroundRadiusMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
minDispenseIntervalMultiplier = config.Bind(
|
||||
"Item Producer", "Min Dispense Interval Multiplier", 1f,
|
||||
new ConfigDescription("Min Dispense Interval Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
minDispenseIntervalMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
secPerItemProducedMultiplier = config.Bind(
|
||||
"Item Producer", "Sec Per Item Produced Multiplier", 1f,
|
||||
new ConfigDescription("Sec Per Item Produced Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
secPerItemProducedMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureModuleItemProducer(MultipliedObject<ModuleItemProducer> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_ResourceGroundRadius", resourceGroundRadiusMultiplier,
|
||||
ShouldApply));
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_MinDispenseInterval", minDispenseIntervalMultiplier,
|
||||
ShouldApply));
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_SecPerItemProduced", secPerItemProducedMultiplier,
|
||||
ShouldApply));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.IsPlayerTank(obj as Module);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemProducer), "GetClosestResourceReservoirInRange")]
|
||||
public static void PostfixCreate(ModuleItemProducer __instance) {
|
||||
Manager.OnObjectAttached(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemProducer), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleItemProducer __instance) {
|
||||
Manager.OnObjectDetached(__instance);
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
Manager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleItemProducer: {0}", obj);
|
||||
PostfixCreate(obj as ModuleItemProducer);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
using System;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleRemoteChargerManager {
|
||||
private static readonly MultipliedObjectManager<ModuleRemoteCharger> Manager =
|
||||
new MultipliedObjectManager<ModuleRemoteCharger>(ConfigureModuleRemoteCharger);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> arcFiringIntervalMultiplier;
|
||||
private static ConfigEntry<float> chargingRadiusMultiplier;
|
||||
private static ConfigEntry<float> powerTransferPerArcMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
const float min = 0.01f;
|
||||
const float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("Remote Charger", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
arcFiringIntervalMultiplier = config.Bind(
|
||||
"Remote Charger", "Arc Firing Interval Multiplier", 1f,
|
||||
new ConfigDescription("Arc Firing Interval Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
arcFiringIntervalMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
chargingRadiusMultiplier = config.Bind(
|
||||
"Remote Charger", "Charging Radius Multiplier", 1f,
|
||||
new ConfigDescription("Charging Radius Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
chargingRadiusMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
powerTransferPerArcMultiplier = config.Bind(
|
||||
"Remote Charger", "Power Transfer Per Arc Multiplier", 1f,
|
||||
new ConfigDescription("Power Transfer Per Arc Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
powerTransferPerArcMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureModuleRemoteCharger(MultipliedObject<ModuleRemoteCharger> obj) {
|
||||
obj.AddField(
|
||||
new FieldConfiguration<float, float>("m_ArcFiringInterval", arcFiringIntervalMultiplier, ShouldApply));
|
||||
obj.AddField(
|
||||
new FieldConfiguration<float, float>("m_ChargingRadius", chargingRadiusMultiplier, ShouldApply));
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_PowerTransferPerArc", powerTransferPerArcMultiplier,
|
||||
ShouldApply));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.IsPlayerTank(obj as Module);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleRemoteCharger __instance) {
|
||||
Manager.OnObjectAttached(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleRemoteCharger __instance) {
|
||||
Manager.OnObjectDetached(__instance);
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
Manager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleRemoteCharger: {0}", obj);
|
||||
PostfixCreate(obj as ModuleRemoteCharger);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
using System;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleShieldGeneratorManager {
|
||||
private static readonly MultipliedObjectManager<ModuleShieldGenerator> Manager =
|
||||
new MultipliedObjectManager<ModuleShieldGenerator>(ConfigureShieldGenerator);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> radiusMultiplier;
|
||||
private static ConfigEntry<float> radiusMultiplierHealing;
|
||||
private static ConfigEntry<float> heartbeatIntervalMultiplier;
|
||||
private static ConfigEntry<float> powerUpDelayMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
const float min = 0.01f;
|
||||
const float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("Shield", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
radiusMultiplier =
|
||||
config.Bind("Shield", "Radius Multiplier", 1f,
|
||||
new ConfigDescription("Radius Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
radiusMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
heartbeatIntervalMultiplier = config.Bind(
|
||||
"Shield", "Heartbeat Interval Multiplier", 1f,
|
||||
new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
heartbeatIntervalMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
powerUpDelayMultiplier = config.Bind(
|
||||
"Shield", "Power Up Delay Multiplier", 1f,
|
||||
new ConfigDescription("Power Up Delay Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
powerUpDelayMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
radiusMultiplierHealing = config.Bind(
|
||||
"Shield", "Radius Multiplier Healing", 1f,
|
||||
new ConfigDescription("Radius Multiplier Healing", new AcceptableValueRange<float>(min, max)));
|
||||
radiusMultiplierHealing.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureShieldGenerator(MultipliedObject<ModuleShieldGenerator> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_HealingHeartbeatInterval", heartbeatIntervalMultiplier,
|
||||
ShouldApply));
|
||||
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_Radius", radiusMultiplier, __instance => {
|
||||
if (!ShouldApply(__instance))
|
||||
return radiusMultiplier;
|
||||
var shield = (ModuleShieldGenerator)__instance;
|
||||
return shield.m_Healing ? radiusMultiplierHealing : radiusMultiplier;
|
||||
}));
|
||||
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_PowerUpDelay", powerUpDelayMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.IsPlayerTank(obj as Module);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleShieldGenerator), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleShieldGenerator __instance) {
|
||||
Manager.OnObjectAttached(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleShieldGenerator), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleShieldGenerator __instance) {
|
||||
Manager.OnObjectDetached(__instance);
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
Manager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleShieldGenerator: {0}", obj);
|
||||
PostfixCreate(obj as ModuleShieldGenerator);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
using System;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleWeaponGunManager {
|
||||
private static readonly MultipliedObjectManager<ModuleWeaponGun> Manager =
|
||||
new MultipliedObjectManager<ModuleWeaponGun>(ConfigureManager);
|
||||
private static readonly MultipliedObjectManager<FireData> FireDataManager =
|
||||
new MultipliedObjectManager<FireData>(ConfigureFireData);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> kickbackStrengthMultiplier;
|
||||
private static ConfigEntry<float> muzzleVelocityMultiplier;
|
||||
private static ConfigEntry<float> burstCooldownMultiplier;
|
||||
private static ConfigEntry<float> burstShotCountMultiplier;
|
||||
private static ConfigEntry<float> shotCooldownMultiplier;
|
||||
private static ConfigEntry<bool> seekingRoundsAll;
|
||||
private static ConfigEntry<bool> resetBurstOnInterruptAll;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
const float min = 0.01f;
|
||||
const float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("WeaponGun", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
kickbackStrengthMultiplier = config.Bind(
|
||||
"FireData", "Kickback Strength Multiplier", 1f,
|
||||
new ConfigDescription("Kickback Strength Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
kickbackStrengthMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
muzzleVelocityMultiplier = config.Bind(
|
||||
"FireData", "Muzzle Velocity Multiplier", 1f,
|
||||
new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
muzzleVelocityMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
burstCooldownMultiplier = config.Bind(
|
||||
"FireData", "Burst Cooldown Multiplier", 1f,
|
||||
new ConfigDescription("Burst Cooldown Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
burstCooldownMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
burstShotCountMultiplier = config.Bind(
|
||||
"FireData", "Burst Shot Count Multiplier", 1f,
|
||||
new ConfigDescription("Burst Shot Count Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
burstShotCountMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
shotCooldownMultiplier = config.Bind(
|
||||
"FireData", "Shot Cooldown Multiplier", 1f,
|
||||
new ConfigDescription("Shot Cooldown Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
shotCooldownMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
seekingRoundsAll =
|
||||
config.Bind("FireData", "Seeking Rounds All", false,
|
||||
new ConfigDescription("Seeking Rounds All", new AcceptableValueRange<bool>(false, true)));
|
||||
seekingRoundsAll.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
resetBurstOnInterruptAll = config.Bind(
|
||||
"FireData", "Reset Burst On Interrupt All", false,
|
||||
new ConfigDescription("Reset Burst On Interrupt All", new AcceptableValueRange<bool>(false, true)));
|
||||
resetBurstOnInterruptAll.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureManager(MultipliedObject<ModuleWeaponGun> obj) {
|
||||
obj.AddBooleanField(new BooleanFieldConfiguration("m_SeekingRounds", seekingRoundsAll, ShouldApply));
|
||||
obj.AddBooleanField(
|
||||
new BooleanFieldConfiguration("m_ResetBurstOnInterrupt", resetBurstOnInterruptAll, ShouldApply));
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_BurstCooldown", burstCooldownMultiplier, ShouldApply));
|
||||
obj.AddField(new FieldConfiguration<int, float>("m_BurstShotCount", burstShotCountMultiplier, ShouldApply));
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_ShotCooldown", shotCooldownMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static void ConfigureFireData(MultipliedObject<FireData> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_MuzzleVelocity", muzzleVelocityMultiplier));
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_KickbackStrength", kickbackStrengthMultiplier));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.IsPlayerTank(obj as Module);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWeaponGun), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleWeaponGun __instance) {
|
||||
Manager.OnObjectAttached(__instance);
|
||||
if (playerOnly.Value && !CykUtil.IsPlayerTank(__instance))
|
||||
return;
|
||||
|
||||
var trav = Traverse.Create(__instance);
|
||||
var firingData = trav.Field("m_FiringData");
|
||||
FireDataManager.OnObjectAttached(firingData.GetValue<FireData>());
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWeaponGun), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleWeaponGun __instance) {
|
||||
Manager.OnObjectAttached(__instance);
|
||||
var trav = Traverse.Create(__instance);
|
||||
if (playerOnly.Value && !CykUtil.IsPlayerTank(__instance))
|
||||
return;
|
||||
|
||||
var firingData = trav.Field("m_FiringData");
|
||||
FireDataManager.OnObjectDetached(firingData.GetValue<FireData>());
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
FireDataManager.ApplyAll();
|
||||
Manager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleWeaponGun: {0}", obj);
|
||||
PostfixCreate(obj as ModuleWeaponGun);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
using System;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleWeaponManager {
|
||||
private static readonly MultipliedObjectManager<ModuleWeapon> Manager =
|
||||
new MultipliedObjectManager<ModuleWeapon>(ConfigureManager);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> rotateSpeedMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
const float min = 0.01f;
|
||||
const float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("ModuleWeapon", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
rotateSpeedMultiplier = config.Bind(
|
||||
"ModuleWeapon", "Rotate Speed Multiplier", 1f,
|
||||
new ConfigDescription("Rotate Speed Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
rotateSpeedMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureManager(MultipliedObject<ModuleWeapon> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("m_RotateSpeed", rotateSpeedMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.IsPlayerTank(obj as Module);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWeapon), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleWeapon __instance) {
|
||||
Manager.OnObjectAttached(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWeapon), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleWeapon __instance) {
|
||||
Manager.OnObjectDetached(__instance);
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
Manager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleWeapon: {0}", obj);
|
||||
PostfixCreate(obj as ModuleWeapon);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
using System;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleWheelsManager {
|
||||
private static readonly MultipliedObjectManager<ManWheels.TorqueParams> TorqueParamsManager =
|
||||
new MultipliedObjectManager<ManWheels.TorqueParams>(ConfigureTorqueParams);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> torqueRpmMultiplier;
|
||||
private static ConfigEntry<float> torqueMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
const float min = 0.01f;
|
||||
const float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("TorqueParams", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
torqueRpmMultiplier =
|
||||
config.Bind("TorqueParams", "Torque RPM Multiplier", 1f,
|
||||
new ConfigDescription("Torque RPM Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
torqueRpmMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
torqueMultiplier =
|
||||
config.Bind("TorqueParams", "Torque Multiplier", 1f,
|
||||
new ConfigDescription("Torque Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
torqueMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureTorqueParams(MultipliedObject<ManWheels.TorqueParams> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("torqueCurveMaxRpm", torqueRpmMultiplier, ShouldApply));
|
||||
obj.AddField(new FieldConfiguration<float, float>("torqueCurveMaxTorque", torqueMultiplier, ShouldApply));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.IsPlayerTank(obj as Module);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWheels), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleWheels __instance) {
|
||||
var trav = Traverse.Create(__instance);
|
||||
var torqueParams = trav.Field("torqueParams");
|
||||
TorqueParamsManager.OnObjectAttached(torqueParams.GetValue<ManWheels.TorqueParams>());
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWheels), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleWheels __instance) {
|
||||
var trav = Traverse.Create(__instance);
|
||||
var torqueParams = trav.Field("torqueParams");
|
||||
TorqueParamsManager.OnObjectDetached(torqueParams.GetValue<ManWheels.TorqueParams>());
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
TorqueParamsManager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleWheels: {0}", obj);
|
||||
PostfixCreate(obj as ModuleWheels);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
using System;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ModuleWingManager {
|
||||
private static readonly MultipliedObjectManager<ModuleWing.Aerofoil> Manager =
|
||||
new MultipliedObjectManager<ModuleWing.Aerofoil>(ConfigureAerofoil);
|
||||
|
||||
private static ConfigEntry<bool> playerOnly;
|
||||
private static ConfigEntry<float> angleRangeMultiplier;
|
||||
private static ConfigEntry<float> turnSpeedMultiplier;
|
||||
private static ConfigEntry<float> liftStrengthMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
const float min = 0.01f;
|
||||
const float max = 32f;
|
||||
|
||||
playerOnly = config.Bind("Aerofoil", "Player Only", false, new ConfigDescription("Player Only"));
|
||||
playerOnly.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
angleRangeMultiplier =
|
||||
config.Bind("Aerofoil", "Angle Range Multiplier", 1f,
|
||||
new ConfigDescription("Angle Range Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
angleRangeMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
turnSpeedMultiplier =
|
||||
config.Bind("Aerofoil", "Turn Speed Multiplier", 1f,
|
||||
new ConfigDescription("Turn Speed Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
turnSpeedMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
liftStrengthMultiplier = config.Bind(
|
||||
"Aerofoil", "Lift Strength Multiplier", 1f,
|
||||
new ConfigDescription("Lift Strength Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
liftStrengthMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureAerofoil(MultipliedObject<ModuleWing.Aerofoil> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("flapAngleRangeActual", angleRangeMultiplier));
|
||||
obj.AddField(new FieldConfiguration<float, float>("flapAngleRangeVisual", angleRangeMultiplier));
|
||||
|
||||
obj.AddField(new FieldConfiguration<float, float>("flapTurnSpeed", turnSpeedMultiplier));
|
||||
obj.AddField(new FieldConfiguration<float, float>("liftStrength", liftStrengthMultiplier));
|
||||
}
|
||||
|
||||
private static readonly Func<object, bool> ShouldApply = obj => {
|
||||
if (!playerOnly.Value)
|
||||
return true;
|
||||
return CykUtil.IsPlayerTank(obj as Module);
|
||||
};
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWing), "OnAttached")]
|
||||
public static void PostfixCreate(ModuleWing __instance) {
|
||||
if (playerOnly.Value && !CykUtil.IsPlayerTank(__instance))
|
||||
return;
|
||||
for (int i = 0; i < __instance.m_Aerofoils.Length; i++) {
|
||||
var aerofoil = __instance.m_Aerofoils[i];
|
||||
Manager.OnObjectAttached(aerofoil);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWing), "OnDetaching")]
|
||||
public static void PostfixDestroy(ModuleWing __instance) {
|
||||
if (playerOnly.Value && !CykUtil.IsPlayerTank(__instance))
|
||||
return;
|
||||
foreach (var aerofoil in __instance.m_Aerofoils) Manager.OnObjectDetached(aerofoil);
|
||||
}
|
||||
|
||||
private static void DoPatch() {
|
||||
Manager.ApplyAll();
|
||||
}
|
||||
|
||||
public static readonly Func<Module, bool> Register = obj => {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Registering ModuleWing: {0}", obj);
|
||||
PostfixCreate(obj as ModuleWing);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class MultiBuy {
|
||||
public static UIShopBlockSelect panel;
|
||||
public static Traverse panelTraverse;
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(UIShopBlockSelect), "OnSpawn")]
|
||||
public static void PostfixCreate(UIShopBlockSelect __instance) {
|
||||
panel = __instance;
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("UISnapshotPanel.OnPool: {0}", __instance);
|
||||
panelTraverse = Traverse.Create(__instance);
|
||||
var placeButton = panelTraverse.Field("m_PurchaseBlockButton").GetValue<Button>();
|
||||
placeButton.gameObject.AddComponent<MultiBuyRightClickHandler>();
|
||||
}
|
||||
}
|
||||
|
||||
class MultiBuyRightClickHandler : MonoBehaviour, IPointerClickHandler {
|
||||
// private void Awake() {
|
||||
// }
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("MultiBuyRightClickHandler.OnPointerClick: {0} {1}", gameObject.name,
|
||||
eventData.button);
|
||||
try {
|
||||
if (eventData.button == PointerEventData.InputButton.Right) {
|
||||
UIBlockSelectGrid grid = MultiBuy.panelTraverse.Field("m_Grid").GetValue<UIBlockSelectGrid>();
|
||||
BlockTypes blockTypes;
|
||||
bool ok = grid.TryGetSelection(out blockTypes);
|
||||
if (!ok) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine(
|
||||
"MultiBuyRightClickHandler.OnPointerClick: Failed to get block selection from grid");
|
||||
return;
|
||||
}
|
||||
uint shopBlockPoolID = MultiBuy.panelTraverse.Field("m_ShopBlockPoolID").GetValue<uint>();
|
||||
|
||||
MethodInfo canPurchaseMethod =
|
||||
AccessTools.Method(typeof(UIShopBlockSelect), "CanPurchaseBlock", new[] { typeof(BlockTypes) });
|
||||
Func<BlockTypes, bool> canPurchase = (Func<BlockTypes, bool>)Delegate.CreateDelegate(
|
||||
typeof(Func<BlockTypes, bool>), MultiBuy.panel, canPurchaseMethod);
|
||||
|
||||
for (int i = 0; i < Main.multiBuyAmount.Value; i++) {
|
||||
if (!canPurchase.Invoke(blockTypes)) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("MultiBuyRightClickHandler.OnPointerClick: Can purchase no more {0}",
|
||||
blockTypes);
|
||||
return;
|
||||
}
|
||||
Singleton.Manager<ManPurchases>.inst.RequestPurchaseBlock(shopBlockPoolID, blockTypes, 1);
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("MultiBuyRightClickHandler.OnPointerClick: Purchased {0} block",
|
||||
blockTypes);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("MultiBuyRightClickHandler.OnPointerClick: Exception occurred: {0}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,531 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
public interface IFieldModifier {
|
||||
void CaptureOriginal();
|
||||
void Apply();
|
||||
void Restore();
|
||||
void LogValue(string prefix);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a field that can be multiplied by a configurable value
|
||||
/// </summary>
|
||||
/// <typeparam name="TField">The type of the field value</typeparam>
|
||||
/// <typeparam name="TMul">The type of the multiplier</typeparam>
|
||||
public class FieldConfiguration<TField, TMul> {
|
||||
private string _fieldName;
|
||||
private ConfigEntry<TMul> _defaultMultiplier;
|
||||
private Func<object, ConfigEntry<TMul>> _conditionalMultiplier;
|
||||
private Func<object, bool> _applyCondition;
|
||||
|
||||
public string FieldName {
|
||||
get { return _fieldName; }
|
||||
set { _fieldName = value; }
|
||||
}
|
||||
|
||||
public ConfigEntry<TMul> DefaultMultiplier {
|
||||
get { return _defaultMultiplier; }
|
||||
set { _defaultMultiplier = value; }
|
||||
}
|
||||
|
||||
public Func<object, ConfigEntry<TMul>> ConditionalMultiplier {
|
||||
get { return _conditionalMultiplier; }
|
||||
set { _conditionalMultiplier = value; }
|
||||
}
|
||||
|
||||
public Func<object, bool> ApplyCondition {
|
||||
get { return _applyCondition; }
|
||||
set { _applyCondition = value; }
|
||||
}
|
||||
|
||||
public FieldConfiguration(string fieldName, ConfigEntry<TMul> defaultMultiplier) {
|
||||
_fieldName = fieldName;
|
||||
_defaultMultiplier = defaultMultiplier;
|
||||
}
|
||||
|
||||
public FieldConfiguration(string fieldName, ConfigEntry<TMul> defaultMultiplier,
|
||||
Func<object, ConfigEntry<TMul>> conditionalMultiplier) {
|
||||
_fieldName = fieldName;
|
||||
_defaultMultiplier = defaultMultiplier;
|
||||
_conditionalMultiplier = conditionalMultiplier;
|
||||
}
|
||||
|
||||
public FieldConfiguration(string fieldName, ConfigEntry<TMul> defaultMultiplier,
|
||||
Func<object, bool> applyCondition) {
|
||||
_fieldName = fieldName;
|
||||
_defaultMultiplier = defaultMultiplier;
|
||||
_applyCondition = applyCondition;
|
||||
}
|
||||
|
||||
public FieldConfiguration(string fieldName, ConfigEntry<TMul> defaultMultiplier,
|
||||
Func<object, ConfigEntry<TMul>> conditionalMultiplier,
|
||||
Func<object, bool> applyCondition) {
|
||||
_fieldName = fieldName;
|
||||
_defaultMultiplier = defaultMultiplier;
|
||||
_conditionalMultiplier = conditionalMultiplier;
|
||||
_applyCondition = applyCondition;
|
||||
}
|
||||
|
||||
public ConfigEntry<TMul> GetMultiplier(object __instance) {
|
||||
if (_conditionalMultiplier == null) {
|
||||
return _defaultMultiplier;
|
||||
}
|
||||
return _conditionalMultiplier(__instance);
|
||||
}
|
||||
|
||||
public bool ShouldApply(object __instance) {
|
||||
if (_applyCondition == null) {
|
||||
return true;
|
||||
}
|
||||
return _applyCondition(__instance);
|
||||
}
|
||||
}
|
||||
|
||||
public class MultipliedField<TField, TMul> : IFieldModifier {
|
||||
private readonly string _fieldName;
|
||||
private readonly ConfigEntry<TMul> _multiplier;
|
||||
private readonly Traverse _parentTraverse;
|
||||
private readonly Func<object, bool> _applyCondition;
|
||||
private TField _originalValue;
|
||||
|
||||
public string FieldName {
|
||||
get { return _fieldName; }
|
||||
}
|
||||
|
||||
public MultipliedField(string fieldName, ConfigEntry<TMul> multiplier, Traverse parentTraverse,
|
||||
Func<object, bool> applyCondition = null) {
|
||||
_fieldName = fieldName;
|
||||
_multiplier = multiplier;
|
||||
_parentTraverse = parentTraverse;
|
||||
_applyCondition = applyCondition;
|
||||
|
||||
if (!parentTraverse.Field(fieldName).FieldExists()) {
|
||||
throw new ArgumentException(
|
||||
string.Format("Field {0} does not exist on {1}", fieldName, parentTraverse));
|
||||
}
|
||||
|
||||
// Verify TField is a numeric type
|
||||
if (!IsNumericType(typeof(TField))) {
|
||||
throw new ArgumentException(
|
||||
string.Format("Field type {0} must be a numeric type", typeof(TField).Name));
|
||||
}
|
||||
|
||||
// Verify TMul is a numeric type
|
||||
if (!IsNumericType(typeof(TMul))) {
|
||||
throw new ArgumentException(
|
||||
string.Format("Multiplier type {0} must be a numeric type", typeof(TMul).Name));
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsNumericType(Type type) {
|
||||
return type == typeof(byte) || type == typeof(sbyte) || type == typeof(short) || type == typeof(ushort) ||
|
||||
type == typeof(int) || type == typeof(uint) || type == typeof(long) || type == typeof(ulong) ||
|
||||
type == typeof(float) || type == typeof(double) || type == typeof(decimal);
|
||||
}
|
||||
|
||||
private TField MultiplyValues(TField fieldValue, TMul multiplierValue) {
|
||||
// Convert both to double for the multiplication
|
||||
double fieldDouble = Convert.ToDouble(fieldValue);
|
||||
double multiplierDouble = Convert.ToDouble(multiplierValue);
|
||||
double result = fieldDouble * multiplierDouble;
|
||||
// Convert back to TField
|
||||
return (TField)Convert.ChangeType(result, typeof(TField));
|
||||
}
|
||||
|
||||
public TField GetValue() {
|
||||
var value = _parentTraverse.Field(_fieldName).GetValue();
|
||||
if (value == null)
|
||||
throw new InvalidOperationException(string.Format("Field {0} returned null", _fieldName));
|
||||
return (TField)value;
|
||||
}
|
||||
|
||||
public void SetValue(TField value) {
|
||||
_parentTraverse.Field(_fieldName).SetValue(value);
|
||||
var verifyValue = GetValue();
|
||||
if (!verifyValue.Equals(value))
|
||||
throw new InvalidOperationException(
|
||||
string.Format("Field {0} set to {1} but read back as {2}", _fieldName, value, verifyValue));
|
||||
}
|
||||
|
||||
public void CaptureOriginal() {
|
||||
_originalValue = GetValue();
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Captured original value for {0}: {1}", _fieldName, _originalValue);
|
||||
}
|
||||
|
||||
public void Apply() {
|
||||
try {
|
||||
if (_applyCondition != null && !_applyCondition(_parentTraverse.GetValue())) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Skipping {0}: condition not met", _fieldName);
|
||||
return;
|
||||
}
|
||||
|
||||
var newValue = MultiplyValues(_originalValue, _multiplier.Value);
|
||||
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Applying to {0}: {1} * {2} = {3}", _fieldName, _originalValue, _multiplier.Value,
|
||||
newValue);
|
||||
|
||||
SetValue(newValue);
|
||||
} catch (Exception e) {
|
||||
throw new InvalidOperationException(string.Format("Failed to apply multiplication to {0}", _fieldName),
|
||||
e);
|
||||
}
|
||||
}
|
||||
|
||||
public void Restore() {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Restoring {0} to original value: {1}", _fieldName, _originalValue);
|
||||
SetValue(_originalValue);
|
||||
}
|
||||
|
||||
public void LogValue(string prefix) {
|
||||
if (!Main.debug.Value)
|
||||
return;
|
||||
var currentValue = GetValue();
|
||||
Console.WriteLine("{0} {1}; {2}: {3} (original: {4}, multiplier: {5})", prefix, _parentTraverse, _fieldName,
|
||||
currentValue, _originalValue, _multiplier.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public class BooleanFieldConfiguration {
|
||||
private string _fieldName;
|
||||
private ConfigEntry<bool> _value;
|
||||
private Func<object, ConfigEntry<bool>> _conditionalValue;
|
||||
private Func<object, bool> _applyCondition;
|
||||
|
||||
public string FieldName {
|
||||
get { return _fieldName; }
|
||||
set { _fieldName = value; }
|
||||
}
|
||||
|
||||
public ConfigEntry<bool> Value {
|
||||
get { return _value; }
|
||||
set { _value = value; }
|
||||
}
|
||||
|
||||
public Func<object, ConfigEntry<bool>> ConditionalValue {
|
||||
get { return _conditionalValue; }
|
||||
set { _conditionalValue = value; }
|
||||
}
|
||||
|
||||
public Func<object, bool> ApplyCondition {
|
||||
get { return _applyCondition; }
|
||||
set { _applyCondition = value; }
|
||||
}
|
||||
|
||||
public BooleanFieldConfiguration(string fieldName, ConfigEntry<bool> value) {
|
||||
_fieldName = fieldName;
|
||||
_value = value;
|
||||
}
|
||||
|
||||
public BooleanFieldConfiguration(string fieldName, ConfigEntry<bool> value,
|
||||
Func<object, ConfigEntry<bool>> conditionalValue) {
|
||||
_fieldName = fieldName;
|
||||
_value = value;
|
||||
_conditionalValue = conditionalValue;
|
||||
}
|
||||
|
||||
public BooleanFieldConfiguration(string fieldName, ConfigEntry<bool> value, Func<object, bool> applyCondition) {
|
||||
_fieldName = fieldName;
|
||||
_value = value;
|
||||
_applyCondition = applyCondition;
|
||||
}
|
||||
|
||||
public BooleanFieldConfiguration(string fieldName, ConfigEntry<bool> value,
|
||||
Func<object, ConfigEntry<bool>> conditionalValue,
|
||||
Func<object, bool> applyCondition) {
|
||||
_fieldName = fieldName;
|
||||
_value = value;
|
||||
_conditionalValue = conditionalValue;
|
||||
_applyCondition = applyCondition;
|
||||
}
|
||||
|
||||
public ConfigEntry<bool> GetValue(object __instance) {
|
||||
if (_conditionalValue == null) {
|
||||
return _value;
|
||||
}
|
||||
return _conditionalValue(__instance);
|
||||
}
|
||||
|
||||
public bool ShouldApply(object __instance) {
|
||||
if (_applyCondition == null) {
|
||||
return true;
|
||||
}
|
||||
return _applyCondition(__instance);
|
||||
}
|
||||
}
|
||||
|
||||
public class BooleanField : IFieldModifier {
|
||||
private readonly string _fieldName;
|
||||
private readonly ConfigEntry<bool> _value;
|
||||
private readonly Traverse _parentTraverse;
|
||||
private readonly Func<object, bool> _applyCondition;
|
||||
private bool _originalValue;
|
||||
|
||||
public string FieldName {
|
||||
get { return _fieldName; }
|
||||
}
|
||||
|
||||
public BooleanField(string fieldName, ConfigEntry<bool> value, Traverse parentTraverse,
|
||||
Func<object, bool> applyCondition = null) {
|
||||
_fieldName = fieldName;
|
||||
_value = value;
|
||||
_parentTraverse = parentTraverse;
|
||||
_applyCondition = applyCondition;
|
||||
|
||||
if (!parentTraverse.Field(fieldName).FieldExists()) {
|
||||
throw new ArgumentException(
|
||||
string.Format("Field {0} does not exist on {1}", fieldName, parentTraverse));
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetValue() {
|
||||
var value = _parentTraverse.Field(_fieldName).GetValue();
|
||||
if (value == null)
|
||||
throw new InvalidOperationException(string.Format("Field {0} returned null", _fieldName));
|
||||
return (bool)value;
|
||||
}
|
||||
|
||||
public void SetValue(bool value) {
|
||||
_parentTraverse.Field(_fieldName).SetValue(value);
|
||||
var verifyValue = GetValue();
|
||||
if (verifyValue != value)
|
||||
throw new InvalidOperationException(
|
||||
string.Format("Field {0} set to {1} but read back as {2}", _fieldName, value, verifyValue));
|
||||
}
|
||||
|
||||
public void CaptureOriginal() {
|
||||
_originalValue = GetValue();
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Captured original value for {0}: {1}", _fieldName, _originalValue);
|
||||
}
|
||||
|
||||
public void Apply() {
|
||||
try {
|
||||
if (_applyCondition != null && !_applyCondition(_parentTraverse.GetValue())) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Skipping {0}: condition not met", _fieldName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_value.Value) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Applying to {0}: forcing to true", _fieldName);
|
||||
|
||||
SetValue(true);
|
||||
} else {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Applying to {0}: leaving as {1} (config is false)", _fieldName, GetValue());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new InvalidOperationException(string.Format("Failed to apply value to {0}", _fieldName), e);
|
||||
}
|
||||
}
|
||||
|
||||
public void Restore() {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Restoring {0} to original value: {1}", _fieldName, _originalValue);
|
||||
SetValue(_originalValue);
|
||||
}
|
||||
|
||||
public void LogValue(string prefix) {
|
||||
if (!Main.debug.Value)
|
||||
return;
|
||||
var currentValue = GetValue();
|
||||
Console.WriteLine("{0} {1}; {2}: {3} (original: {4}, config: {5})", prefix, _parentTraverse, _fieldName,
|
||||
currentValue, _originalValue, _value.Value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an object with multiple fields that can be multiplied
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the object being managed</typeparam>
|
||||
public class MultipliedObject<T> {
|
||||
private readonly T _instance;
|
||||
private readonly Traverse _objectTraverse;
|
||||
private readonly Dictionary<string, IFieldModifier> _fields;
|
||||
|
||||
public MultipliedObject(T __instance) {
|
||||
_instance = __instance;
|
||||
_objectTraverse = Traverse.Create(__instance);
|
||||
_fields = new Dictionary<string, IFieldModifier>();
|
||||
}
|
||||
|
||||
public void AddField<TField, TMul>(FieldConfiguration<TField, TMul> config) {
|
||||
var multiplier = config.GetMultiplier(_instance);
|
||||
_fields[config.FieldName] =
|
||||
new MultipliedField<TField, TMul>(config.FieldName, multiplier, _objectTraverse, config.ShouldApply);
|
||||
}
|
||||
|
||||
public void AddBooleanField(BooleanFieldConfiguration config) {
|
||||
var value = config.GetValue(_instance);
|
||||
_fields[config.FieldName] = new BooleanField(config.FieldName, value, _objectTraverse, config.ShouldApply);
|
||||
}
|
||||
|
||||
public void CaptureFrom() {
|
||||
foreach (var field in _fields.Values) {
|
||||
field.CaptureOriginal();
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyTo(IEnumerable<string> fieldNames = null) {
|
||||
IEnumerable<string> fieldsToApply = fieldNames ?? _fields.Keys;
|
||||
foreach (var fieldName in fieldsToApply.Where(name => _fields.ContainsKey(name)))
|
||||
_fields[fieldName].Apply();
|
||||
}
|
||||
|
||||
public void RestoreTo(IEnumerable<string> fieldNames = null) {
|
||||
IEnumerable<string> fieldsToRestore = fieldNames ?? _fields.Keys;
|
||||
foreach (var fieldName in fieldsToRestore.Where(name => _fields.ContainsKey(name)))
|
||||
_fields[fieldName].Restore();
|
||||
}
|
||||
|
||||
public void LogValues(string prefix) {
|
||||
if (!Main.debug.Value)
|
||||
return;
|
||||
foreach (var field in _fields.Values) {
|
||||
field.LogValue(prefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Manages a collection of objects whose fields can be multiplied
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of objects being managed</typeparam>
|
||||
public class MultipliedObjectManager<T> {
|
||||
private readonly Dictionary<T, MultipliedObject<T>> _managedObjects;
|
||||
private readonly Action<MultipliedObject<T>> _configureObject;
|
||||
|
||||
public MultipliedObjectManager(Action<MultipliedObject<T>> configureObject) {
|
||||
if (configureObject == null)
|
||||
throw new ArgumentNullException("configureObject");
|
||||
|
||||
_configureObject = configureObject;
|
||||
_managedObjects = new Dictionary<T, MultipliedObject<T>>();
|
||||
}
|
||||
|
||||
private void SafeRemove(T __instance) {
|
||||
if (__instance == null)
|
||||
return;
|
||||
|
||||
try {
|
||||
_managedObjects.Remove(__instance);
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine("Error removing __instance from _managedObjects: {0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnObjectAttached(T __instance) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("{0}.OnAttached", typeof(T).Name);
|
||||
|
||||
if (__instance == null) {
|
||||
Console.WriteLine("Attempted to attach null __instance");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (_managedObjects.ContainsKey(__instance)) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("{0} already managed, skipping", typeof(T).Name);
|
||||
return;
|
||||
}
|
||||
|
||||
var multipliedObject = new MultipliedObject<T>(__instance);
|
||||
_configureObject(multipliedObject);
|
||||
multipliedObject.CaptureFrom();
|
||||
_managedObjects.Add(__instance, multipliedObject);
|
||||
multipliedObject.LogValues("Patching");
|
||||
|
||||
ApplyTo(__instance);
|
||||
multipliedObject.LogValues("Patched");
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine("Error in OnObjectAttached: {0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnObjectDetached(T __instance) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("{0}.OnDetaching", typeof(T).Name);
|
||||
if (__instance == null) {
|
||||
Console.WriteLine("Attempted to detach null __instance");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
MultipliedObject<T> multipliedObject;
|
||||
if (_managedObjects.TryGetValue(__instance, out multipliedObject)) {
|
||||
if (Main.debug.Value)
|
||||
multipliedObject.LogValues("Restoring");
|
||||
|
||||
try {
|
||||
RestoreTo(__instance);
|
||||
multipliedObject.LogValues("Restored");
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine("Error restoring values: {0}", e);
|
||||
}
|
||||
|
||||
SafeRemove(__instance);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine("Error in OnObjectDetached: {0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyAll(IEnumerable<string> fieldNames = null) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Modifying {0} {1}", _managedObjects.Count, typeof(T).Name);
|
||||
|
||||
// Make a copy of the keys to avoid modification during enumeration
|
||||
var instances = _managedObjects.Keys.ToList();
|
||||
|
||||
foreach (var __instance in instances) {
|
||||
try {
|
||||
RestoreTo(__instance, fieldNames);
|
||||
ApplyTo(__instance, fieldNames);
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine("Error applying to __instance: {0}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyTo(T __instance, IEnumerable<string> fieldNames = null) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Applying {0}", typeof(T).Name);
|
||||
if (__instance == null)
|
||||
return;
|
||||
|
||||
try {
|
||||
MultipliedObject<T> obj;
|
||||
if (_managedObjects.TryGetValue(__instance, out obj))
|
||||
obj.ApplyTo(fieldNames);
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine("Error in ApplyTo: {0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void RestoreTo(T __instance, IEnumerable<string> fieldNames = null) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Restoring {0}", typeof(T).Name);
|
||||
if (__instance == null)
|
||||
return;
|
||||
|
||||
try {
|
||||
MultipliedObject<T> obj;
|
||||
if (_managedObjects.TryGetValue(__instance, out obj))
|
||||
obj.RestoreTo(fieldNames);
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine("Error in RestoreTo: {0}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class Patches {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ManLicenses), "AddXP")]
|
||||
static void XpMulti(FactionSubTypes corporation, ref int xp, bool showUI = true) {
|
||||
xp = (int)(xp * Main.xpMultiplier.Value);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ManPlayer), "AddMoney")]
|
||||
static void MoneyMulti(ref int amount) {
|
||||
amount = (int)(amount * Main.moneyMultiplier.Value);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TechHolders), "SetHeartbeatInterval")]
|
||||
static void HeartbeatMulti(ref float interval) {
|
||||
interval *= Main.heartbeatIntervalMultiplier.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class ProjectilePatch {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(Projectile), "StickToObjectWithVisuals")]
|
||||
static void Prefix(Projectile __instance) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Projectile created");
|
||||
var trav = Traverse.Create(__instance);
|
||||
var explodeOnStick = trav.Field("m_ExplodeOnStick");
|
||||
|
||||
if (!explodeOnStick.GetValue<bool>()) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("Exploding on stick");
|
||||
explodeOnStick.SetValue(Main.projectileExplodeOnStick.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
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("BlacksmithMaster")]
|
||||
[assembly:AssemblyDescription("")]
|
||||
[assembly:AssemblyConfiguration("")]
|
||||
[assembly:AssemblyCompany("")]
|
||||
[assembly:AssemblyProduct("BlacksmithMaster")]
|
||||
[assembly:AssemblyCopyright("Copyright © 2023")]
|
||||
[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("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
|
||||
|
||||
// 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")]
|
||||
@@ -1,30 +0,0 @@
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
public class SeekingProjectileManager {
|
||||
[HarmonyPatch(typeof(SeekingProjectile), "OnSpawn")]
|
||||
class Patch {
|
||||
public static void Postfix(SeekingProjectile __instance) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("SeekingProjectile created");
|
||||
|
||||
SetField(
|
||||
__instance, "m_VisionConeAngle",
|
||||
Main.seekingProjectileVisionConeAngleMultiplier.Value * GetField(__instance, "m_VisionConeAngle"));
|
||||
SetField(__instance, "m_VisionRange",
|
||||
Main.seekingProjectileVisionRangeMultiplier.Value * GetField(__instance, "m_VisionRange"));
|
||||
SetField(__instance, "m_TurnSpeed",
|
||||
Main.seekingProjectileTurningSpeedMultiplier.Value * GetField(__instance, "m_TurnSpeed"));
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetField(SeekingProjectile seekingProjectile, string field) {
|
||||
return Traverse.Create(seekingProjectile).Field(field).GetValue() as float ? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetField(SeekingProjectile seekingProjectile, string field, float value) {
|
||||
Traverse.Create(seekingProjectile).Field(field).SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class TankBeamManager {
|
||||
private static readonly MultipliedObjectManager<TankBeam> Manager =
|
||||
new MultipliedObjectManager<TankBeam>(ConfigureBeam);
|
||||
|
||||
public static ConfigEntry<float> hoverClearanceMultiplier;
|
||||
public static ConfigEntry<float> nudgeSpeedForwardMultiplier;
|
||||
public static ConfigEntry<float> nudgeSpeedRotateMultiplier;
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
float min = 0.01f;
|
||||
float max = 32f;
|
||||
|
||||
hoverClearanceMultiplier = config.Bind(
|
||||
"TankBeam", "Hover Clearance Multiplier", 1f,
|
||||
new ConfigDescription("Hover Clearance Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
hoverClearanceMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
nudgeSpeedForwardMultiplier = config.Bind(
|
||||
"TankBeam", "Nudge Speed Forward Multiplier", 1f,
|
||||
new ConfigDescription("Nudge Speed Forward Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
nudgeSpeedForwardMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
|
||||
nudgeSpeedRotateMultiplier = config.Bind(
|
||||
"TankBeam", "Nudge Speed Rotate Multiplier", 1f,
|
||||
new ConfigDescription("Nudge Speed Rotate Multiplier", new AcceptableValueRange<float>(min, max)));
|
||||
nudgeSpeedRotateMultiplier.SettingChanged += (sender, args) => DoPatch();
|
||||
}
|
||||
|
||||
private static void ConfigureBeam(MultipliedObject<TankBeam> obj) {
|
||||
obj.AddField(new FieldConfiguration<float, float>("hoverClearance", hoverClearanceMultiplier));
|
||||
obj.AddField(new FieldConfiguration<float, float>("nudgeSpeedForward", nudgeSpeedForwardMultiplier));
|
||||
obj.AddField(new FieldConfiguration<float, float>("nudgeSpeedRotate", nudgeSpeedRotateMultiplier));
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TankBeam), "EnableBeam")]
|
||||
public static void PostfixCreate(TankBeam __instance, ref bool enable) {
|
||||
if (enable)
|
||||
Manager.OnObjectAttached(__instance);
|
||||
else
|
||||
Manager.OnObjectDetached(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
Manager.ApplyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class TankManager {
|
||||
public static ConfigEntry<bool> recheck;
|
||||
public static Dictionary<Type, Func<Module, bool>> moduleManagerMapper =
|
||||
new Dictionary<Type, Func<Module, bool>>();
|
||||
|
||||
public static void Setup(ConfigFile config) {
|
||||
recheck = config.Bind("Tank", "Recheck", false, new ConfigDescription("Recheck"));
|
||||
moduleManagerMapper.Add(typeof(ModuleBooster), ModuleBoosterManager.Register);
|
||||
moduleManagerMapper.Add(typeof(ModuleEnergy), ModuleEnergyManager.Register);
|
||||
moduleManagerMapper.Add(typeof(ModuleEnergyStore), ModuleEnergyStoreManager.Register);
|
||||
moduleManagerMapper.Add(typeof(ModuleFuelTank), ModuleFuelTankManager.Register);
|
||||
moduleManagerMapper.Add(typeof(ModuleGyro), ModuleGyroManager.Register);
|
||||
moduleManagerMapper.Add(typeof(ModuleHeart), ModuleHeartManager.Register);
|
||||
moduleManagerMapper.Add(typeof(ModuleItemHolder), ModuleItemHolderManager.Register);
|
||||
moduleManagerMapper.Add(typeof(ModuleItemProducer), ModuleItemProducerManager.Register);
|
||||
moduleManagerMapper.Add(typeof(ModuleRemoteCharger), ModuleRemoteChargerManager.Register);
|
||||
moduleManagerMapper.Add(typeof(ModuleShieldGenerator), ModuleShieldGeneratorManager.Register);
|
||||
moduleManagerMapper.Add(typeof(ModuleWeaponGun), ModuleWeaponGunManager.Register);
|
||||
moduleManagerMapper.Add(typeof(ModuleWeapon), ModuleWeaponManager.Register);
|
||||
moduleManagerMapper.Add(typeof(ModuleWheels), ModuleWheelsManager.Register);
|
||||
moduleManagerMapper.Add(typeof(ModuleWing), ModuleWingManager.Register);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(Tank), "NotifyAnchor")]
|
||||
public static void PostfixCreate(Tank __instance, ModuleAnchor anchor, bool anchored) {
|
||||
if (Main.debug.Value)
|
||||
Console.WriteLine("TankManager.NotifyAnchor: {0}", __instance);
|
||||
if (!__instance.ControllableByLocalPlayer)
|
||||
return;
|
||||
if (!recheck.Value)
|
||||
return;
|
||||
|
||||
foreach (Transform child in __instance.transform) {
|
||||
GameObject childObj = child.gameObject;
|
||||
Component[] components = childObj.GetComponents<Component>();
|
||||
foreach (Component component in components) {
|
||||
Func<Module, bool> manager;
|
||||
if (moduleManagerMapper.TryGetValue(component.GetType(), out manager))
|
||||
manager(component as Module);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,181 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
using Snapshots;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace BlacksmithMaster {
|
||||
[HarmonyPatch]
|
||||
public class UISnapshotPanelBuyAll {
|
||||
public static UISnapshotPanel panel;
|
||||
public static Traverse panelTraverse;
|
||||
public static SnapshotLiveData selectedData;
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(UISnapshotPanel), "OnPool")]
|
||||
public static void PostfixCreate(UISnapshotPanel __instance) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("UISnapshotPanel.OnPool: {0}", __instance);
|
||||
panel = __instance;
|
||||
panelTraverse = Traverse.Create(__instance);
|
||||
var placeButton = panelTraverse.Field("m_PlaceButton").GetValue<Button>();
|
||||
placeButton.gameObject.AddComponent<RightClickHandler>();
|
||||
|
||||
var swapButton = panelTraverse.Field("m_SwapButton").GetValue<Button>();
|
||||
swapButton.gameObject.AddComponent<RightClickHandlerSwap>();
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(UISnapshotPanel), "OnSelectedChanged")]
|
||||
public static void PostfixCreate(UISnapshotPanel __instance, ref SnapshotLiveData selectedData) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("UISnapshotPanel.OnSelectedChanged: {0}", __instance);
|
||||
UISnapshotPanelBuyAll.selectedData = selectedData;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class BaseRightClickHandler : MonoBehaviour, IPointerClickHandler {
|
||||
protected static Traverse m_TechAvailLookupTraverse;
|
||||
protected static Dictionary<Snapshot, TechDataAvailValidation> m_TechAvailLookup;
|
||||
|
||||
protected virtual void Awake() {
|
||||
var trav = Traverse.Create(Singleton.Manager<ManSnapshots>.inst);
|
||||
m_TechAvailLookupTraverse = trav.Field("m_TechAvailLookup");
|
||||
m_TechAvailLookup = m_TechAvailLookupTraverse.GetValue<Dictionary<Snapshot, TechDataAvailValidation>>();
|
||||
}
|
||||
|
||||
protected Dictionary<BlockTypes, int> CalculateMissingBlocks(
|
||||
Dictionary<BlockTypes, TechDataAvailValidation.BlockTypeAvailability> blockAvailability, bool isSpawning) {
|
||||
Dictionary<BlockTypes, int> missing = new Dictionary<BlockTypes, int>();
|
||||
|
||||
foreach (var kvp in blockAvailability) {
|
||||
int numMissing;
|
||||
if (isSpawning)
|
||||
numMissing = kvp.Value.numRequired - kvp.Value.numInInventory;
|
||||
else
|
||||
numMissing = kvp.Value.numRequired - kvp.Value.numInInventory - kvp.Value.numOnPlayerTech;
|
||||
}
|
||||
|
||||
if (missing.Count == 0)
|
||||
foreach (var kvp in blockAvailability) missing.Add(kvp.Key, kvp.Value.numRequired);
|
||||
return missing;
|
||||
}
|
||||
|
||||
protected int CalculateTotalCost(Dictionary<BlockTypes, int> missingBlocks) {
|
||||
int totalCost = 0;
|
||||
RecipeManager recipeManager = Singleton.Manager<RecipeManager>.inst;
|
||||
|
||||
foreach (var kvp in missingBlocks) {
|
||||
int cost = recipeManager.GetBlockBuyPrice(kvp.Key) * kvp.Value;
|
||||
totalCost += cost;
|
||||
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("{0} of {1} would cost {2}, total now {3}", kvp.Value, kvp.Key, cost, totalCost);
|
||||
}
|
||||
return totalCost;
|
||||
}
|
||||
|
||||
protected bool TryPurchaseBlocks(Dictionary<BlockTypes, int> missingBlocks, int totalCost) {
|
||||
ManPlayer player = Singleton.Manager<ManPlayer>.inst;
|
||||
if (player.GetCurrentMoney() < totalCost) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("Not enough money, have {0} but need {1}, nothing to do",
|
||||
player.GetCurrentMoney(), totalCost);
|
||||
return false;
|
||||
}
|
||||
|
||||
player.PayMoney(totalCost);
|
||||
foreach (var kvp in missingBlocks) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("Buying {0} of {1}", kvp.Value, kvp.Key);
|
||||
player.PlayerInventory.HostAddItem(kvp.Key, kvp.Value);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected bool ProcessPurchase(
|
||||
Dictionary<BlockTypes, TechDataAvailValidation.BlockTypeAvailability> blockAvailability, bool isSpawning) {
|
||||
try {
|
||||
if (blockAvailability == null) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("Block availability is null (wtf?), nothing to do");
|
||||
return false;
|
||||
}
|
||||
|
||||
var missingBlocks = CalculateMissingBlocks(blockAvailability, isSpawning);
|
||||
int totalCost = CalculateTotalCost(missingBlocks);
|
||||
|
||||
if (totalCost > 0) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("Total cost: {0}", totalCost);
|
||||
return TryPurchaseBlocks(missingBlocks, totalCost);
|
||||
}
|
||||
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("No blocks missing or no cost calculated");
|
||||
return false;
|
||||
} catch (Exception e) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("Error during purchase processing: {0}", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected Dictionary<BlockTypes, TechDataAvailValidation.BlockTypeAvailability> GetCurrentBlockAvailability() {
|
||||
SnapshotLiveData selectedSnapshotData = UISnapshotPanelBuyAll.selectedData;
|
||||
Snapshot selectedSnapshot = selectedSnapshotData.m_Snapshot;
|
||||
if (selectedSnapshot == null) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("Selected snapshot is null wtf??: {0}", gameObject.name);
|
||||
return null;
|
||||
}
|
||||
|
||||
TechDataAvailValidation techDataAvail;
|
||||
if (!m_TechAvailLookup.TryGetValue(selectedSnapshot, out techDataAvail)) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("Failed to find TechDataAvailValidation for snapshot: {0}", selectedSnapshot);
|
||||
return null;
|
||||
}
|
||||
|
||||
var trav = Traverse.Create(techDataAvail);
|
||||
var mBlockAvailabilityField = trav.Field("m_BlockAvailability");
|
||||
var mBlockAvailability =
|
||||
mBlockAvailabilityField
|
||||
.GetValue<Dictionary<BlockTypes, TechDataAvailValidation.BlockTypeAvailability>>();
|
||||
|
||||
return mBlockAvailability;
|
||||
}
|
||||
|
||||
public abstract void OnPointerClick(PointerEventData eventData);
|
||||
}
|
||||
|
||||
public class RightClickHandler : BaseRightClickHandler {
|
||||
public override void OnPointerClick(PointerEventData eventData) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("UISnapshotPanel.OnPointerClick: {0} {1}", gameObject.name, eventData.button);
|
||||
try {
|
||||
if (eventData.button == PointerEventData.InputButton.Right)
|
||||
ProcessPurchase(GetCurrentBlockAvailability(), true);
|
||||
} catch (Exception e) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("Shit exploded fml: {0}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class RightClickHandlerSwap : BaseRightClickHandler {
|
||||
public override void OnPointerClick(PointerEventData eventData) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("UISnapshotPanel.OnPointerClick: {0} {1}", gameObject.name, eventData.button);
|
||||
try {
|
||||
if (eventData.button == PointerEventData.InputButton.Right)
|
||||
ProcessPurchase(GetCurrentBlockAvailability(), false);
|
||||
} catch (Exception e) {
|
||||
if (Main.debugBuyAll.Value)
|
||||
Console.WriteLine("Shit exploded fml: {0}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
static void Postfix(UIItemSelectGrid __instance) {
|
||||
try {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine("--------------------");
|
||||
sb.AppendLine("void UIItemSelectGrid::Repopulate()");
|
||||
sb.Append("- __instance: ").AppendLine(__instance.ToString());
|
||||
foreach (var item in __instance.m_FilteredItemList) {
|
||||
sb.Append("- item: ").AppendLine(item.ToString());
|
||||
}
|
||||
UnityExplorer.ExplorerCore.Log(sb.ToString());
|
||||
} catch (System.Exception ex) {
|
||||
UnityExplorer.ExplorerCore.LogWarning($"Exception in patch of void UIItemSelectGrid::Repopulate():\n{ex}");
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
- source: BlacksmithMaster/obj/Release/BlacksmithMaster.dll
|
||||
target: C:/Games/Blacksmith.Master.Early.Access/BepInEx/plugins/BlacksmithMaster.dll
|
||||
delete: true
|
||||
1
Projects/CaptainOfIndustry
Submodule
1
Projects/CaptainOfIndustry
Submodule
Submodule Projects/CaptainOfIndustry added at 91733a89ec
Submodule Projects/CaptainOfIndustry/COI_MineDumpControl deleted from 3c83562726
Submodule Projects/CaptainOfIndustry/CaptainOfCheats deleted from ab65eeed05
@@ -1,123 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
|
||||
// TODO: Make shield and repair bigger
|
||||
// TODO: Maybe make props faster, thrusters work fine
|
||||
namespace CykaOfIndustry {
|
||||
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
public class Main : BaseUnityPlugin {
|
||||
private const string pluginGuid = "CykaMod";
|
||||
private const string pluginName = "CykaMod";
|
||||
private const string pluginVersion = "1.0.0";
|
||||
|
||||
public static ConfigEntry<int> excavatorCapacityMultiplier;
|
||||
public static ConfigEntry<float> excavatorMineTileIterationsMultiplier;
|
||||
public static ConfigEntry<int> truckCapacityMultiplier;
|
||||
public static ConfigEntry<int> cargoShipCapacityMultiplier;
|
||||
public static ConfigEntry<float> excavatorMiningCapacityMultiplier;
|
||||
public static ConfigEntry<int> excavatorMiningAreaMultiplier;
|
||||
public static ConfigEntry<float> excavatorMinReachMultiplier;
|
||||
public static ConfigEntry<float> excavatorMaxReachMultiplier;
|
||||
public static ConfigEntry<float> bufferCapacityMultiplier;
|
||||
public static ConfigEntry<float> unityGenerationMultiplier;
|
||||
public static ConfigEntry<float> depotTransferSpeedMultiplier;
|
||||
public static ConfigEntry<float> worldMineSpeedMultiplier;
|
||||
public static ConfigEntry<float> housingCapacityMultiplier;
|
||||
public static ConfigEntry<float> dumpDelayMultiplier;
|
||||
public static ConfigEntry<float> transportSpeedMultiplier;
|
||||
public static ConfigEntry<float> shipyardCargoMultiplier;
|
||||
public static ConfigEntry<int> autosaveInterval;
|
||||
public static ConfigEntry<string> recipeMultipliers;
|
||||
public static Dictionary<string, int> recipeMultipliersDict;
|
||||
|
||||
public static ConfigEntry<bool> debugMode;
|
||||
|
||||
public void Awake() {
|
||||
excavatorCapacityMultiplier = Config.Bind("General", "Excavator Capacity Multiplier", 1,
|
||||
new ConfigDescription("Excavator Capacity Multiplier"));
|
||||
excavatorMineTileIterationsMultiplier = Config.Bind("General", "Excavator Mine Tile Iterations Multiplier",
|
||||
1f,
|
||||
new ConfigDescription("Excavator Mine Tile Iterations Multiplier"));
|
||||
truckCapacityMultiplier = Config.Bind("General", "Truck Capacity Multiplier", 1,
|
||||
new ConfigDescription("Truck Capacity Multiplier"));
|
||||
cargoShipCapacityMultiplier = Config.Bind("General", "Cargo Ship Capacity Multiplier", 1,
|
||||
new ConfigDescription("Cargo Ship Capacity Multiplier"));
|
||||
excavatorMiningAreaMultiplier = Config.Bind("General", "Excavator Mining Area Multiplier", 1,
|
||||
new ConfigDescription("Excavator Mining Area Multiplier"));
|
||||
excavatorMiningCapacityMultiplier = Config.Bind("General", "Excavator Mining Capacity Multiplier", 1f,
|
||||
new ConfigDescription("Excavator Mining Capacity Multiplier"));
|
||||
excavatorMinReachMultiplier = Config.Bind("General", "Excavator Min Reach Multiplier", 1f,
|
||||
new ConfigDescription("Excavator Min Reach Multiplier"));
|
||||
excavatorMaxReachMultiplier = Config.Bind("General", "Excavator Max Reach Multiplier", 1f,
|
||||
new ConfigDescription("Excavator Max Reach Multiplier"));
|
||||
bufferCapacityMultiplier = Config.Bind("General", "Buffer Capacity Multiplier", 1f,
|
||||
new ConfigDescription("Buffer Capacity Multiplier"));
|
||||
storageCapacityMultiplier = Config.Bind("General", "Storage Capacity Multiplier", 1f,
|
||||
new ConfigDescription("Storage Capacity Multiplier"));
|
||||
unityGenerationMultiplier = Config.Bind("General", "Unity Generation Multiplier", 1f,
|
||||
new ConfigDescription("Unity Generation Multiplier"));
|
||||
depotTransferSpeedMultiplier = Config.Bind("General", "Depot Transfer Speed Multiplier", 1f,
|
||||
new ConfigDescription("Depot Transfer Speed Multiplier"));
|
||||
worldMineSpeedMultiplier = Config.Bind("General", "World Mine Speed Multiplier", 1f,
|
||||
new ConfigDescription("World Mine Speed Multiplier"));
|
||||
housingCapacityMultiplier = Config.Bind("General", "Housing Capacity Multiplier", 1f,
|
||||
new ConfigDescription("Housing Capacity Multiplier"));
|
||||
dumpDelayMultiplier = Config.Bind("General", "Dump Delay Multiplier", 1f,
|
||||
new ConfigDescription("Dump Delay Multiplier"));
|
||||
transportSpeedMultiplier = Config.Bind("General", "Transport Speed Multiplier", 1f,
|
||||
new ConfigDescription("Transport Speed Multiplier"));
|
||||
shipyardCargoMultiplier = Config.Bind("General", "Shipyard Cargo Multiplier", 1f,
|
||||
new ConfigDescription("Shipyard Cargo Multiplier"));
|
||||
autosaveInterval = Config.Bind("General", "Autosave Interval", 1,
|
||||
new ConfigDescription("Autosave Interval in minutes"));
|
||||
recipeMultipliers = Config.Bind("General", "Recipe Multipliers", "dirt:4",
|
||||
new ConfigDescription("Recipe Multipliers"));
|
||||
|
||||
recipeMultipliersDict = recipeMultipliers.Value.Split(',')
|
||||
.ToDictionary(x => x.Split(':')[0], x => int.Parse(x.Split(':')[1]));
|
||||
recipeMultipliers.SettingChanged += (sender, args) => {
|
||||
recipeMultipliersDict = recipeMultipliers.Value.Split(',')
|
||||
.ToDictionary(x => x.Split(':')[0], x => int.Parse(x.Split(':')[1]));
|
||||
Console.WriteLine("IndustrialCyka: Recipe multipliers parsed as:");
|
||||
foreach (var kvp in recipeMultipliersDict)
|
||||
Console.WriteLine("\tIndustrialCyka: {0} x {1}", kvp.Key, kvp.Value);
|
||||
};
|
||||
|
||||
debugMode = Config.Bind("General", "Debug Mode", false, new ConfigDescription("Debug Mode"));
|
||||
|
||||
// shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
|
||||
// energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
|
||||
// magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
// magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
// beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
// beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
// fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
// fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
// wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
// wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
// jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
|
||||
// minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
// minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
// wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
// wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
// wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
foreach (var method in originalMethods) {
|
||||
Logger.LogInfo("Patched " + method.Name);
|
||||
}
|
||||
}
|
||||
|
||||
public static ConfigEntry<float> storageCapacityMultiplier;
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<GAME_DIR>C:/Program Files (x86)/Steam/steamapps/common/Captain of Industry</GAME_DIR>
|
||||
<GAME_MANAGED>$(GAME_DIR)/Captain of Industry_Data/Managed</GAME_MANAGED>
|
||||
<GAME_BEPINEX>$(GAME_DIR)/BepInEx</GAME_BEPINEX>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CykaOfIndustry</RootNamespace>
|
||||
<AssemblyName>CykaOfIndustry</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<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' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Patches.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>$(GAME_BEPINEX)/core/0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>$(GAME_BEPINEX)/core/BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>$(GAME_MANAGED)/UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>$(GAME_MANAGED)/UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mafi">
|
||||
<HintPath>$(GAME_MANAGED)/Mafi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mafi.Core">
|
||||
<HintPath>$(GAME_MANAGED)/Mafi.Core.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
|
||||
</Project>
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CykaOfIndustry", "CykaOfIndustry.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,3 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CProgram_0020Files_0020_0028x86_0029_005CSteam_005Csteamapps_005Ccommon_005CCaptain_0020of_0020Industry_005CCaptain_0020of_0020Industry_005FData_005CManaged_005CUnityEngine_002ECoreModule_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CProgram_0020Files_0020_0028x86_0029_005CSteam_005Csteamapps_005Ccommon_005CCaptain_0020of_0020Industry_005CCaptain_0020of_0020Industry_005FData_005CManaged_005CUnityEngine_002Edll/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
@@ -1,621 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using HarmonyLib;
|
||||
using Mafi;
|
||||
using Mafi.Collections.ImmutableCollections;
|
||||
using Mafi.Core;
|
||||
using Mafi.Core.Buildings.Cargo.Modules;
|
||||
using Mafi.Core.Buildings.Cargo.Ships.Modules;
|
||||
using Mafi.Core.Buildings.Settlements;
|
||||
using Mafi.Core.Buildings.Shipyard;
|
||||
using Mafi.Core.Buildings.Storages;
|
||||
using Mafi.Core.Entities;
|
||||
using Mafi.Core.Entities.Dynamic;
|
||||
using Mafi.Core.Entities.Static;
|
||||
using Mafi.Core.Entities.Static.Layout;
|
||||
using Mafi.Core.Factory.Machines;
|
||||
using Mafi.Core.Factory.Recipes;
|
||||
using Mafi.Core.Factory.Transports;
|
||||
using Mafi.Core.Population;
|
||||
using Mafi.Core.Ports.Io;
|
||||
using Mafi.Core.Products;
|
||||
using Mafi.Core.Prototypes;
|
||||
using Mafi.Core.SaveGame;
|
||||
using Mafi.Core.Terrain;
|
||||
using Mafi.Core.Vehicles.Excavators;
|
||||
using Mafi.Core.World.Entities;
|
||||
|
||||
namespace CykaOfIndustry {
|
||||
[HarmonyPatch]
|
||||
public class Patches {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ExcavatorProtoBuilder.ExcavatorProtoBuilderState), "SetCapacity")]
|
||||
static void excavatorCapacityMultiplier(ref int quantity) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old excavator capacity {0}", quantity);
|
||||
quantity *= Main.excavatorCapacityMultiplier.Value;
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New excavator capacity {0}", quantity);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ExcavatorProtoBuilder.ExcavatorProtoBuilderState), "SetMinedThicknessByDistanceMeters")]
|
||||
static void excavatorMiningAreaMultiplier(ref float[] thicknessMeters) {
|
||||
for (int i = 0; i < thicknessMeters.Length; i++) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old mining area {0}", thicknessMeters[i]);
|
||||
thicknessMeters[i] *= Main.excavatorMiningCapacityMultiplier.Value;
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New mining area {0}", thicknessMeters[i]);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ExcavatorProtoBuilder.ExcavatorProtoBuilderState), "SetMaxMiningDistance")]
|
||||
static void excavatorReachMultiplier(ref RelTile1i minMiningDistance, ref RelTile1i maxMiningDistance) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old min mining distance {0}, max mining distance {1}",
|
||||
minMiningDistance, maxMiningDistance);
|
||||
minMiningDistance = new RelTile1i((int)(minMiningDistance.Value * Main.excavatorMinReachMultiplier.Value));
|
||||
maxMiningDistance = new RelTile1i((int)(maxMiningDistance.Value * Main.excavatorMaxReachMultiplier.Value));
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New min mining distance {0}, max mining distance {1}",
|
||||
minMiningDistance, maxMiningDistance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TruckProtoBuilder.TruckProtoBuilderState), "SetCapacity")]
|
||||
static void truckCapacityMultiplier(ref int quantity) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old truck capacity {0}", quantity);
|
||||
quantity *= Main.truckCapacityMultiplier.Value;
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New truck capacity {0}", quantity);
|
||||
}
|
||||
|
||||
// [HarmonyPrefix]
|
||||
// [HarmonyPatch(typeof(StorageProtoBuilder.State), "SetCapacity")]
|
||||
// static void storageCapacityMultiplier(ref int capacity) {
|
||||
// // Console.WriteLine("IndustrialCyka: Old storage capacity: {0}", capacity);
|
||||
// capacity = (int)(capacity * Main.storageCapacityMultiplier.Value);
|
||||
// // Console.WriteLine("IndustrialCyka: New storage capacity: {0}", capacity);
|
||||
// }
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(CargoShipModuleProto), MethodType.Constructor,
|
||||
new[] {
|
||||
typeof(Proto.ID), typeof(Proto.Str), typeof(ProductType), typeof(Quantity),
|
||||
typeof(CargoShipModuleProto.Gfx)
|
||||
})]
|
||||
static void cargoShipCapacityMultiplier(CargoShipModuleProto __instance) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old ship capacity {0}", __instance.Capacity);
|
||||
__instance.Capacity = new Quantity(__instance.Capacity.Value * Main.cargoShipCapacityMultiplier.Value);
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New ship capacity {0}", __instance.Capacity);
|
||||
}
|
||||
|
||||
// No workey... idk how it's supposed to work, speed is always 1 or 100%
|
||||
// [HarmonyPrefix]
|
||||
// [HarmonyPatch(typeof(DrivingEntity), "SetSpeedFactor")]
|
||||
// static void vehicleSpeedMultiplier(ref Percent speedFactor) {
|
||||
// // Console.WriteLine("IndustrialCyka: Old speed: {0}", speedFactor.ToString());
|
||||
// // typeof(Percent)
|
||||
// // .GetField("RawValue",BindingFlags.Instance|BindingFlags.NonPublic)
|
||||
// // .SetValue(speedFactor,speedFactor.ToFloat() / Main.vehicleSpeedMultiplier.Value);
|
||||
// Percent newSpeedFactor = Percent.FromFloat(speedFactor.ToFloat() / Main.vehicleSpeedMultiplier.Value);
|
||||
// speedFactor = newSpeedFactor;
|
||||
// // Console.WriteLine("IndustrialCyka: New speed: {1}", newSpeedFactor.RawValue.ToString());
|
||||
// }
|
||||
|
||||
// [HarmonyPostfix]
|
||||
// [HarmonyPatch(typeof(SmoothDriver), "SetSpeedFactor")]
|
||||
// static void vehicleSpeedMultiplier(SmoothDriver __instance) {
|
||||
// Fix32 speedMulti = Fix32.FromFloat(Main.vehicleSpeedMultiplier.Value);
|
||||
//
|
||||
// Traverse traverse = Traverse.Create(__instance);
|
||||
// Traverse maxForwardsSpeedField = traverse.Field("m_maxForwardsSpeed");
|
||||
// Traverse maxBackwardsSpeedField = traverse.Field("m_maxBackwardsSpeed");
|
||||
// Traverse maxAccelerationField = traverse.Field("m_maxAcceleration");
|
||||
//
|
||||
// // Console.WriteLine("IndustrialCyka: Old speeds: (F) {0}, (B) {1}, (A) {2}", maxForwardsSpeedField.GetValue(),
|
||||
// // maxBackwardsSpeedField.GetValue(), maxAccelerationField.GetValue());
|
||||
//
|
||||
// maxForwardsSpeedField.SetValue((Fix32)maxForwardsSpeedField.GetValue() * speedMulti);
|
||||
// maxBackwardsSpeedField.SetValue((Fix32)maxBackwardsSpeedField.GetValue() * speedMulti);
|
||||
// maxAccelerationField.SetValue((Fix32)maxAccelerationField.GetValue() * speedMulti);
|
||||
//
|
||||
// // Console.WriteLine("IndustrialCyka: New speeds: (F) {0}, (B) {1}, (A) {2}", maxForwardsSpeedField.GetValue(),
|
||||
// // maxBackwardsSpeedField.GetValue(), maxAccelerationField.GetValue());
|
||||
// }
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(StorageBaseProto), MethodType.Constructor,
|
||||
new[] {
|
||||
typeof(StaticEntityProto.ID),
|
||||
typeof(Proto.Str),
|
||||
typeof(EntityLayout),
|
||||
typeof(Quantity),
|
||||
typeof(EntityCosts),
|
||||
typeof(LayoutEntityProto.Gfx),
|
||||
typeof(Quantity),
|
||||
typeof(Duration),
|
||||
typeof(IEnumerable<Tag>)
|
||||
})]
|
||||
static void storageCapacityMultiplier(StorageProto __instance) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old storage capacity {0}", __instance.Capacity);
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old storage transfer limit {0}", __instance.TransferLimit);
|
||||
Traverse traverse = Traverse.Create(__instance);
|
||||
|
||||
traverse.Field("Capacity")
|
||||
.SetValue(new Quantity((int)(__instance.Capacity.Value * Main.storageCapacityMultiplier.Value)));
|
||||
traverse.Field("TransferLimit").SetValue(new Quantity(10000));
|
||||
traverse.Field("TransferLimitDuration").SetValue(Duration.FromTicks(1));
|
||||
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New storage capacity {0}", __instance.Capacity);
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New storage transfer limit {0}", __instance.TransferLimit);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(UpointsManager), "GenerateUnity")]
|
||||
static void unityGenerationMultiplier(Proto.ID categoryId, ref Upoints generated) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old generated {0} unity", generated.Value);
|
||||
Fix32 multi = Fix32.FromFloat(Main.unityGenerationMultiplier.Value);
|
||||
generated = new Upoints(generated.Value * multi);
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New generated {0} unity", generated.Value);
|
||||
}
|
||||
|
||||
[HarmonyTranspiler]
|
||||
[HarmonyPatch(typeof(Machine), "updateWorkOnRecipes")]
|
||||
static IEnumerable<CodeInstruction> unityBooster(IEnumerable<CodeInstruction> instructions) {
|
||||
Dictionary<int, OpCode> matchTable = new Dictionary<int, OpCode>();
|
||||
matchTable[0] = OpCodes.Ldsfld;
|
||||
matchTable[1] = OpCodes.Br;
|
||||
matchTable[2] = OpCodes.Ldc_I4_2;
|
||||
int matches = 0;
|
||||
int totalMatch = matchTable.Count;
|
||||
|
||||
var codes = new List<CodeInstruction>(instructions);
|
||||
for (int i = 0; i < codes.Count; i++) {
|
||||
if (matches >= totalMatch) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (codes[i].opcode.Equals(matchTable[matches])) {
|
||||
if (matches == totalMatch - 1) {
|
||||
codes[i].opcode = OpCodes.Ldc_I4_6;
|
||||
}
|
||||
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
|
||||
// for (int i = 0; i < codes.Count; i++) {
|
||||
// Console.WriteLine(codes[i].ToString());
|
||||
// }
|
||||
|
||||
return codes.AsEnumerable();
|
||||
}
|
||||
|
||||
// Could not make this work either... idk why... Doesn't make sense...
|
||||
// [HarmonyPostfix]
|
||||
// [HarmonyPatch(typeof(SimpleVirtualResource), "MineResourceAt")]
|
||||
// static void infiniteGroundResources(SimpleVirtualResource __instance) {
|
||||
// // Console.WriteLine("IndustrialCyka: Patching ground resources (Capacity)");
|
||||
// Traverse traverse = Traverse.Create(__instance);
|
||||
// Traverse capacityField = traverse.Field("Capacity");
|
||||
// capacityField.SetValue(1000000000);
|
||||
// Traverse quantityField = traverse.Field("Quantity");
|
||||
// quantityField.SetValue(1000000000);
|
||||
// }
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ProductBuffer), "ForceNewCapacityTo")]
|
||||
static void bufferCapacityMultiplier(ref Quantity newCapacity) {
|
||||
if (newCapacity.Value <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old buffer capacity {0}", newCapacity);
|
||||
Quantity newNewCapacity = new Quantity((int)(newCapacity.Value * Main.bufferCapacityMultiplier.Value));
|
||||
newCapacity = newNewCapacity;
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New buffer capacity {0}", newCapacity);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(CargoDepotModuleProto), MethodType.Constructor,
|
||||
new[] {
|
||||
typeof(CargoDepotModuleProto.ID),
|
||||
typeof(Proto.Str),
|
||||
typeof(EntityLayout),
|
||||
typeof(ProductType),
|
||||
typeof(Option<CargoDepotModuleProto>),
|
||||
typeof(Quantity),
|
||||
typeof(Quantity),
|
||||
typeof(Duration),
|
||||
typeof(Electricity),
|
||||
typeof(bool),
|
||||
typeof(Percent),
|
||||
typeof(EntityCosts),
|
||||
typeof(CargoDepotModuleProto.Gfx),
|
||||
typeof(IEnumerable<Tag>),
|
||||
})]
|
||||
static void depotTransferSpeedMultiplier(CargoDepotModuleProto __instance) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old depot transfer speed {0}", __instance.QuantityPerExchange);
|
||||
Traverse traverse = Traverse.Create(__instance);
|
||||
|
||||
traverse.Field("QuantityPerExchange")
|
||||
.SetValue(new Quantity((int)(__instance.QuantityPerExchange.Value *
|
||||
Main.depotTransferSpeedMultiplier.Value)));
|
||||
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New depot transfer speed {0}", __instance.QuantityPerExchange);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(WorldMapMineProto), MethodType.Constructor,
|
||||
new[] {
|
||||
typeof(EntityProto.ID),
|
||||
typeof(Proto.Str),
|
||||
typeof(ProductQuantity),
|
||||
typeof(Duration),
|
||||
typeof(Upoints),
|
||||
typeof(UpointsCategoryProto),
|
||||
typeof(EntityCosts),
|
||||
typeof(Func<int, EntityCosts>),
|
||||
typeof(int),
|
||||
typeof(Quantity),
|
||||
typeof(WorldMapEntityProto.Gfx),
|
||||
typeof(int),
|
||||
typeof(int),
|
||||
typeof(IEnumerable<Tag>),
|
||||
})]
|
||||
static void worldMineSpeedMultiplier(WorldMapMineProto __instance) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old world mine speed {0}",
|
||||
__instance.ProducedProductPerStep.Quantity);
|
||||
ProductQuantity newProductQuantity = new ProductQuantity(__instance.ProducedProductPerStep.Product,
|
||||
new Quantity((int)(__instance.ProducedProductPerStep.Quantity.Value *
|
||||
Main.worldMineSpeedMultiplier.Value)));
|
||||
|
||||
Traverse.Create(__instance)
|
||||
.Field("ProducedProductPerStep")
|
||||
.SetValue(newProductQuantity);
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New world mine speed {0}",
|
||||
__instance.ProducedProductPerStep.Quantity);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(WorldMapMineProto), MethodType.Constructor,
|
||||
new[] {
|
||||
typeof(EntityProto.ID),
|
||||
typeof(Proto.Str),
|
||||
typeof(ProductQuantity),
|
||||
typeof(Duration),
|
||||
typeof(Upoints),
|
||||
typeof(UpointsCategoryProto),
|
||||
typeof(EntityCosts),
|
||||
typeof(Func<int, EntityCosts>),
|
||||
typeof(int),
|
||||
typeof(Quantity),
|
||||
typeof(WorldMapEntityProto.Gfx),
|
||||
typeof(int),
|
||||
typeof(int),
|
||||
typeof(IEnumerable<Tag>),
|
||||
})]
|
||||
static void worldMineLevelIncrementMultiplier(WorldMapMineProto __instance) {
|
||||
Traverse traverse = Traverse.Create(__instance);
|
||||
|
||||
// int level = traverse.Field("Level").GetValue<int>();
|
||||
int maxLevel = traverse.Field("MaxLevel").GetValue<int>();
|
||||
// int levelsPerUpgrade = traverse.Field("LevelsPerUpgrade").GetValue<int>();
|
||||
|
||||
int newLevelsPerUpgrade = 10;
|
||||
int newMaxLevel = (int)Math.Ceiling((double)maxLevel / newLevelsPerUpgrade) * newLevelsPerUpgrade;
|
||||
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old max level {0}, new max level {1}", maxLevel, newMaxLevel);
|
||||
traverse.Field("MaxLevel").SetValue(newMaxLevel);
|
||||
traverse.Field("LevelsPerUpgrade").SetValue(newLevelsPerUpgrade);
|
||||
}
|
||||
|
||||
[HarmonyTranspiler]
|
||||
[HarmonyPatch(typeof(WorldMapMineProto), MethodType.Constructor,
|
||||
new[] {
|
||||
typeof(EntityProto.ID),
|
||||
typeof(Proto.Str),
|
||||
typeof(ProductQuantity),
|
||||
typeof(Duration),
|
||||
typeof(Upoints),
|
||||
typeof(UpointsCategoryProto),
|
||||
typeof(EntityCosts),
|
||||
typeof(Func<int, EntityCosts>),
|
||||
typeof(int),
|
||||
typeof(Quantity),
|
||||
typeof(WorldMapEntityProto.Gfx),
|
||||
typeof(int),
|
||||
typeof(int),
|
||||
typeof(IEnumerable<Tag>),
|
||||
})]
|
||||
static IEnumerable<CodeInstruction> cookWorldMineLevelIncrementMultiplier(
|
||||
IEnumerable<CodeInstruction> instructions) {
|
||||
Dictionary<int, OpCode> matchTable = new Dictionary<int, OpCode>();
|
||||
matchTable[0] = OpCodes.Rem;
|
||||
matchTable[1] = OpCodes.Ldfld;
|
||||
matchTable[2] = OpCodes.Ldarg_0;
|
||||
matchTable[3] = OpCodes.Ldfld;
|
||||
matchTable[4] = OpCodes.Ldarg_0;
|
||||
int matches = 0;
|
||||
int totalMatch = matchTable.Count;
|
||||
|
||||
var codes = new List<CodeInstruction>(instructions);
|
||||
for (int i = codes.Count - 1; i >= 0; i--) {
|
||||
if (matches >= totalMatch) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (codes[i].opcode.Equals(matchTable[matches])) {
|
||||
if (matches == totalMatch - 1) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Patching world mine level increment");
|
||||
codes[i + 4].opcode = OpCodes.Add;
|
||||
codes[i + 5].opcode = OpCodes.Brtrue_S;
|
||||
break;
|
||||
}
|
||||
|
||||
matches++;
|
||||
}
|
||||
else {
|
||||
matches = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return codes.AsEnumerable();
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(SettlementHousingModuleProto), MethodType.Constructor, new[] {
|
||||
typeof(StaticEntityProto.ID),
|
||||
typeof(Proto.Str),
|
||||
typeof(EntityLayout),
|
||||
typeof(EntityCosts),
|
||||
typeof(int),
|
||||
typeof(Upoints),
|
||||
typeof(ImmutableArray<KeyValuePair<ImmutableArray<PopNeedProto>, Percent>>),
|
||||
typeof(IReadOnlyDictionary<PopNeedProto, Percent>),
|
||||
typeof(Option<SettlementHousingModuleProto>),
|
||||
typeof(SettlementHousingModuleProto.Gfx),
|
||||
})]
|
||||
static void housingCapacityMultiplier(SettlementHousingModuleProto __instance) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old housing capacity {0}", __instance.Capacity);
|
||||
Traverse.Create(__instance).Field<int>("Capacity").Value =
|
||||
(int)(__instance.Capacity * Main.housingCapacityMultiplier.Value);
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New housing capacity {0}", __instance.Capacity);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(StackerProto), MethodType.Constructor, new[] {
|
||||
typeof(StaticEntityProto.ID),
|
||||
typeof(Proto.Str),
|
||||
typeof(EntityLayout),
|
||||
typeof(EntityCosts),
|
||||
typeof(Electricity),
|
||||
typeof(ThicknessTilesI),
|
||||
typeof(RelTile3i),
|
||||
typeof(Duration),
|
||||
typeof(Duration),
|
||||
typeof(StackerProto.Gfx),
|
||||
typeof(ThicknessTilesI),
|
||||
typeof(IEnumerable<Tag>),
|
||||
})]
|
||||
static void dumpDelayMultiplier(StackerProto __instance) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old dumpDelay {0}", __instance.DumpDelay);
|
||||
Duration newDelay =
|
||||
new Duration(Math.Max((int)(__instance.DumpDelay.Ticks * Main.dumpDelayMultiplier.Value), 1));
|
||||
Traverse.Create(__instance).Field("DumpDelay").SetValue(newDelay);
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New dumpDelay {0}", __instance.DumpDelay);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TransportProto), MethodType.Constructor, new[] {
|
||||
typeof(StaticEntityProto.ID),
|
||||
typeof(Proto.Str),
|
||||
typeof(ThicknessTilesF),
|
||||
typeof(Quantity),
|
||||
typeof(RelTile1f),
|
||||
typeof(RelTile1f),
|
||||
typeof(RelTile1i),
|
||||
typeof(bool),
|
||||
typeof(bool),
|
||||
typeof(Option<TerrainTileSurfaceProto>),
|
||||
typeof(RelTile1i),
|
||||
typeof(IoPortShapeProto),
|
||||
typeof(Electricity),
|
||||
typeof(Percent),
|
||||
typeof(bool),
|
||||
typeof(bool),
|
||||
typeof(EntityCosts),
|
||||
typeof(RelTile1i),
|
||||
typeof(Duration),
|
||||
typeof(Option<TransportProto>),
|
||||
typeof(VirtualProductProto),
|
||||
typeof(Quantity),
|
||||
typeof(TransportProto.Gfx),
|
||||
})]
|
||||
static void transportSpeedMultiplier(ref StaticEntityProto.ID id, ref Proto.Str strings,
|
||||
ref ThicknessTilesF surfaceRelativeHeight, ref Quantity maxQuantityPerTransportedProduct,
|
||||
ref RelTile1f transportedProductsSpacing, ref RelTile1f speedPerTick, ref RelTile1i zStepLength,
|
||||
ref bool needsPillarsAtGround, ref bool canBeBuried,
|
||||
ref Option<TerrainTileSurfaceProto> tileSurfaceWhenOnGround, ref RelTile1i maxPillarSupportRadius,
|
||||
ref IoPortShapeProto portsShape, ref Electricity baseElectricityCost, ref Percent cornersSharpnessPercent,
|
||||
ref bool allowMixedProducts, ref bool isBuildable, ref EntityCosts costs, ref RelTile1i lengthPerCost,
|
||||
ref Duration constructionDurationPerProduct, ref Option<TransportProto> nextTier,
|
||||
ref VirtualProductProto maintenanceProduct, Quantity maintenancePerTile, ref TransportProto.Gfx graphics) {
|
||||
if (TransportPillarProto.MAX_PILLAR_HEIGHT.Value < 25)
|
||||
typeof(TransportPillarProto).GetField("MAX_PILLAR_HEIGHT").SetValue(null, new ThicknessTilesI(25));
|
||||
if (IoPort.MAX_TRANSFER_PER_TICK.Value < 10000)
|
||||
typeof(IoPort).GetField("MAX_TRANSFER_PER_TICK").SetValue(null, new Quantity(10000));
|
||||
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Old maxQuantityPerTransportedProduct {0}",
|
||||
maxQuantityPerTransportedProduct);
|
||||
maxQuantityPerTransportedProduct *= 1000;
|
||||
maxQuantityPerTransportedProduct = maxQuantityPerTransportedProduct.Min(new Quantity(10000));
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: New maxQuantityPerTransportedProduct {0}",
|
||||
maxQuantityPerTransportedProduct);
|
||||
|
||||
speedPerTick *= 10;
|
||||
transportedProductsSpacing = speedPerTick;
|
||||
zStepLength = RelTile1i.One;
|
||||
canBeBuried = true;
|
||||
maxPillarSupportRadius = new RelTile1i(8);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(ShipyardProto), MethodType.Constructor, new[] {
|
||||
typeof(StaticEntityProto.ID),
|
||||
typeof(Proto.Str),
|
||||
typeof(EntityLayout),
|
||||
typeof(EntityCosts),
|
||||
typeof(bool),
|
||||
typeof(Quantity),
|
||||
typeof(Option<ShipyardProto>),
|
||||
typeof(ImmutableArray<ImmutableArray<RectangleTerrainArea2iRelative>>),
|
||||
typeof(StackerProto.Gfx),
|
||||
typeof(ImmutableArray<String>),
|
||||
typeof(bool),
|
||||
})]
|
||||
static void shipyardCargoMultiplier(ShipyardProto __instance) {
|
||||
Traverse.Create(__instance).Field("CargoCapacity").SetValue(new Quantity(
|
||||
(int)(__instance.CargoCapacity.Value * Main.shipyardCargoMultiplier.Value)));
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(SaveManager), "isTimeForAutoSave")]
|
||||
static void autosaveInterval(ref bool __result, SaveManager __instance) {
|
||||
if (Main.autosaveInterval.Value <= 0) {
|
||||
__result = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var trav = Traverse.Create(__instance);
|
||||
var lastSaveTime = trav.Field("m_lastSaveTime").GetValue<long>();
|
||||
var num = (Environment.TickCount - lastSaveTime).Abs() / 1000L;
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Autosave interval: {0}", num);
|
||||
__result = num > Main.autosaveInterval.Value;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(MachineProto), nameof(MachineProto.AddRecipe))]
|
||||
static void machineProtoAddRecipe(MachineProto __instance, ref RecipeProto recipe) {
|
||||
Console.WriteLine("Recipe outputs for {0}:", __instance.Id);
|
||||
recipe.AllOutputs.ForEach(o => {
|
||||
var id = o.Product.Id.ToString();
|
||||
Console.WriteLine("\tIndustrialCyka: Recipe output {0} x {1}", id, o.Quantity);
|
||||
if (!Main.recipeMultipliersDict.ContainsKey(id)) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Recipe output {0} not found in multipliers, nothing to do", id);
|
||||
return;
|
||||
}
|
||||
var multiplier = Main.recipeMultipliersDict[id];
|
||||
var trav = Traverse.Create(o);
|
||||
trav.Field("Quantity").SetValue(new Quantity(trav.Field("Quantity").GetValue<Quantity>().Value * multiplier));
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Recipe output {0} changed to {1}", id, trav.Field("Quantity").GetValue<Quantity>());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(Excavator), "MineMixedAt")]
|
||||
public class MineMixedAtPatch {
|
||||
public static Dictionary<ExcavatorProto, Quantity>
|
||||
originalCapacity = new Dictionary<ExcavatorProto, Quantity>();
|
||||
|
||||
public static Dictionary<ExcavatorProto, ImmutableArray<ThicknessTilesF>> originalMinedThicknessByDistance =
|
||||
new Dictionary<ExcavatorProto, ImmutableArray<ThicknessTilesF>>();
|
||||
|
||||
public static Dictionary<ExcavatorProto.Timings, int> originalMineTileIterations =
|
||||
new Dictionary<ExcavatorProto.Timings, int>();
|
||||
|
||||
public static Dictionary<ExcavatorProto, RelTile1i> originalMaxMiningDistance =
|
||||
new Dictionary<ExcavatorProto, RelTile1i>();
|
||||
|
||||
static void Prefix(ref Excavator __instance) {
|
||||
if (!originalCapacity.ContainsKey(__instance.Prototype)) {
|
||||
originalCapacity.Add(__instance.Prototype, __instance.Prototype.Capacity);
|
||||
}
|
||||
|
||||
var trav = Traverse.Create(__instance.Prototype);
|
||||
trav.Field("Capacity")
|
||||
.SetValue(new Quantity(originalCapacity[__instance.Prototype].Value *
|
||||
Main.excavatorCapacityMultiplier.Value));
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Excavator capacity: {0}", __instance.Prototype.Capacity.Value);
|
||||
|
||||
if (!originalMinedThicknessByDistance.ContainsKey(__instance.Prototype)) {
|
||||
originalMinedThicknessByDistance.Add(__instance.Prototype,
|
||||
trav.Field("MinedThicknessByDistance").GetValue<ImmutableArray<ThicknessTilesF>>());
|
||||
}
|
||||
|
||||
trav.Field("MinedThicknessByDistance")
|
||||
.SetValue(originalMinedThicknessByDistance[__instance.Prototype]
|
||||
.SelectMany(t => Enumerable.Repeat(t, Main.excavatorMiningAreaMultiplier.Value))
|
||||
.Select(t =>
|
||||
new ThicknessTilesF((int)(t.Value.ToFloat() * Main.excavatorMiningCapacityMultiplier.Value)))
|
||||
.ToImmutableArray());
|
||||
if (Main.debugMode.Value)
|
||||
originalMinedThicknessByDistance[__instance.Prototype].ForEach(t => Console.WriteLine(t.Value));
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Excavator mined thickness: {0}",
|
||||
__instance.Prototype.MinedThicknessByDistance);
|
||||
|
||||
if (!originalMaxMiningDistance.ContainsKey(__instance.Prototype)) {
|
||||
originalMaxMiningDistance.Add(__instance.Prototype,
|
||||
trav.Field("MaxMiningDistance").GetValue<RelTile1i>());
|
||||
}
|
||||
|
||||
var value = originalMaxMiningDistance[__instance.Prototype];
|
||||
var newValueMiningDistance = new RelTile1i((int)(value.Value * Main.excavatorMaxReachMultiplier.Value));
|
||||
trav.Field("MaxMiningDistance")
|
||||
.SetValue(newValueMiningDistance);
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Excavator max mining distance: {0}",
|
||||
__instance.Prototype.MaxMiningDistance);
|
||||
|
||||
var trav2 = Traverse.Create(__instance.Prototype.MineTimings);
|
||||
if (!originalMineTileIterations.ContainsKey(__instance.Prototype.MineTimings)) {
|
||||
originalMineTileIterations.Add(__instance.Prototype.MineTimings,
|
||||
trav2.Field("MineTileIterations").GetValue<int>());
|
||||
}
|
||||
|
||||
var newValue = (int)(originalMineTileIterations[__instance.Prototype.MineTimings] *
|
||||
Main.excavatorMineTileIterationsMultiplier.Value);
|
||||
trav2.Field("MineTileIterations").SetValue(newValue);
|
||||
trav2.Field("PrepareToMineDuration").SetValue(new Duration(1));
|
||||
trav2.Field("MineDuration").SetValue(new Duration(1));
|
||||
trav2.Field("PrepareToDumpDuration").SetValue(new Duration(1));
|
||||
trav2.Field("DumpDuration").SetValue(new Duration(1));
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("IndustrialCyka: Excavator mine tile iterations 2: {0}",
|
||||
trav2.Field("MineTileIterations").GetValue<int>());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
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("CykaOfIndustry")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CykaOfIndustry")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[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("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
|
||||
|
||||
// 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")]
|
||||
@@ -1,3 +0,0 @@
|
||||
- source: bin/Release/CykaOfIndustry.dll
|
||||
target: C:\Program Files (x86)\Steam\steamapps\common\Captain of Industry\BepInEx\plugins\CykaOfIndustry.dll
|
||||
delete: true
|
||||
Submodule Projects/CaptainOfIndustry/DifficultySettingsMod deleted from 6ab4d6bf69
Submodule Projects/CaptainOfIndustry/DoubleQoLMod deleted from 99be285f06
1
Projects/CarMechanicSimulator2021
Submodule
1
Projects/CarMechanicSimulator2021
Submodule
Submodule Projects/CarMechanicSimulator2021 added at 877ce0ca52
5
Projects/CarMechanicSimulator2021/.gitignore
vendored
5
Projects/CarMechanicSimulator2021/.gitignore
vendored
@@ -1,5 +0,0 @@
|
||||
bin/
|
||||
obj/
|
||||
/packages/
|
||||
riderModule.iml
|
||||
/_ReSharper.Caches/
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarMechanicSimulator2021", "CarMechanicSimulator2021\CarMechanicSimulator2021.csproj", "{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,16 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005C0Harmony_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CAssembly_002DCSharp_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CBepInEx_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CConfigurationManager_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CMelonLoader_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CUnityEngine_002ECoreModule_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CUnityEngine_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CProjects_002DRider_005CRiderProjects_005CBepinex_005CProjects_005CCarMechanicSimulator2021_005CCarMechanicSimulator2021_005Clibs_005C0Harmony_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CProjects_002DRider_005CRiderProjects_005CBepinex_005CProjects_005CCarMechanicSimulator2021_005CCarMechanicSimulator2021_005Clibs_005CAssembly_002DCSharp_002Dfirstpass_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CProjects_002DRider_005CRiderProjects_005CBepinex_005CProjects_005CCarMechanicSimulator2021_005CCarMechanicSimulator2021_005Clibs_005CAssembly_002DCSharp_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CProjects_002DRider_005CRiderProjects_005CBepinex_005CProjects_005CCarMechanicSimulator2021_005CCarMechanicSimulator2021_005Clibs_005CConfigurationManager_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CSeafile_005CProjects_002DRider_005CRiderProjects_005CBepinex_005CProjects_005CCarMechanicSimulator2021_005CCarMechanicSimulator2021_005Clibs_005CMelonLoader_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue"><AssemblyExplorer>
|
||||
<Assembly Path="C:\Users\Administrator\Seafile\Projects-Rider\RiderProjects\Bepinex\Projects\CarMechanicSimulator2021\CarMechanicSimulator2021\libs\MelonLoader.dll" />
|
||||
</AssemblyExplorer></s:String></wpf:ResourceDictionary>
|
||||
@@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" 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>{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SevenDaysToDie</RootNamespace>
|
||||
<AssemblyName>CarMechanicSimulator2021</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<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' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<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>libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp-firstpass">
|
||||
<HintPath>libs\Assembly-CSharp-firstpass.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MelonLoader">
|
||||
<HintPath>libs\MelonLoader.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="XPPatch.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
|
||||
</Project>
|
||||
@@ -1,16 +0,0 @@
|
||||
using HarmonyLib.Tools;
|
||||
using MelonLoader;
|
||||
|
||||
namespace CarMechanicSimulator2021 {
|
||||
[assembly: MelonInfo(typeof(Main), "CykaMod", "1", "Cyka")]
|
||||
public class Main : MelonMod {
|
||||
private const string pluginGuid = "CykaMod";
|
||||
|
||||
|
||||
public void OnInitializeMelon() {
|
||||
HarmonyFileLog.Enabled = true;
|
||||
HarmonyLib.Harmony harmony = new HarmonyLib.Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
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("CarMechanicSimulator2021")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CarMechanicSimulator2021")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[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("1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5")]
|
||||
|
||||
// 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")]
|
||||
@@ -1,29 +0,0 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace CarMechanicSimulator2021 {
|
||||
[HarmonyPatch]
|
||||
public class Patches {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GlobalData), "AddPlayerExp")]
|
||||
static void xpMulti(ref float exp) {
|
||||
exp *= 10;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(MountObject), "Action")]
|
||||
static void mountSpeedMulti(MountObject __instance) {
|
||||
float num = 3f;
|
||||
float num2 = 1.5f;
|
||||
float num3 = num2 * num;
|
||||
bool flag = !__instance.reverseMode;
|
||||
if (flag)
|
||||
{
|
||||
__instance.mountState -= Time.deltaTime * num3 * Mathf.Abs(Mathf.Sin(Time.time * 10f));
|
||||
}
|
||||
else
|
||||
{
|
||||
__instance.mountState += Time.deltaTime * num3 * Mathf.Abs(Mathf.Sin(Time.time * 10f));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user