using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Commando.CommandoWeapon; using HG; using HG.BlendableTypes; using IL.RoR2; using KinematicCharacterController; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates; using On.RoR2; using R2API; using R2API.Networking; using R2API.Utils; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using TF2SoldierMod.Modules; using TF2SoldierMod.Modules.Controllers; using TF2SoldierMod.Modules.Survivors; using TF2SoldierMod.SkillStates; using TF2SoldierMod.SkillStates.Banners; using TF2SoldierMod.SkillStates.BaseStates; using TF2SoldierMod.SkillStates.TF2Soldier.ReloadStates; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("TF2SoldierMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("TF2SoldierMod")] [assembly: AssemblyTitle("TF2SoldierMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] internal class BodyInfo { internal string bodyName = ""; internal string bodyNameToken = ""; internal string subtitleNameToken = ""; internal string bodyNameToClone = "Commando"; internal Texture characterPortrait = null; internal GameObject crosshair = null; internal GameObject podPrefab = null; internal float maxHealth = 100f; internal float healthGrowth = 2f; internal float healthRegen = 0f; internal float shield = 0f; internal float shieldGrowth = 0f; internal float moveSpeed = 7f; internal float moveSpeedGrowth = 0f; internal float acceleration = 80f; internal float jumpPower = 15f; internal float jumpPowerGrowth = 0f; internal float damage = 12f; internal float attackSpeed = 1f; internal float attackSpeedGrowth = 0f; internal float armor = 0f; internal float armorGrowth = 0f; internal float crit = 1f; internal float critGrowth = 0f; internal int jumpCount = 1; internal Color bodyColor = Color.grey; internal Vector3 aimOriginPosition = new Vector3(0f, 1.8f, 0f); internal Vector3 modelBasePosition = new Vector3(0f, -0.92f, 0f); internal Vector3 cameraPivotPosition = new Vector3(0f, 1.6f, 0f); } internal class CustomRendererInfo { internal string childName; internal Material material; internal bool ignoreOverlays; } internal class SkillDefInfo { public string skillName; public string skillNameToken; public string skillDescriptionToken; public Sprite skillIcon; public SerializableEntityStateType activationState; public string activationStateMachineName; public int baseMaxStock; public float baseRechargeInterval; public bool beginSkillCooldownOnSkillEnd; public bool canceledFromSprinting; public bool forceSprintDuringState; public bool fullRestockOnAssign; public InterruptPriority interruptPriority; public bool resetCooldownTimerOnUse; public bool isCombatSkill; public bool mustKeyPress; public bool cancelSprintingOnActivation; public int rechargeStock; public int requiredStock; public int stockToConsume; public string[] keywordTokens; } namespace TF2SoldierMod { [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Lemner.TF2SoldierMod", "TF2SoldierMod", "1.3.3")] [R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI", "NetworkingAPI", "DamageAPI", "TempVisualEffectAPI" })] public class TF2SoldierPlugin : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_ApplyJumpVelocity <>9__17_3; internal void b__17_3(orig_ApplyJumpVelocity orig, CharacterMotor characterMotor, CharacterBody characterBody, float horizontalBonus, float verticalBonus, bool vault) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_0038: 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_0044: 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_008f: 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_0072: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity = characterMotor.velocity; orig.Invoke(characterMotor, characterBody, horizontalBonus, verticalBonus, vault); if (characterBody.baseNameToken.Equals("LEMN_SOLDIERTF2_BODY_NAME")) { Vector3 velocity2 = characterMotor.moveDirection * characterBody.moveSpeed * horizontalBonus; if (((Vector3)(ref characterMotor.velocity)).sqrMagnitude < ((Vector3)(ref velocity2)).sqrMagnitude) { velocity2.y = characterMotor.velocity.y; characterMotor.velocity = velocity2; } else { velocity.y = characterMotor.velocity.y; characterMotor.velocity = velocity; } } } } public const string MODUID = "com.Lemner.TF2SoldierMod"; public const string MODNAME = "TF2SoldierMod"; public const string MODVERSION = "1.3.3"; public const string developerPrefix = "LEMN"; internal List Survivors = new List(); public static TF2SoldierPlugin instance; public static ModdedDamageType ReserveShooterHit; public static ModdedDamageType DeathResistor; public static ModdedDamageType ZatoichiHit; public static ModdedDamageType BazookaHit; private Dictionary info = new Dictionary(); public static bool isFalling; private void Awake() { //IL_0060: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) instance = this; Assets.Initialize(); Config.ReadConfig(); States.RegisterStates(); Buffs.RegisterBuffs(); Projectiles.RegisterProjectiles(); Tokens.AddTokens(); ItemDisplays.PopulateDisplays(); new Soldier().Initialize(); new ContentPacks().Initialize(); ContentManager.onContentPacksAssigned += LateSetup; Hook(); ReserveShooterHit = DamageAPI.ReserveDamageType(); DeathResistor = DamageAPI.ReserveDamageType(); ZatoichiHit = DamageAPI.ReserveDamageType(); BazookaHit = DamageAPI.ReserveDamageType(); LanguageAPI.Add("KEYWORD_MINICRIT", "Mini CritDeals 1.5x damage. Activates on-crit items.\nDamage is overridden by regular critical strikes."); LanguageAPI.Add("KEYWORD_OVERHEAL", "OverhealHealing recieved from this ability is instead applied as a barrier, if your health is full."); LanguageAPI.Add("KEYWORD_PASSIVEONLY", "Passive OnlyThis ability cannot be directly used, and instead provides passive benefits."); LanguageAPI.Add("KEYWORD_ROCKETJUMP", "Rocket JumpingThe rockets from this ability push you back when they explode near you."); LanguageAPI.Add("KEYWORD_SELFDAMAGE", "Self DamagingThe rockets from this ability damage you for 15% of your current health when they explode near you. This damage is non-lethal."); LanguageAPI.Add("KEYWORD_DEATHRESIST", $"Death ResistActivated when you would have been killed. You cannot be lowered below 1 health by normal means. Lasts {7.5f} seconds, and has a cooldown of {30f} seconds."); LanguageAPI.Add("KEYWORD_LOADING", "LoadingHolding the button down loads a rocket. Releasing fires all stored rockets. Attempting to load more than the maximum damages you and pushes you backward."); LanguageAPI.Add("KEYWORD_MOTIVATE", string.Format("MotivationIncreases damage by {0}x, attack speed by {1}%, movement speed by {2}x, critical strike chance by {3}%, and grants {4} additional jump{5}.", 1.25f, 50f, 1.5f, 30f, 1, "")); LanguageAPI.Add("KEYWORD_DUELING", $"DuelingHitting an elite enemy with this ability has a {20f}% chance to steal their affix for {90f} seconds.\nKilling an elite enemy with this ability steals their affix 100% of the time.\nHitting an elite enemy sharing an affix with you with this ability does {5f}x damage and is a guaranteed critical strike, with a {20f}% chance to execute them."); } private static bool ConchBuffCondition(CharacterBody body) { return body.HasBuff(Buffs.conchBuff); } private static bool CritBuffCondition(CharacterBody body) { return body.HasBuff(Buffs.buffBannerBuff); } private static bool BattalionBuffCondition(CharacterBody body) { return body.HasBuff(Buffs.battalionBuff); } private static bool WhipBuffCondition(CharacterBody body) { return body.HasBuff(Buffs.whipBuff); } private void LateSetup(ReadOnlyArray obj) { SurvivorBase.instance.SetItemDisplays(); } private void Hook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Expected O, but got Unknown CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); CharacterMotor.OnLanded += new hook_OnLanded(CharacterMotor_OnLanded); CharacterMotor.OnGroundHit += new hook_OnGroundHit(CharacterMotor_OnGroundHit); CharacterBody.FixedUpdate += new hook_FixedUpdate(CharacterBody_FixedUpdate); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); CharacterModel.Awake += new hook_Awake(CharacterModel_Awake); CharacterModel.Start += new hook_Start(CharacterModel_Start); CharacterBody.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(CharacterBody_OnBuffFirstStackGained); CharacterBody.OnBuffFinalStackLost += new hook_OnBuffFinalStackLost(CharacterBody_OnBuffFinalStackLost); if (Config.autoJumpEnabled.Value) { GenericCharacterMain.GatherInputs += (hook_GatherInputs)delegate(orig_GatherInputs orig, GenericCharacterMain self) { orig.Invoke(self); if (((EntityState)self).characterBody.baseNameToken.Equals("LEMN_SOLDIERTF2_BODY_NAME") && Access(self, "hasInputBank")) { CharacterMotor motor2 = GetMotor(self); if (motor2 != null) { GetInfo(motor2).GroundedJump = AccessProperty(self, typeof(EntityState), "inputBank").jump.down; } } }; } GenericCharacterMain.ProcessJump += (hook_ProcessJump)delegate(orig_ProcessJump orig, GenericCharacterMain self) { CharacterMotor motor = GetMotor(self); if (motor != null && motor.isGrounded) { SoldierMintTeaInfo soldierMintTeaInfo = GetInfo(motor); if (soldierMintTeaInfo != null && soldierMintTeaInfo.GroundedJump) { Set(self, "jumpInputReceived", true); } } orig.Invoke(self); }; CharacterMotor.PreMove += (hook_PreMove)delegate(orig_PreMove orig, CharacterMotor self, float deltaTime) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_004e: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity3 = self.velocity; orig.Invoke(self, deltaTime); if (IsPlayerControlled(self) && self.body.baseNameToken.Equals("LEMN_SOLDIERTF2_BODY_NAME") && !self.body.HasBuff(Buffs.parachuteBuff)) { self.velocity = velocity3; PreMovementHandler(self, deltaTime); } }; object obj = <>c.<>9__17_3; if (obj == null) { hook_ApplyJumpVelocity val = delegate(orig_ApplyJumpVelocity orig, CharacterMotor characterMotor, CharacterBody characterBody, float horizontalBonus, float verticalBonus, bool vault) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_0038: 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_0044: 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_008f: 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_0072: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity = characterMotor.velocity; orig.Invoke(characterMotor, characterBody, horizontalBonus, verticalBonus, vault); if (characterBody.baseNameToken.Equals("LEMN_SOLDIERTF2_BODY_NAME")) { Vector3 velocity2 = characterMotor.moveDirection * characterBody.moveSpeed * horizontalBonus; if (((Vector3)(ref characterMotor.velocity)).sqrMagnitude < ((Vector3)(ref velocity2)).sqrMagnitude) { velocity2.y = characterMotor.velocity.y; characterMotor.velocity = velocity2; } else { velocity.y = characterMotor.velocity.y; characterMotor.velocity = velocity; } } }; <>c.<>9__17_3 = val; obj = (object)val; } GenericCharacterMain.ApplyJumpVelocity += (hook_ApplyJumpVelocity)obj; } private void CharacterMotor_OnGroundHit(orig_OnGroundHit orig, CharacterMotor self, Collider hitCollider, Vector3 hitNormal, Vector3 hitPoint, ref HitStabilityReport hitStabilityReport) { //IL_0004: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_00f7: 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_010d: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, hitCollider, hitNormal, hitPoint, ref hitStabilityReport); float num = 50f; float num2 = 65f; if (Object.op_Implicit((Object)(object)self.body) && self.body.baseNameToken.Equals("LEMN_SOLDIERTF2_BODY_NAME") && self.body.skillLocator.secondary.skillNameToken.Equals("LEMN_SOLDIERTF2_BODY_SECONDARY_MANNTREADS_NAME") && Mathf.Abs(self.velocity.y) > num) { float num3 = Mathf.Lerp(15f, 40f, Mathf.InverseLerp(num, num2, Mathf.Abs(self.velocity.y))); new BlastAttack { attacker = ((Component)self.body).gameObject, inflictor = ((Component)self.body).gameObject, teamIndex = TeamComponent.GetObjectTeam(((Component)self.body).gameObject), position = hitPoint, procCoefficient = 1.5f, radius = 3f, baseForce = 0f, baseDamage = self.body.damage * num3, falloffModel = (FalloffModel)0, crit = true, damageColorIndex = (DamageColorIndex)0, attackerFiltering = (AttackerFiltering)2 }.Fire(); Util.PlaySound("MannTreadBoomSound", ((Component)self).gameObject); List list = new SphereSearch { radius = 3f, mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = hitPoint }.RefreshCandidates().FilterCandidatesByHurtBoxTeam(TeamMask.allButNeutral).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes() .ToList(); if (list.Count > 1 && isFalling) { new ShakeEmitter { amplitudeTimeDecay = true, duration = 0.4f, radius = 100f, scaleShakeRadiusWithLocalScale = false, wave = new Wave { amplitude = 1f, frequency = 40f, cycleOffset = 0f } }.StartShake(); Util.PlaySound("MannTreadSquishSound", ((Component)self).gameObject); } isFalling = false; } } private void CharacterBody_OnBuffFinalStackLost(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { //IL_006c: 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_00c3: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, buffDef); if ((Object)(object)buffDef == (Object)(object)Buffs.whipBuff || (Object)(object)buffDef == (Object)(object)Buffs.conchBuff || (Object)(object)buffDef == (Object)(object)Buffs.battalionBuff || (Object)(object)buffDef == (Object)(object)Buffs.buffBannerBuff) { Util.PlaySound("SpeedDownSound", ((Component)self).gameObject); } if ((Object)(object)buffDef == (Object)(object)Buffs.deathResistActive) { NetworkingHelpers.ApplyBuff(self, Buffs.deathResistCooldown.buffIndex, 1, 30f); } if ((Object)(object)buffDef == (Object)(object)Buffs.EliteVoid && self.inventory.GetItemCount(Items.BearVoid) == 0) { NetworkingHelpers.ApplyBuff(self, Buffs.BearVoidReady.buffIndex, 0, -1f); NetworkingHelpers.ApplyBuff(self, Buffs.BearVoidCooldown.buffIndex, 0, -1f); } } private void CharacterBody_OnBuffFirstStackGained(orig_OnBuffFirstStackGained orig, CharacterBody self, BuffDef buffDef) { orig.Invoke(self, buffDef); if ((Object)(object)buffDef == (Object)(object)Buffs.whipBuff || (Object)(object)buffDef == (Object)(object)Buffs.conchBuff || (Object)(object)buffDef == (Object)(object)Buffs.battalionBuff || (Object)(object)buffDef == (Object)(object)Buffs.buffBannerBuff) { Util.PlaySound("SpeedUpSound", ((Component)self).gameObject); } } private void CharacterModel_Start(orig_Start orig, CharacterModel self) { orig.Invoke(self); if (!((Object)(object)self == (Object)null) && !((Object)(object)self.body == (Object)null) && (Object)(object)self != (Object)null && self.body.baseNameToken.Equals("LEMN_SOLDIERTF2_BODY_NAME")) { if (self.body.skillLocator.utility.skillNameToken.Equals("LEMN_SOLDIERTF2_BODY_UTILITY_CHUTE_TOGGLE_NAME")) { ((Component)self.childLocator.FindChild("BaseJumper")).gameObject.SetActive(true); } else if (self.body.skillLocator.utility.skillNameToken.Equals("LEMN_SOLDIERTF2_BODY_UTILITY_CONCH_NAME")) { ((Component)self.childLocator.FindChild("ConcherorPack")).gameObject.SetActive(true); } else if (self.body.skillLocator.utility.skillNameToken.Equals("LEMN_SOLDIERTF2_BODY_UTILITY_BATTALION_NAME")) { ((Component)self.childLocator.FindChild("BattalionPack")).gameObject.SetActive(true); } else if (self.body.skillLocator.utility.skillNameToken.Equals("LEMN_SOLDIERTF2_BODY_UTILITY_BUFFBANNER_NAME")) { ((Component)self.childLocator.FindChild("BuffPack")).gameObject.SetActive(true); } if (self.body.skillLocator.primary.skillNameToken.Equals("LEMN_SOLDIERTF2_BODY_PRIMARY_ROCKET_NAME")) { ((Component)self.childLocator.FindChild("RocketLauncher")).gameObject.SetActive(true); } else if (self.body.skillLocator.primary.skillNameToken.Equals("LEMN_SOLDIERTF2_BODY_PRIMARY_BAZOOKA_NAME")) { ((Component)self.childLocator.FindChild("BeggarsBazooka")).gameObject.SetActive(true); } else if (self.body.skillLocator.primary.skillNameToken.Equals("LEMN_SOLDIERTF2_BODY_PRIMARY_JUMPER_NAME")) { ((Component)self.childLocator.FindChild("RocketJumper")).gameObject.SetActive(true); } else if (self.body.skillLocator.primary.skillNameToken.Equals("LEMN_SOLDIERTF2_BODY_PRIMARY_AIRSTRIKE_NAME")) { ((Component)self.childLocator.FindChild("AirStrike")).gameObject.SetActive(true); } } } private void CharacterModel_Awake(orig_Awake orig, CharacterModel self) { orig.Invoke(self); if (((Object)((Component)self).gameObject).name.Contains("SoldierTF2Display")) { Util.PlaySound("MenuNoteSoldier", ((Component)self).gameObject); } } private void CharacterBody_FixedUpdate(orig_FixedUpdate orig, CharacterBody self) { //IL_004c: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!Object.op_Implicit((Object)(object)self) || !self.baseNameToken.Equals("LEMN_SOLDIERTF2_BODY_NAME")) { return; } if (self.skillLocator.secondary.skillNameToken.Equals("LEMN_SOLDIERTF2_BODY_SECONDARY_MANNTREADS_NAME")) { if (!((Enum)self.bodyFlags).HasFlag((Enum)(object)(BodyFlags)1)) { self.bodyFlags = (BodyFlags)(self.bodyFlags | 1); } if (self.characterMotor.velocity.y < -55f && !isFalling) { Util.PlaySound("MannTreadFallSound", ((Component)self).gameObject); isFalling = true; } } if (self.HasBuff(Buffs.parachuteBuff) && self.hasEffectiveAuthority) { float y = self.characterMotor.velocity.y; if (y < 0f) { y = Mathf.MoveTowards(y, -4f, 80f * Time.deltaTime); self.characterMotor.velocity = new Vector3(self.characterMotor.velocity.x, y, self.characterMotor.velocity.z); } } if (self.HasBuff(Buffs.BanditSkull) && self.skillLocator.primary.skillNameToken.Equals("LEMN_SOLDIERTF2_BODY_PRIMARY_AIRSTRIKE_NAME")) { self.skillLocator.primary.SetBonusStockFromBody(Mathf.FloorToInt((float)(self.GetBuffCount(Buffs.BanditSkull) / 6))); } } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_067d: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_05e1: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_06ae: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_06ca: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_079b: Unknown result type (might be due to invalid IL or missing references) //IL_07a1: Unknown result type (might be due to invalid IL or missing references) //IL_071b: Unknown result type (might be due to invalid IL or missing references) //IL_0720: Unknown result type (might be due to invalid IL or missing references) //IL_0723: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Unknown result type (might be due to invalid IL or missing references) //IL_0822: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0831: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Unknown result type (might be due to invalid IL or missing references) //IL_0895: Unknown result type (might be due to invalid IL or missing references) //IL_08b4: Unknown result type (might be due to invalid IL or missing references) //IL_08d3: Unknown result type (might be due to invalid IL or missing references) //IL_0951: Unknown result type (might be due to invalid IL or missing references) //IL_0957: Unknown result type (might be due to invalid IL or missing references) //IL_09f9: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Unknown result type (might be due to invalid IL or missing references) //IL_0a47: Unknown result type (might be due to invalid IL or missing references) CharacterBody val = null; if ((Object)(object)damageInfo.attacker != (Object)null) { val = damageInfo.attacker.GetComponent(); } bool flag = false; if ((Object)(object)damageInfo.attacker != (Object)null) { if ((Object)(object)val != (Object)null && val.HasBuff(Buffs.buffBannerBuff) && !flag && !damageInfo.crit) { flag = true; damageInfo.damage *= 1.5f; damageInfo.damageColorIndex = (DamageColorIndex)3; Util.PlaySound("MiniCritSound", ((Component)val).gameObject); } if ((Object)(object)val != (Object)null && val.baseNameToken.Equals("LEMN_SOLDIERTF2_BODY_NAME") && Object.op_Implicit((Object)(object)val.skillLocator) && val.skillLocator.secondary.skillNameToken.Equals("LEMN_SOLDIERTF2_BODY_SECONDARY_RESERVE_SHOOTER_NAME") && (Object)(object)self.body != (Object)null && (self.body.isFlying || (Object.op_Implicit((Object)(object)self.body.characterMotor) && !self.body.characterMotor.isGrounded)) && DamageAPI.HasModdedDamageType(damageInfo, ReserveShooterHit)) { if (!flag && !damageInfo.crit) { Debug.Log((object)("Flying: " + self.body.isFlying)); Debug.Log((object)("Not Grounded: " + (Object.op_Implicit((Object)(object)self.body.characterMotor) && !self.body.characterMotor.isGrounded))); flag = true; damageInfo.damage *= 1.5f; damageInfo.damageColorIndex = (DamageColorIndex)3; Util.PlaySound("MiniCritSound", ((Component)val).gameObject); } if (Util.CheckRoll(10f, val.master)) { damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)1024); } } if ((Object)(object)val != (Object)null && DamageAPI.HasModdedDamageType(damageInfo, ZatoichiHit)) { if (self.body.isElite) { bool flag2 = false; BuffIndex[] eliteBuffIndices = BuffCatalog.eliteBuffIndices; foreach (BuffIndex val2 in eliteBuffIndices) { if (self.body.HasBuff(val2) && val.HasBuff(val2)) { flag2 = true; } } if (flag2) { if (Util.CheckRoll(20f, val.master.luck, (CharacterMaster)null)) { damageInfo.damage = self.fullCombinedHealth; } else { damageInfo.damage *= 5f; damageInfo.crit = true; } } } if (DamageAPI.HasModdedDamageType(damageInfo, ZatoichiHit)) { float num = val.healthComponent.fullHealth - val.healthComponent.health; float num2 = val.healthComponent.fullHealth * 0.05f; float num3 = Mathf.Clamp(num2 - num, 0f, val.healthComponent.fullHealth); val.healthComponent.Heal(num2, default(ProcChainMask), true); if (num3 > 0f) { val.healthComponent.AddBarrierAuthority(num3 / 2f); } if (self.body.isElite && Util.CheckRoll(15f, val.master.luck, (CharacterMaster)null)) { BuffIndex val3 = self.body.activeBuffsList.Intersect(BuffCatalog.eliteBuffIndices).First(); if (!val.HasBuff(val3)) { NetworkingHelpers.ApplyBuff(val, val3, 1, 90f); } } } } } if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && (self.body.HasBuff(Buffs.deathResistActive) || (self.body.HasBuff(Buffs.battalionBuff) && !self.body.HasBuff(Buffs.deathResistCooldown))) && DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)1)) == 0) { damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)1); DamageAPI.AddModdedDamageType(damageInfo, DeathResistor); } if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && self.body.baseNameToken.Equals("LEMN_SOLDIERTF2_BODY_NAME") && DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2097152)) == 1) { damageInfo.damage *= 0.6f; } CharacterBody val4 = null; KillGracePeriod killGracePeriod = null; if (Object.op_Implicit((Object)(object)damageInfo.attacker)) { val4 = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)val4) && !val4.baseNameToken.Equals("LEMN_SOLDIERTF2_BODY_NAME")) { val4 = null; } } if (Object.op_Implicit((Object)(object)val4) && Config.killGracePeriod.Value > 0f) { killGracePeriod = ((Component)self).gameObject.GetComponent(); if ((Object)(object)killGracePeriod == (Object)null) { killGracePeriod = ((Component)self).gameObject.AddComponent(); } if (self.alive && DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)268435456)) == 0L && killGracePeriod.HasSkull(val4)) { damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)268435456); } } if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(Buffs.bazookaBurstDebuff) && DamageAPI.HasModdedDamageType(damageInfo, BazookaHit)) { int buffCount = self.body.GetBuffCount(Buffs.bazookaBurstDebuff); float num4 = 1.5f + 0.5f * (float)(buffCount - 1); damageInfo.damage *= num4; } orig.Invoke(self, damageInfo); if (Object.op_Implicit((Object)(object)self.body) && DamageAPI.HasModdedDamageType(damageInfo, BazookaHit)) { int buffCount2 = self.body.GetBuffCount(Buffs.bazookaBurstDebuff); NetworkingHelpers.ApplyBuff(self.body, Buffs.bazookaBurstDebuff.buffIndex, 1, 1f); } if ((Object)(object)val != (Object)null && DamageAPI.HasModdedDamageType(damageInfo, ZatoichiHit) && !self.alive) { if (self.body.isElite) { BuffIndex val5 = self.body.activeBuffsList.Intersect(BuffCatalog.eliteBuffIndices).First(); if (!val.HasBuff(val5)) { NetworkingHelpers.ApplyBuff(val, val5, 1, 90f); } } float num5 = val.healthComponent.fullHealth - val.healthComponent.health; float num6 = val.healthComponent.fullHealth * 0.4f; float num7 = Mathf.Clamp(num6 - num5, 0f, val.healthComponent.fullHealth); val.healthComponent.Heal(num6, default(ProcChainMask), true); if (num7 > 0f) { val.healthComponent.AddBarrierAuthority(num7 / 2f); } } if (Config.killGracePeriod.Value > 0f && Object.op_Implicit((Object)(object)killGracePeriod) && Object.op_Implicit((Object)(object)val4) && Object.op_Implicit((Object)(object)val4.master) && !damageInfo.rejected) { if (self.alive) { killGracePeriod.AddTimer(val4, DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)268435456))); } else { killGracePeriod.TriggerEffects(val4, self.body); } } if ((Object)(object)self.body != (Object)null && (self.body.isFlying || (Object.op_Implicit((Object)(object)self.body.characterMotor) && !self.body.characterMotor.isGrounded)) && DamageAPI.HasModdedDamageType(damageInfo, ReserveShooterHit) && !self.body.HasBuff(Buffs.DeathMark.buffIndex)) { NetworkingHelpers.ApplyBuff(self.body, Buffs.DeathMark.buffIndex, 1, 5f); } if ((Object)(object)damageInfo.attacker != (Object)null && Object.op_Implicit((Object)(object)val) && damageInfo.attacker.GetComponent().HasBuff(Buffs.conchBuff) && (Object)(object)damageInfo.attacker.GetComponent().healthComponent != (Object)(object)self) { damageInfo.attacker.GetComponent().healthComponent.Heal(damageInfo.damage * 0.2f, default(ProcChainMask), true); } if ((Object)(object)damageInfo.attacker != (Object)null && flag) { CharacterBody component = damageInfo.attacker.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.master != (Object)null) { GlobalEventManager.instance.OnCrit(component, damageInfo, component.master, damageInfo.procCoefficient, damageInfo.procChainMask); } } if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && self.combinedHealth == 1f && DamageAPI.HasModdedDamageType(damageInfo, DeathResistor) && !self.body.HasBuff(Buffs.deathResistActive) && !self.body.HasBuff(Buffs.deathResistCooldown)) { NetworkingHelpers.ApplyBuff(self.body, Buffs.deathResistActive.buffIndex, 1, 7.5f); } } private void CharacterMotor_OnLanded(orig_OnLanded orig, CharacterMotor self) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (Object.op_Implicit((Object)(object)self.body)) { if (self.body.HasBuff(Buffs.rocketJumpingBuff)) { NetworkingHelpers.ApplyBuff(self.body, Buffs.rocketJumpingBuff.buffIndex, 0, -1f); } if (self.body.HasBuff(Buffs.parachuteBuff)) { Util.PlaySound("ParachuteCloseSound", ((Component)this).gameObject); GameObject val = ((Component)self.body.modelLocator.modelTransform).gameObject.GetComponent().childLocator.FindChildGameObject("BaseJumperChute"); val.SetActive(false); NetworkingHelpers.ApplyBuff(self.body, Buffs.parachuteBuff.buffIndex, 0, -1f); } } } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015f: 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_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0176: 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_0185: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!Object.op_Implicit((Object)(object)self)) { return; } if (self.HasBuff(Buffs.conchBuff)) { self.moveSpeed *= 1.5f; } if (self.HasBuff(Buffs.rocketJumpingBuff)) { self.armor += 25f; } if (self.HasBuff(Buffs.buffBannerBuff)) { self.attackSpeed *= 1.5f; } if (self.HasBuff(Buffs.battalionBuff)) { self.armor += 200f; } if (self.HasBuff(Buffs.whipBuff)) { self.moveSpeed *= 1.5f; self.attackSpeed += 0.5f; self.crit += 30f; self.maxJumpCount += 1; self.damage *= 1.25f; } if (self.baseNameToken.Equals("LEMN_SOLDIERTF2_BODY_NAME")) { int num = 0; TeamMask val = default(TeamMask); ((TeamMask)(ref val)).AddTeam(self.master.teamIndex); List list = new SphereSearch { radius = 20f, mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = self.transform.position }.RefreshCandidates().FilterCandidatesByHurtBoxTeam(val).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes() .ToList(); foreach (HurtBox item in list) { if ((Object)(object)item.healthComponent != (Object)(object)self.healthComponent && item.healthComponent.body.HasBuff(Buffs.whipBuff)) { num++; } } NetworkingHelpers.ApplyBuff(self, Buffs.whipHeadBuff.buffIndex, num, -1f); } if (self.HasBuff(Buffs.whipHeadBuff.buffIndex)) { self.damage *= 1f + 0.25f * (float)self.GetBuffCount(Buffs.whipHeadBuff.buffIndex); } if (self.HasBuff(Buffs.parachuteBuff.buffIndex)) { self.damage *= 1.2f; self.attackSpeed *= 1.2f; } } private void PreMovementHandler(CharacterMotor self, float deltaTime) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (!self.hasEffectiveAuthority) { return; } if (!self.isGrounded || GetInfo(self).LeniencyFrame) { AirMovementHandler(self, 3f, 30f); } else { GroundMovement(self, deltaTime); } if (self.useGravity) { self.velocity.y += Physics.gravity.y * deltaTime; if (self.isGrounded) { self.velocity.y = Mathf.Max(self.velocity.y, 0f); } } GetInfo(self).LeniencyFrame = !self.isGrounded; } private void AirMovementHandler(CharacterMotor characterMotor, float maximumAirAcceleration, float airAcceleration) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_004b: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00b0: Unknown result type (might be due to invalid IL or missing references) Vector3 moveDirection = characterMotor.moveDirection; float num = (((double)((Vector3)(ref moveDirection)).sqrMagnitude > 0.0001) ? characterMotor.walkSpeed : 0f); if (num > maximumAirAcceleration) { num = maximumAirAcceleration; } Vector3 velocity = characterMotor.velocity; velocity.y = 0f; Vector3 val = velocity; moveDirection = characterMotor.moveDirection; float num2 = Vector3.Dot(val, ((Vector3)(ref moveDirection)).normalized); float num3 = num - num2; if (!(num3 <= 0f)) { float num4 = airAcceleration * num; if (num4 > num3) { num4 = num3; } Vector3 velocity2 = characterMotor.velocity; moveDirection = characterMotor.moveDirection; characterMotor.velocity = velocity2 + ((Vector3)(ref moveDirection)).normalized * num4; } } private void GroundMovement(CharacterMotor self, float deltaTime) { //IL_0009: 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_007f: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_006f: 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_007c: Unknown result type (might be due to invalid IL or missing references) float acceleration = self.acceleration; Vector3 val = self.moveDirection; if (!self.isFlying) { val.y = 0f; } CharacterBody obj = Access(self, "body"); if (obj != null && obj.isSprinting && 0f < ((Vector3)(ref val)).magnitude && ((Vector3)(ref val)).magnitude < 1f) { val /= ((Vector3)(ref val)).magnitude; } Vector3 val2 = val * self.walkSpeed; if (!self.isFlying) { val2.y = self.velocity.y; } self.velocity = Vector3.MoveTowards(self.velocity, val2, acceleration * deltaTime); } private bool IsPlayerControlled(CharacterMotor motor) { foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { object obj; if (instance == null) { obj = null; } else { CharacterMaster master = instance.master; if (master == null) { obj = null; } else { CharacterBody body = master.GetBody(); obj = ((body != null) ? body.characterMotor : null); } } if ((Object)obj == (Object)(object)motor) { return true; } } return false; } private SoldierMintTeaInfo GetInfo(CharacterMotor characterMotor) { if ((Object)(object)characterMotor == (Object)null) { return null; } if (info.TryGetValue(characterMotor, out var value)) { return value; } return info[characterMotor] = new SoldierMintTeaInfo { Motor = characterMotor, LeniencyFrame = false }; } private static CharacterMotor GetMotor(GenericCharacterMain genericCharacterMain) { return AccessProperty(genericCharacterMain, typeof(EntityState), "characterMotor"); } private T Access(object o, string field) { FieldInfo field2 = o.GetType().GetField(field, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy | BindingFlags.GetField); if (field2 == null) { ManualLogSource logger = ((BaseUnityPlugin)this).Logger; if (logger != null) { logger.LogError((object)("Unrecognized field " + field + " in class " + o.GetType().FullName)); } } return (T)field2.GetValue(o); } private static T AccessProperty(object o, Type type, string field) { PropertyInfo property = type.GetProperty(field, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetProperty); if (property == null) { } return (T)property.GetValue(o); } private void Set(object o, string field, object value) { FieldInfo field2 = o.GetType().GetField(field, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy | BindingFlags.GetField); field2.SetValue(o, value); } } internal class SoldierMintTeaInfo { public CharacterMotor Motor { get; set; } public bool LeniencyFrame { get; set; } public bool GroundedJump { get; set; } } } namespace TF2SoldierMod.SkillStates { public class AirStrike : BaseSkillState { public static float damageCoefficient = 4f; public static float procCoefficient = 1f; public static float baseDuration = 0.65f; public static float throwForce = 70f; private float duration; private float fireTime; private bool hasFired; private Animator animator; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; if (((BaseState)this).HasBuff(Buffs.rocketJumpingBuff)) { duration *= 0.4f; } fireTime = 0.1f * duration; ((EntityState)this).characterBody.SetAimTimer(2f); animator = ((EntityState)this).GetModelAnimator(); Helpers.SwapToPrimary(((EntityState)this).characterBody); animator.SetFloat("weaponIndex", 0f); Util.PlaySound("AirStrikeLaunchSound", ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("PrimaryFire, Override", "FirePrimary", "ThrowBomb.playbackRate", duration, 0f); } public override void OnExit() { ((EntityState)this).OnExit(); } private void Fire() { //IL_0028: 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_00ba: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0126: 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_016d: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) if (hasFired) { return; } hasFired = true; if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); GameObject airStrikeRocketPrefab = Projectiles.airStrikeRocketPrefab; airStrikeRocketPrefab.GetComponent().owner = ((EntityState)this).gameObject; if (!Object.op_Implicit((Object)(object)airStrikeRocketPrefab.GetComponent())) { TF2ExplosionHandler tF2ExplosionHandler = airStrikeRocketPrefab.AddComponent(); tF2ExplosionHandler.rocketDamageBase = damageCoefficient; tF2ExplosionHandler.isAirStrike = true; } int itemCount = ((EntityState)this).characterBody.inventory.GetItemCount(Items.MoreMissile); float num = 1f; if (itemCount > 1) { num += 0.5f * (float)(itemCount - 1); } ProjectileManager.instance.FireProjectile(airStrikeRocketPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 0f, 1000f, false, (DamageColorIndex)0, (GameObject)null, RocketLauncher.throwForce, (DamageTypeCombo?)null); if (itemCount > 0) { GameObject icbmAirStrikeRocketPrefab = Projectiles.icbmAirStrikeRocketPrefab; ProjectileManager.instance.FireProjectile(icbmAirStrikeRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(0f, 20f, 0f) * Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 0f, 1000f, false, (DamageColorIndex)0, (GameObject)null, RocketLauncher.throwForce, (DamageTypeCombo?)null); ProjectileManager.instance.FireProjectile(icbmAirStrikeRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(0f, -20f, 0f) * Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 0f, 1000f, false, (DamageColorIndex)0, (GameObject)null, RocketLauncher.throwForce, (DamageTypeCombo?)null); } } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= fireTime) { Fire(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { if (((EntityState)this).skillLocator.primary.stock < ((EntityState)this).skillLocator.primary.maxStock) { ((EntityState)this).outer.SetNextState((EntityState)(object)new RocketReload()); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class BeggarsBazookaChargeUp : BaseSkillState { public static float damageCoefficient = 7f; public static float procCoefficient = 1f; public static float baseDuration = 0.9f; public static float throwForce = 80f; public static float minChargeDuration = 0.2f; public bool isOverloading; private bool hasOverloaded; private float duration; private float overloadDelayMax; private static float overloadDelay = 0f; private float fireTime; private bool rocketAdded; private int maxRockets = 3; public int currentRockets; private Animator animator; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; overloadDelayMax = duration; fireTime = 0.1f * duration; ((EntityState)this).characterBody.SetAimTimer(2f); animator = ((EntityState)this).GetModelAnimator(); Helpers.SwapToPrimary(((EntityState)this).characterBody); animator.SetFloat("weaponIndex", 0f); } public override void OnExit() { ((EntityState)this).OnExit(); } private void Overload() { //IL_0051: 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_007e: 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_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_008c: 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) //IL_00ad: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00cf: 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_00d9: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_012f: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) if (!hasOverloaded) { hasOverloaded = true; if (((EntityState)this).isAuthority) { ((EntityState)this).skillLocator.primary.AddOneStock(); currentRockets--; NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.bazookaLoadBuff.buffIndex, currentRockets, -1f); Util.PlaySound("RocketExplodeSound", ((EntityState)this).gameObject); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = Vector3.Normalize(((Ray)(ref aimRay)).direction); NetworkingHelpers.DealDamage(new DamageInfo { damage = ((EntityState)this).characterBody.healthComponent.combinedHealth * 0.15f, force = -1f * val * 5700f, position = ((EntityState)this).characterBody.corePosition, damageColorIndex = (DamageColorIndex)0, crit = false, attacker = null, inflictor = null, damageType = DamageTypeCombo.op_Implicit((DamageType)262211), procCoefficient = 0f, procChainMask = default(ProcChainMask) }, ((EntityState)this).characterBody.mainHurtBox, true, false, false); NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.rocketJumpingBuff.buffIndex, 1, -1f); overloadDelay = overloadDelayMax; } } } public int CalculateRocketCount() { return Mathf.FloorToInt(((EntityState)this).fixedAge / duration + duration * 4f / 5f); } public void AddRocket() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (!rocketAdded) { ((EntityState)this).skillLocator.primary.DeductStock(1); currentRockets++; NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.bazookaLoadBuff.buffIndex, currentRockets, -1f); rocketAdded = true; } } public override void FixedUpdate() { //IL_014e: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); int num = CalculateRocketCount(); overloadDelay -= Time.deltaTime; if (((EntityState)this).isAuthority && (num > currentRockets || isOverloading)) { Helpers.SwapToPrimary(((EntityState)this).characterBody); animator.SetFloat("weaponIndex", 0f); ((EntityState)this).PlayAnimation("Reload", "soldier_model_skeleton_primary_reload", "Reload.playbackRate", duration * 2f, 0f); if ((currentRockets >= maxRockets || (isOverloading && currentRockets > 0)) && overloadDelay <= 0f) { isOverloading = true; Overload(); hasOverloaded = false; Util.PlaySound("BeggarsReloadSound", ((EntityState)this).gameObject); } else if (!isOverloading) { AddRocket(); rocketAdded = false; Util.PlaySound("BeggarsReloadSound", ((EntityState)this).gameObject); } } if (((BaseState)this).isGrounded && ((EntityState)this).characterBody.HasBuff(Buffs.rocketJumpingBuff)) { NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.rocketJumpingBuff.buffIndex, 0, -1f); } if (((EntityState)this).isAuthority && !((BaseSkillState)this).IsKeyDownAuthority()) { BeggarsBazookaFire beggarsBazookaFire = new BeggarsBazookaFire(); beggarsBazookaFire.rockets = currentRockets; ((EntityState)this).outer.SetNextState((EntityState)(object)beggarsBazookaFire); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class BeggarsBazookaFire : BaseSkillState { public static float damageCoefficient = 7f; public static float procCoefficient = 1f; public static float baseDuration = 0.65f; public static float throwForce = 70f; public int rockets; private float duration; private float rocketDelayMax = 0.3f; private static float rocketDelay = 0f; private float fireTime; private bool hasFired; private Animator animator; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; fireTime = 0.1f * duration; rocketDelayMax = 0.3f / ((BaseState)this).attackSpeedStat; ((EntityState)this).characterBody.SetAimTimer(2f); animator = ((EntityState)this).GetModelAnimator(); Helpers.SwapToPrimary(((EntityState)this).characterBody); animator.SetFloat("weaponIndex", 0f); } public override void OnExit() { ((EntityState)this).OnExit(); } private void Fire() { //IL_006e: 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_008a: 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_015e: 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_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) if (hasFired) { return; } hasFired = true; if (((EntityState)this).isAuthority) { ((EntityState)this).skillLocator.primary.AddOneStock(); ((EntityState)this).characterBody.SetSpreadBloom(3f, true); rocketDelay = rocketDelayMax; rockets--; NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.bazookaLoadBuff.buffIndex, rockets, -1f); Ray aimRay = ((BaseState)this).GetAimRay(); GameObject bazookaRocketPrefab = Projectiles.bazookaRocketPrefab; bazookaRocketPrefab.GetComponent().owner = ((EntityState)this).gameObject; if (!Object.op_Implicit((Object)(object)bazookaRocketPrefab.GetComponent())) { TF2ExplosionHandler tF2ExplosionHandler = bazookaRocketPrefab.AddComponent(); tF2ExplosionHandler.rocketDamageBase = damageCoefficient; tF2ExplosionHandler.isBazooka = true; } Helpers.SwapToPrimary(((EntityState)this).characterBody); animator.SetFloat("weaponIndex", 0f); float num = 4f; int itemCount = ((EntityState)this).characterBody.inventory.GetItemCount(Items.MoreMissile); float num2 = 1f; if (itemCount > 1) { num2 += 0.5f * (float)(itemCount - 1); } ProjectileManager.instance.FireProjectile(bazookaRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(Random.Range(0f - num, num), Random.Range(0f - num, num), 0f) * Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 0f, 1000f, false, (DamageColorIndex)0, (GameObject)null, RocketLauncher.throwForce, (DamageTypeCombo?)null); if (itemCount > 0) { GameObject icbmBazookaRocketPrefab = Projectiles.icbmBazookaRocketPrefab; ProjectileManager.instance.FireProjectile(icbmBazookaRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(Random.Range((0f - num) * 2f, num * 2f), Random.Range((0f - num) * 2f, num * 2f), 0f) * Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 0f, 1000f, false, (DamageColorIndex)0, (GameObject)null, RocketLauncher.throwForce, (DamageTypeCombo?)null); ProjectileManager.instance.FireProjectile(icbmBazookaRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(Random.Range((0f - num) * 2f, num * 2f), Random.Range((0f - num) * 2f, num * 2f), 0f) * Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 0f, 1000f, false, (DamageColorIndex)0, (GameObject)null, RocketLauncher.throwForce, (DamageTypeCombo?)null); } } Util.PlaySound("BeggarsLaunchSound", ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("PrimaryFire, Override", "FirePrimary", "ThrowBomb.playbackRate", duration, 0f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); rocketDelay -= Time.deltaTime; if (((EntityState)this).isAuthority && rocketDelay <= 0f && rockets > 0) { Fire(); hasFired = false; } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority && rockets <= 0) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class DisciplinaryAction : BaseMeleeAttack { public override void OnEnter() { //IL_001a: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_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) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) Helpers.SwapToSpecial(((EntityState)this).characterBody); hitboxName = "Shovel"; damageType = (DamageType)0; damageCoefficient = 2f; procCoefficient = 1f; pushForce = 100f; bonusForce = Vector3.zero; baseDuration = 1f; attackStartTime = 0.2f; attackEndTime = 0.4f; baseEarlyExitTime = 0.4f; hitStopDuration = 0.012f; attackRecoil = 0.5f; hitHopVelocity = 4f; swingSoundString = "WhipSwingSound"; hitSoundString = ""; muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight"); swingEffectPrefab = Assets.swordSwingEffect; hitEffectPrefab = Assets.swordHitImpactEffect; hitSoundString = "WhipHitEnemySound"; base.OnEnter(); TeamMask val = default(TeamMask); ((TeamMask)(ref val)).AddTeam(((EntityState)this).characterBody.master.teamIndex); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val2 = Vector3.Normalize(((Ray)(ref aimRay)).direction); List list = new SphereSearch { radius = 5f, mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = ((EntityState)this).transform.position + 2.5f * val2 }.RefreshCandidates().FilterCandidatesByHurtBoxTeam(val).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes() .ToList(); bool flag = false; foreach (HurtBox item in list) { if ((Object)(object)item.healthComponent != (Object)(object)((EntityState)this).healthComponent) { NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.whipBuff.buffIndex, 1, 40f); NetworkingHelpers.ApplyBuff(item.healthComponent.body, Buffs.whipBuff.buffIndex, 1, 40f); if (!flag) { flag = true; Util.PlaySound("WhipHitPlayerSound", ((Component)((EntityState)this).characterBody).gameObject); } Util.CleanseBody(item.healthComponent.body, true, false, false, true, true, false); Util.CleanseBody(((EntityState)this).characterBody, true, false, false, true, true, false); } } } protected override void PlayAttackAnimation() { base.PlayAttackAnimation(); } protected override void PlaySwingEffect() { base.PlaySwingEffect(); } protected override void OnHitEnemyAuthority() { base.OnHitEnemyAuthority(); } protected override void SetNextState() { if (swingIndex == 0) { int num = 1; } else { int num = 0; } } public override void OnExit() { base.OnExit(); } } public class ParachuteAnimController : MonoBehaviour { private bool isReady; private void Start() { if (!isReady) { InitAnims(); } } private void InitAnims() { isReady = true; } } public class Manntreads : BaseSkillState { public static float damageCoefficient = 0.65f; public static float procCoefficient = 0.5f; public static float baseDuration = 0.6f; public static float force = 50f; public static float recoil = 3f; public static float range = 256f; public static float velocityThreshold = 25f; public static float velocityMaximum = 50f; public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/TracerGoldGat"); private float duration; private float fireTime; private bool hasFired; private string muzzleString; private Animator animator; private GameObject rocketLauncherObj; private GameObject bazookaLauncherObj; private GameObject shotgunObj; private GameObject shovelObj; public void Awake() { } public void OnDestroy() { } public override void OnEnter() { ((BaseState)this).OnEnter(); } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= fireTime) { } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class MarketGardener : BaseMeleeAttack { private GameObject rocketLauncherObj; private GameObject shotgunObj; private GameObject shovelObj; private GameObject bazookaLauncherObj; private GameObject airStrikeLauncherObj; private GameObject jumperLauncherObj; public override void OnEnter() { //IL_001a: 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_0046: Unknown result type (might be due to invalid IL or missing references) Helpers.SwapToSpecial(((EntityState)this).characterBody); hitboxName = "Shovel"; damageType = (DamageType)0; damageCoefficient = 1.5f; procCoefficient = 1f; pushForce = 100f; bonusForce = Vector3.zero; baseDuration = 1f; attackStartTime = 0.2f; attackEndTime = 0.4f; baseEarlyExitTime = 0.4f; hitStopDuration = 0.012f; attackRecoil = 0.5f; hitHopVelocity = 4f; swingSoundString = "ShovelSwingSound"; hitSoundString = ""; muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight"); swingEffectPrefab = Assets.swordSwingEffect; hitEffectPrefab = Assets.swordHitImpactEffect; if (((EntityState)this).characterBody.HasBuff(Buffs.rocketJumpingBuff)) { forceCrit = true; hitSoundString = "CritSound"; damageCoefficient = 25f; } else { hitSoundString = "ShovelHitSound"; } base.OnEnter(); } protected override void PlayAttackAnimation() { base.PlayAttackAnimation(); } protected override void PlaySwingEffect() { base.PlaySwingEffect(); } protected override void OnHitEnemyAuthority() { base.OnHitEnemyAuthority(); } protected override void SetNextState() { int num = ((swingIndex == 0) ? 1 : 0); ((EntityState)this).outer.SetNextState((EntityState)(object)new MarketGardener { swingIndex = num }); } public override void OnExit() { base.OnExit(); } } internal class ParachuteToggle : BaseSkillState { public static float enterDuration = 0.2f; public static float exitDuration = 0.2f; private bool hasToggled; private float duration; private GameObject chuteObj; public override void OnEnter() { ((BaseState)this).OnEnter(); chuteObj = ((EntityState)this).GetModelChildLocator().FindChildGameObject("BaseJumperChute"); } public void Toggle() { //IL_0103: 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) if (hasToggled) { return; } hasToggled = true; if (((BaseState)this).HasBuff(Buffs.parachuteBuff)) { Util.PlaySound("ParachuteCloseSound", ((EntityState)this).gameObject); PlayAnimation(chuteObj.GetComponent(), "Retract", "Retract"); chuteObj.SetActive(false); duration = enterDuration / ((BaseState)this).attackSpeedStat; if (((EntityState)this).isAuthority) { NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.parachuteBuff.buffIndex, 0, -1f); } } else { Util.PlaySound("ParachuteOpenSound", ((EntityState)this).gameObject); chuteObj.SetActive(true); PlayAnimation(chuteObj.GetComponent(), "Deploy", "Deploy"); duration = exitDuration / ((BaseState)this).attackSpeedStat; if (((EntityState)this).isAuthority) { NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.parachuteBuff.buffIndex, 1, -1f); } } } private void PlayAnimation(Animator animator, string layerName, string animationStateName) { int layerIndex = animator.GetLayerIndex(layerName); animator.speed = 1f; animator.Update(0f); animator.PlayInFixedTime(animationStateName, layerIndex, 0f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration) { Toggle(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0017: 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_001a: Unknown result type (might be due to invalid IL or missing references) if (((BaseState)this).HasBuff(Buffs.parachuteBuff)) { return (InterruptPriority)2; } return (InterruptPriority)1; } } public class ReserveShoot : BaseSkillState { public static float damageCoefficient = 0.5f; public static float procCoefficient = 0.5f; public static float baseDuration = 0.6f; public static float force = 50f; public static float recoil = 3f; public static float range = 256f; public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/TracerGoldGat"); private float duration; private float fireTime; private bool hasFired; private string muzzleString; private Animator animator; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; fireTime = 0.2f * duration; ((EntityState)this).characterBody.SetAimTimer(2f); muzzleString = "Muzzle"; Helpers.SwapToSecondary(((EntityState)this).characterBody); animator = ((EntityState)this).GetModelAnimator(); animator.SetFloat("weaponIndex", 1f); ((EntityState)this).PlayAnimation("PrimaryFire, Override", "FireSecondary", "ShootGun.playbackRate", 1.8f, 0f); } public override void OnExit() { ((EntityState)this).OnExit(); } private void Fire() { //IL_0062: 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) //IL_009b: 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) //IL_00a8: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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) //IL_00c3: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_0111: 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_0127: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_015e: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_017c: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown //IL_01c2: Unknown result type (might be due to invalid IL or missing references) if (!hasFired) { hasFired = true; ((EntityState)this).characterBody.AddSpreadBloom(1.5f); EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); Util.PlaySound("ReserveShooterShootSound", ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); ((BaseState)this).AddRecoil(-1f * ShotgunShoot.recoil, -2f * ShotgunShoot.recoil, -0.5f * ShotgunShoot.recoil, 0.5f * ShotgunShoot.recoil); BulletAttack val = new BulletAttack { bulletCount = 9u, aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, damage = damageCoefficient * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.op_Implicit((DamageType)0), falloffModel = (FalloffModel)0, maxDistance = ShotgunShoot.range, force = ShotgunShoot.force, hitMask = CommonMasks.bullet, minSpread = 0f, maxSpread = 0.8f, isCrit = ((BaseState)this).RollCrit(), owner = ((EntityState)this).gameObject, muzzleName = muzzleString, smartCollision = false, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, radius = 0f, sniper = false, stopperMask = CommonMasks.bullet, weapon = null, tracerEffectPrefab = ShotgunShoot.tracerEffectPrefab, spreadPitchScale = 1f, spreadYawScale = 1f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = FirePistol2.hitEffectPrefab }; DamageAPI.AddModdedDamageType(val, TF2SoldierPlugin.ReserveShooterHit); val.Fire(); } } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= fireTime) { Fire(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { if (((EntityState)this).skillLocator.secondary.stock < ((EntityState)this).skillLocator.secondary.maxStock) { ((EntityState)this).outer.SetNextState((EntityState)(object)new ShotgunReload()); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class RocketJumper : BaseSkillState { public static float damageCoefficient = 0f; public static float procCoefficient = 0f; public static float baseDuration = 0.65f; public static float throwForce = 70f; private float duration; private float fireTime; private bool hasFired; private Animator animator; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = RocketLauncher.baseDuration / ((BaseState)this).attackSpeedStat; fireTime = 0.1f * duration; ((EntityState)this).characterBody.SetAimTimer(2f); animator = ((EntityState)this).GetModelAnimator(); Helpers.SwapToPrimary(((EntityState)this).characterBody); animator.SetFloat("weaponIndex", 0f); Util.PlaySound("RocketJumperLaunchSound", ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("PrimaryFire, Override", "FirePrimary", "ThrowBomb.playbackRate", duration, 0f); } public override void OnExit() { ((EntityState)this).OnExit(); } private void Fire() { //IL_0028: 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_006a: 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_0076: Unknown result type (might be due to invalid IL or missing references) if (hasFired) { return; } hasFired = true; if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); GameObject rocketJumperPrefab = Projectiles.rocketJumperPrefab; rocketJumperPrefab.GetComponent().owner = ((EntityState)this).gameObject; if (!Object.op_Implicit((Object)(object)rocketJumperPrefab.GetComponent())) { rocketJumperPrefab.AddComponent(); } ProjectileManager.instance.FireProjectile(rocketJumperPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, RocketLauncher.throwForce, (DamageTypeCombo?)null); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= fireTime) { Fire(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { if (((EntityState)this).skillLocator.primary.stock < ((EntityState)this).skillLocator.primary.maxStock) { ((EntityState)this).outer.SetNextState((EntityState)(object)new RocketReload()); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } [RequireComponent(typeof(ProjectileController))] public class TF2JumperExplosionHandler : MonoBehaviour, IProjectileImpactBehavior { private ProjectileController projectileController; private float explodeRadius; private bool hasDetonated; protected virtual void Awake() { projectileController = ((Component)this).GetComponent(); explodeRadius = ((ProjectileExplosion)((Component)this).GetComponent()).blastRadius; hasDetonated = false; } public void OnProjectileImpact(ProjectileImpactInfo impactInfo) { if (!hasDetonated) { hasDetonated = true; Detonate(); } } public void Detonate() { DetonateServer(); } protected void DetonateServer() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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) //IL_0053: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00ad: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: 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_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Expected O, but got Unknown //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = projectileController.owner.GetComponent(); TeamMask val = default(TeamMask); ((TeamMask)(ref val)).AddTeam(projectileController.teamFilter.teamIndex); List list = new SphereSearch { radius = explodeRadius, mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = ((Component)this).transform.position }.RefreshCandidates().FilterCandidatesByHurtBoxTeam(val).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes() .ToList(); Vector3 val3 = default(Vector3); foreach (HurtBox item in list) { Vector3 corePosition = component.corePosition; Vector3 position = ((Component)this).transform.position; Vector3 val2 = corePosition - position; if (!(((Vector3)(ref val2)).magnitude < explodeRadius) || !((Object)(object)item.healthComponent.body == (Object)(object)component)) { continue; } Vector3 normalized = ((Vector3)(ref val2)).normalized; ((Vector3)(ref val3))..ctor(6100f, 6100f, 6100f); Vector3 val4 = Vector3.Scale(normalized, val3) * Mathf.Min(1f / Vector3.Distance(corePosition, position), 1f); CharacterMotor characterMotor = component.characterMotor; ((BaseCharacterController)characterMotor).Motor.ForceUnground(0.1f); bool isGrounded = characterMotor.isGrounded; float num = 0.5f; if (!isGrounded) { num = 1.5f; } NetworkingHelpers.ApplyBuff(component, Buffs.rocketJumpingBuff.buffIndex, 1, -1f); NetworkingHelpers.DealDamage(new DamageInfo { damage = component.healthComponent.combinedHealth * 0f, force = Vector3.zero, position = component.corePosition, damageColorIndex = (DamageColorIndex)0, crit = false, attacker = null, inflictor = null, damageType = DamageTypeCombo.op_Implicit((DamageType)262146), procCoefficient = 0f, procChainMask = default(ProcChainMask) }, component.mainHurtBox, true, false, false); Vector3 val5 = val4 * num; float num2 = 4500f; if (Mathf.Abs(val5.x) > num2) { if (val5.x < 0f) { val5.x = 0f - num2; } else { val5.x = num2; } } if (Mathf.Abs(val5.y) > num2) { if (val5.y < 0f) { val5.y = 0f - num2; } else { val5.y = num2; } } if (Mathf.Abs(val5.z) > num2) { if (val5.z < 0f) { val5.z = 0f - num2; } else { val5.z = num2; } } component.characterMotor.ApplyForce(val5, false, false); } } } public class RocketLauncher : BaseSkillState { public static float damageCoefficient = 6f; public static float procCoefficient = 1f; public static float baseDuration = 0.65f; public static float throwForce = 70f; private float duration; private float fireTime; private bool hasFired; private Animator animator; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; fireTime = 0.1f * duration; ((EntityState)this).characterBody.SetAimTimer(2f); animator = ((EntityState)this).GetModelAnimator(); Helpers.SwapToPrimary(((EntityState)this).characterBody); animator.SetFloat("weaponIndex", 0f); Util.PlaySound("RocketSound", ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("PrimaryFire, Override", "FirePrimary", "ThrowBomb.playbackRate", duration, 0f); } public override void OnExit() { ((EntityState)this).OnExit(); } private void Fire() { //IL_0028: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_00ee: 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) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_015c: 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_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) if (hasFired) { return; } hasFired = true; if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); GameObject rocketPrefab = Projectiles.rocketPrefab; rocketPrefab.GetComponent().owner = ((EntityState)this).gameObject; if (!Object.op_Implicit((Object)(object)rocketPrefab.GetComponent())) { TF2ExplosionHandler tF2ExplosionHandler = rocketPrefab.AddComponent(); tF2ExplosionHandler.rocketDamageBase = damageCoefficient; } int itemCount = ((EntityState)this).characterBody.inventory.GetItemCount(Items.MoreMissile); float num = 1f; if (itemCount > 1) { num += 0.5f * (float)(itemCount - 1); } DamageTypeCombo value = DamageTypeCombo.op_Implicit((DamageType)0); value.damageSource = (DamageSource)1; ProjectileDamage component = rocketPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { value = component.damageType; } ProjectileManager.instance.FireProjectile(rocketPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 0f, 1000f, false, (DamageColorIndex)0, (GameObject)null, throwForce, (DamageTypeCombo?)value); if (itemCount > 0) { GameObject icbmRocketPrefab = Projectiles.icbmRocketPrefab; ProjectileManager.instance.FireProjectile(icbmRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(0f, 20f, 0f) * Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 0f, 1000f, false, (DamageColorIndex)0, (GameObject)null, throwForce, (DamageTypeCombo?)value); ProjectileManager.instance.FireProjectile(icbmRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(0f, -20f, 0f) * Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 0f, 1000f, false, (DamageColorIndex)0, (GameObject)null, throwForce, (DamageTypeCombo?)value); } } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= fireTime) { Fire(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { if (((EntityState)this).skillLocator.primary.stock < ((EntityState)this).skillLocator.primary.maxStock) { ((EntityState)this).outer.SetNextState((EntityState)(object)new RocketReload()); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } [RequireComponent(typeof(ProjectileController))] public class TF2ExplosionHandler : MonoBehaviour, IProjectileImpactBehavior { public float selfDamage = 0.35f; private ProjectileController projectileController; private float explodeRadius; private bool hasDetonated; public float rocketDamageBase; public bool isBazooka = false; public bool isAirStrike = false; protected virtual void Awake() { projectileController = ((Component)this).GetComponent(); explodeRadius = ((ProjectileExplosion)((Component)this).GetComponent()).blastRadius; } public void OnProjectileImpact(ProjectileImpactInfo impactInfo) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (!hasDetonated) { hasDetonated = true; Detonate(impactInfo.collider); } } public void Detonate(Collider c) { DetonateServer(c); } protected void DetonateServer(Collider collision) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0054: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00c1: 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_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: 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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: 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_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Expected O, but got Unknown //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_05ea: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Expected O, but got Unknown //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Expected O, but got Unknown //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_062b: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = projectileController.owner.GetComponent(); TeamMask val = default(TeamMask); ((TeamMask)(ref val)).AddTeam(projectileController.teamFilter.teamIndex); TeamMask val2 = TeamMask.AllExcept(component.teamComponent.teamIndex); List list = new SphereSearch { radius = explodeRadius, mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = ((Component)this).transform.position }.RefreshCandidates().FilterCandidatesByHurtBoxTeam(val).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes() .ToList(); Vector3 val4 = default(Vector3); foreach (HurtBox item in list) { Vector3 corePosition = component.corePosition; Vector3 position = ((Component)this).transform.position; Vector3 val3 = corePosition - position; if (!(((Vector3)(ref val3)).magnitude < explodeRadius) || !((Object)(object)item.healthComponent.body == (Object)(object)component)) { continue; } Vector3 normalized = ((Vector3)(ref val3)).normalized; ((Vector3)(ref val4))..ctor(6100f, 6100f, 6100f); Vector3 val5 = Vector3.Scale(normalized, val4) * Mathf.Min(1f / Vector3.Distance(corePosition, position), 1f); CharacterMotor characterMotor = component.characterMotor; ((BaseCharacterController)characterMotor).Motor.ForceUnground(0.1f); bool isGrounded = characterMotor.isGrounded; float num = 0.5f; if (!isGrounded) { num = 1.5f; } NetworkingHelpers.ApplyBuff(component, Buffs.rocketJumpingBuff.buffIndex, 1, -1f); float damage = Mathf.Lerp(component.healthComponent.combinedHealth * selfDamage, 0f, Mathf.InverseLerp(0f, explodeRadius, Mathf.Clamp(((Vector3)(ref val3)).magnitude, 0f, explodeRadius))); NetworkingHelpers.DealDamage(new DamageInfo { damage = damage, force = Vector3.zero, position = component.corePosition, damageColorIndex = (DamageColorIndex)0, crit = false, attacker = null, inflictor = null, damageType = DamageTypeCombo.op_Implicit((DamageType)262147), procCoefficient = 0f, procChainMask = default(ProcChainMask) }, component.mainHurtBox, true, false, false); Vector3 val6 = val5 * num; float num2 = 4500f; if (Mathf.Abs(val6.x) > num2) { if (val6.x < 0f) { val6.x = 0f - num2; } else { val6.x = num2; } } if (Mathf.Abs(val6.y) > num2) { if (val6.y < 0f) { val6.y = 0f - num2; } else { val6.y = num2; } } if (Mathf.Abs(val6.z) > num2) { if (val6.z < 0f) { val6.z = 0f - num2; } else { val6.z = num2; } } component.characterMotor.ApplyForce(val6, false, false); } List list2 = new SphereSearch { radius = explodeRadius, mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = ((Component)this).transform.position }.RefreshCandidates().FilterCandidatesByHurtBoxTeam(val2).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes() .ToList(); DamageTypeCombo damageType = DamageTypeCombo.op_Implicit((DamageType)0); damageType.damageSource = (DamageSource)1; bool crit = component.RollCrit(); int itemCount = component.inventory.GetItemCount(Items.MoreMissile); float num3 = 1f; if (itemCount > 1) { num3 += 0.5f * (float)(itemCount - 1); } float num4 = rocketDamageBase * component.damage * num3; HurtBox val7 = null; if (Object.op_Implicit((Object)(object)collision) && Object.op_Implicit((Object)(object)((Component)collision).gameObject) && Object.op_Implicit((Object)(object)((Component)collision).gameObject.GetComponent())) { val7 = ((Component)collision).gameObject.GetComponent(); } foreach (HurtBox item2 in list2) { Vector3 corePosition2 = item2.healthComponent.body.corePosition; Vector3 position2 = ((Component)this).transform.position; Vector3 val8 = corePosition2 - position2; if ((Object)(object)val7 != (Object)null && (Object)(object)val7.healthComponent.body == (Object)(object)item2.healthComponent.body) { DamageInfo val9 = new DamageInfo { damage = num4, damageType = damageType, procCoefficient = 1f, procChainMask = default(ProcChainMask), crit = crit, inflictor = ((Component)this).gameObject, attacker = ((Component)component).gameObject, position = corePosition2 }; if (isBazooka) { DamageAPI.AddModdedDamageType(val9, TF2SoldierPlugin.BazookaHit); } if (isAirStrike) { val9.damageType |= DamageTypeCombo.op_Implicit((DamageType)268435456); } NetworkingHelpers.DealDamage(val9, item2, true, true, false); } else { DamageInfo val10 = new DamageInfo { damage = Mathf.Lerp(num4, num4 * 0.6f, Mathf.InverseLerp(0f, explodeRadius, Mathf.Clamp(((Vector3)(ref val8)).magnitude, 0f, explodeRadius))), damageType = damageType, procCoefficient = 1f, procChainMask = default(ProcChainMask), crit = crit, inflictor = ((Component)this).gameObject, attacker = ((Component)component).gameObject, position = corePosition2 }; if (isBazooka) { DamageAPI.AddModdedDamageType(val10, TF2SoldierPlugin.BazookaHit); } if (isAirStrike) { val10.damageType |= DamageTypeCombo.op_Implicit((DamageType)268435456); } NetworkingHelpers.DealDamage(val10, item2, true, true, false); } } } } public class ShotgunShoot : BaseSkillState { public static float damageCoefficient = 0.65f; public static float procCoefficient = 0.5f; public static float baseDuration = 0.6f; public static float force = 50f; public static float recoil = 3f; public static float range = 256f; public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/TracerGoldGat"); private float duration; private float fireTime; private bool hasFired; private string muzzleString; private Animator animator; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; fireTime = 0.2f * duration; ((EntityState)this).characterBody.SetAimTimer(2f); muzzleString = "Muzzle"; Helpers.SwapToSecondary(((EntityState)this).characterBody); animator = ((EntityState)this).GetModelAnimator(); animator.SetFloat("weaponIndex", 1f); ((EntityState)this).PlayAnimation("PrimaryFire, Override", "FireSecondary", "ShootGun.playbackRate", 1.8f, 0f); } public override void OnExit() { ((EntityState)this).OnExit(); } private void Fire() { //IL_0062: 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) //IL_009b: 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) //IL_00a8: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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) //IL_00c3: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_0111: 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_0127: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_015e: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_017c: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown if (!hasFired) { hasFired = true; ((EntityState)this).characterBody.AddSpreadBloom(1.5f); EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); Util.PlaySound("ShotgunShootSound", ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); ((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil); BulletAttack val = new BulletAttack { bulletCount = 9u, aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, damage = damageCoefficient * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.op_Implicit((DamageType)0), falloffModel = (FalloffModel)1, maxDistance = range, force = force, hitMask = CommonMasks.bullet, minSpread = 0f, maxSpread = 2f, isCrit = ((BaseState)this).RollCrit(), owner = ((EntityState)this).gameObject, muzzleName = muzzleString, smartCollision = false, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, radius = 0f, sniper = false, stopperMask = CommonMasks.bullet, weapon = null, tracerEffectPrefab = tracerEffectPrefab, spreadPitchScale = 1f, spreadYawScale = 1f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = FirePistol2.hitEffectPrefab }; val.Fire(); } } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= fireTime) { Fire(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { if (((EntityState)this).skillLocator.secondary.stock < ((EntityState)this).skillLocator.secondary.maxStock) { ((EntityState)this).outer.SetNextState((EntityState)(object)new ShotgunReload()); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class Zatoichi : BaseMeleeAttack { public override void OnEnter() { //IL_001a: 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_004d: Unknown result type (might be due to invalid IL or missing references) Helpers.SwapToSpecial(((EntityState)this).characterBody); hitboxName = "Katana"; damageType = (DamageType)0; isKatana = true; damageCoefficient = 5f; procCoefficient = 1f; pushForce = 100f; bonusForce = Vector3.zero; baseDuration = 1f; attackStartTime = 0.2f; attackEndTime = 0.4f; baseEarlyExitTime = 0.4f; hitStopDuration = 0.012f; attackRecoil = 0.5f; hitHopVelocity = 4f; swingSoundString = "KatanaSwingSound"; hitSoundString = "KatanaHitSound"; muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight"); base.OnEnter(); } protected override void PlayAttackAnimation() { base.PlayAttackAnimation(); } protected override void PlaySwingEffect() { base.PlaySwingEffect(); } protected override void OnHitEnemyAuthority() { base.OnHitEnemyAuthority(); } protected override void SetNextState() { int num = ((swingIndex == 0) ? 1 : 0); ((EntityState)this).outer.SetNextState((EntityState)(object)new MarketGardener { swingIndex = num }); } public override void OnExit() { base.OnExit(); } } } namespace TF2SoldierMod.SkillStates.TF2Soldier.ReloadStates { public class RocketReload : BaseState { private bool hasGivenStock; private Animator animator; private float duration => 0.85f / base.attackSpeedStat; public override void OnEnter() { ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); if (animator.GetFloat("weaponIndex") == 0f) { ((EntityState)this).PlayAnimation("Reload", "soldier_model_skeleton_primary_reload", "Reload.playbackRate", duration * 2f, 0f); } } private void GiveStock() { if (!hasGivenStock) { ((EntityState)this).skillLocator.primary.AddOneStock(); hasGivenStock = true; Util.PlaySound("RocketReload", ((EntityState)this).gameObject); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration / 2f) { GiveStock(); } if (((EntityState)this).isAuthority && !(((EntityState)this).fixedAge < duration)) { if (((EntityState)this).skillLocator.primary.stock < ((EntityState)this).skillLocator.primary.maxStock) { ((EntityState)this).outer.SetNextState((EntityState)(object)new RocketReload()); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class ShotgunReload : BaseState { private bool hasGivenStock; private Animator animator; private bool isDone; private float duration => 0.6f / base.attackSpeedStat; public override void OnEnter() { ((BaseState)this).OnEnter(); isDone = false; animator = ((EntityState)this).GetModelAnimator(); if (animator.GetFloat("weaponIndex") == 1f) { ((EntityState)this).PlayAnimation("Reload", "soldier_model_skeleton_secondary_reload", "Reload.playbackRate", duration * 2f, 0f); } } private void GiveStock() { if (!hasGivenStock) { ((EntityState)this).skillLocator.secondary.AddOneStock(); hasGivenStock = true; Util.PlaySound("ShotgunReload", ((EntityState)this).gameObject); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration) { GiveStock(); } if (((EntityState)this).isAuthority && !(((EntityState)this).fixedAge < duration)) { if (((EntityState)this).skillLocator.secondary.stock < ((EntityState)this).skillLocator.secondary.maxStock) { ((EntityState)this).outer.SetNextState((EntityState)(object)new ShotgunReload()); return; } isDone = true; ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); if (isDone) { Util.PlaySound("ShotgunCockSound", ((EntityState)this).gameObject); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } } namespace TF2SoldierMod.SkillStates.BaseStates { public class BaseDeployBanner : BaseSkillState { public static float duration = 2f; public static float BannerBuffDuration = 15f; public static float initialSpeedCoefficient = 5f; public static float finalSpeedCoefficient = 2.5f; private Animator animator; public GameObject soldierBannerPrefab; public BuffDef soldierBuff; public string hornSoundString; public override void OnEnter() { ((BaseState)this).OnEnter(); Helpers.SwapToUtility(((EntityState)this).characterBody); animator = ((EntityState)this).GetModelAnimator(); animator.SetFloat("weaponIndex", 0f); ((EntityState)this).PlayAnimation("FullBody, Override", "Roll", "Roll.playbackRate", duration, 0f); Util.PlaySound(hornSoundString, ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = -1f; } ((EntityState)this).OnExit(); ((EntityState)this).characterMotor.disableAirControlUntilCollision = false; Helpers.SwapToPrimary(((EntityState)this).characterBody); soldierBannerPrefab.transform.SetParent(((EntityState)this).transform, false); soldierBannerPrefab.transform.position = ((EntityState)this).transform.position; soldierBannerPrefab.AddComponent().duration = BannerBuffDuration; Util.PlaySound("BannerFlagSound", ((EntityState)this).gameObject); BuffWard val = soldierBannerPrefab.GetComponent(); if ((Object)(object)val == (Object)null) { val = soldierBannerPrefab.AddComponent(); } GameObject gameObject = ((Component)soldierBannerPrefab.transform.Find("mdlWarbanner")).gameObject; gameObject.SetActive(false); val.floorWard = false; val.buffDef = soldierBuff; val.buffDuration = 3f; TeamFilter val2 = new TeamFilter(); val2.teamIndex = ((EntityState)this).characterBody.teamComponent.teamIndex; val.teamFilter = val2; val.Networkradius = 30f; val.radius = 30f; val.expireDuration = BannerBuffDuration; val.expires = true; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class BaseMeleeAttack : BaseSkillState { public int swingIndex; protected string hitboxName = "Shovel"; protected DamageType damageType = (DamageType)0; protected bool isKatana; protected float damageCoefficient = 3.5f; protected float procCoefficient = 1f; protected float pushForce = 300f; protected Vector3 bonusForce = Vector3.zero; protected float baseDuration = 1f; protected float attackStartTime = 0.2f; protected float attackEndTime = 0.4f; protected float baseEarlyExitTime = 0.4f; protected float hitStopDuration = 0.012f; protected float attackRecoil = 0.75f; protected float hitHopVelocity = 4f; protected bool cancelled = false; protected string swingSoundString = ""; protected string hitSoundString = ""; protected string muzzleString = "SwingCenter"; protected GameObject swingEffectPrefab; protected GameObject hitEffectPrefab; protected NetworkSoundEventIndex impactSound; private float earlyExitTime; public float duration; private bool hasFired; private float hitPauseTimer; private OverlapAttack attack; protected bool inHitPause; private bool hasHopped; protected float stopwatch; protected Animator animator; private HitStopCachedState hitStopCachedState; private Vector3 storedVelocity; protected bool forceCrit = false; public override void OnEnter() { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; earlyExitTime = baseEarlyExitTime / ((BaseState)this).attackSpeedStat; hasFired = false; animator = ((EntityState)this).GetModelAnimator(); ((BaseState)this).StartAimMode(0.5f + duration, false); ((EntityState)this).characterBody.outOfCombatStopwatch = 0f; animator.SetBool("attacking", true); animator.SetFloat("weaponIndex", 2f); HitBoxGroup hitBoxGroup = null; Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents(), (HitBoxGroup element) => element.groupName == hitboxName); } PlayAttackAnimation(); attack = new OverlapAttack(); attack.damageType = DamageTypeCombo.op_Implicit(damageType); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.procCoefficient = procCoefficient; attack.hitEffectPrefab = hitEffectPrefab; attack.forceVector = bonusForce; attack.pushAwayForce = pushForce; attack.hitBoxGroup = hitBoxGroup; if (isKatana) { DamageAPI.AddModdedDamageType(attack, TF2SoldierPlugin.ZatoichiHit); } if (forceCrit) { attack.isCrit = true; } else { attack.isCrit = ((BaseState)this).RollCrit(); } attack.impactSound = impactSound; } protected virtual void PlayAttackAnimation() { ((EntityState)this).PlayCrossfade("PrimaryFire, Override", "FireMelee", "Slash.playbackRate", duration, 0.05f); } public override void OnExit() { ((EntityState)this).OnExit(); } protected virtual void PlaySwingEffect() { EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, true); } protected virtual void OnHitEnemyAuthority() { //IL_007d: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound(hitSoundString, ((EntityState)this).gameObject); if (!hasHopped) { if (!Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) || ((EntityState)this).characterMotor.isGrounded || hitHopVelocity > 0f) { } hasHopped = true; } if (!inHitPause && hitStopDuration > 0f) { storedVelocity = ((EntityState)this).characterMotor.velocity; hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Slash.playbackRate"); hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat; inHitPause = true; } } private void FireAttack() { if (!hasFired) { hasFired = true; Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); if (((EntityState)this).isAuthority) { PlaySwingEffect(); ((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil); } } if (((EntityState)this).isAuthority && attack.Fire((List)null)) { OnHitEnemyAuthority(); } } protected virtual void SetNextState() { int num = ((swingIndex == 0) ? 1 : 0); ((EntityState)this).outer.SetNextState((EntityState)(object)new BaseMeleeAttack { swingIndex = num }); } public override void FixedUpdate() { //IL_0037: 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_0061: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); hitPauseTimer -= Time.fixedDeltaTime; if (hitPauseTimer <= 0f && inHitPause) { ((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator); inHitPause = false; ((EntityState)this).characterMotor.velocity = storedVelocity; } if (!inHitPause) { stopwatch += Time.fixedDeltaTime; } else if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat("Swing.playbackRate", 0f); } if (stopwatch >= duration * attackStartTime && stopwatch <= duration * attackEndTime) { FireAttack(); } if (stopwatch >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(swingIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); swingIndex = reader.ReadInt32(); } } } namespace TF2SoldierMod.SkillStates.Banners { public class DeployBattalionBanner : BaseDeployBanner { public override void OnEnter() { soldierBannerPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/WarbannerWard"), "SoldierDefenseBannerBuffWard"); hornSoundString = "BattalionsBluSound"; soldierBuff = Buffs.battalionBuff; base.OnEnter(); } } public class DeployBuffBanner : BaseDeployBanner { public override void OnEnter() { soldierBannerPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/WarbannerWard"), "SoldierCritBannerBuffWard"); hornSoundString = "BuffBannerBluSound"; soldierBuff = Buffs.buffBannerBuff; base.OnEnter(); } } public class DeployConchBanner : BaseDeployBanner { public override void OnEnter() { soldierBannerPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/WarbannerWard"), "SoldierHealingBannerBuffWard"); hornSoundString = "HornUseSound"; soldierBuff = Buffs.conchBuff; base.OnEnter(); } } } namespace TF2SoldierMod.Modules { internal static class Assets { internal static AssetBundle mainAssetBundle; internal static GameObject swordSwingEffect; internal static GameObject swordHitImpactEffect; internal static GameObject conchBuffEffect; internal static GameObject critBuffEffect; internal static GameObject battalionBuffEffect; internal static GameObject whipBuffEffect; internal static GameObject rocketExplosionEffect; internal static GameObject rocketJumperExplosionEffect; internal static GameObject airStrikeExplosionEffect; internal static NetworkSoundEventDef swordHitSoundEvent; internal static List networkSoundEventDefs = new List(); internal static List effectDefs = new List(); internal static Shader hotpoo = LegacyResourcesAPI.Load("Shaders/Deferred/HGStandard"); internal static Material commandoMat; private static string[] assetNames = new string[0]; private const string assetbundleName = "soldierassets"; internal static void Initialize() { bool flag = false; LoadAssetBundle(); LoadSoundbank(); PopulateAssets(); } internal static void LoadAssetBundle() { if ((Object)(object)mainAssetBundle == (Object)null) { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TF2SoldierMod.soldierassets"); mainAssetBundle = AssetBundle.LoadFromStream(stream); } assetNames = mainAssetBundle.GetAllAssetNames(); } internal static void LoadSoundbank() { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TF2SoldierMod.TF2SoldierModSFX.bnk"); byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); SoundBanks.Add(array); } internal static void PopulateAssets() { //IL_0108: 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_0133: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)mainAssetBundle)) { Debug.LogError((object)"There is no AssetBundle to load assets from."); return; } conchBuffEffect = LoadEffect("ConchBuffParticle"); conchBuffEffect.AddComponent(); critBuffEffect = LoadEffect("CritBuffParticle"); critBuffEffect.AddComponent(); battalionBuffEffect = LoadEffect("BattalionBuffParticle"); battalionBuffEffect.AddComponent(); whipBuffEffect = LoadEffect("WhipBuffParticle"); whipBuffEffect.AddComponent(); rocketExplosionEffect = LoadEffect("RocketExplosionEffect", "RocketExplodeSound"); rocketJumperExplosionEffect = LoadEffect("RocketJumperExplosionEffect", "RocketJumperExplodeSound"); airStrikeExplosionEffect = LoadEffect("AirStrikeExplosionEffect", "RocketExplodeSound"); if (Object.op_Implicit((Object)(object)rocketExplosionEffect)) { ShakeEmitter val = rocketExplosionEffect.AddComponent(); val.amplitudeTimeDecay = true; val.duration = 0f; val.radius = 50f; val.scaleShakeRadiusWithLocalScale = false; val.wave = new Wave { amplitude = 1f, frequency = 40f, cycleOffset = 0f }; } } private static GameObject CreateTracer(string originalTracerName, string newTracerName) { if ((Object)(object)LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/" + originalTracerName) == (Object)null) { return null; } GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/" + originalTracerName), newTracerName, true); if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } val.GetComponent().speed = 250f; val.GetComponent().length = 50f; AddNewEffectDef(val); return val; } internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef val = ScriptableObject.CreateInstance(); networkSoundEventDefs.Add(val); return val; } internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert) { if (!Object.op_Implicit((Object)(object)objectToConvert)) { return; } MeshRenderer[] componentsInChildren = objectToConvert.GetComponentsInChildren(); foreach (MeshRenderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Renderer)val).material)) { ((Renderer)val).material.shader = hotpoo; } } SkinnedMeshRenderer[] componentsInChildren2 = objectToConvert.GetComponentsInChildren(); foreach (SkinnedMeshRenderer val2 in componentsInChildren2) { if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Renderer)val2).material)) { ((Renderer)val2).material.shader = hotpoo; } } } internal static RendererInfo[] SetupRendererInfos(GameObject obj) { //IL_001a: 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_0049: 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) MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren(); RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[componentsInChildren.Length]; for (int i = 0; i < componentsInChildren.Length; i++) { array[i] = new RendererInfo { defaultMaterial = ((Renderer)componentsInChildren[i]).material, renderer = (Renderer)(object)componentsInChildren[i], defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }; } return array; } internal static Texture LoadCharacterIcon(string characterName) { return mainAssetBundle.LoadAsset("tex" + characterName + "Icon"); } internal static GameObject LoadCrosshair(string crosshairName) { if ((Object)(object)LegacyResourcesAPI.Load("Prefabs/Crosshair/" + crosshairName + "Crosshair") == (Object)null) { return LegacyResourcesAPI.Load("Prefabs/Crosshair/StandardCrosshair"); } return LegacyResourcesAPI.Load("Prefabs/Crosshair/" + crosshairName + "Crosshair"); } private static GameObject LoadEffect(string resourceName) { return LoadEffect(resourceName, "", parentToTransform: false); } private static GameObject LoadEffect(string resourceName, string soundName) { return LoadEffect(resourceName, soundName, parentToTransform: false); } private static GameObject LoadEffect(string resourceName, bool parentToTransform) { return LoadEffect(resourceName, "", parentToTransform); } private static GameObject LoadEffect(string resourceName, string soundName, bool parentToTransform) { //IL_0091: 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) bool flag = false; for (int i = 0; i < assetNames.Length; i++) { if (assetNames[i].Contains(resourceName.ToLower())) { flag = true; i = assetNames.Length; } } if (!flag) { Debug.LogError((object)("Failed to load effect: " + resourceName + " because it does not exist in the AssetBundle")); return null; } GameObject val = mainAssetBundle.LoadAsset(resourceName); val.AddComponent().duration = 12f; val.AddComponent(); val.AddComponent().vfxPriority = (VFXPriority)2; EffectComponent val2 = val.AddComponent(); val2.applyScale = false; val2.effectIndex = (EffectIndex)(-1); val2.parentToReferencedTransform = parentToTransform; val2.positionAtReferencedTransform = true; val2.soundName = soundName; AddNewEffectDef(val, soundName); return val; } private static void AddNewEffectDef(GameObject effectPrefab) { AddNewEffectDef(effectPrefab, ""); } private static void AddNewEffectDef(GameObject effectPrefab, string soundName) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown EffectDef val = new EffectDef(); val.prefab = effectPrefab; val.prefabEffectComponent = effectPrefab.GetComponent(); val.prefabName = ((Object)effectPrefab).name; val.prefabVfxAttributes = effectPrefab.GetComponent(); val.spawnSoundEventName = soundName; effectDefs.Add(val); } public static Material CreateMaterial(string materialName, float emission, Color emissionColor, float normalStrength) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)commandoMat)) { commandoMat = LegacyResourcesAPI.Load("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren().baseRendererInfos[0].defaultMaterial; } Material val = Object.Instantiate(commandoMat); Material val2 = mainAssetBundle.LoadAsset(materialName); if (!Object.op_Implicit((Object)(object)val2)) { Debug.LogError((object)("Failed to load material: " + materialName + " - Check to see that the name in your Unity project matches the one in this code")); return commandoMat; } ((Object)val).name = materialName; val.SetColor("_Color", val2.GetColor("_Color")); val.SetTexture("_MainTex", val2.GetTexture("_MainTex")); val.SetColor("_EmColor", emissionColor); val.SetFloat("_EmPower", emission); val.SetTexture("_EmTex", val2.GetTexture("_EmissionMap")); val.SetFloat("_NormalStrength", normalStrength); return val; } public static Material CreateMaterial(string materialName) { return CreateMaterial(materialName, 0f); } public static Material CreateMaterial(string materialName, float emission) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return CreateMaterial(materialName, emission, Color.white); } public static Material CreateMaterial(string materialName, float emission, Color emissionColor) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return CreateMaterial(materialName, emission, emissionColor, 0f); } } internal static class Banners { internal static GameObject conchBuffBanner; internal static GameObject critBuffBanner; internal static GameObject battalionBuffBanner; internal static void RegisterBanners() { CreateConchBanner(); CreateCritBanner(); CreateBattalionBanner(); AddBanner(conchBuffBanner); AddBanner(critBuffBanner); AddBanner(battalionBuffBanner); } private static void CreateConchBanner() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown conchBuffBanner = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/WarbannerWard"), "conchBuffWard", true); BuffWard component = conchBuffBanner.GetComponent(); if ((Object)(object)component != (Object)null) { component.interval = 0.5f; component.floorWard = false; component.buffDef = Buffs.conchBuff; component.buffDuration = 3f; TeamFilter val = new TeamFilter(); val.teamIndex = (TeamIndex)1; component.teamFilter = val; component.Networkradius = 20f; component.radius = 20f; component.expireDuration = 15f; component.expires = true; } } private static void CreateCritBanner() { critBuffBanner = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/WarbannerWard"), "buffBannerBuffWard", true); BuffWard component = critBuffBanner.GetComponent(); if ((Object)(object)component != (Object)null) { component.radius = 20f; component.interval = 0.25f; component.buffDef = Buffs.buffBannerBuff; component.buffDuration = 3f; component.floorWard = false; component.expires = true; component.invertTeamFilter = false; component.expireDuration = 15f; component.animateRadius = false; } } private static void CreateBattalionBanner() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown battalionBuffBanner = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/WarbannerWard"), "battlionBuffWard", true); BuffWard component = battalionBuffBanner.GetComponent(); if ((Object)(object)component != (Object)null) { component.interval = 0.5f; component.floorWard = false; component.buffDef = Buffs.battalionBuff; component.buffDuration = 3f; TeamFilter val = new TeamFilter(); val.teamIndex = (TeamIndex)1; component.teamFilter = val; component.Networkradius = 20f; component.radius = 20f; component.expireDuration = 15f; component.expires = true; } } internal static void AddBanner(GameObject projectileToAdd) { Prefabs.bannerPrefabs.Add(projectileToAdd); } } public static class Buffs { internal static BuffDef rocketJumpingBuff; internal static BuffDef conchBuff; internal static BuffDef buffBannerBuff; internal static BuffDef battalionBuff; internal static BuffDef deathResistActive; internal static BuffDef deathResistCooldown; internal static BuffDef parachuteBuff; internal static BuffDef whipBuff; internal static BuffDef whipHeadBuff; internal static BuffDef bazookaLoadBuff; internal static BuffDef bazookaBurstDebuff; internal static List buffDefs = new List(); internal static void RegisterBuffs() { //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_0020: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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_0116: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) Sprite iconSprite = Addressables.LoadAssetAsync((object)"RoR2/Junk/Common/bdBodyArmor.asset").WaitForCompletion().iconSprite; rocketJumpingBuff = AddNewBuff("RocketJumpingBuff", iconSprite, Color.gray, canStack: false, isDebuff: false); Sprite buffIcon = Assets.mainAssetBundle.LoadAsset("texConchBuffIcon"); conchBuff = AddNewBuff("ConchArmorBuff", buffIcon, Color.white, canStack: false, isDebuff: false); Sprite buffIcon2 = Assets.mainAssetBundle.LoadAsset("texCritBuffIcon"); buffBannerBuff = AddNewBuff("BuffBannerDamageBuff", buffIcon2, Color.white, canStack: false, isDebuff: false); Sprite buffIcon3 = Assets.mainAssetBundle.LoadAsset("texBattalionBuffIcon"); battalionBuff = AddNewBuff("BattalionArmorBuff", buffIcon3, Color.white, canStack: false, isDebuff: false); Sprite buffIcon4 = Assets.mainAssetBundle.LoadAsset("texResistDeathBuffIcon"); deathResistActive = AddNewBuff("BattalionDeathResistBuff", buffIcon4, Color.magenta, canStack: false, isDebuff: false); Sprite buffIcon5 = Assets.mainAssetBundle.LoadAsset("texResistDeathBuffIcon"); deathResistCooldown = AddNewBuff("BattalionDeathCooldown", buffIcon5, Color.white, canStack: false, isDebuff: true, isCooldown: true); Sprite buffIcon6 = Assets.mainAssetBundle.LoadAsset("texBaseJumperBuffIcon"); parachuteBuff = AddNewBuff("ParachuteBuff", buffIcon6, Color.white, canStack: false, isDebuff: false); Sprite iconSprite2 = Addressables.LoadAssetAsync((object)"RoR2/Base/SprintOutOfCombat/bdWhipBoost.asset").WaitForCompletion().iconSprite; whipBuff = AddNewBuff("DisciplinaryActionBuff", iconSprite2, Color.red, canStack: false, isDebuff: false); Sprite iconSprite3 = Addressables.LoadAssetAsync((object)"RoR2/Base/SprintOutOfCombat/bdWhipBoost.asset").WaitForCompletion().iconSprite; whipHeadBuff = AddNewBuff("DisciplinaryActionLeaderBuff", iconSprite3, Color.magenta, canStack: true, isDebuff: false); Sprite buffIcon7 = Assets.mainAssetBundle.LoadAsset("texSoldierBazookaBuffIcon"); bazookaLoadBuff = AddNewBuff("BazookaRocketsLoadedBuff", buffIcon7, Color.white, canStack: true, isDebuff: false); Sprite buffIcon8 = Assets.mainAssetBundle.LoadAsset("texSoldierBazookaBuffIcon"); bazookaBurstDebuff = AddNewBuff("BazookaBurstDebuff", buffIcon8, Color.black, canStack: true, isDebuff: false); } internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, bool isCooldown = false) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance(); ((Object)val).name = buffName; val.buffColor = buffColor; val.canStack = canStack; val.isDebuff = isDebuff; val.eliteDef = null; val.iconSprite = buffIcon; val.isCooldown = isCooldown; buffDefs.Add(val); return val; } internal static BuffDef AddNewBuffWithSound(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, NetworkSoundEventDef sfx) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance(); ((Object)val).name = buffName; val.buffColor = buffColor; val.canStack = canStack; val.isDebuff = isDebuff; val.eliteDef = null; val.iconSprite = buffIcon; val.startSfx = sfx; buffDefs.Add(val); return val; } } public static class Config { public static ConfigEntry autoJumpEnabled { get; set; } public static ConfigEntry killGracePeriod { get; set; } public static void ReadConfig() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown autoJumpEnabled = ((BaseUnityPlugin)TF2SoldierPlugin.instance).Config.Bind("Hold to Auto Jump", "Enabled", false, new ConfigDescription("Set to true to enable automatically jumping when holding the key down. Default: false", (AcceptableValueBase)null, Array.Empty())); killGracePeriod = ((BaseUnityPlugin)TF2SoldierPlugin.instance).Config.Bind("Air Strike Grace Period", "Duration", 1f, new ConfigDescription("Set the grace time for gaining a stack after doing damage with the Air Strike. Default: 1", (AcceptableValueBase)null, Array.Empty())); } internal static ConfigEntry CharacterEnableConfig(string characterName) { //IL_0011: 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_002c: Expected O, but got Unknown //IL_002c: Expected O, but got Unknown return ((BaseUnityPlugin)TF2SoldierPlugin.instance).Config.Bind(new ConfigDefinition(characterName, "Enabled"), true, new ConfigDescription("Set to false to disable this character", (AcceptableValueBase)null, Array.Empty())); } internal static ConfigEntry EnemyEnableConfig(string characterName) { //IL_0011: 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_002c: Expected O, but got Unknown //IL_002c: Expected O, but got Unknown return ((BaseUnityPlugin)TF2SoldierPlugin.instance).Config.Bind(new ConfigDefinition(characterName, "Enabled"), true, new ConfigDescription("Set to false to disable this enemy", (AcceptableValueBase)null, Array.Empty())); } } internal class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public string identifier => "com.Lemner.TF2SoldierMod"; public void Initialize() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.bodyPrefabs.Add(Prefabs.bodyPrefabs.ToArray()); contentPack.buffDefs.Add(Buffs.buffDefs.ToArray()); contentPack.effectDefs.Add(Assets.effectDefs.ToArray()); contentPack.entityStateTypes.Add(States.entityStates.ToArray()); contentPack.masterPrefabs.Add(Prefabs.masterPrefabs.ToArray()); contentPack.networkSoundEventDefs.Add(Assets.networkSoundEventDefs.ToArray()); contentPack.projectilePrefabs.Add(Prefabs.projectilePrefabs.ToArray()); contentPack.skillDefs.Add(Skills.skillDefs.ToArray()); contentPack.skillFamilies.Add(Skills.skillFamilies.ToArray()); contentPack.survivorDefs.Add(Prefabs.survivorDefinitions.ToArray()); contentPack.unlockableDefs.Add(Unlockables.unlockableDefs.ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } internal static class Helpers { internal const string agilePrefix = "Agile. "; internal static string ScepterDescription(string desc) { return "\nSCEPTER: " + desc + ""; } public static T[] Append(ref T[] array, List list) { int num = array.Length; int count = list.Count; Array.Resize(ref array, num + count); list.CopyTo(array, num); return array; } public static Func AppendDel(List list) { return (T[] r) => Append(ref r, list); } public static GameObject GetMyPrimary(CharacterBody body) { string text = "LEMN_SOLDIERTF2_BODY_"; string skillNameToken = body.skillLocator.primary.skillNameToken; if (skillNameToken.Equals(text + "PRIMARY_ROCKET_NAME")) { return ((Component)body.modelLocator.modelTransform).gameObject.GetComponent().childLocator.FindChildGameObject("RocketLauncher"); } if (skillNameToken.Equals(text + "PRIMARY_BAZOOKA_NAME")) { return ((Component)body.modelLocator.modelTransform).gameObject.GetComponent().childLocator.FindChildGameObject("BeggarsBazooka"); } if (skillNameToken.Equals(text + "PRIMARY_JUMPER_NAME")) { return ((Component)body.modelLocator.modelTransform).gameObject.GetComponent().childLocator.FindChildGameObject("RocketJumper"); } if (skillNameToken.Equals(text + "PRIMARY_AIRSTRIKE_NAME")) { return ((Component)body.modelLocator.modelTransform).gameObject.GetComponent().childLocator.FindChildGameObject("AirStrike"); } return null; } public static GameObject GetMySecondary(CharacterBody body) { string text = "LEMN_SOLDIERTF2_BODY_"; string skillNameToken = body.skillLocator.secondary.skillNameToken; if (skillNameToken.Equals(text + "SECONDARY_SHOTGUN_NAME")) { return ((Component)body.modelLocator.modelTransform).gameObject.GetComponent().childLocator.FindChildGameObject("Shotgun"); } if (skillNameToken.Equals(text + "SECONDARY_RESERVE_SHOOTER_NAME")) { return ((Component)body.modelLocator.modelTransform).gameObject.GetComponent().childLocator.FindChildGameObject("ReserveShooter"); } return null; } public static GameObject GetMyUtility(CharacterBody body) { string text = "LEMN_SOLDIERTF2_BODY_"; string skillNameToken = body.skillLocator.utility.skillNameToken; if (skillNameToken.Equals(text + "UTILITY_CONCH_NAME")) { return ((Component)body.modelLocator.modelTransform).gameObject.GetComponent().childLocator.FindChildGameObject("ConcherorHorn"); } if (skillNameToken.Equals(text + "UTILITY_BUFFBANNER_NAME")) { return ((Component)body.modelLocator.modelTransform).gameObject.GetComponent().childLocator.FindChildGameObject("BuffHorn"); } if (skillNameToken.Equals(text + "UTILITY_BATTALION_NAME")) { return ((Component)body.modelLocator.modelTransform).gameObject.GetComponent().childLocator.FindChildGameObject("BattalionHorn"); } return null; } public static GameObject GetMySpecial(CharacterBody body) { string text = "LEMN_SOLDIERTF2_BODY_"; string skillNameToken = body.skillLocator.special.skillNameToken; if (skillNameToken.Equals(text + "SPECIAL_SHOVEL_NAME")) { return ((Component)body.modelLocator.modelTransform).gameObject.GetComponent().childLocator.FindChildGameObject("MarketGardener"); } if (skillNameToken.Equals(text + "SPECIAL_WHIP_NAME")) { return ((Component)body.modelLocator.modelTransform).gameObject.GetComponent().childLocator.FindChildGameObject("Whip"); } if (skillNameToken.Equals(text + "SPECIAL_KATANA_NAME")) { return ((Component)body.modelLocator.modelTransform).gameObject.GetComponent().childLocator.FindChildGameObject("Zatoichi"); } return null; } public static void SwapToPrimary(CharacterBody body) { GameObject myPrimary = GetMyPrimary(body); GameObject mySecondary = GetMySecondary(body); GameObject mySpecial = GetMySpecial(body); GameObject myUtility = GetMyUtility(body); if (Object.op_Implicit((Object)(object)myPrimary)) { myPrimary.SetActive(true); } if (Object.op_Implicit((Object)(object)mySecondary)) { mySecondary.SetActive(false); } if (Object.op_Implicit((Object)(object)mySpecial)) { mySpecial.SetActive(false); } if (Object.op_Implicit((Object)(object)myUtility)) { myUtility.SetActive(false); } } public static void SwapToSecondary(CharacterBody body) { GameObject myPrimary = GetMyPrimary(body); GameObject mySecondary = GetMySecondary(body); GameObject mySpecial = GetMySpecial(body); if (Object.op_Implicit((Object)(object)myPrimary)) { myPrimary.SetActive(false); } if (Object.op_Implicit((Object)(object)mySecondary)) { mySecondary.SetActive(true); } if (Object.op_Implicit((Object)(object)mySpecial)) { mySpecial.SetActive(false); } } public static void SwapToUtility(CharacterBody body) { GameObject myPrimary = GetMyPrimary(body); GameObject mySecondary = GetMySecondary(body); GameObject mySpecial = GetMySpecial(body); GameObject myUtility = GetMyUtility(body); if (Object.op_Implicit((Object)(object)myPrimary)) { myPrimary.SetActive(false); } if (Object.op_Implicit((Object)(object)mySecondary)) { mySecondary.SetActive(false); } if (Object.op_Implicit((Object)(object)mySpecial)) { mySpecial.SetActive(false); } if (Object.op_Implicit((Object)(object)myUtility)) { myUtility.SetActive(true); } } public static void SwapToSpecial(CharacterBody body) { GameObject myPrimary = GetMyPrimary(body); GameObject mySecondary = GetMySecondary(body); GameObject mySpecial = GetMySpecial(body); if (Object.op_Implicit((Object)(object)myPrimary)) { myPrimary.SetActive(false); } if (Object.op_Implicit((Object)(object)mySecondary)) { mySecondary.SetActive(false); } if (Object.op_Implicit((Object)(object)mySpecial)) { mySpecial.SetActive(true); } } } internal static class ArrayHelper { public static T[] Append(ref T[] array, List list) { int num = array.Length; int count = list.Count; Array.Resize(ref array, num + count); list.CopyTo(array, num); return array; } public static Func AppendDel(List list) { return (T[] r) => Append(ref r, list); } } internal static class ItemDisplays { private static Dictionary itemDisplayPrefabs = new Dictionary(); internal static void PopulateDisplays() { PopulateFromBody("Commando"); PopulateFromBody("Croco"); PopulateFromBody("Mage"); } private static void PopulateFromBody(string bodyName) { ItemDisplayRuleSet itemDisplayRuleSet = ((Component)LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyName + "Body").GetComponent().modelTransform).GetComponent().itemDisplayRuleSet; KeyAssetRuleGroup[] keyAssetRuleGroups = itemDisplayRuleSet.keyAssetRuleGroups; for (int i = 0; i < keyAssetRuleGroups.Length; i++) { ItemDisplayRule[] rules = keyAssetRuleGroups[i].displayRuleGroup.rules; for (int j = 0; j < rules.Length; j++) { GameObject followerPrefab = rules[j].followerPrefab; if (Object.op_Implicit((Object)(object)followerPrefab)) { string key = ((Object)followerPrefab).name?.ToLower(); if (!itemDisplayPrefabs.ContainsKey(key)) { itemDisplayPrefabs[key] = followerPrefab; } } } } } internal static GameObject LoadDisplay(string name) { if (itemDisplayPrefabs.ContainsKey(name.ToLower()) && Object.op_Implicit((Object)(object)itemDisplayPrefabs[name.ToLower()])) { return itemDisplayPrefabs[name.ToLower()]; } return null; } } internal static class Prefabs { private static PhysicMaterial ragdollMaterial; internal static List survivorDefinitions = new List(); internal static List bodyPrefabs = new List(); internal static List masterPrefabs = new List(); internal static List projectilePrefabs = new List(); internal static List bannerPrefabs = new List(); internal static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string namePrefix, UnlockableDef unlockableDef, float sortPosition) { //IL_005e: 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) string displayNameToken = "LEMN_" + namePrefix + "_BODY_NAME"; string descriptionToken = "LEMN_" + namePrefix + "_BODY_DESCRIPTION"; string outroFlavorToken = "LEMN_" + namePrefix + "_BODY_OUTRO_FLAVOR"; string mainEndingEscapeFailureFlavorToken = "LEMN_" + namePrefix + "_BODY_OUTRO_FAILURE"; SurvivorDef val = ScriptableObject.CreateInstance(); val.bodyPrefab = bodyPrefab; val.displayPrefab = displayPrefab; val.primaryColor = charColor; val.displayNameToken = displayNameToken; val.descriptionToken = descriptionToken; val.outroFlavorToken = outroFlavorToken; val.mainEndingEscapeFailureFlavorToken = mainEndingEscapeFailureFlavorToken; val.desiredSortPosition = sortPosition; val.unlockableDef = unlockableDef; survivorDefinitions.Add(val); } internal static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string namePrefix) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) RegisterNewSurvivor(bodyPrefab, displayPrefab, charColor, namePrefix, null, 100f); } internal static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string namePrefix, float sortPosition) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) RegisterNewSurvivor(bodyPrefab, displayPrefab, charColor, namePrefix, null, sortPosition); } internal static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string namePrefix, UnlockableDef unlockableDef) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) RegisterNewSurvivor(bodyPrefab, displayPrefab, charColor, namePrefix, unlockableDef, 100f); } internal static GameObject CreateDisplayPrefab(string modelName, GameObject prefab, BodyInfo bodyInfo) { if (!Object.op_Implicit((Object)(object)LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body"))) { Debug.LogError((object)(bodyInfo.bodyNameToClone + "Body is not a valid body, character creation failed")); return null; } GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body"), modelName + "Prefab"); GameObject val2 = CreateModel(val, modelName); Transform val3 = SetupModel(val, val2.transform, bodyInfo); val2.AddComponent().baseRendererInfos = prefab.GetComponentInChildren().baseRendererInfos; Assets.ConvertAllRenderersToHopooShader(val2); return val2.gameObject; } internal static GameObject CreatePrefab(string bodyName, string modelName, BodyInfo bodyInfo) { //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body"))) { Debug.LogError((object)(bodyInfo.bodyNameToClone + "Body is not a valid body, character creation failed")); return null; } GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body"), bodyName); Transform val2 = null; GameObject val3 = null; if (modelName != "mdl") { val3 = CreateModel(val, modelName); if ((Object)(object)val3 == (Object)null) { val3 = ((Component)val.GetComponentInChildren()).gameObject; } val2 = SetupModel(val, val3.transform, bodyInfo); } CharacterBody component = val.GetComponent(); ((Object)component).name = bodyInfo.bodyName; component.baseNameToken = bodyInfo.bodyNameToken; component.subtitleNameToken = bodyInfo.subtitleNameToken; component.portraitIcon = bodyInfo.characterPortrait; CrosshairUtils.RequestOverrideForBody(component, bodyInfo.crosshair, (OverridePriority)0); component.bodyFlags = (BodyFlags)16; component.rootMotionInMainState = false; component.baseMaxHealth = bodyInfo.maxHealth; component.levelMaxHealth = bodyInfo.healthGrowth; component.baseRegen = bodyInfo.healthRegen; component.levelRegen = component.baseRegen * 0.2f; component.baseMaxShield = bodyInfo.shield; component.levelMaxShield = bodyInfo.shieldGrowth; component.baseMoveSpeed = bodyInfo.moveSpeed; component.levelMoveSpeed = bodyInfo.moveSpeedGrowth; component.baseAcceleration = bodyInfo.acceleration; component.baseJumpPower = bodyInfo.jumpPower; component.levelJumpPower = bodyInfo.jumpPowerGrowth; component.baseDamage = bodyInfo.damage; component.levelDamage = component.baseDamage * 0.2f; component.baseAttackSpeed = bodyInfo.attackSpeed; component.levelAttackSpeed = bodyInfo.attackSpeedGrowth; component.baseArmor = bodyInfo.armor; component.levelArmor = bodyInfo.armorGrowth; component.baseCrit = bodyInfo.crit; component.levelCrit = bodyInfo.critGrowth; component.baseJumpCount = bodyInfo.jumpCount; component.sprintingSpeedMultiplier = 1.45f; component.hideCrosshair = false; component.aimOriginTransform = val2.Find("AimOrigin"); component.hullClassification = (HullClassification)0; component.preferredPodPrefab = bodyInfo.podPrefab; component.isChampion = false; component.bodyColor = bodyInfo.bodyColor; if ((Object)(object)val2 != (Object)null) { SetupCharacterDirection(val, val2, val3.transform); } SetupCameraTargetParams(val); if ((Object)(object)val2 != (Object)null) { SetupModelLocator(val, val2, val3.transform); } SetupRigidbody(val); SetupCapsuleCollider(val); SetupMainHurtbox(val, val3); SetupFootstepController(val3); SetupRagdoll(val3); SetupAimAnimator(val, val3); bodyPrefabs.Add(val); return val; } internal static void CreateGenericDoppelganger(GameObject bodyPrefab, string masterName, string masterToCopy) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterMasters/" + masterToCopy + "MonsterMaster"), masterName, true); val.GetComponent().bodyPrefab = bodyPrefab; masterPrefabs.Add(val); } private static Transform SetupModel(GameObject prefab, Transform modelTransform, BodyInfo bodyInfo) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0025: 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) //IL_0056: 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_006c: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00d6: 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_00f8: 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_012e: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("ModelBase"); val.transform.parent = prefab.transform; val.transform.localPosition = bodyInfo.modelBasePosition; val.transform.localRotation = Quaternion.identity; val.transform.localScale = new Vector3(1f, 1f, 1f); GameObject val2 = new GameObject("CameraPivot"); val2.transform.parent = val.transform; val2.transform.localPosition = bodyInfo.cameraPivotPosition; val2.transform.localRotation = Quaternion.identity; val2.transform.localScale = Vector3.one; GameObject val3 = new GameObject("AimOrigin"); val3.transform.parent = val.transform; val3.transform.localPosition = bodyInfo.aimOriginPosition; val3.transform.localRotation = Quaternion.identity; val3.transform.localScale = Vector3.one; prefab.GetComponent().aimOriginTransform = val3.transform; modelTransform.parent = val.transform; modelTransform.localPosition = Vector3.zero; modelTransform.localRotation = Quaternion.identity; return val.transform; } private static GameObject CreateModel(GameObject main, string modelName) { Object.DestroyImmediate((Object)(object)((Component)main.transform.Find("ModelBase")).gameObject); Object.DestroyImmediate((Object)(object)((Component)main.transform.Find("CameraPivot")).gameObject); Object.DestroyImmediate((Object)(object)((Component)main.transform.Find("AimOrigin")).gameObject); if ((Object)(object)Assets.mainAssetBundle.LoadAsset(modelName) == (Object)null) { Debug.LogError((object)"Trying to load a null model- check to see if the name in your code matches the name of the object in Unity!!"); return null; } return Object.Instantiate(Assets.mainAssetBundle.LoadAsset(modelName)); } internal static void SetupCharacterModel(GameObject prefab, CustomRendererInfo[] rendererInfo, int mainRendererIndex) { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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) CharacterModel val = ((Component)prefab.GetComponent().modelTransform).gameObject.AddComponent(); ChildLocator component = ((Component)val).GetComponent(); val.body = prefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Debug.LogError((object)"Failed CharacterModel setup: ChildLocator component does not exist on the model"); return; } List list = new List(); for (int i = 0; i < rendererInfo.Length; i++) { if (!Object.op_Implicit((Object)(object)component.FindChild(rendererInfo[i].childName))) { Debug.LogError((object)("Trying to add a RendererInfo for a renderer that does not exist: " + rendererInfo[i].childName)); continue; } Renderer component2 = ((Component)component.FindChild(rendererInfo[i].childName)).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { list.Add(new RendererInfo { renderer = ((Component)component.FindChild(rendererInfo[i].childName)).GetComponent(), defaultMaterial = rendererInfo[i].material, ignoreOverlays = rendererInfo[i].ignoreOverlays, defaultShadowCastingMode = (ShadowCastingMode)1 }); } } val.baseRendererInfos = list.ToArray(); val.autoPopulateLightInfos = true; val.invisibilityCount = 0; val.temporaryOverlays = new List(); if (mainRendererIndex > val.baseRendererInfos.Length) { Debug.LogError((object)("mainRendererIndex out of range: not setting mainSkinnedMeshRenderer for " + ((Object)prefab).name)); } else { val.mainSkinnedMeshRenderer = ((Component)val.baseRendererInfos[mainRendererIndex].renderer).GetComponent(); } } private static void SetupCharacterDirection(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { CharacterDirection component = prefab.GetComponent(); component.targetTransform = modelBaseTransform; component.overrideAnimatorForwardTransform = null; component.rootMotionAccumulator = null; component.modelAnimator = ((Component)modelTransform).GetComponent(); component.driveFromRootRotation = false; component.turnSpeed = 720f; } private static void SetupCameraTargetParams(GameObject prefab) { //IL_004b: 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) CameraTargetParams component = prefab.GetComponent(); component.cameraParams = LegacyResourcesAPI.Load("Prefabs/CharacterBodies/MercBody").GetComponent().cameraParams; component.cameraPivotTransform = prefab.transform.Find("ModelBase").Find("CameraPivot"); component.RequestAimType((AimType)0); component.recoil = Vector2.zero; component.dontRaycastToPivot = false; } private static void SetupModelLocator(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { ModelLocator component = prefab.GetComponent(); component.modelTransform = modelTransform; component.modelBaseTransform = modelBaseTransform; } private static void SetupRigidbody(GameObject prefab) { Rigidbody component = prefab.GetComponent(); component.mass = 100f; } private static void SetupCapsuleCollider(GameObject prefab) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) CapsuleCollider component = prefab.GetComponent(); component.center = new Vector3(0f, 0f, 0f); component.radius = 0.5f; component.height = 1.82f; component.direction = 1; } private static void SetupMainHurtbox(GameObject prefab, GameObject model) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) ChildLocator component = model.GetComponent(); if (!Object.op_Implicit((Object)(object)component.FindChild("MainHurtbox"))) { Debug.LogError((object)"Could not set up main hurtbox: make sure you have a transform pair in your prefab's ChildLocator component called 'MainHurtbox'"); return; } HurtBoxGroup val = model.AddComponent(); HurtBox val2 = ((Component)component.FindChild("MainHurtbox")).gameObject.AddComponent(); ((Component)val2).gameObject.layer = LayerIndex.entityPrecise.intVal; val2.healthComponent = prefab.GetComponent(); val2.isBullseye = true; val2.damageModifier = (DamageModifier)0; val2.hurtBoxGroup = val; val2.indexInGroup = 0; val.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val2 }; val.mainHurtBox = val2; val.bullseyeCount = 1; } private static void SetupFootstepController(GameObject model) { FootstepHandler val = model.AddComponent(); val.baseFootstepString = "Play_player_footstep"; val.sprintFootstepOverrideString = ""; val.enableFootstepDust = true; val.footstepDustPrefab = LegacyResourcesAPI.Load("Prefabs/GenericFootstepDust"); } private static void SetupRagdoll(GameObject model) { RagdollController component = model.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } if ((Object)(object)ragdollMaterial == (Object)null) { ragdollMaterial = ((Component)LegacyResourcesAPI.Load("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren().bones[1]).GetComponent().material; } Transform[] bones = component.bones; foreach (Transform val in bones) { if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.layer = LayerIndex.ragdoll.intVal; Collider component2 = ((Component)val).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.material = ragdollMaterial; component2.sharedMaterial = ragdollMaterial; } } } } private static void SetupAimAnimator(GameObject prefab, GameObject model) { AimAnimator val = model.AddComponent(); val.directionComponent = prefab.GetComponent(); val.pitchRangeMax = 60f; val.pitchRangeMin = -60f; val.yawRangeMin = -80f; val.yawRangeMax = 80f; val.pitchGiveupRange = 30f; val.yawGiveupRange = 10f; val.giveupDuration = 3f; val.inputBank = prefab.GetComponent(); } internal static void SetupHitbox(GameObject prefab, Transform hitboxTransform, string hitboxName) { HitBoxGroup val = prefab.AddComponent(); HitBox val2 = ((Component)hitboxTransform).gameObject.AddComponent(); ((Component)hitboxTransform).gameObject.layer = LayerIndex.projectile.intVal; val.hitBoxes = (HitBox[])(object)new HitBox[1] { val2 }; val.groupName = hitboxName; } internal static void SetupHitbox(GameObject prefab, string hitboxName, params Transform[] hitboxTransforms) { HitBoxGroup val = prefab.AddComponent(); List list = new List(); foreach (Transform val2 in hitboxTransforms) { HitBox item = ((Component)val2).gameObject.AddComponent(); ((Component)val2).gameObject.layer = LayerIndex.projectile.intVal; list.Add(item); } val.hitBoxes = list.ToArray(); val.groupName = hitboxName; } } internal static class Projectiles { internal static GameObject rocketPrefab; internal static GameObject rocketJumperPrefab; internal static GameObject airStrikeRocketPrefab; internal static GameObject bazookaRocketPrefab; internal static GameObject icbmBazookaRocketPrefab; internal static GameObject icbmRocketPrefab; internal static GameObject icbmAirStrikeRocketPrefab; internal static GameObject conchBuffBanner; internal static GameObject critBuffBanner; internal static GameObject battalionBuffBanner; internal static void RegisterProjectiles() { CreateNormalRocket(); CreateICBMNormalRocket(); CreateICBMAirStrikeRocket(); CreateJumperRocket(); CreateStrikeRocket(); CreateBazookaRocket(); CreateICBMBazookaRocket(); AddProjectile(rocketPrefab); AddProjectile(icbmRocketPrefab); AddProjectile(icbmAirStrikeRocketPrefab); AddProjectile(rocketJumperPrefab); AddProjectile(airStrikeRocketPrefab); AddProjectile(bazookaRocketPrefab); AddProjectile(icbmBazookaRocketPrefab); } internal static void AddProjectile(GameObject projectileToAdd) { Prefabs.projectilePrefabs.Add(projectileToAdd); } private static void CreateNormalRocket() { //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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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) rocketPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/CommandoGrenadeProjectile"), "SoldierRocketProjectile"); ProjectileDamage component = rocketPrefab.GetComponent(); component.damageType = DamageTypeCombo.op_Implicit((DamageType)0); component.damageType.damageSource = (DamageSource)1; ProjectileImpactExplosion component2 = rocketPrefab.GetComponent(); if ((Object)(object)component2 != (Object)null) { InitializeRocketImpactExplosion(component2); ((ProjectileExplosion)component2).blastRadius = 7f; ((ProjectileExplosion)component2).bonusBlastForce = new Vector3(0f, 800f, 0f); component2.destroyOnWorld = true; component2.destroyOnEnemy = true; component2.lifetime = 12f; component2.impactEffect = Assets.rocketExplosionEffect; component2.timerAfterImpact = true; component2.lifetimeAfterImpact = 0f; } ProjectileController component3 = rocketPrefab.GetComponent(); if ((Object)(object)Assets.mainAssetBundle.LoadAsset("SoldierRocket") != (Object)null) { component3.ghostPrefab = CreateGhostPrefab("SoldierRocket"); } component3.startSound = ""; } private static void CreateICBMNormalRocket() { //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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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) icbmRocketPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/CommandoGrenadeProjectile"), "SoldierICBMRocketProjectile"); ProjectileDamage component = icbmRocketPrefab.GetComponent(); component.damageType = DamageTypeCombo.op_Implicit((DamageType)0); component.damageType.damageSource = (DamageSource)1; ProjectileImpactExplosion component2 = icbmRocketPrefab.GetComponent(); if ((Object)(object)component2 != (Object)null) { InitializeRocketImpactExplosion(component2); ((ProjectileExplosion)component2).blastRadius = 7f; ((ProjectileExplosion)component2).bonusBlastForce = new Vector3(0f, 800f, 0f); component2.destroyOnWorld = true; component2.destroyOnEnemy = true; component2.lifetime = 12f; component2.impactEffect = Assets.rocketExplosionEffect; component2.timerAfterImpact = true; component2.lifetimeAfterImpact = 0f; } ProjectileController component3 = icbmRocketPrefab.GetComponent(); if ((Object)(object)Assets.mainAssetBundle.LoadAsset("SoldierRocket") != (Object)null) { component3.ghostPrefab = CreateGhostPrefab("SoldierRocket"); } component3.startSound = ""; } private static void CreateBazookaRocket() { //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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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) bazookaRocketPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/CommandoGrenadeProjectile"), "SoldierBazookaProjectile"); ProjectileDamage component = bazookaRocketPrefab.GetComponent(); component.damageType = DamageTypeCombo.op_Implicit((DamageType)0); component.damageType.damageSource = (DamageSource)1; ProjectileImpactExplosion component2 = bazookaRocketPrefab.GetComponent(); if ((Object)(object)component2 != (Object)null) { InitializeRocketImpactExplosion(component2); ((ProjectileExplosion)component2).blastRadius = 7f; ((ProjectileExplosion)component2).bonusBlastForce = new Vector3(0f, 800f, 0f); component2.destroyOnWorld = true; component2.destroyOnEnemy = true; component2.lifetime = 12f; component2.impactEffect = Assets.rocketExplosionEffect; component2.timerAfterImpact = true; component2.lifetimeAfterImpact = 0f; } ProjectileController component3 = bazookaRocketPrefab.GetComponent(); if ((Object)(object)Assets.mainAssetBundle.LoadAsset("SoldierRocket") != (Object)null) { component3.ghostPrefab = CreateGhostPrefab("SoldierRocket"); } component3.startSound = ""; } private static void CreateICBMBazookaRocket() { //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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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) icbmBazookaRocketPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/CommandoGrenadeProjectile"), "SoldierICBMBazookaProjectile"); ProjectileDamage component = icbmBazookaRocketPrefab.GetComponent(); component.damageType = DamageTypeCombo.op_Implicit((DamageType)0); component.damageType.damageSource = (DamageSource)1; ProjectileImpactExplosion component2 = icbmBazookaRocketPrefab.GetComponent(); if ((Object)(object)component2 != (Object)null) { InitializeRocketImpactExplosion(component2); ((ProjectileExplosion)component2).blastRadius = 7f; ((ProjectileExplosion)component2).bonusBlastForce = new Vector3(0f, 800f, 0f); component2.destroyOnWorld = true; component2.destroyOnEnemy = true; component2.lifetime = 12f; component2.impactEffect = Assets.rocketExplosionEffect; component2.timerAfterImpact = true; component2.lifetimeAfterImpact = 0f; } ProjectileController component3 = icbmBazookaRocketPrefab.GetComponent(); if ((Object)(object)Assets.mainAssetBundle.LoadAsset("SoldierRocket") != (Object)null) { component3.ghostPrefab = CreateGhostPrefab("SoldierRocket"); } component3.startSound = ""; } private static void CreateICBMAirStrikeRocket() { //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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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) icbmAirStrikeRocketPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/CommandoGrenadeProjectile"), "SoldierICBMAirStrikeProjectile"); ProjectileDamage component = icbmAirStrikeRocketPrefab.GetComponent(); component.damageType = DamageTypeCombo.op_Implicit((DamageType)0); component.damageType.damageSource = (DamageSource)1; ProjectileImpactExplosion component2 = icbmAirStrikeRocketPrefab.GetComponent(); if ((Object)(object)component2 != (Object)null) { InitializeAirStrikeImpactExplosion(component2); ((ProjectileExplosion)component2).blastRadius = 7f; ((ProjectileExplosion)component2).bonusBlastForce = new Vector3(0f, 800f, 0f); component2.destroyOnWorld = true; component2.destroyOnEnemy = true; component2.lifetime = 12f; component2.impactEffect = Assets.rocketExplosionEffect; component2.timerAfterImpact = true; component2.lifetimeAfterImpact = 0f; } ProjectileController component3 = icbmAirStrikeRocketPrefab.GetComponent(); if ((Object)(object)Assets.mainAssetBundle.LoadAsset("SoldierRocket") != (Object)null) { component3.ghostPrefab = CreateGhostPrefab("SoldierRocket"); } component3.startSound = ""; } private static void CreateJumperRocket() { //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_0038: Unknown result type (might be due to invalid IL or missing references) rocketJumperPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/CommandoGrenadeProjectile"), "SoldierRocketJumperProjectile"); ProjectileDamage component = rocketJumperPrefab.GetComponent(); component.damageType = DamageTypeCombo.op_Implicit((DamageType)0); component.damageType.damageSource = (DamageSource)1; ProjectileImpactExplosion component2 = rocketJumperPrefab.GetComponent(); if ((Object)(object)component2 != (Object)null) { InitializeJumperImpactExplosion(component2); ((ProjectileExplosion)component2).blastRadius = 7f; component2.destroyOnWorld = true; component2.destroyOnEnemy = true; component2.lifetime = 12f; component2.impactEffect = Assets.rocketJumperExplosionEffect; component2.timerAfterImpact = true; component2.lifetimeAfterImpact = 0f; } ProjectileController component3 = rocketJumperPrefab.GetComponent(); if ((Object)(object)Assets.mainAssetBundle.LoadAsset("SoldierRocket") != (Object)null) { component3.ghostPrefab = CreateGhostPrefab("SoldierRocket"); } component3.startSound = ""; } private static void CreateStrikeRocket() { //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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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) airStrikeRocketPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/CommandoGrenadeProjectile"), "SoldierAirStrikeProjectile"); ProjectileDamage component = airStrikeRocketPrefab.GetComponent(); component.damageType = DamageTypeCombo.op_Implicit((DamageType)0); component.damageType.damageSource = (DamageSource)1; ProjectileImpactExplosion component2 = airStrikeRocketPrefab.GetComponent(); if ((Object)(object)component2 != (Object)null) { InitializeAirStrikeImpactExplosion(component2); ((ProjectileExplosion)component2).blastRadius = 7f; ((ProjectileExplosion)component2).bonusBlastForce = new Vector3(0f, 800f, 0f); component2.destroyOnWorld = true; component2.destroyOnEnemy = true; component2.lifetime = 12f; component2.impactEffect = Assets.airStrikeExplosionEffect; component2.timerAfterImpact = true; component2.lifetimeAfterImpact = 0f; } ProjectileController component3 = airStrikeRocketPrefab.GetComponent(); if ((Object)(object)Assets.mainAssetBundle.LoadAsset("SoldierRocket") != (Object)null) { component3.ghostPrefab = CreateGhostPrefab("SoldierRocket"); } component3.startSound = ""; } private static void InitializeRocketImpactExplosion(ProjectileImpactExplosion projectileImpactExplosion) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_009f: 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_00f1: Unknown result type (might be due to invalid IL or missing references) ((Component)projectileImpactExplosion).GetComponent().localTorque = Vector3.zero; ((Component)projectileImpactExplosion).GetComponent().randomize = false; ((Component)projectileImpactExplosion).gameObject.AddComponent(); ((Component)projectileImpactExplosion).GetComponent().rb = ((Component)projectileImpactExplosion).GetComponent(); ((Component)projectileImpactExplosion).GetComponent().antiGravityCoefficient = 1f; ((ProjectileExplosion)projectileImpactExplosion).blastDamageCoefficient = 1f; ((ProjectileExplosion)projectileImpactExplosion).blastProcCoefficient = 1f; ((ProjectileExplosion)projectileImpactExplosion).blastRadius = 1f; ((ProjectileExplosion)projectileImpactExplosion).bonusBlastForce = Vector3.zero; ((ProjectileExplosion)projectileImpactExplosion).childrenCount = 0; ((ProjectileExplosion)projectileImpactExplosion).childrenDamageCoefficient = 0f; ((ProjectileExplosion)projectileImpactExplosion).childrenProjectilePrefab = null; projectileImpactExplosion.destroyOnEnemy = true; projectileImpactExplosion.destroyOnWorld = true; ((ProjectileExplosion)projectileImpactExplosion).falloffModel = (FalloffModel)0; ((ProjectileExplosion)projectileImpactExplosion).fireChildren = false; projectileImpactExplosion.impactEffect = null; projectileImpactExplosion.lifetime = 0f; projectileImpactExplosion.lifetimeAfterImpact = 0f; projectileImpactExplosion.lifetimeRandomOffset = 0f; projectileImpactExplosion.offsetForLifetimeExpiredSound = 0f; projectileImpactExplosion.timerAfterImpact = false; ((Component)projectileImpactExplosion).GetComponent().damageType = DamageTypeCombo.op_Implicit((DamageType)0); } private static void InitializeJumperImpactExplosion(ProjectileImpactExplosion projectileImpactExplosion) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_009f: 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_00f1: Unknown result type (might be due to invalid IL or missing references) ((Component)projectileImpactExplosion).GetComponent().localTorque = Vector3.zero; ((Component)projectileImpactExplosion).GetComponent().randomize = false; ((Component)projectileImpactExplosion).gameObject.AddComponent(); ((Component)projectileImpactExplosion).GetComponent().rb = ((Component)projectileImpactExplosion).GetComponent(); ((Component)projectileImpactExplosion).GetComponent().antiGravityCoefficient = 1f; ((ProjectileExplosion)projectileImpactExplosion).blastDamageCoefficient = 1f; ((ProjectileExplosion)projectileImpactExplosion).blastProcCoefficient = 1f; ((ProjectileExplosion)projectileImpactExplosion).blastRadius = 1f; ((ProjectileExplosion)projectileImpactExplosion).bonusBlastForce = Vector3.zero; ((ProjectileExplosion)projectileImpactExplosion).childrenCount = 0; ((ProjectileExplosion)projectileImpactExplosion).childrenDamageCoefficient = 0f; ((ProjectileExplosion)projectileImpactExplosion).childrenProjectilePrefab = null; projectileImpactExplosion.destroyOnEnemy = true; projectileImpactExplosion.destroyOnWorld = true; ((ProjectileExplosion)projectileImpactExplosion).falloffModel = (FalloffModel)0; ((ProjectileExplosion)projectileImpactExplosion).fireChildren = false; projectileImpactExplosion.impactEffect = null; projectileImpactExplosion.lifetime = 0f; projectileImpactExplosion.lifetimeAfterImpact = 0f; projectileImpactExplosion.lifetimeRandomOffset = 0f; projectileImpactExplosion.offsetForLifetimeExpiredSound = 0f; projectileImpactExplosion.timerAfterImpact = false; ((Component)projectileImpactExplosion).GetComponent().damageType = DamageTypeCombo.op_Implicit((DamageType)0); } private static void InitializeAirStrikeImpactExplosion(ProjectileImpactExplosion projectileImpactExplosion) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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) ((Component)projectileImpactExplosion).GetComponent().localTorque = Vector3.zero; ((Component)projectileImpactExplosion).GetComponent().randomize = false; ((Component)projectileImpactExplosion).gameObject.AddComponent(); ((Component)projectileImpactExplosion).GetComponent().rb = ((Component)projectileImpactExplosion).GetComponent(); ((Component)projectileImpactExplosion).GetComponent().antiGravityCoefficient = 1f; ((ProjectileExplosion)projectileImpactExplosion).blastDamageCoefficient = 1f; ((ProjectileExplosion)projectileImpactExplosion).blastProcCoefficient = 1f; ((ProjectileExplosion)projectileImpactExplosion).blastRadius = 1f; ((ProjectileExplosion)projectileImpactExplosion).bonusBlastForce = Vector3.zero; ((ProjectileExplosion)projectileImpactExplosion).childrenCount = 0; ((ProjectileExplosion)projectileImpactExplosion).childrenDamageCoefficient = 0f; ((ProjectileExplosion)projectileImpactExplosion).childrenProjectilePrefab = null; projectileImpactExplosion.destroyOnEnemy = true; projectileImpactExplosion.destroyOnWorld = true; ((ProjectileExplosion)projectileImpactExplosion).falloffModel = (FalloffModel)0; ((ProjectileExplosion)projectileImpactExplosion).fireChildren = false; projectileImpactExplosion.impactEffect = null; projectileImpactExplosion.lifetime = 0f; projectileImpactExplosion.lifetimeAfterImpact = 0f; projectileImpactExplosion.lifetimeRandomOffset = 0f; projectileImpactExplosion.offsetForLifetimeExpiredSound = 0f; projectileImpactExplosion.timerAfterImpact = false; ((Component)projectileImpactExplosion).GetComponent().damageType = DamageTypeCombo.op_Implicit((DamageType)268435456); } private static void CreateConchBanner() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown conchBuffBanner = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/WarbannerWard"), "conchBuffWard"); BuffWard component = conchBuffBanner.GetComponent(); if ((Object)(object)component != (Object)null) { component.interval = 0.5f; component.floorWard = false; component.buffDef = Buffs.conchBuff; component.buffDuration = 3f; TeamFilter val = new TeamFilter(); val.teamIndex = (TeamIndex)1; component.teamFilter = val; component.Networkradius = 20f; component.radius = 20f; component.expireDuration = 15f; component.expires = true; } } private static void CreateCritBanner() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) critBuffBanner = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/SporeGrenadeProjectileDotZone"), "buffBannerBuffWard", true); critBuffBanner.transform.localScale = Vector3.one; Object.Destroy((Object)(object)critBuffBanner.GetComponent()); critBuffBanner.AddComponent().duration = 16f; BuffWard val = critBuffBanner.AddComponent(); val.radius = 20f; val.Networkradius = 20f; val.interval = 0.25f; val.rangeIndicator = LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/WarbannerWard").GetComponent().rangeIndicator; val.buffDef = Buffs.buffBannerBuff; val.buffDuration = 3f; val.floorWard = false; val.expires = true; val.invertTeamFilter = false; val.expireDuration = 15f; val.animateRadius = false; Object.Destroy((Object)(object)((Component)critBuffBanner.transform.GetChild(0)).gameObject); } private static void CreateBattalionBanner() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown battalionBuffBanner = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/WarbannerWard"), "battlionBuffWard"); BuffWard component = battalionBuffBanner.GetComponent(); if ((Object)(object)component != (Object)null) { component.interval = 0.5f; component.floorWard = false; component.buffDef = Buffs.battalionBuff; component.buffDuration = 3f; TeamFilter val = new TeamFilter(); val.teamIndex = (TeamIndex)1; component.teamFilter = val; component.Networkradius = 20f; component.radius = 20f; component.expireDuration = 15f; component.expires = true; } } private static GameObject CreateGhostPrefab(string ghostName) { GameObject val = Assets.mainAssetBundle.LoadAsset(ghostName); if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } Assets.ConvertAllRenderersToHopooShader(val); return val; } private static GameObject CloneProjectilePrefab(string prefabName, string newPrefabName) { return PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/" + prefabName), newPrefabName); } } internal static class Skills { internal static List skillFamilies = new List(); internal static List skillDefs = new List(); internal static void CreateSkillFamilies(GameObject targetPrefab) { GenericSkill[] componentsInChildren = targetPrefab.GetComponentsInChildren(); foreach (GenericSkill val in componentsInChildren) { Object.DestroyImmediate((Object)(object)val); } SkillLocator component = targetPrefab.GetComponent(); component.primary = targetPrefab.AddComponent(); SkillFamily val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = ((Object)targetPrefab).name + "PrimaryFamily"; val2.variants = (Variant[])(object)new Variant[0]; component.primary._skillFamily = val2; component.secondary = targetPrefab.AddComponent(); SkillFamily val3 = ScriptableObject.CreateInstance(); ((Object)val3).name = ((Object)targetPrefab).name + "SecondaryFamily"; val3.variants = (Variant[])(object)new Variant[0]; component.secondary._skillFamily = val3; component.utility = targetPrefab.AddComponent(); SkillFamily val4 = ScriptableObject.CreateInstance(); ((Object)val4).name = ((Object)targetPrefab).name + "UtilityFamily"; val4.variants = (Variant[])(object)new Variant[0]; component.utility._skillFamily = val4; component.special = targetPrefab.AddComponent(); SkillFamily val5 = ScriptableObject.CreateInstance(); ((Object)val5).name = ((Object)targetPrefab).name + "SpecialFamily"; val5.variants = (Variant[])(object)new Variant[0]; component.special._skillFamily = val5; component.passiveSkill.enabled = true; component.passiveSkill.skillNameToken = "Where Eagles Dare"; component.passiveSkill.skillDescriptionToken = "The Soldier is capable of propelling himself away from his rockets by standing within the blast radius, granting 25 armor. He also has Source-like airstrafing, and can conserve horizontal momentum by jumping when hitting the ground."; component.passiveSkill.icon = Assets.mainAssetBundle.LoadAsset("texSoldierPassiveIcon"); skillFamilies.Add(val2); skillFamilies.Add(val3); skillFamilies.Add(val4); skillFamilies.Add(val5); } internal static void AddPrimarySkill(GameObject targetPrefab, SkillDef skillDef) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = targetPrefab.GetComponent(); SkillFamily skillFamily = component.primary.skillFamily; Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } internal static void AddSecondarySkill(GameObject targetPrefab, SkillDef skillDef) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = targetPrefab.GetComponent(); SkillFamily skillFamily = component.secondary.skillFamily; Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } internal static void AddSecondarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddSecondarySkill(targetPrefab, skillDef); } } internal static void AddUtilitySkill(GameObject targetPrefab, SkillDef skillDef) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = targetPrefab.GetComponent(); SkillFamily skillFamily = component.utility.skillFamily; Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } internal static void AddUtilitySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddUtilitySkill(targetPrefab, skillDef); } } internal static void AddSpecialSkill(GameObject targetPrefab, SkillDef skillDef) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = targetPrefab.GetComponent(); SkillFamily skillFamily = component.special.skillFamily; Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } internal static void AddSpecialSkills(GameObject targetPrefab, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddSpecialSkill(targetPrefab, skillDef); } } internal static SkillDef CreatePrimarySkillDef(SerializableEntityStateType state, string stateMachine, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, bool agile, int maxStock, int requiredStock, bool pastMax, string[] keywords) { //IL_0025: 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_0063: Unknown result type (might be due to invalid IL or missing references) SkillDef val = ScriptableObject.CreateInstance(); val.skillName = skillNameToken; val.skillNameToken = skillNameToken; val.skillDescriptionToken = skillDescriptionToken; val.icon = skillIcon; val.activationState = state; val.activationStateMachineName = stateMachine; val.baseMaxStock = maxStock; val.baseRechargeInterval = 1.2f; val.beginSkillCooldownOnSkillEnd = false; val.canceledFromSprinting = false; val.forceSprintDuringState = false; val.fullRestockOnAssign = true; val.interruptPriority = (InterruptPriority)1; val.resetCooldownTimerOnUse = true; val.isCombatSkill = true; val.mustKeyPress = false; val.cancelSprintingOnActivation = !agile; val.rechargeStock = requiredStock; val.requiredStock = requiredStock; val.stockToConsume = requiredStock; val.dontAllowPastMaxStocks = pastMax; val.keywordTokens = keywords; skillDefs.Add(val); return val; } internal static SkillDef CreateReloadingPrimarySkillDef(SerializableEntityStateType state, string stateMachine, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, bool agile, int maxStock, int requiredStock, bool pastMax, string[] keywords) { //IL_0025: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00b6: Unknown result type (might be due to invalid IL or missing references) ReloadSkillDef val = ScriptableObject.CreateInstance(); ((SkillDef)val).skillName = skillNameToken; ((SkillDef)val).skillNameToken = skillNameToken; ((SkillDef)val).skillDescriptionToken = skillDescriptionToken; ((SkillDef)val).icon = skillIcon; ((SkillDef)val).activationState = state; ((SkillDef)val).activationStateMachineName = stateMachine; ((SkillDef)val).baseMaxStock = maxStock; ((SkillDef)val).baseRechargeInterval = 1.2f; ((SkillDef)val).beginSkillCooldownOnSkillEnd = false; ((SkillDef)val).canceledFromSprinting = false; ((SkillDef)val).forceSprintDuringState = false; ((SkillDef)val).fullRestockOnAssign = true; ((SkillDef)val).interruptPriority = (InterruptPriority)1; ((SkillDef)val).resetCooldownTimerOnUse = true; ((SkillDef)val).isCombatSkill = true; ((SkillDef)val).mustKeyPress = false; ((SkillDef)val).cancelSprintingOnActivation = !agile; ((SkillDef)val).rechargeStock = 0; ((SkillDef)val).requiredStock = requiredStock; ((SkillDef)val).stockToConsume = requiredStock; val.reloadState = new SerializableEntityStateType(typeof(RocketReload)); val.reloadInterruptPriority = (InterruptPriority)0; val.graceDuration = 0.92f; ((SkillDef)val).keywordTokens = keywords; skillDefs.Add((SkillDef)(object)val); return (SkillDef)(object)val; } internal static SkillDef CreateSkillDef(SkillDefInfo skillDefInfo) { //IL_0039: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) SkillDef val = ScriptableObject.CreateInstance(); val.skillName = skillDefInfo.skillName; val.skillNameToken = skillDefInfo.skillNameToken; val.skillDescriptionToken = skillDefInfo.skillDescriptionToken; val.icon = skillDefInfo.skillIcon; val.activationState = skillDefInfo.activationState; val.activationStateMachineName = skillDefInfo.activationStateMachineName; val.baseMaxStock = skillDefInfo.baseMaxStock; val.baseRechargeInterval = skillDefInfo.baseRechargeInterval; val.beginSkillCooldownOnSkillEnd = skillDefInfo.beginSkillCooldownOnSkillEnd; val.canceledFromSprinting = skillDefInfo.canceledFromSprinting; val.forceSprintDuringState = skillDefInfo.forceSprintDuringState; val.fullRestockOnAssign = skillDefInfo.fullRestockOnAssign; val.interruptPriority = skillDefInfo.interruptPriority; val.resetCooldownTimerOnUse = skillDefInfo.resetCooldownTimerOnUse; val.isCombatSkill = skillDefInfo.isCombatSkill; val.mustKeyPress = skillDefInfo.mustKeyPress; val.cancelSprintingOnActivation = skillDefInfo.cancelSprintingOnActivation; val.rechargeStock = skillDefInfo.rechargeStock; val.requiredStock = skillDefInfo.requiredStock; val.stockToConsume = skillDefInfo.stockToConsume; val.keywordTokens = skillDefInfo.keywordTokens; skillDefs.Add(val); return val; } internal static ReloadSkillDef CreateReloadingSkillDef(SkillDefInfo skillDefInfo) { //IL_0039: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) ReloadSkillDef val = ScriptableObject.CreateInstance(); ((SkillDef)val).skillName = skillDefInfo.skillName; ((SkillDef)val).skillNameToken = skillDefInfo.skillNameToken; ((SkillDef)val).skillDescriptionToken = skillDefInfo.skillDescriptionToken; ((SkillDef)val).icon = skillDefInfo.skillIcon; ((SkillDef)val).activationState = skillDefInfo.activationState; ((SkillDef)val).activationStateMachineName = skillDefInfo.activationStateMachineName; ((SkillDef)val).baseMaxStock = skillDefInfo.baseMaxStock; ((SkillDef)val).baseRechargeInterval = skillDefInfo.baseRechargeInterval; ((SkillDef)val).beginSkillCooldownOnSkillEnd = skillDefInfo.beginSkillCooldownOnSkillEnd; ((SkillDef)val).canceledFromSprinting = skillDefInfo.canceledFromSprinting; ((SkillDef)val).forceSprintDuringState = skillDefInfo.forceSprintDuringState; ((SkillDef)val).fullRestockOnAssign = skillDefInfo.fullRestockOnAssign; ((SkillDef)val).interruptPriority = skillDefInfo.interruptPriority; ((SkillDef)val).resetCooldownTimerOnUse = skillDefInfo.resetCooldownTimerOnUse; ((SkillDef)val).isCombatSkill = skillDefInfo.isCombatSkill; ((SkillDef)val).mustKeyPress = skillDefInfo.mustKeyPress; ((SkillDef)val).cancelSprintingOnActivation = skillDefInfo.cancelSprintingOnActivation; ((SkillDef)val).rechargeStock = 0; ((SkillDef)val).requiredStock = skillDefInfo.requiredStock; ((SkillDef)val).stockToConsume = skillDefInfo.stockToConsume; val.reloadState = new SerializableEntityStateType(typeof(ShotgunReload)); val.reloadInterruptPriority = (InterruptPriority)0; val.graceDuration = 1f; ((SkillDef)val).keywordTokens = skillDefInfo.keywordTokens; skillDefs.Add((SkillDef)(object)val); return val; } } internal static class Skins { internal struct SkinDefInfo { internal SkinDef[] BaseSkins; internal Sprite Icon; internal string NameToken; internal UnlockableDef UnlockableDef; internal GameObject RootObject; internal RendererInfo[] RendererInfos; internal MeshReplacement[] MeshReplacements; internal GameObjectActivation[] GameObjectActivations; internal ProjectileGhostReplacement[] ProjectileGhostReplacements; internal MinionSkinReplacement[] MinionSkinReplacements; internal string Name; } internal static SkinDef CreateSkinDef(string skinName, Sprite skinIcon, RendererInfo[] rendererInfos, SkinnedMeshRenderer mainRenderer, GameObject root) { return CreateSkinDef(skinName, skinIcon, rendererInfos, mainRenderer, root, null); } internal static SkinDef CreateSkinDef(string skinName, Sprite skinIcon, RendererInfo[] rendererInfos, SkinnedMeshRenderer mainRenderer, GameObject root, UnlockableDef unlockableDef) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown SkinDefInfo skinDefInfo = default(SkinDefInfo); skinDefInfo.BaseSkins = Array.Empty(); skinDefInfo.GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0]; skinDefInfo.Icon = skinIcon; skinDefInfo.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0]; skinDefInfo.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0]; skinDefInfo.Name = skinName; skinDefInfo.NameToken = skinName; skinDefInfo.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0]; skinDefInfo.RendererInfos = rendererInfos; skinDefInfo.RootObject = root; skinDefInfo.UnlockableDef = unlockableDef; SkinDefInfo skinDefInfo2 = skinDefInfo; SkinDef.Awake += new hook_Awake(DoNothing); SkinDef val = ScriptableObject.CreateInstance(); val.baseSkins = skinDefInfo2.BaseSkins; val.icon = skinDefInfo2.Icon; val.unlockableDef = skinDefInfo2.UnlockableDef; val.rootObject = skinDefInfo2.RootObject; val.rendererInfos = skinDefInfo2.RendererInfos; val.gameObjectActivations = skinDefInfo2.GameObjectActivations; val.meshReplacements = skinDefInfo2.MeshReplacements; val.projectileGhostReplacements = skinDefInfo2.ProjectileGhostReplacements; val.minionSkinReplacements = skinDefInfo2.MinionSkinReplacements; val.nameToken = skinDefInfo2.NameToken; ((Object)val).name = skinDefInfo2.Name; SkinDef.Awake -= new hook_Awake(DoNothing); return val; } private static void DoNothing(orig_Awake orig, SkinDef self) { } } public static class States { internal static List entityStates = new List(); internal static void RegisterStates() { entityStates.Add(typeof(BaseMeleeAttack)); entityStates.Add(typeof(MarketGardener)); entityStates.Add(typeof(Zatoichi)); entityStates.Add(typeof(DisciplinaryAction)); entityStates.Add(typeof(ShotgunShoot)); entityStates.Add(typeof(ReserveShoot)); entityStates.Add(typeof(BaseDeployBanner)); entityStates.Add(typeof(DeployConchBanner)); entityStates.Add(typeof(DeployBuffBanner)); entityStates.Add(typeof(DeployBattalionBanner)); entityStates.Add(typeof(ParachuteToggle)); entityStates.Add(typeof(RocketLauncher)); entityStates.Add(typeof(BeggarsBazookaChargeUp)); entityStates.Add(typeof(BeggarsBazookaFire)); entityStates.Add(typeof(RocketJumper)); entityStates.Add(typeof(AirStrike)); entityStates.Add(typeof(RocketReload)); entityStates.Add(typeof(ShotgunReload)); } } internal static class StaticValues { internal static string descriptionText = "Henry is a skilled fighter who makes use of a wide arsenal of weaponry to take down his foes." + Environment.NewLine + Environment.NewLine + "< ! > Sword is a good all-rounder while Boxing Gloves are better for laying a beatdown on more powerful foes." + Environment.NewLine + Environment.NewLine + "< ! > Pistol is a powerful anti air, with its low cooldown and high damage." + Environment.NewLine + Environment.NewLine + "< ! > Roll has a lingering armor buff that helps to use it aggressively." + Environment.NewLine + Environment.NewLine + "< ! > Bomb can be used to wipe crowds with ease." + Environment.NewLine + Environment.NewLine; internal const float rocketDamageCoefficient = 6f; internal const float bazookaDamageCoefficient = 7f; internal const float bazookaMaxAngleVariance = 4f; internal const float bazookaBurstInitialModifier = 1.5f; internal const float bazookaBurstSubsequentModifier = 0.5f; internal const float rocketJumperDamageCoefficient = 0f; internal const float airStrikeDamageCoefficient = 4f; internal const int airStrikeKillsThreshold = 6; internal const float conchBuffDuration = 15f; internal const float critBuffDuration = 15f; internal const float battalionBuffDuration = 15f; internal const float battalionsArmorAmount = 200f; internal const float deathResistDuration = 7.5f; internal const float deathResistCooldownDuration = 30f; internal const float shotgunDamageCoefficient = 0.65f; internal const float reserveShooterDamageCoefficient = 0.5f; internal const float manntreadsMinDamageCoefficient = 15f; internal const float manntreadsMaxDamageCoefficient = 40f; internal const float shovelDamageCoefficient = 1.5f; internal const float shovelJumpingDamageCoefficient = 25f; internal const float whipDamageCoefficient = 2f; internal const float whipBuffDuration = 40f; internal const float whipBuffAttackBonus = 0.5f; internal const float whipBuffDamageMultiplier = 1.25f; internal const int whipBuffJumpBonus = 1; internal const float whipBuffSpeedMultiplier = 1.5f; internal const float whipBuffCritBonus = 30f; internal const float katanaDamageCoefficient = 5f; internal const float katanaDamageMultiplier = 5f; internal const float katanaHealingHitCoefficient = 0.05f; internal const float katanaHealingKillCoefficient = 0.4f; internal const float katanaEliteStealDuration = 90f; internal const float katanaChanceCoefficient = 0.2f; internal const float rocketJumpForceMultiplier = 6100f; internal const float rocketJumpForceLimit = 4500f; } internal static class Tokens { internal static void AddTokens() { string text = "LEMN_SOLDIERTF2_BODY_"; string text2 = "The Soldier is a seasoned war veteran capable of dealing ranged attacks while staying on the move." + Environment.NewLine + Environment.NewLine; text2 = text2 + "< ! > The Rocket Launcher allows for solid damage, and powerful mobility at the cost of HP." + Environment.NewLine + Environment.NewLine; text2 = text2 + "< ! > The Shotgun is a reliable means of keeping enemies in check, but it falls off at range." + Environment.NewLine + Environment.NewLine; text2 = text2 + "< ! > The Concheror provides a way to offset some of the damage taken when Rocket Jumping." + Environment.NewLine + Environment.NewLine; text2 = text2 + "< ! > The Market Gardener inflicts massive damage, if you can successfully land a hit with it when Rocket Jumping." + Environment.NewLine + Environment.NewLine; string text3 = "..and so he left, to fight a new war."; string text4 = "..and so he vanished, forever a civilian."; LanguageAPI.Add(text + "NAME", "Soldier"); LanguageAPI.Add(text + "DESCRIPTION", text2); LanguageAPI.Add(text + "SUBTITLE", "The Explosive Jumper"); LanguageAPI.Add(text + "LORE", "The Soldier finds himself in a bizarre land after angering Merasmus again."); LanguageAPI.Add(text + "OUTRO_FLAVOR", text3); LanguageAPI.Add(text + "OUTRO_FAILURE", text4); LanguageAPI.Add(text + "DEFAULT_SKIN_NAME", "RED"); LanguageAPI.Add(text + "BLU_SKIN_NAME", "BLU"); LanguageAPI.Add(text + "PASSIVE_NAME", "Where Eagles Dare"); LanguageAPI.Add(text + "PASSIVE_DESCRIPTION", "By using Rocket Launcher, The Soldier is capable of Rocket Jumping, significantly increasing his ability to airstrafe."); LanguageAPI.Add(text + "PRIMARY_ROCKET_NAME", "Rocket Launcher"); LanguageAPI.Add(text + "PRIMARY_ROCKET_DESCRIPTION", "Agile. " + $"Fire a rocket, dealing up to {600f}% damage."); LanguageAPI.Add(text + "PRIMARY_BAZOOKA_NAME", "Beggar's Bazooka"); LanguageAPI.Add(text + "PRIMARY_BAZOOKA_DESCRIPTION", "Agile. " + $"Loading. Fire up to 3 rockets, each dealing up to {700f}% damage and deviating from your crosshair by a small amount. On hit, inflicts a debuff that makes subsequent rockets deal increased damage."); LanguageAPI.Add(text + "PRIMARY_JUMPER_NAME", "Rocket Jumper"); LanguageAPI.Add(text + "PRIMARY_JUMPER_DESCRIPTION", "Agile. Fire a rocket, dealing ZERO damage to you and enemies."); LanguageAPI.Add(text + "PRIMARY_AIRSTRIKE_NAME", "Air Strike"); LanguageAPI.Add(text + "PRIMARY_AIRSTRIKE_DESCRIPTION", "Agile. " + $"Fire a rocket, dealing up to {400f}% damage.\nIf Rocket Jumping, fire rockets 60% faster.\nFor every {6} kills, increase the maximum number of rockets by 1."); LanguageAPI.Add(text + "SECONDARY_SHOTGUN_NAME", "Shotgun"); LanguageAPI.Add(text + "SECONDARY_SHOTGUN_DESCRIPTION", "Agile. " + $"Fire a shotgun for 9x{65f}% damage."); LanguageAPI.Add(text + "SECONDARY_RESERVE_SHOOTER_NAME", "Reserve Shooter"); LanguageAPI.Add(text + "SECONDARY_RESERVE_SHOOTER_DESCRIPTION", "Agile. " + $"Fire a shotgun for 9x{50f}% damage.\nIf the enemy is airborne, the attack deals a Mini Crit and applies Death Mark."); LanguageAPI.Add(text + "SECONDARY_MANNTREADS_NAME", "Mantreads"); LanguageAPI.Add(text + "SECONDARY_MANNTREADS_DESCRIPTION", $"Passive. Landing with enough vertical speed deals damage in a small radius.\nDamage is between {1500f}% - {4000f}% depending on your falling speed and is a guaranteed critical strike.\nGrants immunity to fall damage."); LanguageAPI.Add(text + "UTILITY_CONCH_NAME", "Concheror"); LanguageAPI.Add(text + "UTILITY_CONCH_DESCRIPTION", "After a small delay, sound a horn providing 20% lifesteal and 50% movespeed to you and nearby allies."); LanguageAPI.Add(text + "UTILITY_BUFFBANNER_NAME", "Buff Banner"); LanguageAPI.Add(text + "UTILITY_BUFFBANNER_DESCRIPTION", "After a small delay, sound a horn providing Mini Crits and 1.5x attack speed to you and nearby allies."); LanguageAPI.Add(text + "UTILITY_BATTALION_NAME", "Battalion's Backup"); LanguageAPI.Add(text + "UTILITY_BATTALION_DESCRIPTION", $"After a small delay, sound a horn providing {200f} armor and Death Resistance to you and nearby allies."); LanguageAPI.Add(text + "UTILITY_CHUTE_TOGGLE_NAME", "B.A.S.E. Jumper"); LanguageAPI.Add(text + "UTILITY_CHUTE_TOGGLE_DESCRIPTION", "Deploy a parachute, greatly slowing your descent. While active, air control is lowered, but gain 1.2x damage and attack speed."); LanguageAPI.Add(text + "UTILITY_CHUTE_DISABLE_NAME", "Cancel Base Jumper"); LanguageAPI.Add(text + "UTILITY_CHUTE_DISABLE_DESCRIPTION", "Retract the parachute."); LanguageAPI.Add(text + "SPECIAL_SHOVEL_NAME", "Market Gardener"); LanguageAPI.Add(text + "SPECIAL_SHOVEL_DESCRIPTION", $"Swing your shovel, dealing {150f}% damage. If Rocket Jumping, this instead deals {2500f}% damage and is a guaranteed critical strike."); LanguageAPI.Add(text + "SPECIAL_WHIP_NAME", "Disciplinary Action"); LanguageAPI.Add(text + "SPECIAL_WHIP_DESCRIPTION", $"Swing your whip, dealing {200f}% damage. Hitting an ally cleanses most negative effects and grants you and them Motivation for {40f} seconds. Soldier gains an additional 25% damage increase for every Motivated ally nearby."); LanguageAPI.Add(text + "SPECIAL_KATANA_NAME", "Half Zatoichi"); LanguageAPI.Add(text + "SPECIAL_KATANA_DESCRIPTION", $"Overhealing. Dueling. Swing your katana, dealing {500f}% damage. When hitting an enemy, heal for {5f}% of max health. When killing an enemy, heal for {40f}% of max health. Duel elites for additional damage!"); LanguageAPI.Add(text + "MASTERYUNLOCKABLE_ACHIEVEMENT_NAME", "Soldier: Mastery"); LanguageAPI.Add(text + "MASTERYUNLOCKABLE_ACHIEVEMENT_DESC", "As Soldier, beat the game or obliterate on Monsoon."); LanguageAPI.Add(text + "MASTERYUNLOCKABLE_UNLOCKABLE_NAME", "Soldier: Mastery"); } } internal static class Unlockables { internal struct UnlockableInfo { internal string Name; internal Func HowToUnlockString; internal Func UnlockedString; internal int SortScore; } private static readonly HashSet usedRewardIds = new HashSet(); internal static List achievementDefs = new List(); internal static List unlockableDefs = new List(); private static readonly List<(AchievementDef achDef, UnlockableDef unlockableDef, string unlockableName)> moddedUnlocks = new List<(AchievementDef, UnlockableDef, string)>(); private static bool addingUnlockables; public static bool ableToAdd { get; private set; } = false; internal static UnlockableDef CreateNewUnlockable(UnlockableInfo unlockableInfo) { UnlockableDef val = ScriptableObject.CreateInstance(); val.nameToken = unlockableInfo.Name; val.cachedName = unlockableInfo.Name; val.getHowToUnlockString = unlockableInfo.HowToUnlockString; val.getUnlockedString = unlockableInfo.UnlockedString; val.sortScore = unlockableInfo.SortScore; return val; } public static UnlockableDef AddUnlockable(bool serverTracked) where TUnlockable : BaseAchievement, IModdedUnlockableDataProvider, new() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0064: 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_0086: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Expected O, but got Unknown //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Expected O, but got Unknown TUnlockable val = new TUnlockable(); string unlockableIdentifier = val.UnlockableIdentifier; if (!usedRewardIds.Add(unlockableIdentifier)) { throw new InvalidOperationException("The unlockable identifier '" + unlockableIdentifier + "' is already used by another mod or the base game."); } AchievementDef val2 = new AchievementDef { identifier = val.AchievementIdentifier, unlockableRewardIdentifier = val.UnlockableIdentifier, prerequisiteAchievementIdentifier = val.PrerequisiteUnlockableIdentifier, nameToken = val.AchievementNameToken, descriptionToken = val.AchievementDescToken, achievedIcon = val.Sprite, type = val.GetType(), serverTrackerType = (serverTracked ? val.GetType() : null) }; UnlockableInfo unlockableInfo = default(UnlockableInfo); unlockableInfo.Name = val.UnlockableIdentifier; unlockableInfo.HowToUnlockString = val.GetHowToUnlock; unlockableInfo.UnlockedString = val.GetUnlocked; unlockableInfo.SortScore = 200; UnlockableDef val3 = CreateNewUnlockable(unlockableInfo); unlockableDefs.Add(val3); achievementDefs.Add(val2); moddedUnlocks.Add((val2, val3, val.UnlockableIdentifier)); if (!addingUnlockables) { addingUnlockables = true; AchievementManager.CollectAchievementDefs += new Manipulator(CollectAchievementDefs); UnlockableCatalog.Init += new Manipulator(Init_Il); } return val3; } public static ILCursor CallDel_(this ILCursor cursor, TDelegate target, out int index) where TDelegate : Delegate { index = cursor.EmitDelegate(target); return cursor; } public static ILCursor CallDel_(this ILCursor cursor, TDelegate target) where TDelegate : Delegate { int index; return cursor.CallDel_(target, out index); } private static void Init_Il(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) new ILCursor(il).GotoNext((MoveType)1, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(UnlockableCatalog), "SetUnlockableDefs") }).CallDel_(ArrayHelper.AppendDel(unlockableDefs)); } private static void CollectAchievementDefs(ILContext il) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0086: 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_00b2: Unknown result type (might be due to invalid IL or missing references) FieldInfo field = typeof(AchievementManager).GetField("achievementIdentifiers", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if ((object)field == null) { throw new NullReferenceException("Could not find field in AchievementManager"); } ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchEndfinally(x), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1) }); val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldsfld, field); val.EmitDelegate, Dictionary, List>>((Action, Dictionary, List>)EmittedDelegate); val.Emit(OpCodes.Ldloc_1); static void EmittedDelegate(List list, Dictionary map, List identifiers) { ableToAdd = false; for (int i = 0; i < moddedUnlocks.Count; i++) { var (val2, val3, text) = moddedUnlocks[i]; if (val2 != null) { identifiers.Add(val2.identifier); list.Add(val2); map.Add(val2.identifier, val2); } } } } } internal interface IModdedUnlockableDataProvider { string AchievementIdentifier { get; } string UnlockableIdentifier { get; } string AchievementNameToken { get; } string PrerequisiteUnlockableIdentifier { get; } string UnlockableNameToken { get; } string AchievementDescToken { get; } Sprite Sprite { get; } Func GetHowToUnlock { get; } Func GetUnlocked { get; } } internal abstract class ModdedUnlockable : BaseAchievement, IModdedUnlockableDataProvider { public abstract string AchievementIdentifier { get; } public abstract string UnlockableIdentifier { get; } public abstract string AchievementNameToken { get; } public abstract string PrerequisiteUnlockableIdentifier { get; } public abstract string UnlockableNameToken { get; } public abstract string AchievementDescToken { get; } public abstract Sprite Sprite { get; } public abstract Func GetHowToUnlock { get; } public abstract Func GetUnlocked { get; } public override bool wantsBodyCallbacks => ((BaseAchievement)this).wantsBodyCallbacks; public void Revoke() { if (((BaseAchievement)this).userProfile.HasAchievement(AchievementIdentifier)) { ((BaseAchievement)this).userProfile.RevokeAchievement(AchievementIdentifier); } ((BaseAchievement)this).userProfile.RevokeUnlockable(UnlockableCatalog.GetUnlockableDef(UnlockableIdentifier)); } public override void OnGranted() { ((BaseAchievement)this).OnGranted(); } public override void OnInstall() { ((BaseAchievement)this).OnInstall(); } public override void OnUninstall() { ((BaseAchievement)this).OnUninstall(); } public override float ProgressForAchievement() { return ((BaseAchievement)this).ProgressForAchievement(); } public override BodyIndex LookUpRequiredBodyIndex() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return ((BaseAchievement)this).LookUpRequiredBodyIndex(); } public override void OnBodyRequirementBroken() { ((BaseAchievement)this).OnBodyRequirementBroken(); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); } } } namespace TF2SoldierMod.Modules.Survivors { internal class Soldier : SurvivorBase { internal static Material soldierMat = Assets.CreateMaterial("soldier_red_full"); internal static Material rocketLauncherMat = Assets.CreateMaterial("w_rocketlauncher01"); internal static Material bazookaMat = Assets.CreateMaterial("c_dumpster_device"); internal static Material airStrikeMat = Assets.CreateMaterial("c_atom_launcher"); internal static Material rocketJumperMat = Assets.CreateMaterial("c_rocketjumper"); internal static Material shotgunMat = Assets.CreateMaterial("w_shotgun"); internal static Material reserveMat = Assets.CreateMaterial("c_army_shotgun"); internal static Material shovelMat = Assets.CreateMaterial("c_etool"); internal static Material katanaMat = Assets.CreateMaterial("c_shogun_katana_soldier"); internal static Material whipMat = Assets.CreateMaterial("c_riding_crop"); internal static Material conchPackMat = Assets.CreateMaterial("c_shogun_warpack_RED"); internal static Material baseJumperMat = Assets.CreateMaterial("c_paratrooper_pack"); internal static Material baseJumperChuteMat = Assets.CreateMaterial("c_paratrooper_pack"); internal static Material buffMat = Assets.CreateMaterial("c_buff_pack"); internal static Material battalionMat = Assets.CreateMaterial("c_battalion_pack"); private static UnlockableDef masterySkinUnlockableDef; internal override string bodyName { get; set; } = "SoldierTF2"; internal override GameObject bodyPrefab { get; set; } internal override GameObject displayPrefab { get; set; } internal override float sortPosition { get; set; } = 100f; internal override ConfigEntry characterEnabled { get; set; } internal override BodyInfo bodyInfo { get; set; } = new BodyInfo { armor = 0f, armorGrowth = 0f, bodyName = "TF2SollyBody", bodyNameToken = "LEMN_SOLDIERTF2_BODY_NAME", bodyColor = Color.grey, characterPortrait = Assets.LoadCharacterIcon("Soldier"), crosshair = Assets.LoadCrosshair("Standard"), damage = 12f, healthGrowth = 33f, healthRegen = 1.5f, jumpCount = 1, maxHealth = 200f, subtitleNameToken = "LEMN_SOLDIERTF2_BODY_SUBTITLE", podPrefab = LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/SurvivorPod") }; internal override int mainRendererIndex { get; set; } = 0; internal override CustomRendererInfo[] customRendererInfos { get; set; } = new CustomRendererInfo[14] { new CustomRendererInfo { childName = "soldier_model", material = soldierMat }, new CustomRendererInfo { childName = "ConcherorPackModel", material = conchPackMat }, new CustomRendererInfo { childName = "BuffPackModel", material = buffMat }, new CustomRendererInfo { childName = "BattalionPackModel", material = battalionMat }, new CustomRendererInfo { childName = "BaseJumperPackModel", material = baseJumperMat }, new CustomRendererInfo { childName = "MarketGardenerModel", material = shovelMat }, new CustomRendererInfo { childName = "ZatoichiModel", material = katanaMat }, new CustomRendererInfo { childName = "WhipModel", material = whipMat }, new CustomRendererInfo { childName = "ShotgunModel", material = shotgunMat }, new CustomRendererInfo { childName = "ReserveShooterModel", material = reserveMat }, new CustomRendererInfo { childName = "RocketLauncherModel", material = rocketLauncherMat }, new CustomRendererInfo { childName = "RocketJumperModel", material = rocketJumperMat }, new CustomRendererInfo { childName = "AirStrikeModel", material = airStrikeMat }, new CustomRendererInfo { childName = "BeggarsBazookaModel", material = bazookaMat } }; internal override Type characterMainState { get; set; } = typeof(GenericCharacterMain); internal override ItemDisplayRuleSet itemDisplayRuleSet { get; set; } internal override List itemDisplayRules { get; set; } internal override UnlockableDef characterUnlockableDef { get; set; } internal override void InitializeCharacter() { //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_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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) base.InitializeCharacter(); CameraTargetParams component = bodyPrefab.GetComponent(); CharacterCameraParams val = ScriptableObject.CreateInstance(); val.data.maxPitch = BlendableFloat.op_Implicit(90f); val.data.minPitch = BlendableFloat.op_Implicit(-90f); val.data.wallCushion = BlendableFloat.op_Implicit(0.1f); val.data.pivotVerticalOffset = BlendableFloat.op_Implicit(1.37f); val.data.idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(0f, 0f, -10f)); component.cameraParams = val; } internal override void InitializeUnlockables() { } internal override void InitializeDoppelganger() { base.InitializeDoppelganger(); } internal override void InitializeHitboxes() { ChildLocator componentInChildren = bodyPrefab.GetComponentInChildren(); GameObject gameObject = ((Component)componentInChildren).gameObject; Transform hitboxTransform = componentInChildren.FindChild("ShovelHitbox"); Prefabs.SetupHitbox(gameObject, hitboxTransform, "Shovel"); Transform hitboxTransform2 = componentInChildren.FindChild("KatanaHitbox"); Prefabs.SetupHitbox(gameObject, hitboxTransform2, "Katana"); } internal override void InitializeSkills() { //IL_0023: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: 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) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_0582: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Unknown result type (might be due to invalid IL or missing references) //IL_06d8: Unknown result type (might be due to invalid IL or missing references) //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_07ae: Unknown result type (might be due to invalid IL or missing references) //IL_07f6: Unknown result type (might be due to invalid IL or missing references) //IL_08c7: Unknown result type (might be due to invalid IL or missing references) //IL_08cc: Unknown result type (might be due to invalid IL or missing references) //IL_0914: Unknown result type (might be due to invalid IL or missing references) //IL_09d0: Unknown result type (might be due to invalid IL or missing references) //IL_09d5: Unknown result type (might be due to invalid IL or missing references) //IL_0a1d: Unknown result type (might be due to invalid IL or missing references) //IL_0ad9: Unknown result type (might be due to invalid IL or missing references) //IL_0ade: Unknown result type (might be due to invalid IL or missing references) //IL_0b26: Unknown result type (might be due to invalid IL or missing references) //IL_0bf7: Unknown result type (might be due to invalid IL or missing references) //IL_0bfc: Unknown result type (might be due to invalid IL or missing references) //IL_0c44: Unknown result type (might be due to invalid IL or missing references) Skills.CreateSkillFamilies(bodyPrefab); string text = "LEMN"; Skills.AddPrimarySkill(bodyPrefab, Skills.CreateReloadingPrimarySkillDef(new SerializableEntityStateType(typeof(RocketLauncher)), "Slide", text + "_SOLDIERTF2_BODY_PRIMARY_ROCKET_NAME", text + "_SOLDIERTF2_BODY_PRIMARY_ROCKET_DESCRIPTION", Assets.mainAssetBundle.LoadAsset("texRocketLauncherIcon"), agile: true, 4, 1, pastMax: true, new string[3] { "KEYWORD_AGILE", "KEYWORD_ROCKETJUMP", "KEYWORD_SELFDAMAGE" })); Skills.AddPrimarySkill(bodyPrefab, Skills.CreatePrimarySkillDef(new SerializableEntityStateType(typeof(BeggarsBazookaChargeUp)), "Slide", text + "_SOLDIERTF2_BODY_PRIMARY_BAZOOKA_NAME", text + "_SOLDIERTF2_BODY_PRIMARY_BAZOOKA_DESCRIPTION", Assets.mainAssetBundle.LoadAsset("texBeggarsBazookaIcon"), agile: true, 3, 0, pastMax: false, new string[4] { "KEYWORD_AGILE", "KEYWORD_ROCKETJUMP", "KEYWORD_SELFDAMAGE", "KEYWORD_LOADING" })); Skills.AddPrimarySkill(bodyPrefab, Skills.CreateReloadingPrimarySkillDef(new SerializableEntityStateType(typeof(RocketJumper)), "Slide", text + "_SOLDIERTF2_BODY_PRIMARY_JUMPER_NAME", text + "_SOLDIERTF2_BODY_PRIMARY_JUMPER_DESCRIPTION", Assets.mainAssetBundle.LoadAsset("texRocketJumperIcon"), agile: true, 4, 1, pastMax: true, new string[2] { "KEYWORD_AGILE", "KEYWORD_ROCKETJUMP" })); Skills.AddPrimarySkill(bodyPrefab, Skills.CreateReloadingPrimarySkillDef(new SerializableEntityStateType(typeof(AirStrike)), "Slide", text + "_SOLDIERTF2_BODY_PRIMARY_AIRSTRIKE_NAME", text + "_SOLDIERTF2_BODY_PRIMARY_AIRSTRIKE_DESCRIPTION", Assets.mainAssetBundle.LoadAsset("texAirStrikeIcon"), agile: true, 4, 1, pastMax: true, new string[3] { "KEYWORD_AGILE", "KEYWORD_ROCKETJUMP", "KEYWORD_SELFDAMAGE" })); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = text + "_SOLDIERTF2_BODY_SECONDARY_SHOTGUN_NAME"; skillDefInfo.skillNameToken = text + "_SOLDIERTF2_BODY_SECONDARY_SHOTGUN_NAME"; skillDefInfo.skillDescriptionToken = text + "_SOLDIERTF2_BODY_SECONDARY_SHOTGUN_DESCRIPTION"; skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset("texShotgunIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(ShotgunShoot)); skillDefInfo.activationStateMachineName = "Weapon"; skillDefInfo.baseMaxStock = 6; skillDefInfo.baseRechargeInterval = 1f; skillDefInfo.beginSkillCooldownOnSkillEnd = true; skillDefInfo.canceledFromSprinting = false; skillDefInfo.forceSprintDuringState = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.interruptPriority = (InterruptPriority)1; skillDefInfo.resetCooldownTimerOnUse = true; skillDefInfo.isCombatSkill = true; skillDefInfo.mustKeyPress = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_AGILE" }; ReloadSkillDef val = Skills.CreateReloadingSkillDef(skillDefInfo); Skills.AddSecondarySkills(bodyPrefab, (SkillDef)val); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = text + "_SOLDIERTF2_BODY_SECONDARY_RESERVE_SHOOTER_NAME"; skillDefInfo.skillNameToken = text + "_SOLDIERTF2_BODY_SECONDARY_RESERVE_SHOOTER_NAME"; skillDefInfo.skillDescriptionToken = text + "_SOLDIERTF2_BODY_SECONDARY_RESERVE_SHOOTER_DESCRIPTION"; skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset("texReserveShooterIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(ReserveShoot)); skillDefInfo.activationStateMachineName = "Weapon"; skillDefInfo.baseMaxStock = 4; skillDefInfo.baseRechargeInterval = 1f; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.forceSprintDuringState = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.interruptPriority = (InterruptPriority)1; skillDefInfo.resetCooldownTimerOnUse = true; skillDefInfo.isCombatSkill = true; skillDefInfo.mustKeyPress = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.keywordTokens = new string[2] { "KEYWORD_AGILE", "KEYWORD_MINICRIT" }; ReloadSkillDef val2 = Skills.CreateReloadingSkillDef(skillDefInfo); Skills.AddSecondarySkills(bodyPrefab, (SkillDef)val2); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = text + "_SOLDIERTF2_BODY_SECONDARY_MANNTREADS_NAME"; skillDefInfo.skillNameToken = text + "_SOLDIERTF2_BODY_SECONDARY_MANNTREADS_NAME"; skillDefInfo.skillDescriptionToken = text + "_SOLDIERTF2_BODY_SECONDARY_MANNTREADS_DESCRIPTION"; skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset("texMannTreadsIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(Manntreads)); skillDefInfo.activationStateMachineName = "Weapon"; skillDefInfo.baseMaxStock = 0; skillDefInfo.baseRechargeInterval = 2.2f; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.forceSprintDuringState = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.interruptPriority = (InterruptPriority)1; skillDefInfo.resetCooldownTimerOnUse = true; skillDefInfo.isCombatSkill = true; skillDefInfo.mustKeyPress = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.rechargeStock = 0; skillDefInfo.requiredStock = 1000; skillDefInfo.stockToConsume = 1; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_PASSIVEONLY" }; SkillDef val3 = Skills.CreateSkillDef(skillDefInfo); Skills.AddSecondarySkills(bodyPrefab, val3); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = text + "_SOLDIERTF2_BODY_UTILITY_CONCH_NAME"; skillDefInfo.skillNameToken = text + "_SOLDIERTF2_BODY_UTILITY_CONCH_NAME"; skillDefInfo.skillDescriptionToken = text + "_SOLDIERTF2_BODY_UTILITY_CONCH_DESCRIPTION"; skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset("texConcherorIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(DeployConchBanner)); skillDefInfo.activationStateMachineName = "Slide"; skillDefInfo.baseMaxStock = 1; skillDefInfo.baseRechargeInterval = 45f; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.forceSprintDuringState = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.isCombatSkill = false; skillDefInfo.mustKeyPress = true; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; SkillDef val4 = Skills.CreateSkillDef(skillDefInfo); Skills.AddUtilitySkills(bodyPrefab, val4); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = text + "_SOLDIERTF2_BODY_UTILITY_BUFFBANNER_NAME"; skillDefInfo.skillNameToken = text + "_SOLDIERTF2_BODY_UTILITY_BUFFBANNER_NAME"; skillDefInfo.skillDescriptionToken = text + "_SOLDIERTF2_BODY_UTILITY_BUFFBANNER_DESCRIPTION"; skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset("texBuffBannerIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(DeployBuffBanner)); skillDefInfo.activationStateMachineName = "Slide"; skillDefInfo.baseMaxStock = 1; skillDefInfo.baseRechargeInterval = 35f; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.forceSprintDuringState = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.isCombatSkill = false; skillDefInfo.mustKeyPress = true; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_MINICRIT" }; SkillDef val5 = Skills.CreateSkillDef(skillDefInfo); Skills.AddUtilitySkills(bodyPrefab, val5); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = text + "_SOLDIERTF2_BODY_UTILITY_BATTALION_NAME"; skillDefInfo.skillNameToken = text + "_SOLDIERTF2_BODY_UTILITY_BATTALION_NAME"; skillDefInfo.skillDescriptionToken = text + "_SOLDIERTF2_BODY_UTILITY_BATTALION_DESCRIPTION"; skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset("texBattalionIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(DeployBattalionBanner)); skillDefInfo.activationStateMachineName = "Slide"; skillDefInfo.baseMaxStock = 1; skillDefInfo.baseRechargeInterval = 40f; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.forceSprintDuringState = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.isCombatSkill = false; skillDefInfo.mustKeyPress = true; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_DEATHRESIST" }; SkillDef val6 = Skills.CreateSkillDef(skillDefInfo); Skills.AddUtilitySkills(bodyPrefab, val6); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = text + "_SOLDIERTF2_BODY_UTILITY_CHUTE_TOGGLE_NAME"; skillDefInfo.skillNameToken = text + "_SOLDIERTF2_BODY_UTILITY_CHUTE_TOGGLE_NAME"; skillDefInfo.skillDescriptionToken = text + "_SOLDIERTF2_BODY_UTILITY_CHUTE_TOGGLE_DESCRIPTION"; skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset("texBaseJumperIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(ParachuteToggle)); skillDefInfo.activationStateMachineName = "Weapon"; skillDefInfo.baseMaxStock = 1; skillDefInfo.baseRechargeInterval = 0.2f; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.forceSprintDuringState = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.isCombatSkill = false; skillDefInfo.mustKeyPress = true; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 0; skillDefInfo.stockToConsume = 0; SkillDef val7 = Skills.CreateSkillDef(skillDefInfo); Skills.AddUtilitySkills(bodyPrefab, val7); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = text + "_SOLDIERTF2_BODY_SPECIAL_SHOVEL_NAME"; skillDefInfo.skillNameToken = text + "_SOLDIERTF2_BODY_SPECIAL_SHOVEL_NAME"; skillDefInfo.skillDescriptionToken = text + "_SOLDIERTF2_BODY_SPECIAL_SHOVEL_DESCRIPTION"; skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset("texMarketGardenerIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(MarketGardener)); skillDefInfo.activationStateMachineName = "Slide"; skillDefInfo.baseMaxStock = 1; skillDefInfo.baseRechargeInterval = 1.2f; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.forceSprintDuringState = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.isCombatSkill = true; skillDefInfo.mustKeyPress = true; skillDefInfo.cancelSprintingOnActivation = true; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; SkillDef val8 = Skills.CreateSkillDef(skillDefInfo); Skills.AddSpecialSkills(bodyPrefab, val8); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = text + "_SOLDIERTF2_BODY_SPECIAL_WHIP_NAME"; skillDefInfo.skillNameToken = text + "_SOLDIERTF2_BODY_SPECIAL_WHIP_NAME"; skillDefInfo.skillDescriptionToken = text + "_SOLDIERTF2_BODY_SPECIAL_WHIP_DESCRIPTION"; skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset("texWhipIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(DisciplinaryAction)); skillDefInfo.activationStateMachineName = "Slide"; skillDefInfo.baseMaxStock = 1; skillDefInfo.baseRechargeInterval = 1.2f; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.forceSprintDuringState = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.isCombatSkill = true; skillDefInfo.mustKeyPress = true; skillDefInfo.cancelSprintingOnActivation = true; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_MOTIVATE" }; SkillDef val9 = Skills.CreateSkillDef(skillDefInfo); Skills.AddSpecialSkills(bodyPrefab, val9); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = text + "_SOLDIERTF2_BODY_SPECIAL_KATANA_NAME"; skillDefInfo.skillNameToken = text + "_SOLDIERTF2_BODY_SPECIAL_KATANA_NAME"; skillDefInfo.skillDescriptionToken = text + "_SOLDIERTF2_BODY_SPECIAL_KATANA_DESCRIPTION"; skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset("texZatoichiIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(Zatoichi)); skillDefInfo.activationStateMachineName = "Slide"; skillDefInfo.baseMaxStock = 1; skillDefInfo.baseRechargeInterval = 1.2f; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.forceSprintDuringState = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.isCombatSkill = true; skillDefInfo.mustKeyPress = true; skillDefInfo.cancelSprintingOnActivation = true; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.keywordTokens = new string[2] { "KEYWORD_OVERHEAL", "KEYWORD_DUELING" }; SkillDef val10 = Skills.CreateSkillDef(skillDefInfo); Skills.AddSpecialSkills(bodyPrefab, val10); } internal override void InitializeSkins() { GameObject gameObject = ((Component)bodyPrefab.GetComponentInChildren().modelTransform).gameObject; CharacterModel component = gameObject.GetComponent(); ModelSkinController val = gameObject.AddComponent(); ChildLocator component2 = gameObject.GetComponent(); SkinnedMeshRenderer mainSkinnedMeshRenderer = component.mainSkinnedMeshRenderer; RendererInfo[] baseRendererInfos = component.baseRendererInfos; List list = new List(); SkinDef val2 = Skins.CreateSkinDef("LEMN_SOLDIERTF2_BODY_DEFAULT_SKIN_NAME", Assets.mainAssetBundle.LoadAsset("texSoldierREDPortraitIcon"), baseRendererInfos, mainSkinnedMeshRenderer, gameObject); val2.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[0]; list.Add(val2); Material val3 = Assets.CreateMaterial("soldier_blu_full"); RendererInfo[] rendererInfos = SkinRendererInfos(baseRendererInfos, (Material[])(object)new Material[4] { val3, val3, val3, val3 }); SkinDef item = Skins.CreateSkinDef("LEMN_SOLDIERTF2_BODY_BLU_SKIN_NAME", Assets.mainAssetBundle.LoadAsset("texSoldierBLUPortraitIcon"), rendererInfos, mainSkinnedMeshRenderer, gameObject); val2.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[0]; list.Add(item); val.skins = list.ToArray(); } internal override void SetItemDisplays() { itemDisplayRules = new List(); itemDisplayRuleSet.keyAssetRuleGroups = itemDisplayRules.ToArray(); itemDisplayRuleSet.GenerateRuntimeValues(); } private static RendererInfo[] SkinRendererInfos(RendererInfo[] defaultRenderers, Material[] materials) { RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[defaultRenderers.Length]; defaultRenderers.CopyTo(array, 0); array[0].defaultMaterial = materials[0]; return array; } } internal abstract class SurvivorBase { internal static SurvivorBase instance; internal abstract string bodyName { get; set; } internal abstract GameObject bodyPrefab { get; set; } internal abstract GameObject displayPrefab { get; set; } internal abstract float sortPosition { get; set; } internal string fullBodyName => bodyName + "Body"; internal abstract ConfigEntry characterEnabled { get; set; } internal abstract UnlockableDef characterUnlockableDef { get; set; } internal abstract BodyInfo bodyInfo { get; set; } internal abstract int mainRendererIndex { get; set; } internal abstract CustomRendererInfo[] customRendererInfos { get; set; } internal abstract Type characterMainState { get; set; } internal abstract ItemDisplayRuleSet itemDisplayRuleSet { get; set; } internal abstract List itemDisplayRules { get; set; } internal virtual void Initialize() { instance = this; InitializeCharacter(); } internal virtual void InitializeCharacter() { //IL_0070: 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_00c6: Unknown result type (might be due to invalid IL or missing references) characterEnabled = Config.CharacterEnableConfig(bodyName); if (characterEnabled.Value) { InitializeUnlockables(); bodyPrefab = Prefabs.CreatePrefab(bodyName + "Body", "mdl" + bodyName, bodyInfo); bodyPrefab.GetComponent().mainStateType = new SerializableEntityStateType(characterMainState); Prefabs.SetupCharacterModel(bodyPrefab, customRendererInfos, mainRendererIndex); displayPrefab = Prefabs.CreateDisplayPrefab(bodyName + "Display", bodyPrefab, bodyInfo); Prefabs.RegisterNewSurvivor(bodyPrefab, displayPrefab, Color.grey, bodyName.ToUpper(), characterUnlockableDef, sortPosition); InitializeHitboxes(); InitializeSkills(); InitializeSkins(); InitializeItemDisplays(); InitializeDoppelganger(); } } internal virtual void InitializeUnlockables() { } internal virtual void InitializeSkills() { } internal virtual void InitializeHitboxes() { } internal virtual void InitializeSkins() { } internal virtual void InitializeDoppelganger() { Prefabs.CreateGenericDoppelganger(instance.bodyPrefab, bodyName + "MonsterMaster", "Merc"); } internal virtual void InitializeItemDisplays() { CharacterModel componentInChildren = bodyPrefab.GetComponentInChildren(); itemDisplayRuleSet = ScriptableObject.CreateInstance(); ((Object)itemDisplayRuleSet).name = "idrs" + bodyName; componentInChildren.itemDisplayRuleSet = itemDisplayRuleSet; } internal virtual void SetItemDisplays() { } } } namespace TF2SoldierMod.Modules.Controllers { public class KillGracePeriod : MonoBehaviour { public static float gracePeriod = Config.killGracePeriod.Value; private List killCache = new List(); private List pendingDelete = new List(); public void FixedUpdate() { pendingDelete.Clear(); foreach (KillCacheEntry item in killCache) { if ((Object)(object)item.skillUsed != (Object)null) { item.timer -= Time.fixedDeltaTime; if (item.timer <= 0f) { pendingDelete.Add(item); } } } foreach (KillCacheEntry item2 in pendingDelete) { killCache.Remove(item2); } pendingDelete.Clear(); } public void TriggerEffects(CharacterBody killerBody, CharacterBody victim) { //IL_00b7: 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_00c3: Invalid comparison between Unknown and I4 //IL_00d7: 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) List list = new List(); bool flag = false; foreach (KillCacheEntry item in killCache) { flag = false; foreach (CharacterBody item2 in list) { if ((Object)(object)item2 == (Object)(object)item.attacker) { flag = true; break; } } if (!flag && (Object)(object)item.attacker != (Object)(object)killerBody && Object.op_Implicit((Object)(object)item.skillUsed) && ((Behaviour)item.skillUsed).isActiveAndEnabled) { list.Add(item.attacker); if ((item.damageType & 0x10000000) > 0) { NetworkingHelpers.ApplyBuff(item.attacker, Buffs.BanditSkull.buffIndex, item.attacker.GetBuffCount(Buffs.BanditSkull.buffIndex) + 1, -1f); } } } killCache.Clear(); } public void AddTimer(CharacterBody b, DamageType dt) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)b.skillLocator)) { KillCacheEntry item = new KillCacheEntry(b, b.skillLocator, gracePeriod, dt); killCache.Add(item); } } public bool HasSkull(CharacterBody b) { //IL_0028: 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_0034: Invalid comparison between Unknown and I4 foreach (KillCacheEntry item in killCache) { if ((Object)(object)item.attacker == (Object)(object)b && (item.damageType & 0x10000000) > 0) { return true; } } return false; } } public class KillCacheEntry { public SkillLocator skillUsed; public CharacterBody attacker; public DamageType damageType; public float timer; public KillCacheEntry(CharacterBody body, SkillLocator skill, float time, DamageType type) { //IL_001e: 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) attacker = body; skillUsed = skill; timer = time; damageType = type; } } } namespace TF2SoldierMod.Modules.Achievements { internal class MasteryAchievement : ModdedUnlockable { public override string AchievementIdentifier { get; } = "LEMN_HENRY_BODY_MASTERYUNLOCKABLE_ACHIEVEMENT_ID"; public override string UnlockableIdentifier { get; } = "LEMN_HENRY_BODY_MASTERYUNLOCKABLE_REWARD_ID"; public override string AchievementNameToken { get; } = "LEMN_HENRY_BODY_MASTERYUNLOCKABLE_ACHIEVEMENT_NAME"; public override string PrerequisiteUnlockableIdentifier { get; } = "LEMN_HENRY_BODY_UNLOCKABLE_REWARD_ID"; public override string UnlockableNameToken { get; } = "LEMN_HENRY_BODY_MASTERYUNLOCKABLE_UNLOCKABLE_NAME"; public override string AchievementDescToken { get; } = "LEMN_HENRY_BODY_MASTERYUNLOCKABLE_ACHIEVEMENT_DESC"; public override Sprite Sprite { get; } = Assets.mainAssetBundle.LoadAsset("texMasteryAchievement"); public override Func GetHowToUnlock { get; } = () => Language.GetStringFormatted("UNLOCK_VIA_ACHIEVEMENT_FORMAT", new object[2] { Language.GetString("LEMN_HENRY_BODY_MASTERYUNLOCKABLE_ACHIEVEMENT_NAME"), Language.GetString("LEMN_HENRY_BODY_MASTERYUNLOCKABLE_ACHIEVEMENT_DESC") }); public override Func GetUnlocked { get; } = () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2] { Language.GetString("LEMN_HENRY_BODY_MASTERYUNLOCKABLE_ACHIEVEMENT_NAME"), Language.GetString("LEMN_HENRY_BODY_MASTERYUNLOCKABLE_ACHIEVEMENT_DESC") }); public override BodyIndex LookUpRequiredBodyIndex() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) return BodyCatalog.FindBodyIndex(SurvivorBase.instance.fullBodyName); } public void ClearCheck(Run run, RunReport runReport) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (run != null && runReport != null && Object.op_Implicit((Object)(object)runReport.gameEnding) && runReport.gameEnding.isWin) { DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(runReport.ruleBook.FindDifficulty()); if (difficultyDef != null && difficultyDef.countsAsHardMode && ((BaseAchievement)this).meetsBodyRequirement) { ((BaseAchievement)this).Grant(); } } } public override void OnInstall() { base.OnInstall(); Run.onClientGameOverGlobal += ClearCheck; } public override void OnUninstall() { base.OnUninstall(); Run.onClientGameOverGlobal -= ClearCheck; } } }