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.7.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 Sprite LoadBundleTextureToSprite(string name)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
Texture2D val = (Texture2D)bundle.LoadAsset(name);
((Texture)val).filterMode = (FilterMode)0;
return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
}
public static GameObject LoadBundleGameObject(string name)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
return (GameObject)bundle.LoadAsset(name);
}
public static bool CheckCombatID(DatabaseID databaseID)
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
return ((Dictionary<DatabaseID, GameObject>)typeof(LandfallContentDatabase).GetField("m_combatMoves", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ContentDatabase.Instance().LandfallContentDatabase)).ContainsKey(databaseID);
}
public static bool CheckCharacterPropID(DatabaseID databaseID)
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
return ((Dictionary<DatabaseID, GameObject>)typeof(LandfallContentDatabase).GetField("m_characterProps", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ContentDatabase.Instance().LandfallContentDatabase)).ContainsKey(databaseID);
}
public static int IDChecker(LandfallContentDatabase landfallContentDatabase, assetType assetType, int id = 0, int modId = -1)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: 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)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
int num = id;
DatabaseID databaseID = default(DatabaseID);
((DatabaseID)(ref databaseID))..ctor(modId, num);
switch (assetType)
{
case assetType.Ability:
if (CheckCombatID(databaseID))
{
while (CheckCombatID(databaseID))
{
Debug.LogError((object)("Duplicate ID: " + num + " with mod ID: " + modId));
num++;
((DatabaseID)(ref databaseID))..ctor(modId, num);
}
Debug.LogError((object)("Found a compatible ID: " + num + " with mod ID: " + modId));
return num;
}
return id;
case assetType.Prop:
if (CheckCharacterPropID(databaseID))
{
while (CheckCharacterPropID(databaseID))
{
Debug.LogError((object)("Duplicate ID: " + num + " with mod ID: " + modId));
num++;
((DatabaseID)(ref databaseID))..ctor(modId, num);
}
Debug.LogError((object)("Found a compatible ID: " + num + " with mod ID: " + modId));
return num;
}
return id;
default:
return id;
}
}
}
public enum assetType
{
Prop,
Ability
}
public static string comment;
public static AssetBundle bundle;
public static void SetClothItems(GameObject cloth, CharacterItem item, PropItemData data, LandfallContentDatabase db)
{
if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("ForceSkinChange"))
{
cloth.AddComponent<ForcedSkinnedChanges>();
}
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"))
{
cloth.AddComponent<EyeKeepOpened>();
}
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_02e8: Unknown result type (might be due to invalid IL or missing references)
//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
//IL_0529: Unknown result type (might be due to invalid IL or missing references)
//IL_05ac: Unknown result type (might be due to invalid IL or missing references)
//IL_05c6: Unknown result type (might be due to invalid IL or missing references)
//IL_05e0: Unknown result type (might be due to invalid IL or missing references)
//IL_05fa: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("DoublesMeleeKnockback"))
{
move.AddComponent<EditAllMeleeWeapon>().knockbackM = 2f;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("HalvesMeleeKnockback"))
{
move.AddComponent<EditAllMeleeWeapon>().knockbackM = 0.5f;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("DoublesMeleeScreenshake"))
{
move.AddComponent<EditAllMeleeWeapon>().screenShakeM = 2f;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("HalvesMeleeScreenshake"))
{
move.AddComponent<EditAllMeleeWeapon>().screenShakeM = 0.5f;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("HideAbilityModel"))
{
move.AddComponent<AddDestroyAbilityChildRenderer>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("DupesRiderToRider"))
{
move.AddComponent<DoublesSpawnerAmount>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("TornadoDisables"))
{
move.AddComponent<RemoveTurnado>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("NulifyHead"))
{
move.AddComponent<NulifyBodyParts>().bodyPartType = NulifyBodyParts.BodyPart.Head;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("NulifyLeftHand"))
{
move.AddComponent<NulifyBodyParts>().bodyPartType = NulifyBodyParts.BodyPart.LeftArm;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("NulifyRightHand"))
{
move.AddComponent<NulifyBodyParts>().bodyPartType = NulifyBodyParts.BodyPart.RightArm;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("HalvesWeaponSwingforce"))
{
move.AddComponent<EditAllMeleeWeapon>().curveForceM = 0.5f;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("DoublesWeaponSwingforce"))
{
move.AddComponent<EditAllMeleeWeapon>().curveForceM = 2f;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("NulifyWeaponSwingforce"))
{
move.AddComponent<EditAllMeleeWeapon>().curveForceM = 0f;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("HalvesWeaponRecoil"))
{
move.AddComponent<EditAllRangeWeapon>().recoilM = 0.5f;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("DoublesWeaponRecoil"))
{
move.AddComponent<EditAllRangeWeapon>().recoilM = 2f;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("NulifyWeaponRecoil"))
{
move.AddComponent<EditAllRangeWeapon>().recoilM = 0f;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("HalvesProjectileScale"))
{
move.AddComponent<ChangeProjectileScale>().scaleM = 0.5f;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("DoublesProjectileScale"))
{
move.AddComponent<ChangeProjectileScale>().scaleM = 2f;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("WeaponHalvedRange"))
{
move.AddComponent<WeaponRangeHalves>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("TransformToRiderWhenDies"))
{
move.AddComponent<GetAndDeleteRider>();
move.GetComponentInChildren<ConditionalEvent>().events[0].conditions[0].conditionType = (ConditionType)5;
}
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;
}
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;
}
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>();
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("TransformToRiderDarkKingCondition"))
{
move.AddComponent<GetAndDeleteRider>();
}
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)
{
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Static Variable";
comment = "----------------------------------------------------------------------------------------------------------------------------";
LoadBundle("techitemsbundle");
Sprite val = Utility.LoadBundleTextureToSprite("icon_technicalitems");
GameObject val2 = Utility.LoadBundleGameObject("Move_EmptyAbility");
GameObject val3 = Utility.LoadBundleGameObject("Move_EmptyProp");
GameObject val4 = Utility.LoadBundleGameObject("Move_EmptySpawner");
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Custom Clothes";
comment = "----------------------------------------------------------------------------------------------------------------------------";
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("ForceSkinChange", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 10101005), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("MeleeTrailLeft", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 10101006), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("MeleeTrailRight", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 10101007), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("SkinChanges", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 10101008), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("AlwaysOpenedEyes", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 10101009), true), "Technical Items", (TagType)0);
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Right Weapons";
comment = "----------------------------------------------------------------------------------------------------------------------------";
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("FlipRightW", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 10101010), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleRightW", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 10101011), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleRightW", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 10101012), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("NulifyScaleRightW", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 10101013), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("RemoveRightWParticles", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 10101014), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("RemoveRightWProj", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 10101015), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleRightWX", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 40101011), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleRightWX", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 40101012), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleRightWY", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 40101013), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleRightWY", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 40101014), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleRightWZ", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 40101015), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleRightWZ", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 40101016), true), "Technical Items", (TagType)0);
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Left Weapons";
comment = "----------------------------------------------------------------------------------------------------------------------------";
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("FlipLeftW", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 20202020), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleLeftW", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 20202021), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleLeftW", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 20202022), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("NulifyScaleLeftW", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 20202023), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("RemoveLeftWParticles", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 20202024), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("RemoveLeftWProj", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 20202025), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleLeftWX", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 50101011), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleLeftWX", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 50101012), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleLeftWY", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 50101013), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleLeftWY", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 50101014), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesScaleLeftWZ", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 50101015), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalfesScaleLeftWZ", val3, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Prop, 50101016), true), "Technical Items", (TagType)0);
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Technical Abilities";
comment = "----------------------------------------------------------------------------------------------------------------------------";
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HideAbilityModel", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303001), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DupesRiderToRider", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303002), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TornadoDisables", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303003), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("NulifyHead", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303004), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("NulifyLeftHand", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303005), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("NulifyRightHand", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303006), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalvesWeaponSwingforce", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303007), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesWeaponSwingforce", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303008), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("NulifyWeaponSwingforce", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303009), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalvesWeaponRecoil", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303010), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesWeaponRecoil", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303011), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("NulifyWeaponRecoil", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303012), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalvesProjectileScale", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303013), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesProjectileScale", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303014), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("WeaponHalvedRange", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303015), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRiderWhenDies", val4, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303016), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalvesProjectiles", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303017), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("MultiplyProjectiles", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303018), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("NoFallDamage", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303019), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("StandStill", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303020), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("FusionWithRider", val4, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303021), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("WeaponDoubledRange", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303022), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("MeleeAddDash", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303023), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("MeleeAddDissarm", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303024), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("MeleeAddBlink", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303025), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("WeaponSwapWhenBelowHalf", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303026), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("WeaponSwapWhenTargetDistance", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303027), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("AlwaysTansferHP", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303028), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("NeverShowHealthBar", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303029), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRiderWhenTargetFarCondition", val4, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303030), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRiderWhenTargetCloseCondition", val4, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303031), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRider10SecondsCondition", val4, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303032), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRiderChronoCondition", Utility.LoadBundleGameObject("TransformToRiderChronoCondition"), true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303033), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRiderDarkKingCondition", Utility.LoadBundleGameObject("TransformToRiderDarkKingCondition"), true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303034), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRiderWhenHealthHalfCondition", val4, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303036), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("TransformToRiderWhenHealthQuarterCondition", val4, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303037), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("AdaptivePirateQueenThrow", Utility.LoadBundleGameObject("AdaptivePirateQueenThrow"), true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303038), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("AdaptiveSenseiBurstThrow", Utility.LoadBundleGameObject("AdaptiveSenseiBurstThrow"), true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303035), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesMeleeKnockback", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303039), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalvesMeleeKnockback", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303040), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("DoublesMeleeScreenshake", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303041), true), "Technical Items", (TagType)0);
Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("HalvesMeleeScreenshake", val2, true, (HideFlags)52, val, Utility.IDChecker(db, assetType.Ability, 30303042), true), "Technical Items", (TagType)0);
}
public static void LoadBundle(string assetBundleName)
{
using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(assetBundleName);
bundle = AssetBundle.LoadFromStream(stream);
}
}
[BepInPlugin("GeeztJeez.Technicalitems", "TechnicalItems", "1.0.7")]
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()
{
try
{
GooglyEye[] componentsInChildren = ((Component)((Component)this).gameObject.transform.root).GetComponentsInChildren<GooglyEye>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].SetState((EyeState)0);
}
}
catch (Exception)
{
Debug.LogWarning((object)"No eye detected");
}
}
}
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_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Expected O, but got Unknown
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
curMat = ((Component)this).gameObject.GetComponentInChildren<Renderer>().materials[0];
if (!Object.op_Implicit((Object)(object)curMat))
{
return;
}
Renderer[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren<Renderer>();
foreach (Renderer val in componentsInChildren)
{
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 j = 0; j < materials.Length; j++)
{
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_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Expected O, but got Unknown
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
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);
MeshRenderer[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<MeshRenderer>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
Object.Destroy((Object)(object)componentsInChildren[i]);
}
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);
}
}
public class ForcedSkinnedChanges : MonoBehaviour
{
private Unit unit;
private Material curMat;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
}
private void Update()
{
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Expected O, but got Unknown
curMat = ((Renderer)((Component)this).gameObject.GetComponentInChildren<MeshRenderer>()).materials[0];
if (!Object.op_Implicit((Object)(object)curMat))
{
return;
}
SkinnedMeshRenderer[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren<SkinnedMeshRenderer>();
foreach (SkinnedMeshRenderer val in componentsInChildren)
{
if (!Object.op_Implicit((Object)(object)((Component)val).gameObject.GetComponentInParent<PropItem>()) && !Object.op_Implicit((Object)(object)((Component)val).gameObject.GetComponentInParent<WeaponItem>()) && !Object.op_Implicit((Object)(object)((Component)val).gameObject.GetComponentInParent<CharacterItem>()) && !Object.op_Implicit((Object)(object)((Component)val).gameObject.GetComponentInParent<SpecialAbility>()))
{
List<Material> list = new List<Material>();
Material[] materials = ((Renderer)val).materials;
for (int j = 0; j < materials.Length; j++)
{
list.Add(new Material(curMat));
}
((Renderer)val).materials = list.ToArray();
}
}
}
}
public class WeaponRangeHalves : 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 *= 0.5f;
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 EditAllMeleeWeapon : MonoBehaviour
{
private Unit unit;
public float curveForceM = 1f;
public float screenShakeM = 1f;
public float knockbackM = 1f;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
MeleeWeapon[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren<MeleeWeapon>();
foreach (MeleeWeapon obj in componentsInChildren)
{
obj.curveForce *= curveForceM;
}
CollisionWeapon[] componentsInChildren2 = ((Component)unit).gameObject.GetComponentsInChildren<CollisionWeapon>();
foreach (CollisionWeapon obj2 in componentsInChildren2)
{
obj2.screenShakeMultiplier *= screenShakeM;
obj2.onImpactForce *= knockbackM;
}
}
}
public class DoublesSpawnerAmount : 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>();
foreach (UnitSpawner obj in componentsInChildren)
{
obj.amountToSpawn *= 2;
}
}
}
public class NulifyBodyParts : MonoBehaviour
{
public enum BodyPart
{
Head,
LeftArm,
RightArm
}
public BodyPart bodyPartType;
private Unit unit;
private void Start()
{
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: 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_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
if (bodyPartType == BodyPart.Head)
{
((Component)unit.data.head).gameObject.transform.localScale = Vector3.one * 1E-05f;
}
else if (bodyPartType == BodyPart.RightArm)
{
((Component)unit.data.rightHand).gameObject.transform.localScale = Vector3.one * 1E-05f;
((Component)unit.data.rightArm).gameObject.transform.localScale = Vector3.one * 1E-05f;
}
else
{
((Component)unit.data.leftHand).gameObject.transform.localScale = Vector3.one * 1E-05f;
((Component)unit.data.leftArm).gameObject.transform.localScale = Vector3.one * 1E-05f;
}
}
}
public class AddDestroyAbilityChildRenderer : MonoBehaviour
{
private Unit unit;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
SpecialAbility[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren<SpecialAbility>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
((Component)componentsInChildren[i]).gameObject.AddComponent<DestroyChildRenderer>();
}
}
}
public class RemoveTurnado : MonoBehaviour
{
private Unit unit;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
SpinToWinBehaviour[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren<SpinToWinBehaviour>();
foreach (SpinToWinBehaviour obj in componentsInChildren)
{
obj.turnadoStartEvent = obj.turnadoEndEvent;
}
}
}
public class DestroyChildRenderer : MonoBehaviour
{
private void Start()
{
Renderer[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<Renderer>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
Object.Destroy((Object)(object)componentsInChildren[i]);
}
}
}
public class EditAllRangeWeapon : MonoBehaviour
{
private Unit unit;
public float recoilM = 1f;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
RangeWeapon[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren<RangeWeapon>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
RangeWeapon obj = componentsInChildren[i];
obj.shootRecoil *= recoilM;
RangeWeapon obj2 = componentsInChildren[i];
obj2.torsoRecoil *= recoilM;
}
}
}
public class ChangeProjectileScale : MonoBehaviour
{
private Unit unit;
public float scaleM;
private GameObject hiddenParent;
private void Start()
{
unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
SetHiddenParent();
RangeWeapon[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren<RangeWeapon>();
foreach (RangeWeapon val in componentsInChildren)
{
GameObject objectToSpawn = MakeTempCopy(val.ObjectToSpawn);
val.ObjectToSpawn = objectToSpawn;
}
SpawnObject[] componentsInChildren2 = ((Component)unit).gameObject.GetComponentsInChildren<SpawnObject>();
for (int j = 0; j < componentsInChildren2.Length; j++)
{
GameObject objectToSpawn2 = MakeTempCopy(componentsInChildren2[j].objectToSpawn);
componentsInChildren2[j].objectToSpawn = objectToSpawn2;
}
}
private GameObject MakeTempCopy(GameObject gameObjectToCopy)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
GameObject obj = Object.Instantiate<GameObject>(gameObjectToCopy, hiddenParent.transform);
Transform transform = obj.transform;
transform.localScale *= scaleM;
return obj;
}
private void SetHiddenParent()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Expected O, but got Unknown
hiddenParent = new GameObject
{
hideFlags = (HideFlags)61
};
hiddenParent.SetActive(false);
}
}