Remove projects

This commit is contained in:
2025-11-23 12:53:24 +01:00
parent 051da59046
commit 830980e180
698 changed files with 0 additions and 294205 deletions

View File

@@ -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

View File

@@ -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>

View File

@@ -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>

View File

@@ -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");
}
}
}

View File

@@ -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());
// // }
}
}

View File

@@ -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")]

View File

@@ -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;
// }
// }
// }

View File

@@ -1,2 +0,0 @@
echo $(pwd)
cp AgainstTheStorm/obj/Release/AgainstTheStorm.dll /c/Games/Against.the.Storm.v1.0.2r/BepInEx/Plugins

View File

@@ -1 +0,0 @@
for lib in $(cat libs.txt); do find $1 -name "$lib" | sed 's|\\|/|g' | xargs -I% -- cp '%' .; done

View File

@@ -1,6 +0,0 @@
0Harmony.dll
Assembly-CSharp.dll
BepInEx.dll
ConfigurationManager.dll
UnityEngine.CoreModule.dll
UnityEngine.dll

View File

@@ -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")]

View File

@@ -1 +0,0 @@
151279b84fdcbaafd9f0fcb1f7663654a57733b1df3836fc5634a1051692a2db

View File

@@ -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

View File

@@ -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")]

View File

@@ -1 +0,0 @@
4baf00dfc139a92b75b2a9b95a0819a23a33a039ecbb07edab3f692cd134a7da

View File

@@ -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

View File

@@ -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>

View File

@@ -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'

View File

@@ -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

View File

@@ -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">&lt;AssemblyExplorer&gt;&#xD;
&lt;Assembly Path="C:\Users\Administrator\RiderProjects\Bepinex\Projects\SupermarketTogether\SupermarketTogether\bin\Release\Assembly-CSharp.dll" /&gt;&#xD;
&lt;/AssemblyExplorer&gt;</s:String></wpf:ResourceDictionary>

View File

@@ -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

View File

@@ -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>

View File

@@ -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;
}
}
}

View File

@@ -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")]

View File

@@ -1,3 +0,0 @@
- source: bin/Release/DaveCEO.dll
target: C:\Games\Airport CEO\BepInEx\plugins\DaveCEO.dll
delete: true

View File

@@ -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">&lt;AssemblyExplorer&gt;&#xD;
&lt;Assembly Path="C:\Users\Administrator\RiderProjects\Bepinex\Projects\SupermarketTogether\SupermarketTogether\bin\Release\Assembly-CSharp.dll" /&gt;&#xD;
&lt;/AssemblyExplorer&gt;</s:String></wpf:ResourceDictionary>

View File

@@ -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">&lt;AssemblyExplorer&gt;&#xD;
&lt;Assembly Path="C:\Users\Administrator\RiderProjects\Bepinex\Projects\SupermarketTogether\SupermarketTogether\bin\Release\Assembly-CSharp.dll" /&gt;&#xD;
&lt;/AssemblyExplorer&gt;</s:String></wpf:ResourceDictionary>

View File

@@ -1,3 +0,0 @@
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 120

View File

@@ -1,16 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BanquetForCyka", "BanquetForCyka\BanquetForCyka.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

View File

@@ -1,96 +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/Banquet.for.Fools.Build.18497011</GAME_DIR>
<GAME_MANAGED>$(GAME_DIR)/Banquet for Fools_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>BanquetForCyka</RootNamespace>
<AssemblyName>BanquetForCyka</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="ExpressionConfigEntry.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>
<Reference Include="System" />
</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>

View File

@@ -1,147 +0,0 @@
using System;
using System.Linq;
using System.Collections.Generic;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using HarmonyLib.Tools;
using System.Reflection.Emit;
namespace BanquetForCyka {
[BepInPlugin(PluginGuid, PluginName, PluginVersion)]
public class Main : BaseUnityPlugin {
private const string PluginGuid = "BanquetForCyka";
private const string PluginName = "BanquetForCyka";
private const string PluginVersion = "1.0.0";
public static ConfigEntry<bool> debug;
public static ConfigEntry<bool> debugXp;
public static ConfigEntry<bool> debugDodgeWindow;
public static ConfigEntry<bool> debugStatEntry;
public static ConfigEntry<bool> debugSkillEntry;
public static ConfigEntry<bool> debugLevelUpEntry;
public static ExpressionConfigEntry xpMultiplier;
public static ExpressionConfigEntry dodgeWindowTotal;
public static ExpressionConfigEntry dodgeWindowPerfect;
public static ExpressionConfigEntry levelUpStatEntry;
public static ExpressionConfigEntry levelUpSkillEntry;
public void Awake() {
debug = Config.Bind("Debug", "Global Debug", false);
debugXp = Config.Bind("Debug", "XP Debug", false);
debugDodgeWindow = Config.Bind("Debug", "Dodge Window Debug", false);
debugStatEntry = Config.Bind("Debug", "Stat Entry Debug", false);
debugSkillEntry = Config.Bind("Debug", "Skill Entry Debug", false);
debugLevelUpEntry = Config.Bind("Debug", "Level Up Entry Debug", false);
xpMultiplier = new ExpressionConfigEntry(
Config, "General", "XP Multiplier", "v*1",
"XP Multiplier expression. Use 'v' to represent the original value.", debugXp);
dodgeWindowTotal = new ExpressionConfigEntry(
Config, "General", "Dodge Window Total", "v*1",
"Total dodge window duration expression. Use 'v' to represent the original value (20).",
debugDodgeWindow);
dodgeWindowPerfect = new ExpressionConfigEntry(
Config, "General", "Dodge Window Perfect", "v*1",
"Perfect dodge window percentage expression. Use 'v' to represent the original value (0.25).",
debugDodgeWindow);
levelUpStatEntry = new ExpressionConfigEntry(
Config, "General", "Level Up Stat Entry", "v*1",
"Stat Entry expression. Use 'v' to represent the original value.", debugStatEntry);
levelUpSkillEntry = new ExpressionConfigEntry(
Config, "General", "Level Up Skill Entry", "v*1",
"Skill Entry expression. Use 'v' to represent the original value.", debugSkillEntry);
Logger.LogInfo("BanquetForCyka 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, ConfigEntry<bool> debugFlag = null) {
if (debug.Value || (debugFlag != null && debugFlag.Value))
Console.WriteLine(message);
}
}
[HarmonyPatch(typeof(Stats), "AddXP")]
public class Stats_AddXP {
public static void Prefix(ref int amt) {
Main.LogDebug("Original XP amount: " + amt, Main.debugXp);
float result = Main.xpMultiplier.Evaluate(amt);
amt = (int)result;
Main.LogDebug("Modified XP amount: " + amt, Main.debugXp);
}
}
[HarmonyPatch(typeof(Actions), "DodgeCalculation")]
public class Actions_DodgeCalculation_Transpiler {
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
var codes = new List<CodeInstruction>(instructions);
// Find the ldc.r4 20 instruction
for (int i = 0; i < codes.Count; i++) {
if (codes[i].opcode == OpCodes.Ldc_R4 && (float)codes[i].operand == 20f) {
// Replace with our expression evaluation
codes[i] = new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(Main), "dodgeWindowTotal"));
codes.Insert(i + 1, new CodeInstruction(OpCodes.Ldc_R4, 20f));
codes.Insert(i + 2,
new CodeInstruction(OpCodes.Callvirt,
AccessTools.Method(typeof(ExpressionConfigEntry), "Evaluate")));
break;
}
}
// Find the ldc.r4 0.25 instruction
for (int i = 0; i < codes.Count; i++) {
if (codes[i].opcode == OpCodes.Ldc_R4 && (float)codes[i].operand == 0.25f) {
// Replace with our expression evaluation
codes[i] =
new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(Main), "dodgeWindowPerfect"));
codes.Insert(i + 1, new CodeInstruction(OpCodes.Ldc_R4, 0.25f));
codes.Insert(i + 2,
new CodeInstruction(OpCodes.Callvirt,
AccessTools.Method(typeof(ExpressionConfigEntry), "Evaluate")));
break;
}
}
return codes;
}
}
[HarmonyPatch(typeof(LevelUp), "ClickedStat")]
public class Actions_ClickedStat {
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
var codes = new List<CodeInstruction>(instructions);
// Find the ldc.r4 1 instruction
for (int i = codes.Count - 1; i >= 0; i--) {
if (codes[i].opcode == OpCodes.Ldc_R4 && (float)codes[i].operand == 1f) {
// Replace with our expression evaluation
codes[i] = new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(Main), "levelUpStatEntry"));
codes.Insert(i + 1, new CodeInstruction(OpCodes.Ldc_R4, 1f));
codes.Insert(i + 2,
new CodeInstruction(OpCodes.Callvirt,
AccessTools.Method(typeof(ExpressionConfigEntry), "Evaluate")));
break;
}
}
return codes;
}
}
[HarmonyPatch(typeof(LevelUp), "IncreaseAmt")]
public class Actions_IncreaseAmount {
public static void Postfix(ref int __result) {
Main.LogDebug("Original amount: " + __result, Main.debugLevelUpEntry);
float result = Main.levelUpSkillEntry.Evaluate(__result);
__result = (int)result;
Main.LogDebug("Modified amount: " + __result, Main.debugLevelUpEntry);
}
}
}

View File

@@ -1,28 +0,0 @@
using System;
namespace BanquetForCyka {
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;
}
};
}
}

View File

@@ -1,269 +0,0 @@
using System;
using System.Collections.Generic;
using BepInEx.Configuration;
using UnityEngine;
namespace BanquetForCyka {
public class ExpressionConfigEntry {
private readonly ConfigEntry<string> _configEntry;
private readonly ConfigEntry<bool> _debug;
private Func<float, float> _compiledExpression;
private string _lastValidExpression;
private bool _isValid = true;
private string _currentInput;
public string Value {
get => _configEntry.Value;
set {
if (value == _configEntry.Value)
return;
_currentInput = value;
// Try to compile the expression
try {
LogDebug($"=== Starting compilation of new expression ===", _debug);
LogDebug($"Input expression: '{value}'", _debug);
var newExpr = ParseExpression(value, _debug);
_compiledExpression = newExpr;
_lastValidExpression = value;
_isValid = true;
LogDebug($"=== Expression compilation successful ===", _debug);
} catch (Exception e) {
_isValid = false;
LogDebug($"=== Expression compilation failed ===", _debug);
LogDebug($"Error: {e.Message}", _debug);
LogDebug($"Stack trace: {e.StackTrace}", _debug);
LogDebug($"Expression is invalid but keeping input: '{value}'", _debug);
}
}
}
public bool IsValid => _isValid;
public string LastValidExpression => _lastValidExpression;
public string CurrentInput => _currentInput;
public ExpressionConfigEntry(ConfigFile config, string section, string key, string defaultValue,
string description, ConfigEntry<bool> debug = null) {
_debug = debug;
LogDebug($"=== Initializing ExpressionConfigEntry ===", _debug);
LogDebug($"Section: {section}", _debug);
LogDebug($"Key: {key}", _debug);
LogDebug($"Default value: {defaultValue}", _debug);
_configEntry = config.Bind(
section, key, defaultValue,
new ConfigDescription(description +
"\nUse 'v' to represent the input value. Examples: 'v*4', 'v+13', '(v+5)*2'"));
_currentInput = defaultValue;
// Initial compilation
try {
LogDebug($"=== Starting initial compilation ===", _debug);
LogDebug($"Initial expression: '{_configEntry.Value}'", _debug);
_compiledExpression = ParseExpression(_configEntry.Value, _debug);
_lastValidExpression = _configEntry.Value;
_isValid = true;
LogDebug($"=== Initial compilation successful ===", _debug);
} catch (Exception e) {
LogDebug($"=== Initial compilation failed ===", _debug);
LogDebug($"Error: {e.Message}", _debug);
LogDebug($"Stack trace: {e.StackTrace}", _debug);
_isValid = false;
}
// Recompile when config changes
_configEntry.SettingChanged += (sender, args) => {
try {
LogDebug($"=== Config changed, starting recompilation ===", _debug);
LogDebug($"New expression: '{_configEntry.Value}'", _debug);
_compiledExpression = ParseExpression(_configEntry.Value, _debug);
_lastValidExpression = _configEntry.Value;
_isValid = true;
_currentInput = _configEntry.Value;
LogDebug($"=== Recompilation successful ===", _debug);
} catch (Exception e) {
_isValid = false;
LogDebug($"=== Recompilation failed ===", _debug);
LogDebug($"Error: {e.Message}", _debug);
LogDebug($"Stack trace: {e.StackTrace}", _debug);
LogDebug($"Expression is invalid but keeping input: '{_configEntry.Value}'", _debug);
_currentInput = _configEntry.Value;
}
};
}
public float Evaluate(float input) {
if (!_isValid) {
LogDebug($"=== Evaluation with invalid expression ===", _debug);
LogDebug($"Input value: {input}", _debug);
LogDebug($"Using last valid expression: '{_lastValidExpression}'", _debug);
return input; // Return original value if expression is invalid
}
LogDebug($"=== Starting expression evaluation ===", _debug);
LogDebug($"Expression: '{_configEntry.Value}'", _debug);
LogDebug($"Input value: {input}", _debug);
var result = _compiledExpression(input);
LogDebug($"Output value: {result}", _debug);
LogDebug($"=== Evaluation complete ===", _debug);
return result;
}
private static void LogDebug(string message, ConfigEntry<bool> debug) {
if (debug?.Value == true) {
Console.WriteLine($"[ExpressionConfigEntry] {message}");
}
}
// Copy of the expression parser from Main
private static Func<float, float> ParseExpression(string expr, ConfigEntry<bool> debug) {
try {
LogDebug($"=== Starting expression parsing ===", debug);
LogDebug($"Raw expression: '{expr}'", debug);
// Remove all whitespace
expr = expr.Replace(" ", "");
LogDebug($"After whitespace removal: '{expr}'", debug);
var tokens = new List<string>();
var current = "";
// Tokenize the expression
LogDebug("=== Tokenizing expression ===", debug);
for (int i = 0; i < expr.Length; i++) {
char c = expr[i];
if (c == 'v') {
if (current != "") {
LogDebug($"Found number token: '{current}'", debug);
tokens.Add(current);
current = "";
}
LogDebug("Found variable token: 'v'", debug);
tokens.Add("v");
} else if (c == '+' || c == '-' || c == '*' || c == '/' || c == '(' || c == ')') {
if (current != "") {
LogDebug($"Found number token: '{current}'", debug);
tokens.Add(current);
current = "";
}
LogDebug($"Found operator token: '{c}'", debug);
tokens.Add(c.ToString());
} else {
current += c;
}
}
if (current != "") {
LogDebug($"Found final number token: '{current}'", debug);
tokens.Add(current);
}
LogDebug($"All tokens: {string.Join(", ", tokens)}", debug);
// Convert to postfix notation using shunting yard
LogDebug("=== Converting to postfix notation ===", debug);
var output = new List<string>();
var operators = new Stack<string>();
foreach (var token in tokens) {
if (token == "v" || float.TryParse(token, out _)) {
LogDebug($"Pushing operand to output: '{token}'", debug);
output.Add(token);
} else if (token == "(") {
LogDebug("Pushing '(' to operator stack", debug);
operators.Push(token);
} else if (token == ")") {
LogDebug("Found ')', popping operators until '('", debug);
while (operators.Count > 0 && operators.Peek() != "(") {
var op = operators.Pop();
LogDebug($"Popped operator to output: '{op}'", debug);
output.Add(op);
}
if (operators.Count > 0) {
LogDebug("Popping '(' from stack", debug);
operators.Pop(); // Remove "("
}
} else {
LogDebug($"Processing operator: '{token}'", debug);
while (operators.Count > 0 && operators.Peek() != "(" &&
GetPrecedence(operators.Peek()) >= GetPrecedence(token)) {
var op = operators.Pop();
LogDebug($"Popped higher precedence operator to output: '{op}'", debug);
output.Add(op);
}
LogDebug($"Pushing operator to stack: '{token}'", debug);
operators.Push(token);
}
}
while (operators.Count > 0) {
var op = operators.Pop();
LogDebug($"Popping remaining operator to output: '{op}'", debug);
output.Add(op);
}
LogDebug($"Postfix expression: {string.Join(" ", output)}", debug);
// Build the expression tree
LogDebug("=== Building expression tree ===", debug);
var stack = new Stack<Func<float, float>>();
foreach (var token in output) {
if (token == "v") {
LogDebug("Pushing variable function to stack", debug);
stack.Push(v => v);
} else if (float.TryParse(token, out float num)) {
LogDebug($"Pushing constant function to stack: {num}", debug);
stack.Push(v => num);
} else {
var right = stack.Pop();
var left = stack.Pop();
LogDebug($"Popped two functions for operator: '{token}'", debug);
switch (token) {
case "+":
LogDebug("Creating addition function", debug);
stack.Push(v => left(v) + right(v));
break;
case "-":
LogDebug("Creating subtraction function", debug);
stack.Push(v => left(v) - right(v));
break;
case "*":
LogDebug("Creating multiplication function", debug);
stack.Push(v => left(v) * right(v));
break;
case "/":
LogDebug("Creating division function", debug);
stack.Push(v => {
var r = right(v);
return r != 0 ? left(v) / r : left(v);
});
break;
}
}
}
LogDebug("=== Expression parsing complete ===", debug);
return stack.Pop();
} catch (Exception e) {
LogDebug($"=== Expression parsing failed ===", debug);
LogDebug($"Error: {e.Message}", debug);
throw new FormatException($"Failed to parse expression '{expr}': {e.Message}");
}
}
private static int GetPrecedence(string op) {
switch (op) {
case "+":
return 1;
case "-":
return 1;
case "*":
return 2;
case "/":
return 2;
default:
return 0;
}
}
}
}

View File

@@ -1,84 +0,0 @@
using System;
using System.Collections.Generic;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,67 +0,0 @@
using System;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,60 +0,0 @@
using System;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,67 +0,0 @@
using System;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,60 +0,0 @@
using System;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,76 +0,0 @@
using System;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,164 +0,0 @@
using System;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,77 +0,0 @@
using System;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,77 +0,0 @@
using System;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,88 +0,0 @@
using System;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,121 +0,0 @@
using System;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,60 +0,0 @@
using System;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,71 +0,0 @@
using System;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,83 +0,0 @@
using System;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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;
};
}
}

View File

@@ -1,71 +0,0 @@
using System;
using System.Reflection;
using HarmonyLib;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace BanquetForCyka {
[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);
}
}
}
}

View File

@@ -1,531 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
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);
}
}
}
}

View File

@@ -1,24 +0,0 @@
using HarmonyLib;
namespace BanquetForCyka {
[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;
}
}
}

View File

@@ -1,22 +0,0 @@
using System;
using HarmonyLib;
namespace BanquetForCyka {
[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);
}
}
}
}

View File

@@ -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("BanquetForCyka")]
[assembly:AssemblyDescription("")]
[assembly:AssemblyConfiguration("")]
[assembly:AssemblyCompany("")]
[assembly:AssemblyProduct("BanquetForCyka")]
[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")]

View File

@@ -1,30 +0,0 @@
using System;
using HarmonyLib;
namespace BanquetForCyka {
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);
}
}
}

View File

@@ -1,53 +0,0 @@
using BepInEx.Configuration;
using HarmonyLib;
namespace BanquetForCyka {
[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();
}
}
}

View File

@@ -1,53 +0,0 @@
using System;
using System.Collections.Generic;
using BepInEx.Configuration;
using HarmonyLib;
using UnityEngine;
namespace BanquetForCyka {
[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);
}
}
}
}
}

View File

@@ -1,181 +0,0 @@
using System;
using System.Collections.Generic;
using HarmonyLib;
using Snapshots;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace BanquetForCyka {
[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);
}
}
}
}

View File

@@ -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}");
}
}

View File

@@ -1,22 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp\Assembly-CSharp.csproj", "{7F2F647A-CC44-4F99-A411-8C0F6446A5CE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7F2F647A-CC44-4F99-A411-8C0F6446A5CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F2F647A-CC44-4F99-A411-8C0F6446A5CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F2F647A-CC44-4F99-A411-8C0F6446A5CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F2F647A-CC44-4F99-A411-8C0F6446A5CE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
using System;
using UnityEngine;
// Token: 0x02000081 RID: 129
public class AddressablesManager : MonoBehaviour
{
}

View File

@@ -1,149 +0,0 @@
using System;
using UnityEngine;
// Token: 0x02000012 RID: 18
public class Ailment : MonoBehaviour
{
// Token: 0x0600018D RID: 397 RVA: 0x0001F899 File Offset: 0x0001DA99
private void OnEnable()
{
this.Reset();
}
// Token: 0x0600018E RID: 398 RVA: 0x0001F8A1 File Offset: 0x0001DAA1
private void Reset()
{
this._ProcAilment = false;
this._TileCount = 0;
this._TurnCount = 0;
}
// Token: 0x0600018F RID: 399 RVA: 0x0001F8B8 File Offset: 0x0001DAB8
public void Inflicted()
{
}
// Token: 0x06000190 RID: 400 RVA: 0x0001F8BA File Offset: 0x0001DABA
public void Healed(bool dead, bool doRemove)
{
}
// Token: 0x0400031C RID: 796
[Header("Table Info")]
public GameObject databaseObj;
// Token: 0x0400031D RID: 797
private GameObject databaseObjMain;
// Token: 0x0400031E RID: 798
public string _Table;
// Token: 0x0400031F RID: 799
public int tableID;
// Token: 0x04000320 RID: 800
public int _TurnCount;
// Token: 0x04000321 RID: 801
public int _TileCount;
// Token: 0x04000322 RID: 802
public int _CureID;
// Token: 0x04000323 RID: 803
public bool _ProcAilment;
// Token: 0x04000324 RID: 804
private float TotalProcs;
// Token: 0x04000325 RID: 805
public string _AilmentID;
// Token: 0x04000326 RID: 806
public string _ProcAction;
// Token: 0x04000327 RID: 807
public float _ProcTrigger;
// Token: 0x04000328 RID: 808
public float _TriggerCount;
// Token: 0x04000329 RID: 809
public string _EmitNoiseType;
// Token: 0x0400032A RID: 810
public string descriptionText;
// Token: 0x0400032B RID: 811
public string displayName;
// Token: 0x0400032C RID: 812
public int potency;
// Token: 0x0400032D RID: 813
[Header("Players")]
public Character targetAI;
// Token: 0x0400032E RID: 814
[Header("Players")]
public Character attackerAI;
// Token: 0x0400032F RID: 815
public Stats charInfo;
// Token: 0x04000330 RID: 816
public GameObject target;
// Token: 0x04000331 RID: 817
public GameObject attacker;
// Token: 0x04000332 RID: 818
public Item currItem;
// Token: 0x04000333 RID: 819
public string currAction;
// Token: 0x04000334 RID: 820
[Header("Misc")]
public bool fromLoad;
// Token: 0x04000335 RID: 821
public string typeText;
// Token: 0x04000336 RID: 822
public string cureText;
// Token: 0x04000337 RID: 823
public string effectPrefab = "";
// Token: 0x04000338 RID: 824
private StringFast str = new StringFast(64);
// Token: 0x04000339 RID: 825
private StringFast str1 = new StringFast(64);
// Token: 0x0400033A RID: 826
public AudioSource audio1;
// Token: 0x0400033B RID: 827
[Header("Progress")]
public int currTileCount;
// Token: 0x0400033C RID: 828
public int currTurnCount;
// Token: 0x0400033D RID: 829
public int currTriggerCount;
// Token: 0x0400033E RID: 830
public Vector3 currTilePos;
// Token: 0x0400033F RID: 831
public int aimLocation;
// Token: 0x04000340 RID: 832
public bool inflicted;
// Token: 0x04000341 RID: 833
public bool didFall;
}

View File

@@ -1,228 +0,0 @@
using System;
using System.Collections.Generic;
using UnityEngine;
// Token: 0x02000078 RID: 120
public class AllSounds : MonoBehaviour
{
// Token: 0x06000BAD RID: 2989 RVA: 0x000E10D4 File Offset: 0x000DF2D4
public AudioClip PlaySound(string type, int id, int num, string extra)
{
if (type == "Human")
{
if (id < this.characters.Count && id > -1)
{
if (num == 0)
{
this.curr = this.characters[id].walk;
}
if (num == 1)
{
this.curr = this.characters[id].run;
}
if (num == 2)
{
this.curr = this.characters[id].hit;
}
if (num == 3)
{
this.curr = this.characters[id].death;
}
if (num == 4)
{
this.curr = this.characters[id].jump;
}
if (num == 6)
{
this.curr = this.characters[id].idle;
}
if (num == 7)
{
this.curr = this.characters[id].hit;
}
if (this.curr != null)
{
if (this.curr.Count <= 0)
{
return null;
}
if (num == 0 && id == 0)
{
int num2 = 0;
int num3 = this.curr.Count;
if (extra.Contains("Guts"))
{
num2 = 15;
num3 = 20;
}
else if (extra.Contains("Fabric"))
{
num2 = 0;
num3 = 5;
}
else if (extra.Contains("Snow"))
{
num2 = 20;
num3 = 25;
}
else if (extra.Contains("Wood"))
{
num2 = 10;
num3 = 15;
}
else if (extra.Contains("Grass"))
{
num2 = 5;
num3 = 10;
}
else if (extra.Contains("Puddle"))
{
num2 = 25;
num3 = 30;
}
else if (extra.Contains("Sand"))
{
num2 = 30;
num3 = 35;
}
else if (extra.Contains("Rocks"))
{
num2 = 35;
num3 = 40;
}
return this.curr[Random.Range(num2, num3)];
}
return this.curr[Random.Range(0, this.curr.Count)];
}
}
this.curr = null;
return null;
}
if (type == "Animal")
{
if (num == 0)
{
this.curr = this.animals[id].walk;
}
if (num == 1)
{
this.curr = this.animals[id].run;
}
if (num == 2)
{
this.curr = this.animals[id].hit;
}
if (num == 3)
{
this.curr = this.animals[id].death;
}
if (num == 4)
{
this.curr = this.animals[id].melee;
}
if (num == 5)
{
this.curr = this.animals[id].range;
}
if (num == 6)
{
this.curr = this.animals[id].idle;
}
if (num == 7)
{
this.curr = this.animals[id].heard;
}
if (this.curr == null)
{
this.curr = null;
return null;
}
if (this.curr.Count > 0)
{
return this.curr[Random.Range(0, this.curr.Count)];
}
return null;
}
else if (type == "Talking")
{
if (num == 10)
{
this.curr = this.talking[id].happy;
}
if (num == 11)
{
this.curr = this.talking[id].neutral;
}
if (num == 12)
{
this.curr = this.talking[id].hostile;
}
if (num == 13)
{
this.curr = this.talking[id].question;
}
if (num == 14)
{
this.curr = this.talking[id].exclaim;
}
if (num == 15)
{
this.curr = this.talking[id].spooked;
}
if (this.curr == null)
{
this.curr = null;
return null;
}
if (this.curr.Count > 0)
{
return this.curr[Random.Range(0, this.curr.Count)];
}
return null;
}
else
{
if (!(type == "Critter"))
{
return null;
}
if (num == 0)
{
this.curr = this.critters[id].idle;
}
if (num == 1)
{
this.curr = this.critters[id].move;
}
if (num == 2)
{
this.curr = this.critters[id].death;
}
if (this.curr == null)
{
this.curr = null;
return null;
}
if (this.curr.Count > 0)
{
return this.curr[Random.Range(0, this.curr.Count)];
}
return null;
}
}
// Token: 0x040011EB RID: 4587
public List<SoundSet.CharacterSounds> characters = new List<SoundSet.CharacterSounds>();
// Token: 0x040011EC RID: 4588
public List<SoundSet.AnimalSounds> animals = new List<SoundSet.AnimalSounds>();
// Token: 0x040011ED RID: 4589
public List<SoundSet.HumanTalking> talking = new List<SoundSet.HumanTalking>();
// Token: 0x040011EE RID: 4590
public List<SoundSet.CritterSounds> critters = new List<SoundSet.CritterSounds>();
// Token: 0x040011EF RID: 4591
private List<AudioClip> curr;
}

View File

@@ -1,79 +0,0 @@
using System;
using UnityEngine;
// Token: 0x0200005B RID: 91
public class AnimationFlags : MonoBehaviour
{
// Token: 0x06000B39 RID: 2873 RVA: 0x000DD3BF File Offset: 0x000DB5BF
private void Start()
{
this.ClearAll();
}
// Token: 0x06000B3A RID: 2874 RVA: 0x000DD3C8 File Offset: 0x000DB5C8
public void StartQTE()
{
this.startQTE = true;
Debug.Log("start qte " + Time.timeSinceLevelLoad.ToString());
}
// Token: 0x06000B3B RID: 2875 RVA: 0x000DD3F8 File Offset: 0x000DB5F8
public void HitTarget()
{
this.hitTarget = true;
Debug.Log("hit target " + Time.timeSinceLevelLoad.ToString());
}
// Token: 0x06000B3C RID: 2876 RVA: 0x000DD428 File Offset: 0x000DB628
public void LeavePocket()
{
this.end = true;
}
// Token: 0x06000B3D RID: 2877 RVA: 0x000DD431 File Offset: 0x000DB631
public void StartTargetFollow()
{
this.targetFollow = true;
}
// Token: 0x06000B3E RID: 2878 RVA: 0x000DD43A File Offset: 0x000DB63A
public void StartBounce()
{
this.bounce = true;
}
// Token: 0x06000B3F RID: 2879 RVA: 0x000DD443 File Offset: 0x000DB643
public void PlayAnimation()
{
this.animate = true;
}
// Token: 0x06000B40 RID: 2880 RVA: 0x000DD44C File Offset: 0x000DB64C
public void ClearAll()
{
this.end = false;
this.hitTarget = false;
this.startQTE = false;
this.targetFollow = false;
this.bounce = false;
this.animate = false;
}
// Token: 0x0400102E RID: 4142
public bool end;
// Token: 0x0400102F RID: 4143
public bool startQTE;
// Token: 0x04001030 RID: 4144
public bool hitTarget;
// Token: 0x04001031 RID: 4145
public bool targetFollow;
// Token: 0x04001032 RID: 4146
public bool bounce;
// Token: 0x04001033 RID: 4147
public bool animate;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,145 +0,0 @@
using System;
using System.Collections.Generic;
using DarkTonic.MasterAudio;
using UnityEngine;
// Token: 0x02000013 RID: 19
public class Armor : MonoBehaviour
{
// Token: 0x06000192 RID: 402 RVA: 0x0001F8EC File Offset: 0x0001DAEC
private void Awake()
{
if (!this.tr)
{
this.tr = base.transform;
}
if (!this.camTr)
{
this.camTr = Links.x.worldCamera.gameObject.transform;
}
this.forw = Vector3.forward;
this.up = Vector3.up;
}
// Token: 0x06000193 RID: 403 RVA: 0x0001F950 File Offset: 0x0001DB50
public void UpdateArmor(int curr)
{
SpriteRenderer spriteRenderer = null;
this.currentArmor = curr;
float num = (float)this.pieces.Count;
float num2 = (float)this.maxArmor / num;
float num3 = (float)curr;
this.segments = num3;
for (int i = 0; i < this.pieces.Count; i++)
{
float num4 = (float)i * num2;
if (num3 > num4)
{
this.pieces[i].color = this.normal;
}
else
{
if (this.pieces[i].color == this.normal)
{
spriteRenderer = this.pieces[i];
}
this.pieces[i].color = this.broken;
}
}
if (spriteRenderer)
{
MasterAudio.PlaySound3DAtVector3AndForget("Armor Break", this.character.torsoPosition, 1f, new float?(1f), 0.5f, "", null);
RectTransform hannahAnimator = Links.x.cellar.GetHannahAnimator(1);
hannahAnimator.gameObject.SetActive(true);
hannahAnimator.gameObject.GetComponent<HannahAnimator>().Play("Idle");
Vector3 vector = Links.x.worldCamera.WorldToScreenPoint(spriteRenderer.transform.position);
vector.z = 0f;
vector.x = vector.x * (1920f / (float)Screen.width) - 960f;
vector.y = vector.y * (Links.x.canvasRT.sizeDelta.y / (float)Screen.height) - Links.x.canvasRT.sizeDelta.y / 2f;
hannahAnimator.localPosition = vector;
if (this.type == "Armor")
{
GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(119);
pooledGameObject.transform.position = this.character.torsoPosition;
pooledGameObject.SetActive(true);
this.str.Clear();
this.str.Append(this.character.stats.GetName());
this.str.Append("'s armor is damaged");
Links.x.gameFeed.AddFeed(this.str.ToString());
}
}
}
// Token: 0x06000194 RID: 404 RVA: 0x0001FBAB File Offset: 0x0001DDAB
public void End()
{
Object.Destroy(base.gameObject);
}
// Token: 0x06000195 RID: 405 RVA: 0x0001FBB8 File Offset: 0x0001DDB8
public void Setup(Character c, int max, int curr, string counterType)
{
this.character = c;
this.type = counterType;
this.currentArmor = curr;
this.maxArmor = max;
this.UpdateArmor(curr);
this.LateUpdate();
}
// Token: 0x06000196 RID: 406 RVA: 0x0001FBE4 File Offset: 0x0001DDE4
private void LateUpdate()
{
this.tr.LookAt(this.tr.position + this.camTr.rotation * this.forw, this.camTr.rotation * this.up);
if (this.type == "Armor")
{
this.tr.position = this.character.body.GetHead().position + new Vector3(0f, 1f, 0f);
return;
}
if (this.character.party)
{
this.tr.position = this.character.body.GetHead().position + new Vector3(0f, 1.1f, 0f);
return;
}
this.tr.position = this.character.body.GetHead().position + new Vector3(0f, 1.85f, 0f);
}
// Token: 0x04000342 RID: 834
public List<SpriteRenderer> pieces = new List<SpriteRenderer>();
// Token: 0x04000343 RID: 835
public Character character;
// Token: 0x04000344 RID: 836
public int maxArmor;
// Token: 0x04000345 RID: 837
public int currentArmor;
// Token: 0x04000346 RID: 838
public float segments;
// Token: 0x04000347 RID: 839
private Transform tr;
// Token: 0x04000348 RID: 840
private Transform camTr;
// Token: 0x04000349 RID: 841
private Vector3 forw;
// Token: 0x0400034A RID: 842
private Vector3 up;
// Token: 0x0400034B RID: 843
public Color normal;
// Token: 0x0400034C RID: 844
public Color broken;
// Token: 0x0400034D RID: 845
private StringFast str = new StringFast(32);
// Token: 0x0400034E RID: 846
public string type;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,382 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7F2F647A-CC44-4F99-A411-8C0F6446A5CE}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Assembly-CSharp</RootNamespace>
<AssemblyName>Assembly-CSharp</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="Assembly-CSharp-firstpass">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="AstarPathfindingProject">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\AstarPathfindingProject.dll</HintPath>
</Reference>
<Reference Include="Boxophobic.TheVegetationEngine.Runtime">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\Boxophobic.TheVegetationEngine.Runtime.dll</HintPath>
</Reference>
<Reference Include="MagicaClothV2">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\MagicaClothV2.dll</HintPath>
</Reference>
<Reference Include="netstandard">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\netstandard.dll</HintPath>
</Reference>
<Reference Include="Unity.InputSystem">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\Unity.InputSystem.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ImageConversionModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.ImageConversionModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ParticleSystemModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.ParticleSystemModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TerrainModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.TerrainModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.UIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.VideoModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.VideoModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.VRModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.VRModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Compile Include="Actions.cs" />
<Compile Include="AddressablesManager.cs" />
<Compile Include="Ailment.cs" />
<Compile Include="AllSounds.cs" />
<Compile Include="AnimateButton.cs" />
<Compile Include="AnimationFlags.cs" />
<Compile Include="Archives.cs" />
<Compile Include="Armor.cs" />
<Compile Include="ArrowKit.cs" />
<Compile Include="AttackAI.cs" />
<Compile Include="AudioListenForMain.cs" />
<Compile Include="AudioSourceDebugging.cs" />
<Compile Include="Bag.cs" />
<Compile Include="BakedMeshAnimation.cs" />
<Compile Include="BakedMeshAnimator.cs" />
<Compile Include="BakedMeshAnimatorUpdater.cs" />
<Compile Include="Billboard.cs" />
<Compile Include="BirdMaterialChanger.cs" />
<Compile Include="Boat.cs" />
<Compile Include="Body.cs" />
<Compile Include="BoneListener.cs" />
<Compile Include="Books.cs" />
<Compile Include="Boro.cs" />
<Compile Include="Breakable.cs" />
<Compile Include="BreakableActions.cs" />
<Compile Include="BtnAlphaThreshold.cs" />
<Compile Include="ButtonMultiTargets.cs" />
<Compile Include="ButtonSmartNavigation.cs" />
<Compile Include="ByeProbuilder.cs" />
<Compile Include="cakeslice\LinkedSet.cs" />
<Compile Include="cakeslice\LinkedSetGlow.cs" />
<Compile Include="cakeslice\Outline.cs" />
<Compile Include="cakeslice\OutlineEffect.cs" />
<Compile Include="cakeslice\OutlineEffectGlow.cs" />
<Compile Include="cakeslice\OutlineGlow.cs" />
<Compile Include="CameraControls.cs" />
<Compile Include="CameraEffects.cs" />
<Compile Include="CameraFogOfWar.cs" />
<Compile Include="CameraParams.cs" />
<Compile Include="CaptureAreaInfo.cs" />
<Compile Include="CaptureBackgrounds.cs" />
<Compile Include="Cellar.cs" />
<Compile Include="Character.cs" />
<Compile Include="CharacterQuips.cs" />
<Compile Include="Chest.cs" />
<Compile Include="ChestActions.cs" />
<Compile Include="Cinematics.cs" />
<Compile Include="ClayShaderVariables.cs" />
<Compile Include="CleanIK.cs" />
<Compile Include="CollectCharacters.cs" />
<Compile Include="CollisionListener.cs" />
<Compile Include="Combat.cs" />
<Compile Include="CompanionDrop.cs" />
<Compile Include="CompanionIcon.cs" />
<Compile Include="ContentSizeFitterEx.cs" />
<Compile Include="CoolAudioSource.cs" />
<Compile Include="CopyShadows.cs" />
<Compile Include="CopyShadowsBaker.cs" />
<Compile Include="CreateCircle.cs" />
<Compile Include="Creation.cs" />
<Compile Include="CreationSkills.cs" />
<Compile Include="CreatureActions.cs" />
<Compile Include="CreatureBoat.cs" />
<Compile Include="Creatures.cs" />
<Compile Include="CritterActions.cs" />
<Compile Include="Critters.cs" />
<Compile Include="Culling.cs" />
<Compile Include="Data.cs" />
<Compile Include="DeathScreen.cs" />
<Compile Include="Dialogue.cs" />
<Compile Include="DialogueSounds.cs" />
<Compile Include="Diorama.cs" />
<Compile Include="DockFriend.cs" />
<Compile Include="Door.cs" />
<Compile Include="DoorActions.cs" />
<Compile Include="DrawBounds.cs" />
<Compile Include="DrawMesh.cs" />
<Compile Include="DrawSettingController.cs" />
<Compile Include="DrawSettings.cs" />
<Compile Include="DrawViewController.cs" />
<Compile Include="Effects.cs" />
<Compile Include="EnchantItem.cs" />
<Compile Include="EnemyGroup.cs" />
<Compile Include="EnvironmentNodes.cs" />
<Compile Include="Equipment.cs" />
<Compile Include="Fauna.cs" />
<Compile Include="Fellowship.cs" />
<Compile Include="Flag.cs" />
<Compile Include="FloatExtensions.cs" />
<Compile Include="FlockChild.cs" />
<Compile Include="FlockChildSound.cs" />
<Compile Include="FlockController.cs" />
<Compile Include="FlockScare.cs" />
<Compile Include="FlockWaypointTrigger.cs" />
<Compile Include="Forfeits.cs" />
<Compile Include="Formation.cs" />
<Compile Include="FOWRevealer.cs" />
<Compile Include="FOWRevealerInterior.cs" />
<Compile Include="FOWSystem.cs" />
<Compile Include="FOWSystemInterior.cs" />
<Compile Include="FPS.cs" />
<Compile Include="Gaia.cs" />
<Compile Include="GameCard.cs" />
<Compile Include="GameFeed.cs" />
<Compile Include="Gameplay.cs" />
<Compile Include="GameSecondCounter.cs" />
<Compile Include="GatherEmeraldsXP.cs" />
<Compile Include="Gauge.cs" />
<Compile Include="GhostBrush.cs" />
<Compile Include="Gore.cs" />
<Compile Include="GoreListen.cs" />
<Compile Include="GroundBag.cs" />
<Compile Include="GroundItemText.cs" />
<Compile Include="Groupies.cs" />
<Compile Include="guiE3.cs" />
<Compile Include="guiMenu.cs" />
<Compile Include="HannahAnimator.cs" />
<Compile Include="HannahAnimatorSimple.cs" />
<Compile Include="HUD.cs" />
<Compile Include="Huddle.cs" />
<Compile Include="HuddleButton.cs" />
<Compile Include="InputActions.cs" />
<Compile Include="InputControls.cs" />
<Compile Include="Interact.cs" />
<Compile Include="InteractionIconAnimator.cs" />
<Compile Include="Interactive.cs" />
<Compile Include="InteriorLights.cs" />
<Compile Include="Inventory.cs" />
<Compile Include="InventoryContainer.cs" />
<Compile Include="Item.cs" />
<Compile Include="ItemBook.cs" />
<Compile Include="ItemCard.cs" />
<Compile Include="ItemCollector.cs" />
<Compile Include="ItemEquipped.cs" />
<Compile Include="ItemLabelGrid.cs" />
<Compile Include="Journal.cs" />
<Compile Include="JournalScroll.cs" />
<Compile Include="KeyboardScript.cs" />
<Compile Include="KeyControl.cs" />
<Compile Include="KeyDrag.cs" />
<Compile Include="KeyDrop.cs" />
<Compile Include="LandingButtons.cs" />
<Compile Include="LandingSpot.cs" />
<Compile Include="LandingSpotController.cs" />
<Compile Include="LevelUp.cs" />
<Compile Include="Library.cs" />
<Compile Include="LibrarySetup.cs" />
<Compile Include="LineWave.cs" />
<Compile Include="LineWaveCollider.cs" />
<Compile Include="Links.cs" />
<Compile Include="ListenerQTE.cs" />
<Compile Include="LookAtCamera.cs" />
<Compile Include="LookAtController.cs" />
<Compile Include="LOS\AttackShapes.cs" />
<Compile Include="LOS\ILOSSource.cs" />
<Compile Include="LOS\LineOfSightCone.cs" />
<Compile Include="LOS\LOSBufferStorage.cs" />
<Compile Include="LOS\LOSCuller.cs" />
<Compile Include="LOS\LOSFinalResolve.cs" />
<Compile Include="LOS\LOSHelper.cs" />
<Compile Include="LOS\LOSLayerExcluder.cs" />
<Compile Include="LOS\LOSManager.cs" />
<Compile Include="LOS\LOSQualityLevel.cs" />
<Compile Include="LOS\LOSSource.cs" />
<Compile Include="LOS\Materials.cs" />
<Compile Include="LOS\PixelOperation.cs" />
<Compile Include="LOS\PointLightShadows.cs" />
<Compile Include="LOS\ShaderID.cs" />
<Compile Include="LOS\Shaders.cs" />
<Compile Include="LOS\Util.cs" />
<Compile Include="MainMenu.cs" />
<Compile Include="Manual.cs" />
<Compile Include="MapConfirm.cs" />
<Compile Include="MapExit.cs" />
<Compile Include="MapExitActions.cs" />
<Compile Include="MapExitIcon.cs" />
<Compile Include="MapPawn.cs" />
<Compile Include="MapPiece.cs" />
<Compile Include="MaskColors.cs" />
<Compile Include="meanPos.cs" />
<Compile Include="MechanimSounds.cs" />
<Compile Include="MenuCameraCrossFade.cs" />
<Compile Include="MenuInputActions.cs" />
<Compile Include="Merchant.cs" />
<Compile Include="MeshSaver.cs" />
<Compile Include="Minigame.cs" />
<Compile Include="MiniMap.cs" />
<Compile Include="Moonlight.cs" />
<Compile Include="MoonlightRevealer.cs" />
<Compile Include="MoonlightSystem.cs" />
<Compile Include="MouseOrbitImproved.cs" />
<Compile Include="MTE\TileContainer.cs" />
<Compile Include="MultiTargetGraphics.cs" />
<Compile Include="NGSSFrustumShadowsSS.cs" />
<Compile Include="Options.cs" />
<Compile Include="OverHeadUI.cs" />
<Compile Include="OverworldMap.cs" />
<Compile Include="OverworldMapMenu.cs" />
<Compile Include="ParticleSunRotation.cs" />
<Compile Include="PartyCollider.cs" />
<Compile Include="Pickups.cs" />
<Compile Include="Pin.cs" />
<Compile Include="PinHolder.cs" />
<Compile Include="PlayerBorders.cs" />
<Compile Include="PlayVideo.cs" />
<Compile Include="Pocket.cs" />
<Compile Include="Pointer.cs" />
<Compile Include="Portrait.cs" />
<Compile Include="Projectile.cs" />
<Compile Include="PromptActions.cs" />
<Compile Include="Prompts.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Puzzle.cs" />
<Compile Include="PuzzleActions.cs" />
<Compile Include="PuzzleListener.cs" />
<Compile Include="QTE.cs" />
<Compile Include="QuestEnd.cs" />
<Compile Include="QuestObjects.cs" />
<Compile Include="QuestTimePoint.cs" />
<Compile Include="QuipSet.cs" />
<Compile Include="RallyStage.cs" />
<Compile Include="RandomAnimationStart.cs" />
<Compile Include="RandomMaterial.cs" />
<Compile Include="Records.cs" />
<Compile Include="RenderPortraits.cs" />
<Compile Include="RenderPortraitSetup.cs" />
<Compile Include="rendertype.cs" />
<Compile Include="ResourceLocation.cs" />
<Compile Include="Rest.cs" />
<Compile Include="RoleSheet.cs" />
<Compile Include="Rope.cs" />
<Compile Include="RtsCamera.cs" />
<Compile Include="SaveKeeper.cs" />
<Compile Include="SaveLoad.cs" />
<Compile Include="SceneCamera.cs" />
<Compile Include="SceneInfo.cs" />
<Compile Include="SceneItem.cs" />
<Compile Include="SceneMap.cs" />
<Compile Include="SceneMapRender.cs" />
<Compile Include="ScrollRectNoDragging.cs" />
<Compile Include="SelectionBox.cs" />
<Compile Include="SelectionCircle.cs" />
<Compile Include="Sensory.cs" />
<Compile Include="SetSpellMaterial.cs" />
<Compile Include="ShadowCaster.cs" />
<Compile Include="ShadowCasterBaker.cs" />
<Compile Include="SkillBag.cs" />
<Compile Include="SkillButton.cs" />
<Compile Include="SoundSet.cs" />
<Compile Include="Spellcrafting.cs" />
<Compile Include="SpellVine.cs" />
<Compile Include="StackSplit.cs" />
<Compile Include="Stamina.cs" />
<Compile Include="Stats.cs" />
<Compile Include="StatusRing.cs" />
<Compile Include="StopMotionAnimations.cs" />
<Compile Include="StringFast.cs" />
<Compile Include="StringSplitter.cs" />
<Compile Include="Sunlight.cs" />
<Compile Include="TerrainDetailDistance.cs" />
<Compile Include="TextFieldBehavior.cs" />
<Compile Include="TextParser.cs" />
<Compile Include="TileEffects.cs" />
<Compile Include="TimedBreakable.cs" />
<Compile Include="TimelineIcon.cs" />
<Compile Include="TimeOfDay.cs" />
<Compile Include="Tooltip.cs" />
<Compile Include="ToonyColorsPro\Runtime\PlanarReflection.cs" />
<Compile Include="TranslateShaderOffset.cs" />
<Compile Include="UITriggerButton.cs" />
<Compile Include="UndergroundMap.cs" />
<Compile Include="UndergroundMapPiece.cs" />
<Compile Include="UnitySourceGeneratedAssemblyMonoScriptTypes_v1.cs" />
<Compile Include="UnityStandardAssets\ImageEffects\BlurOptimized.cs" />
<Compile Include="UnluckDistanceDisabler.cs" />
<Compile Include="Vignettes.cs" />
<Compile Include="Vine.cs" />
<Compile Include="WaterCollisions.cs" />
<Compile Include="WindowHandles.cs" />
<Compile Include="Windows.cs" />
<Compile Include="Wings.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

File diff suppressed because it is too large Load Diff

View File

@@ -1,242 +0,0 @@
using System;
using System.Collections;
using UnityEngine;
// Token: 0x02000015 RID: 21
public class AudioListenForMain : MonoBehaviour
{
// Token: 0x0600020F RID: 527 RVA: 0x0002C690 File Offset: 0x0002A890
private void Start()
{
this.coolAudio = base.gameObject.GetComponent<CoolAudioSource>();
this.coolAudio.audioSource.volume = 0f;
this.distance = this.coolAudio.audioSource.maxDistance;
this.offDistance = this.distance + 10f;
this.position = base.gameObject.transform.position;
this.maxAudioVolume = 1f;
if (this.coolAudio.is2D)
{
this.maxAudioVolume = 0.9f;
if (this.coolAudio.audioSource.clip.name.Contains("Bar"))
{
this.maxAudioVolume = 0.5f;
}
if (this.coolAudio.audioSource.clip.name.Contains("Rozafir"))
{
this.keepPlayingThroughInterior = true;
}
}
if (this.coolAudio.audioSource.clip.name.Contains("RozafirDrums"))
{
this.listenForCharacter = true;
this.overrideMainSoundtrack = true;
this.characterListenName = "RozafirDancerFlutist";
}
}
// Token: 0x06000210 RID: 528 RVA: 0x0002C7B4 File Offset: 0x0002A9B4
private void Update()
{
if (Links.x.hasMain)
{
if (!Records.x.inMenus && !Links.x.gaia.loadingCharacterCreation)
{
float sqrMagnitude = (Links.x.main.currentPosition - this.position).sqrMagnitude;
if (sqrMagnitude < this.distance * this.distance)
{
bool flag = false;
if (this.listenForCharacter)
{
if (!this.character)
{
this.character = Links.x.diorama.FindCharacterAnyState(this.characterListenName);
}
if (this.character && !this.character.dead && !this.character.stunned)
{
flag = true;
}
}
if (!this.inRange && (this.coolAudio.playEveryTimePlayerIsNear || this.endAudio == null) && (!this.listenForCharacter || flag))
{
this.coolAudio.audioSource.Play();
if (this.endAudio == null)
{
this.coolAudio.audioSource.volume = 0f;
}
this.inRange = true;
this.StartAudioBegin();
}
}
else if (this.inRange && sqrMagnitude > this.offDistance * this.offDistance && this.endAudio == null)
{
if (this.keepPlayingThroughInterior)
{
if (!(Links.x.rtsCamera.currentBoundsName == "interior_frog_bridgeA") && !Links.x.cameraEffects.transitioning)
{
this.StartAudioEnd();
}
}
else
{
this.StartAudioEnd();
}
}
}
if (this.playing && Links.x.gaia.loadingCharacterCreation)
{
this.StartAudioEnd();
}
}
}
// Token: 0x06000211 RID: 529 RVA: 0x0002C974 File Offset: 0x0002AB74
private void StartAudioBegin()
{
if (this.startAudio == null)
{
this.startAudio = this.AudioFadeIn();
base.StartCoroutine(this.startAudio);
}
}
// Token: 0x06000212 RID: 530 RVA: 0x0002C998 File Offset: 0x0002AB98
private void OnDisable()
{
if (this.endAudio != null)
{
base.StopCoroutine(this.endAudio);
this.endAudio = null;
}
if (this.inRange)
{
if (Links.x.hasMain && ((this.coolAudio.loopIt && this.overrideMainSoundtrack) || !this.coolAudio.loopIt))
{
Links.x.gaia.playingSoundtrackFromInWorld = false;
Links.x.gaia.SetEnvironmentPlaylist(Links.x.gameplay.sailing, Links.x.main.inTown, true);
}
this.inRange = false;
this.coolAudio.audioSource.Stop();
}
if (this.startAudio != null)
{
base.StopCoroutine(this.startAudio);
this.startAudio = null;
if (Links.x.hasMain && ((this.coolAudio.loopIt && this.overrideMainSoundtrack) || !this.coolAudio.loopIt))
{
Links.x.gaia.playingSoundtrackFromInWorld = false;
Links.x.gaia.SetEnvironmentPlaylist(Links.x.gameplay.sailing, Links.x.main.inTown, true);
}
this.inRange = false;
}
}
// Token: 0x06000213 RID: 531 RVA: 0x0002CADF File Offset: 0x0002ACDF
private IEnumerator AudioFadeIn()
{
if ((this.coolAudio.loopIt && this.overrideMainSoundtrack) || !this.coolAudio.loopIt)
{
Links.x.gaia.playingSoundtrackFromInWorld = true;
Links.x.gaia.FadeOutPlaylist(true, 0.5f);
}
float startValue = this.coolAudio.audioSource.volume;
float num = Links.x.options.soundVolume * this.maxAudioVolume;
float timeToLerp = 3f;
float percentage = 0f;
float startTime = Time.realtimeSinceStartup;
while (percentage < 1f)
{
num = Links.x.options.soundVolume;
num *= this.maxAudioVolume;
percentage = (Time.realtimeSinceStartup - startTime) / timeToLerp;
float num2 = Mathf.Lerp(startValue, num, percentage);
this.coolAudio.audioSource.volume = num2;
yield return null;
}
this.startAudio = null;
yield break;
}
// Token: 0x06000214 RID: 532 RVA: 0x0002CAEE File Offset: 0x0002ACEE
private void StartAudioEnd()
{
if (this.endAudio == null)
{
this.endAudio = this.AudioFadeOut();
base.StartCoroutine(this.endAudio);
}
}
// Token: 0x06000215 RID: 533 RVA: 0x0002CB11 File Offset: 0x0002AD11
private IEnumerator AudioFadeOut()
{
this.playing = false;
float startValue = this.coolAudio.audioSource.volume;
float endValue = 0f;
float timeToLerp = 3f;
float percentage = 0f;
float startTime = Time.realtimeSinceStartup;
while (percentage < 1f)
{
percentage = (Time.realtimeSinceStartup - startTime) / timeToLerp;
float num = Mathf.Lerp(startValue, endValue, percentage);
this.coolAudio.audioSource.volume = num;
yield return null;
}
if (Links.x.hasMain && ((this.coolAudio.loopIt && this.overrideMainSoundtrack) || !this.coolAudio.loopIt))
{
Links.x.gaia.playingSoundtrackFromInWorld = false;
Links.x.gaia.SetEnvironmentPlaylist(Links.x.gameplay.sailing, Links.x.main.inTown, true);
}
this.inRange = false;
this.coolAudio.audioSource.Stop();
if (!this.coolAudio.playEveryTimePlayerIsNear)
{
float num2 = Random.Range(3f, 5f) * 60f;
yield return new WaitForSeconds(num2);
}
this.endAudio = null;
yield break;
}
// Token: 0x040003D7 RID: 983
public CoolAudioSource coolAudio;
// Token: 0x040003D8 RID: 984
private float distance;
// Token: 0x040003D9 RID: 985
private float offDistance;
// Token: 0x040003DA RID: 986
private Vector3 position;
// Token: 0x040003DB RID: 987
public bool inRange;
// Token: 0x040003DC RID: 988
public bool playing;
// Token: 0x040003DD RID: 989
public bool keepPlayingThroughInterior;
// Token: 0x040003DE RID: 990
public bool listenForCharacter;
// Token: 0x040003DF RID: 991
public string characterListenName;
// Token: 0x040003E0 RID: 992
private IEnumerator startAudio;
// Token: 0x040003E1 RID: 993
private IEnumerator endAudio;
// Token: 0x040003E2 RID: 994
private float maxAudioVolume;
// Token: 0x040003E3 RID: 995
private Character character;
// Token: 0x040003E4 RID: 996
private bool overrideMainSoundtrack;
}

View File

@@ -1,14 +0,0 @@
using System;
using UnityEngine;
// Token: 0x0200008B RID: 139
public class AudioSourceDebugging : MonoBehaviour
{
// Token: 0x06000DDB RID: 3547 RVA: 0x00105600 File Offset: 0x00103800
private void Update()
{
}
// Token: 0x04001664 RID: 5732
private AudioSource[] sources;
}

View File

@@ -1,86 +0,0 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
// Token: 0x02000095 RID: 149
public class Bag : MonoBehaviour
{
// Token: 0x06000E5E RID: 3678 RVA: 0x0011444A File Offset: 0x0011264A
private void Awake()
{
this.Setup();
}
// Token: 0x06000E5F RID: 3679 RVA: 0x00114454 File Offset: 0x00112654
public void Setup()
{
if (this.gridTrs.Count == 0)
{
foreach (object obj in this.gridTr)
{
Transform transform = (Transform)obj;
if (transform != this.gridTr)
{
this.gridImg.Add(transform.gameObject.GetComponent<Image>());
this.gridTrs.Add(transform);
this.gridState.Add(false);
transform.gameObject.GetComponent<Image>().sprite = this.emptySprite;
}
}
}
}
// Token: 0x06000E60 RID: 3680 RVA: 0x00114508 File Offset: 0x00112708
public void End()
{
for (int i = 0; i < this.gridImg.Count; i++)
{
if (!this.gridImg[i].sprite != this.emptySprite)
{
this.gridImg[i].sprite = this.emptySprite;
}
this.gridState[i] = false;
}
}
// Token: 0x06000E61 RID: 3681 RVA: 0x00114578 File Offset: 0x00112778
public Vector3 SubtractVectors(Vector3 a, Vector3 b)
{
Vector3 vector;
vector.x = a.x - b.x;
vector.y = a.y - b.y;
vector.z = a.z - b.z;
return vector;
}
// Token: 0x040016D9 RID: 5849
public Transform gridTr;
// Token: 0x040016DA RID: 5850
public int gridAmt;
// Token: 0x040016DB RID: 5851
public int mainBagX = 6;
// Token: 0x040016DC RID: 5852
public int mainBagY = 6;
// Token: 0x040016DD RID: 5853
public List<Image> gridImg = new List<Image>();
// Token: 0x040016DE RID: 5854
public List<bool> gridState = new List<bool>();
// Token: 0x040016DF RID: 5855
public List<Transform> gridTrs = new List<Transform>();
// Token: 0x040016E0 RID: 5856
public List<int> dragHoverImg = new List<int>();
// Token: 0x040016E1 RID: 5857
public bool secondary;
// Token: 0x040016E2 RID: 5858
public Sprite emptySprite;
}

View File

@@ -1,37 +0,0 @@
using System;
using UnityEngine;
// Token: 0x020000FB RID: 251
public class BakedMeshAnimation : MonoBehaviour
{
// Token: 0x040025D0 RID: 9680
public Mesh[] meshes;
// Token: 0x040025D1 RID: 9681
public float playSpeed = 30f;
// Token: 0x040025D2 RID: 9682
[HideInInspector]
public Renderer rendererComponent;
// Token: 0x040025D3 RID: 9683
public bool randomStartFrame = true;
// Token: 0x040025D4 RID: 9684
public bool loop = true;
// Token: 0x040025D5 RID: 9685
public bool pingPong;
// Token: 0x040025D6 RID: 9686
public bool playOnAwake = true;
// Token: 0x040025D7 RID: 9687
public Transform transformCache;
// Token: 0x040025D8 RID: 9688
public int transitionFrame;
// Token: 0x040025D9 RID: 9689
public int crossfadeFrame;
}

View File

@@ -1,387 +0,0 @@
using System;
using System.Collections.Generic;
using UnityEngine;
// Token: 0x020000FC RID: 252
public class BakedMeshAnimator : MonoBehaviour
{
// Token: 0x060015A7 RID: 5543 RVA: 0x0019B24C File Offset: 0x0019944C
private void Awake()
{
this.tr = base.transform;
this.currentAnimation = Mathf.Clamp(this.startAnimation, 0, this.animations.Length - 1);
if (this.animationMeshRenderer == null)
{
this.animationMeshRenderer = base.GetComponent<MeshRenderer>();
}
if (this.animationMeshRenderer == null)
{
Debug.LogError("BakedMeshAnimator: " + ((this != null) ? this.ToString() : null) + " has no assigned MeshRenderer!");
}
this.meshFilter = this.animationMeshRenderer.GetComponent<MeshFilter>();
this.meshCacheCount = this.animations[this.currentAnimation].meshes.Length;
this.currentSpeed = this.animations[this.currentAnimation].playSpeed;
this.CreateCrossFadeMesh();
this.StartCrossfade();
if (this.meshFilter.sharedMesh == null)
{
this.meshFilter.sharedMesh = this.animations[0].meshes[0];
}
}
// Token: 0x060015A8 RID: 5544 RVA: 0x0019B346 File Offset: 0x00199546
public void AnimateUpdate()
{
if (this.animations.Length == 0)
{
return;
}
this.Animate();
}
// Token: 0x060015A9 RID: 5545 RVA: 0x0019B358 File Offset: 0x00199558
public void SetAnimation(int _animation, int _transitionFrame)
{
if (this.currentAnimation == _animation)
{
return;
}
this.transitionFrame = _transitionFrame;
this.anim = _animation;
this.SetAnimCommon();
}
// Token: 0x060015AA RID: 5546 RVA: 0x0019B378 File Offset: 0x00199578
public void SetAnimation(int _animation)
{
if (this.currentAnimation == _animation)
{
return;
}
this.transitionFrame = this.animations[this.currentAnimation].transitionFrame;
this.anim = _animation;
this.SetAnimCommon();
}
// Token: 0x060015AB RID: 5547 RVA: 0x0019B3A9 File Offset: 0x001995A9
private void SetAnimCommon()
{
base.enabled = true;
this.transitioning = true;
this.StartCrossfade();
}
// Token: 0x060015AC RID: 5548 RVA: 0x0019B3C0 File Offset: 0x001995C0
public void Animate()
{
if (!this.animationMeshRenderer.isVisible)
{
return;
}
Vector3 cameraTargetPosition = Links.x.rtsCamera.cameraTargetPosition;
cameraTargetPosition.y = this.tr.position.y;
if ((this.tr.position - cameraTargetPosition).sqrMagnitude > 1600f)
{
return;
}
if (this.transitioning)
{
if (this.crossfade || (int)this.currentFrame == this.transitionFrame || this.failsafe > this.transitionFailsafe)
{
this.failsafe = 0f;
this.transitioning = false;
this.currentAnimation = this.anim;
this.meshCacheCount = this.animations[this.currentAnimation].meshes.Length;
this.currentSpeed = this.animations[this.currentAnimation].playSpeed;
if (Time.time < 1f && this.animations[this.currentAnimation].randomStartFrame)
{
this.currentFrame = (float)Random.Range(this.meshCacheCount, 0);
}
else if (this.crossfade)
{
this.currentFrame = (float)this.animations[this.currentAnimation].crossfadeFrame;
}
else
{
this.currentFrame = (float)this.animations[this.currentAnimation].transitionFrame;
}
}
else
{
this.failsafe += Time.deltaTime;
}
}
if (!this.doCrossfade)
{
if (this.animations[this.currentAnimation].pingPong)
{
this.PingPongFrame();
}
else
{
this.NextFrame();
}
if (this.currentFrameInt != (int)this.currentFrame)
{
this.currentFrameInt = (int)this.currentFrame;
if (this.crossfade && this.crossfadeNormalFix)
{
this.animations[this.currentAnimation].meshes[(int)this.currentFrame].GetVertices(this.norms);
this.crossfadeMeshEnd.SetVertices(this.norms);
}
else
{
this.meshFilter.sharedMesh = this.animations[this.currentAnimation].meshes[(int)this.currentFrame];
}
}
}
this.UpdateCrossfade();
}
// Token: 0x060015AD RID: 5549 RVA: 0x0019B5EC File Offset: 0x001997EC
public bool NextFrame()
{
this.currentFrame += this.currentSpeed * Time.deltaTime * this.playSpeedMultiplier;
if (this.currentFrame > (float)(this.meshCacheCount + 1))
{
this.currentFrame = 0f;
if (!this.animations[this.currentAnimation].loop)
{
base.enabled = false;
}
return true;
}
if (this.currentFrame >= (float)this.meshCacheCount)
{
this.currentFrame = (float)this.meshCacheCount - this.currentFrame;
if (!this.animations[this.currentAnimation].loop)
{
base.enabled = false;
}
return true;
}
return false;
}
// Token: 0x060015AE RID: 5550 RVA: 0x0019B694 File Offset: 0x00199894
public bool PingPongFrame()
{
if (this.pingPongToggle)
{
this.currentFrame += this.currentSpeed * Time.deltaTime * this.playSpeedMultiplier;
}
else
{
this.currentFrame -= this.currentSpeed * Time.deltaTime * this.playSpeedMultiplier;
}
if (this.currentFrame <= 0f)
{
this.currentFrame = 0f;
this.pingPongToggle = true;
return true;
}
if (this.currentFrame >= (float)this.meshCacheCount)
{
this.pingPongToggle = false;
this.currentFrame = (float)(this.meshCacheCount - 1);
return true;
}
return false;
}
// Token: 0x060015AF RID: 5551 RVA: 0x0019B734 File Offset: 0x00199934
public void SetSpeedMultiplier(float speed)
{
this.playSpeedMultiplier = speed;
}
// Token: 0x060015B0 RID: 5552 RVA: 0x0019B740 File Offset: 0x00199940
private void CrossfadeInit()
{
if (this.vertsDiff == null)
{
this.vertsDiff = new Vector3[this.vertsStart.Count];
}
this.crossfadeMestTo.GetVertices(this.meshVerts);
for (int i = 0; i < this.vertsStart.Count; i++)
{
this.vertsDiff[i] = this.meshVerts[i] - this.vertsStart[i];
}
}
// Token: 0x060015B1 RID: 5553 RVA: 0x0019B7BC File Offset: 0x001999BC
private void CreateCrossFadeMesh()
{
if (!this.crossfade)
{
return;
}
this.crossfadeMeshStart = this.meshFilter.sharedMesh;
this.crossfadeMeshStart.GetVertices(this.vertsStart);
if (this.crossfadeMeshEnd == null)
{
this.crossfadeMeshEnd = new Mesh();
this.crossfadeMeshEnd.MarkDynamic();
this.crossfadeMeshEnd.SetVertices(this.vertsStart);
this.crossfadeMeshEnd.triangles = this.crossfadeMeshStart.triangles;
this.crossfadeMeshEnd.uv = this.crossfadeMeshStart.uv;
this.crossfadeMeshStart.GetNormals(this.norms);
this.crossfadeMeshEnd.SetNormals(this.norms);
}
}
// Token: 0x060015B2 RID: 5554 RVA: 0x0019B878 File Offset: 0x00199A78
private void StartCrossfade()
{
if (!this.crossfade)
{
return;
}
this.crossfadeMeshStart = this.meshFilter.sharedMesh;
this.crossfadeMeshStart.GetVertices(this.vertsStart);
this.doCrossfade = true;
this.crossfadeWeight = 0f;
this.crossfadeMeshEnd.SetVertices(this.vertsStart);
this.meshFilter.mesh = this.crossfadeMeshEnd;
this.crossfadeMeshStart.GetVertices(this.vertsStart);
if (this.vertsCurrent == null)
{
this.vertsCurrent = new Vector3[this.vertsStart.Count];
}
}
// Token: 0x060015B3 RID: 5555 RVA: 0x0019B914 File Offset: 0x00199B14
private void UpdateCrossfade()
{
if (!this.crossfade)
{
return;
}
this.nextUpdate += Time.deltaTime;
if (this.nextUpdate < this.crossfadeFrequency)
{
return;
}
this.nextUpdate = 0f;
if (this.crossfadeWeight >= 1f)
{
this.doCrossfade = false;
return;
}
this.crossfadeMestTo = this.animations[this.currentAnimation].meshes[this.animations[this.currentAnimation].crossfadeFrame];
if (this.crossfadeWeight == 0f)
{
this.CrossfadeInit();
}
for (int i = 0; i < this.vertsCurrent.Length; i++)
{
this.vertsCurrent[i] = this.vertsStart[i];
}
if (this.vertsDiff.Length != this.vertsStart.Count)
{
return;
}
for (int j = 0; j < this.vertsCurrent.Length; j++)
{
this.vertsCurrent[j] += this.vertsDiff[j] * this.crossfadeWeight;
}
this.crossfadeMeshEnd.SetVertices(this.vertsCurrent);
this.crossfadeWeight += this.crossfadeWeightAdd;
}
// Token: 0x040025DA RID: 9690
public MeshRenderer animationMeshRenderer;
// Token: 0x040025DB RID: 9691
public BakedMeshAnimation[] animations;
// Token: 0x040025DC RID: 9692
public int startAnimation;
// Token: 0x040025DD RID: 9693
private int currentAnimation;
// Token: 0x040025DE RID: 9694
private MeshFilter meshFilter;
// Token: 0x040025DF RID: 9695
public float currentFrame;
// Token: 0x040025E0 RID: 9696
private int currentFrameInt;
// Token: 0x040025E1 RID: 9697
private float currentSpeed;
// Token: 0x040025E2 RID: 9698
private bool pingPongToggle;
// Token: 0x040025E3 RID: 9699
public float playSpeedMultiplier = 1f;
// Token: 0x040025E4 RID: 9700
private int meshCacheCount;
// Token: 0x040025E5 RID: 9701
public float transitionFailsafe = 0.4f;
// Token: 0x040025E6 RID: 9702
private float failsafe;
// Token: 0x040025E7 RID: 9703
private int transitionFrame;
// Token: 0x040025E8 RID: 9704
private int anim;
// Token: 0x040025E9 RID: 9705
private bool transitioning = true;
// Token: 0x040025EA RID: 9706
private Transform tr;
// Token: 0x040025EB RID: 9707
public bool crossfade;
// Token: 0x040025EC RID: 9708
public bool crossfadeNormalFix;
// Token: 0x040025ED RID: 9709
public float crossfadeFrequency = 0.05f;
// Token: 0x040025EE RID: 9710
public float crossfadeWeightAdd = 0.221f;
// Token: 0x040025EF RID: 9711
private bool doCrossfade;
// Token: 0x040025F0 RID: 9712
private float crossfadeWeight = 1f;
// Token: 0x040025F1 RID: 9713
private Mesh crossfadeMestTo;
// Token: 0x040025F2 RID: 9714
private Mesh crossfadeMeshStart;
// Token: 0x040025F3 RID: 9715
private Mesh crossfadeMeshEnd;
// Token: 0x040025F4 RID: 9716
private List<Vector3> vertsStart = new List<Vector3>();
// Token: 0x040025F5 RID: 9717
private List<Vector3> norms = new List<Vector3>();
// Token: 0x040025F6 RID: 9718
private Vector3[] vertsCurrent;
// Token: 0x040025F7 RID: 9719
private Vector3[] vertsDiff;
// Token: 0x040025F8 RID: 9720
private List<Vector3> meshVerts = new List<Vector3>();
// Token: 0x040025F9 RID: 9721
private float nextUpdate;
}

View File

@@ -1,60 +0,0 @@
using System;
using UnityEngine;
// Token: 0x020000FD RID: 253
public class BakedMeshAnimatorUpdater : MonoBehaviour
{
// Token: 0x060015B5 RID: 5557 RVA: 0x0019BAC8 File Offset: 0x00199CC8
private void Start()
{
if (this.updateChildren)
{
this.children = base.transform.GetComponentsInChildren<BakedMeshAnimator>();
for (int i = 0; i < this.children.Length; i++)
{
if (this.randomizeSpeed)
{
this.children[i].SetSpeedMultiplier(Random.Range(this.minSpeedMultiplier, this.maxSpeedMultiplier));
}
}
return;
}
this.animatedMesh = base.GetComponent<BakedMeshAnimator>();
if (this.randomizeSpeed)
{
this.animatedMesh.SetSpeedMultiplier(Random.Range(this.minSpeedMultiplier, this.maxSpeedMultiplier));
}
}
// Token: 0x060015B6 RID: 5558 RVA: 0x0019BB58 File Offset: 0x00199D58
private void Update()
{
if (this.updateChildren)
{
for (int i = 0; i < this.children.Length; i++)
{
this.children[i].AnimateUpdate();
}
return;
}
this.animatedMesh.AnimateUpdate();
}
// Token: 0x040025FA RID: 9722
private BakedMeshAnimator animatedMesh;
// Token: 0x040025FB RID: 9723
private BakedMeshAnimator[] children;
// Token: 0x040025FC RID: 9724
public bool updateChildren;
// Token: 0x040025FD RID: 9725
public bool randomizeSpeed;
// Token: 0x040025FE RID: 9726
public float minSpeedMultiplier = 1f;
// Token: 0x040025FF RID: 9727
public float maxSpeedMultiplier = 1f;
}

View File

@@ -1,60 +0,0 @@
using System;
using UnityEngine;
// Token: 0x02000096 RID: 150
public class Billboard : MonoBehaviour
{
// Token: 0x06000E63 RID: 3683 RVA: 0x00114611 File Offset: 0x00112811
private void OnEnable()
{
this.GetVariables();
}
// Token: 0x06000E64 RID: 3684 RVA: 0x0011461C File Offset: 0x0011281C
public void GetVariables()
{
if (!this.tr)
{
this.tr = base.transform;
}
if (Links.x.rallyStage.playing && this.inRally)
{
this.camTr = Links.x.rallyStage.rallyCamera.gameObject.transform;
}
else
{
this.camTr = Links.x.rtsCamera.tr;
}
this.forw = Vector3.forward;
this.up = Vector3.up;
this.hasVars = true;
}
// Token: 0x06000E65 RID: 3685 RVA: 0x001146B0 File Offset: 0x001128B0
private void LateUpdate()
{
if (!this.hasVars)
{
this.GetVariables();
}
this.tr.LookAt(this.tr.position + this.camTr.rotation * this.forw, this.camTr.rotation * this.up);
}
// Token: 0x040016E3 RID: 5859
private Transform tr;
// Token: 0x040016E4 RID: 5860
private Transform camTr;
// Token: 0x040016E5 RID: 5861
private Vector3 forw;
// Token: 0x040016E6 RID: 5862
private Vector3 up;
// Token: 0x040016E7 RID: 5863
private bool hasVars;
// Token: 0x040016E8 RID: 5864
public bool inRally;
}

View File

@@ -1,25 +0,0 @@
using System;
using UnityEngine;
// Token: 0x020000EF RID: 239
public class BirdMaterialChanger : MonoBehaviour
{
// Token: 0x0600154B RID: 5451 RVA: 0x001983D8 File Offset: 0x001965D8
private void Start()
{
this.ChangeMaterial();
}
// Token: 0x0600154C RID: 5452 RVA: 0x001983E0 File Offset: 0x001965E0
private void ChangeMaterial()
{
base.GetComponentInChildren<SkinnedMeshRenderer>().sharedMaterial = this.materials[BirdMaterialChanger.counter];
BirdMaterialChanger.counter++;
}
// Token: 0x04002529 RID: 9513
public Material[] materials;
// Token: 0x0400252A RID: 9514
private static int counter;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,19 +0,0 @@
using System;
using UnityEngine;
// Token: 0x02000018 RID: 24
public class BoneListener : MonoBehaviour
{
// Token: 0x060002BE RID: 702 RVA: 0x00038B33 File Offset: 0x00036D33
private void Start()
{
}
// Token: 0x060002BF RID: 703 RVA: 0x00038B35 File Offset: 0x00036D35
private void OnCollisionEnter(Collision collision)
{
}
// Token: 0x040004ED RID: 1261
private float startTime;
}

View File

@@ -1,670 +0,0 @@
using System;
using System.Collections.Generic;
using DarkTonic.MasterAudio;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
// Token: 0x02000097 RID: 151
public class Books : MonoBehaviour
{
// Token: 0x06000E67 RID: 3687 RVA: 0x0011471A File Offset: 0x0011291A
private void Start()
{
this.tr = base.gameObject.transform;
}
// Token: 0x06000E68 RID: 3688 RVA: 0x00114730 File Offset: 0x00112930
public void CloseMenu()
{
if (Links.x.characterSheet.open)
{
MasterAudio.PlaySoundAndForget("Paper Open 2", 1f, new float?(1f), 0f, "", null);
}
this.ReturnSelected();
for (int i = 0; i < this.spells.Count; i++)
{
if (this.spells[i].star)
{
this.spells[i].star = null;
}
Links.x.cellar.ReturnPooledUIObject(49, this.spells[i].gameObject);
}
this.RemoveStars();
this.spells.Clear();
this.open = false;
this.anim.Play("CloseSubMenu");
Links.x.characterSheet.CheckLevelUp();
if (Links.x.joy)
{
Links.x.characterSheet.closeText.SetActive(true);
}
if (Links.x.joy)
{
Links.x.characterSheet.DraggingButtons(false);
}
if (Links.x.joy)
{
if (this.clickedOpen)
{
if (this.clickedOpen.activeSelf && this.clickedOpen.activeInHierarchy)
{
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.clickedOpen);
return;
}
Links.x.gameplay.SetInteractableSelected(EventSystem.current, Links.x.characterSheet.character.characterSheetPortrait.gameObject);
return;
}
else
{
Links.x.gameplay.SetInteractableSelected(EventSystem.current, Links.x.characterSheet.character.characterSheetPortrait.gameObject);
}
}
}
// Token: 0x06000E69 RID: 3689 RVA: 0x00114903 File Offset: 0x00112B03
public void OpenWords()
{
this.currentType = "Words";
this.SetGrid("Words", Links.x.characterSheet.character, false);
}
// Token: 0x06000E6A RID: 3690 RVA: 0x0011492C File Offset: 0x00112B2C
public void OpenSpells()
{
this.favoriteMessage.SetActive(false);
this.RemoveStars();
MasterAudio.PlaySoundAndForget("Paper Open", 1f, new float?(1f), 0f, "", null);
if (Links.x.arrowKit.open)
{
Links.x.arrowKit.CloseMenu();
}
if (Links.x.characterSheet.note.activeSelf)
{
Links.x.characterSheet.CloseNote();
}
this.currentType = "Spells";
this.SetGrid("Spells", Links.x.characterSheet.character, false);
Links.x.characterSheet.levelUpButton.SetActive(false);
if (Links.x.joy)
{
Links.x.characterSheet.closeText.SetActive(false);
}
if (Links.x.joy)
{
Links.x.characterSheet.DraggingButtons(true);
if (this.spells.Count > 0)
{
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.spells[0].gameObject);
}
}
if (Links.x.characterSheet.minstrel)
{
this.closeButton.SetActive(false);
}
else
{
this.closeButton.SetActive(true);
}
Links.x.characterSheet.SetPortraitNav(false);
if (Links.x.joy)
{
this.controllerSpellDelete.spriteAsset = Links.x.GetSpriteSheetAsset(Links.x.gameplay.currentSpriteSheetAsset);
this.str.Clear();
this.str.Append("<voffset=.4em><size=40><sprite=");
int num = Links.x.gameplay.GetControllerSprite("Action", Links.x.gameplay.controllerName);
this.str.Append(num);
this.str.Append("></size></voffset>Toggle Favorite ");
this.str.Append("<voffset=.4em><size=40><sprite=");
num = Links.x.gameplay.GetControllerSprite("Interact", Links.x.gameplay.controllerName);
this.str.Append(num);
this.str.Append("></size></voffset>Delete Spell ");
this.controllerSpellDelete.text = this.str.ToString();
return;
}
this.controllerSpellDelete.text = "";
}
// Token: 0x06000E6B RID: 3691 RVA: 0x00114BB0 File Offset: 0x00112DB0
public void OpenSongs()
{
this.controllerSpellDelete.text = "";
this.RemoveStars();
this.favoriteMessage.SetActive(false);
MasterAudio.PlaySoundAndForget("Paper Open", 1f, new float?(1f), 0f, "", null);
if (Links.x.arrowKit.open)
{
Links.x.arrowKit.CloseMenu();
}
if (Links.x.characterSheet.note.activeSelf)
{
Links.x.characterSheet.CloseNote();
}
this.autoCast.SetActive(false);
this.currentType = "Songs";
this.SetGrid("Songs", Links.x.characterSheet.character, false);
Links.x.characterSheet.levelUpButton.SetActive(false);
if (Links.x.joy)
{
Links.x.characterSheet.closeText.SetActive(false);
}
if (Links.x.joy)
{
Links.x.characterSheet.DraggingButtons(true);
if (this.spells.Count > 0 && !Links.x.characterSheet.minstrel)
{
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.spells[0].gameObject);
}
}
if (Links.x.characterSheet.minstrel)
{
this.closeButton.SetActive(false);
}
else
{
this.closeButton.SetActive(true);
}
this.knowledgeText.enabled = false;
this.krt.gameObject.SetActive(false);
Links.x.characterSheet.SetPortraitNav(false);
}
// Token: 0x06000E6C RID: 3692 RVA: 0x00114D74 File Offset: 0x00112F74
private void Update()
{
if (Links.x.characterSheet.open && (Links.x.characterSheet.character != this.character || this.doUpdate))
{
this.favoriteMessage.SetActive(false);
this.RemoveStars();
this.SetGrid(this.currentType, Links.x.characterSheet.character, false);
this.doUpdate = false;
}
}
// Token: 0x06000E6D RID: 3693 RVA: 0x00114DEB File Offset: 0x00112FEB
public void UpdateAbilityTriggers()
{
}
// Token: 0x06000E6E RID: 3694 RVA: 0x00114DF0 File Offset: 0x00112FF0
public void Equipped()
{
if (this.savedCharacter != Links.x.characterSheet.character)
{
this.abilityNames = Links.x.characterSheet.character.stats.abilityNames;
this.uniqueNames = Links.x.characterSheet.character.stats.uniqueNames;
this.spellLevels = Links.x.characterSheet.character.stats.abilityLevels;
this.abilityCosts = Links.x.characterSheet.character.stats.abilityCost;
this.abilityRows = Links.x.characterSheet.character.stats.abilityRows;
}
this.savedCharacter = Links.x.characterSheet.character;
this.songPointsText.text = Links.x.characterSheet.character.stats.songPoints.ToString();
}
// Token: 0x06000E6F RID: 3695 RVA: 0x00114EF8 File Offset: 0x001130F8
public void SetGrid(string type, Character c, bool allSpells)
{
this.ReturnSelected();
base.gameObject.SetActive(true);
this.open = true;
this.character = c;
if (this.savedCharacter != Links.x.characterSheet.character)
{
this.abilityNames = Links.x.characterSheet.character.stats.abilityNames;
this.uniqueNames = Links.x.characterSheet.character.stats.uniqueNames;
this.spellLevels = Links.x.characterSheet.character.stats.abilityLevels;
this.abilityCosts = Links.x.characterSheet.character.stats.abilityCost;
this.abilityRows = Links.x.characterSheet.character.stats.abilityRows;
}
this.savedCharacter = Links.x.characterSheet.character;
int count = this.abilityNames.Count;
if (this.spells.Count > 0)
{
for (int i = 0; i < this.spells.Count; i++)
{
if (this.spells[i].star)
{
this.spells[i].star = null;
}
Links.x.cellar.ReturnPooledUIObject(49, this.spells[i].gameObject);
}
this.spells.Clear();
}
if (allSpells)
{
this.headerText.text = c.stats.GetName() + "'s ";
TextMeshProUGUI textMeshProUGUI = this.headerText;
textMeshProUGUI.text += " Spell Variants";
}
if (type == "Spells")
{
this.pointsObject.SetActive(false);
this.knowledgeText.enabled = true;
this.knowledgeText.text = "";
this.knowledge = this.character.stats.knowledge;
this.str.Clear();
this.str.Append("\n\n<align=center><size=1.5em><font=Bold>Learned Effects</font></size></align>\n");
for (int j = 0; j < this.knowledge.Count; j++)
{
this.str.Append("<size=1.2em><font=Bold>");
Library.Pagan paganRow = Links.x.library.GetPaganRow(this.knowledge[j]);
this.str.Append(paganRow._DisplayName);
this.str.Append("</font></size>\n");
this.str.Append(paganRow._Description);
this.str.Append("\n\n");
}
if (this.knowledge.Count == 0)
{
this.str.Append("None\n");
}
this.str.Append("\n\n");
this.knowledgeText.text = this.str.ToString();
this.krt.sizeDelta = new Vector2(this.krt.sizeDelta.x, this.knowledgeText.preferredHeight);
}
else
{
this.pointsObject.SetActive(true);
}
if ((type == "Spells" && c.stats.HasSpellbook()) || (type == "Songs" && c.stats.HasSongbook()))
{
for (int k = 0; k < count; k++)
{
bool flag = false;
if (this.abilityRows[k]._IsSpell && allSpells)
{
flag = true;
}
string mainSkill = this.abilityRows[k]._MainSkill;
if (this.abilityRows[k]._IsSpell && type == "Spells" && !allSpells)
{
flag = true;
}
if (!this.abilityRows[k]._IsSpell && !this.abilityRows[k]._IsSong && !allSpells && type == "Words")
{
flag = true;
}
if (this.abilityRows[k]._IsSong && type == "Songs" && !allSpells)
{
flag = true;
}
if (flag)
{
GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(49);
pooledGameObject.SetActive(true);
pooledGameObject.transform.SetParent(this.gridTransform, false);
SkillButton component = pooledGameObject.GetComponent<SkillButton>();
component.inSpellMenu = false;
if (allSpells || type == "Spells")
{
component.abilityName = this.abilityNames[k];
component.uniqueName = this.uniqueNames[k];
component.index = k;
component.abilityCost = (float)((int)this.abilityCosts[k].x);
component.character = c;
component.spellStats = this.spellLevels[k];
if (allSpells)
{
component.inSpellMenu = true;
}
else
{
component.inSpellMenu = false;
}
if (this.character.stats.IsFavoriteSpell(component.uniqueName) && !component.star)
{
this.AddStar(component);
}
}
if (type == "Songs")
{
component.abilityName = this.abilityNames[k];
component.index = k;
component.character = c;
component.componentID = -1;
component.uniqueName = this.uniqueNames[k];
component.inSpellMenu = false;
}
if (type == "Words")
{
component.abilityName = this.abilityNames[k];
component.index = k;
component.character = c;
component.componentID = -1;
component.uniqueName = this.uniqueNames[k];
}
component.inWindow = false;
component.Setup(true, true);
this.spells.Add(component);
pooledGameObject.transform.localPosition = new Vector3(pooledGameObject.transform.localPosition.x, pooledGameObject.transform.localPosition.y, 0f);
}
}
}
if (this.spells.Count > 0)
{
this.noAbilitiesText.text = "";
this.headerText.text = c.stats.GetName() + "'s ";
if (type == "Spells")
{
TextMeshProUGUI textMeshProUGUI2 = this.headerText;
textMeshProUGUI2.text += "Spellbook";
}
if (type == "Songs")
{
TextMeshProUGUI textMeshProUGUI3 = this.headerText;
textMeshProUGUI3.text += "Songbook";
}
if (type == "Words")
{
TextMeshProUGUI textMeshProUGUI4 = this.headerText;
textMeshProUGUI4.text += " Words";
}
if (this.autoCast && !allSpells && this.currentType == "Spells")
{
this.autoCast.SetActive(true);
}
if (type == "Spells")
{
this.favoriteMessage.SetActive(true);
}
}
else
{
this.str.Clear();
this.str.Append(c.stats.GetName());
if (type == "Spells")
{
if (!c.stats.HasSpellbook())
{
this.str.Append(" doesn't have a spellbook");
}
else
{
this.str.Append(" has not crafted any spells yet");
}
this.headerText.text = "";
}
if (type == "Songs")
{
if (!c.stats.HasSongbook())
{
this.str.Append(" doesn't have a songbook");
}
else
{
this.str.Append(" hasn't learned any songs yet");
}
this.headerText.text = "";
}
if (type == "Words")
{
this.str.Append("Words of Power");
}
this.str.Append(".");
this.noAbilitiesText.text = this.str.ToString();
if (this.autoCast)
{
this.autoCast.SetActive(false);
}
}
if (this.empty && this.krt)
{
if (type == "Spells")
{
this.autoCast.transform.SetAsFirstSibling();
this.empty.gameObject.transform.SetAsLastSibling();
this.krt.gameObject.transform.SetAsLastSibling();
this.empty.SetActive(true);
this.krt.gameObject.SetActive(true);
this.favoriteMessage.transform.SetAsLastSibling();
}
else
{
this.krt.gameObject.SetActive(false);
this.empty.SetActive(false);
}
}
this.UpdateSelected();
}
// Token: 0x06000E70 RID: 3696 RVA: 0x00115818 File Offset: 0x00113A18
public void RemoveStars()
{
for (int i = 0; i < this.stars.Count; i++)
{
this.stars[i].SetActive(false);
this.stars[i].transform.SetParent(this.tr);
}
}
// Token: 0x06000E71 RID: 3697 RVA: 0x0011586C File Offset: 0x00113A6C
public void AddStar(SkillButton b)
{
GameObject gameObject = null;
bool flag = false;
for (int i = 0; i < this.stars.Count; i++)
{
if (!this.stars[i])
{
flag = true;
}
else if (!this.stars[i].activeSelf)
{
gameObject = this.stars[i];
break;
}
}
if (flag)
{
this.stars.RemoveAll((GameObject item) => item == null);
}
if (!gameObject)
{
gameObject = Object.Instantiate<GameObject>(this.stars[0], Vector3.zero, Quaternion.Euler(Vector3.zero), null);
this.stars.Add(gameObject);
}
b.star = gameObject;
b.star.SetActive(true);
b.star.transform.SetParent(b.transform);
b.star.transform.position = b.transform.position;
gameObject.transform.localScale = new Vector3(1f, 1f, 1f);
b.star.transform.localPosition = new Vector3(b.star.transform.localPosition.x, b.star.transform.localPosition.y, 0f);
}
// Token: 0x06000E72 RID: 3698 RVA: 0x001159D8 File Offset: 0x00113BD8
public void AddFavoriteSpell(SkillButton b)
{
if (!this.open)
{
return;
}
if (this.character.stats.IsFavoriteSpell(b.uniqueName))
{
this.RemoveFavoriteSpell(b);
return;
}
this.character.stats.AddFavoriteSpell(b.uniqueName);
if (!b.star)
{
this.AddStar(b);
}
}
// Token: 0x06000E73 RID: 3699 RVA: 0x00115A38 File Offset: 0x00113C38
public void RemoveFavoriteSpell(SkillButton b)
{
this.character.stats.RemoveFavoriteSpell(b.uniqueName);
if (b.star)
{
b.star.SetActive(false);
b.star = null;
}
}
// Token: 0x06000E74 RID: 3700 RVA: 0x00115A70 File Offset: 0x00113C70
public void UpdateSelected()
{
foreach (Image image in this.selectedImages)
{
image.enabled = false;
}
if (this.currentType == "Songs")
{
this.equippedList = this.character.stats.equippedSongList;
}
if (this.currentType == "Songs")
{
int num = 0;
int count = this.spells.Count;
for (int i = 0; i < count; i++)
{
if (this.equippedList.Contains(this.spells[i].uniqueName))
{
this.selectedImages[num].enabled = true;
this.selectedImages[num].gameObject.transform.SetParent(this.spells[i].iconBG.gameObject.transform, false);
this.selectedImages[num].gameObject.transform.localPosition = new Vector3(-6f, 4f, 0f);
num++;
}
}
}
this.Equipped();
}
// Token: 0x06000E75 RID: 3701 RVA: 0x00115BC0 File Offset: 0x00113DC0
public void ReturnSelected()
{
}
// Token: 0x06000E76 RID: 3702 RVA: 0x00115BC4 File Offset: 0x00113DC4
public void CloseSpellDelete()
{
this.deletePopup.SetActive(false);
if (Links.x.joy)
{
if (this.spells.Count > 0)
{
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.spells[0].gameObject);
return;
}
Links.x.gameplay.SetInteractableSelected(EventSystem.current, Links.x.characterSheet.character.characterSheetPortrait.gameObject);
}
}
// Token: 0x06000E77 RID: 3703 RVA: 0x00115C4A File Offset: 0x00113E4A
public void OpenSpellDelete(string spellname)
{
this.toDelete = spellname;
this.deletePopup.SetActive(true);
this.deletePopupText.text = "Are you sure you want to delete " + spellname + "?";
}
// Token: 0x06000E78 RID: 3704 RVA: 0x00115C7A File Offset: 0x00113E7A
public void Delete()
{
this.character.stats.RemoveSpell(this.toDelete);
this.SetGrid("Spells", this.character, false);
this.CloseSpellDelete();
}
// Token: 0x040016E9 RID: 5865
public List<Library.Abilities> abilityRows;
// Token: 0x040016EA RID: 5866
private List<string> uniqueNames;
// Token: 0x040016EB RID: 5867
private List<string> abilityNames;
// Token: 0x040016EC RID: 5868
private List<Vector2> abilityCosts;
// Token: 0x040016ED RID: 5869
private List<Vector4> spellLevels;
// Token: 0x040016EE RID: 5870
public List<SkillButton> spells = new List<SkillButton>();
// Token: 0x040016EF RID: 5871
public TextMeshProUGUI deletePopupText;
// Token: 0x040016F0 RID: 5872
public TextMeshProUGUI noAbilitiesText;
// Token: 0x040016F1 RID: 5873
public TextMeshProUGUI headerText;
// Token: 0x040016F2 RID: 5874
public TextMeshProUGUI songPointsText;
// Token: 0x040016F3 RID: 5875
public TextMeshProUGUI knowledgeText;
// Token: 0x040016F4 RID: 5876
public TextMeshProUGUI controllerSpellDelete;
// Token: 0x040016F5 RID: 5877
public GameObject deletePopup;
// Token: 0x040016F6 RID: 5878
private StringFast str = new StringFast(64);
// Token: 0x040016F7 RID: 5879
public string toDelete;
// Token: 0x040016F8 RID: 5880
public Character character;
// Token: 0x040016F9 RID: 5881
public Character savedCharacter;
// Token: 0x040016FA RID: 5882
public Transform gridTransform;
// Token: 0x040016FB RID: 5883
public Animator anim;
// Token: 0x040016FC RID: 5884
public string currentType;
// Token: 0x040016FD RID: 5885
public bool open;
// Token: 0x040016FE RID: 5886
public List<Image> selectedImages = new List<Image>();
// Token: 0x040016FF RID: 5887
private List<string> equippedList;
// Token: 0x04001700 RID: 5888
public GameObject pointsObject;
// Token: 0x04001701 RID: 5889
public bool doUpdate;
// Token: 0x04001702 RID: 5890
public GameObject clickedOpen;
// Token: 0x04001703 RID: 5891
public GameObject closeButton;
// Token: 0x04001704 RID: 5892
private List<string> knowledge;
// Token: 0x04001705 RID: 5893
public RectTransform krt;
// Token: 0x04001706 RID: 5894
public GameObject empty;
// Token: 0x04001707 RID: 5895
public GameObject autoCast;
// Token: 0x04001708 RID: 5896
public GameObject favoriteMessage;
// Token: 0x04001709 RID: 5897
public List<GameObject> stars = new List<GameObject>();
// Token: 0x0400170A RID: 5898
private Transform tr;
}

View File

@@ -1,731 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Pathfinding;
using UnityEngine;
// Token: 0x02000019 RID: 25
public class Boro : MonoBehaviour
{
// Token: 0x060002C1 RID: 705 RVA: 0x00038B3F File Offset: 0x00036D3F
private void Start()
{
}
// Token: 0x060002C2 RID: 706 RVA: 0x00038B41 File Offset: 0x00036D41
public void Setup()
{
this.character = base.gameObject.GetComponent<Character>();
this.party = Links.x.portraitOrder;
}
// Token: 0x060002C3 RID: 707 RVA: 0x00038B64 File Offset: 0x00036D64
private void OnDisable()
{
this.Stop();
}
// Token: 0x060002C4 RID: 708 RVA: 0x00038B6C File Offset: 0x00036D6C
public void Call(Character callingParty)
{
if (this.corout == null && Links.x.gaia.pathfindingReady)
{
if (this.leaveCoroutine != null)
{
base.StopCoroutine(this.leaveCoroutine);
this.leaveCoroutine = null;
}
if (this.attempt == 0)
{
string text = "Calling " + Records.x.boroName + "...";
Links.x.gameFeed.AddFeed(text);
}
this.corout = this.FindSpot(callingParty, true);
base.StartCoroutine(this.corout);
}
}
// Token: 0x060002C5 RID: 709 RVA: 0x00038BFC File Offset: 0x00036DFC
public void Move(Character callingParty)
{
if (this.corout != null)
{
base.StopCoroutine(this.corout);
this.corout = null;
}
if (this.corout == null && Links.x.gaia.pathfindingReady)
{
this.corout = this.FindSpot(callingParty, true);
base.StartCoroutine(this.corout);
}
}
// Token: 0x060002C6 RID: 710 RVA: 0x00038C58 File Offset: 0x00036E58
private IEnumerator FindSpot(Character callingParty, bool instant)
{
float radius = 12f;
ConstantPath constPath = ConstantPath.ConstructFast(callingParty.node, Records.x.GetConstantPathRadius((int)radius), null);
this.SetNodeConstraint(null, false);
this.nodeConstraint.constrainWalkability = false;
constPath.nnConstraint = this.nodeConstraint;
AstarPath.StartPath(constPath, false);
yield return base.StartCoroutine(constPath.WaitForPath());
constPath.Claim(this);
this.allNodes = constPath.allNodes;
int num = this.allNodes.Count;
int num2 = num - 1;
this.SetNodeConstraint(this.character, true);
this.suitableNodes.Clear();
this.edgeNodes.Clear();
this.nearNodes.Clear();
radius *= Records.x.nodeSize;
for (int i = num2; i >= 0; i--)
{
GraphNode graphNode = this.allNodes[i];
if (((Vector3)graphNode.position - (Vector3)callingParty.node.position).sqrMagnitude < radius * radius && this.nodeConstraint.Suitable(graphNode))
{
this.suitableNodes.Add(graphNode);
}
}
constPath.Release(this, false);
num = this.suitableNodes.Count;
Vector3 position = callingParty.tr.position;
this.added.Clear();
for (int j = 0; j < num; j++)
{
this.added.Add(false);
}
for (int k = 0; k < 15; k++)
{
float num3 = float.PositiveInfinity;
int num4 = -1;
for (int l = 0; l < num; l++)
{
if (!this.added[l])
{
float sqrMagnitude = this.SubtractVectors(position, (Vector3)this.suitableNodes[l].position).sqrMagnitude;
if (sqrMagnitude < num3)
{
num3 = sqrMagnitude;
num4 = l;
}
}
}
if (num4 > -1)
{
this.added[num4] = true;
this.edgeNodes.Add(this.suitableNodes[num4]);
}
}
if (this.edgeNodes.Count > 0)
{
this.character.SetMeshState(false);
Links.x.gaia.boro.body.SetMeshState(false, true);
if (Links.x.gaia.boro.circleTr)
{
Links.x.gaia.boro.circleTr.gameObject.SetActive(false);
}
float num5 = Vector3.Distance(this.character.tr.position, callingParty.tr.position);
num5 *= 0.05f;
if (num5 < 1f)
{
num5 = 1f;
}
if (this.attempt == 0 && !instant)
{
yield return new WaitForSeconds(num5);
}
else if (this.attempt == 0 && instant)
{
yield return new WaitForSeconds(0.5f);
}
GraphNode graphNode2 = this.edgeNodes[this.edgeNodes.Count - 1];
int num6 = this.edgeNodes.Count - 1;
this.attempt = 0;
if (this.character.inactive)
{
this.character.TurnScriptsOn();
}
this.boroInvisible = false;
Records.x.boroInvisible = this.boroInvisible;
this.character.tr.position = (Vector3)this.edgeNodes[num6].position;
this.character.SetRotation(Quaternion.LookRotation(callingParty.tr.position - this.character.tr.position), false, true);
this.character.FirstPosition(this.edgeNodes[num6]);
this.character.SetMeshState(true);
Links.x.gaia.boro.body.SetMeshState(true, true);
if (Links.x.gaia.boro.circleTr)
{
Links.x.gaia.boro.circleTr.gameObject.SetActive(true);
}
Links.x.gaia.boro.body.SeeThroughColliders(true);
Links.x.gaia.boro.thisCollider.enabled = true;
this.character.PlaySoundFX(0, 6);
Links.x.hudControl.ToggleBoroButtonSprite();
}
else if (this.attempt < 5)
{
this.attempt++;
yield return new WaitForSeconds(0.5f);
this.corout = null;
this.Call(callingParty);
}
else
{
Links.x.hudControl.ToggleBoroButtonSprite();
Links.x.gameFeed.AddFeed("Boro cannot stand here");
Links.x.gameFeed.ShowNotice("Boro cannot find a place to stand here");
}
this.corout = null;
yield return new WaitForSeconds(0.1f);
yield break;
}
// Token: 0x060002C7 RID: 711 RVA: 0x00038C78 File Offset: 0x00036E78
public bool BoroNearby()
{
return this.character.sailing || (!this.boroInvisible && (Links.x.hasMain && (Links.x.main.currentPosition - this.character.tr.position).sqrMagnitude < 900f));
}
// Token: 0x060002C8 RID: 712 RVA: 0x00038CE0 File Offset: 0x00036EE0
public void StartLeaveWait()
{
if (this.leaveCoroutine == null)
{
this.leaveCoroutine = this.WaitToLeave(false);
base.StartCoroutine(this.leaveCoroutine);
}
}
// Token: 0x060002C9 RID: 713 RVA: 0x00038D04 File Offset: 0x00036F04
private IEnumerator WaitToLeave(bool fromButton)
{
Links.x.hudControl.ToggleBoroButtonSprite();
float timeToLerp = 3f;
float percentage = 0f;
float startTime = Time.time;
if (fromButton)
{
timeToLerp = 1f;
this.character.Flee(Links.x.main.node, false, Links.x.gameplay.seconds, 10f);
}
if (!Links.x.gaia.sceneLoaded)
{
timeToLerp = 0.0001f;
fromButton = true;
}
while (percentage < 1f && (!this.BoroNearby() || fromButton))
{
percentage = (Time.time - startTime) / timeToLerp;
yield return null;
}
if (!this.BoroNearby() || fromButton)
{
bool sceneLoaded = Links.x.gaia.sceneLoaded;
this.character.SetMeshState(false);
this.character.body.SetMeshState(false, sceneLoaded);
this.boroInvisible = true;
Records.x.boroInvisible = this.boroInvisible;
Links.x.gaia.boro.body.SeeThroughColliders(false);
Links.x.gaia.boro.thisCollider.enabled = false;
yield return new WaitForSeconds(0.5f);
this.character.RemoveLastNode(true);
this.character.TurnScriptsOff();
}
Links.x.hudControl.ToggleBoroButtonSprite();
this.leaveCoroutine = null;
yield break;
}
// Token: 0x060002CA RID: 714 RVA: 0x00038D1C File Offset: 0x00036F1C
public void Leave()
{
if (Records.x.partySailing)
{
return;
}
if (this.leaveCoroutine != null)
{
base.StopCoroutine(this.leaveCoroutine);
this.leaveCoroutine = null;
}
this.leaveCoroutine = this.WaitToLeave(true);
base.StartCoroutine(this.leaveCoroutine);
}
// Token: 0x060002CB RID: 715 RVA: 0x00038D6C File Offset: 0x00036F6C
public void BackToBeach()
{
if (this.coroutBack == null && Records.x.boroLastBeachPoint != Vector3.zero)
{
this.coroutBack = this.Back();
base.StartCoroutine(this.coroutBack);
return;
}
Links.x.gameFeed.AddFeed("Boro is busy");
}
// Token: 0x060002CC RID: 716 RVA: 0x00038DC5 File Offset: 0x00036FC5
private IEnumerator Back()
{
this.SetNodeConstraint(this.character, true);
GraphNode beachNode = this.character.NearNode(Records.x.boroLastBeachPoint, true, 0, -1, 0);
bool flag;
if (beachNode == null)
{
flag = false;
Links.x.gameFeed.AddFeed("Boro cannot find a place on beach");
Links.x.gameFeed.ShowNotice("Boro cannot find a place to stand");
}
else
{
flag = true;
}
if (flag)
{
this.character.SetMeshState(false);
Links.x.gaia.boro.body.SetMeshState(false, true);
if (Links.x.gaia.boro.circleTr)
{
Links.x.gaia.boro.circleTr.gameObject.SetActive(false);
}
float t = 0.5f;
yield return new WaitForSeconds(t);
this.character.tr.position = (Vector3)beachNode.position;
this.character.FirstPosition(beachNode);
yield return new WaitForSeconds(t);
this.character.SetMeshState(true);
Links.x.gaia.boro.body.SetMeshState(true, true);
if (Links.x.gaia.boro.circleTr)
{
Links.x.gaia.boro.circleTr.gameObject.SetActive(true);
}
this.character.PlaySoundFX(0, 6);
}
this.coroutBack = null;
yield break;
}
// Token: 0x060002CD RID: 717 RVA: 0x00038DD4 File Offset: 0x00036FD4
public void LeavingForCombat()
{
if (this.boroInvisible)
{
return;
}
if (this.character.sailing)
{
return;
}
if (this.coroutCombat != null)
{
base.StopCoroutine(this.coroutCombat);
this.coroutCombat = null;
}
if (this.coroutCombat == null && !this.boroInvisible)
{
this.savedNode = this.character.node;
this.coroutCombat = this.FindCombatRetreat(false, true);
base.StartCoroutine(this.coroutCombat);
}
}
// Token: 0x060002CE RID: 718 RVA: 0x00038E50 File Offset: 0x00037050
public void ComingBackFromCombat()
{
if (this.character.sailing)
{
return;
}
if (!Links.x.gaia.pathfindingReady)
{
return;
}
if (this.boroInvisible)
{
return;
}
if (this.coroutCombat != null)
{
base.StopCoroutine(this.coroutCombat);
this.coroutCombat = null;
}
if (this.coroutCombat == null && this.character.node == null)
{
this.coroutCombat = this.FindCombatRetreat(true, true);
base.StartCoroutine(this.coroutCombat);
return;
}
if (this.character.node != null)
{
this.character.TurnScriptsOn();
this.boroInvisible = false;
Records.x.boroInvisible = this.boroInvisible;
Links.x.gaia.boro.body.SetMeshState(true, true);
this.character.EndPath();
Links.x.gaia.boro.body.SeeThroughColliders(true);
Links.x.gaia.boro.thisCollider.enabled = true;
}
}
// Token: 0x060002CF RID: 719 RVA: 0x00038F5B File Offset: 0x0003715B
private IEnumerator FindCombatRetreat(bool state, bool instant)
{
bool enoughNodes = false;
float radius = 12f;
if (!state)
{
this.character.CircleAnimation("");
}
GraphNode centerNode = this.character.node;
if (state)
{
this.character.TurnScriptsOn();
this.character.FindCurrentNode(true);
}
if (this.character.node == null && Links.x.diorama.playerStartBoatDefault)
{
this.character.tr.position = Links.x.diorama.playerStartBoatDefault.position;
this.character.FirstPosition(null);
}
if (this.character.node == null)
{
Debug.Log("Sheep node is null");
this.character.SetMeshState(state);
Links.x.gaia.boro.body.SetMeshState(state, true);
if (!state)
{
this.boroInvisible = true;
}
else
{
this.boroInvisible = false;
}
Records.x.boroInvisible = this.boroInvisible;
if (this.boroInvisible)
{
Links.x.gaia.boro.body.SeeThroughColliders(false);
Links.x.gaia.boro.thisCollider.enabled = false;
}
else
{
Links.x.gaia.boro.body.SeeThroughColliders(true);
Links.x.gaia.boro.thisCollider.enabled = true;
}
}
else
{
if (state)
{
this.character.tr.position = (Vector3)this.character.node.position;
centerNode = this.savedNode;
}
ConstantPath constPath = ConstantPath.ConstructFast(centerNode, Records.x.GetConstantPathRadius((int)radius), null);
this.SetNodeConstraint(null, true);
this.nodeConstraint.constrainWalkability = false;
constPath.nnConstraint = this.nodeConstraint;
AstarPath.StartPath(constPath, false);
yield return base.StartCoroutine(constPath.WaitForPath());
constPath.Claim(this);
this.allNodes = constPath.allNodes;
int num = this.allNodes.Count;
int num2 = num - 1;
Vector3 zero = Vector3.zero;
Vector3 zero2 = Vector3.zero;
Vector3 zero3 = Vector3.zero;
Vector3 zero4 = Vector3.zero;
Vector3 forward = Vector3.forward;
Vector3 zero5 = Vector3.zero;
Vector3 zero6 = Vector3.zero;
this.SetNodeConstraint(this.character, true);
this.suitableNodes.Clear();
this.edgeNodes.Clear();
this.nearNodes.Clear();
radius *= Records.x.nodeSize;
if (!state)
{
for (int j = num2; j >= 0; j--)
{
GraphNode graphNode = this.allNodes[j];
if (((Vector3)graphNode.position - (Vector3)centerNode.position).sqrMagnitude < radius * radius && this.nodeConstraint.Suitable(graphNode))
{
this.suitableNodes.Add(graphNode);
}
}
}
else
{
for (int k = 0; k < num; k++)
{
GraphNode graphNode = this.allNodes[k];
if (((Vector3)graphNode.position - (Vector3)centerNode.position).sqrMagnitude < radius * radius && this.nodeConstraint.Suitable(graphNode))
{
this.suitableNodes.Add(graphNode);
}
}
}
num = this.suitableNodes.Count;
num2 = num - 1;
Vector3 position = this.character.tr.position;
for (int l = 0; l < num; l++)
{
if (!enoughNodes)
{
GraphNode graphNode = this.suitableNodes[l];
this.edgeNodes.Add(graphNode);
if (this.edgeNodes.Count >= 100)
{
enoughNodes = true;
break;
}
}
}
constPath.Release(this, false);
this.character.PlaySoundFX(0, 6);
int nodeIndex = -1;
if (this.edgeNodes.Count > 0)
{
bool foundPath = false;
int num3;
for (int i = 0; i < this.edgeNodes.Count; i = num3 + 1)
{
if (!foundPath)
{
ABPath p = ABPath.ConstructFast(this.character.node, this.edgeNodes[i], null);
p.nnConstraint = this.nodeConstraint;
AstarPath.StartPath(p, false);
yield return base.StartCoroutine(p.WaitForPath());
p.Claim(this);
if (!p.error)
{
foundPath = true;
nodeIndex = i;
}
p.Release(this, false);
p = null;
}
num3 = i;
}
}
GraphNode graphNode2 = null;
if (nodeIndex > -1)
{
graphNode2 = this.edgeNodes[nodeIndex];
}
if (graphNode2 == null || instant)
{
this.character.SetMeshState(state);
Links.x.gaia.boro.body.SetMeshState(state, true);
if (!state)
{
this.boroInvisible = true;
}
else
{
this.boroInvisible = false;
}
Records.x.boroInvisible = this.boroInvisible;
if (this.boroInvisible)
{
Links.x.gaia.boro.body.SeeThroughColliders(false);
Links.x.gaia.boro.thisCollider.enabled = false;
}
else
{
Links.x.gaia.boro.body.SeeThroughColliders(true);
Links.x.gaia.boro.thisCollider.enabled = true;
}
}
else
{
bool flag = true;
if (state)
{
flag = false;
}
this.character.MakePath(this.edgeNodes[nodeIndex], 10, false, flag, true);
yield return new WaitForSecondsRealtime(2f);
this.character.SetMeshState(state);
Links.x.gaia.boro.body.SetMeshState(state, true);
if (state)
{
this.character.CircleAnimation("");
}
if (!state)
{
this.boroInvisible = true;
}
else
{
this.boroInvisible = false;
}
Records.x.boroInvisible = this.boroInvisible;
if (this.boroInvisible)
{
Links.x.gaia.boro.body.SeeThroughColliders(false);
Links.x.gaia.boro.thisCollider.enabled = false;
}
else
{
Links.x.gaia.boro.body.SeeThroughColliders(true);
Links.x.gaia.boro.thisCollider.enabled = true;
}
if (!state)
{
yield return new WaitForSecondsRealtime(2f);
this.character.TargetReached();
this.character.RemoveLastNode(true);
this.character.TurnScriptsOff();
}
}
constPath = null;
}
Links.x.hudControl.ToggleBoroButtonSprite();
this.coroutCombat = null;
yield break;
}
// Token: 0x060002D0 RID: 720 RVA: 0x00038F78 File Offset: 0x00037178
private GraphNode GetSuitableNode()
{
for (int i = 0; i < this.edgeNodes.Count; i++)
{
if (this.nodeConstraint.Suitable(this.edgeNodes[i]))
{
return this.edgeNodes[i];
}
}
return null;
}
// Token: 0x060002D1 RID: 721 RVA: 0x00038FC2 File Offset: 0x000371C2
public void Stop()
{
this.attempt = 0;
if (this.corout != null)
{
base.StopCoroutine(this.corout);
this.corout = null;
}
if (this.coroutCombat != null)
{
base.StopCoroutine(this.coroutCombat);
this.coroutCombat = null;
}
}
// Token: 0x060002D2 RID: 722 RVA: 0x00039001 File Offset: 0x00037201
public void Sail()
{
}
// Token: 0x060002D3 RID: 723 RVA: 0x00039003 File Offset: 0x00037203
public void LevelUp()
{
}
// Token: 0x060002D4 RID: 724 RVA: 0x00039008 File Offset: 0x00037208
public void SetNodeConstraint(Character pathfinder, bool constrainTags)
{
this.nodeConstraint.constrainWalkability = true;
this.nodeConstraint.walkable = true;
this.nodeConstraint.constrainTags = constrainTags;
this.nodeConstraint.checkCircleID = 0;
if (!pathfinder)
{
this.nodeConstraint.passID = 0;
this.nodeConstraint.passID2 = 0;
this.nodeConstraint.checkConnections = 0;
this.nodeConstraint.constrainPenalty = 0;
}
else
{
this.nodeConstraint.passID = pathfinder.nodeStationaryID;
this.nodeConstraint.passID2 = pathfinder.nodeMovingID;
this.nodeConstraint.checkConnections = pathfinder.ConnectionNumber();
this.nodeConstraint.constrainPenalty = 0;
}
this.nodeConstraint.constrainToArea = -1;
}
// Token: 0x060002D5 RID: 725 RVA: 0x000390CC File Offset: 0x000372CC
public Vector3 CustomNormalize(Vector3 v)
{
double num = Math.Sqrt((double)(v.x * v.x + v.y * v.y + v.z * v.z));
if (num > 9.99999974737875E-06)
{
float num2 = (float)num;
v.x /= num2;
v.y /= num2;
v.z /= num2;
return v;
}
return Vector3.zero;
}
// Token: 0x060002D6 RID: 726 RVA: 0x00039143 File Offset: 0x00037343
public float GetDot(Vector3 vector1, Vector3 vector2)
{
return vector1.x * vector2.x + vector1.y * vector2.y + vector1.z * vector2.z;
}
// Token: 0x060002D7 RID: 727 RVA: 0x00039170 File Offset: 0x00037370
public Vector3 SubtractVectors(Vector3 a, Vector3 b)
{
Vector3 vector;
vector.x = a.x - b.x;
vector.y = a.y - b.y;
vector.z = a.z - b.z;
return vector;
}
// Token: 0x040004EE RID: 1262
private IEnumerator corout;
// Token: 0x040004EF RID: 1263
private IEnumerator coroutCombat;
// Token: 0x040004F0 RID: 1264
private IEnumerator coroutBack;
// Token: 0x040004F1 RID: 1265
private NNConstraint nodeConstraint = new NNConstraint();
// Token: 0x040004F2 RID: 1266
private List<GraphNode> allNodes;
// Token: 0x040004F3 RID: 1267
private Character character;
// Token: 0x040004F4 RID: 1268
private List<GraphNode> suitableNodes = new List<GraphNode>();
// Token: 0x040004F5 RID: 1269
private List<GraphNode> edgeNodes = new List<GraphNode>();
// Token: 0x040004F6 RID: 1270
private List<GraphNode> nearNodes = new List<GraphNode>();
// Token: 0x040004F7 RID: 1271
public int attempt;
// Token: 0x040004F8 RID: 1272
public bool nearbyDuringCombat;
// Token: 0x040004F9 RID: 1273
private List<Character> party;
// Token: 0x040004FA RID: 1274
private GraphNode savedNode;
// Token: 0x040004FB RID: 1275
public Vector3 lastBeachPoint;
// Token: 0x040004FC RID: 1276
public bool boroInvisible;
// Token: 0x040004FD RID: 1277
private List<bool> added = new List<bool>();
// Token: 0x040004FE RID: 1278
private IEnumerator leaveCoroutine;
}

View File

@@ -1,160 +0,0 @@
using System;
using UnityEngine;
// Token: 0x0200005C RID: 92
public class Breakable : MonoBehaviour
{
// Token: 0x04001034 RID: 4148
public int armor;
// Token: 0x04001035 RID: 4149
public int health = 1;
// Token: 0x04001036 RID: 4150
public GameObject linkedExit;
// Token: 0x04001037 RID: 4151
public Breakable.BreakableTypes type;
// Token: 0x04001038 RID: 4152
[Header("HOW TO BREAK IT")]
public Breakable.BreakableEffectRequired effectRequired;
// Token: 0x04001039 RID: 4153
public bool enemy;
// Token: 0x0400103A RID: 4154
[Header("WHAT'S INSIDE")]
public SceneItem.xmlNames itemA = SceneItem.xmlNames.None;
// Token: 0x0400103B RID: 4155
public int itemStackA;
// Token: 0x0400103C RID: 4156
public SceneItem.xmlNames itemB = SceneItem.xmlNames.None;
// Token: 0x0400103D RID: 4157
public int itemStackB;
// Token: 0x0400103E RID: 4158
public SceneItem.xmlNames itemC = SceneItem.xmlNames.None;
// Token: 0x0400103F RID: 4159
public int itemStackC;
// Token: 0x04001040 RID: 4160
public SceneItem.xmlNames itemD = SceneItem.xmlNames.None;
// Token: 0x04001041 RID: 4161
public int itemStackD;
// Token: 0x04001042 RID: 4162
public Breakable.BarrelLiquidTypes barrelLiquid;
// Token: 0x04001043 RID: 4163
[Header("If elyxir component")]
public Breakable.ComponentTypes component;
// Token: 0x04001044 RID: 4164
[Header("If puzzle connected")]
public Puzzle puzzle;
// Token: 0x04001045 RID: 4165
public Prompts prompt;
// Token: 0x020001BE RID: 446
public enum BreakableTypes
{
// Token: 0x04002BEA RID: 11242
Barrel,
// Token: 0x04002BEB RID: 11243
Fence,
// Token: 0x04002BEC RID: 11244
Gate,
// Token: 0x04002BED RID: 11245
Wall,
// Token: 0x04002BEE RID: 11246
Bramble,
// Token: 0x04002BEF RID: 11247
Plank,
// Token: 0x04002BF0 RID: 11248
Box,
// Token: 0x04002BF1 RID: 11249
Vase,
// Token: 0x04002BF2 RID: 11250
Urn,
// Token: 0x04002BF3 RID: 11251
Acorn,
// Token: 0x04002BF4 RID: 11252
Mushroom,
// Token: 0x04002BF5 RID: 11253
Shell,
// Token: 0x04002BF6 RID: 11254
Rock,
// Token: 0x04002BF7 RID: 11255
Frog,
// Token: 0x04002BF8 RID: 11256
Stick,
// Token: 0x04002BF9 RID: 11257
HollowStick,
// Token: 0x04002BFA RID: 11258
Berry,
// Token: 0x04002BFB RID: 11259
Egg,
// Token: 0x04002BFC RID: 11260
ThickBramble
}
// Token: 0x020001BF RID: 447
public enum BreakableEffectRequired
{
// Token: 0x04002BFE RID: 11262
Damage,
// Token: 0x04002BFF RID: 11263
Stuck,
// Token: 0x04002C00 RID: 11264
Cold,
// Token: 0x04002C01 RID: 11265
Fire
}
// Token: 0x020001C0 RID: 448
public enum BarrelLiquidTypes
{
// Token: 0x04002C03 RID: 11267
none,
// Token: 0x04002C04 RID: 11268
oil,
// Token: 0x04002C05 RID: 11269
sap,
// Token: 0x04002C06 RID: 11270
wine,
// Token: 0x04002C07 RID: 11271
lizard,
// Token: 0x04002C08 RID: 11272
spores
}
// Token: 0x020001C1 RID: 449
public enum ComponentTypes
{
// Token: 0x04002C0A RID: 11274
None,
// Token: 0x04002C0B RID: 11275
Acorn,
// Token: 0x04002C0C RID: 11276
Mushroom,
// Token: 0x04002C0D RID: 11277
Shell,
// Token: 0x04002C0E RID: 11278
Rock,
// Token: 0x04002C0F RID: 11279
Frog,
// Token: 0x04002C10 RID: 11280
Stick,
// Token: 0x04002C11 RID: 11281
HollowStick,
// Token: 0x04002C12 RID: 11282
Berry
}
}

View File

@@ -1,920 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using DarkTonic.MasterAudio;
using Pathfinding;
using UnityEngine;
// Token: 0x0200001A RID: 26
public class BreakableActions : MonoBehaviour
{
// Token: 0x060002D9 RID: 729 RVA: 0x000391FC File Offset: 0x000373FC
private void Awake()
{
if (!this.fromSpell)
{
base.enabled = false;
}
base.gameObject.layer = 16;
this.saveName = base.gameObject.name;
this.mainCollider = base.gameObject.GetComponent<Collider>();
if (!this.mainCollider && base.transform.childCount > 0)
{
foreach (object obj in base.transform)
{
Collider component = ((Transform)obj).gameObject.GetComponent<Collider>();
if (component)
{
this.mainCollider = component;
}
}
}
this.pt = base.gameObject.transform.position;
}
// Token: 0x060002DA RID: 730 RVA: 0x000392D8 File Offset: 0x000374D8
private void OnEnable()
{
this.pt = base.gameObject.transform.position;
if (this.fromSpell)
{
this.destroyed = false;
if (this.renderers.Length == 0)
{
this.GetObjects();
}
this.mainCollider.enabled = true;
this.currentHealth = this.breakable.health;
this.UpdateAstar();
}
if (this.particles.Length != 0)
{
ParticleSystem[] array = this.particles;
for (int i = 0; i < array.Length; i++)
{
array[i].gameObject.SetActive(true);
}
}
if (this.breakable)
{
if (this.breakable.component != Breakable.ComponentTypes.None)
{
for (int j = 0; j < this.renderers.Length; j++)
{
this.renderers[j].enabled = true;
}
this.mainCollider.enabled = true;
}
if (this.breakable.enemy)
{
this.aiShouldBreakIt = true;
}
}
}
// Token: 0x060002DB RID: 731 RVA: 0x000393C3 File Offset: 0x000375C3
public void LoadGameSetup(int h)
{
this.currentHealth = h;
if (h <= 0 && this.resourceLocation == 0)
{
this.ClickToBreak(null, true, false);
}
}
// Token: 0x060002DC RID: 732 RVA: 0x000393E1 File Offset: 0x000375E1
public void NewGameSetup()
{
if (this.breakable.armor > 0)
{
this.currentHealth = this.breakable.health;
return;
}
this.currentHealth = 1;
}
// Token: 0x060002DD RID: 733 RVA: 0x0003940C File Offset: 0x0003760C
public void SetLayers(int x)
{
if (x == 6)
{
if (this.layers == null)
{
this.layers = new List<int>();
for (int i = 0; i < this.renderers.Length; i++)
{
if (this.renderers[i])
{
this.layers.Add(this.renderers[i].gameObject.layer);
if (this.renderers[i].gameObject.layer != 29)
{
this.renderers[i].gameObject.layer = 6;
}
}
else
{
this.layers.Add(0);
}
}
return;
}
}
else
{
for (int j = 0; j < this.renderers.Length; j++)
{
if (this.renderers[j])
{
this.renderers[j].gameObject.layer = this.layers[j];
}
}
}
}
// Token: 0x060002DE RID: 734 RVA: 0x000394F0 File Offset: 0x000376F0
public void Remove()
{
if (this.renderers.Length == 0)
{
this.GetObjects();
}
this.mainCollider.enabled = false;
Links.x.hudControl.AddRemoveInteraction(false, null, this, null, null, null, null, null);
base.enabled = true;
if (this.interactiveCharacterObject)
{
Object.Destroy(this.interactiveCharacterObject);
}
base.StartCoroutine(this.UpdatePath(true));
}
// Token: 0x060002DF RID: 735 RVA: 0x0003955C File Offset: 0x0003775C
public void GetNode()
{
if (!this.destroyed)
{
bool flag = this.fromSpell;
}
}
// Token: 0x060002E0 RID: 736 RVA: 0x00039570 File Offset: 0x00037770
public void GetObjects()
{
if (this.renderers.Length == 0)
{
this.renderers = base.gameObject.GetComponentsInChildren<Renderer>(false);
}
this.rigidbodies = base.gameObject.GetComponentsInChildren<Rigidbody>(true);
if (base.gameObject.transform.childCount > 0)
{
this.normal = base.gameObject.transform.GetChild(0).gameObject;
this.broken = base.gameObject.transform.GetChild(1).gameObject;
if (this.broken && (this.broken.gameObject.layer == 29 || this.broken.gameObject.name.Contains("Block")) && base.gameObject.transform.childCount > 2)
{
this.broken = base.gameObject.transform.GetChild(2).gameObject;
}
}
for (int i = 0; i < this.renderers.Length; i++)
{
if (this.renderers[i].gameObject.name.Contains("Blocker"))
{
this.renderers[i].gameObject.layer = 29;
}
}
this.pt = base.gameObject.transform.position;
}
// Token: 0x060002E1 RID: 737 RVA: 0x000396BF File Offset: 0x000378BF
public void GetDifferentRenderers(GameObject g)
{
this.renderers = g.GetComponentsInChildren<Renderer>(false);
}
// Token: 0x060002E2 RID: 738 RVA: 0x000396CE File Offset: 0x000378CE
public void OutOfRange()
{
if (this.inRangeFX)
{
Links.x.cellar.ReturnPooledGameObject(33, this.inRangeFX);
this.inRangeFX = null;
}
}
// Token: 0x060002E3 RID: 739 RVA: 0x000396FC File Offset: 0x000378FC
public void InRange()
{
if (!this.inRangeFX)
{
this.inRangeFX = Links.x.cellar.GetPooledGameObject(33);
this.inRangeFX.transform.position = base.transform.position + new Vector3(0f, 1f, 0f);
this.inRangeFX.SetActive(true);
}
}
// Token: 0x060002E4 RID: 740 RVA: 0x00039770 File Offset: 0x00037970
public void HoverIn(bool isMainHover)
{
if (this.renderers.Length == 0)
{
this.GetObjects();
}
if (!this.destroyed)
{
int num = 0;
if (this.mainCollider)
{
this.bounds = this.mainCollider.bounds;
}
else
{
this.bounds = default(Bounds);
if (this.renderers.Length != 0 && this.renderers[0])
{
this.bounds = this.renderers[0].bounds;
if (this.renderers.Length > 1)
{
int i = 1;
int num2 = this.renderers.Length;
while (i < num2)
{
if (this.renderers[i] && this.renderers[i].gameObject.layer != 29)
{
this.bounds.Encapsulate(this.renderers[i].bounds);
}
i++;
}
}
}
}
this.bounds.Expand(0.25f);
if (Records.x.pocketPause)
{
num = 2;
}
if (!this.bracket)
{
this.bracket = Links.x.cellar.GetBracket(num, this.bounds);
}
else
{
Links.x.cellar.SetBracketMaterial(num, this.bracket);
}
if (isMainHover)
{
Links.x.hoverObject = base.gameObject;
Shader.SetGlobalVector("_DoorLightPosition", this.bounds.center + Links.x.rtsCamera.gameObject.transform.forward * -2f);
Records.x.hoverLightColor = Color.white * 0.25f;
Shader.SetGlobalFloat("_DoorLightRange", 2f);
if (Records.x.pocketPause && !Links.x.gameplay.attackingCharacter.CanAttack())
{
bool rallyWheelOpen = Links.x.pocketWheel.rallyWheelOpen;
}
}
}
}
// Token: 0x060002E5 RID: 741 RVA: 0x00039964 File Offset: 0x00037B64
public void HoverOut()
{
if (Links.x.hoverObject == base.gameObject)
{
Links.x.hoverObject = null;
}
if (this.multiHover)
{
Links.x.combat.MultiHitCharacters(false);
Links.x.combat.MultiHitObjects(false, base.gameObject.transform.position, this, null, null);
this.multiHover = false;
Links.x.gameplay.CheckIfAnythingShouldRedoMultiTargetHover();
}
if (this.bracket)
{
Links.x.cellar.ReturnPooledGameObject(61, this.bracket);
this.bracket = null;
}
}
// Token: 0x060002E6 RID: 742 RVA: 0x00039A10 File Offset: 0x00037C10
public void CombatSheen(int num)
{
if (this.renderers.Length == 0)
{
this.GetObjects();
}
if (this.destroyed && num == 3)
{
return;
}
bool flag = false;
if (num == 3)
{
flag = true;
}
this.combatTargetID = num;
for (int i = 0; i < this.renderers.Length; i++)
{
if (this.renderers[i].gameObject.layer != 29)
{
this.mats = this.renderers[i].materials;
foreach (Material material in this.mats)
{
this.sheen = 0f;
if (flag)
{
this.sheen = 1f;
}
material.SetFloat("_InCombatBubble", this.sheen);
}
}
}
}
// Token: 0x060002E7 RID: 743 RVA: 0x00039AC8 File Offset: 0x00037CC8
public void Damage(Character party)
{
GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(60);
pooledGameObject.transform.position = base.gameObject.transform.position + new Vector3(0f, 1f, 0f);
pooledGameObject.SetActive(true);
}
// Token: 0x060002E8 RID: 744 RVA: 0x00039B20 File Offset: 0x00037D20
public void Bend()
{
if (this.currentHealth < this.breakable.health && !this.destroyed && this.currentHealth > 0)
{
if (this.timeSinceHeal == 0f)
{
this.timeSinceHeal = Links.x.gameplay.seconds;
}
if (Links.x.gameplay.seconds > this.timeSinceHeal + 100f || this.timeSinceHeal == 0f)
{
this.timeSinceHeal = Links.x.gameplay.seconds;
float num = (float)this.breakable.health / 5f;
this.currentHealth += Mathf.RoundToInt(num);
Vector3 position = this.mainCollider.gameObject.transform.position;
Vector3 vector = Links.x.worldCamera.WorldToScreenPoint(position);
vector.z = 0f;
vector.x = vector.x * (1920f / (float)Screen.width) - 960f;
vector.y = vector.y * (Links.x.canvasRT.sizeDelta.y / (float)Screen.height) - Links.x.canvasRT.sizeDelta.y / 2f;
Links.x.repairFX.localPosition = vector;
Links.x.repairFX.gameObject.SetActive(true);
Links.x.repairFX.gameObject.GetComponent<HannahAnimator>().Play("Idle");
string text = "Repair 1";
if (Random.Range(0, 2) == 0)
{
text = "Repair 2";
}
if (Random.Range(0, 3) == 0)
{
text = "Repair 3";
}
MasterAudio.PlaySound3DAtVector3AndForget("Interactives", base.gameObject.transform.position, Random.Range(0.7f, 0.9f), new float?(1f), 0f, text, null);
if (this.currentHealth == this.breakable.health)
{
this.timeSinceHeal = 0f;
}
}
}
}
// Token: 0x060002E9 RID: 745 RVA: 0x00039D44 File Offset: 0x00037F44
public void ClickToBreak(Character party, bool fromSave, bool fromKick)
{
this.kicked = fromKick;
if (!this.destroyed)
{
this.destroyed = true;
if (base.gameObject.activeSelf)
{
base.StartCoroutine(this.Breaking(party, fromSave, this.kicked));
}
if (!fromSave && this.breakable.puzzle)
{
this.breakable.puzzle.gameObject.GetComponent<PuzzleActions>().BreakablePuzzle(false);
}
}
}
// Token: 0x060002EA RID: 746 RVA: 0x00039DB9 File Offset: 0x00037FB9
private IEnumerator Breaking(Character party, bool fromSave, bool fromKick)
{
if (this.renderers.Length == 0)
{
this.GetObjects();
}
if (!fromSave)
{
while (Links.x.combat.rallyTarget)
{
yield return null;
}
}
if (!fromSave && party)
{
this.OutOfRange();
if (this.breakable.armor == 0 && !Records.x.pocketPause && fromKick)
{
while (party.moving)
{
yield return null;
}
party.TargetReached();
party.alwaysTurn = true;
party.SetRotation(Quaternion.LookRotation(base.gameObject.transform.position - party.tr.position), false, true);
if (this.resourceLocation == -1)
{
party.EndTurning(false);
party.PlayAnimation("Kick", 0f);
Links.x.sensory.LookAtObject(base.transform, 15f, false, party, 4f, 0.5f, null, 0);
}
else
{
party.EndTurning(false);
party.PlayAnimation("Use", 0f);
}
}
}
if (!fromSave)
{
this.HoverOut();
}
bool canBreak = true;
if (!fromSave && party && !canBreak)
{
this.destroyed = false;
}
if (!fromSave && this.breakable.armor == 0 && !Records.x.pocketPause && fromKick)
{
yield return new WaitForSeconds(0.25f);
party.inAction = false;
}
if (!fromSave)
{
Links.x.sensory.AddNoise(party.gameObject, party.node, "Break", party);
}
if (canBreak)
{
if (this.normal)
{
this.normal.gameObject.SetActive(false);
}
if (!fromSave)
{
if (this.broken)
{
this.broken.gameObject.SetActive(true);
}
if (this.resourceLocation >= 0)
{
Links.x.diorama.ReturnResource(this.resourceLocation, base.gameObject);
if (this.breakable.component == Breakable.ComponentTypes.Acorn || this.breakable.component == Breakable.ComponentTypes.Berry || this.breakable.component == Breakable.ComponentTypes.Frog || this.breakable.component == Breakable.ComponentTypes.Mushroom || this.breakable.component == Breakable.ComponentTypes.Rock)
{
this.itemA = this.breakable.itemA.ToString();
if (this.itemA != "" && this.itemA != "None")
{
Library.Inventory invRowFromName = Links.x.library.GetInvRowFromName(this.itemA);
if (invRowFromName != null)
{
Item item;
ItemEquipped itemEquipped;
Links.x.inventory.AddFromGround(null, null, 0, false, 0f, invRowFromName._ID, 1, Vector3.zero, Vector3.zero, new Vector4((float)invRowFromName._DurabilityMax, 0f, 0f, 0f), party, true, false, out item, out itemEquipped);
}
if (this.breakable.component == Breakable.ComponentTypes.Frog)
{
party.StartQuip("Got it!");
}
}
}
if (this.breakable.component == Breakable.ComponentTypes.Stick || this.breakable.component == Breakable.ComponentTypes.HollowStick)
{
this.itemA = this.breakable.itemA.ToString();
if (this.itemA != "" && this.itemA != "None")
{
Library.Inventory invRowFromName2 = Links.x.library.GetInvRowFromName(this.itemA);
if (invRowFromName2 != null && invRowFromName2 != null)
{
Item item2;
ItemEquipped itemEquipped2;
Links.x.inventory.AddFromGround(null, null, 0, false, 0f, invRowFromName2._ID, 1, Vector3.zero, Vector3.zero, new Vector4((float)invRowFromName2._DurabilityMax, 0f, 0f, 0f), party, true, false, out item2, out itemEquipped2);
}
if (this.breakable.component == Breakable.ComponentTypes.Stick)
{
GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(60);
pooledGameObject.transform.position = base.gameObject.transform.position;
pooledGameObject.SetActive(true);
}
}
}
Links.x.itemPickupFX.gameObject.SetActive(true);
Links.x.itemPickupFX.gameObject.GetComponent<HannahAnimator>().Play("Idle");
Vector3 position = base.gameObject.transform.position;
Vector3 vector = Links.x.worldCamera.WorldToScreenPoint(position);
vector.z = 0f;
vector.x = vector.x * (1920f / (float)Screen.width) - 960f;
vector.y = vector.y * (Links.x.canvasRT.sizeDelta.y / (float)Screen.height) - Links.x.canvasRT.sizeDelta.y / 2f;
Links.x.itemPickupFX.localPosition = vector;
MasterAudio.PlaySound3DAtVector3AndForget("Interactives", base.gameObject.transform.position, 0.5f, new float?(1f), 0f, "Collect Resource", null);
if (this.breakable.component == Breakable.ComponentTypes.Frog)
{
HannahAnimatorSimple component = base.gameObject.GetComponent<HannahAnimatorSimple>();
if (component)
{
component.enabled = true;
}
}
if (this.particles.Length != 0)
{
ParticleSystem[] array = this.particles;
for (int i = 0; i < array.Length; i++)
{
array[i].gameObject.SetActive(false);
}
}
for (int j = 0; j < this.renderers.Length; j++)
{
this.renderers[j].enabled = false;
}
}
else
{
for (int k = 0; k < this.rigidbodies.Length; k++)
{
this.rigidbodies[k].gameObject.layer = 20;
Transform transform = this.rigidbodies[k].gameObject.transform;
if (!this.rigidbodies[k].gameObject.GetComponent<BoxCollider>())
{
this.rigidbodies[k].gameObject.AddComponent<BoxCollider>();
}
foreach (object obj in transform)
{
((Transform)obj).gameObject.layer = 20;
}
if (!fromSave && party)
{
Quaternion quaternion = Quaternion.LookRotation(base.gameObject.transform.position - party.body.headBone.position);
this.rigidbodies[k].AddForce(quaternion * Vector3.forward * 3000f, ForceMode.Force);
}
else
{
Vector3 position2 = base.gameObject.transform.position;
Quaternion quaternion2 = Quaternion.LookRotation(position2 - new Vector3(position2.x + Random.Range(-1f, 1f), position2.y + 2f, position2.z + Random.Range(-1f, 1f)));
this.rigidbodies[k].AddForce(quaternion2 * Vector3.forward * 300f, ForceMode.Force);
}
}
MasterAudio.PlaySound3DAtVector3AndForget("Interactives", Links.x.main.tr.position, 1f, new float?(1f), 0f, "Chest Break", null);
Breakable.BarrelLiquidTypes barrelLiquid = this.breakable.barrelLiquid;
if (this.breakable.itemA != SceneItem.xmlNames.None)
{
this.itemA = this.breakable.itemA.ToString();
}
if (this.breakable.itemB != SceneItem.xmlNames.None)
{
this.itemB = this.breakable.itemB.ToString();
}
if (this.breakable.itemC != SceneItem.xmlNames.None)
{
this.itemC = this.breakable.itemC.ToString();
}
if (this.breakable.itemD != SceneItem.xmlNames.None)
{
this.itemD = this.breakable.itemD.ToString();
}
int num = -1;
if (this.node != null)
{
num = (int)this.node.Area;
}
if (this.itemA != "" && this.itemA != "None")
{
Library.Inventory inventory = Links.x.library.GetInvRowFromName(this.itemA);
if (inventory != null)
{
Item item3 = Links.x.inventory.groundBag.DropLoot(inventory._ID, this.breakable.itemStackA, Vector3.zero, Vector3.zero, new Vector4((float)inventory._DurabilityMax, 0f, 0f, 0f), null, base.gameObject.transform.position, false, false, num);
Links.x.diorama.AddItem(item3);
}
}
if (this.itemB != "" && this.itemB != "None")
{
Library.Inventory inventory = Links.x.library.GetInvRowFromName(this.itemB);
if (inventory != null)
{
Item item4 = Links.x.inventory.groundBag.DropLoot(inventory._ID, this.breakable.itemStackB, Vector3.zero, Vector3.zero, new Vector4((float)inventory._DurabilityMax, 0f, 0f, 0f), null, base.gameObject.transform.position, false, false, num);
Links.x.diorama.AddItem(item4);
}
}
if (this.itemC != "" && this.itemC != "None")
{
Library.Inventory inventory = Links.x.library.GetInvRowFromName(this.itemC);
if (inventory != null)
{
Item item5 = Links.x.inventory.groundBag.DropLoot(inventory._ID, this.breakable.itemStackC, Vector3.zero, Vector3.zero, new Vector4((float)inventory._DurabilityMax, 0f, 0f, 0f), null, base.gameObject.transform.position, false, false, num);
Links.x.diorama.AddItem(item5);
}
}
if (this.itemD != "" && this.itemD != "None")
{
Library.Inventory inventory = Links.x.library.GetInvRowFromName(this.itemD);
if (inventory != null)
{
Item item6 = Links.x.inventory.groundBag.DropLoot(inventory._ID, this.breakable.itemStackD, Vector3.zero, Vector3.zero, new Vector4((float)inventory._DurabilityMax, 0f, 0f, 0f), null, base.gameObject.transform.position, false, false, num);
Links.x.diorama.AddItem(item6);
}
}
if (this.breakable.barrelLiquid == Breakable.BarrelLiquidTypes.lizard)
{
Vector3 position3 = base.transform.position;
string text = "SmallLizards";
Quaternion quaternion3 = Quaternion.LookRotation(Links.x.main.tr.position - base.transform.position);
bool flag = false;
Character firstCharacter = Links.x.gaia.CreateCreature(position3, quaternion3, text, flag, 0f, 1).GetFirstCharacter();
firstCharacter.SetPosition(position3, null);
firstCharacter.SetRotation(quaternion3, false, false);
firstCharacter.hostility = 2;
firstCharacter.UpdateLKP(Links.x.main, Links.x.main.node, "Attack", true);
firstCharacter.jumpingPosition = false;
if (!Records.x.InCombat(false))
{
Links.x.combat.StartCombat(Links.x.main, firstCharacter, false, true);
}
Links.x.combat.AddParty(firstCharacter, false, null, true);
}
else if (this.breakable.barrelLiquid != Breakable.BarrelLiquidTypes.none)
{
string text2 = this.breakable.barrelLiquid.ToString();
if (text2 == "none")
{
text2 = "Wine";
}
base.StartCoroutine(this.FindNodes(text2, base.transform.position, party));
}
if (Records.x.pocketPause && party.mainSelected)
{
Links.x.gameplay.PocketPause(false);
}
}
}
this.currentHealth = 0;
Links.x.hudControl.AddRemoveInteraction(false, null, this, null, null, null, null, null);
Links.x.combat.AddRemoveInteraction(false, this, null, null, null);
if (this.mainCollider)
{
this.mainCollider.enabled = false;
}
if (this.resourceLocation == -1 || this.fromSpell)
{
this.UpdateAstar();
}
}
yield break;
}
// Token: 0x060002EB RID: 747 RVA: 0x00039DDD File Offset: 0x00037FDD
public void UpdateAstar()
{
if (!this.updatingPath || this.fromSpell)
{
this.updatingPath = true;
base.enabled = true;
base.StartCoroutine(this.UpdatePath(false));
}
}
// Token: 0x060002EC RID: 748 RVA: 0x00039E0B File Offset: 0x0003800B
private IEnumerator UpdatePath(bool destroying)
{
Vector3 vector = this.currTile;
yield return new WaitForSecondsRealtime(0.1f);
this.currTile = base.gameObject.transform.position;
while (!Links.x.gaia.pathfindingReady)
{
yield return null;
}
if (!Links.x.gaia.sceneLoaded)
{
yield return new WaitForSecondsRealtime(Random.Range(0.2f, 0.5f));
}
AstarPath.active.UpdateGraphs(new Bounds(this.currTile + new Vector3(0f, -1f, 0f), new Vector3(4f, 40f, 4f)));
this.updatingPath = false;
if (this.fromSpell && this.destroyed)
{
if (this.tileEffect)
{
this.tileEffect.RemoveTile(this.node, base.gameObject, this);
}
}
else
{
bool flag = this.fromSpell && destroying;
}
if (!this.fromSpell)
{
base.enabled = false;
}
if (Links.x.fogOfWar)
{
Links.x.fogOfWar.UpdateGrid(this.currTile, 6f);
}
if (Links.x.fogOfWarInterior)
{
Links.x.fogOfWarInterior.UpdateGrid(this.currTile, 6f);
}
yield break;
}
// Token: 0x060002ED RID: 749 RVA: 0x00039E21 File Offset: 0x00038021
private IEnumerator FindNodes(string abilityName, Vector3 startPosition, Character party)
{
if (abilityName == "oil")
{
abilityName = "Oil";
}
if (abilityName == "sap")
{
abilityName = "Sap";
}
if (abilityName == "wine")
{
abilityName = "Wine";
}
if (abilityName == "spores")
{
abilityName = "Spores";
}
Library.Effects effectRow = Links.x.library.GetEffectRow(abilityName);
this.pickedGroundNodes.Clear();
this.SetNodeConstraint(false, 0);
GraphNode targetNode = AstarPath.active.GetNearest(startPosition, this.nodeConstraint).node;
float num = (float)effectRow._TileRadius;
float max = (num * Records.x.nodeSize + 0.1f) * (num * Records.x.nodeSize + 0.1f);
if (Links.x.gaia.pathfindingReady)
{
ConstantPath constPath = null;
constPath = ConstantPath.ConstructFast(targetNode, Records.x.GetConstantPathRadius((int)num), null);
constPath.nnConstraint = this.nodeConstraint;
AstarPath.StartPath(constPath, false);
yield return base.StartCoroutine(constPath.WaitForPath());
int num2 = 0;
constPath.Claim(this);
this.allNodes = constPath.allNodes;
int count = this.allNodes.Count;
int num3 = 0;
for (int i = 0; i < count; i++)
{
if (((Vector3)this.allNodes[i].position - (Vector3)targetNode.position).sqrMagnitude < max)
{
this.pickedGroundNodes.Add(this.allNodes[i]);
num3++;
num2++;
}
}
constPath.Release(this, false);
int num4 = this.pickedGroundNodes.IndexOf(targetNode);
if (num4 > -1)
{
this.pickedGroundNodes.RemoveAt(num4);
}
this.pickedGroundNodes.Add(targetNode);
num2++;
if (this.pickedGroundNodes.Count > 0)
{
TileEffects tileEffects = Links.x.tileEffects.AddComponent<TileEffects>();
tileEffects.gameObject.SetActive(true);
tileEffects.Setup(null, effectRow, null, this, null, party);
}
this.pickedGroundNodes.Clear();
constPath = null;
}
yield break;
}
// Token: 0x060002EE RID: 750 RVA: 0x00039E48 File Offset: 0x00038048
public void SetNodeConstraint(bool constrainTags, int uniqueID)
{
this.nodeConstraint.constrainWalkability = true;
this.nodeConstraint.walkable = true;
this.nodeConstraint.constrainTags = constrainTags;
this.nodeConstraint.checkCircleID = 0;
this.nodeConstraint.passID = 0;
this.nodeConstraint.passID2 = 0;
this.nodeConstraint.checkConnections = 0;
this.nodeConstraint.constrainPenalty = 0;
this.nodeConstraint.constrainToArea = -1;
}
// Token: 0x040004FF RID: 1279
public Breakable breakable;
// Token: 0x04000500 RID: 1280
public bool aiShouldBreakIt;
// Token: 0x04000501 RID: 1281
public string saveName;
// Token: 0x04000502 RID: 1282
public int currentHealth;
// Token: 0x04000503 RID: 1283
private string itemA;
// Token: 0x04000504 RID: 1284
private string itemB;
// Token: 0x04000505 RID: 1285
private string itemC;
// Token: 0x04000506 RID: 1286
private string itemD;
// Token: 0x04000507 RID: 1287
public Renderer[] renderers = new Renderer[0];
// Token: 0x04000508 RID: 1288
public ParticleSystem[] particles = new ParticleSystem[0];
// Token: 0x04000509 RID: 1289
public GameObject normal;
// Token: 0x0400050A RID: 1290
public GameObject broken;
// Token: 0x0400050B RID: 1291
public Rigidbody[] rigidbodies = new Rigidbody[0];
// Token: 0x0400050C RID: 1292
public bool destroyed;
// Token: 0x0400050D RID: 1293
private bool updatingPath;
// Token: 0x0400050E RID: 1294
private Vector3 prevTile;
// Token: 0x0400050F RID: 1295
private Vector3 currTile;
// Token: 0x04000510 RID: 1296
public Collider mainCollider;
// Token: 0x04000511 RID: 1297
public GraphNode node;
// Token: 0x04000512 RID: 1298
public List<GraphNode> pickedGroundNodes = new List<GraphNode>();
// Token: 0x04000513 RID: 1299
private NNConstraint nodeConstraint = new NNConstraint();
// Token: 0x04000514 RID: 1300
private List<GraphNode> allNodes;
// Token: 0x04000515 RID: 1301
public bool fromSpell;
// Token: 0x04000516 RID: 1302
public TileEffects tileEffect;
// Token: 0x04000517 RID: 1303
public int effectID;
// Token: 0x04000518 RID: 1304
public int resourceLocation = -1;
// Token: 0x04000519 RID: 1305
public Character interactiveCharacterObject;
// Token: 0x0400051A RID: 1306
private GameObject inRangeFX;
// Token: 0x0400051B RID: 1307
private Material[] mats;
// Token: 0x0400051C RID: 1308
public Character caster;
// Token: 0x0400051D RID: 1309
public GameObject bracket;
// Token: 0x0400051E RID: 1310
private Bounds bounds;
// Token: 0x0400051F RID: 1311
private List<int> layers;
// Token: 0x04000520 RID: 1312
private bool multiHover;
// Token: 0x04000521 RID: 1313
public int combatTargetID;
// Token: 0x04000522 RID: 1314
public bool kicked;
// Token: 0x04000523 RID: 1315
public Vector3 pt;
// Token: 0x04000524 RID: 1316
public float sheen;
// Token: 0x04000525 RID: 1317
private float timeSinceHeal;
}

View File

@@ -1,17 +0,0 @@
using System;
using UnityEngine;
using UnityEngine.UI;
// Token: 0x02000098 RID: 152
public class BtnAlphaThreshold : MonoBehaviour
{
// Token: 0x06000E7A RID: 3706 RVA: 0x00115CE0 File Offset: 0x00113EE0
private void Awake()
{
base.gameObject.GetComponent<Image>().alphaHitTestMinimumThreshold = this.threshold;
base.enabled = false;
}
// Token: 0x0400170B RID: 5899
public float threshold = 0.5f;
}

View File

@@ -1,144 +0,0 @@
using System;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
// Token: 0x02000099 RID: 153
public class ButtonMultiTargets : Button
{
// Token: 0x06000E7C RID: 3708 RVA: 0x00115D14 File Offset: 0x00113F14
protected override void Start()
{
this.GetTargetGraphics();
base.Start();
Color color = base.colors.normalColor;
if (this.hasTargetGraphics)
{
Image[] array = this.targetImages;
for (int i = 0; i < array.Length; i++)
{
array[i].CrossFadeColor(color, 0f, true, true);
TextMeshProUGUI[] array2 = this.targetText;
for (int j = 0; j < array2.Length; j++)
{
array2[j].CrossFadeColor(color, 0f, true, true);
}
}
if (base.currentSelectionState == Selectable.SelectionState.Disabled)
{
color = base.colors.disabledColor;
array = this.targetImages;
for (int i = 0; i < array.Length; i++)
{
array[i].CrossFadeColor(color, 0f, true, true);
TextMeshProUGUI[] array2 = this.targetText;
for (int j = 0; j < array2.Length; j++)
{
array2[j].CrossFadeColor(color, 0f, true, true);
}
}
}
}
}
// Token: 0x06000E7D RID: 3709 RVA: 0x00115E04 File Offset: 0x00114004
private void GetTargetGraphics()
{
if (!this.targetGraphics)
{
this.targetGraphics = base.GetComponent<MultiTargetGraphics>();
this.hasTargetGraphics = true;
}
if (this.hasTargetGraphics)
{
this.targetImages = this.targetGraphics.targetImages;
this.targetText = this.targetGraphics.targetText;
}
}
// Token: 0x06000E7E RID: 3710 RVA: 0x00115E5C File Offset: 0x0011405C
protected override void DoStateTransition(Selectable.SelectionState state, bool instant)
{
if (!this.hasTargetGraphics)
{
this.GetTargetGraphics();
}
if (state == Selectable.SelectionState.Highlighted && Input.GetMouseButton(0))
{
return;
}
Color color = ((state == Selectable.SelectionState.Disabled) ? base.colors.disabledColor : ((state == Selectable.SelectionState.Highlighted) ? base.colors.highlightedColor : ((state == Selectable.SelectionState.Normal) ? base.colors.normalColor : ((state == Selectable.SelectionState.Pressed) ? base.colors.pressedColor : ((state == Selectable.SelectionState.Selected) ? base.colors.selectedColor : Color.white)))));
Image[] array = this.targetImages;
for (int i = 0; i < array.Length; i++)
{
array[i].CrossFadeColor(color, instant ? 0f : base.colors.fadeDuration, true, true);
}
TextMeshProUGUI[] array2 = this.targetText;
for (int i = 0; i < array2.Length; i++)
{
array2[i].CrossFadeColor(color, instant ? 0f : base.colors.fadeDuration, true, true);
}
}
// Token: 0x06000E7F RID: 3711 RVA: 0x00115F60 File Offset: 0x00114160
private bool CanReachSelectable(Selectable select)
{
return !select || (select.interactable && select.gameObject.activeInHierarchy);
}
// Token: 0x06000E80 RID: 3712 RVA: 0x00115F84 File Offset: 0x00114184
public override Selectable FindSelectableOnLeft()
{
Selectable selectable = base.FindSelectableOnLeft();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnLeft();
}
return selectable;
}
// Token: 0x06000E81 RID: 3713 RVA: 0x00115FAC File Offset: 0x001141AC
public override Selectable FindSelectableOnRight()
{
Selectable selectable = base.FindSelectableOnRight();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnRight();
}
return selectable;
}
// Token: 0x06000E82 RID: 3714 RVA: 0x00115FD4 File Offset: 0x001141D4
public override Selectable FindSelectableOnUp()
{
Selectable selectable = base.FindSelectableOnUp();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnUp();
}
return selectable;
}
// Token: 0x06000E83 RID: 3715 RVA: 0x00115FFC File Offset: 0x001141FC
public override Selectable FindSelectableOnDown()
{
Selectable selectable = base.FindSelectableOnDown();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnDown();
}
return selectable;
}
// Token: 0x0400170C RID: 5900
private Image[] targetImages;
// Token: 0x0400170D RID: 5901
private TextMeshProUGUI[] targetText;
// Token: 0x0400170E RID: 5902
private MultiTargetGraphics targetGraphics;
// Token: 0x0400170F RID: 5903
private bool hasTargetGraphics;
}

View File

@@ -1,56 +0,0 @@
using System;
using UnityEngine.UI;
// Token: 0x0200009A RID: 154
public class ButtonSmartNavigation : Button
{
// Token: 0x06000E85 RID: 3717 RVA: 0x0011602B File Offset: 0x0011422B
private bool CanReachSelectable(Selectable select)
{
return !select || (select.interactable && select.gameObject.activeInHierarchy);
}
// Token: 0x06000E86 RID: 3718 RVA: 0x0011604C File Offset: 0x0011424C
public override Selectable FindSelectableOnLeft()
{
Selectable selectable = base.FindSelectableOnLeft();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnLeft();
}
return selectable;
}
// Token: 0x06000E87 RID: 3719 RVA: 0x00116074 File Offset: 0x00114274
public override Selectable FindSelectableOnRight()
{
Selectable selectable = base.FindSelectableOnRight();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnRight();
}
return selectable;
}
// Token: 0x06000E88 RID: 3720 RVA: 0x0011609C File Offset: 0x0011429C
public override Selectable FindSelectableOnUp()
{
Selectable selectable = base.FindSelectableOnUp();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnUp();
}
return selectable;
}
// Token: 0x06000E89 RID: 3721 RVA: 0x001160C4 File Offset: 0x001142C4
public override Selectable FindSelectableOnDown()
{
Selectable selectable = base.FindSelectableOnDown();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnDown();
}
return selectable;
}
}

View File

@@ -1,41 +0,0 @@
using System;
using System.Collections.Generic;
using UnityEngine;
// Token: 0x02000082 RID: 130
[Serializable]
public class ByeProbuilder : MonoBehaviour
{
// Token: 0x0400146D RID: 5229
public Bounds bounds;
// Token: 0x0400146E RID: 5230
public List<Transform> parentList = new List<Transform>();
// Token: 0x0400146F RID: 5231
public List<Transform> childList = new List<Transform>();
// Token: 0x04001470 RID: 5232
public List<Light> lightList = new List<Light>();
// Token: 0x04001471 RID: 5233
public int settingMin;
// Token: 0x04001472 RID: 5234
public LayerMask everythingCullingMask = -1;
// Token: 0x04001473 RID: 5235
public List<GameObject> pointChildren = new List<GameObject>();
// Token: 0x04001474 RID: 5236
public List<Vector3> points = new List<Vector3>();
// Token: 0x04001475 RID: 5237
public List<Quaternion> rots = new List<Quaternion>();
// Token: 0x04001476 RID: 5238
public List<GameObject> spheres = new List<GameObject>();
// Token: 0x04001477 RID: 5239
private RaycastHit[] hits;
}

Some files were not shown because too many files have changed in this diff Show More