Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of TF2SoldierMod v1.3.3
TF2SoldierMod.dll
Decompiled a year ago
The result has been truncated due to the large size, download it to view full contents!
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 <Hook>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<SurvivorBase> Survivors = new List<SurvivorBase>(); public static TF2SoldierPlugin instance; public static ModdedDamageType ReserveShooterHit; public static ModdedDamageType DeathResistor; public static ModdedDamageType ZatoichiHit; public static ModdedDamageType BazookaHit; private Dictionary<CharacterMotor, SoldierMintTeaInfo> info = new Dictionary<CharacterMotor, SoldierMintTeaInfo>(); 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", "<style=cKeywordName><style=cIsDamage>Mini Crit</style></style><style=cSub>Deals <style=cIsDamage>1.5x damage.</style><style=cIsUtility> Activates on-crit items.</style>\nDamage is overridden by regular critical strikes.</style>"); LanguageAPI.Add("KEYWORD_OVERHEAL", "<style=cKeywordName><style=cIsHealing>Overheal</style></style><style=cSub>Healing recieved from this ability is instead <style=cIsHealing>applied as a barrier</style>, if your health is full.</style>"); LanguageAPI.Add("KEYWORD_PASSIVEONLY", "<style=cKeywordName><style=cIsUtility>Passive Only</style></style><style=cSub>This ability cannot be directly used, and instead provides <style=cIsUtility>passive benefits.</style></style>"); LanguageAPI.Add("KEYWORD_ROCKETJUMP", "<style=cKeywordName><style=cIsUtility>Rocket Jumping</style></style><style=cSub>The rockets from this ability <style=cIsUtility>push you back</style> when they explode near you.</style>"); LanguageAPI.Add("KEYWORD_SELFDAMAGE", "<style=cKeywordName><style=cIsHealth>Self Damaging</style></style><style=cSub>The rockets from this ability damage you for <style=cIsHealth>15% of your current health</style> when they explode near you. This damage is <style=cIsUtility>non-lethal.</style></style>"); LanguageAPI.Add("KEYWORD_DEATHRESIST", $"<style=cKeywordName><style=cIsUtility>Death Resist</style></style><style=cSub>Activated when you would have been killed. You <style=cIsUtility>cannot be lowered below 1 health by normal means.</style> Lasts {7.5f} seconds, and has a cooldown of {30f} seconds.</style>"); LanguageAPI.Add("KEYWORD_LOADING", "<style=cKeywordName><style=cIsUtility>Loading</style></style><style=cSub>Holding the button down loads a rocket. Releasing fires all stored rockets. Attempting to load more than the maximum <style=cIsHealth>damages you</style> and <style=cIsUtility>pushes you backward.</style></style>"); LanguageAPI.Add("KEYWORD_MOTIVATE", string.Format("<style=cKeywordName><style=cIsUtility>Motivation</style></style><style=cSub>Increases damage by {0}x, attack speed by {1}%, movement speed by {2}x, critical strike chance by {3}%, and grants {4} additional jump{5}.</style>", 1.25f, 50f, 1.5f, 30f, 1, "")); LanguageAPI.Add("KEYWORD_DUELING", $"<style=cKeywordName><style=cIsDamage>Dueling</style></style><style=cSub>Hitting an elite enemy with this ability has a <style=cIsUtility>{20f}% chance to steal their affix for {90f} seconds.</style>\nKilling an elite enemy with this ability <style=cIsUtility>steals their affix 100% of the time.</style>\nHitting an elite enemy sharing an affix with you with this ability <style=cIsDamage>does {5f}x damage and is a guaranteed critical strike</style>, with a <style=cIsDamage>{20f}% chance to execute them.</style></style>"); } 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<ReadOnlyContentPack> 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<bool>(self, "hasInputBank")) { CharacterMotor motor2 = GetMotor(self); if (motor2 != null) { GetInfo(motor2).GroundedJump = AccessProperty<InputBankTest>(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<HurtBox> 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<CharacterBody>(); } 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<CharacterBody>(); 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<KillGracePeriod>(); if ((Object)(object)killGracePeriod == (Object)null) { killGracePeriod = ((Component)self).gameObject.AddComponent<KillGracePeriod>(); } 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<CharacterBody>().HasBuff(Buffs.conchBuff) && (Object)(object)damageInfo.attacker.GetComponent<CharacterBody>().healthComponent != (Object)(object)self) { damageInfo.attacker.GetComponent<CharacterBody>().healthComponent.Heal(damageInfo.damage * 0.2f, default(ProcChainMask), true); } if ((Object)(object)damageInfo.attacker != (Object)null && flag) { CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>(); 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<CharacterModel>().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<HurtBox> 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<CharacterBody>(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<CharacterMotor>(genericCharacterMain, typeof(EntityState), "characterMotor"); } private T Access<T>(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<T>(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<ProjectileController>().owner = ((EntityState)this).gameObject; if (!Object.op_Implicit((Object)(object)airStrikeRocketPrefab.GetComponent<TF2ExplosionHandler>())) { TF2ExplosionHandler tF2ExplosionHandler = airStrikeRocketPrefab.AddComponent<TF2ExplosionHandler>(); 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<ProjectileController>().owner = ((EntityState)this).gameObject; if (!Object.op_Implicit((Object)(object)bazookaRocketPrefab.GetComponent<TF2ExplosionHandler>())) { TF2ExplosionHandler tF2ExplosionHandler = bazookaRocketPrefab.AddComponent<TF2ExplosionHandler>(); 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<HurtBox> 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<GameObject>("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<Animator>(), "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<Animator>(), "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<GameObject>("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<ProjectileController>().owner = ((EntityState)this).gameObject; if (!Object.op_Implicit((Object)(object)rocketJumperPrefab.GetComponent<TF2JumperExplosionHandler>())) { rocketJumperPrefab.AddComponent<TF2JumperExplosionHandler>(); } 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<ProjectileController>(); explodeRadius = ((ProjectileExplosion)((Component)this).GetComponent<ProjectileImpactExplosion>()).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<CharacterBody>(); TeamMask val = default(TeamMask); ((TeamMask)(ref val)).AddTeam(projectileController.teamFilter.teamIndex); List<HurtBox> 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