using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using DM;
using HarmonyLib;
using Landfall.TABS;
using Landfall.TABS.UnitEditor;
using SLMA;
using TechnicalItems;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("TechnicalItems")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("GeeztJeez")]
[assembly: AssemblyProduct("TechnicalItems")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7acfaef0-7669-4401-8bff-5a9a02e18c75")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.6.0")]
[module: UnverifiableCode]
namespace TechnicalItems;
public static class UManager
{
public class Utility : MonoBehaviour
{
public static class ItemCategorizer
{
public static void SetTag(GameObject item, string categoryName = "Technical Items", TagType tagType = 0)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
try
{
CharacterItem componentInChildren = item.GetComponentInChildren<CharacterItem>();
if (Object.op_Implicit((Object)(object)componentInChildren))
{
componentInChildren.tags = new List<Tag>
{
new Tag
{
tagType = tagType,
value = categoryName
}
};
}
}
catch (Exception ex)
{
Debug.Log((object)ex);
}
}
}
public static Sprite Image2Sprite(string name)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Expected O, but got Unknown
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name);
Texture2D val = new Texture2D(4, 4);
byte[] array = new byte[stream.Length];
stream.Read(array, 0, (int)stream.Length);
((Texture)val).filterMode = (FilterMode)0;
ImageConversion.LoadImage(val, array);
return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
}
}
public static string comment;
public static void SetClothItems(GameObject cloth, CharacterItem item, PropItemData data, LandfallContentDatabase db)
{
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Expected O, but got Unknown
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Expected O, but got Unknown
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("MeleeTrailLeft"))
{
cloth.AddComponent<MeleeTrail>().right = false;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("MeleeTrailRight"))
{
cloth.AddComponent<MeleeTrail>().right = true;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("SkinChanges"))
{
cloth.AddComponent<SkinnedChanges>();
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("AlwaysOpenedEyes"))
{
GameObject val = UPool.MyPool.AddObject("AlwaysOpenedEyes_Eye", cloth.GetComponentInChildren<EyeSpawner>().eyeObject, true, (HideFlags)52, (Sprite)null, 0, false);
((Renderer)val.GetComponentsInChildren<MeshRenderer>()[0]).material = (Material)SLMALoader.SDic["materials"]["Eye"];
((Renderer)val.GetComponentsInChildren<MeshRenderer>()[1]).material = (Material)SLMALoader.SDic["materials"]["EyeBlack"];
val.AddComponent<EyeKeepOpened>();
cloth.GetComponentInChildren<EyeSpawner>().eyeObject = val;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("FlipRightW") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleRightW") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleRightW") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("NulifyScaleRightW") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("RemoveRightWParticles") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("RemoveRightWProj") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("FlipLeftW") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleLeftW") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleLeftW") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("NulifyScaleLeftW") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("RemoveLeftWParticles") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("RemoveLeftWProj") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleRightWX") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleRightWX") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleRightWY") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleRightWY") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleRightWZ") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleRightWZ") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleLeftWX") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleLeftWX") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleLeftWY") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleLeftWY") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleLeftWZ") || (Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleLeftWZ"))
{
cloth.AddComponent<RemoveSkinnedMeshes>();
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleRightWX"))
{
cloth.AddComponent<ScaleWeaponX>().right = true;
cloth.GetComponentInChildren<ScaleWeaponX>().scaleMultiplier = 1.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleLeftWX"))
{
cloth.AddComponent<ScaleWeaponX>().right = false;
cloth.GetComponentInChildren<ScaleWeaponX>().scaleMultiplier = 1.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleRightWX"))
{
cloth.AddComponent<ScaleWeaponX>().right = true;
cloth.GetComponentInChildren<ScaleWeaponX>().scaleMultiplier = 0.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleLeftWX"))
{
cloth.AddComponent<ScaleWeaponX>().right = false;
cloth.GetComponentInChildren<ScaleWeaponX>().scaleMultiplier = 0.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleRightWY"))
{
cloth.AddComponent<ScaleWeaponY>().right = true;
cloth.GetComponentInChildren<ScaleWeaponY>().scaleMultiplier = 1.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleLeftWY"))
{
cloth.AddComponent<ScaleWeaponY>().right = false;
cloth.GetComponentInChildren<ScaleWeaponY>().scaleMultiplier = 1.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleRightWY"))
{
cloth.AddComponent<ScaleWeaponY>().right = true;
cloth.GetComponentInChildren<ScaleWeaponY>().scaleMultiplier = 0.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleLeftWY"))
{
cloth.AddComponent<ScaleWeaponY>().right = false;
cloth.GetComponentInChildren<ScaleWeaponY>().scaleMultiplier = 0.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleRightWZ"))
{
cloth.AddComponent<ScaleWeaponZ>().right = true;
cloth.GetComponentInChildren<ScaleWeaponZ>().scaleMultiplier = 1.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleLeftWZ"))
{
cloth.AddComponent<ScaleWeaponZ>().right = false;
cloth.GetComponentInChildren<ScaleWeaponZ>().scaleMultiplier = 1.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleRightWZ"))
{
cloth.AddComponent<ScaleWeaponZ>().right = true;
cloth.GetComponentInChildren<ScaleWeaponZ>().scaleMultiplier = 0.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleLeftWZ"))
{
cloth.AddComponent<ScaleWeaponZ>().right = false;
cloth.GetComponentInChildren<ScaleWeaponZ>().scaleMultiplier = 0.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleRightW"))
{
cloth.AddComponent<ScaleWeapon>().right = true;
cloth.GetComponentInChildren<ScaleWeapon>().scaleMultiplier = 1.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("DoublesScaleLeftW"))
{
cloth.AddComponent<ScaleWeapon>().right = false;
cloth.GetComponentInChildren<ScaleWeapon>().scaleMultiplier = 1.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleRightW"))
{
cloth.AddComponent<ScaleWeapon>().right = true;
cloth.GetComponentInChildren<ScaleWeapon>().scaleMultiplier = 0.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("HalfesScaleLeftW"))
{
cloth.AddComponent<ScaleWeapon>().right = false;
cloth.GetComponentInChildren<ScaleWeapon>().scaleMultiplier = 0.5f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("FlipRightW"))
{
cloth.AddComponent<FlipWeapon>().right = true;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("FlipLeftW"))
{
cloth.AddComponent<FlipWeapon>().right = false;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("NulifyScaleRightW"))
{
cloth.AddComponent<ScaleWeapon>().right = true;
cloth.GetComponentInChildren<ScaleWeapon>().scaleMultiplier = 0f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("NulifyScaleLeftW"))
{
cloth.AddComponent<ScaleWeapon>().right = false;
cloth.GetComponentInChildren<ScaleWeapon>().scaleMultiplier = 0f;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("RemoveRightWParticles"))
{
cloth.AddComponent<RemoveWeaponParticles>().right = true;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("RemoveLeftWParticles"))
{
cloth.AddComponent<RemoveWeaponParticles>().right = false;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("RemoveRightWProj"))
{
cloth.AddComponent<RemoveWeaponProjectiles>().right = true;
}
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("RemoveLefttWProj"))
{
cloth.AddComponent<RemoveWeaponProjectiles>().right = false;
}
}
public static void SetMovesItems(GameObject move, LandfallContentDatabase db)
{
//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
//IL_0257: Unknown result type (might be due to invalid IL or missing references)
//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
//IL_030f: Unknown result type (might be due to invalid IL or missing references)
//IL_0329: Unknown result type (might be due to invalid IL or missing references)
//IL_0343: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("HalvesProjectiles"))
{
move.AddComponent<HalvesProjectiles>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("MultiplyProjectiles"))
{
move.AddComponent<MultiplyProjectiles>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("NoFallDamage"))
{
move.AddComponent<NoFallDamage>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("StandStill"))
{
move.AddComponent<StandStill>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("FusionWithRider"))
{
move.AddComponent<GetAndDeleteRider>();
move.AddComponent<FusionMechanic>();
move.GetComponentInChildren<UnitSpawner>().destroyroot = false;
move.GetComponentInChildren<UnitSpawner>().transferHp = false;
move.GetComponentInChildren<UnitSpawner>().switchIfRanged = true;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("WeaponDoubledRange"))
{
move.AddComponent<WeaponRangeDoubler>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("MeleeAddDash"))
{
move.AddComponent<AddMeleeDash>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("MeleeAddDissarm"))
{
move.AddComponent<AddMeleeDissarm>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("MeleeAddBlink"))
{
move.AddComponent<AddMeleeBlinks>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("WeaponSwapWhenBelowHalf"))
{
move.AddComponent<SwapDistanceHalf>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("WeaponSwapWhenTargetDistance"))
{
move.AddComponent<SwapDistanceBase>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("AlwaysTansferHP"))
{
move.AddComponent<TransferHPEnable>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("NeverShowHealthBar"))
{
move.AddComponent<NeverShowHealthBar>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("TransformToRiderWhenHealthHalfCondition"))
{
move.AddComponent<GetAndDeleteRider>();
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].conditionType = (ConditionType)12;
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].value = 0.5f;
((Component)move.transform.FindChild("DarkKingSword")).gameObject.SetActive(false);
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("TransformToRiderWhenHealthQuarterCondition"))
{
move.AddComponent<GetAndDeleteRider>();
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].conditionType = (ConditionType)12;
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].value = 0.25f;
((Component)move.transform.FindChild("DarkKingSword")).gameObject.SetActive(false);
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("TransformToRiderWhenTargetFarCondition"))
{
move.AddComponent<GetAndDeleteRider>();
move.GetComponentInChildren<UnitSpawner>().transferHp = false;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("TransformToRiderWhenTargetCloseCondition"))
{
move.AddComponent<GetAndDeleteRider>();
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].conditionType = (ConditionType)1;
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].whichRange = (WhichRange)0;
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].rangeType = (RangeType)0;
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].valueType = (ValueType)1;
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].onlyCountWhenUnitInRange = false;
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].alwaysResetCounter = false;
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].cooldownRange = 10f;
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].counter = 3f;
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].value = 10f;
move.GetComponentInChildren<UnitSpawner>().transferHp = false;
move.GetComponentInChildren<UnitSpawner>().switchIfRanged = true;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("TransformToRider10SecondsCondition"))
{
move.GetComponentInChildren<ConditionalEvent>().events[0].delay = 10f;
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions = null;
move.AddComponent<GetAndDeleteRider>();
move.GetComponentInChildren<UnitSpawner>().transferHp = false;
move.GetComponentInChildren<UnitSpawner>().switchIfRanged = true;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("TransformToRiderChronoCondition"))
{
move.AddComponent<GetAndDeleteRider>();
((Component)move.transform.FindChild("TimeNinja_Clock")).gameObject.SetActive(false);
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("TransformToRiderDarkKingCondition"))
{
move.AddComponent<GetAndDeleteRider>();
((Component)move.transform.FindChild("DarkKingSword")).gameObject.SetActive(false);
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("AdaptivePirateQueenThrow"))
{
move.AddComponent<AdaptiveThrow>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("AdaptiveSenseiBurstThrow"))
{
ParticleSystem[] componentsInChildren = move.GetComponentsInChildren<ParticleSystem>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].startSize = 1.6f;
}
move.AddComponent<AdaptiveBurst>();
}
}
public static void Init(LandfallContentDatabase db)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Expected O, but got Unknown
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Expected O, but got Unknown
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Expected O, but got Unknown
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Expected O, but got Unknown
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_0151: Expected O, but got Unknown
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01b1: Expected O, but got Unknown
//IL_01df: Unknown result type (might be due to invalid IL or missing references)
//IL_01f3: Expected O, but got Unknown
//IL_0221: Unknown result type (might be due to invalid IL or missing references)
//IL_0235: Expected O, but got Unknown
//IL_0263: Unknown result type (might be due to invalid IL or missing references)
//IL_0277: Expected O, but got Unknown
//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
//IL_02b9: Expected O, but got Unknown
//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
//IL_02fb: Expected O, but got Unknown
//IL_0329: Unknown result type (might be due to invalid IL or missing references)
//IL_033d: Expected O, but got Unknown
//IL_036b: Unknown result type (might be due to invalid IL or missing references)
//IL_037f: Expected O, but got Unknown
//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
//IL_03c1: Expected O, but got Unknown
//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
//IL_0403: Expected O, but got Unknown
//IL_0431: Unknown result type (might be due to invalid IL or missing references)
//IL_0445: Expected O, but got Unknown
//IL_0473: Unknown result type (might be due to invalid IL or missing references)
//IL_0487: Expected O, but got Unknown
//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
//IL_04e7: Expected O, but got Unknown
//IL_0515: Unknown result type (might be due to invalid IL or missing references)
//IL_0529: Expected O, but got Unknown
//IL_0557: Unknown result type (might be due to invalid IL or missing references)
//IL_056b: Expected O, but got Unknown
//IL_0599: Unknown result type (might be due to invalid IL or missing references)
//IL_05ad: Expected O, but got Unknown
//IL_05db: Unknown result type (might be due to invalid IL or missing references)
//IL_05ef: Expected O, but got Unknown
//IL_061d: Unknown result type (might be due to invalid IL or missing references)
//IL_0631: Expected O, but got Unknown
//IL_065f: Unknown result type (might be due to invalid IL or missing references)
//IL_0673: Expected O, but got Unknown
//IL_06a1: Unknown result type (might be due to invalid IL or missing references)
//IL_06b5: Expected O, but got Unknown
//IL_06e3: Unknown result type (might be due to invalid IL or missing references)
//IL_06f7: Expected O, but got Unknown
//IL_0725: Unknown result type (might be due to invalid IL or missing references)
//IL_0739: Expected O, but got Unknown
//IL_0767: Unknown result type (might be due to invalid IL or missing references)
//IL_077b: Expected O, but got Unknown
//IL_07a9: Unknown result type (might be due to invalid IL or missing references)
//IL_07bd: Expected O, but got Unknown
//IL_089d: Unknown result type (might be due to invalid IL or missing references)
//IL_08b1: Expected O, but got Unknown
//IL_0a07: Unknown result type (might be due to invalid IL or missing references)
//IL_0a1b: Expected O, but got Unknown
//IL_0a49: Unknown result type (might be due to invalid IL or missing references)
//IL_0a5d: Expected O, but got Unknown
//IL_0a8b: Unknown result type (might be due to invalid IL or missing references)
//IL_0a9f: Expected O, but got Unknown
//IL_0acd: Unknown result type (might be due to invalid IL or missing references)
//IL_0ae1: Expected O, but got Unknown
//IL_0b0f: Unknown result type (might be due to invalid IL or missing references)
//IL_0b23: Expected O, but got Unknown
//IL_0b51: Unknown result type (might be due to invalid IL or missing references)
//IL_0b65: Expected O, but got Unknown
//IL_0b93: Unknown result type (might be due to invalid IL or missing references)
//IL_0ba7: Expected O, but got Unknown
//IL_0bd5: Unknown result type (might be due to invalid IL or missing references)
//IL_0be9: Expected O, but got Unknown
//IL_0c17: Unknown result type (might be due to invalid IL or missing references)
//IL_0c2b: Expected O, but got Unknown
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Custom Clothes";
comment = "----------------------------------------------------------------------------------------------------------------------------";
Sprite val = Utility.Image2Sprite("icon_technicalitems.png");
GameObject val2 = new GameObject();
val2.AddComponent<SpecialAbility>();
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Custom Clothes";
comment = "----------------------------------------------------------------------------------------------------------------------------";
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("MeleeTrailLeft", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 10101006, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("MeleeTrailRight", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 10101007, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("SkinChanges", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 10101008, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("AlwaysOpenedEyes", (GameObject)SLMALoader.SDic["clothes"]["SpawnEyes_DarkPeasant"], true, (HideFlags)52, val, 10101009, true), "Technical Items", (TagType)0);
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Right Weapons";
comment = "----------------------------------------------------------------------------------------------------------------------------";
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("FlipRightW", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 10101010, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleRightW", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 10101011, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleRightW", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 10101012, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("NulifyScaleRightW", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 10101013, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("RemoveRightWParticles", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 10101014, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("RemoveRightWProj", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 10101015, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleRightWX", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 40101011, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleRightWX", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 40101012, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleRightWY", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 40101013, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleRightWY", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 40101014, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleRightWZ", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 40101015, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleRightWZ", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 40101016, true), "Technical Items", (TagType)0);
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Left Weapons";
comment = "----------------------------------------------------------------------------------------------------------------------------";
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("FlipLeftW", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 20202020, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleLeftW", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 20202021, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleLeftW", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 20202022, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("NulifyScaleLeftW", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 20202023, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("RemoveLeftWParticles", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 20202024, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("RemoveLeftWProj", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 20202025, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleLeftWX", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 50101011, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleLeftWX", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 50101012, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleLeftWY", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 50101013, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleLeftWY", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 50101014, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleLeftWZ", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 50101015, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleLeftWZ", (GameObject)SLMALoader.SDic["clothes"]["Ancient_Scarf001"], true, (HideFlags)52, val, 50101016, true), "Technical Items", (TagType)0);
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Technical Abilities";
comment = "----------------------------------------------------------------------------------------------------------------------------";
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalvesProjectiles", val2, true, (HideFlags)52, val, 30303017, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("MultiplyProjectiles", val2, true, (HideFlags)52, val, 30303018, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("NoFallDamage", val2, true, (HideFlags)52, val, 30303019, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("StandStill", val2, true, (HideFlags)52, val, 30303020, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("FusionWithRider", (GameObject)SLMALoader.SDic["moves"]["Move_BatTransformation"], true, (HideFlags)52, val, 30303021, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("WeaponDoubledRange", val2, true, (HideFlags)52, val, 30303022, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("MeleeAddDash", val2, true, (HideFlags)52, val, 303030243, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("MeleeAddDissarm", val2, true, (HideFlags)52, val, 30303024, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("MeleeAddBlink", val2, true, (HideFlags)52, val, 30303025, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("WeaponSwapWhenBelowHalf", val2, true, (HideFlags)52, val, 30303026, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("WeaponSwapWhenTargetDistance", val2, true, (HideFlags)52, val, 30303027, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("AlwaysTansferHP", val2, true, (HideFlags)52, val, 30303028, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("NeverShowHealthBar", val2, true, (HideFlags)52, val, 30303029, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRiderWhenTargetFarCondition", (GameObject)SLMALoader.SDic["moves"]["Move_BatTransformation"], true, (HideFlags)52, val, 30303030, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRiderWhenTargetCloseCondition", (GameObject)SLMALoader.SDic["moves"]["Move_BatTransformation"], true, (HideFlags)52, val, 30303031, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRider10SecondsCondition", (GameObject)SLMALoader.SDic["moves"]["Move_BatTransformation"], true, (HideFlags)52, val, 30303032, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRiderChronoCondition", (GameObject)SLMALoader.SDic["moves"]["Move_TimeNinjaTransform"], true, (HideFlags)52, val, 30303033, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRiderDarkKingCondition", (GameObject)SLMALoader.SDic["moves"]["Move_DarkkingTransform"], true, (HideFlags)52, val, 30303034, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRiderWhenHealthHalfCondition", (GameObject)SLMALoader.SDic["moves"]["Move_DarkkingTransform"], true, (HideFlags)52, val, 30303036, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRiderWhenHealthQuarterCondition", (GameObject)SLMALoader.SDic["moves"]["Move_DarkkingTransform"], true, (HideFlags)52, val, 30303037, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("AdaptivePirateQueenThrow", (GameObject)SLMALoader.SDic["moves"]["Move_PirateQueen_Bombs"], true, (HideFlags)52, val, 30303038, true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("AdaptiveSenseiBurstThrow", (GameObject)SLMALoader.SDic["moves"]["Move_Sensei_Tornado"], true, (HideFlags)52, val, 30303035, true), "Technical Items", (TagType)0);
}
}
[BepInPlugin("GeeztJeez.Technicalitems", "TechnicalItems", "1.0.6")]
internal class Loader : BaseUnityPlugin
{
private void Awake()
{
((MonoBehaviour)this).StartCoroutine("Call");
}
private IEnumerator Call()
{
yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)Object.FindObjectOfType<ServiceLocator>() != (Object)null));
yield return (object)new WaitUntil((Func<bool>)(() => ServiceLocator.GetService<ISaveLoaderService>() != null));
Debug.Log((object)"Loading TechnicalItems...");
SLMALoader.GetInstance();
LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
UManager.Init(landfallContentDatabase);
new Harmony("TechnicalItems").PatchAll();
GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
for (int i = 0; i < array.Length; i++)
{
if (Object.op_Implicit((Object)(object)array[i].GetComponent<SpecialAbility>()))
{
UManager.SetMovesItems(array[i], landfallContentDatabase);
}
if (Object.op_Implicit((Object)(object)array[i].GetComponent<PropItem>()))
{
UManager.SetClothItems(array[i], array[i].GetComponent<CharacterItem>(), array[i].GetComponent<PropItemData>(), landfallContentDatabase);
}
}
Debug.Log((object)"Loaded TechnicalItems Successfully!");
}
}
public class RemoveSkinnedMeshes : MonoBehaviour
{
private void Start()
{
SkinnedMeshRenderer[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<SkinnedMeshRenderer>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
if (((Object)((Component)componentsInChildren[i]).gameObject).name.Contains("LOD"))
{
Object.Destroy((Object)(object)((Component)componentsInChildren[i]).gameObject);
}
}
}
}
public class AddVanillaCompatibility : MonoBehaviour
{
private void Start()
{
UManager.comment = "I tried, it was worth trying but didn't worth as much as having blood and extremely painful headache :(";
}
private void Update()
{
if (((Component)this).gameObject.tag.EndsWith("(TI)"))
{
Debug.Log((object)("Verified Tag is " + ((Component)this).gameObject.tag));
Debug.Log((object)"Adding Permanent Script to unit!");
}
else
{
Debug.Log((object)("Undetected Tag is " + ((Component)this).gameObject.tag));
}
}
}
public class FlipWeapon : MonoBehaviour
{
private Unit unit;
public bool right;
private void Start()
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
if (right)
{
Transform transform = ((Component)unit.data.weaponHandler.rightWeapon).gameObject.transform;
transform.localScale *= -1f;
}
if (!right)
{
Transform transform2 = ((Component)unit.data.weaponHandler.leftWeapon).gameObject.transform;
transform2.localScale *= -1f;
}
}
}
public class ScaleWeapon : MonoBehaviour
{
private Unit unit;
public bool right;
public float scaleMultiplier;
private void Start()
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
if (right)
{
Transform transform = ((Component)unit.data.weaponHandler.rightWeapon).gameObject.transform;
transform.localScale *= scaleMultiplier;
}
if (!right)
{
Transform transform2 = ((Component)unit.data.weaponHandler.leftWeapon).gameObject.transform;
transform2.localScale *= scaleMultiplier;
}
}
}
public class RemoveWeaponParticles : MonoBehaviour
{
private Unit unit;
private Weapon weapon;
public bool right;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
if (right)
{
weapon = unit.data.weaponHandler.rightWeapon;
}
if (!right)
{
weapon = unit.data.weaponHandler.leftWeapon;
}
ParticleSystem[] componentsInChildren = ((Component)weapon).gameObject.GetComponentsInChildren<ParticleSystem>();
foreach (ParticleSystem obj in componentsInChildren)
{
Object.Destroy((Object)(object)((Component)obj).gameObject.GetComponentInChildren<ParticleSystemRenderer>());
Object.Destroy((Object)(object)obj);
}
}
}
public class RemoveWeaponProjectiles : MonoBehaviour
{
private Unit unit;
private Weapon weapon;
public bool right;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
if (right)
{
weapon = unit.data.weaponHandler.rightWeapon;
}
if (!right)
{
weapon = unit.data.weaponHandler.leftWeapon;
}
if (Object.op_Implicit((Object)(object)((Component)weapon).gameObject.GetComponentInChildren<RangeWeapon>()))
{
((Component)weapon).gameObject.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = null;
((Component)weapon).gameObject.GetComponentInChildren<RangeWeapon>().unitToSpawn = null;
}
}
}
public class GetAndDeleteRider : MonoBehaviour
{
private UnitSpawner unitSpawner;
private void Start()
{
GameObject obj = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<RiderHolder>().riders[0];
UnitBlueprint unitBlueprint = obj.GetComponentInChildren<Unit>().unitBlueprint;
unitSpawner = ((Component)this).gameObject.GetComponentInChildren<UnitSpawner>();
unitSpawner.unitBlueprint = unitBlueprint;
unitSpawner.rangedUnitBlueprint = unitBlueprint;
Object.Destroy((Object)(object)obj.gameObject);
}
}
public class AdaptiveBurst : MonoBehaviour
{
private Color color;
private Unit unit;
private RangeWeapon[] rangeWeapons;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
}
private void Update()
{
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Expected O, but got Unknown
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Expected O, but got Unknown
rangeWeapons = ((Component)unit).gameObject.GetComponentsInChildren<RangeWeapon>();
if (rangeWeapons.Length != 0)
{
int num = Random.Range(0, rangeWeapons.Length);
SpawnObject[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<SpawnObject>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].objectToSpawn = rangeWeapons[num].ObjectToSpawn;
}
Renderer[] componentsInChildren2 = rangeWeapons[num].ObjectToSpawn.GetComponentsInChildren<Renderer>();
foreach (Renderer val in componentsInChildren2)
{
color = val.material.color;
}
ParticleSystem[] componentsInChildren3 = ((Component)this).GetComponentsInChildren<ParticleSystem>();
for (int k = 0; k < componentsInChildren3.Length; k++)
{
componentsInChildren3[k].startColor = color;
}
ParticleSystemRenderer[] componentsInChildren4 = ((Component)this).GetComponentsInChildren<ParticleSystemRenderer>();
foreach (ParticleSystemRenderer obj in componentsInChildren4)
{
((Renderer)obj).material = new Material(((Renderer)obj).material)
{
color = color
};
obj.trailMaterial = new Material(obj.trailMaterial)
{
color = color
};
}
}
}
}
public class AdaptiveThrow : MonoBehaviour
{
private Unit unit;
private RangeWeapon[] rangeWeapons;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
}
private void Update()
{
rangeWeapons = ((Component)unit).gameObject.GetComponentsInChildren<RangeWeapon>();
if (rangeWeapons.Length != 0)
{
int num = Random.Range(0, rangeWeapons.Length);
SpawnObject[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<SpawnObject>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].objectToSpawn = rangeWeapons[num].ObjectToSpawn;
}
}
}
}
public class NeverShowHealthBar : MonoBehaviour
{
private Unit unit;
public void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
}
public void Update()
{
unit.SetHealthBarActive(false);
}
}
public class EyeKeepOpened : MonoBehaviour
{
public void Update()
{
((Component)this).gameObject.GetComponentInChildren<GooglyEye>().SetState((EyeState)0);
}
}
public class TransferHPEnable : MonoBehaviour
{
private Unit unit;
public void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
}
public void Update()
{
UnitSpawner[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren<UnitSpawner>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].transferHp = true;
}
}
}
public class ScaleWeaponY : MonoBehaviour
{
private Unit unit;
public bool right;
public float scaleMultiplier;
private void Start()
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
if (right)
{
Vector3 localScale = ((Component)unit.data.weaponHandler.rightWeapon).gameObject.transform.localScale;
((Component)unit.data.weaponHandler.rightWeapon).gameObject.transform.localScale = new Vector3(localScale.x, localScale.y * scaleMultiplier, localScale.z);
}
if (!right)
{
Vector3 localScale2 = ((Component)unit.data.weaponHandler.leftWeapon).gameObject.transform.localScale;
((Component)unit.data.weaponHandler.leftWeapon).gameObject.transform.localScale = new Vector3(localScale2.x, localScale2.y * scaleMultiplier, localScale2.z);
}
}
}
public class ScaleWeaponZ : MonoBehaviour
{
private Unit unit;
public bool right;
public float scaleMultiplier;
private void Start()
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
if (right)
{
Vector3 localScale = ((Component)unit.data.weaponHandler.rightWeapon).gameObject.transform.localScale;
((Component)unit.data.weaponHandler.rightWeapon).gameObject.transform.localScale = new Vector3(localScale.x, localScale.y, localScale.z * scaleMultiplier);
}
if (!right)
{
Vector3 localScale2 = ((Component)unit.data.weaponHandler.leftWeapon).gameObject.transform.localScale;
((Component)unit.data.weaponHandler.leftWeapon).gameObject.transform.localScale = new Vector3(localScale2.x, localScale2.y, localScale2.z * scaleMultiplier);
}
}
}
public class ScaleWeaponX : MonoBehaviour
{
private Unit unit;
public bool right;
public float scaleMultiplier;
private void Start()
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
if (right)
{
Vector3 localScale = ((Component)unit.data.weaponHandler.rightWeapon).gameObject.transform.localScale;
((Component)unit.data.weaponHandler.rightWeapon).gameObject.transform.localScale = new Vector3(localScale.x * scaleMultiplier, localScale.y, localScale.z);
}
if (!right)
{
Vector3 localScale2 = ((Component)unit.data.weaponHandler.leftWeapon).gameObject.transform.localScale;
((Component)unit.data.weaponHandler.leftWeapon).gameObject.transform.localScale = new Vector3(localScale2.x * scaleMultiplier, localScale2.y, localScale2.z);
}
}
}
public class SwapDistanceBase : MonoBehaviour
{
private HoldingHandler holdingHandler;
private Unit unit;
private bool swapped;
private GameObject leftObject;
private Holdable leftObjectHoldable;
private GameObject rightObject;
private Holdable rightObjectHoldable;
private WeaponHandler WeaponHandler;
public void Start()
{
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
if (!Object.op_Implicit((Object)(object)unit))
{
return;
}
WeaponHandler = unit.WeaponHandler;
holdingHandler = unit.holdingHandler;
if (!Object.op_Implicit((Object)(object)holdingHandler))
{
return;
}
if (Object.op_Implicit((Object)(object)holdingHandler.rightObject))
{
rightObject = ((Component)holdingHandler.rightObject).gameObject;
rightObjectHoldable = holdingHandler.rightObject;
}
if (Object.op_Implicit((Object)(object)holdingHandler.leftObject))
{
leftObject = ((Component)holdingHandler.leftObject).gameObject;
leftObjectHoldable = holdingHandler.leftObject;
holdingHandler.LetGoOfWeapon(leftObject);
if (Object.op_Implicit((Object)(object)holdingHandler.rightObject))
{
holdingHandler.leftObject = holdingHandler.rightObject;
holdingHandler.leftHandActivity = (HandActivity)1;
}
Scaler(leftObject, Vector3.zero);
}
}
public void Update()
{
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
float num = 5f;
if (Object.op_Implicit((Object)(object)unit))
{
if (!Object.op_Implicit((Object)(object)rightObject))
{
rightObject = ((Component)holdingHandler.rightObject).gameObject;
rightObjectHoldable = holdingHandler.rightObject;
}
if (!Object.op_Implicit((Object)(object)leftObject))
{
leftObject = ((Component)holdingHandler.leftObject).gameObject;
leftObjectHoldable = holdingHandler.leftObject;
holdingHandler.LetGoOfWeapon(leftObject);
if (Object.op_Implicit((Object)(object)holdingHandler.rightObject))
{
holdingHandler.leftObject = holdingHandler.rightObject;
holdingHandler.leftHandActivity = (HandActivity)1;
}
Scaler(leftObject, Vector3.zero);
}
}
if (Object.op_Implicit((Object)(object)unit.data.targetData) && !unit.data.Dead)
{
if (Vector3.Distance(unit.data.mainRig.position, unit.data.targetData.mainRig.position) <= num && !swapped)
{
WeaponSwap(SwapToLeft: true);
swapped = true;
}
else if (Vector3.Distance(unit.data.mainRig.position, unit.data.targetData.mainRig.position) > num && swapped)
{
WeaponSwap(SwapToLeft: false);
swapped = false;
}
}
}
public void WeaponSwap(bool SwapToLeft)
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("UI/EquipWeapon", 1f, unit.data.mainRig.position, (MaterialType)0, (Transform)null, 0f);
if (!((Object)(object)leftObject != (Object)null) || !((Object)(object)rightObject != (Object)null))
{
return;
}
if (SwapToLeft)
{
holdingHandler.LetGoOfWeapon(rightObject);
holdingHandler.GrabObject(leftObjectHoldable, true, true, (Action)delegate
{
});
if (Object.op_Implicit((Object)(object)holdingHandler.leftObject))
{
holdingHandler.rightObject = holdingHandler.leftObject;
}
Scaler(rightObject, Vector3.zero);
Scaler(leftObject, Vector3.one);
holdingHandler.leftHandActivity = (HandActivity)1;
holdingHandler.rightHandActivity = (HandActivity)1;
WeaponHandler.SetWeapon(leftObject.GetComponentInChildren<Weapon>(), (HandType)0);
}
else if (!SwapToLeft)
{
holdingHandler.LetGoOfWeapon(leftObject);
holdingHandler.GrabObject(rightObjectHoldable, true, true, (Action)delegate
{
});
if (Object.op_Implicit((Object)(object)holdingHandler.leftObject))
{
holdingHandler.leftObject = holdingHandler.rightObject;
}
Scaler(rightObject, Vector3.one);
Scaler(leftObject, Vector3.zero);
holdingHandler.leftHandActivity = (HandActivity)1;
holdingHandler.rightHandActivity = (HandActivity)1;
WeaponHandler.SetWeapon(rightObject.GetComponentInChildren<Weapon>(), (HandType)0);
}
}
public void Scaler(GameObject basedGameObject, Vector3 scale)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
basedGameObject.transform.localScale = scale;
}
}
public class SwapDistanceHalf : MonoBehaviour
{
private HoldingHandler holdingHandler;
private Unit unit;
private bool swapped;
private GameObject leftObject;
private Holdable leftObjectHoldable;
private GameObject rightObject;
private Holdable rightObjectHoldable;
private WeaponHandler WeaponHandler;
public void Start()
{
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
if (!Object.op_Implicit((Object)(object)unit))
{
return;
}
WeaponHandler = unit.WeaponHandler;
holdingHandler = unit.holdingHandler;
if (!Object.op_Implicit((Object)(object)holdingHandler))
{
return;
}
if (Object.op_Implicit((Object)(object)holdingHandler.rightObject))
{
rightObject = ((Component)holdingHandler.rightObject).gameObject;
rightObjectHoldable = holdingHandler.rightObject;
}
if (Object.op_Implicit((Object)(object)holdingHandler.leftObject))
{
leftObject = ((Component)holdingHandler.leftObject).gameObject;
leftObjectHoldable = holdingHandler.leftObject;
holdingHandler.LetGoOfWeapon(leftObject);
if (Object.op_Implicit((Object)(object)holdingHandler.rightObject))
{
holdingHandler.leftObject = holdingHandler.rightObject;
holdingHandler.leftHandActivity = (HandActivity)1;
}
Scaler(leftObject, Vector3.zero);
}
}
public void Update()
{
//IL_014b: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
float num = unit.data.maxHealth * 0.5f;
if (Object.op_Implicit((Object)(object)unit))
{
if (!Object.op_Implicit((Object)(object)rightObject))
{
rightObject = ((Component)holdingHandler.rightObject).gameObject;
rightObjectHoldable = holdingHandler.rightObject;
}
if (!Object.op_Implicit((Object)(object)leftObject))
{
leftObject = ((Component)holdingHandler.leftObject).gameObject;
leftObjectHoldable = holdingHandler.leftObject;
holdingHandler.LetGoOfWeapon(leftObject);
if (Object.op_Implicit((Object)(object)holdingHandler.rightObject))
{
holdingHandler.leftObject = holdingHandler.rightObject;
holdingHandler.leftHandActivity = (HandActivity)1;
}
Scaler(leftObject, Vector3.zero);
}
}
if (Object.op_Implicit((Object)(object)unit.data.targetData) && !unit.data.Dead)
{
if (unit.data.health <= num && !swapped)
{
WeaponSwap(SwapToLeft: true);
swapped = true;
}
else if (Vector3.Distance(unit.data.mainRig.position, unit.data.targetData.mainRig.position) > num && swapped)
{
WeaponSwap(SwapToLeft: false);
swapped = false;
}
}
}
public void WeaponSwap(bool SwapToLeft)
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("UI/EquipWeapon", 1f, unit.data.mainRig.position, (MaterialType)0, (Transform)null, 0f);
if (!((Object)(object)leftObject != (Object)null) || !((Object)(object)rightObject != (Object)null))
{
return;
}
if (SwapToLeft)
{
holdingHandler.LetGoOfWeapon(rightObject);
holdingHandler.GrabObject(leftObjectHoldable, true, true, (Action)delegate
{
});
if (Object.op_Implicit((Object)(object)holdingHandler.leftObject))
{
holdingHandler.rightObject = holdingHandler.leftObject;
}
Scaler(rightObject, Vector3.zero);
Scaler(leftObject, Vector3.one);
holdingHandler.leftHandActivity = (HandActivity)1;
holdingHandler.rightHandActivity = (HandActivity)1;
WeaponHandler.SetWeapon(leftObject.GetComponentInChildren<Weapon>(), (HandType)0);
}
else if (!SwapToLeft)
{
holdingHandler.LetGoOfWeapon(leftObject);
holdingHandler.GrabObject(rightObjectHoldable, true, true, (Action)delegate
{
});
if (Object.op_Implicit((Object)(object)holdingHandler.leftObject))
{
holdingHandler.leftObject = holdingHandler.rightObject;
}
Scaler(rightObject, Vector3.one);
Scaler(leftObject, Vector3.zero);
holdingHandler.leftHandActivity = (HandActivity)1;
holdingHandler.rightHandActivity = (HandActivity)1;
WeaponHandler.SetWeapon(rightObject.GetComponentInChildren<Weapon>(), (HandType)0);
}
}
public void Scaler(GameObject basedGameObject, Vector3 scale)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
basedGameObject.transform.localScale = scale;
}
}
public class AddMeleeBlinks : MonoBehaviour
{
private Unit unit;
private MeleeWeapon[] meleeWeapons;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
meleeWeapons = ((Component)unit).GetComponentsInChildren<MeleeWeapon>();
MeleeWeapon[] array = meleeWeapons;
for (int i = 0; i < array.Length; i++)
{
List<AttackEffect> list = new List<AttackEffect>(((Weapon)array[i]).attackEffects);
list.Add((AttackEffect)(object)((Component)array[i]).gameObject.AddComponent<BlinkDagger>());
((Weapon)array[i]).attackEffects = list.ToArray();
}
}
}
public class AddMeleeDissarm : MonoBehaviour
{
private Unit unit;
private MeleeWeapon[] meleeWeapons;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
meleeWeapons = ((Component)unit).GetComponentsInChildren<MeleeWeapon>();
MeleeWeapon[] array = meleeWeapons;
for (int i = 0; i < array.Length; i++)
{
((Component)array[i]).gameObject.AddComponent<MeleeWeaponDissarm>();
}
}
}
public class AddMeleeDash : MonoBehaviour
{
private Unit unit;
private MeleeWeapon[] meleeWeapons;
private void Start()
{
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
meleeWeapons = ((Component)unit).GetComponentsInChildren<MeleeWeapon>();
MeleeWeapon[] array = meleeWeapons;
for (int i = 0; i < array.Length; i++)
{
WeaponForceAnimation componentInChildren = ((Component)array[i]).gameObject.GetComponentInChildren<WeaponForceAnimation>();
if (!Object.op_Implicit((Object)(object)componentInChildren))
{
List<AttackEffect> list = new List<AttackEffect>(((Weapon)array[i]).attackEffects);
list.Add((AttackEffect)(object)s.DeepCopyOf<WeaponForceAnimation>(((Component)array[i]).gameObject.AddComponent<WeaponForceAnimation>(), ((GameObject)SLMALoader.SDic["weapons"]["shogunSword"]).GetComponentInChildren<WeaponForceAnimation>()));
((Weapon)array[i]).attackEffects = list.ToArray();
}
else
{
s.DeepCopyOf<WeaponForceAnimation>(componentInChildren, ((GameObject)SLMALoader.SDic["weapons"]["shogunSword"]).GetComponentInChildren<WeaponForceAnimation>());
}
}
}
}
public class WeaponRangeDoubler : MonoBehaviour
{
private Unit unit;
private Weapon[] weapons;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
weapons = ((Component)unit).GetComponentsInChildren<Weapon>();
Weapon[] array = weapons;
float num = 0f;
for (int i = 0; i < array.Length; i++)
{
Weapon obj = array[i];
obj.maxRange *= 2f;
num += array[i].maxRange;
unit.api.UpdateECSValues();
}
unit.m_PreferedDistance = num;
}
private void Update()
{
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)unit.data.targetData) && unit.data.distanceToTarget <= unit.m_PreferedDistance)
{
Unit val = unit.data.targetData.unit;
unit.Attack(val.data.mainRig.position, val.data.mainRig, Vector3.zero);
}
}
}
public class FusionMechanic : MonoBehaviour
{
private UnitSpawner unitSpawner;
private Unit unit;
private Unit rider;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
unitSpawner = ((Component)this).gameObject.GetComponentInChildren<UnitSpawner>();
rider = unitSpawner.Spawn();
Object.Destroy((Object)(object)unitSpawner);
}
private void Update()
{
if (Object.op_Implicit((Object)(object)unit) & Object.op_Implicit((Object)(object)rider))
{
MirrorRigs(rider, unit);
}
}
private void MirrorRigs(Unit unit, Unit target)
{
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
Rigidbody[] allRigs = unit.data.allRigs.AllRigs;
Rigidbody[] allRigs2 = target.data.allRigs.AllRigs;
for (int i = 0; i < allRigs.Length; i++)
{
if (allRigs.Length == allRigs2.Length)
{
((Component)allRigs[i]).transform.position = ((Component)allRigs2[i]).transform.position;
((Component)allRigs[i]).transform.rotation = ((Component)allRigs2[i]).transform.rotation;
}
else
{
unit.data.mainRig.position = target.data.mainRig.position;
unit.data.mainRig.rotation = target.data.mainRig.rotation;
}
}
}
}
public class StandStill : MonoBehaviour
{
private Unit unit;
private UnitDontWalkFor unitDontWalkFor;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
unitDontWalkFor = ((Component)unit).gameObject.AddComponent<UnitDontWalkFor>();
unitDontWalkFor.time = float.PositiveInfinity;
unitDontWalkFor.Go();
}
private void Update()
{
unitDontWalkFor.Go();
}
}
public class SkinnedChanges : MonoBehaviour
{
private Unit unit;
private Material curMat;
private void Start()
{
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Expected O, but got Unknown
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
SkinnedMeshRenderer[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<SkinnedMeshRenderer>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].sharedMesh = null;
}
curMat = ((Component)this).gameObject.GetComponentInChildren<Renderer>().materials[0];
if (!Object.op_Implicit((Object)(object)curMat))
{
return;
}
Renderer[] componentsInChildren2 = ((Component)unit).gameObject.GetComponentsInChildren<Renderer>();
foreach (Renderer val in componentsInChildren2)
{
if (((Component)val).tag == "UnitMesh" && (Object)(object)val.materials[0] != (Object)(object)curMat)
{
List<Material> list = new List<Material>();
Material[] materials = val.materials;
for (int k = 0; k < materials.Length; k++)
{
list.Add(new Material(curMat));
}
val.materials = list.ToArray();
}
}
}
}
public class NoFallDamage : MonoBehaviour
{
private Unit unit;
private UnitDontWalkFor unitDontWalkFor;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
}
private void Update()
{
if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.data))
{
unit.data.takeFallDamage = false;
unit.data.canFall = false;
}
}
}
public class MeleeTrail : MonoBehaviour
{
private Unit unit;
public bool right;
public Material curMat;
private void Start()
{
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Expected O, but got Unknown
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
SkinnedMeshRenderer[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<SkinnedMeshRenderer>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].sharedMesh = null;
}
curMat = ((Component)this).gameObject.GetComponentInChildren<Renderer>().materials[0];
AnimationCurve val = new AnimationCurve();
val.AddKey(0f, 0f);
val.AddKey(0.75f, 0.1f);
val.AddKey(1f, 0f);
GameObject val2 = ((!right) ? ((Component)unit.data.weaponHandler.leftWeapon).gameObject : ((Component)unit.data.weaponHandler.rightWeapon).gameObject);
AddTrail(((Component)val2.GetComponentInChildren<ForcePoint>()).gameObject, curMat, val);
}
private void AddTrail(GameObject point, Material material, AnimationCurve widthCurve)
{
TrailRenderer obj = point.AddComponent<TrailRenderer>();
obj.time = 0.5f;
((Renderer)obj).material = material;
obj.widthCurve = widthCurve;
}
}
public class HalvesProjectiles : MonoBehaviour
{
private Unit unit;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
RangeWeapon[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren<RangeWeapon>();
foreach (RangeWeapon val in componentsInChildren)
{
val.numberOfObjects = Halfes(val.numberOfObjects);
val.maxProjectilesPerFrane = Halfes(val.maxProjectilesPerFrane);
}
}
private int Halfes(int count)
{
return (int)Mathf.Round((float)count / 2f);
}
}
public class MultiplyProjectiles : MonoBehaviour
{
private Unit unit;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
RangeWeapon[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren<RangeWeapon>();
foreach (RangeWeapon val in componentsInChildren)
{
val.numberOfObjects = Multiply(val.numberOfObjects);
val.maxProjectilesPerFrane = Multiply(val.maxProjectilesPerFrane);
}
}
private int Multiply(int count)
{
return (int)Mathf.Round((float)count * 2f);
}
}