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 Scout v0.9.9
plugins/OfficialScoutMod.dll
Decompiled 3 months 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 AncientScepter; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EmotesAPI; using EntityStates; using EntityStates.AI.Walker; using EntityStates.Commando.CommandoWeapon; using HG; using HG.BlendableTypes; using OfficialScoutMod.Modules; using OfficialScoutMod.Modules.Achievements; using OfficialScoutMod.Modules.BaseStates; using OfficialScoutMod.Modules.Characters; using OfficialScoutMod.Modules.Components; using OfficialScoutMod.Scout; using OfficialScoutMod.Scout.Components; using OfficialScoutMod.Scout.Content; using OfficialScoutMod.Scout.SkillStates; using On.RoR2; using On.RoR2.UI; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.EntityLogic; using RoR2.HudOverlay; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using ThreeEyedGames; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.UI; [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 = ".NET Standard 2.1")] [assembly: AssemblyCompany("OfficialScoutMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+9394b556754849734b12c430655b2a8f5c8d91b8")] [assembly: AssemblyProduct("OfficialScoutMod")] [assembly: AssemblyTitle("OfficialScoutMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace OfficialScoutMod { internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void ErrorAssetBundle(string assetName, string bundleName) { Error("failed to load asset, " + assetName + ", because it does not exist in asset bundle, " + bundleName); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.kenko.Scout", "Scout", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class ScoutPlugin : BaseUnityPlugin { public const string MODUID = "com.kenko.Scout"; public const string MODNAME = "Scout"; public const string MODVERSION = "1.0.0"; public const string DEVELOPER_PREFIX = "KENKO"; public static ScoutPlugin instance; public static bool emotesInstalled => Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI"); public static bool scepterInstalled => Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter"); private void Awake() { instance = this; NetworkingAPI.RegisterMessageType<SyncAtomic>(); Log.Init(((BaseUnityPlugin)this).Logger); Language.Init(); new ScoutSurvivor().Initialize(); new ContentPacks().Initialize(); } } } namespace OfficialScoutMod.Scout { public class ScoutSurvivor : SurvivorBase<ScoutSurvivor> { public static class EmotesAPICompat { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Emotes() { GameObject val = ScoutAssets.mainAssetBundle.LoadAsset<GameObject>("scout_emoteskeleton"); CustomEmotesAPI.ImportArmature(characterPrefab, val, 0, true); } } public const string SCOUT_PREFIX = "KENKO_SCOUT_"; internal static GameObject characterPrefab; public static SkillDef swapScepterSkillDef; public override string assetBundleName => "scout"; public override string bodyName => "ScoutBody"; public override string masterName => "ScoutMonsterMaster"; public override string modelPrefabName => "mdlScout"; public override string displayPrefabName => "ScoutDisplay"; public override string survivorTokenPrefix => "KENKO_SCOUT_"; public override BodyInfo bodyInfo => new BodyInfo { bodyName = bodyName, bodyNameToken = "KENKO_SCOUT_NAME", subtitleNameToken = "KENKO_SCOUT_SUBTITLE", characterPortrait = assetBundle.LoadAsset<Texture>("texScoutIcon"), bodyColor = new Color(0.72156864f, 0.8862745f, 0.23921569f), sortPosition = 7f, crosshair = CharacterAssets.LoadCrosshair("SimpleDot"), podPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/SurvivorPod"), damage = ScoutConfig.damage.Value, damageGrowth = ScoutConfig.damageGrowth.Value * ScoutConfig.damage.Value, attackSpeed = ScoutConfig.attackSpeed.Value, attackSpeedGrowth = ScoutConfig.attackSpeedGrowth.Value, crit = ScoutConfig.crit.Value, critGrowth = ScoutConfig.critGrowth.Value, maxHealth = ScoutConfig.maxHealth.Value, healthGrowth = ScoutConfig.healthGrowth.Value * ScoutConfig.maxHealth.Value, healthRegen = ScoutConfig.healthRegen.Value, regenGrowth = ScoutConfig.regenGrowth.Value * ScoutConfig.healthRegen.Value, shield = ScoutConfig.shield.Value, shieldGrowth = ScoutConfig.shieldGrowth.Value * ScoutConfig.shield.Value, armor = ScoutConfig.armor.Value, armorGrowth = ScoutConfig.armorGrowth.Value * ScoutConfig.armor.Value, moveSpeed = ScoutConfig.moveSpeed.Value, moveSpeedGrowth = ScoutConfig.moveSpeedGrowth.Value * ScoutConfig.moveSpeed.Value, jumpPower = ScoutConfig.jumpPower.Value, jumpPowerGrowth = ScoutConfig.jumpPowerGrowth.Value * ScoutConfig.jumpPower.Value, acceleration = ScoutConfig.acceleration.Value, jumpCount = ScoutConfig.jumpCount.Value, autoCalculateLevelStats = ScoutConfig.autoCalculateLevelStats.Value }; public override CustomRendererInfo[] customRendererInfos => new CustomRendererInfo[4] { new CustomRendererInfo { childName = "Model" }, new CustomRendererInfo { childName = "ScatterGunMesh" }, new CustomRendererInfo { childName = "BackBatMesh" }, new CustomRendererInfo { childName = "BatMesh" } }; public override UnlockableDef characterUnlockableDef => ScoutUnlockables.characterUnlockableDef; public override ItemDisplaysBase itemDisplays => new ScoutItemDisplays(); public override AssetBundle assetBundle { get; protected set; } public override GameObject bodyPrefab { get; protected set; } public override CharacterBody prefabCharacterBody { get; protected set; } public override GameObject characterModelObject { get; protected set; } public override CharacterModel prefabCharacterModel { get; protected set; } public override GameObject displayPrefab { get; protected set; } public override void Initialize() { base.Initialize(); } public override void InitializeCharacter() { ScoutConfig.Init(); ScoutUnlockables.Init(); base.InitializeCharacter(); ChildLocator componentInChildren = bodyPrefab.GetComponentInChildren<ChildLocator>(); ((Component)componentInChildren.FindChild("BatMesh")).gameObject.SetActive(false); DamageTypes.Init(); ScoutStates.Init(); ScoutTokens.Init(); ScoutAssets.Init(assetBundle); ScoutBuffs.Init(assetBundle); InitializeEntityStateMachines(); InitializeSkills(); InitializeSkins(); InitializeCharacterMaster(); AdditionalBodySetup(); characterPrefab = bodyPrefab; AddHooks(); } private void AdditionalBodySetup() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_003d: Expected O, but got Unknown AddHitboxes(); bodyPrefab.AddComponent<ScoutController>(); TempVisualEffectAPI.AddTemporaryVisualEffect(ScoutAssets.atomicEffect, new EffectRadius(pee), new EffectCondition(tempAdd), ""); static float pee(CharacterBody body) { return 2f * body.radius; } static bool tempAdd(CharacterBody body) { return body.HasBuff(ScoutBuffs.scoutAtomicBuff); } } public void AddHitboxes() { Prefabs.SetupHitBoxGroup(characterModelObject, "Bat", "BatHitbox"); } public override void InitializeEntityStateMachines() { Prefabs.ClearEntityStateMachines(bodyPrefab); Prefabs.AddMainEntityStateMachine(bodyPrefab, "Body", typeof(MainState), typeof(SpawnTeleporterState)); Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon"); Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon2"); } public override void InitializeSkills() { bodyPrefab.AddComponent<ScoutPassive>(); bodyPrefab.AddComponent<ScoutSwap>(); Skills.CreateSkillFamilies(bodyPrefab); AddPassiveSkills(); AddPrimarySkills(); AddSecondarySkills(); AddUtilitySkills(); AddSpecialSkills(); if (ScoutPlugin.scepterInstalled) { InitializeScepter(); } } private void AddPassiveSkills() { //IL_007a: 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_00bf: Unknown result type (might be due to invalid IL or missing references) ScoutPassive component = bodyPrefab.GetComponent<ScoutPassive>(); SkillLocator component2 = bodyPrefab.GetComponent<SkillLocator>(); component2.passiveSkill.enabled = false; component.doubleJumpPassive = Skills.CreateSkillDef(new SkillDefInfo { skillName = "KENKO_SCOUT_PASSIVE_NAME", skillNameToken = "KENKO_SCOUT_PASSIVE_NAME", skillDescriptionToken = "KENKO_SCOUT_PASSIVE_DESCRIPTION", skillIcon = assetBundle.LoadAsset<Sprite>("texDoubleJumpIcon"), keywordTokens = new string[0], activationState = new SerializableEntityStateType(typeof(Idle)), activationStateMachineName = "", baseMaxStock = 1, baseRechargeInterval = 0f, beginSkillCooldownOnSkillEnd = false, canceledFromSprinting = false, forceSprintDuringState = false, fullRestockOnAssign = true, interruptPriority = (InterruptPriority)0, resetCooldownTimerOnUse = false, isCombatSkill = false, mustKeyPress = false, cancelSprintingOnActivation = false, rechargeStock = 1, requiredStock = 2, stockToConsume = 1 }); Skills.AddPassiveSkills(component.passiveSkillSlot.skillFamily, component.doubleJumpPassive); } private void AddPrimarySkills() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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) //IL_0095: 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_0183: 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_0198: 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_01af: 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_0273: Unknown result type (might be due to invalid IL or missing references) ScoutSwap component = bodyPrefab.GetComponent<ScoutSwap>(); ReloadSkillDefInfo reloadSkillDefInfo = new ReloadSkillDefInfo(); reloadSkillDefInfo.skillName = "SplatterGun"; reloadSkillDefInfo.skillNameToken = "KENKO_SCOUT_PRIMARY_SPLATTERGUN_NAME"; reloadSkillDefInfo.skillDescriptionToken = "KENKO_SCOUT_PRIMARY_SPLATTERGUN_DESCRIPTION"; reloadSkillDefInfo.keywordTokens = new string[1] { Tokens.agileKeyword }; reloadSkillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texShotgunIcon"); reloadSkillDefInfo.activationState = new SerializableEntityStateType(typeof(Shoot)); reloadSkillDefInfo.reloadState = new SerializableEntityStateType(typeof(EnterReload)); reloadSkillDefInfo.activationStateMachineName = "Weapon"; reloadSkillDefInfo.interruptPriority = (InterruptPriority)1; reloadSkillDefInfo.reloadInterruptPriority = (InterruptPriority)0; reloadSkillDefInfo.baseMaxStock = 2; reloadSkillDefInfo.baseRechargeInterval = 0f; reloadSkillDefInfo.rechargeStock = 0; reloadSkillDefInfo.requiredStock = 1; reloadSkillDefInfo.stockToConsume = 1; reloadSkillDefInfo.graceDuration = 0.1f; reloadSkillDefInfo.resetCooldownTimerOnUse = false; reloadSkillDefInfo.fullRestockOnAssign = false; reloadSkillDefInfo.dontAllowPastMaxStocks = false; reloadSkillDefInfo.beginSkillCooldownOnSkillEnd = false; reloadSkillDefInfo.mustKeyPress = true; reloadSkillDefInfo.isCombatSkill = true; reloadSkillDefInfo.canceledFromSprinting = false; reloadSkillDefInfo.cancelSprintingOnActivation = false; reloadSkillDefInfo.forceSprintDuringState = false; ReloadSkillDef val = Skills.CreateReloadSkillDef(reloadSkillDefInfo); Skills.AddPrimarySkills(bodyPrefab, (SkillDef)val); reloadSkillDefInfo = new ReloadSkillDefInfo(); reloadSkillDefInfo.skillName = "Rifle"; reloadSkillDefInfo.skillNameToken = "KENKO_SCOUT_PRIMARY_RIFLE_NAME"; reloadSkillDefInfo.skillDescriptionToken = "KENKO_SCOUT_PRIMARY_RIFLE_DESCRIPTION"; reloadSkillDefInfo.keywordTokens = new string[0]; reloadSkillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texRifleIcon"); reloadSkillDefInfo.activationState = new SerializableEntityStateType(typeof(ShootRifle)); reloadSkillDefInfo.reloadState = new SerializableEntityStateType(typeof(EnterRifleReload)); reloadSkillDefInfo.activationStateMachineName = "Weapon"; reloadSkillDefInfo.interruptPriority = (InterruptPriority)1; reloadSkillDefInfo.reloadInterruptPriority = (InterruptPriority)0; reloadSkillDefInfo.baseMaxStock = 7; reloadSkillDefInfo.baseRechargeInterval = 0f; reloadSkillDefInfo.rechargeStock = 0; reloadSkillDefInfo.requiredStock = 1; reloadSkillDefInfo.stockToConsume = 1; reloadSkillDefInfo.graceDuration = 5f; reloadSkillDefInfo.resetCooldownTimerOnUse = false; reloadSkillDefInfo.fullRestockOnAssign = false; reloadSkillDefInfo.dontAllowPastMaxStocks = false; reloadSkillDefInfo.beginSkillCooldownOnSkillEnd = false; reloadSkillDefInfo.mustKeyPress = false; reloadSkillDefInfo.isCombatSkill = true; reloadSkillDefInfo.canceledFromSprinting = false; reloadSkillDefInfo.cancelSprintingOnActivation = true; reloadSkillDefInfo.forceSprintDuringState = false; ReloadSkillDef val2 = Skills.CreateReloadSkillDef(reloadSkillDefInfo); Skills.AddPrimarySkills(bodyPrefab, (SkillDef)val2); component.batSkillDef = Skills.CreateSkillDef<SteppedSkillDef>(new SkillDefInfo("Bonk", "KENKO_SCOUT_PRIMARY_BONK_NAME", "KENKO_SCOUT_PRIMARY_BONK_DESCRIPTION", assetBundle.LoadAsset<Sprite>("texSwingIcon"), new SerializableEntityStateType(typeof(Swing)))); component.batSkillDef.stepCount = 2; component.batSkillDef.stepGraceDuration = 1f; Skills.AddAdditionalSkills(component.batSkillSlot.skillFamily, (SkillDef)component.batSkillDef); } private void AddSecondarySkills() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //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_017c: Unknown result type (might be due to invalid IL or missing references) ScoutSwap component = bodyPrefab.GetComponent<ScoutSwap>(); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "Toxic Cleaver"; skillDefInfo.skillNameToken = "KENKO_SCOUT_SECONDARY_CLEAVER_NAME"; skillDefInfo.skillDescriptionToken = "KENKO_SCOUT_SECONDARY_CLEAVER_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { Tokens.agileKeyword }; skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texButcherKnifeIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(ThrowCleaver)); skillDefInfo.activationStateMachineName = "Weapon2"; skillDefInfo.interruptPriority = (InterruptPriority)1; skillDefInfo.baseMaxStock = 1; skillDefInfo.baseRechargeInterval = 6f; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.fullRestockOnAssign = false; skillDefInfo.dontAllowPastMaxStocks = false; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.mustKeyPress = false; skillDefInfo.isCombatSkill = true; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.forceSprintDuringState = false; SkillDef val = Skills.CreateSkillDef(skillDefInfo); Skills.AddSecondarySkills(bodyPrefab, val); component.ballSkillDef = Skills.CreateSkillDef(new SkillDefInfo { skillName = "Atomic Spikeball", skillNameToken = "KENKO_SCOUT_SECONDARY_SPIKEDBALL_NAME", skillDescriptionToken = "KENKO_SCOUT_SECONDARY_SPIKEDBALL_DESCRIPTION", keywordTokens = new string[1] { Tokens.agileKeyword }, skillIcon = assetBundle.LoadAsset<Sprite>("texBaseballIcon"), activationState = new SerializableEntityStateType(typeof(HitBaseball)), activationStateMachineName = "Weapon2", interruptPriority = (InterruptPriority)1, baseMaxStock = 1, baseRechargeInterval = 6f, rechargeStock = 1, requiredStock = 1, stockToConsume = 1, resetCooldownTimerOnUse = false, fullRestockOnAssign = false, dontAllowPastMaxStocks = false, beginSkillCooldownOnSkillEnd = false, mustKeyPress = false, isCombatSkill = true, canceledFromSprinting = false, cancelSprintingOnActivation = false, forceSprintDuringState = false }); Skills.AddAdditionalSkills(component.ballSkillSlot.skillFamily, component.ballSkillDef); } private void AddUtilitySkills() { //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_007c: Unknown result type (might be due to invalid IL or missing references) SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "Atomic Blast"; skillDefInfo.skillNameToken = "KENKO_SCOUT_UTILITY_ATOMICBLAST_NAME"; skillDefInfo.skillDescriptionToken = "KENKO_SCOUT_UTILITY_ATOMICBLAST_DESCRIPTION"; skillDefInfo.keywordTokens = new string[2] { Tokens.agileKeyword, Tokens.miniCritsKeyword }; skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texAtomicIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(ActivateAtomic)); skillDefInfo.activationStateMachineName = "Weapon2"; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.baseRechargeInterval = 0f; skillDefInfo.baseMaxStock = 1; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 0; skillDefInfo.stockToConsume = 0; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.dontAllowPastMaxStocks = false; skillDefInfo.mustKeyPress = true; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.isCombatSkill = true; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.forceSprintDuringState = false; SkillDef val = Skills.CreateSkillDef(skillDefInfo); Skills.AddUtilitySkills(bodyPrefab, val); } private void AddSpecialSkills() { //IL_0055: 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_006c: Unknown result type (might be due to invalid IL or missing references) SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "Swap"; skillDefInfo.skillNameToken = "KENKO_SCOUT_SPECIAL_SWAP_NAME"; skillDefInfo.skillDescriptionToken = "KENKO_SCOUT_SPECIAL_SWAP_DESCRIPTION"; skillDefInfo.keywordTokens = new string[0]; skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texSwapIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(SwapWeapon)); skillDefInfo.activationStateMachineName = "Weapon"; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.baseRechargeInterval = 0f; skillDefInfo.baseMaxStock = 1; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 0; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.fullRestockOnAssign = false; skillDefInfo.dontAllowPastMaxStocks = true; skillDefInfo.mustKeyPress = true; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.isCombatSkill = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.forceSprintDuringState = false; SkillDef val = Skills.CreateSkillDef(skillDefInfo); Skills.AddSpecialSkills(bodyPrefab, val); } private void InitializeScepter() { //IL_0055: 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_006c: Unknown result type (might be due to invalid IL or missing references) SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "Swap Scepter"; skillDefInfo.skillNameToken = "KENKO_SCOUT_SPECIAL_SCEPTER_SWAP_NAME"; skillDefInfo.skillDescriptionToken = "KENKO_SCOUT_SPECIAL_SCEPTER_SWAP_DESCRIPTION"; skillDefInfo.keywordTokens = new string[0]; skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texSwapIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(SwapWeapon)); skillDefInfo.activationStateMachineName = "Weapon"; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.baseRechargeInterval = 0f; skillDefInfo.baseMaxStock = 1; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 0; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.dontAllowPastMaxStocks = true; skillDefInfo.mustKeyPress = true; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.isCombatSkill = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.forceSprintDuringState = false; swapScepterSkillDef = Skills.CreateSkillDef(skillDefInfo); ItemBase<AncientScepterItem>.instance.RegisterScepterSkill(swapScepterSkillDef, bodyName, (SkillSlot)3, 0); } public override void InitializeSkins() { ModelSkinController val = ((Component)prefabCharacterModel).gameObject.AddComponent<ModelSkinController>(); ChildLocator component = ((Component)prefabCharacterModel).GetComponent<ChildLocator>(); RendererInfo[] baseRendererInfos = prefabCharacterModel.baseRendererInfos; List<SkinDef> list = new List<SkinDef>(); SkinDef val2 = Skins.CreateSkinDef("DEFAULT_SKIN", assetBundle.LoadAsset<Sprite>("texDefaultSkin"), baseRendererInfos, ((Component)prefabCharacterModel).gameObject); val2.meshReplacements = Skins.getMeshReplacements(assetBundle, baseRendererInfos, "meshScout", "meshSuperShotgun", "meshBackBat", "meshBat"); list.Add(val2); val.skins = list.ToArray(); } public override void InitializeCharacterMaster() { ScoutAI.Init(bodyPrefab, masterName); } private void AddHooks() { //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 HUD.onHudTargetChangedGlobal += HUDSetup; RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); LoadoutPanelController.Rebuild += new hook_Rebuild(LoadoutPanelController_Rebuild); HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(HealthComponent_TakeDamageProcess); SurvivorCatalog.Init += new hook_Init(SurvivorCatalog_Init); } private void SurvivorCatalog_Init(orig_Init orig) { orig.Invoke(); if (ScoutPlugin.emotesInstalled) { EmotesAPICompat.Emotes(); } } private static void LoadoutPanelController_Rebuild(orig_Rebuild orig, LoadoutPanelController self) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); int num = 0; if (self.currentDisplayData.bodyIndex != BodyCatalog.FindBodyIndex("ScoutBody")) { return; } LanguageTextMeshController[] componentsInChildren = ((Component)self).gameObject.GetComponentsInChildren<LanguageTextMeshController>(); foreach (LanguageTextMeshController val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && val.token == "LOADOUT_SKILL_MISC") { if (num == 0) { val.token = "Passive"; num++; } if (num == 1) { val.token = "Swap"; } } } } private void HealthComponent_TakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = self.body; EntityStateMachine component = ((Component)body).GetComponent<EntityStateMachine>(); if (Object.op_Implicit((Object)(object)body) && body.bodyIndex == BodyCatalog.FindBodyIndex("ScoutBody")) { ScoutController component2 = ((Component)body).GetComponent<ScoutController>(); if (!component2.InGracePeriod()) { component2.FillAtomic(-10f, isCrit: false); } } if (DamageAPI.HasModdedDamageType(damageInfo, DamageTypes.AtomicCrits)) { damageInfo.damage *= 1.25f; damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)16384); } if (DamageAPI.HasModdedDamageType(damageInfo, DamageTypes.CleaverBonus) && Object.op_Implicit((Object)(object)component) && (component.state is StunState || body.HasBuff(ScoutBuffs.scoutStunMarker))) { damageInfo.crit = true; damageInfo.damageType &= DamageTypeCombo.op_Implicit((DamageType)(-1048577)); damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)4096); Util.PlaySound("sfx_driver_blood_gurgle", ((Component)self).gameObject); } orig.Invoke(self, damageInfo); if (Object.op_Implicit((Object)(object)body) && body.bodyIndex == BodyCatalog.FindBodyIndex("ScoutBody")) { body.RecalculateStats(); } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { ScoutController component = ((Component)sender).GetComponent<ScoutController>(); HealthComponent component2 = ((Component)sender).GetComponent<HealthComponent>(); SkillLocator component3 = ((Component)sender).GetComponent<SkillLocator>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2) && !sender.HasBuff(ScoutBuffs.scoutAtomicBuff)) { if (component.atomicGauge > 0f) { args.baseMoveSpeedAdd += Util.Remap(component.atomicGauge, 0f, component.maxAtomicGauge, 0f, 3f); } } else if (sender.HasBuff(ScoutBuffs.scoutAtomicBuff)) { args.baseMoveSpeedAdd += 3f; args.attackSpeedMultAdd += 1f; } } internal static void HUDSetup(HUD hud) { //IL_01be: 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_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)hud.targetBodyObject) && Object.op_Implicit((Object)(object)hud.targetMaster) && (Object)(object)hud.targetMaster.bodyPrefab == (Object)(object)characterPrefab && ((NetworkBehaviour)hud.targetMaster).hasAuthority) { Transform parent = ((Component)hud.equipmentIcons[0]).gameObject.transform.parent; Transform val = ((Component)hud).transform.Find("MainContainer").Find("MainUIArea").Find("SpringCanvas") .Find("BottomLeftCluster") .Find("BarRoots") .Find("LevelDisplayCluster"); GameObject val2 = Object.Instantiate<GameObject>(((Component)val).gameObject, ((Component)hud).transform.Find("MainContainer").Find("MainUIArea").Find("SpringCanvas") .Find("BottomLeftCluster")); ((Object)val2).name = "AmmoTracker"; val2.transform.SetParent(((Component)hud).transform.Find("MainContainer").Find("MainUIArea").Find("CrosshairCanvas") .Find("CrosshairExtras")); Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(0)).gameObject); Object.Destroy((Object)(object)val2.GetComponentInChildren<LevelText>()); Object.Destroy((Object)(object)val2.GetComponentInChildren<ExpBar>()); ((Component)val2.transform.Find("LevelDisplayRoot").Find("ValueText")).gameObject.SetActive(false); Object.DestroyImmediate((Object)(object)((Component)val2.transform.Find("ExpBarRoot")).gameObject); ((Component)val2.transform.Find("LevelDisplayRoot")).GetComponent<RectTransform>().anchoredPosition = new Vector2(-12f, 0f); RectTransform component = val2.GetComponent<RectTransform>(); ((Transform)component).localScale = new Vector3(0.8f, 0.8f, 1f); component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(0f, 0f); component.offsetMin = new Vector2(120f, -40f); component.offsetMax = new Vector2(120f, -40f); component.pivot = new Vector2(0.5f, 0f); component.anchoredPosition = new Vector2(50f, 0f); ((Transform)component).localPosition = new Vector3(120f, -40f, 0f); GameObject val3 = Object.Instantiate<GameObject>(ScoutAssets.mainAssetBundle.LoadAsset<GameObject>("WeaponChargeBar")); ((Object)val3).name = "AtomicGauge"; val3.transform.SetParent(((Component)hud).transform.Find("MainContainer").Find("MainUIArea").Find("CrosshairCanvas") .Find("CrosshairExtras")); component = val3.GetComponent<RectTransform>(); ((Transform)component).localScale = new Vector3(0.75f, 0.1f, 1f); component.anchorMin = new Vector2(100f, 2f); component.anchorMax = new Vector2(100f, 2f); component.pivot = new Vector2(0.5f, 0f); component.anchoredPosition = new Vector2(100f, 2f); ((Transform)component).localPosition = new Vector3(100f, 2f, 0f); ((Transform)component).rotation = Quaternion.Euler(new Vector3(0f, 0f, 90f)); AtomicGauge atomicGauge = val2.AddComponent<AtomicGauge>(); atomicGauge.targetHUD = hud; atomicGauge.targetText = ((Component)val2.transform.Find("LevelDisplayRoot").Find("PrefixText")).gameObject.GetComponent<LanguageTextMeshController>(); atomicGauge.durationDisplay = val3; atomicGauge.durationBar = ((Component)val3.transform.GetChild(1)).gameObject.GetComponent<Image>(); atomicGauge.durationBarRed = ((Component)val3.transform.GetChild(0)).gameObject.GetComponent<Image>(); } } } } namespace OfficialScoutMod.Scout.SkillStates { public class ActivateAtomic : BaseScoutSkillState { public override void OnEnter() { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_015a: 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_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: 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_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: 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_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) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: 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) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Expected O, but got Unknown RefreshState(); base.OnEnter(); if (((EntityState)this).characterBody.HasBuff(ScoutBuffs.scoutAtomicBuff) || scoutController.atomicGauge < 1f || !Object.op_Implicit((Object)(object)scoutController)) { return; } scoutController.ActivateAtomic(); if (scoutController.atomicGauge >= 10f) { if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 1.5f); } if (((EntityState)this).isAuthority) { DamageTypeCombo val = DamageTypeCombo.op_Implicit((DamageType)131072); val |= DamageTypeCombo.op_Implicit((DamageType)((scoutController.atomicGauge >= scoutController.maxAtomicGauge / 2f) ? 32 : 0)); val.damageSource = (DamageSource)4; Result val2 = new BlastAttack { attacker = ((EntityState)this).gameObject, procChainMask = default(ProcChainMask), impactEffect = (EffectIndex)(-1), losType = (LoSType)0, damageColorIndex = (DamageColorIndex)0, damageType = val, procCoefficient = Util.Remap(scoutController.atomicGauge, 10f, scoutController.maxAtomicGauge, 0.1f, 1f), bonusForce = Util.Remap(scoutController.atomicGauge, 10f, scoutController.maxAtomicGauge, 50f, 400f) * Vector3.up, baseForce = Util.Remap(scoutController.atomicGauge, 10f, scoutController.maxAtomicGauge, 250f, 2000f), baseDamage = Util.Remap(scoutController.atomicGauge, 10f, scoutController.maxAtomicGauge, 1f * ((BaseState)this).damageStat, ScoutConfig.atomicBlastDamageCoefficient.Value * ((BaseState)this).damageStat), falloffModel = (FalloffModel)0, radius = Util.Remap(scoutController.atomicGauge, 10f, scoutController.maxAtomicGauge, 1f, 16f), position = ((EntityState)this).characterBody.corePosition, attackerFiltering = (AttackerFiltering)2, teamIndex = ((BaseState)this).GetTeam(), inflictor = ((EntityState)this).gameObject, crit = ((BaseState)this).RollCrit() }.Fire(); EffectManager.SpawnEffect(ScoutAssets.atomicImpactEffect, new EffectData { origin = ((EntityState)this).transform.position + Vector3.up * 1.8f, rotation = Quaternion.identity, scale = Util.Remap(scoutController.atomicGauge, 10f, scoutController.maxAtomicGauge, 0.2f, 3f) }, false); } } if (((EntityState)this).isAuthority) { if (!((BaseState)this).isGrounded) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, Util.Remap(scoutController.atomicGauge, 10f, scoutController.maxAtomicGauge, 1f, 16f)); } ((EntityState)this).outer.SetNextStateToMain(); } } } public class EnterReload : BaseScoutSkillState { public static float baseDuration = 0.1f; private float duration => baseDuration / ((BaseState)this).attackSpeedStat; public override void OnEnter() { base.OnEnter(); } public override void FixedUpdate() { base.FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextState((EntityState)(object)new Reload()); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class EnterRifleReload : BaseScoutSkillState { public static float baseDuration = 0.1f; public override void OnEnter() { base.OnEnter(); } public override void FixedUpdate() { //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_006e: Unknown result type (might be due to invalid IL or missing references) base.FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= baseDuration) { Util.PlaySound("sfx_scout_ooa", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)scoutController)) { scoutController.DropCasing(-((Component)((EntityState)this).GetModelBaseTransform()).transform.right * (float)(-Random.Range(4, 12))); } if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextState((EntityState)(object)new RifleReload()); } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class HitBaseball : GenericProjectileBaseState { public static float baseDuration = 0.2f; public static float baseDelayDuration = 0.1f * baseDuration; public GameObject ballPrefab = ScoutAssets.baseballPrefab; public ScoutController scoutController; public override void OnEnter() { scoutController = ((EntityState)this).gameObject.GetComponent<ScoutController>(); base.attackSoundString = "sfx_scout_baseball_hit"; base.baseDuration = baseDuration; base.baseDelayBeforeFiringProjectile = baseDelayDuration; base.damageCoefficient = base.damageCoefficient; base.force = 120f; base.projectilePitchBonus = -3.5f; base.recoilAmplitude = 0.1f; base.bloom = 10f; ((GenericProjectileBaseState)this).OnEnter(); scoutController.SetupStockSecondary2(); } public override void FireProjectile() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_0108: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { Ray val = ((BaseState)this).GetAimRay(); val = ((GenericProjectileBaseState)this).ModifyProjectileAimRay(val); ((Ray)(ref val)).direction = Util.ApplySpread(((Ray)(ref val)).direction, 0f, 0f, 1f, 1f, 0f, base.projectilePitchBonus); ProjectileDamage component = ballPrefab.GetComponent<ProjectileDamage>(); if (scoutController.ModdedDamageType == DamageTypes.AtomicCrits) { DamageAPI.AddModdedDamageType(ref component.damageType, DamageTypes.AtomicCrits); } ProjectileManager.instance.FireProjectile(ballPrefab, ((Ray)(ref val)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref val)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * ScoutConfig.baseballDamageCoefficient.Value, base.force, ((BaseState)this).RollCrit(), (DamageColorIndex)(scoutController.atomicDraining ? 3 : 0), (GameObject)null, -1f, (DamageTypeCombo?)null); if (DamageAPI.HasModdedDamageType(ref component.damageType, DamageTypes.AtomicCrits)) { DamageAPI.RemoveModdedDamageType(ref component.damageType, DamageTypes.AtomicCrits); } } } public override void FixedUpdate() { ((GenericProjectileBaseState)this).FixedUpdate(); } 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)3; } public override void PlayAnimation(float duration) { if (Object.op_Implicit((Object)(object)((EntityState)this).GetModelAnimator())) { ((EntityState)this).PlayAnimation("Gesture, Override", "BatSwing1", "Swing.playbackRate", base.duration * 4.5f, 0f); } } public override void OnExit() { ((GenericProjectileBaseState)this).OnExit(); } } public class MainState : GenericCharacterMain { private Animator animator; public LocalUser localUser; public override void OnEnter() { ((GenericCharacterMain)this).OnEnter(); animator = ((BaseCharacterMain)this).modelAnimator; FindLocalUser(); } private void FindLocalUser() { if (localUser != null || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { return; } foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList) { if ((Object)(object)readOnlyLocalUsers.cachedBody == (Object)(object)((EntityState)this).characterBody) { localUser = readOnlyLocalUsers; break; } } } public override void FixedUpdate() { ((GenericCharacterMain)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)animator)) { bool flag = false; if (!((EntityState)this).characterBody.outOfDanger || !((EntityState)this).characterBody.outOfCombat) { flag = true; } animator.SetBool("inCombat", flag); if (((BaseState)this).isGrounded) { animator.SetFloat("airBlend", 0f); } else { animator.SetFloat("airBlend", 1f); } } } public override void ProcessJump() { //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Expected O, but got Unknown //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Expected O, but got Unknown //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Expected O, but got Unknown if (!((BaseCharacterMain)this).hasCharacterMotor) { return; } bool flag = false; bool flag2 = false; if (!base.jumpInputReceived || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || ((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.maxJumpCount) { return; } int itemCount = ((EntityState)this).characterBody.inventory.GetItemCount(Items.JumpBoost); float num = 1f; float num2 = 1f; if (((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.baseJumpCount) { flag = true; num = 1.5f; num2 = 1.5f; } else if (itemCount > 0 && ((EntityState)this).characterBody.isSprinting) { float num3 = ((EntityState)this).characterBody.acceleration * ((EntityState)this).characterMotor.airControl; if (((EntityState)this).characterBody.moveSpeed > 0f && num3 > 0f) { flag2 = true; float num4 = Mathf.Sqrt(10f * (float)itemCount / num3); float num5 = ((EntityState)this).characterBody.moveSpeed / num3; num = (num4 + num5) / num5; } } if (((EntityState)this).characterMotor.jumpCount == ((EntityState)this).characterBody.baseJumpCount - 1) { Util.PlaySound("sfx_driver_air_dodge", ((EntityState)this).gameObject); } GenericCharacterMain.ApplyJumpVelocity(((EntityState)this).characterMotor, ((EntityState)this).characterBody, num, num2, false); if (((BaseCharacterMain)this).hasModelAnimator) { int layerIndex = ((BaseCharacterMain)this).modelAnimator.GetLayerIndex("Body"); if (layerIndex >= 0) { if (((EntityState)this).characterBody.isSprinting) { ((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("SprintJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex); } else if (flag) { ((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("BonusJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex); } else { ((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("Jump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex); } } } if (flag) { EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/FeatherEffect"), new EffectData { origin = ((EntityState)this).characterBody.footPosition }, true); } else if (((EntityState)this).characterMotor.jumpCount > 0) { EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CharacterLandImpact"), new EffectData { origin = ((EntityState)this).characterBody.footPosition, scale = ((EntityState)this).characterBody.radius }, true); } if (flag2) { EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BoostJumpEffect"), new EffectData { origin = ((EntityState)this).characterBody.footPosition, rotation = Util.QuaternionSafeLookRotation(((EntityState)this).characterMotor.velocity) }, true); } CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.jumpCount++; } } public class Reload : BaseScoutSkillState { public static float baseDuration = 1.4f; private float duration; private float startReload; private bool startReloadPlayed = false; private float startShell; private bool startReloadShell = false; private float shellsIn; private bool endReloadShell = false; private bool dontPlay = false; private bool hasGivenStock; public override void OnEnter() { base.OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; if (scoutController.stagedReload > 0f) { duration = scoutController.stagedReload; } else { scoutController.stagedReload = duration; } startReload = 0.04f * duration; startShell = 0.05f * duration; shellsIn = 0.5f * duration; dontPlay = scoutController.isSwapped; if (dontPlay && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); return; } ((EntityState)this).PlayCrossfade("Gesture, Override", "ReloadShotgun", "Shoot.playbackRate", duration, 0.05f); Util.PlayAttackSpeedSound("sfx_scout_start_reload", ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); } public override void FixedUpdate() { base.FixedUpdate(); if (dontPlay && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); return; } if (((EntityState)this).fixedAge >= startReload && !startReloadPlayed) { scoutController.stagedReload = duration - startReload; startReloadPlayed = true; Util.PlayAttackSpeedSound("sfx_scout_start_reload", ((EntityState)this).gameObject, 1f); } if (((EntityState)this).fixedAge >= startShell && !startReloadShell) { scoutController.stagedReload = duration - startShell; startReloadShell = true; Util.PlayAttackSpeedSound("sfx_scout_shells_out", ((EntityState)this).gameObject, 1f); } if (((EntityState)this).fixedAge >= shellsIn && !endReloadShell) { scoutController.stagedReload = duration - shellsIn; endReloadShell = true; Util.PlayAttackSpeedSound("sfx_scout_shells_in", ((EntityState)this).gameObject, 1f); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { Util.PlayAttackSpeedSound("sfx_scout_end_reload", ((EntityState)this).gameObject, 1f); GiveStock(); scoutController.stagedReload = 0f; ((EntityState)this).outer.SetNextStateToMain(); } } private void GiveStock() { if (!hasGivenStock) { for (int i = ((EntityState)this).skillLocator.primary.stock; i < ((EntityState)this).skillLocator.primary.maxStock; i++) { ((EntityState)this).skillLocator.primary.AddOneStock(); } hasGivenStock = true; } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class RifleReload : BaseScoutSkillState { public static float baseDuration = 1.4f; private float duration; private bool dontPlay = false; private bool hasGivenStock; public override void OnEnter() { base.OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; if (scoutController.stagedReload > 0f) { duration = scoutController.stagedReload; } else { scoutController.stagedReload = duration; } dontPlay = Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.secondary) == scoutController.isSwapped; if (dontPlay && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); return; } ((EntityState)this).PlayAnimation("Gesture, Override", "ReloadRifle", "Shoot.playbackRate", duration, 0f); Util.PlayAttackSpeedSound("sfx_scout_start_reload_rifle", ((EntityState)this).gameObject, 1f); } public override void FixedUpdate() { base.FixedUpdate(); if (dontPlay && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } else if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { Util.PlayAttackSpeedSound("sfx_scout_finish_rifle_reload", ((EntityState)this).gameObject, 1f); GiveStock(); scoutController.stagedReload = 0f; ((EntityState)this).outer.SetNextStateToMain(); } } private void GiveStock() { if (!hasGivenStock) { for (int i = ((EntityState)this).skillLocator.primary.stock; i < ((EntityState)this).skillLocator.primary.maxStock; i++) { ((EntityState)this).skillLocator.primary.AddOneStock(); } hasGivenStock = true; } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class Shoot : BaseScoutSkillState { public static float damageCoefficient = ScoutConfig.shotgunDamageCoefficient.Value; public static float procCoefficient = 0.7f; public float baseDuration = 1.2f; public static int bulletCount = 12; public static float bulletSpread = 8f; public static float bulletRecoil = ScoutConfig.adjustShotgunRecoil.Value; public static float bulletRange = 150f; public static float bulletThiccness = 1f; public float selfForce = 3000f; private float earlyExitTime; protected float duration; protected float fireDuration; protected bool hasFired; private bool isCrit; protected string muzzleString; public override void OnEnter() { base.OnEnter(); ((EntityState)this).characterBody.SetAimTimer(5f); muzzleString = "GunMuzzle"; hasFired = false; duration = baseDuration / ((BaseState)this).attackSpeedStat; isCrit = ((BaseState)this).RollCrit(); earlyExitTime = 0.5f * duration; if (isCrit) { Util.PlaySound("sfx_scout_shoot_crit", ((EntityState)this).gameObject); } else { Util.PlaySound("sfx_scout_shoot", ((EntityState)this).gameObject); } ((EntityState)this).PlayAnimation("Gesture, Override", "FireShotgun", "Shoot.playbackRate", duration * 1.5f, 0f); fireDuration = 0f; } public virtual void FireBullet() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: 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_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: 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_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: 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_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Expected O, but got Unknown //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) if (hasFired) { return; } hasFired = true; if (Object.op_Implicit((Object)(object)scoutController)) { scoutController.DropShell(-((Component)((EntityState)this).GetModelBaseTransform()).transform.right * (float)(-Random.Range(4, 12))); } float num = bulletRecoil / ((BaseState)this).attackSpeedStat; base.AddRecoil2(-0.4f * num, -0.8f * num, -0.3f * num, 0.3f * num); ((EntityState)this).characterBody.AddSpreadBloom(4f); EffectManager.SimpleMuzzleFlash(FireBarrage.effectPrefab, ((EntityState)this).gameObject, muzzleString, false); GameObject tracerEffectPrefab = ScoutAssets.scoutTracer; if (isCrit) { tracerEffectPrefab = ScoutAssets.scoutTracerCrit; } if (((EntityState)this).isAuthority) { float damage = damageCoefficient * ((BaseState)this).damageStat; Ray aimRay = ((BaseState)this).GetAimRay(); float num2 = bulletSpread; float radius = bulletThiccness; float force = 50f; BulletAttack val = new BulletAttack { aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, damage = damage, damageColorIndex = (DamageColorIndex)(scoutController.atomicDraining ? 3 : 0), damageType = DamageTypeCombo.op_Implicit((DamageType)0), falloffModel = (FalloffModel)1, maxDistance = bulletRange, force = force, hitMask = CommonMasks.bullet, isCrit = isCrit, owner = ((EntityState)this).gameObject, muzzleName = muzzleString, smartCollision = true, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, radius = radius, sniper = false, stopperMask = CommonMasks.bullet, weapon = null, tracerEffectPrefab = tracerEffectPrefab, spreadPitchScale = 1f, spreadYawScale = 1f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = FireBarrage.hitEffectPrefab, HitEffectNormal = false }; val.damageType.damageSource = (DamageSource)1; DamageAPI.AddModdedDamageType(val, scoutController.ModdedDamageType); DamageAPI.AddModdedDamageType(val, DamageTypes.FillAtomicShotgun); val.minSpread = 0f; val.maxSpread = 0f; val.bulletCount = 1u; val.Fire(); uint num3 = (uint)(Mathf.CeilToInt((float)bulletCount / 2f) - 1); val.minSpread = 0f; val.maxSpread = num2 / 1.45f; val.bulletCount = num3; val.Fire(); val.minSpread = num2 / 1.45f; val.maxSpread = num2; val.bulletCount = (uint)Mathf.FloorToInt((float)bulletCount / 2f); val.Fire(); if (!((EntityState)this).characterMotor.isGrounded) { ((EntityState)this).characterMotor.ApplyForce(((Ray)(ref aimRay)).direction * (0f - selfForce) * 0.5f, false, false); } } } public override void FixedUpdate() { base.FixedUpdate(); if (((EntityState)this).fixedAge >= fireDuration) { FireBullet(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextState((EntityState)(object)new Reload()); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).fixedAge >= earlyExitTime) { return (InterruptPriority)0; } return (InterruptPriority)1; } } public class ShootRifle : BaseScoutSkillState { public float damageCoefficient = ScoutConfig.rifleDamageCoefficient.Value; public static float procCoefficient = 1f; public static float baseDuration = 0.8f; public static float force = 200f; public static float recoil = ScoutConfig.adjustRifleRecoil.Value; public static float range = 9000f; protected float duration; protected string muzzleString; protected bool isCrit; protected int diamondbackStacks; public string shootSoundString = "sfx_scout_rifle_shoot"; private CameraParamsOverrideHandle camParamsOverrideHandle; private OverlayController overlayController; private float fireTimer; public bool hasFired; protected virtual GameObject tracerPrefab => isCrit ? ScoutAssets.scoutTracerCrit : ScoutAssets.scoutTracer; public virtual FalloffModel falloff => (FalloffModel)0; public override void OnEnter() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) RefreshState(); base.OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).characterBody.SetAimTimer(4f); muzzleString = "GunMuzzle"; isCrit = ((BaseState)this).RollCrit(); shootSoundString = "sfx_scout_rifle_shoot"; overlayController = HudOverlayManager.AddOverlay(((EntityState)this).gameObject, new OverlayCreationParams { prefab = ScoutAssets.headshotOverlay, childLocatorEntry = "ScopeContainer" }); } public override void FixedUpdate() { //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_00fa: 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_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) RefreshState(); base.FixedUpdate(); if (!(scoutController.jamTimer <= 0f)) { return; } fireTimer += Time.fixedDeltaTime; if (!hasFired) { hasFired = true; if (((EntityState)this).isAuthority) { Fire(); } } if (!((EntityState)this).inputBank.skill1.down && fireTimer >= duration) { if (((EntityState)this).skillLocator.primary.stock <= 0) { Util.PlaySound("sfx_scout_ooa", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)scoutController)) { scoutController.DropCasing(-((Component)((EntityState)this).GetModelBaseTransform()).transform.right * (float)(-Random.Range(4, 12))); } if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextState((EntityState)(object)new RifleReload()); } } else if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } else { if (!((EntityState)this).inputBank.skill1.down || !(fireTimer >= duration)) { return; } if (((EntityState)this).skillLocator.primary.stock <= 0) { Util.PlaySound("sfx_scout_ooa", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)scoutController)) { scoutController.DropCasing(-((Component)((EntityState)this).GetModelBaseTransform()).transform.right * (float)(-Random.Range(4, 12))); } if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextState((EntityState)(object)new RifleReload()); } } else { ((EntityState)this).characterBody.SetAimTimer(4f); GenericSkill primary = ((EntityState)this).skillLocator.primary; int stock = primary.stock; primary.stock = stock - 1; Fire(); } } } public void Fire() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019c: 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_01af: 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_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Expected O, but got Unknown //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Expected O, but got Unknown ((EntityState)this).characterBody.isSprinting = false; ((EntityState)this).PlayAnimation("Gesture, Override", "FireRifle", "Shoot.playbackRate", duration * 1.5f, 0f); if (Object.op_Implicit((Object)(object)scoutController)) { scoutController.DropShell(-((Component)((EntityState)this).GetModelBaseTransform()).transform.right * (float)(-Random.Range(4, 12))); } fireTimer = 0f; EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); Util.PlaySound(shootSoundString, ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); base.AddRecoil2(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil); BulletAttack val = new BulletAttack { bulletCount = 1u, aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, damage = damageCoefficient * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, falloffModel = falloff, maxDistance = range, force = force, hitMask = CommonMasks.bullet, minSpread = 0f, maxSpread = ((EntityState)this).characterBody.spreadBloomAngle * 2f, isCrit = isCrit, owner = ((EntityState)this).gameObject, muzzleName = muzzleString, smartCollision = true, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, radius = 0.75f, sniper = false, stopperMask = CommonMasks.bullet, weapon = null, tracerEffectPrefab = tracerPrefab, spreadPitchScale = 1f, spreadYawScale = 1f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = FirePistol2.hitEffectPrefab }; val.damageType.damageSource = (DamageSource)1; DamageAPI.AddModdedDamageType(val, scoutController.ModdedDamageType); DamageAPI.AddModdedDamageType(val, DamageTypes.FillAtomic); val.modifyOutgoingDamageCallback = (ModifyOutgoingDamageCallback)delegate(BulletAttack _bulletAttack, ref BulletHit hitInfo, DamageInfo damageInfo) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0060: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) if (BulletAttack.IsSniperTargetHit(ref hitInfo)) { damageInfo.damage *= 2f; DamageAPI.AddModdedDamageType(damageInfo, DamageTypes.FillAtomicHeadshot); damageInfo.damageColorIndex = (DamageColorIndex)12; EffectData val2 = new EffectData { origin = hitInfo.point, rotation = Quaternion.LookRotation(-hitInfo.direction) }; val2.SetHurtBoxReference(hitInfo.hitHurtBox); EffectManager.SpawnEffect(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Junk/Common/VFX/WeakPointProcEffect.prefab").WaitForCompletion(), val2, true); Util.PlaySound("sfx_driver_headshot", ((EntityState)this).gameObject); } }; val.Fire(); } ((EntityState)this).characterBody.AddSpreadBloom(1.25f); duration = baseDuration / ((EntityState)this).characterBody.attackSpeed; } public override void OnExit() { ((EntityState)this).OnExit(); if (overlayController != null) { HudOverlayManager.RemoveOverlay(overlayController); overlayController = null; } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (fireTimer >= duration) { return (InterruptPriority)0; } return (InterruptPriority)2; } } public class SwapWeapon : BaseScoutSkillState { public override void OnEnter() { RefreshState(); base.OnEnter(); Util.PlaySound("sfx_scout_swap_weapon", ((EntityState)this).gameObject); if (scoutController.isSwapped) { ((EntityState)this).PlayAnimation("Gesture, Override", "SwapToGun", "Swap.playbackRate", 0.65f / ((EntityState)this).characterBody.attackSpeed, 0f); scoutController.SwitchLayer(""); ((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).gameObject, (SkillDef)(object)scoutSwapPassive.batSkillDef, (SkillOverridePriority)4); ((EntityState)this).skillLocator.secondary.UnsetSkillOverride((object)((EntityState)this).gameObject, scoutSwapPassive.ballSkillDef, (SkillOverridePriority)4); if (((EntityState)this).isAuthority) { ((EntityState)this).skillLocator.secondary.RemoveAllStocks(); for (int i = 0; i < scoutController.currentSecondary1Stock; i++) { ((EntityState)this).skillLocator.secondary.AddOneStock(); } } if (((EntityState)this).skillLocator.secondary.stock < ((EntityState)this).skillLocator.secondary.maxStock) { ((EntityState)this).skillLocator.secondary.rechargeStopwatch = scoutController.secondary1CdTimer; } } else { ((EntityState)this).PlayAnimation("Gesture, Override", "SwapToBat", "Swap.playbackRate", 0.65f / ((EntityState)this).characterBody.attackSpeed, 0f); scoutController.SwitchLayer("Body, Bat"); scoutController.jamTimer = ShootRifle.baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).gameObject, (SkillDef)(object)scoutSwapPassive.batSkillDef, (SkillOverridePriority)4); ((EntityState)this).skillLocator.secondary.SetSkillOverride((object)((EntityState)this).gameObject, scoutSwapPassive.ballSkillDef, (SkillOverridePriority)4); if (((EntityState)this).isAuthority) { ((EntityState)this).skillLocator.secondary.RemoveAllStocks(); for (int j = 0; j < scoutController.currentSecondary2Stock; j++) { ((EntityState)this).skillLocator.secondary.AddOneStock(); } } if (((EntityState)this).skillLocator.secondary.stock < ((EntityState)this).skillLocator.secondary.maxStock) { ((EntityState)this).skillLocator.secondary.rechargeStopwatch = scoutController.secondary2CdTimer; } } if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } } public class Swing : BaseMeleeAttack { public override void OnEnter() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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) RefreshState(); hitboxGroupName = "Bat"; damageType = DamageTypeCombo.op_Implicit((DamageType)0); damageSource = (DamageSource)1; damageCoefficient = ScoutConfig.swingDamageCoefficient.Value; procCoefficient = 1f; pushForce = 300f; bonusForce = Vector3.zero; baseDuration = 1.5f; attackStartPercentTime = 0.2f; attackEndPercentTime = 0.3f; earlyExitPercentTime = 0.5f; hitStopDuration = 0.012f; attackRecoil = 0.5f; hitHopVelocity = 4f; swingSoundString = "sfx_driver_swing"; hitSoundString = ""; muzzleString = ((swingIndex % 2 == 0) ? "SwingMuzzle1" : "SwingMuzzle2"); playbackRateParam = "Swing.playbackRate"; swingEffectPrefab = (isAtomic ? ScoutAssets.atomicSwingEffect : ScoutAssets.batSwingEffect); if (isAtomic) { moddedDamageTypeHolder.Add(scoutController.ModdedDamageType); damageType |= DamageTypeCombo.op_Implicit((DamageType)16384); } moddedDamageTypeHolder.Add(DamageTypes.FillAtomic); hitEffectPrefab = ScoutAssets.batHitEffect; impactSound = ScoutAssets.batImpactSoundDef.index; base.OnEnter(); } protected override void OnHitEnemyAuthority() { base.OnHitEnemyAuthority(); } protected override void FireAttack() { //IL_000d: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0045: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; direction.y = Mathf.Max(direction.y, direction.y * 0.5f); ((BaseState)this).FindModelChild("MeleePivot").rotation = Util.QuaternionSafeLookRotation(direction); } base.FireAttack(); } protected override void PlaySwingEffect() { Util.PlaySound(swingSoundString, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)swingEffectPrefab)) { Transform val = ((BaseState)this).FindModelChild(muzzleString); if (Object.op_Implicit((Object)(object)val)) { swingEffectPrefab = Object.Instantiate<GameObject>(swingEffectPrefab, val); } } } protected override void PlayAttackAnimation() { ((EntityState)this).PlayCrossfade("Gesture, Override", "BatSwing" + (1 + swingIndex), playbackRateParam, duration * 1.2f, 0.05f); } } public class ThrowCleaver : GenericProjectileBaseState { public static float baseDuration = 0.2f; public static float baseDelayDuration = 0.1f * baseDuration; public GameObject cleaverPrefab = ScoutAssets.cleaverPrefab; public ScoutController scoutController; public override void OnEnter() { scoutController = ((EntityState)this).gameObject.GetComponent<ScoutController>(); base.attackSoundString = "sfx_scout_cleaver_throw"; base.baseDuration = baseDuration; base.baseDelayBeforeFiringProjectile = baseDelayDuration; base.damageCoefficient = base.damageCoefficient; base.force = 120f; base.projectilePitchBonus = -3.5f; ((GenericProjectileBaseState)this).OnEnter(); scoutController.SetupStockSecondary1(); } public override void FireProjectile() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_0108: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { Ray val = ((BaseState)this).GetAimRay(); val = ((GenericProjectileBaseState)this).ModifyProjectileAimRay(val); ((Ray)(ref val)).direction = Util.ApplySpread(((Ray)(ref val)).direction, 0f, 0f, 1f, 1f, 0f, base.projectilePitchBonus); ProjectileDamage component = cleaverPrefab.GetComponent<ProjectileDamage>(); if (scoutController.ModdedDamageType == DamageTypes.AtomicCrits) { DamageAPI.AddModdedDamageType(ref component.damageType, DamageTypes.AtomicCrits); } ProjectileManager.instance.FireProjectile(cleaverPrefab, ((Ray)(ref val)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref val)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * ScoutConfig.cleaverDamageCoefficient.Value, base.force, ((BaseState)this).RollCrit(), (DamageColorIndex)(scoutController.atomicDraining ? 3 : 0), (GameObject)null, -1f, (DamageTypeCombo?)null); if (DamageAPI.HasModdedDamageType(ref component.damageType, DamageTypes.AtomicCrits)) { DamageAPI.RemoveModdedDamageType(ref component.damageType, DamageTypes.AtomicCrits); } } } public override void FixedUpdate() { ((GenericProjectileBaseState)this).FixedUpdate(); } 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)3; } public override void PlayAnimation(float duration) { if (Object.op_Implicit((Object)(object)((EntityState)this).GetModelAnimator())) { ((EntityState)this).PlayAnimation("Gesture, Override", "ThrowCleaver", "Cleaver.playbackRate", base.duration * 4.5f, 0f); } } } } namespace OfficialScoutMod.Scout.Content { public static class DamageTypes { public static ModdedDamageType Default; public static ModdedDamageType FillAtomic; public static ModdedDamageType FillAtomicShotgun; public static ModdedDamageType FillAtomicHeadshot; public static ModdedDamageType AtomicCrits; public static ModdedDamageType BallStun; public static ModdedDamageType CleaverBonus; internal static void Init() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) Default = DamageAPI.ReserveDamageType(); FillAtomic = DamageAPI.ReserveDamageType(); FillAtomicShotgun = DamageAPI.ReserveDamageType(); FillAtomicHeadshot = DamageAPI.ReserveDamageType(); CleaverBonus = DamageAPI.ReserveDamageType(); AtomicCrits = DamageAPI.ReserveDamageType(); BallStun = DamageAPI.ReserveDamageType(); Hook(); } private static void Hook() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt; SetStateOnHurt.OnTakeDamageServer += new hook_OnTakeDamageServer(SetStateOnHurt_OnTakeDamageServer); } private static void SetStateOnHurt_OnTakeDamageServer(orig_OnTakeDamageServer orig, SetStateOnHurt self, DamageReport damageReport) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { orig.Invoke(self, damageReport); DamageInfo damageInfo = damageReport.damageInfo; GameObject inflictor = damageInfo.inflictor; if (DamageAPI.HasModdedDamageType(damageInfo, BallStun)) { self.SetStun(inflictor.GetComponent<DistanceLobController>().timer * 2f + 1.5f); } } } private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport) { //IL_008e: 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_00a3: 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) DamageInfo damageInfo = damageReport.damageInfo; if (!Object.op_Implicit((Object)(object)damageReport.attackerBody) || !Object.op_Implicit((Object)(object)damageReport.victimBody)) { return; } HealthComponent victim = damageReport.victim; GameObject inflictor = damageInfo.inflictor; CharacterBody victimBody = damageReport.victimBody; EntityStateMachine component = ((Component)victimBody).GetComponent<EntityStateMachine>(); CharacterBody attackerBody = damageReport.attackerBody; GameObject gameObject = damageReport.attacker.gameObject; ScoutController component2 = ((Component)attackerBody).GetComponent<ScoutController>(); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)component2)) { return; } if (DamageAPI.HasModdedDamageType(damageInfo, FillAtomic)) { if (DamageAPI.HasModdedDamageType(damageInfo, FillAtomicHeadshot)) { component2.FillAtomic(10f / attackerBody.skillLocator.utility.cooldownScale + attackerBody.skillLocator.utility.flatCooldownReduction, damageInfo.crit); } else { component2.FillAtomic(5f / attackerBody.skillLocator.utility.cooldownScale + attackerBody.skillLocator.utility.flatCooldownReduction, damageInfo.crit); } attackerBody.RecalculateStats(); } else if (DamageAPI.HasModdedDamageType(damageInfo, FillAtomicShotgun)) { component2.FillAtomic(1f / attackerBody.skillLocator.utility.cooldownScale + attackerBody.skillLocator.utility.flatCooldownReduction, damageInfo.crit); attackerBody.RecalculateStats(); } if (DamageAPI.HasModdedDamageType(damageInfo, BallStun) && Object.op_Implicit((Object)(object)inflictor)) { damageReport.victimBody.AddTimedBuff(ScoutBuffs.scoutStunMarker, inflictor.GetComponent<DistanceLobController>().timer * 2f + 1.5f); } } } public static class ScoutAI { public static void Init(GameObject bodyPrefab, string masterName) { //IL_003a: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) GameObject val = Prefabs.CreateBlankMasterPrefab(bodyPrefab, masterName); BaseAI component = val.GetComponent<BaseAI>(); component.aimVectorDampTime = 0.1f; component.aimVectorMaxSpeed = 360f; AISkillDriver val2 = val.AddComponent<AISkillDriver>(); val2.customName = "Use Primary Swing"; val2.skillSlot = (SkillSlot)0; val2.requiredSkill = null; val2.requireSkillReady = false; val2.requireEquipmentReady = false; val2.minUserHealthFraction = float.NegativeInfinity; val2.maxUserHealthFraction = float.PositiveInfinity; val2.minTargetHealthFraction = float.NegativeInfinity; val2.maxTargetHealthFraction = float.PositiveInfinity; val2.minDistance = 0f; val2.maxDistance = 8f; val2.selectionRequiresTargetLoS = false; val2.selectionRequiresOnGround = false; val2.selectionRequiresAimTarget = false; val2.maxTimesSelected = -1; val2.moveTargetType = (TargetType)0; val2.activationRequiresTargetLoS = false; val2.activationRequiresAimTargetLoS = false; val2.activationRequiresAimConfirmation = false; val2.movementType = (MovementType)1; val2.moveInputScale = 1f; val2.aimType = (AimType)1; val2.ignoreNodeGraph = false; val2.shouldSprint = false; val2.shouldFireEquipment = false; val2.buttonPressType = (ButtonPressType)0; val2.driverUpdateTimerOverride = -1f; val2.resetCurrentEnemyOnNextDriverSelection = false; val2.noRepeat = false; val2.nextHighPriorityOverride = null; AISkillDriver val3 = val.AddComponent<AISkillDriver>(); val3.customName = "Use Secondary Shoot"; val3.skillSlot = (SkillSlot)1; val3.requireSkillReady = true; val3.minDistance = 0f; val3.maxDistance = 25f; val3.selectionRequiresTargetLoS = false; val3.selectionRequiresOnGround = false; val3.selectionRequiresAimTarget = false; val3.maxTimesSelected = -1; val3.moveTargetType = (TargetType)0; val3.activationRequiresTargetLoS = false; val3.activationRequiresAimTargetLoS = false; val3.activationRequiresAimConfirmation = true; val3.movementType = (MovementType)1; val3.moveInputScale = 1f; val3.aimType = (AimType)1; val3.buttonPressType = (ButtonPressType)0; AISkillDriver val4 = val.AddComponent<AISkillDriver>(); val4.customName = "Use Utility Roll"; val4.skillSlot = (SkillSlot)2; val4.requireSkillReady = true; val4.minDistance = 8f; val4.maxDistance = 20f; val4.selectionRequiresTargetLoS = true; val4.selectionRequiresOnGround = false; val4.selectionRequiresAimTarget = false; val4.maxTimesSelected = -1; val4.moveTargetType = (TargetType)0; val4.activationRequiresTargetLoS = false;