Compare commits
9 Commits
f56aae2dbf
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a149d45ec | |||
| c2fe7b0c9e | |||
| 71163fc589 | |||
| 0f2a242b30 | |||
| 4ae13418a6 | |||
| 9583944c69 | |||
| 345f8c4565 | |||
| 66ca370ac2 | |||
| dea5256339 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,3 +11,4 @@ Projects/CykaOfQud/.vs/
|
|||||||
|
|
||||||
Projects/CykaOfQud/.vscode/
|
Projects/CykaOfQud/.vscode/
|
||||||
*.suo
|
*.suo
|
||||||
|
Projects/BanquetForFools/.vs/BanquetForCyka
|
||||||
|
|||||||
3
Projects/BanquetForFools/.clang-format
Normal file
3
Projects/BanquetForFools/.clang-format
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
BasedOnStyle: Google
|
||||||
|
IndentWidth: 4
|
||||||
|
ColumnLimit: 120
|
||||||
16
Projects/BanquetForFools/BanquetForCyka.sln
Normal file
16
Projects/BanquetForFools/BanquetForCyka.sln
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
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
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<?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>
|
||||||
147
Projects/BanquetForFools/BanquetForCyka/Class1.cs
Normal file
147
Projects/BanquetForFools/BanquetForCyka/Class1.cs
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
28
Projects/BanquetForFools/BanquetForCyka/CykUtil.cs
Normal file
28
Projects/BanquetForFools/BanquetForCyka/CykUtil.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
269
Projects/BanquetForFools/BanquetForCyka/ExpressionConfigEntry.cs
Normal file
269
Projects/BanquetForFools/BanquetForCyka/ExpressionConfigEntry.cs
Normal file
@@ -0,0 +1,269 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
60
Projects/BanquetForFools/BanquetForCyka/ModuleGyroManager.cs
Normal file
60
Projects/BanquetForFools/BanquetForCyka/ModuleGyroManager.cs
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
83
Projects/BanquetForFools/BanquetForCyka/ModuleWingManager.cs
Normal file
83
Projects/BanquetForFools/BanquetForCyka/ModuleWingManager.cs
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
71
Projects/BanquetForFools/BanquetForCyka/MultiBuy.cs
Normal file
71
Projects/BanquetForFools/BanquetForCyka/MultiBuy.cs
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
531
Projects/BanquetForFools/BanquetForCyka/ObjectFieldMultiplier.cs
Normal file
531
Projects/BanquetForFools/BanquetForCyka/ObjectFieldMultiplier.cs
Normal file
@@ -0,0 +1,531 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
24
Projects/BanquetForFools/BanquetForCyka/Patches.cs
Normal file
24
Projects/BanquetForFools/BanquetForCyka/Patches.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
22
Projects/BanquetForFools/BanquetForCyka/ProjectilePatch.cs
Normal file
22
Projects/BanquetForFools/BanquetForCyka/ProjectilePatch.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
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")]
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
53
Projects/BanquetForFools/BanquetForCyka/TankBeamManager.cs
Normal file
53
Projects/BanquetForFools/BanquetForCyka/TankBeamManager.cs
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
53
Projects/BanquetForFools/BanquetForCyka/TankManager.cs
Normal file
53
Projects/BanquetForFools/BanquetForCyka/TankManager.cs
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
181
Projects/BanquetForFools/BanquetForCyka/UISnapshotPanelBuyAll.cs
Normal file
181
Projects/BanquetForFools/BanquetForCyka/UISnapshotPanelBuyAll.cs
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
Projects/BanquetForFools/BanquetForCyka/log.cs
Normal file
14
Projects/BanquetForFools/BanquetForCyka/log.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
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}");
|
||||||
|
}
|
||||||
|
}
|
||||||
22
Projects/BanquetForFools/Source/Assembly-CSharp.sln
Normal file
22
Projects/BanquetForFools/Source/Assembly-CSharp.sln
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
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
|
||||||
8099
Projects/BanquetForFools/Source/Assembly-CSharp/Actions.cs
Normal file
8099
Projects/BanquetForFools/Source/Assembly-CSharp/Actions.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x02000081 RID: 129
|
||||||
|
public class AddressablesManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
}
|
||||||
149
Projects/BanquetForFools/Source/Assembly-CSharp/Ailment.cs
Normal file
149
Projects/BanquetForFools/Source/Assembly-CSharp/Ailment.cs
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
228
Projects/BanquetForFools/Source/Assembly-CSharp/AllSounds.cs
Normal file
228
Projects/BanquetForFools/Source/Assembly-CSharp/AllSounds.cs
Normal file
@@ -0,0 +1,228 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
1176
Projects/BanquetForFools/Source/Assembly-CSharp/AnimateButton.cs
Normal file
1176
Projects/BanquetForFools/Source/Assembly-CSharp/AnimateButton.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,79 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
1297
Projects/BanquetForFools/Source/Assembly-CSharp/Archives.cs
Normal file
1297
Projects/BanquetForFools/Source/Assembly-CSharp/Archives.cs
Normal file
File diff suppressed because it is too large
Load Diff
145
Projects/BanquetForFools/Source/Assembly-CSharp/Armor.cs
Normal file
145
Projects/BanquetForFools/Source/Assembly-CSharp/Armor.cs
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
1042
Projects/BanquetForFools/Source/Assembly-CSharp/ArrowKit.cs
Normal file
1042
Projects/BanquetForFools/Source/Assembly-CSharp/ArrowKit.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,382 @@
|
|||||||
|
<?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>
|
||||||
9695
Projects/BanquetForFools/Source/Assembly-CSharp/AttackAI.cs
Normal file
9695
Projects/BanquetForFools/Source/Assembly-CSharp/AttackAI.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,242 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
86
Projects/BanquetForFools/Source/Assembly-CSharp/Bag.cs
Normal file
86
Projects/BanquetForFools/Source/Assembly-CSharp/Bag.cs
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,387 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
60
Projects/BanquetForFools/Source/Assembly-CSharp/Billboard.cs
Normal file
60
Projects/BanquetForFools/Source/Assembly-CSharp/Billboard.cs
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
3099
Projects/BanquetForFools/Source/Assembly-CSharp/Boat.cs
Normal file
3099
Projects/BanquetForFools/Source/Assembly-CSharp/Boat.cs
Normal file
File diff suppressed because it is too large
Load Diff
4846
Projects/BanquetForFools/Source/Assembly-CSharp/Body.cs
Normal file
4846
Projects/BanquetForFools/Source/Assembly-CSharp/Body.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,19 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
670
Projects/BanquetForFools/Source/Assembly-CSharp/Books.cs
Normal file
670
Projects/BanquetForFools/Source/Assembly-CSharp/Books.cs
Normal file
@@ -0,0 +1,670 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
731
Projects/BanquetForFools/Source/Assembly-CSharp/Boro.cs
Normal file
731
Projects/BanquetForFools/Source/Assembly-CSharp/Boro.cs
Normal file
@@ -0,0 +1,731 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
160
Projects/BanquetForFools/Source/Assembly-CSharp/Breakable.cs
Normal file
160
Projects/BanquetForFools/Source/Assembly-CSharp/Breakable.cs
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,920 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x02000002 RID: 2
|
||||||
|
public class CameraControls : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x04000001 RID: 1
|
||||||
|
[Header("Smoothing")]
|
||||||
|
public bool Smoothing;
|
||||||
|
|
||||||
|
// Token: 0x04000002 RID: 2
|
||||||
|
public float MoveDampening;
|
||||||
|
|
||||||
|
// Token: 0x04000003 RID: 3
|
||||||
|
public float ZoomDampening;
|
||||||
|
|
||||||
|
// Token: 0x04000004 RID: 4
|
||||||
|
public float RotationDampening;
|
||||||
|
|
||||||
|
// Token: 0x04000005 RID: 5
|
||||||
|
public float TiltDampening;
|
||||||
|
|
||||||
|
// Token: 0x04000006 RID: 6
|
||||||
|
[Header("Keys and Mouse")]
|
||||||
|
public bool AllowMove;
|
||||||
|
|
||||||
|
// Token: 0x04000007 RID: 7
|
||||||
|
public float MoveSpeed;
|
||||||
|
|
||||||
|
// Token: 0x04000008 RID: 8
|
||||||
|
public bool AllowFastMove;
|
||||||
|
|
||||||
|
// Token: 0x04000009 RID: 9
|
||||||
|
public float FastMoveSpeed;
|
||||||
|
|
||||||
|
// Token: 0x0400000A RID: 10
|
||||||
|
public KeyCode FastMoveKeyCode1;
|
||||||
|
|
||||||
|
// Token: 0x0400000B RID: 11
|
||||||
|
public KeyCode FastMoveKeyCode2;
|
||||||
|
|
||||||
|
// Token: 0x0400000C RID: 12
|
||||||
|
public bool AllowRotate;
|
||||||
|
|
||||||
|
// Token: 0x0400000D RID: 13
|
||||||
|
public float RotateSpeed;
|
||||||
|
|
||||||
|
// Token: 0x0400000E RID: 14
|
||||||
|
public bool AllowZoom;
|
||||||
|
|
||||||
|
// Token: 0x0400000F RID: 15
|
||||||
|
public float ZoomSpeed;
|
||||||
|
|
||||||
|
// Token: 0x04000010 RID: 16
|
||||||
|
public bool AllowTilt;
|
||||||
|
|
||||||
|
// Token: 0x04000011 RID: 17
|
||||||
|
public float TiltSpeed;
|
||||||
|
|
||||||
|
// Token: 0x04000012 RID: 18
|
||||||
|
public KeyCode ResetKey;
|
||||||
|
|
||||||
|
// Token: 0x04000013 RID: 19
|
||||||
|
public bool IncludePositionOnReset;
|
||||||
|
|
||||||
|
// Token: 0x04000014 RID: 20
|
||||||
|
public bool MovementBreaksFollow;
|
||||||
|
|
||||||
|
// Token: 0x04000015 RID: 21
|
||||||
|
public string HorizontalInputAxis = "Horizontal";
|
||||||
|
|
||||||
|
// Token: 0x04000016 RID: 22
|
||||||
|
public string VerticalInputAxis = "Vertical";
|
||||||
|
|
||||||
|
// Token: 0x04000017 RID: 23
|
||||||
|
public bool RotateUsesInputAxis;
|
||||||
|
|
||||||
|
// Token: 0x04000018 RID: 24
|
||||||
|
public string RotateInputAxis = "KbCameraRotate";
|
||||||
|
|
||||||
|
// Token: 0x04000019 RID: 25
|
||||||
|
public KeyCode RotateLeftKey = KeyCode.Q;
|
||||||
|
|
||||||
|
// Token: 0x0400001A RID: 26
|
||||||
|
public KeyCode RotateRightKey = KeyCode.E;
|
||||||
|
|
||||||
|
// Token: 0x0400001B RID: 27
|
||||||
|
public bool ZoomUsesInputAxis;
|
||||||
|
|
||||||
|
// Token: 0x0400001C RID: 28
|
||||||
|
public string ZoomInputAxis = "KbCameraZoom";
|
||||||
|
|
||||||
|
// Token: 0x0400001D RID: 29
|
||||||
|
public KeyCode ZoomOutKey = KeyCode.Z;
|
||||||
|
|
||||||
|
// Token: 0x0400001E RID: 30
|
||||||
|
public KeyCode ZoomInKey = KeyCode.X;
|
||||||
|
|
||||||
|
// Token: 0x0400001F RID: 31
|
||||||
|
public bool TiltUsesInputAxis;
|
||||||
|
|
||||||
|
// Token: 0x04000020 RID: 32
|
||||||
|
public string TiltInputAxis = "KbCameraTilt";
|
||||||
|
|
||||||
|
// Token: 0x04000021 RID: 33
|
||||||
|
public KeyCode TiltUpKey = KeyCode.R;
|
||||||
|
|
||||||
|
// Token: 0x04000022 RID: 34
|
||||||
|
public KeyCode TiltDownKey = KeyCode.F;
|
||||||
|
|
||||||
|
// Token: 0x04000023 RID: 35
|
||||||
|
public KeyCode MouseOrbitButton;
|
||||||
|
|
||||||
|
// Token: 0x04000024 RID: 36
|
||||||
|
public bool AllowScreenEdgeMove;
|
||||||
|
|
||||||
|
// Token: 0x04000025 RID: 37
|
||||||
|
public bool ScreenEdgeMoveBreaksFollow;
|
||||||
|
|
||||||
|
// Token: 0x04000026 RID: 38
|
||||||
|
public int ScreenEdgeBorderWidth;
|
||||||
|
|
||||||
|
// Token: 0x04000027 RID: 39
|
||||||
|
public bool AllowPan;
|
||||||
|
|
||||||
|
// Token: 0x04000028 RID: 40
|
||||||
|
public bool PanBreaksFollow;
|
||||||
|
|
||||||
|
// Token: 0x04000029 RID: 41
|
||||||
|
public float PanSpeed;
|
||||||
|
|
||||||
|
// Token: 0x0400002A RID: 42
|
||||||
|
public float RotateSpeedMouse;
|
||||||
|
|
||||||
|
// Token: 0x0400002B RID: 43
|
||||||
|
public float MoveSpeedMouse;
|
||||||
|
|
||||||
|
// Token: 0x0400002C RID: 44
|
||||||
|
public float TiltSpeedMouse;
|
||||||
|
|
||||||
|
// Token: 0x0400002D RID: 45
|
||||||
|
public float ZoomSpeedMouse;
|
||||||
|
|
||||||
|
// Token: 0x0400002E RID: 46
|
||||||
|
public float FollowSpeed;
|
||||||
|
|
||||||
|
// Token: 0x0400002F RID: 47
|
||||||
|
public string RotateInputAxisMouse = "Mouse X";
|
||||||
|
|
||||||
|
// Token: 0x04000030 RID: 48
|
||||||
|
public string TiltInputAxisMouse = "Mouse Y";
|
||||||
|
|
||||||
|
// Token: 0x04000031 RID: 49
|
||||||
|
public string ZoomInputAxisMouse = "Mouse ScrollWheel";
|
||||||
|
|
||||||
|
// Token: 0x04000032 RID: 50
|
||||||
|
public KeyCode PanKey1 = KeyCode.LeftShift;
|
||||||
|
|
||||||
|
// Token: 0x04000033 RID: 51
|
||||||
|
public KeyCode PanKey2 = KeyCode.RightShift;
|
||||||
|
}
|
||||||
2666
Projects/BanquetForFools/Source/Assembly-CSharp/CameraEffects.cs
Normal file
2666
Projects/BanquetForFools/Source/Assembly-CSharp/CameraEffects.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x0200005D RID: 93
|
||||||
|
public class CameraFogOfWar : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000B43 RID: 2883 RVA: 0x000DD4AF File Offset: 0x000DB6AF
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B44 RID: 2884 RVA: 0x000DD4B1 File Offset: 0x000DB6B1
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B45 RID: 2885 RVA: 0x000DD4B3 File Offset: 0x000DB6B3
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B46 RID: 2886 RVA: 0x000DD4B8 File Offset: 0x000DB6B8
|
||||||
|
private void OnRenderImage(RenderTexture src, RenderTexture dest)
|
||||||
|
{
|
||||||
|
if (!this.cam)
|
||||||
|
{
|
||||||
|
this.cam = Camera.main;
|
||||||
|
}
|
||||||
|
if (this.cam)
|
||||||
|
{
|
||||||
|
Matrix4x4 cameraToWorldMatrix = this.cam.cameraToWorldMatrix;
|
||||||
|
Shader.SetGlobalMatrix("_CamToWorld", this.cam.cameraToWorldMatrix);
|
||||||
|
if (!this.fogMaterial)
|
||||||
|
{
|
||||||
|
this.fogMaterial = new Material(Shader.Find("Hannah/FogOfWar"));
|
||||||
|
}
|
||||||
|
Graphics.Blit(src, dest, this.fogMaterial);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x04001046 RID: 4166
|
||||||
|
private Material fogMaterial;
|
||||||
|
|
||||||
|
// Token: 0x04001047 RID: 4167
|
||||||
|
private Camera cam;
|
||||||
|
}
|
||||||
136
Projects/BanquetForFools/Source/Assembly-CSharp/CameraParams.cs
Normal file
136
Projects/BanquetForFools/Source/Assembly-CSharp/CameraParams.cs
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Rendering;
|
||||||
|
|
||||||
|
// Token: 0x0200005E RID: 94
|
||||||
|
[ExecuteInEditMode]
|
||||||
|
public class CameraParams : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000B48 RID: 2888 RVA: 0x000DD544 File Offset: 0x000DB744
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
this.SetParams();
|
||||||
|
if (this.meshRenderer)
|
||||||
|
{
|
||||||
|
this.meshRenderer.shadowCastingMode = ShadowCastingMode.Off;
|
||||||
|
this.meshRenderer.receiveShadows = false;
|
||||||
|
if (this.meshRenderer && this.meshRenderer.sharedMaterial)
|
||||||
|
{
|
||||||
|
this.bakedShadows = this.meshRenderer.sharedMaterial.GetTexture("_ShadowsTex");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B49 RID: 2889 RVA: 0x000DD5B6 File Offset: 0x000DB7B6
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
this.SetParams();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B4A RID: 2890 RVA: 0x000DD5BE File Offset: 0x000DB7BE
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
this.SetParams();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B4B RID: 2891 RVA: 0x000DD5C8 File Offset: 0x000DB7C8
|
||||||
|
public void SetParams()
|
||||||
|
{
|
||||||
|
if (this.cam)
|
||||||
|
{
|
||||||
|
this.sceneMatrix = this.cam.cameraToWorldMatrix;
|
||||||
|
if (this.meshRenderer && this.meshRenderer.sharedMaterial)
|
||||||
|
{
|
||||||
|
this.meshRenderer.sharedMaterial.SetMatrix("_Scene_CamToWorld", this.sceneMatrix);
|
||||||
|
this.projMatrix = GL.GetGPUProjectionMatrix(this.cam.projectionMatrix, true) * this.cam.worldToCameraMatrix;
|
||||||
|
this.meshRenderer.sharedMaterial.SetMatrix("_Scene_CameraProjectionMatrix", this.projMatrix);
|
||||||
|
if (this.shadowParams)
|
||||||
|
{
|
||||||
|
this.meshRenderer.sharedMaterial.SetMatrix("_Scene_ShadowMatrix_", this.shadowParams.shadowMatrixMorning);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.meshRenderer.sharedMaterial.SetMatrix("_Scene_ShadowMatrix_", this.shadowMatrixMorning);
|
||||||
|
}
|
||||||
|
float num = 1f;
|
||||||
|
this.projParams = new Vector4(num, this.cam.nearClipPlane, this.cam.farClipPlane, 1f / this.cam.farClipPlane);
|
||||||
|
this.meshRenderer.sharedMaterial.SetVector("_Scene_ProjectionParams", this.projParams);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x04001048 RID: 4168
|
||||||
|
[Header("CAMERA VARIABLES")]
|
||||||
|
public Matrix4x4 projMatrix;
|
||||||
|
|
||||||
|
// Token: 0x04001049 RID: 4169
|
||||||
|
public Matrix4x4 sceneMatrix;
|
||||||
|
|
||||||
|
// Token: 0x0400104A RID: 4170
|
||||||
|
public Vector4 projParams;
|
||||||
|
|
||||||
|
// Token: 0x0400104B RID: 4171
|
||||||
|
public Matrix4x4 shadowMatrixMorning;
|
||||||
|
|
||||||
|
// Token: 0x0400104C RID: 4172
|
||||||
|
public Matrix4x4 shadowMatrixAfternoon;
|
||||||
|
|
||||||
|
// Token: 0x0400104D RID: 4173
|
||||||
|
public Matrix4x4 shadowMatrixEvening;
|
||||||
|
|
||||||
|
// Token: 0x0400104E RID: 4174
|
||||||
|
public Matrix4x4 shadowMatrixNight;
|
||||||
|
|
||||||
|
// Token: 0x0400104F RID: 4175
|
||||||
|
public Matrix4x4 shadowMatrixIndoor;
|
||||||
|
|
||||||
|
// Token: 0x04001050 RID: 4176
|
||||||
|
public Texture2D shadowsMorning;
|
||||||
|
|
||||||
|
// Token: 0x04001051 RID: 4177
|
||||||
|
public Texture2D shadowsAfternoon;
|
||||||
|
|
||||||
|
// Token: 0x04001052 RID: 4178
|
||||||
|
public Texture2D shadowsEvening;
|
||||||
|
|
||||||
|
// Token: 0x04001053 RID: 4179
|
||||||
|
public Texture2D shadowsNight;
|
||||||
|
|
||||||
|
// Token: 0x04001054 RID: 4180
|
||||||
|
public Texture2D shadowsIndoors;
|
||||||
|
|
||||||
|
// Token: 0x04001055 RID: 4181
|
||||||
|
public Texture bakedShadows;
|
||||||
|
|
||||||
|
// Token: 0x04001056 RID: 4182
|
||||||
|
public Texture2D pointLightShadow1;
|
||||||
|
|
||||||
|
// Token: 0x04001057 RID: 4183
|
||||||
|
public Texture2D pointLightShadow2;
|
||||||
|
|
||||||
|
// Token: 0x04001058 RID: 4184
|
||||||
|
public Texture2D pointLightShadow3;
|
||||||
|
|
||||||
|
// Token: 0x04001059 RID: 4185
|
||||||
|
public Texture2D pointLightShadow4;
|
||||||
|
|
||||||
|
// Token: 0x0400105A RID: 4186
|
||||||
|
public Texture2D pointLightShadow5;
|
||||||
|
|
||||||
|
// Token: 0x0400105B RID: 4187
|
||||||
|
public Texture2D pointLightShadow6;
|
||||||
|
|
||||||
|
// Token: 0x0400105C RID: 4188
|
||||||
|
public Vector3 center;
|
||||||
|
|
||||||
|
// Token: 0x0400105D RID: 4189
|
||||||
|
[Header("RENDERER")]
|
||||||
|
public MeshRenderer meshRenderer;
|
||||||
|
|
||||||
|
// Token: 0x0400105E RID: 4190
|
||||||
|
[Header("CAMERA")]
|
||||||
|
public Camera cam;
|
||||||
|
|
||||||
|
// Token: 0x0400105F RID: 4191
|
||||||
|
public CameraParams shadowParams;
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x0200005F RID: 95
|
||||||
|
public class CaptureAreaInfo : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000B4D RID: 2893 RVA: 0x000DD71E File Offset: 0x000DB91E
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B4E RID: 2894 RVA: 0x000DD720 File Offset: 0x000DB920
|
||||||
|
public void TurnOnLights()
|
||||||
|
{
|
||||||
|
foreach (InteriorLights interiorLights in this.pointLights)
|
||||||
|
{
|
||||||
|
interiorLights.TurnOnLights();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B4F RID: 2895 RVA: 0x000DD770 File Offset: 0x000DB970
|
||||||
|
public void TurnOffLights()
|
||||||
|
{
|
||||||
|
foreach (InteriorLights interiorLights in this.pointLights)
|
||||||
|
{
|
||||||
|
interiorLights.TurnOffLights();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x04001060 RID: 4192
|
||||||
|
public int index;
|
||||||
|
|
||||||
|
// Token: 0x04001061 RID: 4193
|
||||||
|
public string id;
|
||||||
|
|
||||||
|
// Token: 0x04001062 RID: 4194
|
||||||
|
public List<BoxCollider> boundingBoxes = new List<BoxCollider>();
|
||||||
|
|
||||||
|
// Token: 0x04001063 RID: 4195
|
||||||
|
public List<BoxCollider> interiorCameraBoxes = new List<BoxCollider>();
|
||||||
|
|
||||||
|
// Token: 0x04001064 RID: 4196
|
||||||
|
public Camera sceneCamera;
|
||||||
|
|
||||||
|
// Token: 0x04001065 RID: 4197
|
||||||
|
public Camera minimapCamera;
|
||||||
|
|
||||||
|
// Token: 0x04001066 RID: 4198
|
||||||
|
public BoxCollider cameraCollider;
|
||||||
|
|
||||||
|
// Token: 0x04001067 RID: 4199
|
||||||
|
public BoxCollider exteriorCameraBoundsCollider;
|
||||||
|
|
||||||
|
// Token: 0x04001068 RID: 4200
|
||||||
|
public GameObject terrainMap;
|
||||||
|
|
||||||
|
// Token: 0x04001069 RID: 4201
|
||||||
|
public List<InteriorLights> pointLights = new List<InteriorLights>();
|
||||||
|
|
||||||
|
// Token: 0x0400106A RID: 4202
|
||||||
|
public List<GameObject> quads = new List<GameObject>();
|
||||||
|
|
||||||
|
// Token: 0x0400106B RID: 4203
|
||||||
|
public bool perspectiveShot;
|
||||||
|
|
||||||
|
// Token: 0x0400106C RID: 4204
|
||||||
|
public bool isInterior;
|
||||||
|
|
||||||
|
// Token: 0x0400106D RID: 4205
|
||||||
|
[Header("Art")]
|
||||||
|
public GameObject backgroundArt;
|
||||||
|
|
||||||
|
// Token: 0x0400106E RID: 4206
|
||||||
|
public Texture2D sceneMap;
|
||||||
|
}
|
||||||
@@ -0,0 +1,295 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x02000073 RID: 115
|
||||||
|
[ExecuteInEditMode]
|
||||||
|
public class CaptureBackgrounds : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000B85 RID: 2949 RVA: 0x000DF670 File Offset: 0x000DD870
|
||||||
|
public void Setup()
|
||||||
|
{
|
||||||
|
if (this.normalsTexture)
|
||||||
|
{
|
||||||
|
this.normalsTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.albedoTexture)
|
||||||
|
{
|
||||||
|
this.albedoTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.smoothnessTexture)
|
||||||
|
{
|
||||||
|
this.smoothnessTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.depthTexture)
|
||||||
|
{
|
||||||
|
this.depthTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.pointLightTexture)
|
||||||
|
{
|
||||||
|
this.pointLightTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.albedoTempTexture)
|
||||||
|
{
|
||||||
|
this.albedoTempTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.directionalLightTexture)
|
||||||
|
{
|
||||||
|
this.directionalLightTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.specularTexture)
|
||||||
|
{
|
||||||
|
this.specularTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.specShadowsTexture)
|
||||||
|
{
|
||||||
|
this.specShadowsTexture.Release();
|
||||||
|
}
|
||||||
|
this.depthTexture = new RenderTexture(this.depthWidth, this.depthHeight, 24, RenderTextureFormat.ARGBFloat);
|
||||||
|
this.normalsTexture = new RenderTexture(this.normalWidth, this.normalHeight, 24, RenderTextureFormat.ARGBFloat);
|
||||||
|
this.albedoTexture = new RenderTexture(this.albedoWidth, this.albedoHeight, 24, RenderTextureFormat.ARGBFloat);
|
||||||
|
this.smoothnessTexture = new RenderTexture(this.albedoWidth, this.albedoHeight, 24, RenderTextureFormat.ARGBFloat);
|
||||||
|
this.pointLightTexture = new RenderTexture(this.depthWidth, this.depthHeight, 24, RenderTextureFormat.ARGBHalf);
|
||||||
|
this.directionalLightTexture = new RenderTexture(this.shadowWidth, this.shadowHeight, 24, RenderTextureFormat.ARGBFloat);
|
||||||
|
this.albedoTempTexture = new RenderTexture(this.albedoWidth, this.albedoHeight, 24, RenderTextureFormat.ARGBFloat);
|
||||||
|
this.specularTexture = new RenderTexture(this.shadowWidth, this.shadowHeight, 24, RenderTextureFormat.ARGBFloat);
|
||||||
|
this.specShadowsTexture = new RenderTexture(this.shadowWidth, this.shadowHeight, 24, RenderTextureFormat.ARGBFloat);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B86 RID: 2950 RVA: 0x000DF848 File Offset: 0x000DDA48
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
if (this.normalsTexture)
|
||||||
|
{
|
||||||
|
this.normalsTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.albedoTexture)
|
||||||
|
{
|
||||||
|
this.albedoTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.smoothnessTexture)
|
||||||
|
{
|
||||||
|
this.smoothnessTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.depthTexture)
|
||||||
|
{
|
||||||
|
this.depthTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.pointLightTexture)
|
||||||
|
{
|
||||||
|
this.pointLightTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.albedoTempTexture)
|
||||||
|
{
|
||||||
|
this.albedoTempTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.directionalLightTexture)
|
||||||
|
{
|
||||||
|
this.directionalLightTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.specularTexture)
|
||||||
|
{
|
||||||
|
this.specularTexture.Release();
|
||||||
|
}
|
||||||
|
if (this.specShadowsTexture)
|
||||||
|
{
|
||||||
|
this.specShadowsTexture.Release();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B87 RID: 2951 RVA: 0x000DF930 File Offset: 0x000DDB30
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (!this.cam)
|
||||||
|
{
|
||||||
|
this.cam = base.gameObject.GetComponent<Camera>();
|
||||||
|
}
|
||||||
|
if (!this.normalsTexture)
|
||||||
|
{
|
||||||
|
this.Setup();
|
||||||
|
}
|
||||||
|
if (!this.cam)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.albedo || this.directionalShadows)
|
||||||
|
{
|
||||||
|
this.cam.enabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.cam.enabled = false;
|
||||||
|
}
|
||||||
|
if (this.normalsTexture.width != this.normalWidth || this.normalsTexture.height != this.normalHeight || this.albedoTexture.width != this.albedoWidth || this.albedoTexture.height != this.albedoHeight || this.depthTexture.height != this.depthHeight || this.pointLightTexture.height != this.depthHeight || this.directionalLightTexture.height != this.shadowHeight)
|
||||||
|
{
|
||||||
|
this.Setup();
|
||||||
|
}
|
||||||
|
if (this.directionalShadows)
|
||||||
|
{
|
||||||
|
if (!this.directionalLightShader)
|
||||||
|
{
|
||||||
|
this.directionalLightShader = Shader.Find("Hidden/ViewDirectionalShadows");
|
||||||
|
}
|
||||||
|
Shader.SetGlobalFloat("passNumber", 1f);
|
||||||
|
this.cam.targetTexture = this.directionalLightTexture;
|
||||||
|
this.cam.RenderWithShader(this.directionalLightShader, "RenderType");
|
||||||
|
this.cam.targetTexture = null;
|
||||||
|
Shader.SetGlobalFloat("passNumber", 0f);
|
||||||
|
this.cam.targetTexture = this.specularTexture;
|
||||||
|
this.cam.RenderWithShader(this.directionalLightShader, "RenderType");
|
||||||
|
this.cam.targetTexture = null;
|
||||||
|
}
|
||||||
|
if (this.normalsTexture && this.normals)
|
||||||
|
{
|
||||||
|
if (!this.normalsShader)
|
||||||
|
{
|
||||||
|
this.normalsShader = Shader.Find("Hidden/ViewNormals");
|
||||||
|
}
|
||||||
|
this.cam.targetTexture = this.normalsTexture;
|
||||||
|
this.cam.RenderWithShader(this.normalsShader, "RenderType");
|
||||||
|
this.cam.targetTexture = null;
|
||||||
|
Shader.SetGlobalTexture("_GlobalNormalsTex", this.normalsTexture);
|
||||||
|
}
|
||||||
|
if (this.depthTexture && this.depth)
|
||||||
|
{
|
||||||
|
if (!this.depthShader)
|
||||||
|
{
|
||||||
|
this.depthShader = Shader.Find("Hidden/ViewDepthOrtho");
|
||||||
|
}
|
||||||
|
this.cam.targetTexture = this.depthTexture;
|
||||||
|
this.cam.RenderWithShader(this.depthShader, "RenderType");
|
||||||
|
this.cam.targetTexture = null;
|
||||||
|
Shader.SetGlobalTexture("_GlobalDepthTex", this.depthTexture);
|
||||||
|
}
|
||||||
|
if (this.smoothnessTexture && this.albedo)
|
||||||
|
{
|
||||||
|
if (!this.smoothnessShader)
|
||||||
|
{
|
||||||
|
this.smoothnessShader = Shader.Find("Hidden/ViewSmoothness");
|
||||||
|
}
|
||||||
|
this.cam.targetTexture = this.smoothnessTexture;
|
||||||
|
this.cam.RenderWithShader(this.smoothnessShader, "RenderType");
|
||||||
|
this.cam.targetTexture = null;
|
||||||
|
this.doAlbedo = true;
|
||||||
|
this.cam.targetTexture = this.albedoTempTexture;
|
||||||
|
this.cam.Render();
|
||||||
|
this.cam.targetTexture = null;
|
||||||
|
this.doAlbedo = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B88 RID: 2952 RVA: 0x000DFC68 File Offset: 0x000DDE68
|
||||||
|
private void OnRenderImage(RenderTexture src, RenderTexture dest)
|
||||||
|
{
|
||||||
|
if (this.albedoTexture && this.doAlbedo)
|
||||||
|
{
|
||||||
|
if (!this.albedoMaterial)
|
||||||
|
{
|
||||||
|
this.albedoMaterial = new Material(Shader.Find("Hidden/CombineCaptures"));
|
||||||
|
}
|
||||||
|
this.albedoMaterial.SetTexture("_SmoothnessTex", this.smoothnessTexture);
|
||||||
|
this.albedoMaterial.SetTexture("_AlbedoTex", this.albedoTempTexture);
|
||||||
|
Graphics.Blit(src, this.albedoTexture, this.albedoMaterial, 0);
|
||||||
|
}
|
||||||
|
if (this.specularTexture && this.directionalShadows)
|
||||||
|
{
|
||||||
|
if (!this.albedoMaterial)
|
||||||
|
{
|
||||||
|
this.albedoMaterial = new Material(Shader.Find("Hidden/CombineCaptures"));
|
||||||
|
}
|
||||||
|
this.albedoMaterial.SetTexture("_SpecTex", this.specularTexture);
|
||||||
|
this.albedoMaterial.SetTexture("_LightTex", this.directionalLightTexture);
|
||||||
|
Graphics.Blit(src, this.specShadowsTexture, this.albedoMaterial, 1);
|
||||||
|
}
|
||||||
|
Graphics.Blit(src, dest);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0400117F RID: 4479
|
||||||
|
public bool normals;
|
||||||
|
|
||||||
|
// Token: 0x04001180 RID: 4480
|
||||||
|
public bool albedo = true;
|
||||||
|
|
||||||
|
// Token: 0x04001181 RID: 4481
|
||||||
|
public bool depth;
|
||||||
|
|
||||||
|
// Token: 0x04001182 RID: 4482
|
||||||
|
public bool directionalShadows;
|
||||||
|
|
||||||
|
// Token: 0x04001183 RID: 4483
|
||||||
|
private Camera cam;
|
||||||
|
|
||||||
|
// Token: 0x04001184 RID: 4484
|
||||||
|
public RenderTexture normalsTexture;
|
||||||
|
|
||||||
|
// Token: 0x04001185 RID: 4485
|
||||||
|
public RenderTexture albedoTexture;
|
||||||
|
|
||||||
|
// Token: 0x04001186 RID: 4486
|
||||||
|
public RenderTexture smoothnessTexture;
|
||||||
|
|
||||||
|
// Token: 0x04001187 RID: 4487
|
||||||
|
public RenderTexture pointLightTexture;
|
||||||
|
|
||||||
|
// Token: 0x04001188 RID: 4488
|
||||||
|
public RenderTexture directionalLightTexture;
|
||||||
|
|
||||||
|
// Token: 0x04001189 RID: 4489
|
||||||
|
public RenderTexture specularTexture;
|
||||||
|
|
||||||
|
// Token: 0x0400118A RID: 4490
|
||||||
|
public RenderTexture albedoTempTexture;
|
||||||
|
|
||||||
|
// Token: 0x0400118B RID: 4491
|
||||||
|
public RenderTexture depthTexture;
|
||||||
|
|
||||||
|
// Token: 0x0400118C RID: 4492
|
||||||
|
public RenderTexture specShadowsTexture;
|
||||||
|
|
||||||
|
// Token: 0x0400118D RID: 4493
|
||||||
|
public Shader normalsShader;
|
||||||
|
|
||||||
|
// Token: 0x0400118E RID: 4494
|
||||||
|
public Shader smoothnessShader;
|
||||||
|
|
||||||
|
// Token: 0x0400118F RID: 4495
|
||||||
|
public Shader depthShader;
|
||||||
|
|
||||||
|
// Token: 0x04001190 RID: 4496
|
||||||
|
public Shader pointBakeShader;
|
||||||
|
|
||||||
|
// Token: 0x04001191 RID: 4497
|
||||||
|
public Shader directionalLightShader;
|
||||||
|
|
||||||
|
// Token: 0x04001192 RID: 4498
|
||||||
|
private Material albedoMaterial;
|
||||||
|
|
||||||
|
// Token: 0x04001193 RID: 4499
|
||||||
|
public int depthWidth = 2048;
|
||||||
|
|
||||||
|
// Token: 0x04001194 RID: 4500
|
||||||
|
public int depthHeight = 2048;
|
||||||
|
|
||||||
|
// Token: 0x04001195 RID: 4501
|
||||||
|
public int albedoWidth = 2048;
|
||||||
|
|
||||||
|
// Token: 0x04001196 RID: 4502
|
||||||
|
public int albedoHeight = 2048;
|
||||||
|
|
||||||
|
// Token: 0x04001197 RID: 4503
|
||||||
|
public int normalWidth = 2048;
|
||||||
|
|
||||||
|
// Token: 0x04001198 RID: 4504
|
||||||
|
public int normalHeight = 2048;
|
||||||
|
|
||||||
|
// Token: 0x04001199 RID: 4505
|
||||||
|
public int shadowWidth = 2048;
|
||||||
|
|
||||||
|
// Token: 0x0400119A RID: 4506
|
||||||
|
public int shadowHeight = 2048;
|
||||||
|
|
||||||
|
// Token: 0x0400119B RID: 4507
|
||||||
|
private bool doAlbedo;
|
||||||
|
|
||||||
|
// Token: 0x0400119C RID: 4508
|
||||||
|
public Transform lightTransform;
|
||||||
|
}
|
||||||
5944
Projects/BanquetForFools/Source/Assembly-CSharp/Cellar.cs
Normal file
5944
Projects/BanquetForFools/Source/Assembly-CSharp/Cellar.cs
Normal file
File diff suppressed because it is too large
Load Diff
21718
Projects/BanquetForFools/Source/Assembly-CSharp/Character.cs
Normal file
21718
Projects/BanquetForFools/Source/Assembly-CSharp/Character.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,822 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using PixelCrushers.DialogueSystem;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x0200001C RID: 28
|
||||||
|
public class CharacterQuips : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000460 RID: 1120 RVA: 0x00063B1C File Offset: 0x00061D1C
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
this.AddQuip("Party");
|
||||||
|
this.AddQuip("BloodlessHunter");
|
||||||
|
this.AddQuip("Yeti");
|
||||||
|
this.AddQuip("Empty");
|
||||||
|
this.AddQuip("FarmerRozafir");
|
||||||
|
this.AddQuip("FarmerRozafirChora");
|
||||||
|
this.AddQuip("Pedlar");
|
||||||
|
this.AddQuip("Stonesmith");
|
||||||
|
this.AddQuip("Menestral");
|
||||||
|
this.AddQuip("Barkeep");
|
||||||
|
this.AddQuip("BarkeepRozafir");
|
||||||
|
this.AddQuip("Shipwrith");
|
||||||
|
this.AddQuip("BarPatron");
|
||||||
|
this.AddQuip("Herder");
|
||||||
|
this.AddQuip("Meadmaid");
|
||||||
|
this.AddQuip("Monger");
|
||||||
|
this.AddQuip("Chanter");
|
||||||
|
this.AddQuip("Dolki");
|
||||||
|
this.AddQuip("Cook");
|
||||||
|
this.AddQuip("CookApprentice");
|
||||||
|
this.AddQuip("FarmerLazure");
|
||||||
|
this.AddQuip("RozafirUnderkeep");
|
||||||
|
this.AddQuip("HerderRozafir");
|
||||||
|
this.AddQuip("GuardLazure");
|
||||||
|
this.AddQuip("GuardRozafir");
|
||||||
|
this.AddQuip("RozafirStorekeep");
|
||||||
|
this.AddQuip("RozafirNewStorekeep");
|
||||||
|
this.AddQuip("Resting");
|
||||||
|
this.AddQuip("BanquetFriend");
|
||||||
|
this.AddQuip("BanquetSpawn");
|
||||||
|
this.AddQuip("GuardMainC5Caravan");
|
||||||
|
this.AddQuip("GuardC5Caravan");
|
||||||
|
this.AddQuip("C5Camper");
|
||||||
|
this.AddQuip("LittleFairyC5_A");
|
||||||
|
this.AddQuip("LittleFairyC5_B");
|
||||||
|
this.AddQuip("LittleFairyC5_C");
|
||||||
|
this.AddQuip("LittleFairyC6_A");
|
||||||
|
this.AddQuip("LittleFairyC6_B");
|
||||||
|
this.AddQuip("LittleFairyC6_C");
|
||||||
|
this.AddQuip("LittleFairyE6_A");
|
||||||
|
this.AddQuip("LittleFairyE6_B");
|
||||||
|
this.AddQuip("LittleFairyE6_C");
|
||||||
|
this.AddQuip("GuardD5");
|
||||||
|
this.AddQuip("RobberD5");
|
||||||
|
this.AddQuip("Minstrel");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000461 RID: 1121 RVA: 0x00063D18 File Offset: 0x00061F18
|
||||||
|
private void AddQuip(string n)
|
||||||
|
{
|
||||||
|
QuipSet.Quips quips = new QuipSet.Quips();
|
||||||
|
if (n == "Party")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.foundItem = new List<string>();
|
||||||
|
this.l = quips.foundItem;
|
||||||
|
this.l.Add("I could use this");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("We should keep moving");
|
||||||
|
this.l.Add("Come on");
|
||||||
|
quips.equipJewelry = new List<string>();
|
||||||
|
this.l = quips.equipJewelry;
|
||||||
|
this.l.Add("This suits me");
|
||||||
|
this.l.Add("A fine piece");
|
||||||
|
this.l.Add("This befits my rank");
|
||||||
|
this.l.Add("I'm moving up in the world");
|
||||||
|
quips.equipJewelry = new List<string>();
|
||||||
|
this.l = quips.equipJewelry;
|
||||||
|
this.l.Add("I'll put this to good use");
|
||||||
|
this.l.Add("I can work with this");
|
||||||
|
this.l.Add("I'll give this a try");
|
||||||
|
this.l.Add("I could use this");
|
||||||
|
}
|
||||||
|
if (n == "BloodlessHunter")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Something lingers");
|
||||||
|
this.l.Add("This air smells of death");
|
||||||
|
this.l.Add("Death clings to this land");
|
||||||
|
quips.taunt = new List<string>();
|
||||||
|
this.l = quips.taunt;
|
||||||
|
this.l.Add("Come and get me!");
|
||||||
|
}
|
||||||
|
if (n == "Yeti")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("Huh?");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("Huh?");
|
||||||
|
}
|
||||||
|
if (n == "Empty")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
}
|
||||||
|
if (n == "Pedlar")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Got used goods?");
|
||||||
|
this.l.Add("I'll buy anything...");
|
||||||
|
this.l.Add("Your trash is my treasure");
|
||||||
|
}
|
||||||
|
if (n == "Stonesmith")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("So dull...");
|
||||||
|
this.l.Add("Where are those hammers hiding...?");
|
||||||
|
this.l.Add("Riddled with holes...");
|
||||||
|
}
|
||||||
|
if (n == "Menestral")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("La-la-la di-dilly-day");
|
||||||
|
this.l.Add("Hmm-hmm-hmmmmmm");
|
||||||
|
this.l.Add("Do-a-di-a-tra-la-do");
|
||||||
|
}
|
||||||
|
if (n == "Barkeep")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Baked apples, mushroom curry...");
|
||||||
|
this.l.Add("Where has Florina run off to?");
|
||||||
|
this.l.Add("Etherflora, silaflora, musswort...");
|
||||||
|
}
|
||||||
|
if (n == "BarkeepRozafir")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Good music today...");
|
||||||
|
this.l.Add("Reve has all the farmers working 'round the clock");
|
||||||
|
this.l.Add("Have you tried the mulled mead?");
|
||||||
|
this.l.Add("Imported rice beer, all the way from the Taratian hills...");
|
||||||
|
this.l.Add("Best to unwind with a spiced gin...");
|
||||||
|
}
|
||||||
|
if (n == "BarPatron")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Another round?");
|
||||||
|
this.l.Add("A decent inn, not what I expected");
|
||||||
|
this.l.Add("A pot of mushroom stew for me, please you");
|
||||||
|
this.l.Add("How now, Florina?");
|
||||||
|
this.l.Add("Did you hear about the spy? Reporting to the Renazin he was...");
|
||||||
|
this.l.Add("Good mead, this");
|
||||||
|
this.l.Add("Two barrels of peppura, I hear...");
|
||||||
|
this.l.Add("Just one more");
|
||||||
|
this.l.Add("What news, my good Nelu?");
|
||||||
|
}
|
||||||
|
if (n == "RozafirUnderkeep")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Another round?");
|
||||||
|
this.l.Add("Does this rice beer taste stale to you?");
|
||||||
|
this.l.Add("More bread pudding, please you");
|
||||||
|
this.l.Add("I feel safer down here");
|
||||||
|
this.l.Add("Have you visited the new shopkeep?");
|
||||||
|
this.l.Add("Good gin, this");
|
||||||
|
this.l.Add("Not long 'til harvest");
|
||||||
|
this.l.Add("Just one more");
|
||||||
|
this.l.Add("What news, good Vali?");
|
||||||
|
}
|
||||||
|
if (n == "Shipwrith")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Faster, faster");
|
||||||
|
this.l.Add("Not a boat in the harbor");
|
||||||
|
this.l.Add("Where is that shipment from Porta Dun?");
|
||||||
|
this.l.Add("No ships on the horizon");
|
||||||
|
}
|
||||||
|
if (n == "Shipwrith")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Where have I placed that netting?");
|
||||||
|
this.l.Add("Not one boat left behind...");
|
||||||
|
this.l.Add("I hope they're keeping watch on the horizon...");
|
||||||
|
this.l.Add("Not a ship to be seen...");
|
||||||
|
}
|
||||||
|
if (n == "Herder")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("You'll stay here with me");
|
||||||
|
this.l.Add("Your friends will return soon");
|
||||||
|
this.l.Add("So far from home...");
|
||||||
|
this.l.Add("None to tend them...");
|
||||||
|
}
|
||||||
|
if (n == "HerderRozafir")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Coats are looking good");
|
||||||
|
this.l.Add("No fleas");
|
||||||
|
this.l.Add("Too bright...");
|
||||||
|
this.l.Add("Not long 'til harvest...");
|
||||||
|
}
|
||||||
|
if (n == "Meadmaid")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
}
|
||||||
|
if (n == "Monger")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("One emerald, two emeralds, three...");
|
||||||
|
this.l.Add("Five-and-twenty emeralds, six-and-twenty...");
|
||||||
|
this.l.Add("Fresh wares!");
|
||||||
|
this.l.Add("Highest quality!");
|
||||||
|
}
|
||||||
|
if (n == "Chanter")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Respiv sima soara vivrii");
|
||||||
|
this.l.Add("Impez sima acru sil");
|
||||||
|
this.l.Add("Para sima pivi asade");
|
||||||
|
this.l.Add("Qie sima resivi se");
|
||||||
|
}
|
||||||
|
if (n == "Dolki")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Hisssss...");
|
||||||
|
this.l.Add("Hisss...");
|
||||||
|
this.l.Add("Hisssssssth...");
|
||||||
|
}
|
||||||
|
if (n == "Cook")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Five potatoes...dimi-bushel mushrooms...");
|
||||||
|
this.l.Add("Forget not the dilwere...");
|
||||||
|
this.l.Add("Boil, dry, then soak anew....");
|
||||||
|
}
|
||||||
|
if (n == "CookApprentice")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Spit duty yesternight");
|
||||||
|
this.l.Add("Spit duty morrownight");
|
||||||
|
this.l.Add("Spit duty everlasting");
|
||||||
|
}
|
||||||
|
if (n == "FarmerLazure")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Not yet ripe");
|
||||||
|
this.l.Add("These are ready for harvest");
|
||||||
|
this.l.Add("Shroomsect eggs...we'll need a potion");
|
||||||
|
this.l.Add("Blisters all over my hands...");
|
||||||
|
}
|
||||||
|
if (n == "FarmerRozafir")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("This plant needs more dew");
|
||||||
|
this.l.Add("My back aches so...");
|
||||||
|
this.l.Add("Sela fair blazes today");
|
||||||
|
this.l.Add("These leaves show signs of shroombites");
|
||||||
|
this.l.Add("Is that a small footprint?");
|
||||||
|
this.l.Add("Harvest is not so far away");
|
||||||
|
this.l.Add("What burrows here?");
|
||||||
|
}
|
||||||
|
if (n == "FarmerRozafirChora")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Mmmm-tra-la-la-lo...");
|
||||||
|
this.l.Add("Do-dora-dae...");
|
||||||
|
this.l.Add("Lo-La-Li-Lo-La-Li-Le...");
|
||||||
|
this.l.Add("Chora please bless us...Chora protect us...La-la-li la-la-li loooo...");
|
||||||
|
this.l.Add("Hmmm hmmmm hm hm hum hmmmmm");
|
||||||
|
}
|
||||||
|
if (n == "GuardLazure")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Stay sharp");
|
||||||
|
this.l.Add("No ships on the horizon yet");
|
||||||
|
this.l.Add("I should visit the stonesmith");
|
||||||
|
this.l.Add("Not long 'til harvest");
|
||||||
|
this.l.Add("No news yet from the Pavura");
|
||||||
|
this.l.Add("The Renazin would be fools to attack here");
|
||||||
|
this.l.Add("Was that a bakka howl?");
|
||||||
|
this.l.Add("The forten's on edge");
|
||||||
|
this.l.Add("Too soon for news from the army");
|
||||||
|
this.l.Add("Stay vigilant");
|
||||||
|
}
|
||||||
|
if (n == "GuardRozafir")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Stay sharp");
|
||||||
|
this.l.Add("Step wide around the Dolki");
|
||||||
|
this.l.Add("This will be the best harvest yet");
|
||||||
|
this.l.Add("No news yet from Forten Lazure");
|
||||||
|
this.l.Add("The Renazin would be fools to attack us");
|
||||||
|
this.l.Add("Wish there was fresh news from Forten Lazure");
|
||||||
|
}
|
||||||
|
if (n == "RozafirStorekeep")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Fresh wares all the way from Porta Dun");
|
||||||
|
this.l.Add("A better deal you'll not find");
|
||||||
|
this.l.Add("Don't bother traveling to Din Sera, this is premium stock");
|
||||||
|
}
|
||||||
|
if (n == "RozafirNewStorekeep")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("How now, my good guard?");
|
||||||
|
}
|
||||||
|
if (n == "Resting")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("I am not myself...");
|
||||||
|
this.l.Add("So tired...");
|
||||||
|
this.l.Add("I've not the strength to rise....");
|
||||||
|
}
|
||||||
|
if (n == "BanquetFriend")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("I never though to see such madness...");
|
||||||
|
this.l.Add("Where is the Lady of Spring?");
|
||||||
|
this.l.Add("Spawn of the Bloodless, every one of them...");
|
||||||
|
this.l.Add("Where are the gods now?");
|
||||||
|
}
|
||||||
|
if (n == "BanquetSpawn")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("I will obey...");
|
||||||
|
this.l.Add("Master...my will is yours...");
|
||||||
|
this.l.Add("All will fall to him...");
|
||||||
|
}
|
||||||
|
if (n == "GuardMainC5Caravan")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Stay sharp");
|
||||||
|
this.l.Add("Keep the incense burning");
|
||||||
|
this.l.Add("Another raid would be disastrous");
|
||||||
|
this.l.Add("Did you hear somewhat?");
|
||||||
|
this.l.Add("We should not linger here");
|
||||||
|
}
|
||||||
|
if (n == "GuardC5Caravan")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Did you hear that?");
|
||||||
|
this.l.Add("I'll not drop my guard");
|
||||||
|
this.l.Add("These woods are not safe");
|
||||||
|
this.l.Add("We should stay near the camp");
|
||||||
|
this.l.Add("I do not like the look of this place");
|
||||||
|
}
|
||||||
|
if (n == "C5Camper")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("This is a dismal beach");
|
||||||
|
this.l.Add("I fear to leave this fire");
|
||||||
|
this.l.Add("I long for my bed");
|
||||||
|
this.l.Add("Our supplies run low soon");
|
||||||
|
this.l.Add("This island is cursed");
|
||||||
|
}
|
||||||
|
if (n == "LittleFairyC5_A")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("lis");
|
||||||
|
}
|
||||||
|
if (n == "LittleFairyC5_B")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("fal");
|
||||||
|
}
|
||||||
|
if (n == "LittleFairyC5_C")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("ero");
|
||||||
|
}
|
||||||
|
if (n == "LittleFairyC6_A")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("ila");
|
||||||
|
}
|
||||||
|
if (n == "LittleFairyC6_B")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("por");
|
||||||
|
}
|
||||||
|
if (n == "LittleFairyC6_C")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("vex");
|
||||||
|
}
|
||||||
|
if (n == "LittleFairyE6_A")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("sea");
|
||||||
|
}
|
||||||
|
if (n == "LittleFairyE6_B")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("mar");
|
||||||
|
}
|
||||||
|
if (n == "LittleFairyE6_C")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("fin");
|
||||||
|
}
|
||||||
|
if (n == "GuardD5")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("To arms!");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Wits sharp, blades sharper");
|
||||||
|
this.l.Add("House Dura will not falter!");
|
||||||
|
this.l.Add("What fresh predator stalks our borders?");
|
||||||
|
this.l.Add("Did you hear somewhat?");
|
||||||
|
this.l.Add("My skin fair crawls to sleep here");
|
||||||
|
}
|
||||||
|
if (n == "RobberD5")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("Intruder!");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("Did you hear that?");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("The cowards will regret their hasty attack!");
|
||||||
|
this.l.Add("We'll cut them down like the Grave Keeper!");
|
||||||
|
this.l.Add("We've not had fresh provisions for days...");
|
||||||
|
this.l.Add("Did you hear somewhat?");
|
||||||
|
this.l.Add("Rozafir's caverns are well-stocked, and poorly defended...");
|
||||||
|
}
|
||||||
|
if (n == "Minstrel")
|
||||||
|
{
|
||||||
|
quips.type = n;
|
||||||
|
quips.seen = new List<string>();
|
||||||
|
this.l = quips.seen;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.heard = new List<string>();
|
||||||
|
this.l = quips.heard;
|
||||||
|
this.l.Add("");
|
||||||
|
quips.idle = new List<string>();
|
||||||
|
this.l = quips.idle;
|
||||||
|
this.l.Add("Mmmm-tra-la-la-lo...");
|
||||||
|
this.l.Add("Do-dora-dae...");
|
||||||
|
this.l.Add("Lo-La-Li-Lo-La-Li-Le...");
|
||||||
|
}
|
||||||
|
this.quips.Add(quips);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000462 RID: 1122 RVA: 0x00065A74 File Offset: 0x00063C74
|
||||||
|
public string GetQuip(string type, int quipID)
|
||||||
|
{
|
||||||
|
this.list = null;
|
||||||
|
if (quipID == -1)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (type == "Seen")
|
||||||
|
{
|
||||||
|
this.list = this.quips[quipID].seen;
|
||||||
|
}
|
||||||
|
if (type == "Heard")
|
||||||
|
{
|
||||||
|
this.list = this.quips[quipID].heard;
|
||||||
|
}
|
||||||
|
if (type == "Taunt")
|
||||||
|
{
|
||||||
|
this.list = this.quips[quipID].taunt;
|
||||||
|
}
|
||||||
|
if (type == "Idle")
|
||||||
|
{
|
||||||
|
if (quipID == 4)
|
||||||
|
{
|
||||||
|
if (QuestLog.GetQuestState("D6_Chora") == QuestState.Complete)
|
||||||
|
{
|
||||||
|
this.list = this.quips[5].idle;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.list = this.quips[quipID].idle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.list = this.quips[quipID].idle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type == "End Search")
|
||||||
|
{
|
||||||
|
this.list = this.quips[quipID].endSearch;
|
||||||
|
}
|
||||||
|
if (type == "Scared")
|
||||||
|
{
|
||||||
|
this.list = this.quips[quipID].scared;
|
||||||
|
}
|
||||||
|
if (type == "Combat Win")
|
||||||
|
{
|
||||||
|
this.list = this.quips[quipID].combatWin;
|
||||||
|
}
|
||||||
|
if (type == "Found Item")
|
||||||
|
{
|
||||||
|
this.list = this.quips[quipID].foundItem;
|
||||||
|
}
|
||||||
|
if (type == "Equip Item")
|
||||||
|
{
|
||||||
|
this.list = this.quips[quipID].equipItem;
|
||||||
|
}
|
||||||
|
if (type == "Equip Jewelry")
|
||||||
|
{
|
||||||
|
this.list = this.quips[quipID].equipJewelry;
|
||||||
|
}
|
||||||
|
if (this.list != null && this.list.Count > 0)
|
||||||
|
{
|
||||||
|
return this.list[Random.Range(0, this.list.Count)];
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000463 RID: 1123 RVA: 0x00065C7C File Offset: 0x00063E7C
|
||||||
|
public int GetQuipIndex(string quipLine)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < this.quips.Count; i++)
|
||||||
|
{
|
||||||
|
if (quipLine == this.quips[i].type)
|
||||||
|
{
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000464 RID: 1124 RVA: 0x00065CBC File Offset: 0x00063EBC
|
||||||
|
public bool HasIdleQuip(int quipID)
|
||||||
|
{
|
||||||
|
this.list = null;
|
||||||
|
if (quipID == -1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.list = this.quips[quipID].idle;
|
||||||
|
return this.list != null && this.list.Count > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0400071C RID: 1820
|
||||||
|
private List<QuipSet.Quips> quips = new List<QuipSet.Quips>();
|
||||||
|
|
||||||
|
// Token: 0x0400071D RID: 1821
|
||||||
|
private List<string> list;
|
||||||
|
|
||||||
|
// Token: 0x0400071E RID: 1822
|
||||||
|
private List<string> l;
|
||||||
|
}
|
||||||
108
Projects/BanquetForFools/Source/Assembly-CSharp/Chest.cs
Normal file
108
Projects/BanquetForFools/Source/Assembly-CSharp/Chest.cs
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x02000060 RID: 96
|
||||||
|
public class Chest : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x0400106F RID: 4207
|
||||||
|
[Header("IF LOCKABLE")]
|
||||||
|
public bool lockable;
|
||||||
|
|
||||||
|
// Token: 0x04001070 RID: 4208
|
||||||
|
public bool locked;
|
||||||
|
|
||||||
|
// Token: 0x04001071 RID: 4209
|
||||||
|
public int lockDifficulty;
|
||||||
|
|
||||||
|
// Token: 0x04001072 RID: 4210
|
||||||
|
public int health;
|
||||||
|
|
||||||
|
// Token: 0x04001073 RID: 4211
|
||||||
|
public int armor;
|
||||||
|
|
||||||
|
// Token: 0x04001074 RID: 4212
|
||||||
|
public SceneItem.xmlNames keyItem = SceneItem.xmlNames.None;
|
||||||
|
|
||||||
|
// Token: 0x04001075 RID: 4213
|
||||||
|
public Creatures owner;
|
||||||
|
|
||||||
|
// Token: 0x04001076 RID: 4214
|
||||||
|
[Header("ALWAYS")]
|
||||||
|
public SceneItem.xmlNames item1 = SceneItem.xmlNames.None;
|
||||||
|
|
||||||
|
// Token: 0x04001077 RID: 4215
|
||||||
|
public int itemStack1 = 1;
|
||||||
|
|
||||||
|
// Token: 0x04001078 RID: 4216
|
||||||
|
public SceneItem.xmlNames item2 = SceneItem.xmlNames.None;
|
||||||
|
|
||||||
|
// Token: 0x04001079 RID: 4217
|
||||||
|
public int itemStack2 = 1;
|
||||||
|
|
||||||
|
// Token: 0x0400107A RID: 4218
|
||||||
|
public SceneItem.xmlNames item3 = SceneItem.xmlNames.None;
|
||||||
|
|
||||||
|
// Token: 0x0400107B RID: 4219
|
||||||
|
public int itemStack3 = 1;
|
||||||
|
|
||||||
|
// Token: 0x0400107C RID: 4220
|
||||||
|
public SceneItem.xmlNames item4 = SceneItem.xmlNames.None;
|
||||||
|
|
||||||
|
// Token: 0x0400107D RID: 4221
|
||||||
|
public int itemStack4 = 1;
|
||||||
|
|
||||||
|
// Token: 0x0400107E RID: 4222
|
||||||
|
public SceneItem.xmlNames item5 = SceneItem.xmlNames.None;
|
||||||
|
|
||||||
|
// Token: 0x0400107F RID: 4223
|
||||||
|
public int itemStack5 = 1;
|
||||||
|
|
||||||
|
// Token: 0x04001080 RID: 4224
|
||||||
|
public SceneItem.xmlNames item6 = SceneItem.xmlNames.None;
|
||||||
|
|
||||||
|
// Token: 0x04001081 RID: 4225
|
||||||
|
public int itemStack6 = 1;
|
||||||
|
|
||||||
|
// Token: 0x04001082 RID: 4226
|
||||||
|
public SceneItem.xmlNames item7 = SceneItem.xmlNames.None;
|
||||||
|
|
||||||
|
// Token: 0x04001083 RID: 4227
|
||||||
|
public int itemStack7 = 1;
|
||||||
|
|
||||||
|
// Token: 0x04001084 RID: 4228
|
||||||
|
public SceneItem.xmlNames item8 = SceneItem.xmlNames.None;
|
||||||
|
|
||||||
|
// Token: 0x04001085 RID: 4229
|
||||||
|
public int itemStack8 = 1;
|
||||||
|
|
||||||
|
// Token: 0x04001086 RID: 4230
|
||||||
|
public SceneItem.xmlNames item9 = SceneItem.xmlNames.None;
|
||||||
|
|
||||||
|
// Token: 0x04001087 RID: 4231
|
||||||
|
public int itemStack9 = 1;
|
||||||
|
|
||||||
|
// Token: 0x04001088 RID: 4232
|
||||||
|
public SceneItem.xmlNames item10 = SceneItem.xmlNames.None;
|
||||||
|
|
||||||
|
// Token: 0x04001089 RID: 4233
|
||||||
|
public int itemStack10 = 1;
|
||||||
|
|
||||||
|
// Token: 0x0400108A RID: 4234
|
||||||
|
[Header("EFFECT ON OPENING")]
|
||||||
|
public Chest.EffectTypes effect;
|
||||||
|
|
||||||
|
// Token: 0x0400108B RID: 4235
|
||||||
|
[Header("HOW TO BREAK IT")]
|
||||||
|
public Breakable.BreakableEffectRequired effectRequired;
|
||||||
|
|
||||||
|
// Token: 0x020001C2 RID: 450
|
||||||
|
public enum EffectTypes
|
||||||
|
{
|
||||||
|
// Token: 0x04002C14 RID: 11284
|
||||||
|
none,
|
||||||
|
// Token: 0x04002C15 RID: 11285
|
||||||
|
oil,
|
||||||
|
// Token: 0x04002C16 RID: 11286
|
||||||
|
sap
|
||||||
|
}
|
||||||
|
}
|
||||||
1009
Projects/BanquetForFools/Source/Assembly-CSharp/ChestActions.cs
Normal file
1009
Projects/BanquetForFools/Source/Assembly-CSharp/ChestActions.cs
Normal file
File diff suppressed because it is too large
Load Diff
2073
Projects/BanquetForFools/Source/Assembly-CSharp/Cinematics.cs
Normal file
2073
Projects/BanquetForFools/Source/Assembly-CSharp/Cinematics.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,87 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x02000004 RID: 4
|
||||||
|
[ExecuteInEditMode]
|
||||||
|
public class ClayShaderVariables : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x0600003B RID: 59 RVA: 0x000067E2 File Offset: 0x000049E2
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600003C RID: 60 RVA: 0x000067E4 File Offset: 0x000049E4
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
Shader.SetGlobalFloat("_xEnviro_tcp2RampThreshold", this.enviroRampThreshold);
|
||||||
|
Shader.SetGlobalFloat("_xEnviro_tcp2RampSmoothness", this.enviroRampSmoothness);
|
||||||
|
Shader.SetGlobalVector("_xEnviro_tcp2HighlightColor", this.enviroHighlightColor);
|
||||||
|
Shader.SetGlobalVector("_xEnviro_tcp2ShadowColor", this.enviroShadowColor);
|
||||||
|
Shader.SetGlobalVector("_xEnviro_rimParams", new Vector3(this.enviroRimMin, this.enviroRimMax, this.enviroRimStrength));
|
||||||
|
Shader.SetGlobalVector("_xEnviro_rimColor", this.enviroRimColor);
|
||||||
|
Shader.SetGlobalVector("_xEnviro_tcp2DirShadowColor", this.enviroDirectionalShadow);
|
||||||
|
Shader.SetGlobalFloat("_xCharacter_tcp2RampThreshold", this.characterRampThreshold);
|
||||||
|
Shader.SetGlobalFloat("_xCharacter_tcp2RampSmoothness", this.characterRampSmoothness);
|
||||||
|
Shader.SetGlobalVector("_xCharacter_tcp2HighlightColor", this.characterHighlightColor);
|
||||||
|
Shader.SetGlobalVector("_xCharactertcp2ShadowColor", this.characterShadowColor);
|
||||||
|
Shader.SetGlobalVector("_xCharacter_rimParams", new Vector3(this.characterRimMin, this.characterRimMax, this.characterRimStrength));
|
||||||
|
Shader.SetGlobalVector("_xCharacter_rimColor", this.characterRimColor);
|
||||||
|
Shader.SetGlobalVector("_xCharactertcp2DirShadowColor", this.characterDirectionalShadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x04000114 RID: 276
|
||||||
|
[Header("CHARACTER LIGHTING")]
|
||||||
|
public float characterRampThreshold = 0.5f;
|
||||||
|
|
||||||
|
// Token: 0x04000115 RID: 277
|
||||||
|
public float characterRampSmoothness = 0.1f;
|
||||||
|
|
||||||
|
// Token: 0x04000116 RID: 278
|
||||||
|
public float characterRimMin = 0.8f;
|
||||||
|
|
||||||
|
// Token: 0x04000117 RID: 279
|
||||||
|
public float characterRimMax = 0.85f;
|
||||||
|
|
||||||
|
// Token: 0x04000118 RID: 280
|
||||||
|
public float characterRimStrength = 0.5f;
|
||||||
|
|
||||||
|
// Token: 0x04000119 RID: 281
|
||||||
|
public Color characterRimColor = Color.white;
|
||||||
|
|
||||||
|
// Token: 0x0400011A RID: 282
|
||||||
|
public Color characterHighlightColor = Color.white;
|
||||||
|
|
||||||
|
// Token: 0x0400011B RID: 283
|
||||||
|
public Color characterShadowColor = Color.gray;
|
||||||
|
|
||||||
|
// Token: 0x0400011C RID: 284
|
||||||
|
public Color characterDirectionalShadow = Color.black;
|
||||||
|
|
||||||
|
// Token: 0x0400011D RID: 285
|
||||||
|
[Header("ENVIRONMENT LIGHTING")]
|
||||||
|
public float enviroRampThreshold = 0.5f;
|
||||||
|
|
||||||
|
// Token: 0x0400011E RID: 286
|
||||||
|
public float enviroRampSmoothness = 0.1f;
|
||||||
|
|
||||||
|
// Token: 0x0400011F RID: 287
|
||||||
|
public float enviroRimMin = 0.8f;
|
||||||
|
|
||||||
|
// Token: 0x04000120 RID: 288
|
||||||
|
public float enviroRimMax = 0.85f;
|
||||||
|
|
||||||
|
// Token: 0x04000121 RID: 289
|
||||||
|
public float enviroRimStrength = 0.5f;
|
||||||
|
|
||||||
|
// Token: 0x04000122 RID: 290
|
||||||
|
public Color enviroRimColor = Color.white;
|
||||||
|
|
||||||
|
// Token: 0x04000123 RID: 291
|
||||||
|
public Color enviroHighlightColor = Color.white;
|
||||||
|
|
||||||
|
// Token: 0x04000124 RID: 292
|
||||||
|
public Color enviroShadowColor = Color.gray;
|
||||||
|
|
||||||
|
// Token: 0x04000125 RID: 293
|
||||||
|
public Color enviroDirectionalShadow = Color.black;
|
||||||
|
}
|
||||||
190
Projects/BanquetForFools/Source/Assembly-CSharp/CleanIK.cs
Normal file
190
Projects/BanquetForFools/Source/Assembly-CSharp/CleanIK.cs
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x0200001E RID: 30
|
||||||
|
[RequireComponent(typeof(Animator))]
|
||||||
|
public class CleanIK : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000479 RID: 1145 RVA: 0x00066E5D File Offset: 0x0006505D
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
this.animator = base.GetComponent<Animator>();
|
||||||
|
this.layerMask = 4194433;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600047A RID: 1146 RVA: 0x00066E76 File Offset: 0x00065076
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
this.handleColliderOffset();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600047B RID: 1147 RVA: 0x00066E80 File Offset: 0x00065080
|
||||||
|
private void OnAnimatorIK()
|
||||||
|
{
|
||||||
|
if (this.animator && this.ikActive)
|
||||||
|
{
|
||||||
|
if (this.LeftFoot != null)
|
||||||
|
{
|
||||||
|
this.solveIK(this.LeftFoot, true);
|
||||||
|
}
|
||||||
|
if (this.RightFoot != null)
|
||||||
|
{
|
||||||
|
this.solveIK(this.RightFoot, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600047C RID: 1148 RVA: 0x00066ED8 File Offset: 0x000650D8
|
||||||
|
private void solveIK(Transform foot, bool left)
|
||||||
|
{
|
||||||
|
string name = foot.name;
|
||||||
|
RaycastHit raycastHit = default(RaycastHit);
|
||||||
|
Vector3 vector = default(Vector3);
|
||||||
|
Quaternion quaternion = Quaternion.identity;
|
||||||
|
if (Physics.Linecast(this.checkOrigin(foot.position), this.checkTarget(foot.position), out raycastHit, this.layerMask))
|
||||||
|
{
|
||||||
|
vector = this.footPosition(raycastHit);
|
||||||
|
quaternion = this.footRotation(foot, raycastHit);
|
||||||
|
if (left)
|
||||||
|
{
|
||||||
|
this.animator.SetIKPositionWeight(AvatarIKGoal.LeftFoot, 1f);
|
||||||
|
this.animator.SetIKPosition(AvatarIKGoal.LeftFoot, vector);
|
||||||
|
this.LeftFootY = vector.y;
|
||||||
|
if (this.rotation)
|
||||||
|
{
|
||||||
|
this.animator.SetIKRotationWeight(AvatarIKGoal.LeftFoot, 1f);
|
||||||
|
this.animator.SetIKRotation(AvatarIKGoal.LeftFoot, quaternion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!left)
|
||||||
|
{
|
||||||
|
this.animator.SetIKPositionWeight(AvatarIKGoal.RightFoot, 1f);
|
||||||
|
this.animator.SetIKPosition(AvatarIKGoal.RightFoot, vector);
|
||||||
|
this.RightFootY = vector.y;
|
||||||
|
if (this.rotation)
|
||||||
|
{
|
||||||
|
this.animator.SetIKRotationWeight(AvatarIKGoal.RightFoot, 1f);
|
||||||
|
this.animator.SetIKRotation(AvatarIKGoal.RightFoot, quaternion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600047D RID: 1149 RVA: 0x00066FE4 File Offset: 0x000651E4
|
||||||
|
private void handleColliderOffset()
|
||||||
|
{
|
||||||
|
this.stateBasedLegDistance();
|
||||||
|
if (!this.controller)
|
||||||
|
{
|
||||||
|
this.controller = base.gameObject.transform.parent.GetComponent<CharacterController>();
|
||||||
|
if (this.controller)
|
||||||
|
{
|
||||||
|
this.colliderHeight = this.controller.height;
|
||||||
|
this.controllerBoundsBottom = this.controller.bounds.extents.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.controller)
|
||||||
|
{
|
||||||
|
if (this.planeSpeed(ref this.controller) < 0.1f)
|
||||||
|
{
|
||||||
|
float num = Mathf.Abs(this.LeftFootY - this.RightFootY);
|
||||||
|
this.controller.height = this.colliderHeight - num * this.deltaAmplifier;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.controller.height = this.colliderHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600047E RID: 1150 RVA: 0x000670BA File Offset: 0x000652BA
|
||||||
|
private void stateBasedLegDistance()
|
||||||
|
{
|
||||||
|
if (this.controller)
|
||||||
|
{
|
||||||
|
this.legDistance = 1f / (this.planeSpeed(ref this.controller) + 0.8f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600047F RID: 1151 RVA: 0x000670E8 File Offset: 0x000652E8
|
||||||
|
private float planeSpeed(ref CharacterController characterController)
|
||||||
|
{
|
||||||
|
Vector3 vector = new Vector3(characterController.velocity.x, 0f, characterController.velocity.z);
|
||||||
|
return vector.magnitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000480 RID: 1152 RVA: 0x00067120 File Offset: 0x00065320
|
||||||
|
private Quaternion footRotation(Transform foot, RaycastHit hit)
|
||||||
|
{
|
||||||
|
return Quaternion.LookRotation(Vector3.ProjectOnPlane(base.transform.forward, hit.normal), hit.normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000481 RID: 1153 RVA: 0x00067148 File Offset: 0x00065348
|
||||||
|
private Vector3 footPosition(RaycastHit hit)
|
||||||
|
{
|
||||||
|
Vector3 point = hit.point;
|
||||||
|
point.y += this.footOffset;
|
||||||
|
return point;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000482 RID: 1154 RVA: 0x0006716F File Offset: 0x0006536F
|
||||||
|
private Vector3 checkOrigin(Vector3 footPosition)
|
||||||
|
{
|
||||||
|
return footPosition + (this.legDistance + 0.25f) * Vector3.up;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000483 RID: 1155 RVA: 0x0006718D File Offset: 0x0006538D
|
||||||
|
private Vector3 checkTarget(Vector3 footPosition)
|
||||||
|
{
|
||||||
|
return footPosition - this.legDistance / 2f * Vector3.up;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0400073E RID: 1854
|
||||||
|
protected Animator animator;
|
||||||
|
|
||||||
|
// Token: 0x0400073F RID: 1855
|
||||||
|
public bool ikActive;
|
||||||
|
|
||||||
|
// Token: 0x04000740 RID: 1856
|
||||||
|
public bool rotation = true;
|
||||||
|
|
||||||
|
// Token: 0x04000741 RID: 1857
|
||||||
|
public bool showMarkers;
|
||||||
|
|
||||||
|
// Token: 0x04000742 RID: 1858
|
||||||
|
public Transform LeftFoot;
|
||||||
|
|
||||||
|
// Token: 0x04000743 RID: 1859
|
||||||
|
public Transform RightFoot;
|
||||||
|
|
||||||
|
// Token: 0x04000744 RID: 1860
|
||||||
|
public float footOffset;
|
||||||
|
|
||||||
|
// Token: 0x04000745 RID: 1861
|
||||||
|
private float legDistance;
|
||||||
|
|
||||||
|
// Token: 0x04000746 RID: 1862
|
||||||
|
private int layerMask = 256;
|
||||||
|
|
||||||
|
// Token: 0x04000747 RID: 1863
|
||||||
|
private CharacterController controller;
|
||||||
|
|
||||||
|
// Token: 0x04000748 RID: 1864
|
||||||
|
private float colliderHeight;
|
||||||
|
|
||||||
|
// Token: 0x04000749 RID: 1865
|
||||||
|
private float controllerBoundsBottom;
|
||||||
|
|
||||||
|
// Token: 0x0400074A RID: 1866
|
||||||
|
private float LeftFootY;
|
||||||
|
|
||||||
|
// Token: 0x0400074B RID: 1867
|
||||||
|
private float RightFootY;
|
||||||
|
|
||||||
|
// Token: 0x0400074C RID: 1868
|
||||||
|
public float smooth = 10f;
|
||||||
|
|
||||||
|
// Token: 0x0400074D RID: 1869
|
||||||
|
public float deltaAmplifier = 1f;
|
||||||
|
|
||||||
|
// Token: 0x0400074E RID: 1870
|
||||||
|
private Rigidbody rbody;
|
||||||
|
}
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x0200001F RID: 31
|
||||||
|
public class CollectCharacters : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000485 RID: 1157 RVA: 0x000671DB File Offset: 0x000653DB
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
Links.x.characterCollector = this;
|
||||||
|
this.tr = base.transform;
|
||||||
|
base.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000486 RID: 1158 RVA: 0x00067200 File Offset: 0x00065400
|
||||||
|
public void SetSpherePosition(Vector3 pos)
|
||||||
|
{
|
||||||
|
this.tr.position = pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000487 RID: 1159 RVA: 0x00067210 File Offset: 0x00065410
|
||||||
|
private void OnTriggerEnter(Collider other)
|
||||||
|
{
|
||||||
|
GameObject gameObject = other.gameObject;
|
||||||
|
this.AddCharacter(gameObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000488 RID: 1160 RVA: 0x0006722B File Offset: 0x0006542B
|
||||||
|
public void AddCharacter(GameObject go)
|
||||||
|
{
|
||||||
|
if (this.charactersGo.IndexOf(go) == -1)
|
||||||
|
{
|
||||||
|
this.toAdd.Add(go);
|
||||||
|
this.changingCharacters = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000489 RID: 1161 RVA: 0x0006724F File Offset: 0x0006544F
|
||||||
|
public void SwitchBlock()
|
||||||
|
{
|
||||||
|
this.charactersGo.Clear();
|
||||||
|
this.characters.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600048A RID: 1162 RVA: 0x00067268 File Offset: 0x00065468
|
||||||
|
public void LateAddCharacter()
|
||||||
|
{
|
||||||
|
foreach (GameObject gameObject in this.toAdd)
|
||||||
|
{
|
||||||
|
if (gameObject)
|
||||||
|
{
|
||||||
|
this.charactersGo.Add(gameObject);
|
||||||
|
this.characters.Add(gameObject.GetComponent<Character>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.toAdd.Clear();
|
||||||
|
this.UpdateCharacterNumbers();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600048B RID: 1163 RVA: 0x000672EC File Offset: 0x000654EC
|
||||||
|
public void LateRemoveCharacter()
|
||||||
|
{
|
||||||
|
int count = this.characters.Count;
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
if (!this.characters[i])
|
||||||
|
{
|
||||||
|
this.toRemove.Add(null);
|
||||||
|
}
|
||||||
|
else if (this.characters[i].inactive)
|
||||||
|
{
|
||||||
|
this.toRemove.Add(this.charactersGo[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (GameObject gameObject in this.toRemove)
|
||||||
|
{
|
||||||
|
int num = this.charactersGo.IndexOf(gameObject);
|
||||||
|
if (num > -1)
|
||||||
|
{
|
||||||
|
this.charactersGo.RemoveAt(num);
|
||||||
|
if (this.characters[num])
|
||||||
|
{
|
||||||
|
this.characters[num].body.SetMask(false);
|
||||||
|
}
|
||||||
|
this.characters.RemoveAt(num);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.toRemove.Clear();
|
||||||
|
this.UpdateCharacterNumbers();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600048C RID: 1164 RVA: 0x00067408 File Offset: 0x00065608
|
||||||
|
public void RemoveCharacter(GameObject go)
|
||||||
|
{
|
||||||
|
if (this.charactersGo.IndexOf(go) > -1)
|
||||||
|
{
|
||||||
|
this.toRemove.Add(go);
|
||||||
|
this.changingCharacters = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600048D RID: 1165 RVA: 0x0006742C File Offset: 0x0006562C
|
||||||
|
public void UpdateCharacterNumbers()
|
||||||
|
{
|
||||||
|
int count = this.characters.Count;
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
if (this.characters[i] && this.characters[i].body)
|
||||||
|
{
|
||||||
|
this.characters[i].body.SetMaskNumber(((float)i + 2f) * 1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600048E RID: 1166 RVA: 0x000674A0 File Offset: 0x000656A0
|
||||||
|
private void OnTriggerExit(Collider other)
|
||||||
|
{
|
||||||
|
GameObject gameObject = other.gameObject;
|
||||||
|
this.RemoveCharacter(gameObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0400074F RID: 1871
|
||||||
|
public List<Character> characters = new List<Character>();
|
||||||
|
|
||||||
|
// Token: 0x04000750 RID: 1872
|
||||||
|
public List<GameObject> charactersGo = new List<GameObject>();
|
||||||
|
|
||||||
|
// Token: 0x04000751 RID: 1873
|
||||||
|
private List<GameObject> toRemove = new List<GameObject>();
|
||||||
|
|
||||||
|
// Token: 0x04000752 RID: 1874
|
||||||
|
private List<GameObject> toAdd = new List<GameObject>();
|
||||||
|
|
||||||
|
// Token: 0x04000753 RID: 1875
|
||||||
|
public Transform tr;
|
||||||
|
|
||||||
|
// Token: 0x04000754 RID: 1876
|
||||||
|
public bool changingCharacters;
|
||||||
|
}
|
||||||
@@ -0,0 +1,251 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using DarkTonic.MasterAudio;
|
||||||
|
using Pathfinding;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x02000020 RID: 32
|
||||||
|
public class CollisionListener : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000490 RID: 1168 RVA: 0x000674F0 File Offset: 0x000656F0
|
||||||
|
public void StartLisening(string t)
|
||||||
|
{
|
||||||
|
if (this.turnOff != null)
|
||||||
|
{
|
||||||
|
this.EndNow();
|
||||||
|
base.StopCoroutine(this.turnOff);
|
||||||
|
this.turnOff = null;
|
||||||
|
}
|
||||||
|
this.type = t;
|
||||||
|
base.transform.rotation = Quaternion.identity;
|
||||||
|
this.rbody.isKinematic = false;
|
||||||
|
this.timeSinceCollision = 0f;
|
||||||
|
this.bounced = 0;
|
||||||
|
this.listen = true;
|
||||||
|
this.tr = base.transform;
|
||||||
|
this.dynamicCollide = false;
|
||||||
|
this.underground = false;
|
||||||
|
if (this.c)
|
||||||
|
{
|
||||||
|
this.safePosition = this.c.tr.position;
|
||||||
|
this.startPoint = this.c.tr.position;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000491 RID: 1169 RVA: 0x000675B0 File Offset: 0x000657B0
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
RaycastHit raycastHit;
|
||||||
|
if (this.listen && !this.rbody.isKinematic && !this.dynamicCollide && this.c && Physics.Raycast(this.tr.position + new Vector3(0f, 30f, 0f), Vector3.up * -1f, out raycastHit, 200f, 4194305))
|
||||||
|
{
|
||||||
|
if (this.tr.position.y < raycastHit.point.y)
|
||||||
|
{
|
||||||
|
this.safePosition = raycastHit.point;
|
||||||
|
this.underground = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.dynamicCollide)
|
||||||
|
{
|
||||||
|
Vector3 position = this.tr.position;
|
||||||
|
bool flag = Physics.Linecast(position + new Vector3(0f, 20f, 0f), raycastHit.point, 144);
|
||||||
|
bool flag2 = false;
|
||||||
|
if (!flag)
|
||||||
|
{
|
||||||
|
flag2 = Physics.Raycast(position + new Vector3(0f, 400f, 0f), Vector3.up * -1f, 1000f, 768);
|
||||||
|
}
|
||||||
|
RaycastHit raycastHit2;
|
||||||
|
if ((flag || flag2) && !this.dynamicCollide && Physics.SphereCast(this.c.tr.position + new Vector3(0f, 20f, 0f), 1.25f, Vector3.up * -1f, out raycastHit2, 200f, 4194305))
|
||||||
|
{
|
||||||
|
if (this.c.node != null)
|
||||||
|
{
|
||||||
|
this.c.setArea = (int)this.c.node.Area;
|
||||||
|
}
|
||||||
|
GraphNode graphNode = this.c.NearNode(raycastHit2.point, false, 0, -1, 0);
|
||||||
|
if (graphNode != null)
|
||||||
|
{
|
||||||
|
this.safePosition = (Vector3)graphNode.position;
|
||||||
|
this.c.ClaimNode(graphNode, this.safePosition, false);
|
||||||
|
}
|
||||||
|
else if (this.c.node != null)
|
||||||
|
{
|
||||||
|
this.safePosition = (Vector3)graphNode.position;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.safePosition = this.startPoint;
|
||||||
|
}
|
||||||
|
this.dynamicCollide = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000492 RID: 1170 RVA: 0x000677F4 File Offset: 0x000659F4
|
||||||
|
private void FixedUpdate()
|
||||||
|
{
|
||||||
|
if (this.listen && !this.rbody.isKinematic)
|
||||||
|
{
|
||||||
|
if (this.body)
|
||||||
|
{
|
||||||
|
this.body.tr.position = this.tr.position - new Vector3(0f, 0.2f, 0f);
|
||||||
|
}
|
||||||
|
if (this.c)
|
||||||
|
{
|
||||||
|
if (!this.c.jumpingPosition && !this.c.jumpingAreas)
|
||||||
|
{
|
||||||
|
if (this.underground)
|
||||||
|
{
|
||||||
|
if (Mathf.Abs(this.tr.position.y - this.safePosition.y) > 0.5f)
|
||||||
|
{
|
||||||
|
Vector3 vector = Vector3.Lerp(this.c.tr.position, this.safePosition, Time.fixedDeltaTime * 5f);
|
||||||
|
this.c.SetPosition(vector, null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (this.dynamicCollide)
|
||||||
|
{
|
||||||
|
Vector3 vector2 = Vector3.Lerp(this.c.tr.position, this.safePosition, Time.fixedDeltaTime * 7f);
|
||||||
|
this.c.SetPosition(vector2, null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.c.SetPosition(this.tr.position - new Vector3(0f, 0.4f, 0f), null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000493 RID: 1171 RVA: 0x0006796C File Offset: 0x00065B6C
|
||||||
|
private void OnCollisionEnter(Collision collision)
|
||||||
|
{
|
||||||
|
if ((collision.gameObject.layer == 0 || collision.gameObject.layer == 22) && this.type == "Hit" && (Time.timeSinceLevelLoad > this.timeSinceCollision + 0.1f || this.timeSinceCollision == 0f))
|
||||||
|
{
|
||||||
|
if (this.bounced < 2)
|
||||||
|
{
|
||||||
|
this.HitFX();
|
||||||
|
}
|
||||||
|
this.timeSinceCollision = Time.timeSinceLevelLoad;
|
||||||
|
this.bounced++;
|
||||||
|
if (this.bounced >= this.bounceMax)
|
||||||
|
{
|
||||||
|
this.rbody.isKinematic = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000494 RID: 1172 RVA: 0x00067A0C File Offset: 0x00065C0C
|
||||||
|
private void HitFX()
|
||||||
|
{
|
||||||
|
MasterAudio.PlaySound3DAtVector3AndForget("Body Fall", base.gameObject.transform.position, Random.Range(0.5f, 0.6f), new float?(Random.Range(0.95f, 1f)), 0f, "", null);
|
||||||
|
if (this.c && !this.c.dead)
|
||||||
|
{
|
||||||
|
GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(129);
|
||||||
|
RaycastHit raycastHit;
|
||||||
|
if (Physics.Raycast(this.c.tr.position + new Vector3(0f, 3f, 0f), Vector3.up * -1f, out raycastHit, 10f, 4194305))
|
||||||
|
{
|
||||||
|
pooledGameObject.transform.rotation = Quaternion.Euler(Quaternion.FromToRotation(Vector3.up, raycastHit.normal).eulerAngles);
|
||||||
|
}
|
||||||
|
pooledGameObject.transform.position = this.c.tr.position + new Vector3(0f, 0.1f, 0f);
|
||||||
|
pooledGameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000495 RID: 1173 RVA: 0x00067B4E File Offset: 0x00065D4E
|
||||||
|
public void End()
|
||||||
|
{
|
||||||
|
this.listen = false;
|
||||||
|
this.turnOff = this.Ending();
|
||||||
|
if (!base.gameObject.activeSelf)
|
||||||
|
{
|
||||||
|
base.gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
base.StartCoroutine(this.turnOff);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000496 RID: 1174 RVA: 0x00067B89 File Offset: 0x00065D89
|
||||||
|
public void TurnOff()
|
||||||
|
{
|
||||||
|
this.HitFX();
|
||||||
|
base.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000497 RID: 1175 RVA: 0x00067B9D File Offset: 0x00065D9D
|
||||||
|
public void EndNow()
|
||||||
|
{
|
||||||
|
this.ReturnObjs();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000498 RID: 1176 RVA: 0x00067BA5 File Offset: 0x00065DA5
|
||||||
|
private IEnumerator Ending()
|
||||||
|
{
|
||||||
|
this.rbody.isKinematic = true;
|
||||||
|
yield return new WaitForSeconds(1f);
|
||||||
|
this.ReturnObjs();
|
||||||
|
base.gameObject.SetActive(false);
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000499 RID: 1177 RVA: 0x00067BB4 File Offset: 0x00065DB4
|
||||||
|
private void ReturnObjs()
|
||||||
|
{
|
||||||
|
if (this.pooledObject)
|
||||||
|
{
|
||||||
|
Links.x.cellar.ReturnPooledGameObject(this.pooledNumber, this.pooledObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x04000755 RID: 1877
|
||||||
|
public string type;
|
||||||
|
|
||||||
|
// Token: 0x04000756 RID: 1878
|
||||||
|
private IEnumerator turnOff;
|
||||||
|
|
||||||
|
// Token: 0x04000757 RID: 1879
|
||||||
|
private GameObject pooledObject;
|
||||||
|
|
||||||
|
// Token: 0x04000758 RID: 1880
|
||||||
|
private int pooledNumber;
|
||||||
|
|
||||||
|
// Token: 0x04000759 RID: 1881
|
||||||
|
public Rigidbody rbody;
|
||||||
|
|
||||||
|
// Token: 0x0400075A RID: 1882
|
||||||
|
private float timeSinceCollision;
|
||||||
|
|
||||||
|
// Token: 0x0400075B RID: 1883
|
||||||
|
public Character c;
|
||||||
|
|
||||||
|
// Token: 0x0400075C RID: 1884
|
||||||
|
public int bounceMax = 3;
|
||||||
|
|
||||||
|
// Token: 0x0400075D RID: 1885
|
||||||
|
private int bounced;
|
||||||
|
|
||||||
|
// Token: 0x0400075E RID: 1886
|
||||||
|
public bool listen;
|
||||||
|
|
||||||
|
// Token: 0x0400075F RID: 1887
|
||||||
|
private Transform tr;
|
||||||
|
|
||||||
|
// Token: 0x04000760 RID: 1888
|
||||||
|
public Body body;
|
||||||
|
|
||||||
|
// Token: 0x04000761 RID: 1889
|
||||||
|
private Vector3 safePosition;
|
||||||
|
|
||||||
|
// Token: 0x04000762 RID: 1890
|
||||||
|
private bool dynamicCollide;
|
||||||
|
|
||||||
|
// Token: 0x04000763 RID: 1891
|
||||||
|
private bool underground;
|
||||||
|
|
||||||
|
// Token: 0x04000764 RID: 1892
|
||||||
|
private Vector3 startPoint;
|
||||||
|
}
|
||||||
4960
Projects/BanquetForFools/Source/Assembly-CSharp/Combat.cs
Normal file
4960
Projects/BanquetForFools/Source/Assembly-CSharp/Combat.cs
Normal file
File diff suppressed because it is too large
Load Diff
140
Projects/BanquetForFools/Source/Assembly-CSharp/CompanionDrop.cs
Normal file
140
Projects/BanquetForFools/Source/Assembly-CSharp/CompanionDrop.cs
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
// Token: 0x0200009B RID: 155
|
||||||
|
public class CompanionDrop : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler
|
||||||
|
{
|
||||||
|
// Token: 0x06000E8B RID: 3723 RVA: 0x001160F3 File Offset: 0x001142F3
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E8C RID: 3724 RVA: 0x001160F5 File Offset: 0x001142F5
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
this.EndDrag();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E8D RID: 3725 RVA: 0x001160FD File Offset: 0x001142FD
|
||||||
|
public void StartDrag()
|
||||||
|
{
|
||||||
|
this.SetButton(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E8E RID: 3726 RVA: 0x00116106 File Offset: 0x00114306
|
||||||
|
public void EndDrag()
|
||||||
|
{
|
||||||
|
this.SetButton(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E8F RID: 3727 RVA: 0x00116110 File Offset: 0x00114310
|
||||||
|
public void SetButton(bool state)
|
||||||
|
{
|
||||||
|
new Color(0.6039216f, 0.4745098f, 0.4745098f, 0f);
|
||||||
|
this.btn.interactable = state;
|
||||||
|
this.img.raycastTarget = state;
|
||||||
|
if (state)
|
||||||
|
{
|
||||||
|
Color color = this.highlight;
|
||||||
|
ColorBlock colors = this.btn.colors;
|
||||||
|
colors.normalColor = color;
|
||||||
|
colors.selectedColor = color * 1.5f;
|
||||||
|
colors.highlightedColor = color * 1.5f;
|
||||||
|
if (!Links.x.formation.dragging)
|
||||||
|
{
|
||||||
|
Links.x.formation.ToggleHighlight(this.label1, true);
|
||||||
|
Links.x.formation.ToggleHighlight(this.label2, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ColorBlock colors2 = this.btn.colors;
|
||||||
|
colors2.normalColor = this.normal;
|
||||||
|
colors2.highlightedColor = this.normal;
|
||||||
|
colors2.selectedColor = this.normal;
|
||||||
|
if (Links.x.formation.hoverBox != this)
|
||||||
|
{
|
||||||
|
Links.x.formation.ToggleHighlight(this.label1, false);
|
||||||
|
Links.x.formation.ToggleHighlight(this.label2, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E90 RID: 3728 RVA: 0x0011624B File Offset: 0x0011444B
|
||||||
|
public void ToggleHighlight(bool state)
|
||||||
|
{
|
||||||
|
Links.x.formation.ToggleHighlight(this.label1, state);
|
||||||
|
Links.x.formation.ToggleHighlight(this.label2, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E91 RID: 3729 RVA: 0x0011627C File Offset: 0x0011447C
|
||||||
|
public void OnPointerEnter(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
if (Links.x.formation)
|
||||||
|
{
|
||||||
|
Links.x.formation.canDrop = true;
|
||||||
|
Links.x.formation.hoverBox = this;
|
||||||
|
if (Links.x.formation.dragging)
|
||||||
|
{
|
||||||
|
Links.x.formation.GetDescription(null, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.ToggleHighlight(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E92 RID: 3730 RVA: 0x001162E4 File Offset: 0x001144E4
|
||||||
|
public void OnPointerExit(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
if (Links.x.formation)
|
||||||
|
{
|
||||||
|
Links.x.formation.canDrop = false;
|
||||||
|
Links.x.formation.hoverBox = null;
|
||||||
|
if (!Links.x.joy)
|
||||||
|
{
|
||||||
|
if (!Links.x.formation.selectedCharacter)
|
||||||
|
{
|
||||||
|
Links.x.formation.formationDescription = Links.x.formation.defaultText;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Links.x.formation.GetDescription(null, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.ToggleHighlight(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E93 RID: 3731 RVA: 0x0011637C File Offset: 0x0011457C
|
||||||
|
public void OnPointerUp(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E94 RID: 3732 RVA: 0x0011637E File Offset: 0x0011457E
|
||||||
|
public void OnPointerDown(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x04001710 RID: 5904
|
||||||
|
public Button btn;
|
||||||
|
|
||||||
|
// Token: 0x04001711 RID: 5905
|
||||||
|
public int dropNum;
|
||||||
|
|
||||||
|
// Token: 0x04001712 RID: 5906
|
||||||
|
public Image img;
|
||||||
|
|
||||||
|
// Token: 0x04001713 RID: 5907
|
||||||
|
public Color highlight;
|
||||||
|
|
||||||
|
// Token: 0x04001714 RID: 5908
|
||||||
|
public Color normal;
|
||||||
|
|
||||||
|
// Token: 0x04001715 RID: 5909
|
||||||
|
public string label1;
|
||||||
|
|
||||||
|
// Token: 0x04001716 RID: 5910
|
||||||
|
public string label2;
|
||||||
|
}
|
||||||
651
Projects/BanquetForFools/Source/Assembly-CSharp/CompanionIcon.cs
Normal file
651
Projects/BanquetForFools/Source/Assembly-CSharp/CompanionIcon.cs
Normal file
@@ -0,0 +1,651 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
// Token: 0x0200009C RID: 156
|
||||||
|
public class CompanionIcon : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler
|
||||||
|
{
|
||||||
|
// Token: 0x06000E96 RID: 3734 RVA: 0x00116388 File Offset: 0x00114588
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
this.normal = this.btn.colors.normalColor;
|
||||||
|
this.useItemTr = this.useItemsRT.gameObject.transform;
|
||||||
|
this.autoCastTr = this.autoCastRT.gameObject.transform;
|
||||||
|
this.leaderTr = this.leaderRT.gameObject.transform;
|
||||||
|
this.useItemOffset = this.rt.anchoredPosition3D - this.useItemsRT.anchoredPosition3D;
|
||||||
|
this.autoCastOffset = this.rt.anchoredPosition3D - this.autoCastRT.anchoredPosition3D;
|
||||||
|
this.leaderOffset = this.rt.anchoredPosition3D - this.leaderRT.anchoredPosition3D;
|
||||||
|
this.useItems.gameObject.SetActive(false);
|
||||||
|
this.autoCast.gameObject.SetActive(false);
|
||||||
|
this.leader.gameObject.SetActive(false);
|
||||||
|
this.useItemsJoy.gameObject.SetActive(false);
|
||||||
|
this.autoCastJoy.gameObject.SetActive(false);
|
||||||
|
this.leaderJoy.gameObject.SetActive(false);
|
||||||
|
if (this.selected)
|
||||||
|
{
|
||||||
|
this.selected.enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E97 RID: 3735 RVA: 0x001164D4 File Offset: 0x001146D4
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
if (this.selected)
|
||||||
|
{
|
||||||
|
this.selected.enabled = false;
|
||||||
|
}
|
||||||
|
if (!this.tr)
|
||||||
|
{
|
||||||
|
this.tr = base.transform;
|
||||||
|
}
|
||||||
|
this.allCompanionIcons = Links.x.formation.companionIcons;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E98 RID: 3736 RVA: 0x00116528 File Offset: 0x00114728
|
||||||
|
public void TurnOff()
|
||||||
|
{
|
||||||
|
this.character = null;
|
||||||
|
this.leader.gameObject.SetActive(false);
|
||||||
|
this.leaderJoy.isOn = false;
|
||||||
|
this.leaderJoy.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E99 RID: 3737 RVA: 0x00116560 File Offset: 0x00114760
|
||||||
|
public void Setup(Character newCharacter)
|
||||||
|
{
|
||||||
|
if (this.selected)
|
||||||
|
{
|
||||||
|
this.selected.enabled = false;
|
||||||
|
}
|
||||||
|
this.character = newCharacter;
|
||||||
|
this.dragging = false;
|
||||||
|
Links.x.renderPortraits.AddCharacter(this.character, this.character.stats.xmlName, null, true, null, null, null, this);
|
||||||
|
this.updateTime = Time.realtimeSinceStartup;
|
||||||
|
this.useItems.isOn = false;
|
||||||
|
this.autoCast.isOn = false;
|
||||||
|
this.useItems.interactable = true;
|
||||||
|
this.autoCast.interactable = true;
|
||||||
|
this.useItems.targetGraphic.raycastTarget = true;
|
||||||
|
this.autoCast.targetGraphic.raycastTarget = true;
|
||||||
|
this.useItems.graphic.raycastTarget = true;
|
||||||
|
this.autoCast.graphic.raycastTarget = true;
|
||||||
|
this.useItemsJoy.isOn = this.useItems.isOn;
|
||||||
|
this.autoCastJoy.isOn = this.autoCast.isOn;
|
||||||
|
this.leaderJoy.isOn = this.leader.isOn;
|
||||||
|
if (!this.leader.isOn)
|
||||||
|
{
|
||||||
|
this.leaderJoy.interactable = false;
|
||||||
|
}
|
||||||
|
this.CheckLeader();
|
||||||
|
if (Links.x.mk)
|
||||||
|
{
|
||||||
|
this.useItems.gameObject.SetActive(false);
|
||||||
|
this.autoCast.gameObject.SetActive(true);
|
||||||
|
this.leader.gameObject.SetActive(true);
|
||||||
|
this.useItemsJoy.gameObject.SetActive(false);
|
||||||
|
this.autoCastJoy.gameObject.SetActive(false);
|
||||||
|
this.leaderJoy.gameObject.SetActive(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.useItems.gameObject.SetActive(false);
|
||||||
|
this.autoCast.gameObject.SetActive(false);
|
||||||
|
this.leader.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E9A RID: 3738 RVA: 0x00116748 File Offset: 0x00114948
|
||||||
|
public void CheckLeader()
|
||||||
|
{
|
||||||
|
if (this.character)
|
||||||
|
{
|
||||||
|
if (Links.x.formation.SharingFormationGroup(this.character))
|
||||||
|
{
|
||||||
|
if (this.character.stats.isLeader)
|
||||||
|
{
|
||||||
|
this.leader.interactable = true;
|
||||||
|
this.leader.targetGraphic.raycastTarget = true;
|
||||||
|
this.leader.graphic.raycastTarget = true;
|
||||||
|
this.leader.isOn = true;
|
||||||
|
this.leader.gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
else if (this.character.stats.defendMainInCombat)
|
||||||
|
{
|
||||||
|
this.leader.gameObject.SetActive(true);
|
||||||
|
this.leader.interactable = true;
|
||||||
|
this.leader.targetGraphic.raycastTarget = true;
|
||||||
|
this.leader.graphic.raycastTarget = true;
|
||||||
|
this.leader.isOn = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.leader.isOn = false;
|
||||||
|
this.leader.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.leader.gameObject.SetActive(false);
|
||||||
|
this.leaderJoy.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
if (Links.x.joy)
|
||||||
|
{
|
||||||
|
this.leaderJoy.isOn = this.leader.isOn;
|
||||||
|
this.leaderJoy.interactable = this.leader.interactable;
|
||||||
|
this.leader.interactable = false;
|
||||||
|
if (base.gameObject == Links.x.gameplay.currentEventObject && this.character.stats.defendMainInCombat)
|
||||||
|
{
|
||||||
|
this.leaderJoy.gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E9B RID: 3739 RVA: 0x00116904 File Offset: 0x00114B04
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (Links.x.joy)
|
||||||
|
{
|
||||||
|
if (base.gameObject == Links.x.gameplay.currentEventObject)
|
||||||
|
{
|
||||||
|
if (!this.hovering)
|
||||||
|
{
|
||||||
|
this.OnPointerEnter(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (this.hovering && !this.dragging)
|
||||||
|
{
|
||||||
|
this.OnPointerExit(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Time.realtimeSinceStartup > this.updateTime + 0.15f)
|
||||||
|
{
|
||||||
|
this.updateTime = Time.realtimeSinceStartup;
|
||||||
|
this.companionPortrait.texture = this.texturesIdle;
|
||||||
|
}
|
||||||
|
if (Links.x.mk && (this.hovering || this.dragging))
|
||||||
|
{
|
||||||
|
if (Input.GetMouseButtonDown(0))
|
||||||
|
{
|
||||||
|
this.OnPointerDown(null);
|
||||||
|
}
|
||||||
|
if (Input.GetMouseButtonUp(0))
|
||||||
|
{
|
||||||
|
this.OnPointerUp(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.dragging)
|
||||||
|
{
|
||||||
|
if (Links.x.mk)
|
||||||
|
{
|
||||||
|
this.tr.position = Links.x.menuCamera.ScreenToWorldPoint(Input.mousePosition) + this.offset;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EventSystem.current.SetSelectedGameObject(base.gameObject);
|
||||||
|
float num = Links.x.fellowship.move.magnitude / 2f;
|
||||||
|
Vector3 vector = new Vector3(Links.x.fellowship.move.x, Links.x.fellowship.move.y, 0f) * num;
|
||||||
|
bool flag = true;
|
||||||
|
Vector3 vector2 = this.tr.position + vector;
|
||||||
|
if (vector2.x >= Links.x.formation.bottomRight.transform.position.x)
|
||||||
|
{
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
if (vector2.x <= Links.x.formation.bottomLeft.transform.position.x)
|
||||||
|
{
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
if (vector2.y >= Links.x.formation.topRight.transform.position.y)
|
||||||
|
{
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
if (vector2.y <= Links.x.formation.bottomRight.transform.position.y)
|
||||||
|
{
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
if (flag)
|
||||||
|
{
|
||||||
|
this.tr.position += vector;
|
||||||
|
}
|
||||||
|
CompanionDrop closestBox = Links.x.formation.GetClosestBox(this.tr.position);
|
||||||
|
this.prevBox = Links.x.formation.hoverBox;
|
||||||
|
if (closestBox != this.prevBox)
|
||||||
|
{
|
||||||
|
if (this.prevBox)
|
||||||
|
{
|
||||||
|
this.prevBox.OnPointerExit(null);
|
||||||
|
this.prevBox.img.material = Links.x.sceneMap.normalMaterial;
|
||||||
|
}
|
||||||
|
if (closestBox)
|
||||||
|
{
|
||||||
|
closestBox.OnPointerEnter(null);
|
||||||
|
closestBox.img.material = Links.x.sceneMap.hoverMaterial;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Links.x.formation.hoverBox = closestBox;
|
||||||
|
}
|
||||||
|
Links.x.formation.dragMessage.text = Links.x.formation.formationDescription;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E9C RID: 3740 RVA: 0x00116C14 File Offset: 0x00114E14
|
||||||
|
private void LateUpdate()
|
||||||
|
{
|
||||||
|
this.SetIcons();
|
||||||
|
if (this.waitForDrag && Links.x.mk)
|
||||||
|
{
|
||||||
|
if (Input.GetMouseButton(0) && (Time.realtimeSinceStartup > this.waitForDragTime + 0.3f || Vector3.Distance(this.waitForDragPos, Input.mousePosition) > Links.x.formation.dragThreshold))
|
||||||
|
{
|
||||||
|
this.Drag();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Time.realtimeSinceStartup > this.waitForDragTime + 0.3f)
|
||||||
|
{
|
||||||
|
this.waitForDrag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E9D RID: 3741 RVA: 0x00116C98 File Offset: 0x00114E98
|
||||||
|
private void Drag()
|
||||||
|
{
|
||||||
|
this.dragging = true;
|
||||||
|
for (int i = 0; i < this.allCompanionIcons.Count; i++)
|
||||||
|
{
|
||||||
|
if (this.allCompanionIcons[i].character && (Links.x.mk || (Links.x.joy && this.allCompanionIcons[i] != this)))
|
||||||
|
{
|
||||||
|
this.allCompanionIcons[i].border.raycastTarget = false;
|
||||||
|
this.allCompanionIcons[i].btn.interactable = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Links.x.formationTooltip.EndHoverText(base.gameObject, false);
|
||||||
|
this.savedPos = this.tr.position;
|
||||||
|
CompanionDrop component = this.tr.parent.gameObject.GetComponent<CompanionDrop>();
|
||||||
|
this.tr.SetParent(Links.x.formation.dragHolder, true);
|
||||||
|
Links.x.formation.dragging = true;
|
||||||
|
this.useItems.interactable = false;
|
||||||
|
this.autoCast.interactable = false;
|
||||||
|
this.useItems.targetGraphic.raycastTarget = false;
|
||||||
|
this.autoCast.targetGraphic.raycastTarget = false;
|
||||||
|
this.useItems.graphic.raycastTarget = false;
|
||||||
|
this.autoCast.graphic.raycastTarget = false;
|
||||||
|
this.leader.interactable = false;
|
||||||
|
this.leader.interactable = false;
|
||||||
|
this.leader.isOn = false;
|
||||||
|
this.character.stats.isLeader = false;
|
||||||
|
this.leaderJoy.isOn = this.leader.isOn;
|
||||||
|
this.leaderJoy.interactable = this.leader.interactable;
|
||||||
|
if (Links.x.joy)
|
||||||
|
{
|
||||||
|
this.leaderJoy.gameObject.SetActive(this.leader.interactable);
|
||||||
|
}
|
||||||
|
this.leader.targetGraphic.raycastTarget = false;
|
||||||
|
this.leader.graphic.raycastTarget = false;
|
||||||
|
Links.x.formation.group1box.StartDrag();
|
||||||
|
Links.x.formation.group2box.StartDrag();
|
||||||
|
Links.x.formation.group3box.StartDrag();
|
||||||
|
Links.x.formation.group4box.StartDrag();
|
||||||
|
Links.x.formation.group5box.StartDrag();
|
||||||
|
Links.x.formation.group6box.StartDrag();
|
||||||
|
Links.x.formation.group7box.StartDrag();
|
||||||
|
Links.x.formation.group8box.StartDrag();
|
||||||
|
Links.x.formation.group9box.StartDrag();
|
||||||
|
this.offset = this.tr.position - Links.x.menuCamera.ScreenToWorldPoint(Input.mousePosition);
|
||||||
|
Links.x.formation.StartDrag(this, component);
|
||||||
|
this.SetIcons();
|
||||||
|
this.SetButton(true);
|
||||||
|
this.SetControllerIcons(false);
|
||||||
|
this.waitForDrag = false;
|
||||||
|
if (Links.x.joy)
|
||||||
|
{
|
||||||
|
Links.x.hudControl.JoyBox(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E9E RID: 3742 RVA: 0x00116FCC File Offset: 0x001151CC
|
||||||
|
private void SetIcons()
|
||||||
|
{
|
||||||
|
this.useItemsRT.anchoredPosition3D = this.rt.anchoredPosition3D - this.useItemOffset;
|
||||||
|
this.autoCastRT.anchoredPosition3D = this.rt.anchoredPosition3D - this.autoCastOffset;
|
||||||
|
this.leaderRT.anchoredPosition3D = this.rt.anchoredPosition3D - this.leaderOffset;
|
||||||
|
if (this.useItemTr.parent != this.tr.parent)
|
||||||
|
{
|
||||||
|
this.useItemTr.SetParent(this.tr.parent);
|
||||||
|
this.autoCastTr.SetParent(this.tr.parent);
|
||||||
|
this.leaderTr.SetParent(this.tr.parent);
|
||||||
|
this.autoCastTr.SetAsLastSibling();
|
||||||
|
this.useItemTr.SetAsLastSibling();
|
||||||
|
this.leaderTr.SetAsLastSibling();
|
||||||
|
this.useItemTr.localScale = Vector3.one;
|
||||||
|
this.autoCastTr.localScale = Vector3.one;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000E9F RID: 3743 RVA: 0x001170DF File Offset: 0x001152DF
|
||||||
|
public void PointerUpFromTrigger()
|
||||||
|
{
|
||||||
|
if (this.dragging)
|
||||||
|
{
|
||||||
|
this.OnPointerUp(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.OnPointerDown(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000EA0 RID: 3744 RVA: 0x001170F8 File Offset: 0x001152F8
|
||||||
|
public void OnPointerDown(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
if (Links.x.formation.selectedCharacter)
|
||||||
|
{
|
||||||
|
CompanionIcon selectedIcon = Links.x.formation.GetSelectedIcon();
|
||||||
|
if (selectedIcon)
|
||||||
|
{
|
||||||
|
selectedIcon.selected.enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Links.x.formation.UpdateSelectedCharacter(this.character);
|
||||||
|
this.selected.enabled = true;
|
||||||
|
if (!this.dragging)
|
||||||
|
{
|
||||||
|
if (Links.x.joy)
|
||||||
|
{
|
||||||
|
this.Drag();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.waitForDrag)
|
||||||
|
{
|
||||||
|
this.waitForDrag = true;
|
||||||
|
this.waitForDragTime = Time.realtimeSinceStartup;
|
||||||
|
this.waitForDragPos = Input.mousePosition;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000EA1 RID: 3745 RVA: 0x001171A0 File Offset: 0x001153A0
|
||||||
|
public void SetButton(bool state)
|
||||||
|
{
|
||||||
|
if (state)
|
||||||
|
{
|
||||||
|
this.normal * 1.5f;
|
||||||
|
Button button = this.btn;
|
||||||
|
ColorBlock colors = button.colors;
|
||||||
|
colors.disabledColor = colors.highlightedColor;
|
||||||
|
button.colors = colors;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Button button2 = this.btn;
|
||||||
|
ColorBlock colors2 = button2.colors;
|
||||||
|
colors2.disabledColor = this.normal;
|
||||||
|
button2.colors = colors2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000EA2 RID: 3746 RVA: 0x00117203 File Offset: 0x00115403
|
||||||
|
public void OnPointerUp(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
if (this.dragging)
|
||||||
|
{
|
||||||
|
this.EndDrag();
|
||||||
|
}
|
||||||
|
this.waitToEndDrag = true;
|
||||||
|
if (Links.x.joy)
|
||||||
|
{
|
||||||
|
this.dragging = false;
|
||||||
|
this.waitToEndDrag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000EA3 RID: 3747 RVA: 0x00117234 File Offset: 0x00115434
|
||||||
|
public void EndDrag()
|
||||||
|
{
|
||||||
|
this.SetButton(false);
|
||||||
|
this.dragging = false;
|
||||||
|
this.useItems.interactable = true;
|
||||||
|
this.autoCast.interactable = true;
|
||||||
|
this.useItems.targetGraphic.raycastTarget = true;
|
||||||
|
this.autoCast.targetGraphic.raycastTarget = true;
|
||||||
|
this.useItems.graphic.raycastTarget = true;
|
||||||
|
this.autoCast.graphic.raycastTarget = true;
|
||||||
|
if (Links.x.formation.hoverBox != null)
|
||||||
|
{
|
||||||
|
this.character.stats.formationGroup = Links.x.formation.hoverBox.dropNum;
|
||||||
|
Links.x.formation.SetPortraitParent(this.index, true);
|
||||||
|
Links.x.formation.group1box.EndDrag();
|
||||||
|
Links.x.formation.group2box.EndDrag();
|
||||||
|
Links.x.formation.group3box.EndDrag();
|
||||||
|
Links.x.formation.group4box.EndDrag();
|
||||||
|
Links.x.formation.group5box.EndDrag();
|
||||||
|
Links.x.formation.group6box.EndDrag();
|
||||||
|
Links.x.formation.group7box.EndDrag();
|
||||||
|
Links.x.formation.group8box.EndDrag();
|
||||||
|
Links.x.formation.group9box.EndDrag();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.tr.position = this.savedPos;
|
||||||
|
Links.x.formation.SetPortraitParent(this.index, true);
|
||||||
|
Links.x.formation.group1box.EndDrag();
|
||||||
|
Links.x.formation.group2box.EndDrag();
|
||||||
|
Links.x.formation.group3box.EndDrag();
|
||||||
|
Links.x.formation.group4box.EndDrag();
|
||||||
|
Links.x.formation.group5box.EndDrag();
|
||||||
|
Links.x.formation.group6box.EndDrag();
|
||||||
|
Links.x.formation.group7box.EndDrag();
|
||||||
|
Links.x.formation.group8box.EndDrag();
|
||||||
|
Links.x.formation.group9box.EndDrag();
|
||||||
|
}
|
||||||
|
for (int i = 0; i < this.allCompanionIcons.Count; i++)
|
||||||
|
{
|
||||||
|
if (this.allCompanionIcons[i].character)
|
||||||
|
{
|
||||||
|
this.allCompanionIcons[i].border.raycastTarget = true;
|
||||||
|
this.allCompanionIcons[i].btn.interactable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.prevBox)
|
||||||
|
{
|
||||||
|
this.prevBox.OnPointerExit(null);
|
||||||
|
this.prevBox.img.material = Links.x.sceneMap.normalMaterial;
|
||||||
|
}
|
||||||
|
CompanionDrop component = this.tr.parent.gameObject.GetComponent<CompanionDrop>();
|
||||||
|
Links.x.SetFormationParty();
|
||||||
|
Links.x.formation.EndDrag(component);
|
||||||
|
this.SetIcons();
|
||||||
|
this.SetControllerIcons(true);
|
||||||
|
if (Links.x.joy)
|
||||||
|
{
|
||||||
|
EventSystem.current.SetSelectedGameObject(base.gameObject);
|
||||||
|
this.OnPointerEnter(null);
|
||||||
|
Links.x.hudControl.SetJoyBox(base.gameObject.GetComponent<UITriggerButton>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000EA4 RID: 3748 RVA: 0x001175A4 File Offset: 0x001157A4
|
||||||
|
public void OnPointerEnter(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
this.hovering = true;
|
||||||
|
if (!this.character)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!Input.GetMouseButton(0))
|
||||||
|
{
|
||||||
|
bool flag = this.dragging;
|
||||||
|
}
|
||||||
|
bool joy = Links.x.joy;
|
||||||
|
CompanionDrop component = this.tr.parent.gameObject.GetComponent<CompanionDrop>();
|
||||||
|
if (component)
|
||||||
|
{
|
||||||
|
component.SetButton(true);
|
||||||
|
}
|
||||||
|
if (Links.x.formation && component)
|
||||||
|
{
|
||||||
|
Links.x.formation.GetDescription(this, component);
|
||||||
|
Links.x.formation.UpdateSliderValues(this.character);
|
||||||
|
}
|
||||||
|
if (this.waitToEndDrag)
|
||||||
|
{
|
||||||
|
this.dragging = false;
|
||||||
|
this.waitToEndDrag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000EA5 RID: 3749 RVA: 0x0011765A File Offset: 0x0011585A
|
||||||
|
public CompanionDrop GetDrop()
|
||||||
|
{
|
||||||
|
return this.tr.parent.gameObject.GetComponent<CompanionDrop>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000EA6 RID: 3750 RVA: 0x00117674 File Offset: 0x00115874
|
||||||
|
public void OnPointerExit(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
CompanionDrop component = this.tr.parent.gameObject.GetComponent<CompanionDrop>();
|
||||||
|
if (component)
|
||||||
|
{
|
||||||
|
component.SetButton(false);
|
||||||
|
}
|
||||||
|
this.hovering = false;
|
||||||
|
if (!Links.x.formation.selectedCharacter)
|
||||||
|
{
|
||||||
|
Links.x.formation.formationDescription = Links.x.formation.defaultText;
|
||||||
|
Links.x.formation.EmptySliders();
|
||||||
|
}
|
||||||
|
else if (Links.x.mk)
|
||||||
|
{
|
||||||
|
Links.x.formation.GetDescription(null, null);
|
||||||
|
Links.x.formation.UpdateSliderValues(Links.x.formation.selectedCharacter);
|
||||||
|
}
|
||||||
|
this.waitForDragTime = 0f;
|
||||||
|
this.waitForDrag = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000EA7 RID: 3751 RVA: 0x00117740 File Offset: 0x00115940
|
||||||
|
public void SetControllerIcons(bool state)
|
||||||
|
{
|
||||||
|
if (this.dragging)
|
||||||
|
{
|
||||||
|
state = false;
|
||||||
|
}
|
||||||
|
if (!this.character)
|
||||||
|
{
|
||||||
|
state = false;
|
||||||
|
this.leaderJoy.gameObject.SetActive(false);
|
||||||
|
this.autoCastJoy.gameObject.SetActive(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.autoCastJoy.gameObject.SetActive(false);
|
||||||
|
if (this.character.stats.defendMainInCombat && Links.x.joy)
|
||||||
|
{
|
||||||
|
this.leaderJoy.gameObject.SetActive(state);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.leaderJoy.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x04001717 RID: 5911
|
||||||
|
public int index;
|
||||||
|
|
||||||
|
// Token: 0x04001718 RID: 5912
|
||||||
|
public Character character;
|
||||||
|
|
||||||
|
// Token: 0x04001719 RID: 5913
|
||||||
|
public bool dragging;
|
||||||
|
|
||||||
|
// Token: 0x0400171A RID: 5914
|
||||||
|
public RawImage companionPortrait;
|
||||||
|
|
||||||
|
// Token: 0x0400171B RID: 5915
|
||||||
|
public Image border;
|
||||||
|
|
||||||
|
// Token: 0x0400171C RID: 5916
|
||||||
|
public Button btn;
|
||||||
|
|
||||||
|
// Token: 0x0400171D RID: 5917
|
||||||
|
public RenderTexture texturesIdle;
|
||||||
|
|
||||||
|
// Token: 0x0400171E RID: 5918
|
||||||
|
public bool hovering;
|
||||||
|
|
||||||
|
// Token: 0x0400171F RID: 5919
|
||||||
|
private Transform tr;
|
||||||
|
|
||||||
|
// Token: 0x04001720 RID: 5920
|
||||||
|
private Vector3 offset;
|
||||||
|
|
||||||
|
// Token: 0x04001721 RID: 5921
|
||||||
|
private List<CompanionIcon> allCompanionIcons;
|
||||||
|
|
||||||
|
// Token: 0x04001722 RID: 5922
|
||||||
|
private Vector3 savedPos;
|
||||||
|
|
||||||
|
// Token: 0x04001723 RID: 5923
|
||||||
|
private float updateTime;
|
||||||
|
|
||||||
|
// Token: 0x04001724 RID: 5924
|
||||||
|
private bool waitToEndDrag;
|
||||||
|
|
||||||
|
// Token: 0x04001725 RID: 5925
|
||||||
|
private CompanionDrop prevBox;
|
||||||
|
|
||||||
|
// Token: 0x04001726 RID: 5926
|
||||||
|
public RectTransform rt;
|
||||||
|
|
||||||
|
// Token: 0x04001727 RID: 5927
|
||||||
|
private Color normal;
|
||||||
|
|
||||||
|
// Token: 0x04001728 RID: 5928
|
||||||
|
public Toggle useItems;
|
||||||
|
|
||||||
|
// Token: 0x04001729 RID: 5929
|
||||||
|
public Toggle autoCast;
|
||||||
|
|
||||||
|
// Token: 0x0400172A RID: 5930
|
||||||
|
public Toggle leader;
|
||||||
|
|
||||||
|
// Token: 0x0400172B RID: 5931
|
||||||
|
public Toggle useItemsJoy;
|
||||||
|
|
||||||
|
// Token: 0x0400172C RID: 5932
|
||||||
|
public Toggle autoCastJoy;
|
||||||
|
|
||||||
|
// Token: 0x0400172D RID: 5933
|
||||||
|
public Toggle leaderJoy;
|
||||||
|
|
||||||
|
// Token: 0x0400172E RID: 5934
|
||||||
|
private Vector3 useItemOffset;
|
||||||
|
|
||||||
|
// Token: 0x0400172F RID: 5935
|
||||||
|
private Vector3 autoCastOffset;
|
||||||
|
|
||||||
|
// Token: 0x04001730 RID: 5936
|
||||||
|
private Vector3 leaderOffset;
|
||||||
|
|
||||||
|
// Token: 0x04001731 RID: 5937
|
||||||
|
public RectTransform useItemsRT;
|
||||||
|
|
||||||
|
// Token: 0x04001732 RID: 5938
|
||||||
|
public RectTransform autoCastRT;
|
||||||
|
|
||||||
|
// Token: 0x04001733 RID: 5939
|
||||||
|
public RectTransform leaderRT;
|
||||||
|
|
||||||
|
// Token: 0x04001734 RID: 5940
|
||||||
|
public Transform useItemTr;
|
||||||
|
|
||||||
|
// Token: 0x04001735 RID: 5941
|
||||||
|
public Transform autoCastTr;
|
||||||
|
|
||||||
|
// Token: 0x04001736 RID: 5942
|
||||||
|
public Transform leaderTr;
|
||||||
|
|
||||||
|
// Token: 0x04001737 RID: 5943
|
||||||
|
public bool waitForDrag;
|
||||||
|
|
||||||
|
// Token: 0x04001738 RID: 5944
|
||||||
|
public float waitForDragTime;
|
||||||
|
|
||||||
|
// Token: 0x04001739 RID: 5945
|
||||||
|
public Vector3 waitForDragPos;
|
||||||
|
|
||||||
|
// Token: 0x0400173A RID: 5946
|
||||||
|
public Image selected;
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
// Token: 0x0200009D RID: 157
|
||||||
|
public class ContentSizeFitterEx : ContentSizeFitter
|
||||||
|
{
|
||||||
|
// Token: 0x06000EA9 RID: 3753 RVA: 0x001177E8 File Offset: 0x001159E8
|
||||||
|
public override void SetLayoutHorizontal()
|
||||||
|
{
|
||||||
|
base.SetLayoutHorizontal();
|
||||||
|
RectTransform rectTransform = base.transform as RectTransform;
|
||||||
|
Vector2 sizeDelta = rectTransform.sizeDelta;
|
||||||
|
sizeDelta.x = Mathf.Clamp(sizeDelta.x, this.sizeMin.x, this.sizeMax.x);
|
||||||
|
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, sizeDelta.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000EAA RID: 3754 RVA: 0x00117844 File Offset: 0x00115A44
|
||||||
|
public override void SetLayoutVertical()
|
||||||
|
{
|
||||||
|
base.SetLayoutVertical();
|
||||||
|
RectTransform rectTransform = base.transform as RectTransform;
|
||||||
|
Vector2 sizeDelta = rectTransform.sizeDelta;
|
||||||
|
sizeDelta.y = Mathf.Clamp(sizeDelta.y, this.sizeMin.y, this.sizeMax.y);
|
||||||
|
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, sizeDelta.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0400173B RID: 5947
|
||||||
|
public Vector2 sizeMin = new Vector2(0f, 0f);
|
||||||
|
|
||||||
|
// Token: 0x0400173C RID: 5948
|
||||||
|
public Vector2 sizeMax = new Vector2(350f, 1080f);
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x02000061 RID: 97
|
||||||
|
public class CoolAudioSource : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000B52 RID: 2898 RVA: 0x000DD8A8 File Offset: 0x000DBAA8
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
this.audioSource = base.gameObject.GetComponent<AudioSource>();
|
||||||
|
this.audioSource.loop = this.loopIt;
|
||||||
|
if (this.is2D)
|
||||||
|
{
|
||||||
|
this.audioSource.spatialBlend = 0f;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.audioSource.spatialBlend = 1f;
|
||||||
|
}
|
||||||
|
if (this.playOnAwake)
|
||||||
|
{
|
||||||
|
this.audioSource.playOnAwake = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.audioSource.playOnAwake = false;
|
||||||
|
}
|
||||||
|
this.audioSource.volume = 0f;
|
||||||
|
this.audioSource.priority = 1;
|
||||||
|
base.enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0400108C RID: 4236
|
||||||
|
[Header("FOR JOSEPH")]
|
||||||
|
public bool playOnAwake;
|
||||||
|
|
||||||
|
// Token: 0x0400108D RID: 4237
|
||||||
|
public bool loopIt;
|
||||||
|
|
||||||
|
// Token: 0x0400108E RID: 4238
|
||||||
|
public bool is2D;
|
||||||
|
|
||||||
|
// Token: 0x0400108F RID: 4239
|
||||||
|
public bool playOnceThenWaitForCharacterToReturn;
|
||||||
|
|
||||||
|
// Token: 0x04001090 RID: 4240
|
||||||
|
public bool playEveryTimePlayerIsNear;
|
||||||
|
|
||||||
|
// Token: 0x04001091 RID: 4241
|
||||||
|
[Header("FOR HANNAH")]
|
||||||
|
public AudioSource audioSource;
|
||||||
|
}
|
||||||
109
Projects/BanquetForFools/Source/Assembly-CSharp/CopyShadows.cs
Normal file
109
Projects/BanquetForFools/Source/Assembly-CSharp/CopyShadows.cs
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Rendering;
|
||||||
|
|
||||||
|
// Token: 0x02000074 RID: 116
|
||||||
|
[ExecuteInEditMode]
|
||||||
|
[RequireComponent(typeof(Light))]
|
||||||
|
public class CopyShadows : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000B8A RID: 2954 RVA: 0x000DFDDA File Offset: 0x000DDFDA
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
this.lightComponent = base.GetComponent<Light>();
|
||||||
|
this.SetupCommandBuffer();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B8B RID: 2955 RVA: 0x000DFDEE File Offset: 0x000DDFEE
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
this.lightComponent.RemoveCommandBuffer(LightEvent.AfterShadowMap, this.commandBuffer);
|
||||||
|
this.lightComponent.RemoveCommandBuffer(LightEvent.AfterScreenspaceMask, this.commandBuffer2);
|
||||||
|
this.ReleaseCommandBuffer();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B8C RID: 2956 RVA: 0x000DFE1C File Offset: 0x000DE01C
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (this.tex == null || this.w != (float)Screen.width || this.h != (float)Screen.height)
|
||||||
|
{
|
||||||
|
if (this.tex != null)
|
||||||
|
{
|
||||||
|
this.tex.Release();
|
||||||
|
}
|
||||||
|
this.w = (float)Screen.width;
|
||||||
|
this.h = (float)Screen.height;
|
||||||
|
this.tex = new RenderTexture(Screen.width, Screen.height, 24, RenderTextureFormat.ARGB32);
|
||||||
|
this.reset = true;
|
||||||
|
}
|
||||||
|
if (this.reset)
|
||||||
|
{
|
||||||
|
this.OnDisable();
|
||||||
|
this.OnEnable();
|
||||||
|
this.reset = false;
|
||||||
|
}
|
||||||
|
float num = 0f;
|
||||||
|
if (Links.x && Links.x.diorama && Links.x.cameraEffects.indoors)
|
||||||
|
{
|
||||||
|
num = 1f;
|
||||||
|
}
|
||||||
|
Shader.SetGlobalFloat("_UsePointLight", num);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B8D RID: 2957 RVA: 0x000DFF04 File Offset: 0x000DE104
|
||||||
|
private void SetupCommandBuffer()
|
||||||
|
{
|
||||||
|
this.commandBuffer = new CommandBuffer();
|
||||||
|
RenderTargetIdentifier renderTargetIdentifier = BuiltinRenderTextureType.CurrentActive;
|
||||||
|
this.commandBuffer.SetGlobalTexture(this.textureSemanticName, renderTargetIdentifier);
|
||||||
|
this.lightComponent.AddCommandBuffer(LightEvent.AfterShadowMap, this.commandBuffer);
|
||||||
|
this.commandBuffer2 = new CommandBuffer();
|
||||||
|
RenderTargetIdentifier renderTargetIdentifier2 = BuiltinRenderTextureType.CurrentActive;
|
||||||
|
this.commandBuffer2.Blit(renderTargetIdentifier2, this.tex, this.material);
|
||||||
|
this.commandBuffer2.SetGlobalTexture(this.textureSemanticName2, this.tex);
|
||||||
|
this.lightComponent.AddCommandBuffer(LightEvent.AfterScreenspaceMask, this.commandBuffer2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B8E RID: 2958 RVA: 0x000DFFA4 File Offset: 0x000DE1A4
|
||||||
|
private void ReleaseCommandBuffer()
|
||||||
|
{
|
||||||
|
this.commandBuffer2.Clear();
|
||||||
|
this.commandBuffer.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0400119D RID: 4509
|
||||||
|
public string textureSemanticName = "_EnvironmentShadows";
|
||||||
|
|
||||||
|
// Token: 0x0400119E RID: 4510
|
||||||
|
public string textureSemanticName2 = "_EnvironmentShadowsScreenSpace";
|
||||||
|
|
||||||
|
// Token: 0x0400119F RID: 4511
|
||||||
|
public bool reset;
|
||||||
|
|
||||||
|
// Token: 0x040011A0 RID: 4512
|
||||||
|
private CommandBuffer commandBuffer;
|
||||||
|
|
||||||
|
// Token: 0x040011A1 RID: 4513
|
||||||
|
private CommandBuffer commandBuffer2;
|
||||||
|
|
||||||
|
// Token: 0x040011A2 RID: 4514
|
||||||
|
private Light lightComponent;
|
||||||
|
|
||||||
|
// Token: 0x040011A3 RID: 4515
|
||||||
|
public RenderTexture tex;
|
||||||
|
|
||||||
|
// Token: 0x040011A4 RID: 4516
|
||||||
|
public RenderTexture pointLightTexture;
|
||||||
|
|
||||||
|
// Token: 0x040011A5 RID: 4517
|
||||||
|
public Material material;
|
||||||
|
|
||||||
|
// Token: 0x040011A6 RID: 4518
|
||||||
|
private float w;
|
||||||
|
|
||||||
|
// Token: 0x040011A7 RID: 4519
|
||||||
|
private float h;
|
||||||
|
|
||||||
|
// Token: 0x040011A8 RID: 4520
|
||||||
|
public Transform pointLight;
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Rendering;
|
||||||
|
|
||||||
|
// Token: 0x02000075 RID: 117
|
||||||
|
[ExecuteInEditMode]
|
||||||
|
[RequireComponent(typeof(Light))]
|
||||||
|
public class CopyShadowsBaker : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000B90 RID: 2960 RVA: 0x000DFFDA File Offset: 0x000DE1DA
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
this.lightComponent = base.GetComponent<Light>();
|
||||||
|
this.SetupCommandBuffer();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B91 RID: 2961 RVA: 0x000DFFEE File Offset: 0x000DE1EE
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
this.lightComponent.RemoveCommandBuffer(LightEvent.AfterScreenspaceMask, this.commandBuffer2);
|
||||||
|
this.ReleaseCommandBuffer();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B92 RID: 2962 RVA: 0x000E0008 File Offset: 0x000DE208
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (this.reset)
|
||||||
|
{
|
||||||
|
this.OnDisable();
|
||||||
|
this.OnEnable();
|
||||||
|
this.reset = false;
|
||||||
|
}
|
||||||
|
if (this.tex == null || this.w != (float)Screen.width || this.h != (float)Screen.height)
|
||||||
|
{
|
||||||
|
if (this.tex != null)
|
||||||
|
{
|
||||||
|
this.tex.Release();
|
||||||
|
}
|
||||||
|
this.w = (float)Screen.width;
|
||||||
|
this.h = (float)Screen.height;
|
||||||
|
this.tex = new RenderTexture(Screen.width, Screen.height, 24, RenderTextureFormat.ARGB32);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B93 RID: 2963 RVA: 0x000E00A4 File Offset: 0x000DE2A4
|
||||||
|
private void SetupCommandBuffer()
|
||||||
|
{
|
||||||
|
this.commandBuffer2 = new CommandBuffer();
|
||||||
|
RenderTargetIdentifier renderTargetIdentifier = BuiltinRenderTextureType.CurrentActive;
|
||||||
|
this.commandBuffer2.Blit(renderTargetIdentifier, this.tex, this.material);
|
||||||
|
this.commandBuffer2.SetGlobalTexture(this.textureSemanticName2, this.tex);
|
||||||
|
this.lightComponent.AddCommandBuffer(LightEvent.AfterScreenspaceMask, this.commandBuffer2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000B94 RID: 2964 RVA: 0x000E010E File Offset: 0x000DE30E
|
||||||
|
private void ReleaseCommandBuffer()
|
||||||
|
{
|
||||||
|
this.commandBuffer2.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x040011A9 RID: 4521
|
||||||
|
public string textureSemanticName = "_EnvironmentShadows";
|
||||||
|
|
||||||
|
// Token: 0x040011AA RID: 4522
|
||||||
|
public string textureSemanticName2 = "_EnvironmentShadowsScreenSpace";
|
||||||
|
|
||||||
|
// Token: 0x040011AB RID: 4523
|
||||||
|
public bool reset;
|
||||||
|
|
||||||
|
// Token: 0x040011AC RID: 4524
|
||||||
|
private CommandBuffer commandBuffer;
|
||||||
|
|
||||||
|
// Token: 0x040011AD RID: 4525
|
||||||
|
private CommandBuffer commandBuffer2;
|
||||||
|
|
||||||
|
// Token: 0x040011AE RID: 4526
|
||||||
|
private Light lightComponent;
|
||||||
|
|
||||||
|
// Token: 0x040011AF RID: 4527
|
||||||
|
public RenderTexture tex;
|
||||||
|
|
||||||
|
// Token: 0x040011B0 RID: 4528
|
||||||
|
public RenderTexture pointLightTexture;
|
||||||
|
|
||||||
|
// Token: 0x040011B1 RID: 4529
|
||||||
|
public Material material;
|
||||||
|
|
||||||
|
// Token: 0x040011B2 RID: 4530
|
||||||
|
private float w;
|
||||||
|
|
||||||
|
// Token: 0x040011B3 RID: 4531
|
||||||
|
private float h;
|
||||||
|
|
||||||
|
// Token: 0x040011B4 RID: 4532
|
||||||
|
public Transform pointLight;
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x0200009E RID: 158
|
||||||
|
public class CreateCircle : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000EAC RID: 3756 RVA: 0x001178D0 File Offset: 0x00115AD0
|
||||||
|
public GameObject CreateSphere(Vector3 position, float size)
|
||||||
|
{
|
||||||
|
GameObject gameObject = GameObject.CreatePrimitive(PrimitiveType.Capsule);
|
||||||
|
gameObject.transform.parent = Links.x.gameplay.transform;
|
||||||
|
gameObject.transform.position = position;
|
||||||
|
gameObject.transform.localScale = new Vector3(size, size, size);
|
||||||
|
Object.Destroy(gameObject.GetComponent<SphereCollider>());
|
||||||
|
gameObject.layer = 2;
|
||||||
|
return gameObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000EAD RID: 3757 RVA: 0x00117930 File Offset: 0x00115B30
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < this.numberOfObjects; i++)
|
||||||
|
{
|
||||||
|
float num = (float)i * 3.1415927f * 2f / (float)this.numberOfObjects;
|
||||||
|
Vector3 vector = base.gameObject.transform.position + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * this.radius;
|
||||||
|
if (Physics.Raycast(vector + new Vector3(0f, 10f, 0f), Vector3.up * -1f, out this.hit, 20f, 8))
|
||||||
|
{
|
||||||
|
vector = this.hit.point;
|
||||||
|
GameObject gameObject = this.CreateSphere(vector, 0.5f);
|
||||||
|
gameObject.transform.rotation = Quaternion.LookRotation(vector - base.gameObject.transform.position);
|
||||||
|
gameObject.transform.Rotate(new Vector3(0f, 0f, 90f));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0400173D RID: 5949
|
||||||
|
public int numberOfObjects = 30;
|
||||||
|
|
||||||
|
// Token: 0x0400173E RID: 5950
|
||||||
|
public float radius = 6f;
|
||||||
|
|
||||||
|
// Token: 0x0400173F RID: 5951
|
||||||
|
private RaycastHit hit;
|
||||||
|
}
|
||||||
9324
Projects/BanquetForFools/Source/Assembly-CSharp/Creation.cs
Normal file
9324
Projects/BanquetForFools/Source/Assembly-CSharp/Creation.cs
Normal file
File diff suppressed because it is too large
Load Diff
1674
Projects/BanquetForFools/Source/Assembly-CSharp/CreationSkills.cs
Normal file
1674
Projects/BanquetForFools/Source/Assembly-CSharp/CreationSkills.cs
Normal file
File diff suppressed because it is too large
Load Diff
5528
Projects/BanquetForFools/Source/Assembly-CSharp/CreatureActions.cs
Normal file
5528
Projects/BanquetForFools/Source/Assembly-CSharp/CreatureActions.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,26 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x02000062 RID: 98
|
||||||
|
public class CreatureBoat : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x04001092 RID: 4242
|
||||||
|
[Header("Joseph fills this")]
|
||||||
|
public CreatureBoat.boatNames boat;
|
||||||
|
|
||||||
|
// Token: 0x04001093 RID: 4243
|
||||||
|
[Header("Hannah fills this")]
|
||||||
|
public Boat creatureBoat;
|
||||||
|
|
||||||
|
// Token: 0x04001094 RID: 4244
|
||||||
|
public Creatures leadCreature;
|
||||||
|
|
||||||
|
// Token: 0x020001C3 RID: 451
|
||||||
|
public enum boatNames
|
||||||
|
{
|
||||||
|
// Token: 0x04002C18 RID: 11288
|
||||||
|
TePuke,
|
||||||
|
// Token: 0x04002C19 RID: 11289
|
||||||
|
CropGoblinBoat
|
||||||
|
}
|
||||||
|
}
|
||||||
1122
Projects/BanquetForFools/Source/Assembly-CSharp/Creatures.cs
Normal file
1122
Projects/BanquetForFools/Source/Assembly-CSharp/Creatures.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,282 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using DarkTonic.MasterAudio;
|
||||||
|
using Pathfinding;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x02000023 RID: 35
|
||||||
|
public class CritterActions : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000581 RID: 1409 RVA: 0x000795C9 File Offset: 0x000777C9
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
this.GetVariables();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000582 RID: 1410 RVA: 0x000795D4 File Offset: 0x000777D4
|
||||||
|
private void GetVariables()
|
||||||
|
{
|
||||||
|
this.tr = base.transform.parent.gameObject.transform;
|
||||||
|
this.anim = base.gameObject.GetComponent<Animator>();
|
||||||
|
this.seeker = base.gameObject.GetComponent<Seeker>();
|
||||||
|
this.seeker.pathCallback = new OnPathDelegate(this.PathFinished);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000583 RID: 1411 RVA: 0x00079638 File Offset: 0x00077838
|
||||||
|
public void MakeRandomPath(GraphNode startNode)
|
||||||
|
{
|
||||||
|
if (this.dead)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.tr)
|
||||||
|
{
|
||||||
|
this.GetVariables();
|
||||||
|
}
|
||||||
|
this.nodeConstraint.constrainWalkability = true;
|
||||||
|
this.nodeConstraint.walkable = true;
|
||||||
|
this.nodeConstraint.constrainPenalty = 0;
|
||||||
|
this.nodeConstraint.constrainTags = true;
|
||||||
|
this.nodeConstraint.passID = 0;
|
||||||
|
this.nodeConstraint.passID2 = 0;
|
||||||
|
this.nodeConstraint.checkConnections = 0;
|
||||||
|
this.nodeConstraint.constrainToEnvironment = 1;
|
||||||
|
this.nodeConstraint.constrainToArea = -1;
|
||||||
|
if (startNode == null)
|
||||||
|
{
|
||||||
|
if (this.resourceLocation == -1)
|
||||||
|
{
|
||||||
|
if (this.isResource)
|
||||||
|
{
|
||||||
|
startNode = AstarPath.active.GetNearest(this.resourcePoint, this.nodeConstraint).node;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
startNode = Links.x.critters.GetRandomNode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.isResource = true;
|
||||||
|
startNode = AstarPath.active.GetNearest(this.resourcePoint, this.nodeConstraint).node;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (startNode != null && Links.x.gaia.sceneLoaded && Links.x.gaia.changingMapsComplete)
|
||||||
|
{
|
||||||
|
this.pathmaking = true;
|
||||||
|
if ((this.tr.position - (Vector3)startNode.position).sqrMagnitude > 25f)
|
||||||
|
{
|
||||||
|
this.tr.position = (Vector3)startNode.position;
|
||||||
|
this.Stop();
|
||||||
|
}
|
||||||
|
this.seeker.pathConstraint = this.nodeConstraint;
|
||||||
|
if (Links.x.hasMain)
|
||||||
|
{
|
||||||
|
Vector3 position = Links.x.main.tr.position;
|
||||||
|
this.seeker.StartRandomPath(startNode, 40000, new OnPathDelegate(this.PathFinished), 0.2f, 30000, position);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.seeker.StartRandomPath(startNode, 40000, new OnPathDelegate(this.PathFinished), 0.2f, 30000, base.gameObject.transform.position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000584 RID: 1412 RVA: 0x00079846 File Offset: 0x00077A46
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
this.nodes.Clear();
|
||||||
|
this.targetPosition = Vector3.zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000585 RID: 1413 RVA: 0x00079860 File Offset: 0x00077A60
|
||||||
|
public void PathFinished(Path p)
|
||||||
|
{
|
||||||
|
p.Claim(this);
|
||||||
|
if (!p.error && !this.dead)
|
||||||
|
{
|
||||||
|
this.nodes.Clear();
|
||||||
|
this.pathVectors = p.vectorPath;
|
||||||
|
this.pathNodes = p.path;
|
||||||
|
for (int i = 0; i < this.pathVectors.Count; i++)
|
||||||
|
{
|
||||||
|
this.nodes.Add(this.pathVectors[i]);
|
||||||
|
}
|
||||||
|
this.lastNode = this.pathNodes[this.pathNodes.Count - 1];
|
||||||
|
this.currentIndex = 0;
|
||||||
|
this.t = 0f;
|
||||||
|
this.startPosition = this.tr.position;
|
||||||
|
if (this.currentIndex < this.nodes.Count && this.currentIndex > -1)
|
||||||
|
{
|
||||||
|
this.targetPosition = this.nodes[this.currentIndex];
|
||||||
|
this.anim.Play("Move");
|
||||||
|
this.anim.speed = 1.25f;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.targetPosition = this.tr.position;
|
||||||
|
this.Stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.tr.position = new Vector3(1000f, 0f, 0f);
|
||||||
|
this.targetPosition = Vector3.zero;
|
||||||
|
}
|
||||||
|
this.pathmaking = false;
|
||||||
|
p.Release(this, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000586 RID: 1414 RVA: 0x000799C4 File Offset: 0x00077BC4
|
||||||
|
public void Squish(Character character)
|
||||||
|
{
|
||||||
|
if (this.dead)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Time.timeSinceLevelLoad > this.spawnTime + 2f || !this.isResource)
|
||||||
|
{
|
||||||
|
this.targetPosition = Vector3.zero;
|
||||||
|
this.currentIndex = 0;
|
||||||
|
MasterAudio.PlaySound3DAtVector3AndForget("Squish", this.tr.position, 1f, new float?(1f), 0f, "", null);
|
||||||
|
GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(21);
|
||||||
|
pooledGameObject.gameObject.SetActive(true);
|
||||||
|
pooledGameObject.transform.position = this.tr.position + new Vector3(0f, 0.1f, 0f);
|
||||||
|
if (this.resourceLocation >= 0)
|
||||||
|
{
|
||||||
|
Library.Inventory invRowFromName = Links.x.library.GetInvRowFromName("Shell");
|
||||||
|
if (invRowFromName != null)
|
||||||
|
{
|
||||||
|
int num = -1;
|
||||||
|
if (character.node != null)
|
||||||
|
{
|
||||||
|
num = (int)character.node.Area;
|
||||||
|
}
|
||||||
|
Item item = Links.x.inventory.groundBag.DropLoot(invRowFromName._ID, 1, Vector3.zero, Vector3.zero, new Vector4((float)invRowFromName._DurabilityMax, 0f, 0f, 0f), null, base.gameObject.transform.position, false, false, num);
|
||||||
|
Links.x.diorama.AddItem(item);
|
||||||
|
}
|
||||||
|
this.dead = true;
|
||||||
|
Links.x.diorama.ReturnResource(this.resourceLocation, this.tr.parent.gameObject);
|
||||||
|
base.gameObject.SetActive(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.isResource)
|
||||||
|
{
|
||||||
|
GameObject pooledGameObject2 = Links.x.cellar.GetPooledGameObject(20);
|
||||||
|
pooledGameObject2.gameObject.SetActive(true);
|
||||||
|
pooledGameObject2.transform.position = this.tr.position;
|
||||||
|
pooledGameObject2.transform.rotation = this.tr.rotation;
|
||||||
|
Links.x.critters.AddSquished(pooledGameObject2, false);
|
||||||
|
base.gameObject.SetActive(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GameObject pooledGameObject3 = Links.x.cellar.GetPooledGameObject(20);
|
||||||
|
pooledGameObject3.gameObject.SetActive(true);
|
||||||
|
pooledGameObject3.transform.position = this.tr.position;
|
||||||
|
pooledGameObject3.transform.rotation = this.tr.rotation;
|
||||||
|
Links.x.critters.AddSquished(pooledGameObject3, true);
|
||||||
|
if (character)
|
||||||
|
{
|
||||||
|
character.stats.AddSpiritFromKill(1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000587 RID: 1415 RVA: 0x00079C54 File Offset: 0x00077E54
|
||||||
|
private void OnAnimatorMove()
|
||||||
|
{
|
||||||
|
if (this.dead)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.targetPosition != Vector3.zero && !this.pathmaking)
|
||||||
|
{
|
||||||
|
if ((this.tr.position - this.targetPosition).sqrMagnitude < 0.09f)
|
||||||
|
{
|
||||||
|
if (this.resourceLocation >= 0)
|
||||||
|
{
|
||||||
|
this.lastNode = this.pathNodes[this.currentIndex];
|
||||||
|
}
|
||||||
|
if (this.currentIndex + 1 < this.nodes.Count && this.nodes.Count > 0)
|
||||||
|
{
|
||||||
|
this.currentIndex++;
|
||||||
|
this.targetPosition = this.nodes[this.currentIndex];
|
||||||
|
this.t = 0f;
|
||||||
|
this.startPosition = this.tr.position;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.targetPosition = Vector3.zero;
|
||||||
|
this.MakeRandomPath(this.lastNode);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!this.isResource)
|
||||||
|
{
|
||||||
|
this.tr.rotation = Quaternion.LookRotation(this.targetPosition - this.tr.position);
|
||||||
|
Vector3 rootPosition = this.anim.rootPosition;
|
||||||
|
rootPosition.y = Mathf.Lerp(this.tr.position.y, this.targetPosition.y, Time.deltaTime * 5f);
|
||||||
|
this.tr.position = rootPosition;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.t += Time.deltaTime;
|
||||||
|
this.tr.position = Vector3.Lerp(this.startPosition, this.targetPosition, this.t * 2f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0400087D RID: 2173
|
||||||
|
public Transform tr;
|
||||||
|
|
||||||
|
// Token: 0x0400087E RID: 2174
|
||||||
|
public bool dead;
|
||||||
|
|
||||||
|
// Token: 0x0400087F RID: 2175
|
||||||
|
private Animator anim;
|
||||||
|
|
||||||
|
// Token: 0x04000880 RID: 2176
|
||||||
|
private Vector3 moveFollow;
|
||||||
|
|
||||||
|
// Token: 0x04000881 RID: 2177
|
||||||
|
private Seeker seeker;
|
||||||
|
|
||||||
|
// Token: 0x04000882 RID: 2178
|
||||||
|
private NNConstraint nodeConstraint = new NNConstraint();
|
||||||
|
|
||||||
|
// Token: 0x04000883 RID: 2179
|
||||||
|
public List<Vector3> nodes = new List<Vector3>();
|
||||||
|
|
||||||
|
// Token: 0x04000884 RID: 2180
|
||||||
|
private List<Vector3> pathVectors;
|
||||||
|
|
||||||
|
// Token: 0x04000885 RID: 2181
|
||||||
|
private List<GraphNode> pathNodes;
|
||||||
|
|
||||||
|
// Token: 0x04000886 RID: 2182
|
||||||
|
private GraphNode lastNode;
|
||||||
|
|
||||||
|
// Token: 0x04000887 RID: 2183
|
||||||
|
private Vector3 targetPosition;
|
||||||
|
|
||||||
|
// Token: 0x04000888 RID: 2184
|
||||||
|
private Vector3 startPosition;
|
||||||
|
|
||||||
|
// Token: 0x04000889 RID: 2185
|
||||||
|
private float t;
|
||||||
|
|
||||||
|
// Token: 0x0400088A RID: 2186
|
||||||
|
private int currentIndex;
|
||||||
|
|
||||||
|
// Token: 0x0400088B RID: 2187
|
||||||
|
private bool pathmaking;
|
||||||
|
|
||||||
|
// Token: 0x0400088C RID: 2188
|
||||||
|
public int resourceLocation = -1;
|
||||||
|
|
||||||
|
// Token: 0x0400088D RID: 2189
|
||||||
|
public Vector3 resourcePoint;
|
||||||
|
|
||||||
|
// Token: 0x0400088E RID: 2190
|
||||||
|
public bool isResource;
|
||||||
|
|
||||||
|
// Token: 0x0400088F RID: 2191
|
||||||
|
public float spawnTime;
|
||||||
|
}
|
||||||
234
Projects/BanquetForFools/Source/Assembly-CSharp/Critters.cs
Normal file
234
Projects/BanquetForFools/Source/Assembly-CSharp/Critters.cs
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Pathfinding;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x02000024 RID: 36
|
||||||
|
public class Critters : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000589 RID: 1417 RVA: 0x00079E28 File Offset: 0x00078028
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
this.count = 7;
|
||||||
|
for (int i = 0; i < this.count; i++)
|
||||||
|
{
|
||||||
|
GameObject gameObject = Object.Instantiate<GameObject>(this.critterTypes[Random.Range(0, this.critterTypes.Count)], new Vector3(10000f, 0f, 0f), Quaternion.identity, base.gameObject.transform);
|
||||||
|
CritterActions critterActions = gameObject.transform.GetChild(0).gameObject.AddComponent<CritterActions>();
|
||||||
|
this.activeCritters.Add(critterActions);
|
||||||
|
gameObject.transform.SetParent(Links.x.gameplay.transform);
|
||||||
|
}
|
||||||
|
this.party = Links.x.party;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600058A RID: 1418 RVA: 0x00079EE4 File Offset: 0x000780E4
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (Links.x.gaia.changingMapsComplete && Links.x.gaia.sceneLoaded && Links.x.main)
|
||||||
|
{
|
||||||
|
if ((this.prevPosition - Links.x.main.tr.position).sqrMagnitude > 100f && Links.x.main.desiredGraph == 0 && !Records.x.partySailing)
|
||||||
|
{
|
||||||
|
if (Links.x.main.node != null)
|
||||||
|
{
|
||||||
|
this.StartNewCritterPaths();
|
||||||
|
}
|
||||||
|
this.prevPosition = Links.x.main.tr.position;
|
||||||
|
}
|
||||||
|
Vector3 vector = Vector3.zero;
|
||||||
|
int num = this.activeCritters.Count;
|
||||||
|
for (int i = 0; i < num; i++)
|
||||||
|
{
|
||||||
|
if (!this.activeCritters[i].dead && this.activeCritters[i].tr)
|
||||||
|
{
|
||||||
|
vector = this.activeCritters[i].tr.position;
|
||||||
|
for (int j = 0; j < this.party.Count; j++)
|
||||||
|
{
|
||||||
|
Character character = this.party[j];
|
||||||
|
if (character && character.moving && character.stats.Floating() == 0)
|
||||||
|
{
|
||||||
|
vector.y = character.tr.position.y;
|
||||||
|
if ((character.tr.position - vector).sqrMagnitude < 0.36f)
|
||||||
|
{
|
||||||
|
this.activeCritters[i].Squish(character);
|
||||||
|
if (this.activeCritters[i].isResource)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (this.outsideNodes.Count > 0)
|
||||||
|
{
|
||||||
|
this.activeCritters[i].MakeRandomPath(this.outsideNodes[Random.Range(0, this.outsideNodes.Count)]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.activeCritters[i].tr.position = Vector3.zero;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600058B RID: 1419 RVA: 0x0007A12F File Offset: 0x0007832F
|
||||||
|
public void StartNewCritterPaths()
|
||||||
|
{
|
||||||
|
if (!this.lookingForPaths)
|
||||||
|
{
|
||||||
|
base.StartCoroutine(this.CritterPaths());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600058C RID: 1420 RVA: 0x0007A146 File Offset: 0x00078346
|
||||||
|
private IEnumerator CritterPaths()
|
||||||
|
{
|
||||||
|
this.outsideNodes.Clear();
|
||||||
|
if (Links.x.gaia.changingMapsComplete && Links.x.gaia.sceneLoaded && Links.x.gaia.pathfindingReady)
|
||||||
|
{
|
||||||
|
GraphNode node = Links.x.main.node;
|
||||||
|
Vector3 startPosition = (Vector3)node.position;
|
||||||
|
ConstantPath constPath = null;
|
||||||
|
constPath = ConstantPath.ConstructFast(node, Records.x.GetConstantPathRadius(12), null);
|
||||||
|
this.nodeConstraint.constrainWalkability = false;
|
||||||
|
this.nodeConstraint.walkable = true;
|
||||||
|
this.nodeConstraint.constrainTags = false;
|
||||||
|
this.nodeConstraint.checkCircleID = 0;
|
||||||
|
this.nodeConstraint.passID = 0;
|
||||||
|
this.nodeConstraint.passID2 = 0;
|
||||||
|
this.nodeConstraint.checkConnections = 0;
|
||||||
|
this.nodeConstraint.constrainPenalty = 0;
|
||||||
|
this.nodeConstraint.constrainToArea = -1;
|
||||||
|
this.nodeConstraint.constrainToEnvironment = 1;
|
||||||
|
constPath.nnConstraint = this.nodeConstraint;
|
||||||
|
AstarPath.StartPath(constPath, false);
|
||||||
|
yield return base.StartCoroutine(constPath.WaitForPath());
|
||||||
|
int num = 0;
|
||||||
|
constPath.Claim(this);
|
||||||
|
this.allNodes = constPath.allNodes;
|
||||||
|
int num2 = this.allNodes.Count;
|
||||||
|
float max = 900f;
|
||||||
|
for (int j = 0; j < num2; j++)
|
||||||
|
{
|
||||||
|
if (((Vector3)this.allNodes[j].position - startPosition).sqrMagnitude > max && this.allNodes[j].Walkable)
|
||||||
|
{
|
||||||
|
this.outsideNodes.Add(this.allNodes[j]);
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
constPath.Release(this, false);
|
||||||
|
max = 900f;
|
||||||
|
int num3;
|
||||||
|
for (int i = 0; i < this.count; i = num3 + 1)
|
||||||
|
{
|
||||||
|
if (!this.activeCritters[i].dead && (Links.x.follow.position - this.activeCritters[i].tr.position).sqrMagnitude > max)
|
||||||
|
{
|
||||||
|
if (this.outsideNodes.Count > 0)
|
||||||
|
{
|
||||||
|
GraphNode graphNode = this.outsideNodes[Random.Range(0, this.outsideNodes.Count)];
|
||||||
|
this.activeCritters[i].MakeRandomPath(graphNode);
|
||||||
|
}
|
||||||
|
yield return new WaitForSeconds(0.1f);
|
||||||
|
}
|
||||||
|
num3 = i;
|
||||||
|
}
|
||||||
|
this.CheckSquished(startPosition);
|
||||||
|
startPosition = default(Vector3);
|
||||||
|
constPath = null;
|
||||||
|
}
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600058D RID: 1421 RVA: 0x0007A155 File Offset: 0x00078355
|
||||||
|
public void AddActiveCritter(CritterActions c)
|
||||||
|
{
|
||||||
|
this.activeCritters.Add(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600058E RID: 1422 RVA: 0x0007A163 File Offset: 0x00078363
|
||||||
|
public void RemoveActiveCritter(CritterActions c)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600058F RID: 1423 RVA: 0x0007A165 File Offset: 0x00078365
|
||||||
|
public void AddSquished(GameObject go, bool respawn)
|
||||||
|
{
|
||||||
|
this.squished.Add(go);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000590 RID: 1424 RVA: 0x0007A173 File Offset: 0x00078373
|
||||||
|
public GraphNode GetRandomNode()
|
||||||
|
{
|
||||||
|
return this.outsideNodes[Random.Range(0, this.outsideNodes.Count)];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000591 RID: 1425 RVA: 0x0007A194 File Offset: 0x00078394
|
||||||
|
public void CheckSquished(Vector3 fromDistance)
|
||||||
|
{
|
||||||
|
bool flag = false;
|
||||||
|
for (int i = 0; i < this.squished.Count; i++)
|
||||||
|
{
|
||||||
|
if ((this.squished[i].transform.position - fromDistance).sqrMagnitude > 1225f)
|
||||||
|
{
|
||||||
|
Links.x.cellar.ReturnPooledGameObject(20, this.squished[i]);
|
||||||
|
this.squished[i] = null;
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag)
|
||||||
|
{
|
||||||
|
this.squished.RemoveAll((GameObject item) => item == null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000592 RID: 1426 RVA: 0x0007A240 File Offset: 0x00078440
|
||||||
|
public void RemoveScene()
|
||||||
|
{
|
||||||
|
foreach (GameObject gameObject in this.squished)
|
||||||
|
{
|
||||||
|
Links.x.cellar.ReturnPooledGameObject(20, gameObject);
|
||||||
|
}
|
||||||
|
this.outsideNodes.Clear();
|
||||||
|
for (int i = 0; i < this.activeCritters.Count; i++)
|
||||||
|
{
|
||||||
|
if (i < this.activeCritters.Count && this.activeCritters[i])
|
||||||
|
{
|
||||||
|
this.activeCritters[i].Stop();
|
||||||
|
this.activeCritters[i].dead = false;
|
||||||
|
this.activeCritters[i].gameObject.transform.position = new Vector3(10000f, 10000f, 10000f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.prevPosition = new Vector3(100000f, 100000f, 100000f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x04000890 RID: 2192
|
||||||
|
public List<GameObject> critterTypes = new List<GameObject>();
|
||||||
|
|
||||||
|
// Token: 0x04000891 RID: 2193
|
||||||
|
public List<CritterActions> activeCritters = new List<CritterActions>();
|
||||||
|
|
||||||
|
// Token: 0x04000892 RID: 2194
|
||||||
|
public bool lookingForPaths;
|
||||||
|
|
||||||
|
// Token: 0x04000893 RID: 2195
|
||||||
|
private Vector3 prevPosition;
|
||||||
|
|
||||||
|
// Token: 0x04000894 RID: 2196
|
||||||
|
private List<GraphNode> outsideNodes = new List<GraphNode>();
|
||||||
|
|
||||||
|
// Token: 0x04000895 RID: 2197
|
||||||
|
private NNConstraint nodeConstraint = new NNConstraint();
|
||||||
|
|
||||||
|
// Token: 0x04000896 RID: 2198
|
||||||
|
private List<GraphNode> allNodes;
|
||||||
|
|
||||||
|
// Token: 0x04000897 RID: 2199
|
||||||
|
private int count;
|
||||||
|
|
||||||
|
// Token: 0x04000898 RID: 2200
|
||||||
|
private List<Character> party;
|
||||||
|
|
||||||
|
// Token: 0x04000899 RID: 2201
|
||||||
|
private List<GameObject> squished = new List<GameObject>();
|
||||||
|
|
||||||
|
// Token: 0x0400089A RID: 2202
|
||||||
|
public GameObject crab;
|
||||||
|
}
|
||||||
402
Projects/BanquetForFools/Source/Assembly-CSharp/Culling.cs
Normal file
402
Projects/BanquetForFools/Source/Assembly-CSharp/Culling.cs
Normal file
@@ -0,0 +1,402 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Rendering;
|
||||||
|
|
||||||
|
// Token: 0x02000084 RID: 132
|
||||||
|
public class Culling : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000CD7 RID: 3287 RVA: 0x000F90F0 File Offset: 0x000F72F0
|
||||||
|
public void Setup(SceneCamera sceneCam)
|
||||||
|
{
|
||||||
|
this.sceneCamera = sceneCam;
|
||||||
|
if (this.centerSphere)
|
||||||
|
{
|
||||||
|
this.centerSphere.SetActive(false);
|
||||||
|
}
|
||||||
|
int count = this.grass.Count;
|
||||||
|
if (!this.sceneCamera.perspectiveShot && this.sceneCamera.index == 0)
|
||||||
|
{
|
||||||
|
this.art.gameObject.transform.localScale = new Vector3(22.6001f, 22.6001f, 1f);
|
||||||
|
}
|
||||||
|
if (!this.sceneCamera.perspectiveShot && this.sceneCamera.index == 1)
|
||||||
|
{
|
||||||
|
if (this.art.gameObject.transform.localScale.x > 20f)
|
||||||
|
{
|
||||||
|
this.art.gameObject.transform.localScale = new Vector3(22.6001f, 22.6001f, 1f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.art.gameObject.transform.localScale = new Vector3(11.3002f, 11.3002f, 1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!this.first)
|
||||||
|
{
|
||||||
|
if (this.art)
|
||||||
|
{
|
||||||
|
this.art.gameObject.layer = 2;
|
||||||
|
if (this.art.sharedMaterial && !this.art.sharedMaterial.shader.name.Contains("Lit"))
|
||||||
|
{
|
||||||
|
this.art.sharedMaterial.shader = Links.x.quadShader;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.first = true;
|
||||||
|
}
|
||||||
|
if (Links.x)
|
||||||
|
{
|
||||||
|
Links.x.AddQuad(this);
|
||||||
|
}
|
||||||
|
if (this.art)
|
||||||
|
{
|
||||||
|
this.min = this.art.bounds.min;
|
||||||
|
this.max = this.art.bounds.max;
|
||||||
|
}
|
||||||
|
this.culling = this;
|
||||||
|
if (Links.x)
|
||||||
|
{
|
||||||
|
this.ChangeState(false, false);
|
||||||
|
}
|
||||||
|
base.enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CD8 RID: 3288 RVA: 0x000F92F4 File Offset: 0x000F74F4
|
||||||
|
public void ChangeState(bool on, bool quadForceOff)
|
||||||
|
{
|
||||||
|
int num = this.lights.Count;
|
||||||
|
for (int i = 0; i < num; i++)
|
||||||
|
{
|
||||||
|
if (this.lights[i])
|
||||||
|
{
|
||||||
|
this.lights[i].enabled = on;
|
||||||
|
if (on)
|
||||||
|
{
|
||||||
|
this.lights[i].EnableRevealer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
num = this.losBlockers.Count;
|
||||||
|
for (int j = 0; j < num; j++)
|
||||||
|
{
|
||||||
|
this.losBlockers[j].enabled = on;
|
||||||
|
}
|
||||||
|
num = this.grass.Count;
|
||||||
|
for (int k = 0; k < num; k++)
|
||||||
|
{
|
||||||
|
this.grass[k].enabled = on;
|
||||||
|
}
|
||||||
|
num = this.audioSources.Count;
|
||||||
|
for (int l = 0; l < num; l++)
|
||||||
|
{
|
||||||
|
this.audioSources[l].enabled = on;
|
||||||
|
if (on)
|
||||||
|
{
|
||||||
|
this.audioSources[l].audioSource.volume = Links.x.options.soundVolume;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
num = this.hannahAnimators.Count;
|
||||||
|
for (int m = 0; m < num; m++)
|
||||||
|
{
|
||||||
|
this.hannahAnimators[m].enabled = on;
|
||||||
|
if (on && this.hannahAnimators[m])
|
||||||
|
{
|
||||||
|
this.hannahAnimators[m].enabled = on;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.camParams.enabled = on;
|
||||||
|
this.art.enabled = on;
|
||||||
|
if (quadForceOff)
|
||||||
|
{
|
||||||
|
this.art.enabled = false;
|
||||||
|
this.camParams.enabled = false;
|
||||||
|
}
|
||||||
|
this.isOn = on;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CD9 RID: 3289 RVA: 0x000F9494 File Offset: 0x000F7694
|
||||||
|
public void SetVolume()
|
||||||
|
{
|
||||||
|
int count = this.audioSources.Count;
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
this.audioSources[i].audioSource.volume = Links.x.options.soundVolume;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CDA RID: 3290 RVA: 0x000F94DE File Offset: 0x000F76DE
|
||||||
|
public void ArtOn()
|
||||||
|
{
|
||||||
|
this.camParams.enabled = true;
|
||||||
|
this.art.enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CDB RID: 3291 RVA: 0x000F94F8 File Offset: 0x000F76F8
|
||||||
|
public void MultiCameraChange(bool on)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CDC RID: 3292 RVA: 0x000F94FC File Offset: 0x000F76FC
|
||||||
|
public void CreateWallRenderers()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < this.losBlockers.Count; i++)
|
||||||
|
{
|
||||||
|
if (this.losBlockers[i])
|
||||||
|
{
|
||||||
|
Object.DestroyImmediate(this.losBlockers[i].gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.losBlockers.Clear();
|
||||||
|
int count = this.colliders.Count;
|
||||||
|
for (int j = 0; j < count; j++)
|
||||||
|
{
|
||||||
|
if (this.colliders[j].gameObject.layer == 9)
|
||||||
|
{
|
||||||
|
this.CreateMeshRenderer(this.colliders[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CDD RID: 3293 RVA: 0x000F9598 File Offset: 0x000F7798
|
||||||
|
public void CreateFloorRenderer(Collider collider)
|
||||||
|
{
|
||||||
|
GameObject gameObject = collider.gameObject;
|
||||||
|
if (gameObject.GetComponent<MeshCollider>())
|
||||||
|
{
|
||||||
|
GameObject gameObject2 = new GameObject("Line of Sight Blocker Mesh " + gameObject.name);
|
||||||
|
Transform transform = gameObject.transform;
|
||||||
|
gameObject2.transform.position = transform.position - this.ySubtract;
|
||||||
|
gameObject2.transform.rotation = transform.rotation;
|
||||||
|
gameObject2.AddComponent<MeshFilter>().mesh = gameObject.GetComponent<MeshFilter>().sharedMesh;
|
||||||
|
gameObject2.AddComponent<MeshRenderer>().sharedMaterial = Links.x.lineOfSightBlockerMaterial;
|
||||||
|
gameObject2.layer = 29;
|
||||||
|
gameObject2.transform.parent = transform;
|
||||||
|
gameObject2.transform.localScale = Vector3.one;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
BoxCollider component = gameObject.GetComponent<BoxCollider>();
|
||||||
|
if (component)
|
||||||
|
{
|
||||||
|
GameObject gameObject3 = new GameObject("Line of Sight Blocker");
|
||||||
|
Transform transform2 = gameObject.transform;
|
||||||
|
gameObject3.transform.position = transform2.TransformPoint(component.center);
|
||||||
|
gameObject3.transform.rotation = transform2.rotation;
|
||||||
|
gameObject3.transform.localScale = new Vector3(component.size.x * transform2.localScale.x, component.size.y * transform2.localScale.y, component.size.z * transform2.localScale.z);
|
||||||
|
gameObject3.AddComponent<MeshFilter>().mesh = Links.x.cubeMesh;
|
||||||
|
gameObject3.AddComponent<MeshRenderer>().sharedMaterial = Links.x.lineOfSightBlockerMaterial;
|
||||||
|
gameObject3.layer = 29;
|
||||||
|
gameObject3.transform.parent = transform2;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SphereCollider component2 = gameObject.GetComponent<SphereCollider>();
|
||||||
|
if (component2)
|
||||||
|
{
|
||||||
|
GameObject gameObject4 = new GameObject("Line of Sight Blocker Sphere");
|
||||||
|
Transform transform3 = gameObject.transform;
|
||||||
|
gameObject4.transform.position = transform3.TransformPoint(component2.center);
|
||||||
|
gameObject4.transform.rotation = transform3.rotation;
|
||||||
|
gameObject4.transform.localScale = new Vector3(component2.radius * transform3.localScale.x * 2f, component2.radius * transform3.localScale.x * 2f, component2.radius * transform3.localScale.z * 2f);
|
||||||
|
gameObject4.AddComponent<MeshFilter>().mesh = Links.x.sphereMesh;
|
||||||
|
gameObject4.AddComponent<MeshRenderer>().sharedMaterial = Links.x.lineOfSightBlockerMaterial;
|
||||||
|
gameObject4.layer = 29;
|
||||||
|
gameObject4.transform.parent = transform3;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
CapsuleCollider component3 = gameObject.GetComponent<CapsuleCollider>();
|
||||||
|
if (component3)
|
||||||
|
{
|
||||||
|
GameObject gameObject5 = new GameObject("Line of Sight Blocker Capsule");
|
||||||
|
Transform transform4 = gameObject.transform;
|
||||||
|
gameObject5.transform.position = transform4.TransformPoint(component3.center);
|
||||||
|
gameObject5.transform.rotation = transform4.rotation;
|
||||||
|
gameObject5.transform.localScale = new Vector3(component3.radius * transform4.localScale.x * 2f, component3.height * transform4.localScale.y / 2f, component3.radius * transform4.localScale.z * 2f);
|
||||||
|
gameObject5.AddComponent<MeshFilter>().mesh = Links.x.capsuleMesh;
|
||||||
|
gameObject5.AddComponent<MeshRenderer>().sharedMaterial = Links.x.lineOfSightBlockerMaterial;
|
||||||
|
gameObject5.layer = 29;
|
||||||
|
gameObject5.transform.parent = transform4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CDE RID: 3294 RVA: 0x000F990C File Offset: 0x000F7B0C
|
||||||
|
public void CreateMeshRenderer(Collider collider)
|
||||||
|
{
|
||||||
|
GameObject gameObject = collider.gameObject;
|
||||||
|
BoxCollider component = gameObject.GetComponent<BoxCollider>();
|
||||||
|
if (component)
|
||||||
|
{
|
||||||
|
GameObject gameObject2 = new GameObject("Line of Sight Blocker");
|
||||||
|
Transform transform = gameObject.transform;
|
||||||
|
gameObject2.transform.position = transform.TransformPoint(component.center);
|
||||||
|
gameObject2.transform.rotation = transform.rotation;
|
||||||
|
gameObject2.transform.localScale = new Vector3(component.size.x * transform.localScale.x, component.size.y * transform.localScale.y, component.size.z * transform.localScale.z);
|
||||||
|
gameObject2.AddComponent<MeshFilter>().mesh = Resources.GetBuiltinResource<Mesh>("Cube.fbx");
|
||||||
|
MeshRenderer meshRenderer = gameObject2.AddComponent<MeshRenderer>();
|
||||||
|
meshRenderer.sharedMaterial = Resources.Load<Material>("Crawl/LineOfSightBlockers");
|
||||||
|
gameObject2.layer = 29;
|
||||||
|
gameObject2.transform.parent = transform;
|
||||||
|
this.losBlockers.Add(meshRenderer);
|
||||||
|
meshRenderer.enabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
CapsuleCollider component2 = gameObject.GetComponent<CapsuleCollider>();
|
||||||
|
if (component2)
|
||||||
|
{
|
||||||
|
GameObject gameObject3 = new GameObject("Line of Sight Blocker Capsule");
|
||||||
|
Transform transform2 = gameObject.transform;
|
||||||
|
gameObject3.transform.position = transform2.TransformPoint(component2.center);
|
||||||
|
gameObject3.transform.rotation = transform2.rotation;
|
||||||
|
gameObject3.transform.localScale = new Vector3(component2.radius * transform2.localScale.x * 2f, component2.height * transform2.localScale.y / 2f, component2.radius * transform2.localScale.z * 2f);
|
||||||
|
gameObject3.AddComponent<MeshFilter>().mesh = Resources.GetBuiltinResource<Mesh>("Capsule.fbx");
|
||||||
|
MeshRenderer meshRenderer2 = gameObject3.AddComponent<MeshRenderer>();
|
||||||
|
meshRenderer2.sharedMaterial = Resources.Load<Material>("Crawl/LineOfSightBlockers");
|
||||||
|
gameObject3.layer = 29;
|
||||||
|
gameObject3.transform.parent = transform2;
|
||||||
|
this.losBlockers.Add(meshRenderer2);
|
||||||
|
meshRenderer2.enabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SphereCollider component3 = gameObject.GetComponent<SphereCollider>();
|
||||||
|
if (component3)
|
||||||
|
{
|
||||||
|
GameObject gameObject4 = new GameObject("Line of Sight Blocker Sphere");
|
||||||
|
Transform transform3 = gameObject.transform;
|
||||||
|
gameObject4.transform.position = transform3.TransformPoint(component3.center);
|
||||||
|
gameObject4.transform.rotation = transform3.rotation;
|
||||||
|
gameObject4.transform.localScale = new Vector3(component3.radius * transform3.localScale.x * 2f, component3.radius * transform3.localScale.x * 2f, component3.radius * transform3.localScale.z * 2f);
|
||||||
|
gameObject4.AddComponent<MeshFilter>().mesh = Resources.GetBuiltinResource<Mesh>("Sphere.fbx");
|
||||||
|
MeshRenderer meshRenderer3 = gameObject4.AddComponent<MeshRenderer>();
|
||||||
|
meshRenderer3.sharedMaterial = Resources.Load<Material>("Crawl/LineOfSightBlockers");
|
||||||
|
gameObject4.layer = 29;
|
||||||
|
gameObject4.transform.parent = transform3;
|
||||||
|
this.losBlockers.Add(meshRenderer3);
|
||||||
|
meshRenderer3.enabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CDF RID: 3295 RVA: 0x000F9C21 File Offset: 0x000F7E21
|
||||||
|
public void ClearColliders()
|
||||||
|
{
|
||||||
|
this.colliders.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CE0 RID: 3296 RVA: 0x000F9C2E File Offset: 0x000F7E2E
|
||||||
|
public void AddCollider(Collider coll)
|
||||||
|
{
|
||||||
|
if (coll.gameObject.name.Contains("amera"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.colliders.Add(coll);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CE1 RID: 3297 RVA: 0x000F9C54 File Offset: 0x000F7E54
|
||||||
|
public void ClearGrass()
|
||||||
|
{
|
||||||
|
this.grass.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CE2 RID: 3298 RVA: 0x000F9C61 File Offset: 0x000F7E61
|
||||||
|
public void ClearAudio()
|
||||||
|
{
|
||||||
|
this.audioSources.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CE3 RID: 3299 RVA: 0x000F9C6E File Offset: 0x000F7E6E
|
||||||
|
public void AddGrass(MeshRenderer renderer)
|
||||||
|
{
|
||||||
|
if (renderer.shadowCastingMode == ShadowCastingMode.ShadowsOnly)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.grass.Add(renderer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CE4 RID: 3300 RVA: 0x000F9C86 File Offset: 0x000F7E86
|
||||||
|
public void ClearLights()
|
||||||
|
{
|
||||||
|
this.lights.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CE5 RID: 3301 RVA: 0x000F9C93 File Offset: 0x000F7E93
|
||||||
|
public void ClearHannahAnimators()
|
||||||
|
{
|
||||||
|
this.hannahAnimators.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CE6 RID: 3302 RVA: 0x000F9CA0 File Offset: 0x000F7EA0
|
||||||
|
public void AddSource(CoolAudioSource source)
|
||||||
|
{
|
||||||
|
this.audioSources.Add(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CE7 RID: 3303 RVA: 0x000F9CAE File Offset: 0x000F7EAE
|
||||||
|
public void AddLight(Moonlight light)
|
||||||
|
{
|
||||||
|
this.lights.Add(light);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000CE8 RID: 3304 RVA: 0x000F9CBC File Offset: 0x000F7EBC
|
||||||
|
public void AddHannahAnimator(HannahAnimatorSimple anim)
|
||||||
|
{
|
||||||
|
this.hannahAnimators.Add(anim);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0400147E RID: 5246
|
||||||
|
public bool isOn;
|
||||||
|
|
||||||
|
// Token: 0x0400147F RID: 5247
|
||||||
|
public MeshRenderer art;
|
||||||
|
|
||||||
|
// Token: 0x04001480 RID: 5248
|
||||||
|
public List<Moonlight> lights = new List<Moonlight>();
|
||||||
|
|
||||||
|
// Token: 0x04001481 RID: 5249
|
||||||
|
public List<Collider> colliders = new List<Collider>();
|
||||||
|
|
||||||
|
// Token: 0x04001482 RID: 5250
|
||||||
|
public List<MeshRenderer> grass = new List<MeshRenderer>();
|
||||||
|
|
||||||
|
// Token: 0x04001483 RID: 5251
|
||||||
|
public List<RandomAnimationStart> animatorsRandom = new List<RandomAnimationStart>();
|
||||||
|
|
||||||
|
// Token: 0x04001484 RID: 5252
|
||||||
|
public List<HannahAnimatorSimple> hannahAnimators = new List<HannahAnimatorSimple>();
|
||||||
|
|
||||||
|
// Token: 0x04001485 RID: 5253
|
||||||
|
public List<MeshRenderer> losBlockers = new List<MeshRenderer>();
|
||||||
|
|
||||||
|
// Token: 0x04001486 RID: 5254
|
||||||
|
public List<Item> items = new List<Item>();
|
||||||
|
|
||||||
|
// Token: 0x04001487 RID: 5255
|
||||||
|
public Vector3 center;
|
||||||
|
|
||||||
|
// Token: 0x04001488 RID: 5256
|
||||||
|
public Vector3 min;
|
||||||
|
|
||||||
|
// Token: 0x04001489 RID: 5257
|
||||||
|
public Vector3 max;
|
||||||
|
|
||||||
|
// Token: 0x0400148A RID: 5258
|
||||||
|
public CameraParams camParams;
|
||||||
|
|
||||||
|
// Token: 0x0400148B RID: 5259
|
||||||
|
private Culling culling;
|
||||||
|
|
||||||
|
// Token: 0x0400148C RID: 5260
|
||||||
|
private Material[] mat;
|
||||||
|
|
||||||
|
// Token: 0x0400148D RID: 5261
|
||||||
|
private Vector3 ySubtract = new Vector3(0f, 0.1f, 0f);
|
||||||
|
|
||||||
|
// Token: 0x0400148E RID: 5262
|
||||||
|
public GameObject centerSphere;
|
||||||
|
|
||||||
|
// Token: 0x0400148F RID: 5263
|
||||||
|
public SceneCamera sceneCamera;
|
||||||
|
|
||||||
|
// Token: 0x04001490 RID: 5264
|
||||||
|
public List<CoolAudioSource> audioSources = new List<CoolAudioSource>();
|
||||||
|
|
||||||
|
// Token: 0x04001491 RID: 5265
|
||||||
|
private bool first;
|
||||||
|
}
|
||||||
12
Projects/BanquetForFools/Source/Assembly-CSharp/Data.cs
Normal file
12
Projects/BanquetForFools/Source/Assembly-CSharp/Data.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x020000A1 RID: 161
|
||||||
|
public class Data : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x040018FC RID: 6396
|
||||||
|
public int x;
|
||||||
|
|
||||||
|
// Token: 0x040018FD RID: 6397
|
||||||
|
public int y;
|
||||||
|
}
|
||||||
378
Projects/BanquetForFools/Source/Assembly-CSharp/DeathScreen.cs
Normal file
378
Projects/BanquetForFools/Source/Assembly-CSharp/DeathScreen.cs
Normal file
@@ -0,0 +1,378 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using UnityEngine.Video;
|
||||||
|
|
||||||
|
// Token: 0x020000A2 RID: 162
|
||||||
|
public class DeathScreen : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000F36 RID: 3894 RVA: 0x001281FC File Offset: 0x001263FC
|
||||||
|
public void Setup()
|
||||||
|
{
|
||||||
|
if (Links.x.sensory)
|
||||||
|
{
|
||||||
|
Records.x.SetTypingState(true);
|
||||||
|
Links.x.gameplay.TogglePause(true);
|
||||||
|
Records.x.RemoveControls(true);
|
||||||
|
}
|
||||||
|
this.startVideo.enabled = false;
|
||||||
|
if (this.rt != null)
|
||||||
|
{
|
||||||
|
this.rt.Release();
|
||||||
|
}
|
||||||
|
RenderTextureFormat renderTextureFormat = RenderTextureFormat.Default;
|
||||||
|
this.rt = new RenderTexture(1920, 1080, 24, renderTextureFormat);
|
||||||
|
this.startVideo.targetTexture = this.rt;
|
||||||
|
this.videoImg.texture = this.rt;
|
||||||
|
this.done = false;
|
||||||
|
this.skipText.enabled = false;
|
||||||
|
RenderTexture active = RenderTexture.active;
|
||||||
|
RenderTexture.active = this.rt;
|
||||||
|
GL.Clear(true, true, Color.black);
|
||||||
|
RenderTexture.active = active;
|
||||||
|
if (!this.forDemo)
|
||||||
|
{
|
||||||
|
this.animator.Play("DeathScreenVideo");
|
||||||
|
}
|
||||||
|
Time.timeScale = 1f;
|
||||||
|
if (this.forDemo)
|
||||||
|
{
|
||||||
|
this.WatchTrailer();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.coroutineStart = this.VideoStart();
|
||||||
|
base.StartCoroutine(this.coroutineStart);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F37 RID: 3895 RVA: 0x0012831F File Offset: 0x0012651F
|
||||||
|
private IEnumerator VideoStart()
|
||||||
|
{
|
||||||
|
Links.x.gaia.PlayFade("Out", "Unscaled");
|
||||||
|
yield return new WaitForSecondsRealtime(0.5f);
|
||||||
|
RenderTexture active = RenderTexture.active;
|
||||||
|
RenderTexture.active = this.startVideo.targetTexture;
|
||||||
|
GL.Clear(true, true, Color.black);
|
||||||
|
RenderTexture.active = active;
|
||||||
|
Links.x.gaia.PlayFade("In", "Unscaled");
|
||||||
|
if (Records.x.linux)
|
||||||
|
{
|
||||||
|
this.startVideo.clip = this.mmVideoStartLinux;
|
||||||
|
}
|
||||||
|
else if (!Records.x.linux && (Records.x.windows7 || Records.x.alwaysPlayTranscodedVideo))
|
||||||
|
{
|
||||||
|
this.startVideo.clip = this.mmVideoStartWindows7;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.startVideo.clip = this.mmVideoStart;
|
||||||
|
}
|
||||||
|
if (this.forDemo)
|
||||||
|
{
|
||||||
|
this.startVideo.isLooping = true;
|
||||||
|
}
|
||||||
|
this.startVideo.targetTexture = this.rt;
|
||||||
|
this.videoImg.texture = this.rt;
|
||||||
|
this.startVideo.SetDirectAudioVolume(0, Links.x.options.musicVolume);
|
||||||
|
RenderTexture active2 = RenderTexture.active;
|
||||||
|
RenderTexture.active = this.startVideo.targetTexture;
|
||||||
|
GL.Clear(true, true, Color.black);
|
||||||
|
RenderTexture.active = active2;
|
||||||
|
this.startVideo.enabled = true;
|
||||||
|
this.startVideo.started += this.VideoStarted;
|
||||||
|
this.startVideo.loopPointReached += this.EndReached;
|
||||||
|
this.videoImg.enabled = true;
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F38 RID: 3896 RVA: 0x00128330 File Offset: 0x00126530
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
float num = this.rectTransformBlack.sizeDelta.x;
|
||||||
|
float num2 = this.rectTransformBlack.sizeDelta.y;
|
||||||
|
float num3 = (float)Screen.width / (float)Screen.height;
|
||||||
|
float num4 = 1.7777778f;
|
||||||
|
if (num3 != num4)
|
||||||
|
{
|
||||||
|
if (num3 > num4)
|
||||||
|
{
|
||||||
|
num = num2 * num4;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
num2 = num / num4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.rectTransform.sizeDelta = new Vector2(num, num2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F39 RID: 3897 RVA: 0x00128397 File Offset: 0x00126597
|
||||||
|
public void VideoStarted(VideoPlayer vp)
|
||||||
|
{
|
||||||
|
base.StartCoroutine(this.VideoStarting());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F3A RID: 3898 RVA: 0x001283A6 File Offset: 0x001265A6
|
||||||
|
private IEnumerator VideoStarting()
|
||||||
|
{
|
||||||
|
if (Time.timeScale > 0.5f)
|
||||||
|
{
|
||||||
|
Time.timeScale = 1f;
|
||||||
|
}
|
||||||
|
this.skipText.enabled = false;
|
||||||
|
this.skipText.spriteAsset = Links.x.GetSpriteSheetAsset(Links.x.gameplay.currentSpriteSheetAsset);
|
||||||
|
this.str.Clear();
|
||||||
|
this.str.Append("Skip ");
|
||||||
|
this.str.Append(" <voffset=.4em><size=50><sprite=");
|
||||||
|
if (Links.x.mk)
|
||||||
|
{
|
||||||
|
int keyIconIndex = Links.x.keyControl.GetKeyIconIndex("LMB");
|
||||||
|
this.str.Append(keyIconIndex);
|
||||||
|
this.str.Append("></size></voffset>");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int controllerSprite = Links.x.gameplay.GetControllerSprite("Cancel", Links.x.gameplay.controllerName);
|
||||||
|
this.str.Append(controllerSprite);
|
||||||
|
this.str.Append("></size></voffset>");
|
||||||
|
}
|
||||||
|
this.skipText.text = this.str.ToString();
|
||||||
|
float timeToLerp = 1f;
|
||||||
|
float percentage = 0f;
|
||||||
|
float startTime = Time.time;
|
||||||
|
while (percentage < 1f)
|
||||||
|
{
|
||||||
|
if (Time.timeScale > 0.5f)
|
||||||
|
{
|
||||||
|
Time.timeScale = 1f;
|
||||||
|
}
|
||||||
|
percentage = (Time.time - startTime) / timeToLerp;
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
this.skipText.enabled = true;
|
||||||
|
timeToLerp = 6f;
|
||||||
|
percentage = 0f;
|
||||||
|
startTime = Time.time;
|
||||||
|
while (percentage < 1f && !this.Clicked())
|
||||||
|
{
|
||||||
|
if (Time.timeScale > 0.5f)
|
||||||
|
{
|
||||||
|
Time.timeScale = 1f;
|
||||||
|
}
|
||||||
|
percentage = (Time.time - startTime) / timeToLerp;
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
if (!this.done && !this.forDemo)
|
||||||
|
{
|
||||||
|
this.animator.Play("DeathScreenIn");
|
||||||
|
this.SetFirstObject();
|
||||||
|
}
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F3B RID: 3899 RVA: 0x001283B5 File Offset: 0x001265B5
|
||||||
|
public void SetFirstObject()
|
||||||
|
{
|
||||||
|
this.skipText.enabled = false;
|
||||||
|
if (Links.x.joy)
|
||||||
|
{
|
||||||
|
base.StartCoroutine(this.WaitToSetFirstObject());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F3C RID: 3900 RVA: 0x001283DC File Offset: 0x001265DC
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
if (this.rt != null)
|
||||||
|
{
|
||||||
|
this.rt.Release();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F3D RID: 3901 RVA: 0x001283F7 File Offset: 0x001265F7
|
||||||
|
private IEnumerator WaitToSetFirstObject()
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(0.1f);
|
||||||
|
while (!this.loadBtn.activeSelf || !this.loadBtn.activeInHierarchy)
|
||||||
|
{
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
EventSystem.current.SetSelectedGameObject(this.loadBtn);
|
||||||
|
this.loadBtn.GetComponent<UITriggerButton>().SetSelected(true);
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F3E RID: 3902 RVA: 0x00128406 File Offset: 0x00126606
|
||||||
|
public void EndReached(VideoPlayer vp)
|
||||||
|
{
|
||||||
|
if (!this.forDemo)
|
||||||
|
{
|
||||||
|
vp.enabled = false;
|
||||||
|
this.videoImg.enabled = false;
|
||||||
|
}
|
||||||
|
this.done = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F3F RID: 3903 RVA: 0x0012842A File Offset: 0x0012662A
|
||||||
|
public void DeathScreenOut()
|
||||||
|
{
|
||||||
|
Links.x.hudControl.JoyBox(false);
|
||||||
|
this.startVideo.enabled = false;
|
||||||
|
this.videoImg.enabled = false;
|
||||||
|
this.animator.Play("DeathScreenOut");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F40 RID: 3904 RVA: 0x00128464 File Offset: 0x00126664
|
||||||
|
public void DeathScreenOut2()
|
||||||
|
{
|
||||||
|
Links.x.hudControl.JoyBox(false);
|
||||||
|
this.startVideo.enabled = false;
|
||||||
|
this.videoImg.enabled = false;
|
||||||
|
this.animator.Play("DeathScreenOut2");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F41 RID: 3905 RVA: 0x0012849E File Offset: 0x0012669E
|
||||||
|
public void TurnOffScreen()
|
||||||
|
{
|
||||||
|
base.gameObject.SetActive(false);
|
||||||
|
if (this.rt != null)
|
||||||
|
{
|
||||||
|
this.rt.Release();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F42 RID: 3906 RVA: 0x001284C8 File Offset: 0x001266C8
|
||||||
|
private bool Clicked()
|
||||||
|
{
|
||||||
|
if (Links.x.joy)
|
||||||
|
{
|
||||||
|
if (Links.x.gameplay.cancelStart || Links.x.gameplay.actionStart || Links.x.gameplay.interactStart)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1) || Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.Return))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F43 RID: 3907 RVA: 0x0012853B File Offset: 0x0012673B
|
||||||
|
public void ReturnToGame()
|
||||||
|
{
|
||||||
|
Records.x.RemoveControls(false);
|
||||||
|
Links.x.gameplay.TogglePause(false);
|
||||||
|
Records.x.SetTypingState(false);
|
||||||
|
base.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F44 RID: 3908 RVA: 0x0012856F File Offset: 0x0012676F
|
||||||
|
public void BuyGame()
|
||||||
|
{
|
||||||
|
if (Links.x.main)
|
||||||
|
{
|
||||||
|
EventSystem.current.SetSelectedGameObject(null);
|
||||||
|
}
|
||||||
|
Application.OpenURL("https://banquetforfools.com/");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F45 RID: 3909 RVA: 0x00128597 File Offset: 0x00126797
|
||||||
|
public void WatchTrailer()
|
||||||
|
{
|
||||||
|
this.animator.Play("DemoScreenTrailer");
|
||||||
|
if (Links.x.mk)
|
||||||
|
{
|
||||||
|
EventSystem.current.SetSelectedGameObject(null);
|
||||||
|
}
|
||||||
|
base.StartCoroutine(this.TrailerStart());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F46 RID: 3910 RVA: 0x001285CD File Offset: 0x001267CD
|
||||||
|
private IEnumerator TrailerStart()
|
||||||
|
{
|
||||||
|
RenderTextureFormat renderTextureFormat = RenderTextureFormat.ARGB32;
|
||||||
|
this.rt = new RenderTexture(1920, 1080, 24, renderTextureFormat);
|
||||||
|
this.startVideo.targetTexture = this.rt;
|
||||||
|
this.videoImg.texture = this.rt;
|
||||||
|
this.startVideo.isLooping = false;
|
||||||
|
this.startVideo.SetDirectAudioVolume(0, Links.x.options.musicVolume);
|
||||||
|
yield return new WaitForSecondsRealtime(0.25f);
|
||||||
|
this.startVideo.enabled = true;
|
||||||
|
this.startVideo.loopPointReached += this.TrailerEndReached;
|
||||||
|
this.videoImg.enabled = true;
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000F47 RID: 3911 RVA: 0x001285DC File Offset: 0x001267DC
|
||||||
|
public void TrailerEndReached(VideoPlayer vp)
|
||||||
|
{
|
||||||
|
this.coroutineStart = this.VideoStart();
|
||||||
|
base.StartCoroutine(this.coroutineStart);
|
||||||
|
this.animator.Play("DemoScreenIn", 0, 0f);
|
||||||
|
this.startVideo.loopPointReached -= this.TrailerEndReached;
|
||||||
|
this.startVideo.isLooping = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x040018FE RID: 6398
|
||||||
|
public VideoPlayer startVideo;
|
||||||
|
|
||||||
|
// Token: 0x040018FF RID: 6399
|
||||||
|
public VideoPlayer loopVideo;
|
||||||
|
|
||||||
|
// Token: 0x04001900 RID: 6400
|
||||||
|
public VideoClip mmVideoStart;
|
||||||
|
|
||||||
|
// Token: 0x04001901 RID: 6401
|
||||||
|
public VideoClip mmVideoStartLinux;
|
||||||
|
|
||||||
|
// Token: 0x04001902 RID: 6402
|
||||||
|
public VideoClip mmVideoStartWindows7;
|
||||||
|
|
||||||
|
// Token: 0x04001903 RID: 6403
|
||||||
|
public VideoClip trailerVideo;
|
||||||
|
|
||||||
|
// Token: 0x04001904 RID: 6404
|
||||||
|
public VideoClip trailerVideoLinux;
|
||||||
|
|
||||||
|
// Token: 0x04001905 RID: 6405
|
||||||
|
public RawImage videoImg;
|
||||||
|
|
||||||
|
// Token: 0x04001906 RID: 6406
|
||||||
|
private RenderTexture rt;
|
||||||
|
|
||||||
|
// Token: 0x04001907 RID: 6407
|
||||||
|
private IEnumerator coroutineStart;
|
||||||
|
|
||||||
|
// Token: 0x04001908 RID: 6408
|
||||||
|
public Animator animator;
|
||||||
|
|
||||||
|
// Token: 0x04001909 RID: 6409
|
||||||
|
private int clickCount;
|
||||||
|
|
||||||
|
// Token: 0x0400190A RID: 6410
|
||||||
|
private float clickTime;
|
||||||
|
|
||||||
|
// Token: 0x0400190B RID: 6411
|
||||||
|
private bool done;
|
||||||
|
|
||||||
|
// Token: 0x0400190C RID: 6412
|
||||||
|
public bool forDemo;
|
||||||
|
|
||||||
|
// Token: 0x0400190D RID: 6413
|
||||||
|
public RectTransform rectTransform;
|
||||||
|
|
||||||
|
// Token: 0x0400190E RID: 6414
|
||||||
|
public RectTransform rectTransformBlack;
|
||||||
|
|
||||||
|
// Token: 0x0400190F RID: 6415
|
||||||
|
public GameObject loadBtn;
|
||||||
|
|
||||||
|
// Token: 0x04001910 RID: 6416
|
||||||
|
public TextMeshProUGUI skipText;
|
||||||
|
|
||||||
|
// Token: 0x04001911 RID: 6417
|
||||||
|
private StringFast str = new StringFast(32);
|
||||||
|
}
|
||||||
7853
Projects/BanquetForFools/Source/Assembly-CSharp/Dialogue.cs
Normal file
7853
Projects/BanquetForFools/Source/Assembly-CSharp/Dialogue.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Token: 0x02000026 RID: 38
|
||||||
|
public class DialogueSounds : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Token: 0x06000669 RID: 1641 RVA: 0x0008620B File Offset: 0x0008440B
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600066A RID: 1642 RVA: 0x00086210 File Offset: 0x00084410
|
||||||
|
public void PlaySound()
|
||||||
|
{
|
||||||
|
string parsedText = this.textComponent.GetParsedText();
|
||||||
|
int maxVisibleCharacters = this.textComponent.maxVisibleCharacters;
|
||||||
|
int num = 0;
|
||||||
|
int num2 = 0;
|
||||||
|
foreach (char c in parsedText)
|
||||||
|
{
|
||||||
|
if (num2 == maxVisibleCharacters)
|
||||||
|
{
|
||||||
|
num = (int)(char.ToUpper(c) - 'A');
|
||||||
|
if (num < 0)
|
||||||
|
{
|
||||||
|
num = 26;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
num2++;
|
||||||
|
}
|
||||||
|
this.audioPlayer.clip = this.audioArray[num];
|
||||||
|
this.audioPlayer.volume = Links.x.options.soundVolume * 0.3f;
|
||||||
|
this.audioPlayer.Play();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x04000924 RID: 2340
|
||||||
|
public TextMeshProUGUI textComponent;
|
||||||
|
|
||||||
|
// Token: 0x04000925 RID: 2341
|
||||||
|
public AudioSource audioPlayer;
|
||||||
|
|
||||||
|
// Token: 0x04000926 RID: 2342
|
||||||
|
public List<AudioClip> audioArray = new List<AudioClip>();
|
||||||
|
}
|
||||||
3102
Projects/BanquetForFools/Source/Assembly-CSharp/Diorama.cs
Normal file
3102
Projects/BanquetForFools/Source/Assembly-CSharp/Diorama.cs
Normal file
File diff suppressed because it is too large
Load Diff
101
Projects/BanquetForFools/Source/Assembly-CSharp/DockFriend.cs
Normal file
101
Projects/BanquetForFools/Source/Assembly-CSharp/DockFriend.cs
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
// Token: 0x02000027 RID: 39
|
||||||
|
public class DockFriend : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerDownHandler, IPointerUpHandler, IPointerExitHandler
|
||||||
|
{
|
||||||
|
// Token: 0x0600066C RID: 1644 RVA: 0x000862C8 File Offset: 0x000844C8
|
||||||
|
public void Setup(Character c, Character boundToCharacter)
|
||||||
|
{
|
||||||
|
this.character = c;
|
||||||
|
this.boundCharacterName = boundToCharacter.stats.GetName();
|
||||||
|
Links.x.renderPortraits.AddCharacter(null, this.character.stats.xmlName, null, false, null, this.raw, null, null);
|
||||||
|
this.UpdateHealth();
|
||||||
|
this.dock = boundToCharacter.portrait.skillBag;
|
||||||
|
base.transform.SetParent(boundToCharacter.portrait.skillBag.weaponTransform);
|
||||||
|
this.dock.AddButton(this.btn);
|
||||||
|
base.gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
|
||||||
|
base.gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600066D RID: 1645 RVA: 0x0008638B File Offset: 0x0008458B
|
||||||
|
public void UpdateHealth()
|
||||||
|
{
|
||||||
|
this.healthBar.fillAmount = 1f - (float)this.character.stats.HealthCurrent() / (float)this.character.stats.HealthMax();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600066E RID: 1646 RVA: 0x000863C1 File Offset: 0x000845C1
|
||||||
|
public void RemovePortrait()
|
||||||
|
{
|
||||||
|
Links.x.renderPortraits.RemoveCharacter(null, this.character.stats.xmlName, this.raw.texture);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0600066F RID: 1647 RVA: 0x000863F0 File Offset: 0x000845F0
|
||||||
|
public void AddPortrait()
|
||||||
|
{
|
||||||
|
Links.x.renderPortraits.AddCharacter(null, this.character.stats.xmlName, null, false, null, this.raw, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000670 RID: 1648 RVA: 0x00086428 File Offset: 0x00084628
|
||||||
|
public void Remove()
|
||||||
|
{
|
||||||
|
Links.x.renderPortraits.RemoveCharacter(null, this.character.stats.xmlName, this.raw.texture);
|
||||||
|
base.transform.SetParent(Links.x.hudControl.miscFolderQuipsTransform);
|
||||||
|
if (this.dock)
|
||||||
|
{
|
||||||
|
this.dock.RemoveButton(this.btn);
|
||||||
|
}
|
||||||
|
Links.x.cellar.ReturnPooledGameObject(121, base.gameObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000671 RID: 1649 RVA: 0x000864B0 File Offset: 0x000846B0
|
||||||
|
public void OnPointerEnter(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
this.str.Clear();
|
||||||
|
this.str.Append(this.character.stats.GetName());
|
||||||
|
this.str.Append(" ");
|
||||||
|
this.str.Append(this.character.stats.HealthCurrent());
|
||||||
|
this.str.Append("/");
|
||||||
|
this.str.Append(this.character.stats.HealthMax());
|
||||||
|
this.dock.TooltipOn(null, base.gameObject, this.str.ToString(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000672 RID: 1650 RVA: 0x0008655D File Offset: 0x0008475D
|
||||||
|
public void OnPointerExit(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
this.dock.TooltipOff();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000673 RID: 1651 RVA: 0x0008656A File Offset: 0x0008476A
|
||||||
|
public void OnPointerDown(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000674 RID: 1652 RVA: 0x0008656C File Offset: 0x0008476C
|
||||||
|
public void OnPointerUp(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x04000927 RID: 2343
|
||||||
|
public Character character;
|
||||||
|
|
||||||
|
// Token: 0x04000928 RID: 2344
|
||||||
|
public string boundCharacterName;
|
||||||
|
|
||||||
|
// Token: 0x04000929 RID: 2345
|
||||||
|
public RawImage raw;
|
||||||
|
|
||||||
|
// Token: 0x0400092A RID: 2346
|
||||||
|
public Image healthBar;
|
||||||
|
|
||||||
|
// Token: 0x0400092B RID: 2347
|
||||||
|
private SkillBag dock;
|
||||||
|
|
||||||
|
// Token: 0x0400092C RID: 2348
|
||||||
|
public Button btn;
|
||||||
|
|
||||||
|
// Token: 0x0400092D RID: 2349
|
||||||
|
private StringFast str = new StringFast(32);
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user