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 FhpSLib; using HarmonyLib; using Landfall.TABC; using Landfall.TABS; using Landfall.TABS.AI.Components; using Landfall.TABS.UnitEditor; using SLMA; using TFBGames; using TI; using TIComponents; using Unity.Mathematics; using UnityEngine; using UnityEngine.Events; [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 © 4Ever")] [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.19.0")] [module: UnverifiableCode] namespace TI { public static class Manager { public class InitManager { public static void InitClothings(Sprite icon, string itemCatName) { GameObject val = UTI.LoadGmObj("EmptyPropTechItem"); int startId = 10101000; comment = "----------------------------------------------------------------------------------------------------------------------------"; comment = "Custom Clothes"; comment = "----------------------------------------------------------------------------------------------------------------------------"; UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartAdaptiveProjSpawner", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartKeepDistance", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("RigScaleHead", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("RigScaleTorso", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("RigScaleLegLeft", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("RigScaleLegRight", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("RigScaleFootLeft", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("RigScaleFootRight", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("RigScaleLeftHand", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("RigScaleRightHand", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("RigScaleLeftArm", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("RigScaleRightArm", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("RigScaleHip", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BodyPartScaleHead", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BodyPartScaleNeck", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BodyPartScaleTorso", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BodyPartScaleLegLeft", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BodyPartScaleLegRight", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BodyPartScaleFootLeft", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BodyPartScaleFootRight", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BodyPartScaleLeftHand", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BodyPartScaleRightHand", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BodyPartScaleLeftArm", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BodyPartScaleRightArm", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BodyPartScaleHip", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartOnHitEffectAll", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("ColorableWeaponProjParticle", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("ColorableAbilityProjParticle", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("ColorableWeaponProjModel", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("ColorableAbilityProjModel", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("ForcePointAddReaperScytheEffect", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderBoxHead", UTI.LoadGmObj("AddPlaceholderBoxHead"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderBoxNeck", UTI.LoadGmObj("AddPlaceholderBoxNeck"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderBoxTorso", UTI.LoadGmObj("AddPlaceholderBoxTorso"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponPlaceholderBoxLeft", UTI.LoadGmObj("AddPlaceholderBoxWeapon"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderBoxArms", UTI.LoadGmObj("AddPlaceholderBoxArms"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponPlaceholderBoxRight", UTI.LoadGmObj("AddPlaceholderBoxWeapon"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderBoxHands", UTI.LoadGmObj("AddPlaceholderBoxHands"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderBoxWaist", UTI.LoadGmObj("AddPlaceholderBoxWaist"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderBoxLegs", UTI.LoadGmObj("AddPlaceholderBoxLegs"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderBoxFeet", UTI.LoadGmObj("AddPlaceholderBoxFeet"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("ForceSkinChange", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("MeleeTrailLeft", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("MeleeTrailRight", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SkinChanges", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AlwaysOpenedEyes", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartOnHitEffectWeapon", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartOnHitEffectProj", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartMeleeAddDash", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartUnitRigidbody", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartUnitRigidbodyLimiter", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartConditionalEventManager", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartSummonRider", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartUnitBalanceModifier", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SetPropRotatingPerpetual", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SetPropRotationStatic", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartHealingItem", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartUnitDupe", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartMeleeKnockback", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartProjectileScaling", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartRangeDistance", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartUnitVocalManager", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartUnitWeaponSoundManager", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartSFXManager", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartMoreRider", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartCustomRider", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartConnectedTransform", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartTransformToRider", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartTransformationAmount", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderSphereHead", UTI.LoadGmObj("AddPlaceholderSphereHead"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderSphereNeck", UTI.LoadGmObj("AddPlaceholderSphereNeck"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderSphereTorso", UTI.LoadGmObj("AddPlaceholderSphereTorso"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponPlaceholderSphereLeft", UTI.LoadGmObj("AddPlaceholderSphereWeapon"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderSphereArms", UTI.LoadGmObj("AddPlaceholderSphereArms"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponPlaceholderSphereRight", UTI.LoadGmObj("AddPlaceholderSphereWeapon"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderSphereHands", UTI.LoadGmObj("AddPlaceholderSphereHands"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderSphereWaist", UTI.LoadGmObj("AddPlaceholderSphereWaist"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderSphereLegs", UTI.LoadGmObj("AddPlaceholderSphereLegs"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderSphereFeet", UTI.LoadGmObj("AddPlaceholderSphereFeet"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderPyramidHead", UTI.LoadGmObj("AddPlaceholderPyramidHead"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderPyramidNeck", UTI.LoadGmObj("AddPlaceholderPyramidNeck"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderPyramidTorso", UTI.LoadGmObj("AddPlaceholderPyramidTorso"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponPlaceholderPyramidLeft", UTI.LoadGmObj("AddPlaceholderPyramidWeapon"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderPyramidArms", UTI.LoadGmObj("AddPlaceholderPyramidArms"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponPlaceholderPyramidRight", UTI.LoadGmObj("AddPlaceholderPyramidWeapon"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderPyramidHands", UTI.LoadGmObj("AddPlaceholderPyramidHands"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderPyramidWaist", UTI.LoadGmObj("AddPlaceholderPyramidWaist"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderPyramidLegs", UTI.LoadGmObj("AddPlaceholderPyramidLegs"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderPyramidFeet", UTI.LoadGmObj("AddPlaceholderPyramidFeet"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderCylinderHead", UTI.LoadGmObj("AddPlaceholderCylinderHead"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderCylinderNeck", UTI.LoadGmObj("AddPlaceholderCylinderNeck"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderCylinderTorso", UTI.LoadGmObj("AddPlaceholderCylinderTorso"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponPlaceholderCylinderLeft", UTI.LoadGmObj("AddPlaceholderCylinderWeapon"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderCylinderArms", UTI.LoadGmObj("AddPlaceholderCylinderArms"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponPlaceholderCylinderRight", UTI.LoadGmObj("AddPlaceholderCylinderWeapon"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderCylinderHands", UTI.LoadGmObj("AddPlaceholderCylinderHands"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderCylinderWaist", UTI.LoadGmObj("AddPlaceholderCylinderWaist"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderCylinderLegs", UTI.LoadGmObj("AddPlaceholderCylinderLegs"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AddPlaceholderCylinderFeet", UTI.LoadGmObj("AddPlaceholderCylinderFeet"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); comment = "----------------------------------------------------------------------------------------------------------------------------"; comment = "Right Weapons"; comment = "----------------------------------------------------------------------------------------------------------------------------"; UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartWeaponScalingRightStatic", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartWeaponScalingRightDynamic", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("RemoveRightWParticles", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartWeaponWeightingLeft", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponHoldingUpRotationLeft", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponHoldingForwardRotationLeft", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponHoldingRelativePositionLeft", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartRightMagSet", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartRightRangedSet", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartRightMeleeSet", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartProjSetRight", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartWeaponHoldableRight", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); comment = "----------------------------------------------------------------------------------------------------------------------------"; comment = "Left Weapons"; comment = "----------------------------------------------------------------------------------------------------------------------------"; UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartWeaponScalingLeftStatic", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartWeaponScalingLeftDynamic", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("RemoveLeftWParticles", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartWeaponWeightingRight", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponHoldingUpRotationRight", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponHoldingForwardRotationRight", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponHoldingRelativePositionRight", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartLeftMagSet", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartLeftRangedSet", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartLeftMeleeSet", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartProjSetLeft", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SmartWeaponHoldableLeft", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Prop, startId), true), itemCatName, (TagType)0); } public static void InitAbilities(Sprite icon, string itemCatName) { GameObject val = UTI.LoadGmObj("Move_EmptyAbility"); int startId = 30303031; comment = "----------------------------------------------------------------------------------------------------------------------------"; comment = "Technical Abilities"; comment = "----------------------------------------------------------------------------------------------------------------------------"; UTI.ICat.SetTag(UPool.MyPool.AddObject("ThrowMeleeWeapon", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("MakeBaseHaveProp", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("HideAbilityModel", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("TornadoDisables", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BindVehicleHealth", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("BindRiderHealth", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SetWeaponProjHoming", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("SetAbilityProjHoming", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("NoFallDamage", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("StandStill", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("FusionWithRider", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("UnitTargetSelf", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("MeleeAddDissarm", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("MeleeAddBlink", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponSwapWhenBelowHalf", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("WeaponSwapWhenTargetDistance", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AlwaysTansferHP", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("NeverShowHealthBar", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("TransformToRiderChronoCondition", UTI.LoadGmObj("TransformToRiderChronoCondition"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("TransformToRiderDarkKingCondition", UTI.LoadGmObj("TransformToRiderDarkKingCondition"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AdaptivePirateQueenThrow", UTI.LoadGmObj("AdaptivePirateQueenThrow"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AdaptiveSenseiBurstThrow", UTI.LoadGmObj("AdaptiveSenseiBurstThrow"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("MeleeAddStick", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("UnitDisableFriendlyFire", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("UnbindVehicleHealth", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("UnbindRiderHealth", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AdaptiveOrbCasting", UTI.LoadGmObj("AdaptiveOrbCasting"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AdaptiveSwordCasting", UTI.LoadGmObj("AdaptiveSwordCasting"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("MeleeHitFaster", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AbilityRemoveSound", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("KeepNormalUnitColorInstance", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("NullifyAllDelay", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("DisableUnitOutline", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("AdaptiveArrowVolley", UTI.LoadGmObj("AdaptiveArrowVolley"), true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); UTI.ICat.SetTag(UPool.MyPool.AddObject("HideAbilityParticles", val, true, (HideFlags)52, icon, UTI.IDScan(UTI.assetType.Ability, startId), true), itemCatName, (TagType)0); } } public static string comment; public static void Init(LandfallContentDatabase db) { UTI.LoadBundle("techitemsbundle"); Sprite icon = UTI.LoadTexture2Sprite("icon_technicalitems"); string itemCatName = "Technical Items"; InitManager.InitClothings(icon, itemCatName); InitManager.InitAbilities(icon, itemCatName); } public static void SetItemObject(GameObject itemObject) { if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartAdaptiveProjSpawner")) { itemObject.AddComponent().smokeObject = UTI.LoadGmObj("E_EmptySpawnerPoof"); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("ThrowMeleeWeapon")) { itemObject.AddComponent().baseProjObject = UTI.LoadGmObj("P_TemplateMeleeProj"); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartKeepDistance")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("MakeBaseHaveProp")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("UnitDisableFriendlyFire")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("UnitTargetSelf")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("DisableUnitOutline")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("MeleeAddStick")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("MeleeHitFaster")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("UnbindVehicleHealth")) { itemObject.AddComponent().HealthBindType = BindSiegeHealthBehaviour.BindType.UnbindVehicleHealth; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("UnbindRiderHealth")) { itemObject.AddComponent().HealthBindType = BindSiegeHealthBehaviour.BindType.UnbindRiderHealth; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BindVehicleHealth")) { itemObject.AddComponent().HealthBindType = BindSiegeHealthBehaviour.BindType.BindVehicleHealth; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BindRiderHealth")) { itemObject.AddComponent().HealthBindType = BindSiegeHealthBehaviour.BindType.BindRiderHealth; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("KeepNormalUnitColorInstance")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AbilityRemoveSound")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("HideAbilityModel")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("HideAbilityParticles")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("NullifyAllDelay")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("TornadoDisables")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("NoFallDamage")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("StandStill")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("FusionWithRider")) { itemObject.AddComponent(); itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("MeleeAddDissarm")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("MeleeAddBlink")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponSwapWhenBelowHalf")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponSwapWhenTargetDistance")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AlwaysTansferHP")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("NeverShowHealthBar")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("TransformToRiderChronoCondition")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("TransformToRiderDarkKingCondition")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AdaptiveOrbCasting")) { SpookySwords componentInChildren = itemObject.GetComponentInChildren(); AdaptiveCastBehaviour adaptiveCastBehaviour = itemObject.AddComponent(); adaptiveCastBehaviour.followSpeed = componentInChildren.followSpeed; adaptiveCastBehaviour.throwSpeed = componentInChildren.throwSpeed; adaptiveCastBehaviour.throwCurve = componentInChildren.throwCurve; adaptiveCastBehaviour.attackRate = componentInChildren.attackRate; adaptiveCastBehaviour.projToCopyCodeAnimation = UTI.LoadGmObj("CodeAnimToCopy"); Object.Destroy((Object)(object)componentInChildren); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AdaptiveSwordCasting")) { SpookySwords componentInChildren2 = itemObject.GetComponentInChildren(); AdaptiveCastBehaviour adaptiveCastBehaviour2 = itemObject.AddComponent(); adaptiveCastBehaviour2.followSpeed = componentInChildren2.followSpeed; adaptiveCastBehaviour2.throwSpeed = componentInChildren2.throwSpeed; adaptiveCastBehaviour2.throwCurve = componentInChildren2.throwCurve; adaptiveCastBehaviour2.attackRate = componentInChildren2.attackRate; adaptiveCastBehaviour2.projToCopyCodeAnimation = UTI.LoadGmObj("CodeAnimToCopy"); Object.Destroy((Object)(object)componentInChildren2); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AdaptiveArrowVolley")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AdaptivePirateQueenThrow")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AdaptiveSenseiBurstThrow")) { ParticleSystem[] componentsInChildren = itemObject.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].startSize = 1.6f; } itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("RigScaleHead")) { itemObject.AddComponent().rigType = SmartRigScaleSizingBehaviour.RigType.Head; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("RigScaleTorso")) { itemObject.AddComponent().rigType = SmartRigScaleSizingBehaviour.RigType.Torso; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("RigScaleLegLeft")) { itemObject.AddComponent().rigType = SmartRigScaleSizingBehaviour.RigType.LegLeft; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("RigScaleLegRight")) { itemObject.AddComponent().rigType = SmartRigScaleSizingBehaviour.RigType.LegRight; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("RigScaleFootLeft")) { itemObject.AddComponent().rigType = SmartRigScaleSizingBehaviour.RigType.FootLeft; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("RigScaleFootRight")) { itemObject.AddComponent().rigType = SmartRigScaleSizingBehaviour.RigType.FootRight; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("RigScaleLeftHand")) { itemObject.AddComponent().rigType = SmartRigScaleSizingBehaviour.RigType.LeftHand; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("RigScaleRightHand")) { itemObject.AddComponent().rigType = SmartRigScaleSizingBehaviour.RigType.RightHand; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("RigScaleLeftArm")) { itemObject.AddComponent().rigType = SmartRigScaleSizingBehaviour.RigType.LeftArm; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("RigScaleRightArm")) { itemObject.AddComponent().rigType = SmartRigScaleSizingBehaviour.RigType.RightArm; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("RigScaleHip")) { itemObject.AddComponent().rigType = SmartRigScaleSizingBehaviour.RigType.Hip; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BodyPartScaleHead")) { itemObject.AddComponent().rigType = SmartBodyPartScaleSizing.RigType.Head; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BodyPartScaleNeck")) { itemObject.AddComponent().rigType = SmartBodyPartScaleSizing.RigType.Neck; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BodyPartScaleTorso")) { itemObject.AddComponent().rigType = SmartBodyPartScaleSizing.RigType.Torso; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BodyPartScaleLegLeft")) { itemObject.AddComponent().rigType = SmartBodyPartScaleSizing.RigType.LegLeft; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BodyPartScaleLegRight")) { itemObject.AddComponent().rigType = SmartBodyPartScaleSizing.RigType.LegRight; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BodyPartScaleFootLeft")) { itemObject.AddComponent().rigType = SmartBodyPartScaleSizing.RigType.FootLeft; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BodyPartScaleFootRight")) { itemObject.AddComponent().rigType = SmartBodyPartScaleSizing.RigType.FootRight; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BodyPartScaleLeftHand")) { itemObject.AddComponent().rigType = SmartBodyPartScaleSizing.RigType.LeftHand; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BodyPartScaleRightHand")) { itemObject.AddComponent().rigType = SmartBodyPartScaleSizing.RigType.RightHand; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BodyPartScaleLeftArm")) { itemObject.AddComponent().rigType = SmartBodyPartScaleSizing.RigType.LeftArm; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BodyPartScaleRightArm")) { itemObject.AddComponent().rigType = SmartBodyPartScaleSizing.RigType.RightArm; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("BodyPartScaleHip")) { itemObject.AddComponent().rigType = SmartBodyPartScaleSizing.RigType.Hip; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartTransformationAmount")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartTransformToRider")) { itemObject.AddComponent().particle = UTI.LoadGmObj("E_EmptySpawnerPoof"); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartConnectedTransform")) { itemObject.AddComponent().particle = UTI.LoadGmObj("E_EmptySpawnerPoof"); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartCustomRider")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartMoreRider")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartUnitWeaponSoundManager")) { itemObject.AddComponent().soundType = SmartSoundsManagerBehaviour.SoundType.Weapons; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartUnitVocalManager")) { itemObject.AddComponent().soundType = SmartSoundsManagerBehaviour.SoundType.Vocal; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartSFXManager")) { itemObject.AddComponent().soundType = SmartSoundsManagerBehaviour.SoundType.SFX; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartRangeDistance")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartProjectileScaling")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartMeleeKnockback")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartUnitDupe")) { itemObject.AddComponent().abilityToRemove = UPool.MyPool.GetObject("SmartUnitDupe"); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartHealingItem")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SetPropRotatingPerpetual")) { itemObject.AddComponent().rotationType = SetPropRotationBehaviour.RotationType.Perpetual; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SetPropRotationStatic")) { itemObject.AddComponent().rotationType = SetPropRotationBehaviour.RotationType.Static; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartUnitBalanceModifier")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartSummonRider")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartConditionalEventManager")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartUnitRigidbodyLimiter")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartUnitRigidbody")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartMeleeAddDash")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("ColorableWeaponProjParticle")) { itemObject.AddComponent().MaterialChangeType = ColorableWeaponProjBehaviour.ChangeType.Particle; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("ColorableAbilityProjParticle")) { itemObject.AddComponent().MaterialChangeType = ColorableAbilityProjBehaviour.ChangeType.Particle; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("ColorableWeaponProjModel")) { itemObject.AddComponent().MaterialChangeType = ColorableWeaponProjBehaviour.ChangeType.Model; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("ColorableAbilityProjModel")) { itemObject.AddComponent().MaterialChangeType = ColorableAbilityProjBehaviour.ChangeType.Model; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SetAbilityProjHoming")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SetWeaponProjHoming")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponPlaceholderBoxRight")) { itemObject.AddComponent().right = true; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponPlaceholderBoxLeft")) { itemObject.AddComponent().right = false; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderBoxHands")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderBoxLegs")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderBoxFeet")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderBoxArms")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponPlaceholderSphereRight")) { itemObject.AddComponent().right = true; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponPlaceholderSphereLeft")) { itemObject.AddComponent().right = false; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderSphereHands")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderSphereLegs")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderSphereFeet")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderSphereArms")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponPlaceholderPyramidRight")) { itemObject.AddComponent().right = true; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponPlaceholderPyramidLeft")) { itemObject.AddComponent().right = false; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderPyramidHands")) { itemObject.AddComponent().multiplier = 25f; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderPyramidLegs")) { itemObject.AddComponent().multiplier = 25f; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderPyramidFeet")) { itemObject.AddComponent().multiplier = 25f; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderPyramidArms")) { itemObject.AddComponent().multiplier = 25f; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponPlaceholderCylinderRight")) { itemObject.AddComponent().right = true; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponPlaceholderCylinderLeft")) { itemObject.AddComponent().right = false; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderCylinderHands")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderCylinderLegs")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderCylinderFeet")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AddPlaceholderCylinderArms")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartWeaponScalingLeftStatic")) { itemObject.AddComponent().right = false; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartWeaponScalingRightStatic")) { itemObject.AddComponent().right = true; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartWeaponScalingLeftDynamic")) { itemObject.AddComponent().right = false; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartWeaponScalingRightDynamic")) { itemObject.AddComponent().right = true; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartProjSetLeft")) { itemObject.AddComponent().right = false; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartProjSetRight")) { itemObject.AddComponent().right = true; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("ForcePointAddReaperScytheEffect")) { itemObject.AddComponent().trailObject = UTI.LoadGmObj("ReaperParticleTI"); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartLeftMeleeSet")) { itemObject.AddComponent().right = false; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartRightMeleeSet")) { itemObject.AddComponent().right = true; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartLeftRangedSet")) { itemObject.AddComponent().right = false; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartRightRangedSet")) { itemObject.AddComponent().right = true; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartLeftMagSet")) { itemObject.AddComponent().right = false; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartRightMagSet")) { itemObject.AddComponent().right = true; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartWeaponWeightingLeft")) { itemObject.AddComponent().right = false; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartWeaponWeightingRight")) { itemObject.AddComponent().right = true; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponHoldingUpRotationLeft")) { SmartWeaponHoldingChangeBehaviour smartWeaponHoldingChangeBehaviour = itemObject.AddComponent(); smartWeaponHoldingChangeBehaviour.right = false; smartWeaponHoldingChangeBehaviour.holdingChangeType = SmartWeaponHoldingChangeBehaviour.HoldingChangeType.UpRotation; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponHoldingForwardRotationLeft")) { SmartWeaponHoldingChangeBehaviour smartWeaponHoldingChangeBehaviour2 = itemObject.AddComponent(); smartWeaponHoldingChangeBehaviour2.right = false; smartWeaponHoldingChangeBehaviour2.holdingChangeType = SmartWeaponHoldingChangeBehaviour.HoldingChangeType.ForwardRotation; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponHoldingRelativePositionLeft")) { SmartWeaponHoldingChangeBehaviour smartWeaponHoldingChangeBehaviour3 = itemObject.AddComponent(); smartWeaponHoldingChangeBehaviour3.right = false; smartWeaponHoldingChangeBehaviour3.holdingChangeType = SmartWeaponHoldingChangeBehaviour.HoldingChangeType.RelativePosition; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponHoldingUpRotationRight")) { SmartWeaponHoldingChangeBehaviour smartWeaponHoldingChangeBehaviour4 = itemObject.AddComponent(); smartWeaponHoldingChangeBehaviour4.right = true; smartWeaponHoldingChangeBehaviour4.holdingChangeType = SmartWeaponHoldingChangeBehaviour.HoldingChangeType.UpRotation; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponHoldingForwardRotationRight")) { SmartWeaponHoldingChangeBehaviour smartWeaponHoldingChangeBehaviour5 = itemObject.AddComponent(); smartWeaponHoldingChangeBehaviour5.right = true; smartWeaponHoldingChangeBehaviour5.holdingChangeType = SmartWeaponHoldingChangeBehaviour.HoldingChangeType.ForwardRotation; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("WeaponHoldingRelativePositionRight")) { SmartWeaponHoldingChangeBehaviour smartWeaponHoldingChangeBehaviour6 = itemObject.AddComponent(); smartWeaponHoldingChangeBehaviour6.right = true; smartWeaponHoldingChangeBehaviour6.holdingChangeType = SmartWeaponHoldingChangeBehaviour.HoldingChangeType.RelativePosition; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartWeaponHoldableRight")) { SmartWeaponHoldingChangeBehaviour smartWeaponHoldingChangeBehaviour7 = itemObject.AddComponent(); smartWeaponHoldingChangeBehaviour7.right = true; smartWeaponHoldingChangeBehaviour7.holdingChangeType = SmartWeaponHoldingChangeBehaviour.HoldingChangeType.HoldingStats; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartWeaponHoldableLeft")) { SmartWeaponHoldingChangeBehaviour smartWeaponHoldingChangeBehaviour8 = itemObject.AddComponent(); smartWeaponHoldingChangeBehaviour8.right = false; smartWeaponHoldingChangeBehaviour8.holdingChangeType = SmartWeaponHoldingChangeBehaviour.HoldingChangeType.HoldingStats; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("ForceSkinChange")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("MeleeTrailLeft")) { itemObject.AddComponent().right = false; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("MeleeTrailRight")) { itemObject.AddComponent().right = true; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SkinChanges")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("AlwaysOpenedEyes")) { itemObject.AddComponent(); } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("RemoveRightWParticles")) { itemObject.AddComponent().right = true; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("RemoveLeftWParticles")) { itemObject.AddComponent().right = false; } GameObject[] explosions = (GameObject[])(object)new GameObject[9] { UTI.LoadGmObj("E_GroundExplosionTI"), UTI.LoadGmObj("E_FireExplosionTI"), UTI.LoadGmObj("E_IceExplosionTI"), UTI.LoadGmObj("E_GunpowderExplosionTI"), UTI.LoadGmObj("E_ThorHammerLightningExplosionTI"), UTI.LoadGmObj("E_ReaperExplosionTI"), UTI.LoadGmObj("E_ChronotimeExplosionTI"), UTI.LoadGmObj("E_EFBluefireExplosionTI"), UTI.LoadGmObj("E_EFEvilSwordExplosionTI") }; if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartOnHitEffectAll")) { SmartOnHitEffectBehaviour smartOnHitEffectBehaviour = itemObject.AddComponent(); smartOnHitEffectBehaviour.effectType = SmartOnHitEffectBehaviour.EffectType.All; smartOnHitEffectBehaviour.explosions = explosions; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartOnHitEffectWeapon")) { SmartOnHitEffectBehaviour smartOnHitEffectBehaviour2 = itemObject.AddComponent(); smartOnHitEffectBehaviour2.effectType = SmartOnHitEffectBehaviour.EffectType.Weapon; smartOnHitEffectBehaviour2.explosions = explosions; } if ((Object)(object)itemObject == (Object)(object)UPool.MyPool.GetObject("SmartOnHitEffectProj")) { SmartOnHitEffectBehaviour smartOnHitEffectBehaviour3 = itemObject.AddComponent(); smartOnHitEffectBehaviour3.effectType = SmartOnHitEffectBehaviour.EffectType.Projectile; smartOnHitEffectBehaviour3.explosions = explosions; } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("GeeztJeez.Technicalitems", "TechnicalItems", "1.0.19")] internal class Loader : BaseUnityPlugin { public static string modName; public static bool DebugEnabled; public static string modtitle; private void ApplyHarmony() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) try { new Harmony(modName).PatchAll(Assembly.GetExecutingAssembly()); Log(" Harmony patched successfully!"); } catch (Exception ex) { LogError("Harmony patch failed: " + ex); Log("Please contact Geezt Jeez or try reloading the game for proper installation..."); } } static Loader() { DebugEnabled = false; modtitle = "Technical Items"; modName = "TechnicalItems"; } public static void Log(string message) { if (DebugEnabled) { Debug.Log((object)$"[{modName}] {message}"); } } public static void LogWarning(string message) { if (DebugEnabled) { Debug.LogWarning((object)$"[{modName}] {message}"); } } public static void LogError(string message) { if (DebugEnabled) { Debug.LogError((object)$"[{modName}] {message}"); } } private void Awake() { ApplyHarmony(); ((MonoBehaviour)this).StartCoroutine(Call()); } private IEnumerator Call() { yield return (object)new WaitUntil((Func)(() => (Object)(object)Object.FindObjectOfType() != (Object)null)); yield return (object)new WaitUntil((Func)(() => ServiceLocator.GetService() != null)); Log($"Loading {modtitle}!"); SLMALoader.GetInstance(); Manager.Init(ContentDatabase.Instance().LandfallContentDatabase); GameObject[] array = Resources.FindObjectsOfTypeAll(); for (int num = 0; num < array.Length; num++) { Manager.SetItemObject(array[num]); } Log($"Loaded {modtitle} Successfully!"); } } } namespace TIComponents { public class ScaleWeaponBehaviour : 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(); 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 RemoveWeaponParticlesBehaviour : MonoBehaviour { private Unit unit; private Weapon weapon; public bool right; private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); if (right) { weapon = unit.data.weaponHandler.rightWeapon; } if (!right) { weapon = unit.data.weaponHandler.leftWeapon; } ParticleSystem[] componentsInChildren = ((Component)weapon).gameObject.GetComponentsInChildren(); foreach (ParticleSystem obj in componentsInChildren) { Object.Destroy((Object)(object)((Component)obj).gameObject.GetComponentInChildren()); Object.Destroy((Object)(object)obj); } } } public class GetAndDeleteRiderBehaviour : MonoBehaviour { public UnitSpawner unitSpawner; public UnitBlueprint riderBlueprint; private void Start() { GameObject val = ((Component)((Component)this).transform.root).GetComponentInChildren().riders[0]; riderBlueprint = val.GetComponentInChildren().unitBlueprint; UnitSpawner componentInChildren = ((Component)this).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)riderBlueprint)) { unitSpawner = componentInChildren; unitSpawner.unitBlueprint = riderBlueprint; unitSpawner.rangedUnitBlueprint = riderBlueprint; } Object.Destroy((Object)(object)val.gameObject); } } public class AdaptiveBurstBehaviour : MonoBehaviour { private Color color; private Unit unit; private RangeWeapon[] rangeWeapons; private SpawnObject[] spawnObjects; private ParticleSystem[] particleSystems; private ParticleSystemRenderer[] particleRenderers; private GameObject currentProjectile; private float refreshTimer; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); spawnObjects = ((Component)this).GetComponentsInChildren(); particleSystems = ((Component)this).GetComponentsInChildren(); particleRenderers = ((Component)this).GetComponentsInChildren(); Refresh(); } private void Update() { refreshTimer += Time.deltaTime; if (refreshTimer >= 0.25f) { refreshTimer = 0f; Refresh(); } } private void Refresh() { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)unit)) { return; } rangeWeapons = ((Component)unit).GetComponentsInChildren(); if (rangeWeapons == null || rangeWeapons.Length == 0) { return; } int num = Random.Range(0, rangeWeapons.Length); if ((Object)(object)rangeWeapons[num] == (Object)null || (Object)(object)rangeWeapons[num].ObjectToSpawn == (Object)null) { return; } GameObject objectToSpawn = rangeWeapons[num].ObjectToSpawn; if ((Object)(object)objectToSpawn == (Object)(object)currentProjectile) { return; } currentProjectile = objectToSpawn; for (int i = 0; i < spawnObjects.Length; i++) { spawnObjects[i].objectToSpawn = objectToSpawn; } Renderer componentInChildren = objectToSpawn.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { color = componentInChildren.sharedMaterial.color; } for (int j = 0; j < particleSystems.Length; j++) { MainModule main = particleSystems[j].main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color); } for (int k = 0; k < particleRenderers.Length; k++) { if ((Object)(object)((Renderer)particleRenderers[k]).sharedMaterial != (Object)null) { ((Renderer)particleRenderers[k]).sharedMaterial.color = color; } if ((Object)(object)particleRenderers[k].trailMaterial != (Object)null) { particleRenderers[k].trailMaterial.color = color; } } } } public class AdaptiveThrowBehaviour : MonoBehaviour { private Unit unit; private RangeWeapon[] rangeWeapons; private int lastRangeWeaponCount; private int lastSpawnObjectCount; private SpawnObject[] spawnObjects; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); rangeWeapons = ((Component)unit).GetComponentsInChildren(); } private void Update() { int num = ((Component)unit).GetComponentsInChildren().Length; int num2 = ((Component)this).GetComponentsInChildren().Length; if (num != lastRangeWeaponCount || num2 != lastSpawnObjectCount) { lastRangeWeaponCount = num; lastSpawnObjectCount = num2; rangeWeapons = ((Component)unit).GetComponentsInChildren(); spawnObjects = ((Component)this).GetComponentsInChildren(); } if (rangeWeapons != null && rangeWeapons.Length != 0) { GameObject objectToSpawn = rangeWeapons[Random.Range(0, rangeWeapons.Length)].ObjectToSpawn; for (int i = 0; i < spawnObjects.Length; i++) { spawnObjects[i].objectToSpawn = objectToSpawn; } } } } public class NeverShowHealthBarBehaviour : MonoBehaviour { private Unit unit; public void Start() { unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren(); } public void Update() { unit.SetHealthBarActive(false); } } public class EyeKeepOpenedBehaviour : MonoBehaviour { public void Update() { try { GooglyEye[] componentsInChildren = ((Component)((Component)this).gameObject.transform.root).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].SetState((EyeState)0); } } catch (Exception) { Debug.LogWarning((object)"No eye detected"); } } } public class TransferHPEnableBehaviour : MonoBehaviour { private Unit unit; public void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); UnitSpawner[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].transferHp = true; } SmartTransformToRiderBehaviour[] componentsInChildren2 = ((Component)unit).GetComponentsInChildren(); for (int j = 0; j < componentsInChildren2.Length; j++) { componentsInChildren2[j].transferHP = true; } SmartConnectedTransformBehaviour[] componentsInChildren3 = ((Component)unit).GetComponentsInChildren(); for (int k = 0; k < componentsInChildren3.Length; k++) { componentsInChildren3[k].transferHP = true; } } } public class SwapDistanceBaseBehaviour : 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(); 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) 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(), (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(), (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 SwapDistanceHalfBehaviour : 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(); 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) 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(), (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(), (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 AddMeleeBlinkBehaviour : MonoBehaviour { private Unit unit; private MeleeWeapon[] meleeWeapons; private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); meleeWeapons = ((Component)unit).GetComponentsInChildren(); MeleeWeapon[] array = meleeWeapons; for (int i = 0; i < array.Length; i++) { List list = new List(((Weapon)array[i]).attackEffects); list.Add((AttackEffect)(object)((Component)array[i]).gameObject.AddComponent()); ((Weapon)array[i]).attackEffects = list.ToArray(); } } } public class AddMeleeDissarmBehaviour : MonoBehaviour { private Unit unit; private MeleeWeapon[] meleeWeapons; private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); meleeWeapons = ((Component)unit).GetComponentsInChildren(); MeleeWeapon[] array = meleeWeapons; for (int i = 0; i < array.Length; i++) { ((Component)array[i]).gameObject.AddComponent(); } } } public class AddSmartMeleeDashBehaviour : MonoBehaviour { public enum AnimationProperty { RigForce, Delay } private Unit unit; private MeleeWeapon[] meleeWeapons; private void Start() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); meleeWeapons = ((Component)unit).GetComponentsInChildren(); float x = ((Component)this).transform.localScale.x; float y = ((Component)this).transform.localScale.y; MeleeWeapon[] array = meleeWeapons; for (int i = 0; i < array.Length; i++) { MeleeWeapon obj = array[i]; ((Weapon)obj).maxRange = ((Weapon)obj).maxRange * ((Component)this).transform.localScale.z; WeaponForceAnimation componentInChildren = ((Component)array[i]).gameObject.GetComponentInChildren(); if (!Object.op_Implicit((Object)(object)componentInChildren)) { List list = new List(((Weapon)array[i]).attackEffects); WeaponForceAnimation val = ((Component)array[i]).gameObject.AddComponent(); s.DeepCopyOf(val, ((GameObject)SLMALoader.SDic["weapons"]["shogunSword"]).GetComponentInChildren()); SetDefaultProperty(val, 100f); SetAnimationProperty(val, AnimationProperty.RigForce, x); SetAnimationProperty(val, AnimationProperty.Delay, y); list.Add((AttackEffect)(object)val); ((Weapon)array[i]).attackEffects = list.ToArray(); } else { s.DeepCopyOf(componentInChildren, ((GameObject)SLMALoader.SDic["weapons"]["shogunSword"]).GetComponentInChildren()); SetDefaultProperty(componentInChildren, 100f); SetAnimationProperty(componentInChildren, AnimationProperty.RigForce, x); SetAnimationProperty(componentInChildren, AnimationProperty.Delay, y); } } } private void SetAnimationProperty(WeaponForceAnimation anim, AnimationProperty property, float value) { if ((Object)(object)anim == (Object)null || anim.animations == null || anim.animations.Length == 0) { Debug.LogWarning((object)"Animation or animation data missing."); return; } switch (property) { case AnimationProperty.RigForce: { SpellAnimation obj2 = anim.animations[0]; obj2.rigAnimationForce *= value; break; } case AnimationProperty.Delay: { SpellAnimation obj = anim.animations[0]; obj.animationDelay *= value; break; } default: Debug.LogWarning((object)"Unknown animation property!"); break; } } private void SetDefaultProperty(WeaponForceAnimation anim, float value) { if ((Object)(object)anim == (Object)null || anim.animations == null || anim.animations.Length == 0) { Debug.LogWarning((object)"Animation or animation data missing."); return; } Debug.Log((object)"Set the animation to default value"); anim.animations[0].rigAnimationForce = value; } } public class SmartRangeDistanceBehaviour : MonoBehaviour { private Unit unit; private Weapon[] weapons; public float unitAttackDistance; public float weaponDistance; public bool alwaysAttack; private static float SETMAX = 99999f; private void Start() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_0067: Unknown result type (might be due to invalid IL or missing references) Transform root = ((Component)this).transform.root; unit = ((Component)root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); return; } weapons = ((Component)unit).GetComponentsInChildren(); Vector3 localScale = ((Component)this).transform.localScale; unitAttackDistance = localScale.x; weaponDistance = localScale.y; alwaysAttack = localScale.z >= 1f; if (alwaysAttack) { Weapon[] array = weapons; for (int i = 0; i < array.Length; i++) { array[i].maxRange = SETMAX; } unit.api.UpdateECSValues(); unit.m_PreferedDistance = SETMAX; } else { Weapon[] array2 = weapons; for (int j = 0; j < array2.Length; j++) { array2[j].maxRange = weaponDistance; } unit.api.UpdateECSValues(); unit.m_PreferedDistance = unitAttackDistance; } } private void Update() { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)unit == (Object)null || unit.data.Dead || (Object)(object)unit.data.targetData == (Object)null || (Object)(object)MainCam.instance == (Object)null) { return; } CameraAbilityPossess componentInParent = ((Component)MainCam.instance).GetComponentInParent(); if ((!((Object)(object)componentInParent != (Object)null) || !((Object)(object)componentInParent.currentUnit == (Object)(object)unit)) && (alwaysAttack || unit.data.distanceToTarget <= unit.m_PreferedDistance || unit.data.distanceToTarget <= unitAttackDistance)) { Unit val = unit.data.targetData.unit; if ((Object)(object)val != (Object)null) { unit.Attack(val.data.mainRig.position, val.data.mainRig, val.data.mainRig.position - val.data.mainRig.position); } } } } public class FusionMechanicBehaviour : MonoBehaviour { private Unit rider; private GetAndDeleteRiderBehaviour getAndDeleteRiderBehaviour; private UnitBlueprint riderToSpawn; private Unit rootUnit; private bool hasTriggered; private void Start() { rootUnit = ((Component)((Component)this).transform.root).GetComponentInChildren(); getAndDeleteRiderBehaviour = ((Component)this).GetComponentInChildren(); riderToSpawn = getAndDeleteRiderBehaviour.riderBlueprint; if (!hasTriggered) { hasTriggered = true; rider = Spawn(riderToSpawn); } } private void Update() { if (Object.op_Implicit((Object)(object)rootUnit) & Object.op_Implicit((Object)(object)rider)) { MirrorRigs(rider, rootUnit); } } 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 Unit Spawn(UnitBlueprint unitBlueprint) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) Unit val = default(Unit); unitBlueprint.Spawn(rootUnit.data.mainRig.position, rootUnit.data.mainRig.rotation, rootUnit.Team, ref val, 1f, false, true, 0, (UnitPoolInfo?)null); if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.AddComponent().targetUnit = rootUnit; return val; } return null; } } public class StandStillBehaviour : MonoBehaviour { private Unit unit; private UnitDontWalkFor unitDontWalkFor; private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); unitDontWalkFor = ((Component)unit).gameObject.AddComponent(); unitDontWalkFor.time = float.PositiveInfinity; unitDontWalkFor.Go(); } private void Update() { unitDontWalkFor.Go(); } } public class SkinnedChangesBehaviour : 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(); curMat = ((Component)this).gameObject.GetComponentInChildren().materials[0]; if (!Object.op_Implicit((Object)(object)curMat)) { return; } Renderer[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren(); foreach (Renderer val in componentsInChildren) { if (((Component)val).tag == "UnitMesh" && (Object)(object)val.materials[0] != (Object)(object)curMat) { List list = new List(); Material[] materials = val.materials; for (int j = 0; j < materials.Length; j++) { list.Add(new Material(curMat)); } val.materials = list.ToArray(); } } } } public class NoFallDamageBehaviour : MonoBehaviour { private Unit unit; private UnitDontWalkFor unitDontWalkFor; private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); } 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 MeleeTrailBehaviour : 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(); curMat = ((Component)this).gameObject.GetComponentInChildren().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(); for (int i = 0; i < componentsInChildren.Length; i++) { Object.Destroy((Object)(object)componentsInChildren[i]); } AddTrail(((Component)val2.GetComponentInChildren()).gameObject, curMat, val); } private void AddTrail(GameObject point, Material material, AnimationCurve widthCurve) { TrailRenderer obj = point.AddComponent(); obj.time = 0.5f; ((Renderer)obj).material = material; obj.widthCurve = widthCurve; } } public class ForcedSkinChangeBehaviour : MonoBehaviour { private sealed class RendererMaterialEntry { public SkinnedMeshRenderer renderer; public Material[] forcedMaterials; } public Unit unit; private Material clonedMat; [SerializeField] private float updateInterval = 0.5f; private float timer; private readonly List cachedRenderers = new List(); private readonly Dictionary materialArrayCache = new Dictionary(); private void Start() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { ((Behaviour)this).enabled = false; return; } MeshRenderer componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null || ((Renderer)componentInChildren).sharedMaterials.Length == 0) { ((Behaviour)this).enabled = false; return; } clonedMat = new Material(((Renderer)componentInChildren).sharedMaterials[0]); SkinnedMeshRenderer[] componentsInChildren = ((Component)unit).GetComponentsInChildren(true); foreach (SkinnedMeshRenderer val in componentsInChildren) { if (!Object.op_Implicit((Object)(object)((Component)val).GetComponentInParent()) && !Object.op_Implicit((Object)(object)((Component)val).GetComponentInParent()) && !Object.op_Implicit((Object)(object)((Component)val).GetComponentInParent()) && !Object.op_Implicit((Object)(object)((Component)val).GetComponentInParent())) { cachedRenderers.Add(new RendererMaterialEntry { renderer = val, forcedMaterials = GetMaterialArray(((Renderer)val).sharedMaterials.Length) }); } } ForceMaterials(); } private void OnDestroy() { if ((Object)(object)clonedMat != (Object)null) { Object.Destroy((Object)(object)clonedMat); } } private void Update() { timer += Time.deltaTime; if (!(timer < updateInterval)) { timer = 0f; ForceMaterials(); } } private Material[] GetMaterialArray(int count) { if (!materialArrayCache.TryGetValue(count, out var value)) { value = (Material[])(object)new Material[count]; for (int i = 0; i < count; i++) { value[i] = clonedMat; } materialArrayCache.Add(count, value); } return value; } private void ForceMaterials() { for (int num = cachedRenderers.Count - 1; num >= 0; num--) { RendererMaterialEntry rendererMaterialEntry = cachedRenderers[num]; if ((Object)(object)rendererMaterialEntry.renderer == (Object)null) { cachedRenderers.RemoveAt(num); } else if (((Renderer)rendererMaterialEntry.renderer).sharedMaterials != rendererMaterialEntry.forcedMaterials) { ((Renderer)rendererMaterialEntry.renderer).sharedMaterials = rendererMaterialEntry.forcedMaterials; } } if (cachedRenderers.Count == 0) { ((Behaviour)this).enabled = false; } } } public class SmartTransformationAmountBehaviour : MonoBehaviour { private Unit unit; public void Start() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); int num = (int)((Component)this).gameObject.transform.localScale.x; UnitSpawner[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].amountToSpawn = num; } SmartTransformToRiderBehaviour[] componentsInChildren2 = ((Component)unit).GetComponentsInChildren(); for (int j = 0; j < componentsInChildren2.Length; j++) { componentsInChildren2[j].spawnAmount = num; } SmartConnectedTransformBehaviour[] componentsInChildren3 = ((Component)unit).GetComponentsInChildren(); for (int k = 0; k < componentsInChildren3.Length; k++) { componentsInChildren3[k].spawnAmount = num; } } } public class DestroyAbilitiesModelBehaviour : MonoBehaviour { private void Awake() { SpecialAbility[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { DestroyChild(((Component)componentsInChildren[i]).gameObject); } } public void DestroyChild(GameObject gameObject) { Renderer[] componentsInChildren = gameObject.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { if (((object)componentsInChildren[i]).GetType() != typeof(ParticleSystemRenderer)) { Object.Destroy((Object)(object)componentsInChildren[i]); } } } private void Start() { SpecialAbility[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { DestroyChild(((Component)componentsInChildren[i]).gameObject); } } } public class RemoveTurnadoBehaviour : MonoBehaviour { private Unit unit; private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren(); SpinToWinBehaviour[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren(); foreach (SpinToWinBehaviour obj in componentsInChildren) { obj.turnadoStartEvent = obj.turnadoEndEvent; } } } public class SmartProjectileScalingBehaviour : MonoBehaviour { private Unit unit; private GameObject hiddenParent; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); SetUpHiddenParent(); ProcessObjectsToScale((Func)((RangeWeapon rw) => rw.ObjectToSpawn), (Action)delegate(RangeWeapon rw, GameObject obj) { rw.ObjectToSpawn = obj; }); ProcessObjectsToScale((Func)((SpawnObject so) => so.objectToSpawn), (Action)delegate(SpawnObject so, GameObject obj) { so.objectToSpawn = obj; }); } private void SetUpHiddenParent() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown hiddenParent = new GameObject("HiddenParent") { hideFlags = (HideFlags)61 }; hiddenParent.SetActive(false); } private void ProcessObjectsToScale(Func getObject, Action setObject) where T : Component { T[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); foreach (T val in componentsInChildren) { GameObject val2 = getObject(val); if (!((Object)(object)val2 == (Object)null)) { GameObject arg = CreateScaledCopy(val2); setObject(val, arg); } } } private GameObject CreateScaledCopy(GameObject original) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) GameObject obj = Object.Instantiate(original, hiddenParent.transform); Vector3 localScale = obj.transform.localScale; Vector3 localScale2 = ((Component)this).transform.localScale; obj.transform.localScale = Vector3.Scale(localScale, localScale2); return obj; } } public class SmartWeaponRigidbodyChangeBehaviour : MonoBehaviour { private Unit unit; public bool right; public float scaleMultiplier; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); return; } Weapon val = (right ? unit.data.weaponHandler.rightWeapon : unit.data.weaponHandler.leftWeapon); if ((Object)(object)val != (Object)null) { ApplyRigidbodyChanges(((Component)val).gameObject); } } private void ApplyRigidbodyChanges(GameObject weapon) { Rigidbody componentInChildren = weapon.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { UpdateRigidbodyData(componentInChildren); } } private void Update() { Weapon val = (right ? unit.data.weaponHandler.rightWeapon : unit.data.weaponHandler.leftWeapon); if ((Object)(object)val != (Object)null) { Rigidbody componentInChildren = ((Component)val).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { UpdateRigidbodyData(componentInChildren); } } } private void UpdateRigidbodyData(Rigidbody rigidbody) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = ((Component)this).transform.localScale; rigidbody.mass = localScale.x; rigidbody.drag = localScale.y; rigidbody.angularDrag = localScale.z; } } public class SmartWeaponHoldingChangeBehaviour : MonoBehaviour { public enum HoldingChangeType { UpRotation, ForwardRotation, RelativePosition, HoldingStats } private Unit unit; public bool right; public HoldingChangeType holdingChangeType; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); return; } Weapon val = (right ? unit.data.weaponHandler.rightWeapon : unit.data.weaponHandler.leftWeapon); if ((Object)(object)val != (Object)null) { ApplyWeaponHoldingChanges(((Component)val).gameObject); } } private void ApplyWeaponHoldingChanges(GameObject weapon) { Holdable componentInChildren = weapon.GetComponentInChildren(); if (!((Object)(object)componentInChildren == (Object)null)) { UpdateHoldableData(componentInChildren); } } private void Update() { Weapon val = (right ? unit.data.weaponHandler.rightWeapon : unit.data.weaponHandler.leftWeapon); if ((Object)(object)val != (Object)null) { Holdable componentInChildren = ((Component)val).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { UpdateHoldableData(componentInChildren); } } } private void UpdateHoldableData(Holdable holdable) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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) //IL_0079: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = ((Component)this).transform.localScale; switch (holdingChangeType) { case HoldingChangeType.UpRotation: holdable.holdableData.upRotation = localScale; break; case HoldingChangeType.ForwardRotation: holdable.holdableData.forwardRotation = localScale; break; case HoldingChangeType.RelativePosition: holdable.holdableData.relativePosition = localScale; break; case HoldingChangeType.HoldingStats: holdable.pidData.proportionalForce = localScale.x; holdable.jointData.angularDrive = localScale.y; holdable.jointData.limit = localScale.z; break; } } } public class AbilityRemoveSoundBehaviour : MonoBehaviour { private void Start() { SpecialAbility[] componentsInChildren = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentsInChildren(); foreach (SpecialAbility val in componentsInChildren) { AudioSource[] componentsInChildren2 = ((Component)val).gameObject.GetComponentsInChildren(); for (int j = 0; j < componentsInChildren2.Length; j++) { Object.Destroy((Object)(object)componentsInChildren2[j]); } PlaySoundEffect[] componentsInChildren3 = ((Component)val).gameObject.GetComponentsInChildren(); for (int j = 0; j < componentsInChildren3.Length; j++) { Object.Destroy((Object)(object)componentsInChildren3[j]); } } } } public class KeepNormalUnitColorInstanceBehaviour : MonoBehaviour { private Unit unit; private UnitColorHandler colorHandler; private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); return; } colorHandler = ((Component)unit).GetComponentInChildren(); if ((Object)(object)colorHandler == (Object)null) { Debug.LogError((object)"UnitColorHandler not found on the unit."); } } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown if (!((Object)(object)unit == (Object)null) && !((Object)(object)colorHandler == (Object)null) && colorHandler.colors != null) { colorHandler.effectColor = Color.clear; UnitColorInstance val = new UnitColorInstance { acceptWhenDead = false, color = Color.clear, currentValue = 0f, colorName = "NormalValue" }; colorHandler.SetColor(val, 0f); colorHandler.colors = null; } } } public class NullifyAllDelayBehaviour : MonoBehaviour { private Unit unit; private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); DelayEvent[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].delay = 0f; componentsInChildren[i].randomDelay = 0f; } } } public class SmartMagSetBehaviour : MonoBehaviour { private Unit unit; public bool right; private RangeWeapon rangeWeapon; private int lastMag = -1; private float lastReload = -1f; private int lastBurst = -1; private static readonly FieldInfo AmmoField; private void Update() { if ((Object)(object)unit == (Object)null || (Object)(object)unit.data == (Object)null || (Object)(object)unit.data.weaponHandler == (Object)null) { return; } if ((Object)(object)rangeWeapon == (Object)null) { FindWeapon(); if ((Object)(object)rangeWeapon == (Object)null) { return; } } ApplySettings(force: false); } private void Start() { ((MonoBehaviour)this).StartCoroutine(Initialize()); } private IEnumerator Initialize() { yield return null; unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found."); yield break; } FindWeapon(); ApplySettings(force: true); } private void FindWeapon() { Weapon val = (right ? unit.data.weaponHandler.rightWeapon : unit.data.weaponHandler.leftWeapon); rangeWeapon = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponentInChildren() : null); } private void ApplySettings(bool force) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = ((Component)this).transform.localScale; int num = Mathf.Max(1, Mathf.RoundToInt(localScale.x + 1f)); float num2 = Mathf.Max(0f, localScale.y); int num3 = Mathf.Max(1, Mathf.RoundToInt(localScale.z)); bool flag = force || num != lastMag; bool flag2 = force || !Mathf.Approximately(num2, lastReload); bool flag3 = force || num3 != lastBurst; if (!flag && !flag2 && !flag3) { return; } if (flag && force) { rangeWeapon.magSize = num; if (AmmoField != null) { int num4 = (int)AmmoField.GetValue(rangeWeapon); AmmoField.SetValue(rangeWeapon, Mathf.Min(num4, num)); } lastMag = num; } if (flag2) { rangeWeapon.reloadTime = num2; lastReload = num2; } if (flag3) { rangeWeapon.maxProjectilesPerFrane = num3; lastBurst = num3; } } static SmartMagSetBehaviour() { AmmoField = typeof(RangeWeapon).GetField("ammo", BindingFlags.Instance | BindingFlags.NonPublic); } } public class SmartRangedSetBehaviour : MonoBehaviour { private Unit unit; [Tooltip("Set to true to modify the right weapon; false for the left weapon.")] public bool right; private PropItem propItem; private PropItemData propItemData; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"[SmartRangedSet] Unit not found in hierarchy."); return; } propItem = ((Component)this).GetComponentInChildren(); if ((Object)(object)propItem == (Object)null) { Debug.LogError((object)"[SmartRangedSet] PropItem not found."); return; } propItemData = ((CharacterItem)propItem).PropData; SetDefaultIfZero(); DataHandler data = unit.data; WeaponHandler val = (((Object)(object)data != (Object)null) ? data.weaponHandler : null); if ((Object)(object)val == (Object)null) { Debug.LogWarning((object)"[SmartRangedSet] WeaponHandler not found."); return; } Weapon val2 = (right ? val.rightWeapon : val.leftWeapon); if ((Object)(object)val2 == (Object)null) { Debug.LogWarning((object)("[SmartRangedSet] " + (right ? "Right" : "Left") + " weapon is null.")); return; } Debug.Log((object)("[SmartRangedSet] Editing " + (right ? "right" : "left") + " weapon: " + ((Object)val2).name)); RangeWeapon componentInChildren = ((Component)val2).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { UpdateRangedData(componentInChildren); } else { Debug.LogWarning((object)"[SmartRangedSet] RangeWeapon component not found on the selected weapon."); } } private void UpdateRangedData(RangeWeapon rangeWeapon) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) Vector3 localScale = ((Component)this).transform.localScale; Vector3 positionOffset = propItemData.m_positionOffset; rangeWeapon.force *= localScale.x; ((Weapon)rangeWeapon).internalCooldown = localScale.y; rangeWeapon.spread = localScale.z; rangeWeapon.shootRecoil = positionOffset.x; rangeWeapon.torsoRecoil = positionOffset.x; rangeWeapon.numberOfObjects = Mathf.RoundToInt(positionOffset.y); rangeWeapon.spawnDelay = positionOffset.z; rangeWeapon.delayPerSpawn = positionOffset.z; rangeWeapon.useSpawnDelayForEveryShot = true; rangeWeapon.useRandomDelay = false; Debug.Log((object)$"[SmartRangedSet] Updated RangeWeapon: Force={rangeWeapon.force}, Cooldown={((Weapon)rangeWeapon).internalCooldown}, Spread={rangeWeapon.spread}, Recoil={rangeWeapon.shootRecoil}, NumberOfObjects={rangeWeapon.numberOfObjects}, SpawnDelay={rangeWeapon.spawnDelay}"); } private void SetDefaultIfZero() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (propItemData.m_positionOffset == Vector3.zero) { propItemData.m_positionOffset = Vector3.one; Debug.Log((object)"[SmartRangedSet] m_positionOffset was zero; set to Vector3.one."); } if (((Component)this).transform.localPosition == Vector3.zero) { ((Component)this).transform.localPosition = Vector3.one; Debug.Log((object)"[SmartRangedSet] localPosition was zero; set to Vector3.one."); } } } public class SmartMeleeSetBehaviour : MonoBehaviour { private Unit unit; public bool right; private PropItem propItem; private PropItemData propItemData; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"[SmartMeleeSet] Unit not found in hierarchy."); return; } propItem = ((Component)this).GetComponentInChildren(); if ((Object)(object)propItem == (Object)null) { Debug.LogError((object)"[SmartMeleeSet] PropItem not found."); return; } propItemData = ((CharacterItem)propItem).PropData; SetDefaultIfZero(); DataHandler data = unit.data; WeaponHandler val = (((Object)(object)data != (Object)null) ? data.weaponHandler : null); if ((Object)(object)val == (Object)null) { Debug.LogWarning((object)"[SmartMeleeSet] WeaponHandler not found."); return; } Weapon val2 = (right ? val.rightWeapon : val.leftWeapon); if ((Object)(object)val2 == (Object)null) { Debug.LogWarning((object)("[SmartMeleeSet] " + (right ? "Right" : "Left") + " weapon is null.")); return; } Debug.Log((object)("[SmartMeleeSet] Editing " + (right ? "right" : "left") + " weapon: " + ((Object)val2).name)); MeleeWeapon componentInChildren = ((Component)val2).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { UpdateMeleeData(componentInChildren); } CollisionWeapon componentInChildren2 = ((Component)val2).GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { UpdateCollisionData(componentInChildren2); } } private void UpdateMeleeData(MeleeWeapon meleeWeapon) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = ((Component)this).transform.localScale; ((Weapon)meleeWeapon).internalCooldown = localScale.y; meleeWeapon.requiredPowerToParry = propItemData.m_positionOffset.y; meleeWeapon.curveForce *= localScale.z; Debug.Log((object)$"[SmartMeleeSet] Updated MeleeWeapon: Cooldown={((Weapon)meleeWeapon).internalCooldown}, CurveForce={meleeWeapon.curveForce}"); } private void UpdateCollisionData(CollisionWeapon collisionWeapon) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = ((Component)this).transform.localScale; collisionWeapon.damage *= localScale.x; collisionWeapon.screenShakeMultiplier = propItemData.m_positionOffset.x; collisionWeapon.selfDamageMultiplier = propItemData.m_positionOffset.z; Debug.Log((object)$"[SmartMeleeSet] Updated CollisionWeapon: Damage={collisionWeapon.damage}"); } private void SetDefaultIfZero() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (propItemData.m_positionOffset == Vector3.zero) { propItemData.m_positionOffset = Vector3.one; } if (((Component)this).transform.localPosition == Vector3.zero) { ((Component)this).transform.localPosition = Vector3.one; } } } public class ForcePointAddReaperScytheEffectBehaviour : MonoBehaviour { private Unit unit; private Material curMat; public GameObject trailObject; private List trails; private void Start() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); return; } trails = new List(); ForcePoint[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); foreach (ForcePoint val in componentsInChildren) { GameObject obj = Object.Instantiate(trailObject, ((Component)val).transform); obj.transform.localScale = ((Component)this).gameObject.transform.localScale; ParticleSystemRenderer componentInChildren = obj.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { trails.Add(componentInChildren); } else { Debug.LogWarning((object)"Trail object does not contain a ParticleSystemRenderer component."); } } } private void Update() { if ((Object)(object)curMat == (Object)null) { MeshRenderer componentInChildren = ((Component)this).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && ((Renderer)componentInChildren).materials.Length != 0) { curMat = ((Renderer)componentInChildren).materials[0]; } } if (!((Object)(object)curMat != (Object)null)) { return; } foreach (ParticleSystemRenderer trail in trails) { if ((Object)(object)trail.trailMaterial != (Object)(object)curMat) { trail.trailMaterial = curMat; } } } } public class BindSiegeHealthBehaviour : MonoBehaviour { public enum BindType { UnbindVehicleHealth, UnbindRiderHealth, BindVehicleHealth, BindRiderHealth } private Unit unit; public BindType HealthBindType; public void Start() { unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogWarning((object)"Unit component not found."); return; } MountPos[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); foreach (MountPos val in componentsInChildren) { switch (HealthBindType) { case BindType.UnbindVehicleHealth: val.killVehicleIfRiderDies = false; break; case BindType.UnbindRiderHealth: val.killRiderIfVehicleDies = false; break; case BindType.BindVehicleHealth: val.killVehicleIfRiderDies = true; break; case BindType.BindRiderHealth: val.killRiderIfVehicleDies = true; break; } } } } public class ColorableWeaponProjBehaviour : MonoBehaviour { public enum ChangeType { Model, Particle } private Unit unit; private GameObject hiddenParent; private Material curMat; public ChangeType MaterialChangeType; private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Loader.LogWarning("Unit component not found."); return; } SetHiddenParent(); RangeWeapon[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); foreach (RangeWeapon val in componentsInChildren) { val.ObjectToSpawn = MakeTempCopy(val.ObjectToSpawn); } } private GameObject MakeTempCopy(GameObject gameObjectToCopy) { GameObject val = Object.Instantiate(gameObjectToCopy, hiddenParent.transform); MeshRenderer componentInChildren = ((Component)this).GetComponentInChildren(); curMat = (((Object)(object)componentInChildren != (Object)null) ? ((Renderer)componentInChildren).materials[0] : null); if ((Object)(object)curMat != (Object)null) { switch (MaterialChangeType) { case ChangeType.Particle: ApplyMaterialToRenderers(val); break; case ChangeType.Model: ApplyMaterialToRenderers(val); ApplyMaterialToRenderers(val); break; } } return val; } 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); } private void ApplyMaterialToRenderers(GameObject obj) where T : Renderer { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown T[] componentsInChildren = obj.GetComponentsInChildren(); foreach (T val in componentsInChildren) { List list = new List(); Material[] materials = ((Renderer)val).materials; for (int j = 0; j < materials.Length; j++) { _ = materials[j]; list.Add(new Material(curMat)); } ((Renderer)val).materials = list.ToArray(); } } } [RequireComponent(typeof(MoveTransform), typeof(SpellTarget))] public class HomingProjCustomizedBehaviour : MonoBehaviour { private MoveTransform move; public Transform upTarget; public float minRot = 300f; public float maxRot = 700f; public float drag = 15f; public float force = 50f; public float upForce = 200f; public AnimationCurve upForceOverRange; public AnimationCurve upForceOverTimes; public AnimationCurve dragOverTime; public AnimationCurve forceOverTime; public float prediction; private float rot; private float counter; private SpellTarget target; public float expiration = float.PositiveInfinity; private void Start() { //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) move = GetOrAddComponent(); target = GetOrAddComponent(); minRot = 300f; maxRot = 700f; drag = 15f; force = 50f; upForce = 200f; Dictionary dictionary; if (SLMALoader.SDic.TryGetValue("projectiles", out var value) && (dictionary = value) != null) { GameObject val; if (dictionary.TryGetValue("P_MagicMissile", out var value2) && (Object)(object)(val = (GameObject)((value2 is GameObject) ? value2 : null)) != (Object)null) { MoveTransformMissile component = val.GetComponent(); if ((Object)(object)component != (Object)null) { upTarget = component.upTarget; upForceOverRange = component.upForceOverRange; upForceOverTimes = component.upForceOverTimes; dragOverTime = component.dragOverTime; forceOverTime = component.forceOverTime; } else { Debug.LogWarning((object)"MoveTransformMissile component not found in P_MagicMissile."); } } else { Debug.LogWarning((object)"P_MagicMissile not found or is not a GameObject."); } } else { Debug.LogWarning((object)"Projectiles dictionary not found in SLMALoader.SDic."); } rot = Random.Range(minRot, maxRot); if ((Object)(object)upTarget != (Object)null) { upTarget.Rotate(((Component)this).transform.forward * Random.Range(0f, 360f), (Space)0); } else { Debug.LogWarning((object)"upTarget is not set. Homing behavior may not work correctly."); } } private void Update() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: 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_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) counter += Time.deltaTime; if (counter >= expiration) { Object.Destroy((Object)(object)this); return; } SpellTarget val = target; if ((Object)(object)(((Object)(object)val != (Object)null) ? val.rig : null) != (Object)null) { float num = Vector3.Distance(((Component)this).transform.position, target.rig.position); Vector3 val2 = target.rig.position + target.rig.velocity * prediction - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; MoveTransform obj = move; obj.velocity += normalized * force * forceOverTime.Evaluate(counter) * Time.deltaTime; if ((Object)(object)upTarget != (Object)null) { MoveTransform obj2 = move; obj2.velocity += upTarget.forward * upForce * upForceOverRange.Evaluate(num) * upForceOverTimes.Evaluate(counter) * Time.deltaTime; } MoveTransform obj3 = move; obj3.velocity -= move.velocity * drag * dragOverTime.Evaluate(counter) * Time.deltaTime; } if ((Object)(object)upTarget != (Object)null) { upTarget.Rotate(((Component)this).transform.forward * rot * Time.deltaTime, (Space)0); } } private T GetOrAddComponent() where T : Component { T val = ((Component)this).GetComponentInChildren(); if ((Object)(object)val == (Object)null) { val = ((Component)this).gameObject.AddComponent(); Debug.Log((object)("Added missing component: " + typeof(T).Name)); } return val; } } public class ChangeWeaponProjectileHomingBehaviour : MonoBehaviour { private Unit unit; public float scaleM; private GameObject hiddenParent; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); SetHiddenParent(); RangeWeapon[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren(); foreach (RangeWeapon val in componentsInChildren) { GameObject objectToSpawn = MakeTempCopy(val.ObjectToSpawn); val.ObjectToSpawn = objectToSpawn; } } private GameObject MakeTempCopy(GameObject gameObjectToCopy) { GameObject obj = Object.Instantiate(gameObjectToCopy, hiddenParent.transform); obj.AddComponent().force *= 6f; 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); } } public class SmartProjSetBehaviour : MonoBehaviour { private Unit unit; public bool right; private GameObject hiddenParent; private PropItem propItem; private PropItemData propItemData; private void Start() { try { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); return; } propItem = ((Component)this).gameObject.GetComponentInChildren(); propItemData = ((CharacterItem)propItem).PropData; SetDefaultIfZero(); SetHiddenParent(); Weapon val = (right ? unit.data.weaponHandler.rightWeapon : unit.data.weaponHandler.leftWeapon); if ((Object)(object)val != (Object)null) { ApplyProjChanges(((Component)val).gameObject); } else { Debug.LogWarning((object)("Weapon not found on the " + (right ? "right" : "left") + " side.")); } } catch (Exception ex) { Debug.LogError((object)ex); } } private void ApplyProjChanges(GameObject weapon) { RangeWeapon componentInChildren = weapon.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { GameObject objectToSpawn = MakeTempCopy(componentInChildren.ObjectToSpawn); componentInChildren.ObjectToSpawn = objectToSpawn; Debug.Log((object)"Projectile changed successfully"); } else { Debug.LogWarning((object)"RangeWeapon component not found in weapon."); } } private GameObject MakeTempCopy(GameObject gameObjectToCopy) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) GameObject obj = Object.Instantiate(gameObjectToCopy, hiddenParent.transform); ProjectileHit componentInChildren = obj.GetComponentInChildren(); MoveTransform componentInChildren2 = obj.GetComponentInChildren(); Vector3 localScale = ((Component)this).transform.localScale; if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.force *= localScale.x; componentInChildren.damage = localScale.z; componentInChildren.blockPoweredNeeded = propItemData.m_positionOffset.x; componentInChildren.allowedHits = (int)propItemData.m_positionOffset.y; componentInChildren.shakeAmount = propItemData.m_positionOffset.z; } if ((Object)(object)componentInChildren2 != (Object)null) { componentInChildren2.selfImpulse *= localScale.y; } return obj; } private void SetHiddenParent() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown hiddenParent = new GameObject("HiddenParent") { hideFlags = (HideFlags)61 }; hiddenParent.SetActive(false); } private void SetDefaultIfZero() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (propItemData.m_positionOffset == Vector3.zero) { propItemData.m_positionOffset = Vector3.one; } if (((Component)this).gameObject.transform.localPosition == Vector3.zero) { ((Component)this).gameObject.transform.localPosition = Vector3.one; } } } public class OnHitEffectAddonBehaviour : MonoBehaviour { private Unit unit; public GameObject explosion; private float counter; private const float Timer = 0.5f; public float scaleMultiplier = 1f; public int amountToSpawn = 1; public bool randomExplosion; public GameObject[] explosions; public float offset; public float damageMultiplier; public float delayPerSpawn; private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); } } private void Update() { counter += Time.deltaTime; } private void OnCollisionEnter(Collision collision) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) Debug.LogError((object)"IM COLLIDING SO GOOD OHHHHHH"); if ((Object)(object)collision.gameObject == (Object)null) { Debug.Log((object)"Collision has no gameObject."); return; } if (counter < 0.5f) { Debug.Log((object)"Collision ignored due to counter < 0.5f"); return; } Unit componentInChildren = ((Component)collision.gameObject.transform.root).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { Debug.Log((object)"No Unit component found in collided object."); return; } if (componentInChildren.Team == unit.Team) { Debug.Log((object)"Collided Unit is on the same team. Ignoring."); return; } if ((Object)(object)componentInChildren == (Object)(object)unit) { Debug.Log((object)"Collided with self. Ignoring."); return; } Debug.Log((object)"Valid collision! Preparing explosion."); counter = 0f; if (randomExplosion) { Debug.Log((object)"Spawning random explosion."); ((MonoBehaviour)this).StartCoroutine(SpawnExplosionRandom(explosions, collision.transform.position)); } else if ((Object)(object)explosion != (Object)null) { Debug.Log((object)"Spawning specific explosion."); ((MonoBehaviour)this).StartCoroutine(SpawnExplosion(explosion, collision.transform.position)); } else { Debug.Log((object)"No explosion prefab assigned."); } } private IEnumerator SpawnExplosionRandom(GameObject[] explosions, Vector3 spawnPos) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < amountToSpawn; i++) { int num = Random.Range(0, explosions.Length); GameObject obj = Object.Instantiate(explosions[num], setOffset(spawnPos), Quaternion.identity, (Transform)null); Transform transform = obj.transform; transform.localScale *= scaleMultiplier; TeamHolder val = new TeamHolder { getRootTeamOnAwake = true, team = unit.Team, spawner = ((Component)unit).gameObject }; Explosion componentInChildren = obj.GetComponentInChildren(); componentInChildren.damage *= damageMultiplier; TeamHolder.AddTeamHolder(obj, unit, val); yield return (object)new WaitForSeconds(delayPerSpawn); } } private IEnumerator SpawnExplosion(GameObject explosion, Vector3 spawnPos) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < amountToSpawn; i++) { GameObject obj = Object.Instantiate(explosion, setOffset(spawnPos), Quaternion.identity, (Transform)null); Transform transform = obj.transform; transform.localScale *= scaleMultiplier; TeamHolder val = new TeamHolder { getRootTeamOnAwake = true, team = unit.Team, spawner = ((Component)unit).gameObject }; Explosion componentInChildren = obj.GetComponentInChildren(); componentInChildren.damage *= damageMultiplier; TeamHolder.AddTeamHolder(obj, unit, val); yield return (object)new WaitForSeconds(delayPerSpawn); } } private Vector3 setOffset(Vector3 mainPos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) float num = mainPos.x + Random.Range(0f - offset, offset); float num2 = mainPos.y + Random.Range(0f - offset, offset); float num3 = mainPos.z + Random.Range(0f - offset, offset); return new Vector3(num, num2, num3); } } public class SmartOnHitEffectBehaviour : MonoBehaviour { public enum EffectType { All, Weapon, Projectile } private Unit unit; public GameObject[] explosions; private GameObject hiddenParent; public EffectType effectType; private PropItem propItem; private PropItemData propItemData; private void Start() { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); return; } propItem = ((Component)this).gameObject.GetComponentInChildren(); propItemData = ((CharacterItem)propItem).PropData; SetDefaultIfZero(); SetHiddenParent(); if (effectType == EffectType.All || effectType == EffectType.Projectile) { RangeWeapon[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); foreach (RangeWeapon rangeWeapon in componentsInChildren) { UpdateRangeWeaponProjectile(rangeWeapon); } SpawnObject[] componentsInChildren2 = ((Component)unit).GetComponentsInChildren(); foreach (SpawnObject spawnObject in componentsInChildren2) { UpdateSpawnObjectProjectile(spawnObject); } } int num = (int)((Component)this).transform.localScale.x; if (effectType == EffectType.Weapon) { WeaponItem[] componentsInChildren3 = ((Component)unit).GetComponentsInChildren(); OnHitEffectAddonBehaviour onHitEffectAddonBehaviour2 = default(OnHitEffectAddonBehaviour); for (int j = 0; j < componentsInChildren3.Length; j++) { OnHitEffectAddonBehaviour onHitEffectAddonBehaviour = ((Component)componentsInChildren3[j]).gameObject.AddComponent(); if (num >= 0) { onHitEffectAddonBehaviour.explosion = explosions[num]; } else { onHitEffectAddonBehaviour.randomExplosion = true; onHitEffectAddonBehaviour.explosions = explosions; } onHitEffectAddonBehaviour.scaleMultiplier = ((Component)this).transform.localScale.y; onHitEffectAddonBehaviour.amountToSpawn = (int)((Component)this).transform.localScale.z; onHitEffectAddonBehaviour.offset = propItemData.m_positionOffset.z; onHitEffectAddonBehaviour.delayPerSpawn = propItemData.m_positionOffset.x; onHitEffectAddonBehaviour.damageMultiplier = propItemData.m_positionOffset.y; Collider[] componentsInChildren4 = ((Component)componentsInChildren3[j]).GetComponentsInChildren(); foreach (Collider val in componentsInChildren4) { if (!((Object)(object)((Component)val).transform.parent == (Object)null) && !((Component)((Component)val).transform.parent).gameObject.TryGetComponent(ref onHitEffectAddonBehaviour2)) { OnHitEffectAddonBehaviour onHitEffectAddonBehaviour3 = ((Component)((Component)val).transform.parent).gameObject.AddComponent(); if (num >= 0) { onHitEffectAddonBehaviour3.explosion = explosions[num]; } else { onHitEffectAddonBehaviour3.randomExplosion = true; onHitEffectAddonBehaviour3.explosions = explosions; } onHitEffectAddonBehaviour3.scaleMultiplier = ((Component)this).transform.localScale.y; onHitEffectAddonBehaviour3.amountToSpawn = (int)((Component)this).transform.localScale.z; onHitEffectAddonBehaviour3.offset = propItemData.m_positionOffset.z; onHitEffectAddonBehaviour3.delayPerSpawn = propItemData.m_positionOffset.x; onHitEffectAddonBehaviour3.damageMultiplier = propItemData.m_positionOffset.y; } } } } else { if (effectType != EffectType.All) { return; } Collider[] componentsInChildren4 = ((Component)unit).GetComponentsInChildren(); OnHitEffectAddonBehaviour onHitEffectAddonBehaviour4 = default(OnHitEffectAddonBehaviour); foreach (Collider val2 in componentsInChildren4) { if (!((Object)(object)((Component)val2).transform.parent == (Object)null) && !((Component)((Component)val2).transform.parent).gameObject.TryGetComponent(ref onHitEffectAddonBehaviour4)) { OnHitEffectAddonBehaviour onHitEffectAddonBehaviour5 = ((Component)((Component)val2).transform.parent).gameObject.AddComponent(); if (num >= 0) { onHitEffectAddonBehaviour5.explosion = explosions[num]; } else { onHitEffectAddonBehaviour5.randomExplosion = true; onHitEffectAddonBehaviour5.explosions = explosions; } onHitEffectAddonBehaviour5.scaleMultiplier = ((Component)this).transform.localScale.y; onHitEffectAddonBehaviour5.amountToSpawn = (int)((Component)this).transform.localScale.z; onHitEffectAddonBehaviour5.offset = propItemData.m_positionOffset.z; onHitEffectAddonBehaviour5.delayPerSpawn = propItemData.m_positionOffset.x; onHitEffectAddonBehaviour5.damageMultiplier = propItemData.m_positionOffset.y; } } } } private void UpdateRangeWeaponProjectile(RangeWeapon rangeWeapon) { if ((Object)(object)rangeWeapon == (Object)null) { Debug.LogWarning((object)"RangeWeapon component not found in weapon."); } else { rangeWeapon.ObjectToSpawn = MakeTempCopy(rangeWeapon.ObjectToSpawn); } } private GameObject MakeTempCopy(GameObject gameObjectToCopy) { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_0089: 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) //IL_0098: Expected O, but got Unknown if ((Object)(object)gameObjectToCopy == (Object)null) { Debug.LogError((object)"GameObject to copy is null."); return null; } GameObject val = Object.Instantiate(gameObjectToCopy, hiddenParent.transform); ProjectileHit componentInChildren = val.GetComponentInChildren(); List list = new List(); for (int i = 0; i < (int)((Component)this).transform.localScale.z; i++) { GameObject val2 = Object.Instantiate(explosions[(int)((Component)this).transform.localScale.x], hiddenParent.transform); Transform transform = val2.transform; transform.localScale *= ((Component)this).transform.localScale.y; ObjectToSpawn item = new ObjectToSpawn { objectToSpawn = val2 }; list.Add(item); } if (Object.op_Implicit((Object)(object)componentInChildren)) { ObjectToSpawn[] objectsToSpawn = componentInChildren.objectsToSpawn; foreach (ObjectToSpawn item2 in objectsToSpawn) { list.Add(item2); } componentInChildren.objectsToSpawn = list.ToArray(); } return val; } private void SetHiddenParent() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown hiddenParent = new GameObject("HiddenParent") { hideFlags = (HideFlags)61 }; hiddenParent.SetActive(false); } private void UpdateSpawnObjectProjectile(SpawnObject spawnObject) { if ((Object)(object)spawnObject == (Object)null) { Debug.LogWarning((object)"RangeWeapon component not found in weapon."); } else { spawnObject.objectToSpawn = MakeTempCopy(spawnObject.objectToSpawn); } } private void SetDefaultIfZero() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (propItemData.m_positionOffset == Vector3.zero) { propItemData.m_positionOffset = Vector3.one; } if (((Component)this).gameObject.transform.localPosition == Vector3.zero) { ((Component)this).gameObject.transform.localPosition = Vector3.one; } } } public class MeleeHitFasterBehaviour : 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(); CollisionWeapon[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].hitFasterAfterDealDamage = true; } } } public class MeleeAddStickBehaviour : MonoBehaviour { private Unit unit; private void Start() { //IL_007f: 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) unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { return; } MeleeWeapon[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); foreach (MeleeWeapon val in componentsInChildren) { ForcePoint componentInChildren = ((Component)val).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { if ((Object)(object)((Component)val).GetComponentInChildren() == (Object)null) { StickPosition obj = ((Component)componentInChildren).gameObject.AddComponent(); obj.lockRotation = true; Vector3 localScale = ((Component)val).transform.localScale; obj.radius = 0.5f * ((Vector3)(ref localScale)).magnitude; } if ((Object)(object)((Component)val).GetComponent() == (Object)null) { MeleeWeaponStick obj2 = ((Component)val).gameObject.AddComponent(); obj2.hardStick = true; obj2.breakForce = 50000f; obj2.downwardsForceOnStuckRig = -50f; obj2.walkBackwardsWhenStuck = false; obj2.time = 5f; obj2.onlyOtherTeam = true; } } } } } public class SmartWeaponScalingDynamicBehaviour : MonoBehaviour { private Unit unit; public bool right; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); return; } Weapon val = (right ? unit.data.weaponHandler.rightWeapon : unit.data.weaponHandler.leftWeapon); if ((Object)(object)val != (Object)null) { UpdateScaleData(((Component)val).gameObject); } } private void Update() { Weapon val = (right ? unit.data.weaponHandler.rightWeapon : unit.data.weaponHandler.leftWeapon); if ((Object)(object)val != (Object)null) { UpdateScaleData(((Component)val).gameObject); } } private void UpdateScaleData(GameObject weaponObject) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) weaponObject.transform.localScale = ((Component)this).transform.localScale; } } public class SmartBodyPartScaleSizing : MonoBehaviour { public enum RigType { Head, Neck, Torso, LegLeft, LegRight, FootLeft, FootRight, LeftHand, RightHand, LeftArm, RightArm, Hip } private Unit unit; public RigType rigType; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); } } private void Update() { if (Object.op_Implicit((Object)(object)unit)) { UpdateRigData(); } } private void UpdateRigData() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) UnitRig componentInChildren = ((Component)unit).GetComponentInChildren(); switch (rigType) { case RigType.Head: ((Component)componentInChildren.m_head).transform.localScale = ((Component)this).transform.localScale; break; case RigType.Neck: ((Component)componentInChildren.m_neck).transform.localScale = ((Component)this).transform.localScale; break; case RigType.Torso: ((Component)componentInChildren.m_torso).transform.localScale = ((Component)this).transform.localScale; break; case RigType.LegLeft: ((Component)componentInChildren.m_legLeft).transform.localScale = ((Component)this).transform.localScale; break; case RigType.LegRight: ((Component)componentInChildren.m_legRight).transform.localScale = ((Component)this).transform.localScale; break; case RigType.FootLeft: ((Component)componentInChildren.m_footLeft).transform.localScale = ((Component)this).transform.localScale; break; case RigType.FootRight: ((Component)componentInChildren.m_footRight).transform.localScale = ((Component)this).transform.localScale; break; case RigType.LeftHand: ((Component)componentInChildren.m_wristLeft).transform.localScale = ((Component)this).transform.localScale; break; case RigType.RightHand: ((Component)componentInChildren.m_wristRight).transform.localScale = ((Component)this).transform.localScale; break; case RigType.LeftArm: ((Component)componentInChildren.m_armLeft).transform.localScale = ((Component)this).transform.localScale; break; case RigType.RightArm: ((Component)componentInChildren.m_armRight).transform.localScale = ((Component)this).transform.localScale; break; case RigType.Hip: ((Component)componentInChildren.m_waist).transform.localScale = ((Component)this).transform.localScale; break; } } } public class DynamicPropSetupBehaviour : MonoBehaviour { private Unit unit; public List meshes; private PropItemData propItemData; public float multiplier = 1f; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); propItemData = ((CharacterItem)((Component)this).GetComponentInChildren()).PropData; if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); return; } GoToBodyPart[] componentsInChildren = ((Component)this).GetComponentsInChildren(); foreach (GoToBodyPart val in componentsInChildren) { meshes.Add(((Component)val).gameObject); val.GoToPart(); } } private void Update() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (propItemData == null) { return; } foreach (GameObject mesh in meshes) { mesh.transform.localScale = ((Component)this).transform.localScale * multiplier; mesh.transform.localPosition = propItemData.m_positionOffset; mesh.transform.localRotation = ((Component)this).transform.rotation; } } } public class DynamicPropWeaponBehaviour : MonoBehaviour { private Unit unit; private PropItemData propItemData; private GameObject meshObject; public bool right; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); propItemData = ((CharacterItem)((Component)this).GetComponentInChildren()).PropData; if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); return; } meshObject = ((Component)((Component)this).GetComponentInChildren()).gameObject; Weapon val = (right ? unit.data.weaponHandler.rightWeapon : unit.data.weaponHandler.leftWeapon); if ((Object)(object)val != (Object)null && Object.op_Implicit((Object)(object)meshObject)) { MoveToWeapon(((Component)val).gameObject, meshObject); } } private void Update() { //IL_0026: 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_005c: Unknown result type (might be due to invalid IL or missing references) if (propItemData != null && Object.op_Implicit((Object)(object)meshObject)) { meshObject.transform.localScale = ((Component)this).transform.localScale; meshObject.transform.localPosition = propItemData.m_positionOffset; meshObject.transform.localRotation = ((Component)this).transform.rotation; } } private void MoveToWeapon(GameObject weaponObject, GameObject box) { box.transform.SetParent(weaponObject.transform); } } public class AdaptiveCastBehaviour : MonoBehaviour { public delegate void AttackedEventHandler(Rigidbody target, int useAttackID); public UnityEvent shootEvent; private ShootPosition[] swordPoints; private List swords = new List(); public GameObject projToCopyCodeAnimation; private GameObject hiddenParent; private RangeWeapon[] rangeWeapons; private Unit unit; public float followSpeed = 1f; public float throwSpeed = 100f; public AnimationCurve throwCurve; private float counter; private DataHandler data; private bool done; public float attackRate; private float attackspeedMulti = 1f; private int attackID; public GameObject sourceSword; private GameObject currentProjectilePrefab; private float projectileRefreshTimer; public event AttackedEventHandler Attacked; private void Start() { ((MonoBehaviour)this).StartCoroutine(DelayedInit()); } private void Update() { //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) try { projectileRefreshTimer += Time.deltaTime; if (projectileRefreshTimer >= 0.25f) { projectileRefreshTimer = 0f; RefreshProjectile(); } if (rangeWeapons != null && Object.op_Implicit((Object)(object)unit)) { if (rangeWeapons.Length == 0) { Loader.LogWarning("No RangeWeapons found on unit."); } else { int num = Random.Range(0, rangeWeapons.Length); RangeWeapon val = rangeWeapons[num]; GameObject val2 = (((Object)(object)val != (Object)null) ? val.ObjectToSpawn : null); if ((Object)(object)val2 == (Object)null) { Loader.LogError("Selected RangeWeapon has null ObjectToSpawn."); } else { sourceSword = MakeTempCopy(val2); } } } if (done) { return; } if ((Object)(object)data != (Object)null && data.Dead) { done = true; for (int i = 0; i < swords.Count; i++) { attackID = i; Attack(data.mainRig, attackID); } return; } float num2 = Mathf.Clamp(Time.deltaTime, 0f, 0.02f); DataHandler val3 = data; if ((Object)(object)(((Object)(object)val3 != (Object)null) ? val3.weaponHandler : null) != (Object)null) { attackspeedMulti = data.weaponHandler.attackSpeedMultiplier; } DataHandler val4 = data; bool num3 = (Object)(object)(((Object)(object)val4 != (Object)null) ? val4.unit : null) == (Object)null || !data.unit.IsRemotelyControlled; counter += Time.deltaTime * attackspeedMulti; if (num3) { DataHandler val5 = data; if ((Object)(object)(((Object)(object)val5 != (Object)null) ? val5.targetMainRig : null) != (Object)null && counter > attackRate) { float num4 = 999f; for (int j = 0; j < swordPoints.Length; j++) { if (swords.Count > j && swords[j] != null && !((Object)(object)swordPoints[j] == (Object)null)) { float num5 = Vector3.Angle(data.targetMainRig.position - ((Component)this).transform.position, ((Component)swordPoints[j]).transform.position - ((Component)this).transform.position); if (num5 < num4 && swords[j].sinceSpawn > 1.5f) { num4 = num5; attackID = j; } } } if (data.distanceToTarget < 10f) { Attack(data.targetMainRig, attackID); } } } for (int k = 0; k < swords.Count; k++) { SpookySword val6 = swords[k]; if (!((Object)(object)val6?.gameObject == (Object)null) && swordPoints.Length > k && !((Object)(object)swordPoints[k] == (Object)null)) { val6.sinceSpawn += num2; val6.move.velocity = (((Component)swordPoints[k]).transform.position - val6.gameObject.transform.position) * followSpeed; val6.gameObject.transform.rotation = quaternion.op_Implicit(quaternion.LookRotation(float3.op_Implicit(Vector3.up), float3.op_Implicit(((Component)swordPoints[k]).transform.position - ((Component)this).transform.position))); } } } catch (Exception ex) { Loader.LogError("Error in Update: " + ex.Message); } } public void Attack(Rigidbody target, int useAttackID) { //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) try { counter = 0f; if (useAttackID < 0 || useAttackID >= swords.Count || useAttackID >= swordPoints.Length) { Loader.LogWarning($"[AdaptiveCast] Invalid attackID: {useAttackID}. swords.Count = {swords.Count}, swordPoints.Length = {swordPoints.Length}"); return; } SpookySword val = swords[useAttackID]; if (val == null || (Object)(object)val.gameObject == (Object)null) { return; } ((MonoBehaviour)this).StartCoroutine(DoAttack(val, target)); UnityEvent val2 = shootEvent; if (val2 != null) { val2.Invoke(); } if (!done) { swords[useAttackID] = CreateNewSword(((Component)swordPoints[useAttackID]).transform.position, quaternion.op_Implicit(((Component)swordPoints[useAttackID]).transform.rotation)); } else { ProjectileHit component = val.gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.ignoreTeamMates = false; } } this.Attacked?.Invoke(target, useAttackID); } catch (Exception ex) { Loader.LogError("[AdaptiveCast] Error in Attack: " + ex.Message); } } private void OnDestroy() { try { ((MonoBehaviour)this).StopAllCoroutines(); foreach (SpookySword sword in swords) { if ((Object)(object)sword?.gameObject != (Object)null) { Object.Destroy((Object)(object)sword.gameObject); } } } catch (Exception ex) { Loader.LogError("[AdaptiveCast] Error in OnDestroy: " + ex.Message); } } private IEnumerator DoAttack(SpookySword attackSword, Rigidbody targ) { if ((Object)(object)attackSword?.gameObject == (Object)null || (Object)(object)targ == (Object)null) { yield break; } float counter = 0f; float duration = ((Keyframe)(ref throwCurve.keys[throwCurve.length - 1])).time; ProjectileStick stick = attackSword.gameObject.GetComponent(); RaycastTrail component = attackSword.gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { ((Behaviour)component).enabled = true; } while (counter < duration && ((Object)(object)stick == (Object)null || !stick.stuck)) { if ((Object)(object)attackSword.gameObject == (Object)null || (Object)(object)targ == (Object)null) { yield break; } float num = Mathf.Clamp(Time.deltaTime, 0f, 0.02f); counter += Time.deltaTime; Vector3 val = targ.position - attackSword.gameObject.transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; attackSword.move.velocity = Vector3.Lerp(attackSword.move.velocity, throwCurve.Evaluate(counter) * throwSpeed * normalized, num * 8f); attackSword.gameObject.transform.rotation = Quaternion.Lerp(attackSword.gameObject.transform.rotation, quaternion.op_Implicit(quaternion.LookRotation(float3.op_Implicit(normalized), float3.op_Implicit(Vector3.up))), num * 7f); yield return null; } counter = 0f; while (counter < 0.5f && ((Object)(object)stick == (Object)null || !stick.stuck)) { float num2 = Mathf.Clamp(Time.deltaTime, 0f, 0.02f); counter += Time.deltaTime; if ((Object)(object)attackSword.gameObject != (Object)null) { attackSword.gameObject.transform.rotation = Quaternion.Lerp(attackSword.gameObject.transform.rotation, quaternion.op_Implicit(quaternion.LookRotation(float3.op_Implicit(attackSword.move.velocity), float3.op_Implicit(Vector3.up))), num2 * 15f); } yield return null; } } private SpookySword CreateNewSword(Vector3 pos, quaternion rot) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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) SpookySword val = new SpookySword(); if ((Object)(object)sourceSword == (Object)null) { Loader.LogError("[AdaptiveCast] CreateNewSword failed: sourceSword is null."); return null; } try { val.gameObject = Object.Instantiate(sourceSword, pos, quaternion.op_Implicit(rot)); val.move = val.gameObject.GetComponent(); TeamHolder val2 = GameObjectExtensions.FetchComponent(val.gameObject); if ((Object)(object)val2 != (Object)null && (Object)(object)data != (Object)null) { val2.team = data.team; } CodeAnimation componentInChildren = val.gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.speedMultiplier = attackspeedMulti; } } catch (Exception ex) { Loader.LogError("[AdaptiveCast] Error in CreateNewSword: " + ex.Message); return null; } return val; } 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); } private GameObject MakeTempCopy(GameObject gameObjectToCopy) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Expected O, but got Unknown if ((Object)(object)gameObjectToCopy == (Object)null) { return null; } GameObject val = Object.Instantiate(gameObjectToCopy, hiddenParent.transform); RaycastTrail componentInChildren = val.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((Behaviour)componentInChildren).enabled = false; } MoveTransform componentInChildren2 = val.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { componentInChildren2.worldImpulse = Vector3.zero; componentInChildren2.selfImpulse = Vector3.zero; componentInChildren2.gravity = 0f; componentInChildren2.velocity = Vector3.zero; componentInChildren2.drag = 0f; componentInChildren2.randomVelocitySpread = 0f; componentInChildren2.sprea = 0f; componentInChildren2.rotationFollowVelocity = false; componentInChildren2.UseCappedDeltaTime = true; componentInChildren2.lateVelocityInit = false; } RemoveAfterSeconds componentInChildren3 = val.GetComponentInChildren(); if ((Object)(object)componentInChildren3 != (Object)null) { componentInChildren3.seconds = float.PositiveInfinity; } if (!Object.op_Implicit((Object)(object)val.GetComponentInChildren()) && (Object)(object)projToCopyCodeAnimation != (Object)null) { CodeAnimation componentInChildren4 = projToCopyCodeAnimation.GetComponentInChildren(); if ((Object)(object)componentInChildren4 != (Object)null) { s.DeepCopyOf(val.AddComponent(), componentInChildren4); } } if (!Object.op_Implicit((Object)(object)val.GetComponentInChildren()) && (Object)(object)unit != (Object)null) { TeamHolder val2 = new TeamHolder { spawner = ((Component)this).gameObject, team = unit.Team }; TeamHolder.AddTeamHolder(val, unit, val2); } return val; } private void Awake() { try { swordPoints = ((Component)this).GetComponentsInChildren(); unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); SetHiddenParent(); if ((Object)(object)unit != (Object)null) { RefreshProjectile(); } } catch (Exception ex) { Loader.LogError("[AdaptiveCast] Error in Awake: " + ex.Message); } } private IEnumerator DelayedInit() { yield return (object)new WaitForSeconds(0.5f); try { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)unit) && !Object.op_Implicit((Object)(object)sourceSword)) { RefreshProjectile(); } data = ((Component)((Component)this).transform.root).GetComponentInChildren(); List list = new List(); ShootPosition[] array = swordPoints; foreach (ShootPosition val in array) { if (!((Object)(object)val == (Object)null)) { SpookySword val2 = CreateNewSword(((Component)val).transform.position + Vector3.up * 2f, quaternion.op_Implicit(((Component)val).transform.rotation)); if ((Object)(object)val2?.gameObject != (Object)null) { list.AddRange(val2.gameObject.GetComponentsInChildren()); swords.Add(val2); } } } DataHandler val3 = data; if ((Object)(object)(((Object)(object)val3 != (Object)null) ? val3.unit : null) != (Object)null) { data.unit.AddRenderersToShowHide(list.ToArray(), data.unit.IsSpawnedInBlindPlacement); } } catch (Exception ex) { Loader.LogError("[AdaptiveCast] Error in DelayedInit: " + ex.Message); } } private void RefreshProjectile() { if ((Object)(object)unit == (Object)null) { return; } rangeWeapons = ((Component)unit).GetComponentsInChildren(); if (rangeWeapons == null || rangeWeapons.Length == 0) { return; } int num = Random.Range(0, rangeWeapons.Length); RangeWeapon val = rangeWeapons[num]; if ((Object)(object)val == (Object)null || (Object)(object)val.ObjectToSpawn == (Object)null) { return; } GameObject objectToSpawn = val.ObjectToSpawn; if (!((Object)(object)objectToSpawn == (Object)(object)currentProjectilePrefab)) { currentProjectilePrefab = objectToSpawn; if ((Object)(object)sourceSword != (Object)null) { Object.Destroy((Object)(object)sourceSword); } sourceSword = MakeTempCopy(objectToSpawn); } } } public class DisableUnitOutlineBehaviour : MonoBehaviour { private Unit unit; private Outline outline; public bool includeChildren = true; private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); outline = ((Component)unit).GetComponentInChildren(); if (includeChildren) { Transform[] componentsInChildren = ((Component)unit).GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { DisableOutlineComponents(((Component)val).gameObject); } } else { DisableOutlineComponents(((Component)unit).gameObject); } } private void Update() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)outline)) { ((Behaviour)outline).enabled = false; outline.OutlineColor = new Color(0f, 0f, 0f, 0f); } } public void DisableOutlineComponents(GameObject obj) { Component[] components = obj.GetComponents(); foreach (Component val in components) { if ((Object)(object)val == (Object)null) { continue; } string text = ((object)val).GetType().Name.ToLower(); if (!((Object)(object)val == (Object)(object)this) && !(text == "disableunitoutlinebehaviour") && text.Contains("outline")) { Behaviour val2 = (Behaviour)(object)((val is Behaviour) ? val : null); if ((Object)(object)val2 != (Object)null) { val2.enabled = false; Debug.Log((object)("Disabled: " + text + " on " + ((Object)obj).name)); } else { Object.Destroy((Object)(object)val); Debug.Log((object)("Destroyed: " + text + " on " + ((Object)obj).name)); } } } } } public class UnitTargetSelfBehaviourBehaviour : MonoBehaviour { private Unit unit; private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); } private void Update() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)unit)) { Rigidbody mainRig = unit.data.mainRig; Vector3 position = ((Component)mainRig).transform.position; float magnitude = ((Vector3)(ref position)).magnitude; TargetData val = new TargetData { DistanceToTarget = magnitude, TargetInAttackRange = ((magnitude <= unit.m_AttackDistance) ? 1 : 0), TargetInPreferredRange = ((magnitude <= unit.m_PreferedDistance) ? 1 : 0) }; unit.api.SetAttackTarget(float3.op_Implicit(mainRig.position), mainRig, unit.data.targetData, val, false, false); } } } public class SmartUnitRigidbodySetBehaviour : MonoBehaviour { private Unit unit; private void Start() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); Rigidbody[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); foreach (Rigidbody obj in componentsInChildren) { obj.mass = ((Component)this).gameObject.transform.localScale.x; obj.drag = ((Component)this).gameObject.transform.localScale.y; obj.angularDrag = ((Component)this).gameObject.transform.localScale.z; } } } public class SmartUnitRigidbodyLimiterSetBehaviour : MonoBehaviour { private Unit unit; private float maxAngularVelocity = 1f; private float maxVelocity = 1f; private void Start() { //IL_002c: 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) unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); maxVelocity = ((Component)this).gameObject.transform.localScale.x; maxAngularVelocity = ((Component)this).gameObject.transform.localScale.y; } private void FixedUpdate() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Rigidbody[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); foreach (Rigidbody obj in componentsInChildren) { Vector3 val = obj.angularVelocity; obj.angularVelocity = ((Vector3)(ref val)).normalized * maxAngularVelocity; val = obj.velocity; obj.velocity = ((Vector3)(ref val)).normalized * maxVelocity; } } } public class SmartConditionalEventManagerSet : MonoBehaviour { private Unit unit; private void Start() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Invalid comparison between Unknown and I4 //IL_00b6: 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) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Invalid comparison between Unknown and I4 //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); Vector3 localScale = ((Component)this).transform.localScale; ConditionalEvent[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { ConditionalEventInstance[] events = componentsInChildren[i].events; for (int j = 0; j < events.Length; j++) { EventCondition[] conditions = events[j].conditions; foreach (EventCondition val in conditions) { ConditionType conditionType = val.conditionType; if ((int)conditionType != 0) { if ((int)conditionType == 1) { if ((int)val.valueType == 0 && localScale.y != 0f) { val.value = localScale.y; } else if ((int)val.valueType == 1 && localScale.z != 0f) { val.value = localScale.z; } val.cooldownRange = 10f; val.extraRandomCooldown = 0f; val.rangeType = (RangeType)0; } } else { if (localScale.x != 0f) { val.value = localScale.x; } val.cooldownRange = 10f; val.extraRandomCooldown = 0f; val.rangeType = (RangeType)0; } } } } } } public class SmartSummonRiderBehaviour : MonoBehaviour { private UnitSpawner unitSpawner; private bool spawned; public float counter; public float spawnInterval; public float spawnAmount; public float expirationTime; private Unit rootUnit; public UnitBlueprint unitBlueprint; private void Start() { //IL_005d: 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_0093: Unknown result type (might be due to invalid IL or missing references) try { rootUnit = ((Component)((Component)this).transform.root).GetComponentInChildren(); GameObject val = ((Component)rootUnit).GetComponentInChildren().riders[0]; if (Object.op_Implicit((Object)(object)val)) { unitBlueprint = val.GetComponentInChildren().unitBlueprint; Object.Destroy((Object)(object)val.gameObject); spawnAmount = ((Component)this).gameObject.transform.localScale.x; expirationTime = ((Component)this).gameObject.transform.localScale.y; spawnInterval = ((Component)this).gameObject.transform.localScale.z; } else { Debug.Log((object)"Rider not found"); } } catch (Exception ex) { Debug.LogError((object)ex); } } private void FixedUpdate() { if (spawnInterval > 0f) { counter += Time.deltaTime; } try { if (!Object.op_Implicit((Object)(object)rootUnit) || !Object.op_Implicit((Object)(object)rootUnit.data) || rootUnit.data.Dead || !Object.op_Implicit((Object)(object)rootUnit.data.targetData)) { return; } if (spawnInterval == 0f && !spawned) { spawned = true; Spawn(expirationTime); } else if (spawnInterval > 0f && counter >= spawnInterval) { counter = 0f; for (int i = 0; (float)i < spawnAmount; i++) { Spawn(expirationTime); } } } catch (Exception ex) { Debug.LogError((object)ex); } } public void Spawn(float expiration) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) try { unitBlueprint.Validate(); Unit val = default(Unit); unitBlueprint.Spawn(rootUnit.data.mainRig.position, ((Component)this).transform.rotation, rootUnit.data.team, ref val, 1f, false, true, 0, (UnitPoolInfo?)null); if (expiration > 0f) { ((Component)val).gameObject.AddComponent().seconds = expiration; ((Component)val).gameObject.AddComponent().targetUnit = rootUnit; } } catch (Exception ex) { Debug.LogError((object)ex); } } } public class DestroyIfUnitNullBehaviour : MonoBehaviour { public Unit targetUnit; private Unit unit; public void Update() { if (!Object.op_Implicit((Object)(object)targetUnit)) { Object.Destroy((Object)(object)((Component)this).gameObject); } } public void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); } private void Destroy() { if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.data) && Object.op_Implicit((Object)(object)unit.data.healthHandler) && unit.data.healthHandler.Die((Unit)null)) { Object.Destroy((Object)(object)((Component)unit).gameObject); } } } public class SmartUnitBalanceModifierBehaviour : MonoBehaviour { private Unit unit; private PropItem propItem; private PropItemData propItemData; private void Start() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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) unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); propItem = ((Component)this).gameObject.GetComponentInChildren(); propItemData = ((CharacterItem)propItem).PropData; ((Component)unit).GetComponentInChildren().forceMultiplier = ((Component)this).gameObject.transform.localScale.x; BalanceDataInstance[] balanceInstances = ((Component)unit).GetComponentInChildren().balanceData.balanceInstances; foreach (BalanceDataInstance obj in balanceInstances) { obj.force *= ((Component)this).gameObject.transform.localScale.y; } ((Component)unit).GetComponentInChildren().gravityData.gravity = ((Component)this).gameObject.transform.localScale.z; } private void SetDefaultIfZero() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (propItemData.m_positionOffset == Vector3.zero) { propItemData.m_positionOffset = Vector3.one; } if (((Component)this).gameObject.transform.localPosition == Vector3.zero) { ((Component)this).gameObject.transform.localPosition = Vector3.one; } } } public class SetPropRotationBehaviour : MonoBehaviour { public enum RotationType { Static, Perpetual } private Unit unit; private PropItem propItem; private PropItemData propItemData; private GameObject objectToSpin; private bool checkOnDeath; private float speed; public RotationType rotationType; public int id; private void Start() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); propItem = ((Component)this).GetComponentInChildren(); propItemData = ((CharacterItem)propItem).PropData; if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)propItem)) { SetDefaultIfZero(); id = Mathf.FloorToInt(((Component)this).transform.localScale.x); speed = ((Component)this).transform.localScale.y; checkOnDeath = ((Component)this).transform.localScale.z >= 1f; List list = new List(); PropItem[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); object[] array = componentsInChildren; object[] args = array; Loader.Log(string.Format("Here is prop items that are detected: {0}", args)); for (int i = 0; i < componentsInChildren.Length; i++) { GameObject gameObject = ((Component)componentsInChildren[i]).gameObject; SkinnedMeshRenderer componentInChildren = gameObject.GetComponentInChildren(); MeshRenderer componentInChildren2 = gameObject.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)gameObject) && !Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)componentInChildren2)) { list.Add(gameObject); } } GameObject[] array2 = list.ToArray(); if (array2 != null && id >= 0 && id < array2.Length) { objectToSpin = array2[id]; } Loader.Log($"Set Object to spin: {((Object)objectToSpin).name}"); } else { Loader.LogError("No unit or prop found"); } } private void Update() { //IL_001b: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)objectToSpin)) { if (rotationType == RotationType.Static) { Vector3 positionOffset = propItemData.m_positionOffset; if (!(objectToSpin.transform.localRotation == Quaternion.Euler(positionOffset))) { objectToSpin.transform.localRotation = Quaternion.Euler(positionOffset); } } else if (!checkOnDeath || (checkOnDeath && !unit.data.Dead)) { RotateObject(speed); } return; } List list = new List(); PropItem[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); object[] array = componentsInChildren; object[] args = array; Loader.Log(string.Format("Here is prop items that are detected: {0}", args)); for (int i = 0; i < componentsInChildren.Length; i++) { GameObject gameObject = ((Component)componentsInChildren[i]).gameObject; SkinnedMeshRenderer componentInChildren = gameObject.GetComponentInChildren(); MeshRenderer componentInChildren2 = gameObject.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)gameObject) && !Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)componentInChildren2)) { list.Add(gameObject); } } GameObject[] array2 = list.ToArray(); if (array2 != null && id >= 0 && id < array2.Length) { objectToSpin = array2[id]; } Loader.Log($"Set Object to spin: {((Object)objectToSpin).name}"); } private void RotateObject(float spinSpeed) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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) Vector3 positionOffset = propItemData.m_positionOffset; objectToSpin.transform.Rotate(positionOffset * spinSpeed * Time.deltaTime, (Space)1); } private void SetDefaultIfZero() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (propItemData.m_positionOffset == Vector3.zero) { propItemData.m_positionOffset = Vector3.one; } if (((Component)this).transform.localPosition == Vector3.zero) { ((Component)this).transform.localPosition = Vector3.one; } } } public class SmartHealingItemBehaviour : MonoBehaviour { public enum HealType { Brawl, Constant, Percentage } public float sinceDamaged; private float counter; private Unit unit; private PropItem propItem; private PropItemData propItemData; public float healAmount; public float healRate; public HealType healType; private void Start() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); propItem = ((Component)this).gameObject.GetComponentInChildren(); if ((Object)(object)propItem == (Object)null) { Debug.LogWarning((object)"[SmartHealingItem] No PropItem found on object."); return; } propItemData = ((CharacterItem)propItem).PropData; healAmount = ((Component)this).gameObject.transform.localScale.x; healRate = ((Component)this).gameObject.transform.localScale.y; float z = ((Component)this).gameObject.transform.localScale.z; if (z <= 0f) { healType = HealType.Brawl; } else if (z == 1f) { healType = HealType.Constant; } else { healType = HealType.Percentage; } } public void Update() { if ((Object)(object)unit == (Object)null || (Object)(object)unit.data == (Object)null || (Object)(object)unit.data.healthHandler == (Object)null || unit.data.Dead) { return; } if (healType == HealType.Brawl) { if (sinceDamaged >= 0f) { sinceDamaged -= Time.deltaTime; } float num = 0.5f; if (counter <= num) { counter += Time.deltaTime; } if (counter >= num) { counter = 0f; float amount = 0.13f * unit.data.maxHealth; Heal(amount); } return; } if (counter <= healRate) { counter += Time.deltaTime; } if (counter >= healRate) { counter = 0f; if (healType == HealType.Constant) { Heal(healAmount); } else if (healType == HealType.Percentage) { float amount2 = healAmount * unit.data.maxHealth; Heal(amount2); } } } private void Heal(float amount) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) ((Damagable)unit.data.healthHandler).TakeDamage(0f - amount, Vector3.zero, unit, (DamageType)3); } private void SetDefaultIfZero() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (propItemData.m_positionOffset == Vector3.zero) { propItemData.m_positionOffset = Vector3.one; } if (((Component)this).gameObject.transform.localPosition == Vector3.zero) { ((Component)this).gameObject.transform.localPosition = Vector3.one; } } } } namespace TIHarmonyPatches { [HarmonyPatch(typeof(HealthHandler), "TakeDamage")] internal class HealthHandlerTakeDamagePatch { private static readonly FieldInfo dataField; private static readonly FieldInfo invulnField; private static void Prefix(HealthHandler __instance, float damage) { if (float.IsNaN(damage) || float.IsInfinity(damage) || damage == 0f) { return; } FieldInfo fieldInfo = dataField; object? obj = ((fieldInfo != null) ? fieldInfo.GetValue(__instance) : null); DataHandler val = (DataHandler)((obj is DataHandler) ? obj : null); FieldInfo fieldInfo2 = invulnField; bool flag = (((fieldInfo2 != null) ? fieldInfo2.GetValue(__instance) : null) as bool?) ?? false; if ((Object)(object)val == (Object)null || val.Dead || flag) { return; } if (val.lifeTime >= 0.3f && (val.immunityForSeconds <= 0f || damage < 0f)) { SmartHealingItemBehaviour componentInChildren = ((Component)val.unit).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.sinceDamaged = 3f; } } if (val.lifeTime >= 0.3f && damage >= val.health) { SmartTransformToRiderBehaviour componentInChildren2 = ((Component)val.unit).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren2) && componentInChildren2.onDeathActivate) { val.immunityForSeconds = float.PositiveInfinity; val.health = float.PositiveInfinity; componentInChildren2.Spawn(); } } } static HealthHandlerTakeDamagePatch() { dataField = typeof(HealthHandler).GetField("data", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); invulnField = typeof(HealthHandler).GetField("isInvulnerable", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } } } namespace TIComponents { public class UnitDisableFriendlyFireBehaviour : MonoBehaviour { private Unit unit; private GameObject hiddenParent; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); SetHiddenParent(); RangeWeapon[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); foreach (RangeWeapon val in componentsInChildren) { val.ObjectToSpawn = MakeTempCopy(val.ObjectToSpawn); } SpawnObject[] componentsInChildren2 = ((Component)unit).GetComponentsInChildren(); foreach (SpawnObject val2 in componentsInChildren2) { val2.objectToSpawn = MakeTempCopy(val2.objectToSpawn); } CollisionWeapon[] componentsInChildren3 = ((Component)unit).GetComponentsInChildren(); foreach (CollisionWeapon obj in componentsInChildren3) { obj.ignoreTeamMates = true; obj.teamDamage = 0f; } } private GameObject MakeTempCopy(GameObject original) { if ((Object)(object)original == (Object)null) { return null; } GameObject obj = Object.Instantiate(original, hiddenParent.transform); ProjectileHit componentInChildren = obj.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.ignoreTeamMates = true; componentInChildren.alwaysHitTeamMates = false; } 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); } } public class SmartUnitDupeBehaviourBehaviour : MonoBehaviour { public GameObject abilityToRemove; private Unit rootUnit; private bool spawned; public float counter; public float spawnInterval; public float spawnAmount; public float expirationTime; public UnitBlueprint unitBlueprint; private void Start() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) rootUnit = ((Component)((Component)this).transform.root).GetComponentInChildren(); spawnAmount = ((Component)this).gameObject.transform.localScale.x; expirationTime = ((Component)this).gameObject.transform.localScale.y; spawnInterval = ((Component)this).gameObject.transform.localScale.z; SetBlueprint(); if ((Object)(object)abilityToRemove == (Object)null && Object.op_Implicit((Object)(object)unitBlueprint)) { Debug.LogError((object)"WARNING: FATAL ERROR, NO ABILITYTOREMOVE OR UNITBLUEPRINT"); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void FixedUpdate() { try { if (!Object.op_Implicit((Object)(object)unitBlueprint)) { SetBlueprint(); } if (!Object.op_Implicit((Object)(object)rootUnit) || !Object.op_Implicit((Object)(object)rootUnit.data) || rootUnit.data.Dead || !Object.op_Implicit((Object)(object)rootUnit.data.targetData)) { return; } if (spawnInterval == 0f && !spawned) { spawned = true; Spawn(expirationTime); } else { if (!(spawnInterval > 0f)) { return; } if (counter < spawnInterval) { counter += Time.deltaTime; return; } counter = 0f; for (int i = 0; (float)i < spawnAmount; i++) { Spawn(expirationTime); } } } catch (Exception ex) { Debug.LogError((object)ex); } } public void Spawn(float expiration) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) try { Unit val = default(Unit); unitBlueprint.Spawn(rootUnit.data.mainRig.position, rootUnit.data.mainRig.rotation, rootUnit.data.team, ref val, 1f, false, true, 0, (UnitPoolInfo?)null); if (expiration > 0f) { ((Component)val).gameObject.AddComponent().seconds = expiration; ((Component)val).gameObject.AddComponent().targetUnit = rootUnit; } Rigidbody[] allRigs = rootUnit.data.allRigs.AllRigs; Rigidbody[] allRigs2 = val.data.allRigs.AllRigs; ((Component)this).gameObject.transform.localScale = ((Component)rootUnit).transform.localScale; for (int i = 0; i < allRigs2.Length; i++) { ((Component)allRigs2[i]).transform.position = ((Component)allRigs[i]).transform.position; ((Component)allRigs2[i]).transform.rotation = ((Component)allRigs[i]).transform.rotation; allRigs2[i].velocity = allRigs[i].velocity; } PlacementSpawnEffects componentInChildren = ((Component)val).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { Object.Destroy((Object)(object)((Component)componentInChildren).gameObject); } } catch (Exception ex) { Debug.LogError((object)ex); } } public static GameObject[] RemoveGameObjectsWithParameter(GameObject[] objects, string parameterName) { List list = new List(); foreach (GameObject val in objects) { bool flag = false; Component[] components = val.GetComponents(); foreach (Component val2 in components) { if (!((Object)(object)val2 == (Object)null)) { Type type = ((object)val2).GetType(); bool flag2 = type.GetField(parameterName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) != null; bool flag3 = type.GetProperty(parameterName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) != null; if (flag2 || flag3) { flag = true; break; } } } if (!flag) { list.Add(val); } } return list.ToArray(); } public void SetBlueprint() { if (!Object.op_Implicit((Object)(object)unitBlueprint)) { UnitBlueprint val = Object.Instantiate(rootUnit.unitBlueprint); if (Object.op_Implicit((Object)(object)rootUnit.unitBlueprint.UnitBase)) { s.DeepCopyOf(val, rootUnit.unitBlueprint); val.UnitBase = rootUnit.unitBlueprint.UnitBase; val.excludeFromWinCondition = true; val.objectsToSpawnAsChildren = RemoveGameObjectsWithParameter(val.objectsToSpawnAsChildren, ((Object)abilityToRemove).name); unitBlueprint = val; } } } } public class SmartMeleeKnockbackBehaviour : MonoBehaviour { private Unit unit; public void Start() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); CollisionWeapon[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren(); foreach (CollisionWeapon obj in componentsInChildren) { obj.onImpactForce = ((Component)this).gameObject.transform.localScale.x; obj.impactMultiplier *= ((Component)this).gameObject.transform.localScale.y; obj.enemyMassPow = ((Component)this).gameObject.transform.localScale.z; } } } public class SmartSoundsManagerBehaviour : MonoBehaviour { [Serializable] public class CategoryData { public string category; public List effects; } public enum SoundType { Vocal, Weapons, SFX } private Unit unit; public bool right; private PropItem propItem; private PropItemData propItemData; public List datasoundsLib = new List { new CategoryData { category = "Tribal", effects = new List { "Battle", "Placement" } }, new CategoryData { category = "Farmer", effects = new List { "Battle", "Placement" } }, new CategoryData { category = "Ancient", effects = new List { "Battle", "Placement" } }, new CategoryData { category = "Medieval", effects = new List { "Battle", "Placement" } }, new CategoryData { category = "Viking", effects = new List { "Battle", "Placement" } }, new CategoryData { category = "Simulation Scene", effects = new List { "Placement", "Battle" } }, new CategoryData { category = "Misc", effects = new List { "Menumusic" } }, new CategoryData { category = "Dynasty", effects = new List { "Placement", "Battle" } }, new CategoryData { category = "Renaissance", effects = new List { "Placement", "Battle" } }, new CategoryData { category = "Halloween", effects = new List { "Placement", "Battle" } }, new CategoryData { category = "Pirate", effects = new List { "Battle", "Placement" } }, new CategoryData { category = "Western", effects = new List { "Placement", "Battle" } }, new CategoryData { category = "Legacy", effects = new List { "Battle", "Placement" } }, new CategoryData { category = "FantasyGood", effects = new List { "Placement", "Battle" } }, new CategoryData { category = "FantasyEvil", effects = new List { "Placement", "Battle" } }, new CategoryData { category = "UnitCreator", effects = new List { "Jazz" } }, new CategoryData { category = "Christmas", effects = new List { "Placement", "Battle" } }, new CategoryData { category = "Credits", effects = new List { "CreditsSong" } }, new CategoryData { category = "Effects", effects = new List { "Aggro", "Ballooon", "BoneSpell", "BonerSpell 1", "Explosion", "ExplosionGrenade", "ExplosionIceGiant", "Expotion", "FireWork", "GroundSlam", "IceArrowEffect", "Log", "Poof", "PotionEffect", "PriestHeal", "RockSpell", "Slice", "SpawnSwordArrow", "Speed", "Telekanesis", "Balloon_Deflate", "FanBlow", "Reap", "Shout", "BatTransform", "Fear", "FireArrowEffect", "Candlehead", "ReaperDeath", "HammerUp", "HammerExplosion", "MagicMissileSmite", "Storm", "CupidKiss", "CupidLove", "MinerExpl", "CactusPoof", "BlockShield", "AngelExplosion", "ThorThunder", "TankExplosion", "WizardShoot", "Pharaoh", "WizardExplosion", "DarkPeasantSelfExplode", "DarkPeasantThrowDownExplosion", "DarkPeasantTentacleExplode", "DarkPeasantHandThrowWhoosh", "DarkPeasantHandThrowImpact", "FireStorm", "IceStorm", "JarlBerserk", "IceArena", "DragonKick", "Gas", "VladImpale", "DarkPeasantImpale", "CannonBarrage", "ShogunSlash", "ArtemisArrows", "WitchCopy", "GhostScreamLift", "NecromancerTurnDOT", "IceMageColdSnap", "BalloonerMeteor", "IceBreath", "GhostExplode", "TombStonePush", "TombStoneImpact", "EarthStorm", "WaterStorm", "WindStorm", "ColdSnap", "PresentOpen", "IceBreathOneShot", "NeonProjectileBlock", "NeonSlice", "LaserVoidTrap", "VoidMonarchTransformation", "VoidMonarchBigExplosion", "VoidMonarchSmallExplosion", "ChronomancerTransformation", "TimeTransformWhoosh", "TimeTransformWhoosh2", "FireLoop", "FireLoopBackground", "SeedPainterBackground", "SeedPainterPaintLoop", "MeteorHazardImpact", "MeteorToolBackground", "SunManipulatorLoop", "MaterialPainterPaintLoop", "RainHazardBackground", "RainHazardFire", "EarthquakeToolFire", "EarthquakeToolBackground", "LightningToolBackground", "LightningToolFire", "LightningToolChargeLoop", "LandscapeShaperAddLoop", "LandscapeShaperRemoveLoop", "LandscapeShaperBlurLoop", "VulcanoToolFire", "VulcanoToolBackground", "EraserToolDestroyObject" } }, new CategoryData { category = "Moves", effects = new List { "BalloonPack", "Block", "BlockAlways", "BlockSlow", "Charge", "CrowWings", "Dodge", "Fairywings", "FireBreath", "Halfling_Jump", "Hay", "Headbutt", "Jump_Charge", "MonkeyTail", "NinjaDodge", "Shield_Charge", "WallShield_Slam", "Wings", "Gunslinger Spin" } }, new CategoryData { category = "Footsteps", effects = new List { "Small", "Medium", "Big", "Mammoth", "Minotaur", "Bear", "IceGiant", "Snake", "Horse", "Raptor", "Bat", "Skeleton" } }, new CategoryData { category = "Misc", effects = new List { "CameraCollision" } }, new CategoryData { category = "UI", effects = new List { "Click", "Unit Placed", "Unit Removed", "Hover", "Wrong", "Unit Unlocked", "Whoosh", "Wrong2", "Win", "Landfall", "Tabs", "Swosh", "EquipClothing", "EquipWeapon", "SmallClick", "DequipItem", "SmallClickMinus" } }, new CategoryData { category = "Projectiles", effects = new List { "Boulder", "CatapultRock", "Chest", "Apple", "Axe", "Ballista", "BalloonBow", "Bomb", "Bombl", "Bow", "Cannon", "Crow", "Dark", "Firework", "Flintlock", "Grapple", "Holy", "Hwacha", "Ice", "Knife", "Lightning", "Magnet", "Master", "MasterShuriken", "Minigun", "Musket", "Owl", "PoachBow", "Potion", "Shuriken", "Skull", "Snake", "Spear", "Sword", "ThunderBolt", "Z", "Blunderbus", "BouncyBalls", "Gravle", "Webs", "Ullr", "Fire Arrow", "Candlehead", "Pumpkin", "MagicMissile", "Glaive", "CupidBow", "RevolverBullet", "Orb", "TimeNinja", "Present" } }, new CategoryData { category = "Ancient Attack Vocals", effects = new List { "Archer_Snake", "Ballista", "Hoplite", "Minotaur", "Shield", "SpearUnit", "Zeus" } }, new CategoryData { category = "Ancient Death Vocals", effects = new List { "Archer_Snake", "Ballista", "Hoplite", "Minotaur", "Shield", "SpearUnit", "Zeus" } }, new CategoryData { category = "Asia Attack Vocals", effects = new List { "Archer_Firework", "CatapultHwacha", "Dragon", "Monk", "Monkey King", "Samurai", "Thrower_Shuriken" } }, new CategoryData { category = "Asia Death Vocals", effects = new List { "Archer_Firework", "CatapultHwacha", "Dragon", "Monk", "Monkey King", "Samurai", "Thrower_Shuriken" } }, new CategoryData { category = "Farmer Attack Vocals", effects = new List { "Halfling", "Hay", "Pitchfork", "Potionseller", "Scarecrow", "Scythe", "Wheelbarrow A", "Wheelbarrow B", "Wheelbarrow C" } }, new CategoryData { category = "Farmer Death Vocals", effects = new List { "Halfling", "Hay", "Pitchfork", "Potionseller", "Scarecrow", "Scythe", "Wheelbarrow A", "Wheelbarrow B", "Wheelbarrow C" } }, new CategoryData { category = "Medieval Attack Vocals", effects = new List { "Archer", "Banjo", "Catapult", "Knight", "Priest", "Swordsman", "TheKing" } }, new CategoryData { category = "Medieval Death Vocals", effects = new List { "Archer", "Banjo", "Catapult", "Knight", "Priest", "Swordsman", "TheKing" } }, new CategoryData { category = "Pirate Attack Vocals", effects = new List { "Cannon", "Captain", "Flintlock", "Harpooner", "Thrower_Bomb", "Clams", "Blunderbus", "PirateQueen" } }, new CategoryData { category = "Pirate Death Vocals", effects = new List { "Cannon", "Captain", "Flintlock", "Harpooneer", "Thrower_Bomb", "Clams", "Blunderbus", "PirateQueen" } }, new CategoryData { category = "Reinassance Attack Vocals", effects = new List { "Fencer", "Halberd", "Musket", "Painter", "StickyHands", "Balloon Archer", "Da Vinci", "Jouster" } }, new CategoryData { category = "Reinassance Death Vocals", effects = new List { "Fencer", "Halberd", "Musket", "Painter", "StickyHands", "Balloon Archer", "Da Vinci", "Jouster" } }, new CategoryData { category = "Tribal Attack Vocals", effects = new List { "Club", "BoneMage", "DoubleAxe", "Mammoth", "Shield_Wood", "Thrower_Boulder", "Thrower_Spear" } }, new CategoryData { category = "Tribal Death Vocals", effects = new List { "Club", "BoneMage", "DoubleAxe", "Mammoth", "Shield_Wood", "Thrower_Boulder", "Thrower_Spear" } }, new CategoryData { category = "Viking Attack Vocals", effects = new List { "Archer_Ice", "Berserker", "Brawler", "Headbutter", "Jarl", "Valkyrie", "VikingBoat", "Shouter" } }, new CategoryData { category = "Viking Death Vocals", effects = new List { "Archer_Ice", "Berserker", "Brawler", "Headbutter", "Jarl", "Valkyrie", "VikingBoat", "Shouter" } }, new CategoryData { category = "Misc Attack Vocals", effects = new List { "Assassin", "BallistaDude", "Bear", "Binkdouble", "Blinkdagger", "Catapult_Bounce", "Catapult_Gravel", "Catapult_Magnet", "Celestial", "Centaur", "Crow", "Dedede", "Doden", "DoubleSword", "DragonCarrier", "Executioner", "Fairy", "Gatling", "Hunter", "IceGiant", "Mace", "MasterNinja", "Peasant", "Pitchfork_WheelBarrow", "Poacher", "SamuraiMaster", "Shield_Fan", "Shield_Mirror", "Shield_Wall", "Snake", "SpiderMage", "Stick", "TestUnit", "TheUntouchable", "Thor", "Thrower_Axe", "Thrower_Bird", "Thrower_Knife", "Thrower_WheelbarrowSpear", "Traveller", "VikingBoatCarrier", "VikingBoatRider", "VikingTank", "Witch Doctor", "Zombie", "Zorro", "Artemis", "Tree Giant", "Samurai Giant", "Cheerleader", "Fan Bearer", "Sword Teacher", "Jester", "Ullr", "Vlad", "Taekwondo", "Horse", "Raptor", "RaptorRider", "Cupid", "Cavalry", "Redjade", "Necromancer", "Witch", "Ghost", "Ice Mage", "PresentThrower" } }, new CategoryData { category = "Misc Death Vocals", effects = new List { "Ancient Tank", "Archer_Balloon", "Archer_Bomb", "Archer_Dark", "Archer_Lightning", "Archer_Master", "Archer_Super", "Assassin", "BallistaDude", "Bear", "Binkdouble", "Blinkdagger", "Catapult_Bounce", "Catapult_Gravel", "Catapult_Magnet", "Celestial", "Centaur", "Crow", "Dedede", "Doden", "DoubleSword", "DragonCarrier", "Executioner", "Fairy", "Gatling", "Hunter", "IceGiant", "Mace", "MasterNinja", "Peasant", "Pitchfork_WheelBarrow", "Poacher", "SamuraiMaster", "Shield_Fan", "Shield_Mirror", "Shield_Wall", "Snake", "SpiderMage", "Stick", "TestUnit", "TheUntouchable", "Thor", "Thrower_Axe", "Thrower_Bird", "Thrower_Knife", "Thrower_WheelbarrowSpear", "Traveller", "VikingBoatCarrier", "VikingBoatRider", "VikingTank", "Witch Doctor", "Zombie", "Zorro", "Artemis", "Tree Giant", "Samurai Giant", "Cheerleader", "Fan Bearer", "Sword Teacher", "Jester", "Taekwondo", "Ullr", "Vlad", "Horse", "Raptor", "RaptorRider", "Cupid", "Cavalry", "Redjade", "Necromancer", "Witch", "Ghost", "Ice Mage", "PresentThrower" } }, new CategoryData { category = "Ancient Attacks", effects = new List { "BallistaArrow", "Bow_Snake", "CentaurSword", "HopliteShield", "MinoTaurGrab", "Shield", "ShortBow", "Spear", "SpearHoplite", "Throw_Thunderbolt" } }, new CategoryData { category = "Ancient Hits", effects = new List { "CentaurSword", "HopliteShield", "MinoTaurGrab", "Shield", "Spear", "SpearHoplite" } }, new CategoryData { category = "Asia Attacks", effects = new List { "BowFirework", "CatapultHwacha", "Katana", "Master_Throw_Shuriken", "MonkeyKingStaff", "MonkStaff", "SwordMaster", "Throw_Shuriken" } }, new CategoryData { category = "Asia Hits", effects = new List { "Katana", "MonkeyKingStaff", "MonkStaff", "SwordMaster" } }, new CategoryData { category = "Aztek Attacks", effects = new List { "SwordAztek001", "SwordAztek002" } }, new CategoryData { category = "Aztek Hits", effects = new List { "SwordAztek001", "SwordAztek002" } }, new CategoryData { category = "Farmer Attacks", effects = new List { "Banjo", "HalflingGrab", "Pitchfork", "Throw_Potion", "Thrower_Crow", "Thrower_WheelBarrowSkewer", "Scythe" } }, new CategoryData { category = "Farmer Hits", effects = new List { "Banjo", "HalflingGrab", "Pitchfork", "Throw_Potion", "Thrower_Crow", "Thrower_WheelBarrowSkewer", "Scythe" } }, new CategoryData { category = "Medieval Attacks", effects = new List { "Bow", "CatapultRock", "Dagger", "Executioner_Axe", "Flag", "KingSword", "KnightShield", "Mace", "MinotaurAxe1", "MinotaurAxe2", "PriestStaff", "Sword", "Throw_Knife" } }, new CategoryData { category = "Medieval Hits", effects = new List { "Dagger", "Executioner_Axe", "Flag", "KingSword", "KnightShield", "Mace", "MinotaurAxe1", "MinotaurAxe2", "PriestStaff", "Sword" } }, new CategoryData { category = "Misc Attacks", effects = new List { "BlinkDagger", "Bow_Explosive", "Bow_Holy", "Bow_Lightning", "Bow_master", "Bow_Poach", "Bow_Spam", "CatapultBounce", "CatapultGravle", "CatapultMagnet", "FairySword", "GatlingGun", "Minigun", "MongolianDagger", "NetSpell", "Scythe", "Shield_Mirror", "Shield_Wall", "Throw_Bird", "Throw_Bird 1", "Artemis", "Cheerleader", "Tree Giant", "Ullr", "Jester", "Taekwondo", "Vlad", "Chu Ko Nu", "Red Jade", "Cupid Bow", "Witch", "Necromancer", "Ice Mage" } }, new CategoryData { category = "Misc Hits", effects = new List { "BlinkDagger", "FairySword", "GatlingGun", "MongolianDagger", "Scythe", "Shield_Mirror", "Shield_Wall", "Tree Giant", "Vlad", "Jester", "Taekwondo", "Red Jade", "Raptor", "Witch", "Necromancer", "Ice Mage" } }, new CategoryData { category = "Pirate Attacks", effects = new List { "Blunderbus", "CannonBall", "Flintlock", "FlintlockCaptain", "Harpoon", "Sabre", "Throw_Bomb", "Thrower_Chest" } }, new CategoryData { category = "Pirate Hits", effects = new List { "Harpoon", "Sabre" } }, new CategoryData { category = "Renaissance Attacks", effects = new List { "Bow_Balloon", "Halberd", "Musket", "PaintBrush", "Palette", "Pike", "Rapier", "Shield_Fan", "StickyHands" } }, new CategoryData { category = "Renaissance Hits", effects = new List { "Halberd", "PaintBrush", "Palette", "Pike", "Rapier", "Shield_Fan", "StickyHands" } }, new CategoryData { category = "Tribal Attacks", effects = new List { "BoneStaffMelee", "BoneStaffRange", "Club", "ShieldWood", "Stick", "StoneAge_Axe", "Throw_Skull", "Thrower_Boulder", "Thrower_Spear" } }, new CategoryData { category = "Tribal Hits", effects = new List { "BoneStaffMelee", "Club", "ShieldWood", "Stick", "StoneAge_Axe", "Mammoth" } }, new CategoryData { category = "Viking Attacks", effects = new List { "BrawlerAxe", "BrawlerShield", "Dededeclub", "GiantPunch", "Hammer_viking", "IceBow", "Jarl_Axe", "Oar", "ThorsHammer", "Throw_Axe", "ValkyrieSword", "Viking_axe", "Headbutter", "LongboatThrow" } }, new CategoryData { category = "Viking Hits", effects = new List { "BrawlerAxe", "BrawlerShield", "Dededeclub", "GiantPunch", "Hammer_viking", "Jarl_Axe", "Oar", "ThorsHammer", "Throw_Axe", "ValkyrieSword", "Viking_Axe", "Headbutter", "LongBoatImpact" } }, new CategoryData { category = "Misc Effects", effects = new List { "RopeStretch", "TankReload" } }, new CategoryData { category = "Halloween Attack Vocals", effects = new List { "Candlehead", "Catapult", "Reaper", "SkeletonArcher", "SkeletonWarrior", "Swordcaster", "VampireBiter", "SkeletonGiant" } }, new CategoryData { category = "Halloween Death Vocals", effects = new List { "Candlehead", "Catapult", "Reaper", "SkeletonArcher", "SkeletonWarrior", "Swordcaster", "VampireBiter", "SkeletonGiant" } }, new CategoryData { category = "Halloween Attacks", effects = new List { "Candlehead", "Catapult", "ReaperScythe", "SkeletonArcher", "SkeletonWarrior", "Swordcaster", "VampireBiter", "ReaperTentacle" } }, new CategoryData { category = "Halloween Hits", effects = new List { "Candlehead", "Catapult", "ReaperScythe", "SkeletonArcher", "SkeletonWarrior", "Swordcaster", "VampireBiter", "ReaperTentacle" } }, new CategoryData { category = "Fantasy Light Attack Vocals", effects = new List { "Elephant", "Gauntlet", "Good Cleric", "OrbCaster", "Smite Priest", "Thrown Glaive", "TimeNinja", "TimeNinjaTransformed" } }, new CategoryData { category = "Fantasy Light Death Vocals", effects = new List { "Elephant", "Gauntlet", "Good Cleric", "OrbCaster", "Smite Priest", "Thrown Glaive", "TimeNinja", "TimeNinjaTransformed" } }, new CategoryData { category = "Fantasy Dark Attack Vocals", effects = new List { "DarkKingHuman", "DarkKingTransformed", "Evil Cleric", "EvilTank", "FantasyAssassin", "FireBat", "StormPriest", "WarGlaive" } }, new CategoryData { category = "Fantasy Dark Death Vocals", effects = new List { "DarkKingHuman", "DarkKingTransformed", "Evil Cleric", "EvilTank", "FantasyAssassin", "FireBat", "StormPriest", "WarGlaive" } }, new CategoryData { category = "Fantasy Light Attacks", effects = new List { "SmiteMissile", "Gauntlet", "Glaive", "OrbCaster", "TimeNinja", "Elephant", "MagicMissile" } }, new CategoryData { category = "Fantasy Light Hits", effects = new List { "Gauntlet", "SmiteMissile", "Glaive", "Elephant", "MagicMissile", "TimeNinja", "OrbCaster" } }, new CategoryData { category = "Fantasy Dark Attacks", effects = new List { "DarkKingHuman", "DarkKingMonster", "Evil Cleric", "EvilTank", "FantasyAssassin", "FireBat", "StormPriest", "WarGlaive" } }, new CategoryData { category = "Fantasy Dark Hits", effects = new List { "DarkKingHuman", "DarkKingMonster", "Evil Cleric", "EvilTank", "FantasyAssassin", "FireBat", "StormPriest", "WarGlaive" } }, new CategoryData { category = "Bugs", effects = new List { "BalloonInflate", "BalloonImpact", "HandGrab", "HandLetGo", "HandHover", "SwitchDevTool", "SwitchProjectile", "BlackHoleSuckIn" } }, new CategoryData { category = "Western Attack Vocals", effects = new List { "Cactus", "Deadeye", "LassoHorse", "Pickaxe", "Quickdraw", "Dynamite", "Gunslinger", "BallAndChain", "SafeThrower", "GatlingGun" } }, new CategoryData { category = "Western Death Vocals", effects = new List { "Cactus", "Deadeye", "LassoHorse", "Pickaxe", "Quickdraw", "Dynamite", "Gunslinger", "BallAndChain", "SafeThrower", "GatlingGun" } }, new CategoryData { category = "Western Attacks", effects = new List { "Cactus", "Deadeye", "LassoHorse", "Pickaxe", "Quickdraw", "Dynamite", "Gunslinger", "BallAndChain", "SafeThrower", "GatlingGun" } }, new CategoryData { category = "Western Hits", effects = new List { "Cactus", "Deadeye", "LassoHorse", "Pickaxe", "Quickdraw", "Dynamite", "Gunslinger", "BallAndChain", "SafeThrower", "GatlingGun" } }, new CategoryData { category = "Legacy Attack Vocals", effects = new List { "Blowdart", "Boxer", "Chariot", "Barrelroller", "DarkPeasant", "FlagBearer", "FlagBearerStay", "Pharaoh", "Pike", "SuperBoxer", "SuperPeasant", "Wizard", "Peasant", "Poacher", "Thor", "Chicken", "Tank" } }, new CategoryData { category = "Legacy Death Vocals", effects = new List { "Blowdart", "Boxer", "Chariot", "Barrelroller", "DarkPeasant", "FlagBearer", "FlagBearerStay", "Pharaoh", "Pike", "SuperBoxer", "SuperPeasant", "Wizard", "Peasant", "Poacher", "Thor", "Tank" } }, new CategoryData { category = "Legacy Attacks", effects = new List { "Blowdart", "Boxer", "Chariot", "ChickenMan", "Barrelroller", "FlagBearer", "FlagBearerStay", "Pharaoh", "Pike", "SuperBoxer", "SuperPeasant", "Wizard", "Peasant", "Poacher", "Thor", "Tank", "DarkPeasant", "DarkPeasantTentacleShoot" } }, new CategoryData { category = "Legacy Hits", effects = new List { "Blowdart", "Boxer", "Chariot", "ChickenMan", "Barrelroller", "DarkPeasant", "FlagBearer", "FlagBearerStay", "Pharaoh", "Pike", "SuperBoxer", "SuperPeasant", "Wizard", "Peasant", "Poacher", "Thor", "Tank" } }, new CategoryData { category = "TABG Attacks", effects = new List { "AA-12", "AK-47", "AKS-74U", "Arnold", "AUG", "AWP", "Ballistic Shield", "Bar", "Barrett", "Beretta 93R", "Crossbow", "CrowBar", "Desert Eagle", "DoubleBarrel", "Famas", "Garand", "Glock18", "HandCannon", "Inflatable_Hammer", "Kar98K", "Luger", "M2 Browning", "M14", "M16", "M1911", "MAC-10", "Mg-42", "MGL", "Minigun", "Mossberg", "Mp-40", "Mp5k", "P90", "Ppsh", "PulseRifle", "Revolver", "RiotShield", "Rocket Launcher", "Scar", "ShallowPot", "Tec-9", "Thompson", "Vector", "Vss" } }, new CategoryData { category = "TABG Hits", effects = new List { "Big", "Medium", "Small", "Huge", "Crowbar", "ShallowPot", "Rocket" } }, new CategoryData { category = "UC Attacks", effects = new List { "Blowdart", "Boxer", "Chariot", "ChickenMan", "Barrelroller", "FlagBearer", "FlagBearerStay", "Pharaoh", "Pike", "SuperBoxer", "SuperPeasant", "Wizard", "Peasant", "Poacher", "Thor", "Tank", "DarkPeasant", "DarkPeasantTentacleShoot" } }, new CategoryData { category = "UC Hits", effects = new List { "Blowdart", "Boxer", "Chariot", "ChickenMan", "Barrelroller", "DarkPeasant", "FlagBearer", "FlagBearerStay", "Pharaoh", "Pike", "SuperBoxer", "SuperPeasant", "Wizard", "Peasant", "Poacher", "Thor", "Tank" } }, new CategoryData { category = "Neon Attacks", effects = new List { "ArmCannon", "BigSword", "Claws", "Sword", "FocusBeam", "GiantLaser", "Minigun", "PlasmaRifle", "PulsePistol", "PulseRifle", "Stasis", "PulseSMG", "TeslaCannon", "DoubleSword" } }, new CategoryData { category = "Neon Hits", effects = new List { "ArmCannon", "BigSword", "Claws", "Sword", "FocusBeam", "GiantLaser", "Minigun", "PlasmaRifle", "PulsePistol", "PulseRifle", "Stasis", "PulseSMG", "TeslaCannon", "BigSword", "DoubleSword" } }, new CategoryData { category = "Secret Attack Vocals", effects = new List { "Ballooner", "Bomb on a Stick", "Fan Bearer", "Raptor", "The Teacher", "Jester", "Ball and Chain", "Chu ko nu", "Executioner", "Shouter", "Taekwondo", "Raptor Rider", "Cheerleader", "Cupid", "Mace Spinner", "Clam Thrower", "Present Elf", "Ice Mage", "Bank Robbers", "Witch", "Banshee", "Necromancer", "Wheelbarrow Dragon", "Bomb Cannon", "Cavalry", "Vlad", "Blackbeard", "Samurai Giant", "Ullr", "Red Jade", "Sensei", "Shogun", "Tree Giant", "Artemis", "Ice Giant", "Blackbeard", "Snake", "Horse", "Crow", "Clam" } }, new CategoryData { category = "Secret Death Vocals", effects = new List { "Ballooner", "Bomb on a Stick", "Fan Bearer", "Raptor", "The Teacher", "Jester", "Ball and Chain", "Chu ko nu", "Executioner", "Shouter", "Taekwondo", "Raptor Rider", "Cheerleader", "Cupid", "Mace Spinner", "Clam Thrower", "Present Elf", "Ice Mage", "Bank Robbers", "Witch", "Banshee", "Necromancer", "Wheelbarrow Dragon", "Bomb Cannon", "Cavalry", "Vlad", "Blackbeard", "Samurai Giant", "Ullr", "Red Jade", "Sensei", "Shogun", "Tree Giant", "Artemis", "Ice Giant", "Blackbeard", "Snake", "Horse", "Crow", "Clam" } } }; public SoundType soundType; private void Start() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) try { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); return; } propItem = ((Component)this).gameObject.GetComponentInChildren(); if ((Object)(object)propItem == (Object)null) { Debug.LogError((object)"PropItem not found in hierarchy."); return; } propItemData = ((CharacterItem)propItem).PropData; SetDefaultIfZero(); float x = ((Component)this).transform.localScale.x; float y = ((Component)this).transform.localScale.y; int num = Mathf.RoundToInt(((Component)this).transform.localScale.z); int effectIndex = Mathf.RoundToInt(propItemData.m_positionOffset.x); string category = GetCategory(num); string text = BuildEffectString(num, effectIndex, x, y); if (string.IsNullOrEmpty(category) || string.IsNullOrEmpty(text)) { Debug.LogError((object)"Invalid category or effect data."); return; } switch (soundType) { case SoundType.Vocal: AssignVocalSounds(unit, category, text, x, y); break; case SoundType.SFX: { PlaySoundEffect[] componentsInChildren2 = ((Component)unit).GetComponentsInChildren(); foreach (PlaySoundEffect soundEffect in componentsInChildren2) { AssignSoundEffect(soundEffect, category, text); } break; } case SoundType.Weapons: { CollisionSound[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); foreach (CollisionSound collisionSound in componentsInChildren) { AssignSoundEffect(collisionSound, category, text); } break; } } } catch (Exception arg) { Debug.LogError((object)$"SmartSoundsManagerBehaviour Error: {arg}"); } } private void SetDefaultIfZero() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (propItemData != null && propItemData.m_positionOffset == Vector3.zero) { propItemData.m_positionOffset = Vector3.one; } if (((Component)this).transform.localPosition == Vector3.zero) { ((Component)this).transform.localPosition = Vector3.one; } } private string GetCategory(int index) { if (index < 0 || index >= datasoundsLib.Count) { return null; } return datasoundsLib[index].category; } private string GetEffect(int categoryIndex, int effectIndex) { if (categoryIndex >= 0 && categoryIndex < datasoundsLib.Count) { List effects = datasoundsLib[categoryIndex].effects; if (effectIndex >= 0 && effectIndex < effects.Count) { return effects[effectIndex]; } } return null; } private string BuildEffectString(int categoryIndex, int effectIndex, float pitch, float volume) { string effect = GetEffect(categoryIndex, effectIndex); if (string.IsNullOrEmpty(effect)) { return null; } return $"{effect}(p={pitch})(v={volume})"; } private void AssignVocalSounds(Unit unit, string category, string effect, float pitch, float volume) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown UnitSounds componentInChildren = ((Component)unit).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.DeathPathData = (componentInChildren.VocalPathData = new AudioPathData(category, effect, pitch, volume)); componentInChildren.Pitch = pitch; } } private void AssignSoundEffect(PlaySoundEffect soundEffect, string category, string effect) { if ((Object)(object)soundEffect != (Object)null) { soundEffect.SoundRef = category + "/" + effect; soundEffect.Validate(); } } private void AssignSoundEffect(CollisionSound collisionSound, string category, string effect) { if ((Object)(object)collisionSound != (Object)null) { collisionSound.SoundEffectRef = category + "/" + effect; collisionSound.Validate(); } } } public class SmartMoreMountBehaviour : MonoBehaviour { private Rigidbody platformRig; private ConfigurableJoint seatJoint; private Unit riderUnit; private Unit rootUnit; private UnitBlueprint riderToSpawn; public void Start() { rootUnit = ((Component)((Component)this).transform.root).GetComponentInChildren(); GameObject val = ((Component)((Component)this).transform.root).GetComponentInChildren().riders[0]; riderToSpawn = val.GetComponentInChildren().unitBlueprint; platformRig = ((Component)this).gameObject.AddComponent(); platformRig.mass = 15f; platformRig.drag = 2f; platformRig.angularDrag = 2f; platformRig.useGravity = false; platformRig.isKinematic = true; riderUnit = EnterMount(riderToSpawn, rootUnit); } private void Update() { if (Object.op_Implicit((Object)(object)rootUnit.data) && rootUnit.data.Dead) { Fall(); } } private void Fall() { if (Object.op_Implicit((Object)(object)seatJoint)) { Object.Destroy((Object)(object)seatJoint); } if (Object.op_Implicit((Object)(object)platformRig)) { Object.Destroy((Object)(object)((Component)platformRig).gameObject); } riderUnit.api.SetIsRider(false, true); Object.Destroy((Object)(object)((Component)this).gameObject); } public Unit EnterMount(UnitBlueprint riderBlueprint, Unit rootUnit) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) Unit val = default(Unit); riderBlueprint.Spawn(((Component)this).transform.position, ((Component)this).transform.rotation, rootUnit.Team, ref val, 1f, false, true, 0, (UnitPoolInfo?)null); if (Object.op_Implicit((Object)(object)val)) { seatJoint = JointActions.AttachJoint(val.data.hip, platformRig, 0f, 0f, true, true, 0f); SpawnFreezeBody[] componentsInChildren = ((Component)this).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren[i]); } Rigidbody[] allRigs = val.data.allRigs.AllRigs; for (int j = 0; j < allRigs.Length; j++) { allRigs[j].isKinematic = false; } if ((Object)(object)val != (Object)null && (Object)(object)val.data != (Object)null && rootUnit.IsRemotelyControlled) { val.UnfreezeBody(); } ((Component)val).gameObject.AddComponent().targetUnit = rootUnit; } return val; } } public class SmartConnectedTransformBehaviour : MonoBehaviour { private float counter; private Unit rootUnit; private UnitBlueprint riderToSpawn; public float range; public float delay; public float damageRequired; private bool hasTriggered; public GameObject particle; private Material curMat; public static HashSet AllInstances; private Team team; public bool transferHP; public int spawnAmount = 1; public void Start() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) rootUnit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)rootUnit != (Object)null) { team = rootUnit.Team; } RiderHolder componentInChildren = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.riders != null && componentInChildren.riders.Count > 0 && (Object)(object)componentInChildren.riders[0] != (Object)null) { Unit componentInChildren2 = componentInChildren.riders[0].GetComponentInChildren(); riderToSpawn = (((Object)(object)componentInChildren2 != (Object)null) ? componentInChildren2.unitBlueprint : null); delay = ((Component)this).gameObject.transform.localScale.x; range = ((Component)this).gameObject.transform.localScale.y; damageRequired = ((Component)this).gameObject.transform.localScale.z; Object.Destroy((Object)(object)componentInChildren.riders[0].gameObject); } else { Loader.LogWarning("RiderHolder or riders not set up correctly!"); } } private void Update() { //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)curMat == (Object)null) { MeshRenderer componentInChildren = ((Component)this).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && ((Renderer)componentInChildren).materials.Length != 0) { curMat = ((Renderer)componentInChildren).materials[0]; } } if (!Object.op_Implicit((Object)(object)rootUnit) || !Object.op_Implicit((Object)(object)rootUnit.data) || rootUnit.data.Dead || !Object.op_Implicit((Object)(object)rootUnit.data.targetData)) { return; } counter += Time.deltaTime; if (!(rootUnit.data.distanceToTarget <= range) || !(counter >= delay) || !(rootUnit.damageDealt >= damageRequired)) { return; } foreach (SmartConnectedTransformBehaviour allInstance in AllInstances) { if ((Object)(object)allInstance != (Object)null && !allInstance.hasTriggered && allInstance.team == team) { allInstance.OnSharedTriggered(); } } } private void OnEnable() { AllInstances.Add(this); } private void OnDisable() { AllInstances.Remove(this); } public void OnSharedTriggered() { if (!hasTriggered) { hasTriggered = true; Loader.Log(((Object)((Component)this).gameObject).name + " received shared trigger!"); Spawn(riderToSpawn); } } static SmartConnectedTransformBehaviour() { AllInstances = new HashSet(); } public void Spawn(UnitBlueprint riderBlueprint) { //IL_002c: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)riderBlueprint == (Object)null) { Loader.LogWarning("Rider Blueprint is null, cannot spawn!"); return; } Unit val = default(Unit); for (int i = 0; i < spawnAmount; i++) { riderBlueprint.Spawn(rootUnit.data.mainRig.position, rootUnit.data.mainRig.rotation, rootUnit.Team, ref val, 1f, false, true, 0, (UnitPoolInfo?)null); if (!((Object)(object)val != (Object)null) || !((Object)(object)val.data != (Object)null)) { continue; } rootUnit.data.hasBeenRevived = false; rootUnit.data.healthHandler.willBeRewived = true; Rigidbody[] allRigs = rootUnit.data.allRigs.AllRigs; foreach (Rigidbody val2 in allRigs) { if (Object.op_Implicit((Object)(object)curMat) && Object.op_Implicit((Object)(object)particle)) { ParticleSystemRenderer componentInChildren = Object.Instantiate(particle, val2.position, val2.rotation).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((Renderer)componentInChildren).material = curMat; componentInChildren.trailMaterial = curMat; } } } if (!transferHP) { continue; } Loader.Log($"Spawned unit health: {val.data.health} / Spawner unit health: {rootUnit.data.health} / Spawner unit blueprint health: {rootUnit.unitBlueprint.health}"); if (object.Equals(float.PositiveInfinity, rootUnit.data.health) || object.Equals(float.NaN, rootUnit.data.health)) { if (Object.op_Implicit((Object)(object)rootUnit.unitBlueprint)) { val.data.health = rootUnit.unitBlueprint.health; } } else { val.data.health = rootUnit.data.health; } } Object.Destroy((Object)(object)((Component)rootUnit).gameObject); } } public class SmartTransformToRiderBehaviour : MonoBehaviour { private float counter; private Unit rootUnit; private UnitBlueprint riderToSpawn; public float delay; public float damageRequired; private bool hasTriggered; public GameObject particle; private Material curMat; public bool transferHP; public float healthPercentageDetection; public bool useHealthPercentage; public bool onDeathActivate; public float minRange; public float maxRange; [SerializeField] private int maxRigParticleSpawnCount; private const float HEALTH_PERCENTAGE_THRESHOLD_MIN = 0f; private const float SCALE_THRESHOLD_FOR_ONDEATH = 1f; private PropItem propItem; private PropItemData propItemData; public int spawnAmount = 1; public void Start() { InitializeRootUnit(); InitializePropItem(); FinalInitializeRiderAndVar(); } private void Update() { if ((Object)(object)curMat == (Object)null) { MeshRenderer componentInChildren = ((Component)this).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && ((Renderer)componentInChildren).materials.Length != 0) { curMat = ((Renderer)componentInChildren).materials[0]; } } if (onDeathActivate && rootUnit.data.Dead) { Spawn(); } if (!Object.op_Implicit((Object)(object)rootUnit) || !Object.op_Implicit((Object)(object)rootUnit.data) || !Object.op_Implicit((Object)(object)rootUnit.data.targetData) || hasTriggered || onDeathActivate || rootUnit.data.Dead) { return; } counter += Time.deltaTime; if (rootUnit.data.distanceToTarget >= minRange && rootUnit.data.distanceToTarget <= maxRange && counter >= delay && rootUnit.damageDealt >= damageRequired) { if (useHealthPercentage && rootUnit.data.health <= rootUnit.data.maxHealth * healthPercentageDetection) { Spawn(); } else if (!useHealthPercentage) { Spawn(); } } } public SmartTransformToRiderBehaviour() { maxRigParticleSpawnCount = 30; } public void Spawn() { //IL_0046: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) if (hasTriggered) { return; } hasTriggered = true; if ((Object)(object)riderToSpawn == (Object)null) { Loader.LogWarning("Rider Blueprint is null, cannot spawn!"); return; } Unit val = default(Unit); for (int i = 0; i < spawnAmount; i++) { riderToSpawn.Spawn(rootUnit.data.mainRig.position, rootUnit.data.mainRig.rotation, rootUnit.Team, ref val, 1f, false, true, 0, (UnitPoolInfo?)null); if (!((Object)(object)val != (Object)null) || !((Object)(object)val.data != (Object)null)) { continue; } rootUnit.data.hasBeenRevived = false; rootUnit.data.healthHandler.willBeRewived = true; int num = rootUnit.data.allRigs.AllRigs.Length; if (Object.op_Implicit((Object)(object)curMat) && Object.op_Implicit((Object)(object)particle)) { if (num <= maxRigParticleSpawnCount) { Rigidbody[] allRigs = rootUnit.data.allRigs.AllRigs; foreach (Rigidbody val2 in allRigs) { ParticleSystemRenderer componentInChildren = Object.Instantiate(particle, val2.position, val2.rotation).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((Renderer)componentInChildren).material = curMat; componentInChildren.trailMaterial = curMat; } } } else { ParticleSystemRenderer componentInChildren2 = Object.Instantiate(particle, rootUnit.data.mainRig.position, rootUnit.data.mainRig.rotation).GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { ((Renderer)componentInChildren2).material = curMat; componentInChildren2.trailMaterial = curMat; } } } if (!transferHP) { continue; } Loader.Log($"Spawned unit health: {val.data.health} / Spawner unit health: {rootUnit.data.health} / Spawner unit blueprint health: {rootUnit.unitBlueprint.health}"); if (object.Equals(float.PositiveInfinity, rootUnit.data.health) || object.Equals(float.NaN, rootUnit.data.health)) { if (Object.op_Implicit((Object)(object)rootUnit.unitBlueprint)) { val.data.health = rootUnit.unitBlueprint.health; } } else { val.data.health = rootUnit.data.health; } } Object.Destroy((Object)(object)((Component)rootUnit).gameObject); } public void InitializeRootUnit() { rootUnit = ((Component)((Component)this).transform.root).GetComponentInChildren(); } public void InitializePropItem() { propItem = ((Component)this).GetComponentInChildren(); if ((Object)(object)propItem == (Object)null) { Loader.LogError("PropItem not found."); return; } propItemData = ((CharacterItem)propItem).PropData; SetDefaultIfZero(); } public void FinalInitializeRiderAndVar() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_00e0: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) RiderHolder componentInChildren = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.riders != null && componentInChildren.riders.Count > 0 && (Object)(object)componentInChildren.riders[0] != (Object)null) { Unit componentInChildren2 = componentInChildren.riders[0].GetComponentInChildren(); riderToSpawn = (((Object)(object)componentInChildren2 != (Object)null) ? componentInChildren2.unitBlueprint : null); delay = ((Component)this).gameObject.transform.localScale.x; onDeathActivate = ((Component)this).gameObject.transform.localScale.y >= 1f; damageRequired = ((Component)this).gameObject.transform.localScale.z; Vector3 positionOffset = propItemData.m_positionOffset; if (positionOffset.x > 0f) { useHealthPercentage = true; healthPercentageDetection = positionOffset.x; } minRange = positionOffset.y; maxRange = positionOffset.z; Object.Destroy((Object)(object)componentInChildren.riders[0].gameObject); } else { Loader.LogWarning("RiderHolder or riders not set up correctly!"); } } private void SetDefaultIfZero() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (propItemData.m_positionOffset == Vector3.zero) { propItemData.m_positionOffset = Vector3.one; Loader.Log("m_positionOffset was zero; set to Vector3.one."); } if (((Component)this).transform.localPosition == Vector3.zero) { ((Component)this).transform.localPosition = Vector3.one; Loader.Log("localPosition was zero; set to Vector3.one."); } } } public class SmartRigScaleSizingBehaviour : MonoBehaviour { public enum RigType { Head, Torso, LegLeft, LegRight, FootLeft, FootRight, LeftHand, RightHand, LeftArm, RightArm, Hip } private Unit unit; public RigType rigType; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); } } private void Update() { if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.data)) { UpdateRigData(); } } private void UpdateRigData() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0179: 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) switch (rigType) { case RigType.Head: unit.data.head.localScale = ((Component)this).transform.localScale; break; case RigType.Torso: unit.data.torso.localScale = ((Component)this).transform.localScale; break; case RigType.LegLeft: unit.data.legLeft.localScale = ((Component)this).transform.localScale; break; case RigType.LegRight: unit.data.legRight.localScale = ((Component)this).transform.localScale; break; case RigType.FootLeft: unit.data.footLeft.localScale = ((Component)this).transform.localScale; break; case RigType.FootRight: unit.data.footRight.localScale = ((Component)this).transform.localScale; break; case RigType.LeftHand: unit.data.leftHand.localScale = ((Component)this).transform.localScale; break; case RigType.RightHand: unit.data.rightHand.localScale = ((Component)this).transform.localScale; break; case RigType.LeftArm: unit.data.leftArm.localScale = ((Component)this).transform.localScale; break; case RigType.RightArm: unit.data.rightArm.localScale = ((Component)this).transform.localScale; break; case RigType.Hip: ((Component)unit.data.hip).transform.localScale = ((Component)this).transform.localScale; break; } } } public class SmartKeepDistanceBehaviour : MonoBehaviour { public float maxDistance; public float minDistance; public float atkDistance; private Unit unit; public float counter; public float timer; public float force = 500f; private UnitDontWalkFor unitDontWalkFor; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); unitDontWalkFor = ((Component)this).gameObject.AddComponent(); unitDontWalkFor.time = 1f; ApplySettings(); } public SmartKeepDistanceBehaviour() { timer = 0.01f; } private void Update() { //IL_00ed: 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_0118: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: 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) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) counter += Time.deltaTime; if (!Object.op_Implicit((Object)(object)unit) || !Object.op_Implicit((Object)(object)unit.data) || unit.data.Dead || !Object.op_Implicit((Object)(object)unit.data.targetData) || !(counter >= timer)) { return; } counter = 0f; Unit val = unit.data.targetData.unit; if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.data) || !Object.op_Implicit((Object)(object)val.data.mainRig) || !Object.op_Implicit((Object)(object)unit.data.mainRig)) { return; } float num = Vector3.Distance(val.data.mainRig.position, unit.data.mainRig.position); Vector3 val2 = val.data.mainRig.position - unit.data.mainRig.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; CameraAbilityPossess componentInParent = ((Component)MainCam.instance).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent) && (Object)(object)componentInParent.currentUnit != (Object)(object)unit && num >= atkDistance) { unit.Attack(val.data.mainRig.position, val.data.mainRig, Vector3.zero); } Rigidbody[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { if (num <= minDistance) { componentsInChildren[i].AddForce(-normalized * force, (ForceMode)5); } } if (num <= maxDistance) { unitDontWalkFor.Go(); } } private void ApplySettings() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = ((Component)this).transform.localScale; atkDistance = localScale.x; minDistance = localScale.y; maxDistance = localScale.z; } } public class MakeUnitBasePropableBehaviour : MonoBehaviour { private Unit unit; private UnitRig rig; private UnitBlueprint unitBlueprint; private Transform mainTransform; private void Awake() { //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null || (Object)(object)unit.data == (Object)null) { Loader.LogError("Unit or Unit.data is missing."); return; } unitBlueprint = unit.unitBlueprint; mainTransform = ((Component)unit.data.mainRig).transform; rig = ((Component)unit).GetComponent(); if (!Object.op_Implicit((Object)(object)rig)) { Loader.LogWarning("UnitRig component not found on unit."); return; } SetUnitRigIfNull(); if (!Object.op_Implicit((Object)(object)rig) || !Object.op_Implicit((Object)(object)unit) || !Object.op_Implicit((Object)(object)unitBlueprint)) { return; } Loader.Log("Spawning Props!"); ((Component)unit.data.mainRig).GetComponentsInChildren(true); rig.SpawnProps(unitBlueprint.m_props, unitBlueprint.m_propData, (RigType)1, unit.Team); foreach (Transform item in ((Component)unit).transform) { Transform val = item; if (Object.op_Implicit((Object)(object)((Component)val).GetComponent()) && (Object)(object)val.parent != (Object)(object)((Component)unit.data.mainRig).transform) { val.SetParent(((Component)unit.data.mainRig).transform, true); Loader.Log("Re-parented prop: " + ((Object)val).name); } } if (!(typeof(UnitRig).GetField("m_items", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(rig) is List list)) { return; } foreach (CharacterItem item2 in list) { if ((Object)(object)item2 != (Object)null && (Object)(object)((Component)item2).transform.parent == (Object)null) { ((Component)item2).transform.SetParent(mainTransform, true); Loader.Log("Re-parented item: " + ((Object)item2).name); } } } public void SetUnitRigIfNull() { if (Object.op_Implicit((Object)(object)rig) && Object.op_Implicit((Object)(object)mainTransform)) { if ((Object)(object)rig.m_head == (Object)null) { rig.m_head = mainTransform; } if ((Object)(object)rig.m_neck == (Object)null) { rig.m_neck = mainTransform; } if ((Object)(object)rig.m_shoulderLeft == (Object)null) { rig.m_shoulderLeft = mainTransform; } if ((Object)(object)rig.m_shoulderRight == (Object)null) { rig.m_shoulderRight = mainTransform; } if ((Object)(object)rig.m_armLeft == (Object)null) { rig.m_armLeft = mainTransform; } if ((Object)(object)rig.m_armRight == (Object)null) { rig.m_armRight = mainTransform; } if ((Object)(object)rig.m_wristLeft == (Object)null) { rig.m_wristLeft = mainTransform; } if ((Object)(object)rig.m_wristRight == (Object)null) { rig.m_wristRight = mainTransform; } if ((Object)(object)rig.m_torso == (Object)null) { rig.m_torso = mainTransform; } if ((Object)(object)rig.m_waist == (Object)null) { rig.m_waist = mainTransform; } if ((Object)(object)rig.m_legLeft == (Object)null) { rig.m_legLeft = mainTransform; } if ((Object)(object)rig.m_legRight == (Object)null) { rig.m_legRight = mainTransform; } if ((Object)(object)rig.m_footLeft == (Object)null) { rig.m_footLeft = mainTransform; } if ((Object)(object)rig.m_footRight == (Object)null) { rig.m_footRight = mainTransform; } } } } } namespace TIHarmonyPatches { [HarmonyPatch(typeof(Unit), "Awake")] public class UnitAwakePatch { private static bool enable; private static void Postfix(Unit __instance) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Invalid comparison between Unknown and I4 //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.data == (Object)null || !enable || (int)__instance.unitType != 1 || (int)__instance.RigType != 0) { return; } if ((Object)(object)__instance.data.mainRig == (Object)null) { Debug.LogWarning((object)"[UnitAwakePatch] Unit.data.mainRig is null, skipping."); return; } Debug.Log((object)("[UnitAwakePatch] Checking warmachine rig: " + ((Object)__instance).name)); if (Object.op_Implicit((Object)(object)((Component)__instance).GetComponentInChildren())) { Debug.Log((object)"[UnitAwakePatch] Existing UnitRig found in child object."); return; } Loader.Log("[UnitAwakePatch] Injecting custom UnitRig."); UnitRig val = ((Component)__instance).gameObject.AddComponent(); Transform transform = ((Component)__instance.data.mainRig).transform; Transform val2 = transform.Find("Rigidbodies") ?? new GameObject("Rigidbodies").transform; val2.SetParent(transform, false); val2.localPosition = Vector3.zero; Transform parent = CreateBone("M_Armature", val2); val.m_waist = AssignIfNull(val.m_waist, CreateBone("M_Hip", parent)); val.m_torso = AssignIfNull(val.m_torso, CreateBone("M_Torso", val.m_waist)); val.m_neck = AssignIfNull(val.m_neck, CreateBone("M_Neck", val.m_torso)); val.m_head = AssignIfNull(val.m_head, CreateBone("M_Head", val.m_neck)); val.m_legLeft = AssignIfNull(val.m_legLeft, CreateBone("M_Leg_Left", val.m_waist)); val.m_footLeft = AssignIfNull(val.m_footLeft, CreateBone("M_Foot_Left", val.m_legLeft)); val.m_legRight = AssignIfNull(val.m_legRight, CreateBone("M_Leg_Right", val.m_waist)); val.m_footRight = AssignIfNull(val.m_footRight, CreateBone("M_Foot_Right", val.m_legRight)); val.m_armLeft = AssignIfNull(val.m_armLeft, CreateBone("M_Arm_Left", val.m_torso)); val.m_shoulderLeft = AssignIfNull(val.m_shoulderLeft, CreateBone("M_Shoulder_Left", val.m_armLeft)); val.m_wristLeft = AssignIfNull(val.m_wristLeft, CreateBone("M_Wrist_Left", val.m_shoulderLeft)); CreateBone("M_Hand_Left", val.m_wristLeft); val.m_armRight = AssignIfNull(val.m_armRight, CreateBone("M_Arm_Right", val.m_torso)); val.m_shoulderRight = AssignIfNull(val.m_shoulderRight, CreateBone("M_Shoulder_Right", val.m_armRight)); val.m_wristRight = AssignIfNull(val.m_wristRight, CreateBone("M_Wrist_Right", val.m_shoulderRight)); CreateBone("M_Hand_Right", val.m_wristRight); } private static Transform CreateBone(string name, Transform parent) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) Transform val = parent.Find(name); if ((Object)(object)val != (Object)null) { return val; } GameObject val2 = new GameObject(name); val2.transform.SetParent(parent, false); val2.transform.localPosition = Vector3.zero; return val2.transform; } private static Transform AssignIfNull(Transform current, Transform fallback) { if (!((Object)(object)current != (Object)null)) { return fallback; } return current; } static UnitAwakePatch() { enable = true; } } } namespace TIComponents { public class SmartWeaponScalingStaticBehaviour : MonoBehaviour { private Unit unit; public bool right; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)"Unit not found in hierarchy."); return; } Weapon val = (right ? unit.data.weaponHandler.rightWeapon : unit.data.weaponHandler.leftWeapon); if ((Object)(object)val != (Object)null) { UpdateScaleData(((Component)val).gameObject); } } private void UpdateScaleData(GameObject weaponObject) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) weaponObject.transform.localScale = ((Component)this).transform.localScale; } } public class ExpirationBehaviourBehaviour : MonoBehaviour { public Unit unit; public float seconds = 10f; private float counter; private void Update() { counter += Time.deltaTime; if (counter >= seconds) { Destroy(); } } private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); } private void Destroy() { if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.data) && Object.op_Implicit((Object)(object)unit.data.healthHandler) && unit.data.healthHandler.Die((Unit)null)) { Object.Destroy((Object)(object)((Component)unit).gameObject); } } } } namespace TI { public static class UTI { public static class ICat { public static void SetTag(GameObject item, string categoryName = "Technical Items", TagType tagType = (TagType)0) { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)item == (Object)null) { Loader.LogWarning("[SetTag] Provided item is null."); return; } CharacterItem componentInChildren = item.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { Loader.LogWarning("[SetTag] CharacterItem not found in children."); return; } if (componentInChildren.tags == null) { componentInChildren.tags = new List(); } string uniqueValue = categoryName; int num = 0; while (componentInChildren.tags.Exists((Tag tag) => tag.value == uniqueValue)) { num++; uniqueValue = $"{categoryName}_{num}"; if (num > 999999) { Loader.LogError("[SetTag] Failed to generate a unique tag value after 999999 attempts."); return; } } componentInChildren.tags.Add(new Tag { tagType = tagType, value = uniqueValue }); } catch (Exception ex) { Loader.LogError("[SetTag] Exception occurred: " + ex.Message); } } } public enum assetType { Prop, Ability } public static string comment; public static AssetBundle bundle; private static Dictionary CombatMoves { get { Dictionary dictionary = HelpLibrary.m_combatMoves; if (dictionary == null) { dictionary = (HelpLibrary.m_combatMoves = new Dictionary()); } return dictionary; } } private static Dictionary CharacterProps { get { Dictionary dictionary = HelpLibrary.m_characterProps; if (dictionary == null) { dictionary = (HelpLibrary.m_characterProps = new Dictionary()); } return dictionary; } } public static void LoadBundle(string assetBundleName) { Stream manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(assetBundleName); if (manifestResourceStream == null) { Loader.LogError("[LoadBundle] Failed to find resource: " + assetBundleName); } else if (!manifestResourceStream.CanRead) { Loader.LogError("[LoadBundle] Resource stream is not readable: " + assetBundleName); } else { bundle = AssetBundle.LoadFromStream(manifestResourceStream); } } public static Sprite LoadTexture2Sprite(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 LoadGmObj(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); } private static bool IsOccupied(DatabaseID id) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (!CombatMoves.ContainsKey(id)) { return CharacterProps.ContainsKey(id); } return true; } public static int IDScan(assetType type, int startId = 1) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) int num = Math.Max(1, startId); DatabaseID id = default(DatabaseID); ((DatabaseID)(ref id))..ctor(num); while (IsOccupied(id)) { Loader.LogWarning($"[IDChecker] ID {num} in use, trying {num + 1}…"); num++; ((DatabaseID)(ref id))..ctor(num); } Loader.Log($"[IDChecker] Found free ID: {num}"); return num; } } } namespace TIComponents { public class StitchedClothingBehaviour : MonoBehaviour { public Transform UnitBone; public string BoneName; public List ClothingBones = new List(); } public class ColorableAbilityProjBehaviour : MonoBehaviour { public enum ChangeType { Model, Particle } private Unit unit; private GameObject hiddenParent; private Material curMat; public ChangeType MaterialChangeType; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Loader.LogWarning("Unit component not found."); return; } SetHiddenParent(); SpawnObject[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); foreach (SpawnObject val in componentsInChildren) { val.objectToSpawn = MakeTempCopy(val.objectToSpawn); } } private GameObject MakeTempCopy(GameObject gameObjectToCopy) { GameObject val = Object.Instantiate(gameObjectToCopy, hiddenParent.transform); MeshRenderer componentInChildren = ((Component)this).GetComponentInChildren(); curMat = (((Object)(object)componentInChildren != (Object)null) ? ((Renderer)componentInChildren).materials[0] : null); if ((Object)(object)curMat != (Object)null) { switch (MaterialChangeType) { case ChangeType.Particle: ApplyMaterialToRenderers(val); break; case ChangeType.Model: ApplyMaterialToRenderers(val); ApplyMaterialToRenderers(val); break; } } return val; } 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); } private void ApplyMaterialToRenderers(GameObject obj) where T : Renderer { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown T[] componentsInChildren = obj.GetComponentsInChildren(); foreach (T val in componentsInChildren) { List list = new List(); Material[] materials = ((Renderer)val).materials; for (int j = 0; j < materials.Length; j++) { _ = materials[j]; list.Add(new Material(curMat)); } ((Renderer)val).materials = list.ToArray(); } } } public class ChangeAbilityProjectileHomingBehaviour : MonoBehaviour { private Unit unit; public float scaleM; private GameObject hiddenParent; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); SetHiddenParent(); SpawnObject[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { GameObject objectToSpawn = MakeTempCopy(componentsInChildren[i].objectToSpawn); componentsInChildren[i].objectToSpawn = objectToSpawn; } } private GameObject MakeTempCopy(GameObject gameObjectToCopy) { GameObject obj = Object.Instantiate(gameObjectToCopy, hiddenParent.transform); obj.AddComponent().force *= 6f; 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); } } } namespace TIHarmonyPatches { [HarmonyPatch(typeof(SetParent), "Doit")] internal static class SetParentDoitPatch { private static bool Prefix(SetParent __instance) { ((MonoBehaviour)__instance).StartCoroutine(CheckLater(__instance)); return true; } public static void DestroyChildModels(GameObject inObject) { Renderer[] componentsInChildren = inObject.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (!(val is ParticleSystemRenderer)) { Object.Destroy((Object)(object)val); } } } private static IEnumerator CheckLater(SetParent setParent) { yield return (object)new WaitForSeconds(0.1f); if (!((Object)(object)setParent == (Object)null) && !((Object)(object)setParent.parentBefore == (Object)null)) { Transform root = setParent.parentBefore.root; Loader.Log("Transform root on: " + ((Object)root).name); if ((Object)(object)((Component)root).GetComponentInChildren(true) != (Object)null) { Loader.Log("Deleting child models on: " + ((Object)((Component)setParent).gameObject).name); DestroyChildModels(((Component)setParent).gameObject); } if ((Object)(object)((Component)root).GetComponentInChildren(true) != (Object)null) { Loader.Log("Deleting child particles on: " + ((Object)((Component)setParent).gameObject).name); DestroyChildParticles(((Component)setParent).gameObject); } else { Loader.LogWarning("No Hide Ability Model found."); } } } public static void DestroyChildParticles(GameObject inObject) { Renderer[] componentsInChildren = inObject.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (val is ParticleSystemRenderer) { Object.Destroy((Object)(object)val); } } } } } namespace TIComponents { public class SmartCustomMountBehaviour : MonoBehaviour { private Unit rootUnit; private IEnumerator Start() { rootUnit = ((Component)((Component)this).transform.root).GetComponentInChildren(); Mount componentInChildren = ((Component)rootUnit).GetComponentInChildren().riders[0].GetComponentInChildren(); ConfigurableJoint[] joints = (ConfigurableJoint[])OtherLibrary.GetField(componentInChildren, "joints"); while ((Object)(object)joints[0] == (Object)null) { yield return null; } for (int i = 0; i < joints.Length; i++) { ((Joint)joints[i]).autoConfigureConnectedAnchor = false; ConfigurableJoint obj = joints[i]; ((Joint)obj).connectedAnchor = ((Joint)obj).connectedAnchor + ((Component)this).transform.localPosition; } } } public class ThrowMeleeWeaponBehaviour : MonoBehaviour { private Unit unit; private GameObject hiddenParent; public GameObject baseProjObject; private void Start() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Expected O, but got Unknown unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); SetHiddenParent(); MeleeWeapon[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); foreach (MeleeWeapon val in componentsInChildren) { GameObject gameObject = ((Component)val).gameObject; CollisionWeapon componentInChildren = gameObject.GetComponentInChildren(); GameObject weaponModelLOD = GetWeaponModelLOD0(gameObject); if (!Object.op_Implicit((Object)(object)weaponModelLOD)) { continue; } MeshFilter component = weaponModelLOD.GetComponent(); MeshRenderer component2 = weaponModelLOD.GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component2)) { continue; } float scaleMulti = CondenseVector(weaponModelLOD.gameObject.transform.lossyScale); GameObject val2 = MakeTempCopy(baseProjObject, val, componentInChildren, component, component2, scaleMulti); if (!Object.op_Implicit((Object)(object)((Component)val).GetComponentInChildren()) && Object.op_Implicit((Object)(object)val2)) { SpawnObject val3 = ((Component)val).gameObject.AddComponent(); val3.spawnIfUnitDead = false; val3.objectToSpawn = val2; if (val.swingEvent == null) { val.swingEvent = new UnityEvent(); } val.swingEvent.AddListener(new UnityAction(val3.SpawnTowardsTarget)); } } } 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); } private GameObject GetWeaponModelLOD0(GameObject weaponObject) { MeshRenderer[] componentsInChildren = weaponObject.GetComponentsInChildren(); foreach (MeshRenderer val in componentsInChildren) { if (!Object.op_Implicit((Object)(object)((Component)val).GetComponentInChildren()) && !Object.op_Implicit((Object)(object)((Component)val).GetComponentInChildren()) && !Object.op_Implicit((Object)(object)((Component)val).GetComponentInChildren()) && !Object.op_Implicit((Object)(object)((Component)val).GetComponentInChildren()) && !Object.op_Implicit((Object)(object)((Component)val).GetComponentInChildren())) { return ((Component)val).gameObject; } } return null; } private GameObject MakeTempCopy(GameObject gameObjectToCopy, MeleeWeapon meleeWeapon, CollisionWeapon collisionWeapon, MeshFilter meshFilterOrigin, MeshRenderer meshRendererOrigin, float scaleMulti) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) GameObject obj = Object.Instantiate(gameObjectToCopy, hiddenParent.transform); CollisionSound componentInChildren = obj.GetComponentInChildren(); RaycastTrail componentInChildren2 = obj.GetComponentInChildren(); ProjectileHit componentInChildren3 = obj.GetComponentInChildren(); MeshFilter componentInChildren4 = obj.GetComponentInChildren(); MeshRenderer componentInChildren5 = obj.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren4) && Object.op_Implicit((Object)(object)componentInChildren5)) { componentInChildren4.sharedMesh = meshFilterOrigin.sharedMesh; ((Renderer)componentInChildren5).sharedMaterials = ((Renderer)meshRendererOrigin).sharedMaterials; ((Component)componentInChildren4).gameObject.transform.localScale = Vector3.one * scaleMulti; } if (Object.op_Implicit((Object)(object)componentInChildren3) && Object.op_Implicit((Object)(object)collisionWeapon)) { if (Object.op_Implicit((Object)(object)componentInChildren)) { componentInChildren3.SoundRef = componentInChildren.SoundEffectRef; componentInChildren3.Validate(); } componentInChildren3.damage = collisionWeapon.damage; componentInChildren3.force = collisionWeapon.onImpactForce; componentInChildren3.lowMassCap = collisionWeapon.massCap; componentInChildren3.shakeAmount = collisionWeapon.screenShakeMultiplier; componentInChildren3.blockPoweredNeeded = meleeWeapon.requiredPowerToParry; } if (Object.op_Implicit((Object)(object)componentInChildren2)) { componentInChildren2.radius = Mathf.Clamp(scaleMulti, 0f, float.PositiveInfinity); componentInChildren2.ignoredFrames = 1; } return obj; } private float CondenseVector(Vector3 vector3) { //IL_0000: 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_000d: Unknown result type (might be due to invalid IL or missing references) return (vector3.x + vector3.y + vector3.z) / 3f; } } public class SmartAdaptiveProjSpawnerBehaviour : MonoBehaviour { public SpawnObject spawnObject; private Unit unit; public GameObject smokeObject; public int amountToSpawn; public float distance; public float counter; public float timer; public Material curMat; private float weaponRefresh; private RangeWeapon[] rangeWeapons; private GameObject[] projectilePool; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); rangeWeapons = ((Component)unit).GetComponentsInChildren(); spawnObject = ((Component)this).gameObject.AddComponent(); spawnObject.spawnIfUnitDead = false; SetSettings(); } private void Update() { //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) counter += Time.deltaTime; weaponRefresh += Time.deltaTime; if (weaponRefresh >= 1f) { weaponRefresh = 0f; rangeWeapons = ((Component)unit).GetComponentsInChildren(); } if ((Object)(object)curMat == (Object)null) { MeshRenderer componentInChildren = ((Component)this).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && ((Renderer)componentInChildren).materials.Length != 0) { curMat = ((Renderer)componentInChildren).materials[0]; } } if (!Object.op_Implicit((Object)(object)unit) || !Object.op_Implicit((Object)(object)unit.data) || !(unit.data.distanceToTarget <= distance) || !(counter >= timer)) { return; } counter = 0f; for (int i = 0; i < amountToSpawn; i++) { spawnObject.objectToSpawn = GetProjectile(); spawnObject.SpawnTowardsTarget(); if (Object.op_Implicit((Object)(object)smokeObject)) { ParticleSystemRenderer componentInChildren2 = Object.Instantiate(smokeObject, ((Component)this).transform.position, Quaternion.identity, (Transform)null).GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { ((Renderer)componentInChildren2).material = curMat; componentInChildren2.trailMaterial = curMat; } } } } private void SetSettings() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = ((Component)this).transform.localScale; timer = localScale.x; distance = localScale.y; amountToSpawn = Mathf.RoundToInt(localScale.z); } private GameObject GetProjectile() { if (rangeWeapons == null || rangeWeapons.Length == 0) { return null; } return rangeWeapons[Random.Range(0, rangeWeapons.Length)].ObjectToSpawn; } } public class DestroyAbilitiesParticlesBehaviour : MonoBehaviour { private void Awake() { SpecialAbility[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { DestroyChild(((Component)componentsInChildren[i]).gameObject); } } public void DestroyChild(GameObject gameObject) { Renderer[] componentsInChildren = gameObject.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { if (((object)componentsInChildren[i]).GetType() == typeof(ParticleSystemRenderer)) { Object.Destroy((Object)(object)componentsInChildren[i]); } } } private void Start() { SpecialAbility[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { DestroyChild(((Component)componentsInChildren[i]).gameObject); } } } }