Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of ArtifactOfInferno v1.0.1
ArtifactOfInferno.dll
Decompiled 2 years agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using ArtifactOfInferno.Artifact; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Microsoft.CodeAnalysis; using R2API; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.CharacterAI; using UnityEngine; [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.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("ArtifactOfInferno")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ArtifactOfInferno")] [assembly: AssemblyTitle("ArtifactOfInferno")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ArtifactOfInferno { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("HIFU.ArtifactOfInferno", "ArtifactOfInferno", "1.0.0")] public class Main : BaseUnityPlugin { public const string PluginGUID = "HIFU.ArtifactOfInferno"; public const string PluginAuthor = "HIFU"; public const string PluginName = "ArtifactOfInferno"; public const string PluginVersion = "1.0.0"; public static AssetBundle artifactofinferno; public static ManualLogSource AOILogger; public static ConfigEntry<float> AIScaling { get; set; } public void Awake() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown AOILogger = ((BaseUnityPlugin)this).Logger; artifactofinferno = AssetBundle.LoadFromFile(Assembly.GetExecutingAssembly().Location.Replace("ArtifactOfInferno.dll", "artifactofinferno")); AIScaling = ((BaseUnityPlugin)this).Config.Bind<float>("General", "AI Scaling Coefficient", 1f, "Adds to AI aim and range every cleared stage. Vanilla is 0"); ModSettingsManager.SetModIcon(artifactofinferno.LoadAsset<Sprite>("Assets/ArtifactOfInferno/texArtifactOfInfernoEnabled.png")); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(AIScaling, new StepSliderConfig { min = 0f, max = 3f, increment = 0.1f, restartRequired = false })); IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase)) select type; foreach (Type item in enumerable) { ArtifactBase artifactBase = (ArtifactBase)Activator.CreateInstance(item); artifactBase.Init(((BaseUnityPlugin)this).Config); } } } } namespace ArtifactOfInferno.Artifact { public abstract class ArtifactBase<T> : ArtifactBase where T : ArtifactBase<T> { public static T Instance { get; private set; } public ArtifactBase() { if (Instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ArtifactBase was instantiated twice"); } Instance = this as T; } } public abstract class ArtifactBase { public ArtifactDef ArtifactDef; public abstract string ArtifactName { get; } public abstract string ArtifactLangTokenName { get; } public abstract string ArtifactDescription { get; } public abstract Sprite ArtifactEnabledIcon { get; } public abstract Sprite ArtifactDisabledIcon { get; } public bool ArtifactEnabled => RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef); public abstract void Init(ConfigFile config); protected void CreateLang() { LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_NAME", ArtifactName); LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION", ArtifactDescription); } protected void CreateArtifact() { ArtifactDef = ScriptableObject.CreateInstance<ArtifactDef>(); ArtifactDef.cachedName = "ARTIFACT_" + ArtifactLangTokenName; ArtifactDef.nameToken = "ARTIFACT_" + ArtifactLangTokenName + "_NAME"; ArtifactDef.descriptionToken = "ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION"; ArtifactDef.smallIconSelectedSprite = ArtifactEnabledIcon; ArtifactDef.smallIconDeselectedSprite = ArtifactDisabledIcon; ContentAddition.AddArtifactDef(ArtifactDef); } public abstract void Hooks(); } internal class ArtifactOfInferno : ArtifactBase<ArtifactOfInferno> { public override string ArtifactName => "Artifact of Inferno"; public override string ArtifactLangTokenName => "HIFU_ArtifactOfInferno"; public override string ArtifactDescription => "Enemies are smarter and more accurate."; public override Sprite ArtifactEnabledIcon => Main.artifactofinferno.LoadAsset<Sprite>("Assets/ArtifactOfInferno/texArtifactOfInfernoEnabled.png"); public override Sprite ArtifactDisabledIcon => Main.artifactofinferno.LoadAsset<Sprite>("Assets/ArtifactOfInferno/texArtifactOfInfernoDisabled.png"); public override void Init(ConfigFile config) { CreateLang(); CreateArtifact(); Hooks(); } public override void Hooks() { CharacterMaster.onStartGlobal += CharacterMaster_onStartGlobal; } private void CharacterMaster_onStartGlobal(CharacterMaster master) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 //IL_0c7b: Unknown result type (might be due to invalid IL or missing references) //IL_1747: Unknown result type (might be due to invalid IL or missing references) //IL_07ab: Unknown result type (might be due to invalid IL or missing references) //IL_1068: Unknown result type (might be due to invalid IL or missing references) //IL_07e4: Unknown result type (might be due to invalid IL or missing references) //IL_10a1: Unknown result type (might be due to invalid IL or missing references) //IL_0835: Unknown result type (might be due to invalid IL or missing references) //IL_0c3d: Unknown result type (might be due to invalid IL or missing references) //IL_0aae: Unknown result type (might be due to invalid IL or missing references) //IL_08b0: Unknown result type (might be due to invalid IL or missing references) //IL_10da: Unknown result type (might be due to invalid IL or missing references) //IL_153e: Unknown result type (might be due to invalid IL or missing references) //IL_0af3: Unknown result type (might be due to invalid IL or missing references) //IL_1583: Unknown result type (might be due to invalid IL or missing references) //IL_0a1f: Unknown result type (might be due to invalid IL or missing references) //IL_0cb9: Unknown result type (might be due to invalid IL or missing references) //IL_0a58: Unknown result type (might be due to invalid IL or missing references) if (!ArtifactBase<ArtifactOfInferno>.Instance.ArtifactEnabled || ((int)master.teamIndex != 2 && (int)master.teamIndex != 4)) { return; } CharacterBody body = master.GetBody(); if (!Object.op_Implicit((Object)(object)body)) { return; } if (body.isChampion) { master.inventory.GiveItem(Items.TeleportWhenOob, 1); } if (body.baseJumpPower < 20f) { body.baseJumpPower = 20f; } BaseAI component = ((Component)master).GetComponent<BaseAI>(); if (!Object.op_Implicit((Object)(object)component)) { return; } if (((Object)master).name != "GolemMaster(Clone)") { component.fullVision = true; component.aimVectorDampTime = Mathf.Max(0.001f, 0.031f - 0.0001f * Main.AIScaling.Value * (float)Run.instance.stageClearCount); component.aimVectorMaxSpeed = 250f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; component.enemyAttentionDuration = 1.5f; } else { component.fullVision = true; component.aimVectorDampTime = Mathf.Max(0.001f, 0.09f - 0.0003f * Main.AIScaling.Value * (float)Run.instance.stageClearCount); component.aimVectorMaxSpeed = 250f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; component.enemyAttentionDuration = 1.5f; } string name = ((Object)master).name; string text = name; if (text == null) { return; } switch (text.Length) { case 24: switch (text[8]) { case 'e': if (text == "BeetleQueenMaster(Clone)") { AISkillDriver val45 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Chase" select x).First(); val45.minDistance = 0f; AISkillDriver val46 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "SpawnWards" select x).First(); val46.maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; val46.maxUserHealthFraction = float.PositiveInfinity; } break; case 'p': if (text == "GravekeeperMaster(Clone)") { AISkillDriver val48 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "RunAndShoot" select x).First(); val48.movementType = (MovementType)2; AISkillDriver val49 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Hooks" select x).First(); val49.movementType = (MovementType)2; val49.maxUserHealthFraction = float.PositiveInfinity; val49.minDistance = 13f; AISkillDriver val50 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "WaitAroundUntilSkillIsBack" select x).First(); val50.movementType = (MovementType)2; } break; case 'u': if (text == "BrotherHurtMaster(Clone)") { AISkillDriver val52 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "SlamGround" select x).First(); val52.maxUserHealthFraction = float.PositiveInfinity; val52.movementType = (MovementType)2; AISkillDriver val53 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Shoot" select x).First(); val53.movementType = (MovementType)2; } break; case 'a': if (text == "BeetleGuardMaster(Clone)") { AISkillDriver val47 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "FireSunder" select x).First(); val47.maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; } break; case 's': if (text == "ClayBruiserMaster(Clone)") { AISkillDriver val51 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "WalkAndShoot" select x).First(); val51.movementType = (MovementType)2; } break; case 'i': if (text == "GreaterWispMaster(Clone)") { AISkillDriver val44 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.minDistance == 15f select x).First(); val44.movementType = (MovementType)2; val44.maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; } break; } break; case 20: switch (text[1]) { case 'm': if (text == "ImpBossMaster(Clone)") { AISkillDriver val10 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "GroundPound" select x).First(); val10.maxDistance = 12f; AISkillDriver val11 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "FireVoidspikesWhenInRange" select x).First(); val11.movementType = (MovementType)2; val11.minDistance = 16f; AISkillDriver val12 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "BlinkToTarget" select x).First(); val12.minDistance = 33f; } break; case 'r': if (text == "BrotherMaster(Clone)") { AISkillDriver val13 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Sprint and FireLunarShards" select x).First(); val13.minDistance = 0f; val13.maxUserHealthFraction = float.PositiveInfinity; AISkillDriver val14 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Sprint After Target" select x).First(); val14.minDistance = 40f - Main.AIScaling.Value * (float)Run.instance.stageClearCount; AISkillDriver val15 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "DashStrafe" select x).First(); val15.nextHighPriorityOverride = val13; } break; case 'u': if (text == "VultureMaster(Clone)") { } break; case 'a': if (text == "VagrantMaster(Clone)") { AISkillDriver val9 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Chase" select x).First(); val9.minDistance = 25f; } break; } break; case 18: switch (text[0]) { case 'T': if (text == "TitanMaster(Clone)") { AISkillDriver val56 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 3 select x).First(); val56.maxUserHealthFraction = float.PositiveInfinity; val56.minDistance = 16f; val56.movementType = (MovementType)2; AISkillDriver val57 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 2 select x).First(); val57.maxUserHealthFraction = 0.8f; val57.movementType = (MovementType)2; } break; case 'G': if (text == "GolemMaster(Clone)") { AISkillDriver val55 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 1 select x).First(); val55.selectionRequiresAimTarget = true; val55.activationRequiresAimTargetLoS = true; val55.activationRequiresAimConfirmation = true; val55.maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; val55.minDistance = 0f; } break; case 'B': if (text == "BisonMaster(Clone)") { AISkillDriver val54 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 2 select x).First(); val54.minDistance = 0f; val54.maxDistance = 150f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; } break; } break; case 25: switch (text[6]) { case 'V': if (text == "FlyingVerminMaster(Clone)") { AISkillDriver val39 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 0 select x).First(); val39.minDistance = 10f; val39.maxDistance = 40f; } break; case 's': if (text == "MiniMushroomMaster(Clone)") { AISkillDriver val36 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Spore Grenade" select x).First(); val36.maxDistance = 60f + 10f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; AISkillDriver val37 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Path" select x).First(); val37.shouldSprint = true; AISkillDriver val38 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "PathStrafe" select x).First(); val38.shouldSprint = true; } break; case 'g': if (text == "VoidMegaCrabMaster(Clone)") { } break; case 'l': if (text == "RoboBallBossMaster(Clone)") { AISkillDriver val40 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 3 select x).First(); val40.maxUserHealthFraction = 0.5f; } break; case 'r': if (text == "VoidBarnacleMaster(Clone)") { AISkillDriver val35 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Shooty" select x).First(); val35.maxDistance = 100f; } break; } break; case 16: switch (text[0]) { case 'I': if (text == "ImpMaster(Clone)") { AISkillDriver val43 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Slash" select x).First(); val43.maxDistance = 12f; } break; case 'G': if (text == "GupMaster(Clone)") { AISkillDriver val42 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Spike" select x).First(); val42.maxDistance = 14f; } break; } break; case 17: switch (text[0]) { case 'W': if (text == "WispMaster(Clone)") { AISkillDriver val28 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.minDistance == 0f select x).First(); val28.maxDistance = 10f; AISkillDriver val29 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.maxDistance == 30f select x).First(); val29.minDistance = 10f; } break; case 'S': if (text == "ScavMaster(Clone)") { AISkillDriver val24 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Sit" select x).First(); val24.maxUserHealthFraction = 0.75f; AISkillDriver val25 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "FireCannon" select x).First(); val25.maxDistance = 100f; AISkillDriver val26 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "ThrowSack" select x).First(); val26.maxDistance = 100f; AISkillDriver val27 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "UseEquipmentAndFireCannon" select x).First(); val27.maxDistance = 100f; } break; } break; case 26: switch (text[0]) { case 'L': if (text == "LunarExploderMaster(Clone)") { AISkillDriver val7 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "StrafeAndShoot" select x).First(); val7.maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; AISkillDriver val8 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "SprintNodegraphAndShoot" select x).First(); val8.maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; } break; case 'M': if (text == "MegaConstructMaster(Clone)") { AISkillDriver val3 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 0 select x).First(); val3.maxDistance = 60f; val3.minDistance = 0f; AISkillDriver val4 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 2 select x).First(); val4.maxDistance = 60f; val4.minDistance = 0f; AISkillDriver val5 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 3 select x).First(); val5.maxDistance = 60f; val5.minDistance = 0f; AISkillDriver val6 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "StrafeStep" select x).First(); val5.maxDistance = 60f; val5.minDistance = 0f; } break; case 'C': if (text == "ClayGrenadierMaster(Clone)") { AISkillDriver val2 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "FaceSlam" select x).First(); val2.maxDistance = 35f + 7f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; } break; } break; case 22: switch (text[0]) { case 'N': if (text == "NullifierMaster(Clone)") { AISkillDriver val19 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "PanicFireWhenClose" select x).First(); val19.movementType = (MovementType)1; AISkillDriver val20 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "FireAndStrafe" select x).First(); val20.movementType = (MovementType)1; AISkillDriver val21 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "FireAndChase" select x).First(); val21.movementType = (MovementType)1; } break; case 'L': if (text == "LunarWispMaster(Clone)") { AISkillDriver val22 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Back Up" select x).First(); val22.maxDistance = 13f; AISkillDriver val23 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Chase" select x).First(); val23.minDistance = 25f; } break; case 'T': if (text == "TitanGoldMaster(Clone)") { AISkillDriver val17 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 3 select x).First(); val17.maxUserHealthFraction = float.PositiveInfinity; val17.minDistance = 16f; val17.movementType = (MovementType)2; AISkillDriver val18 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 2 select x).First(); val18.maxUserHealthFraction = 0.8f; val18.movementType = (MovementType)2; } break; } break; case 23: switch (text[0]) { case 'H': if (text == "HermitCrabMaster(Clone)") { } break; case 'L': if (text == "LunarGolemMaster(Clone)") { } break; } break; case 27: if (text == "MinorConstructMaster(Clone)") { AISkillDriver val41 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Shooty" select x).First(); val41.maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; } break; case 28: if (text == "LemurianBruiserMaster(Clone)") { AISkillDriver val30 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "StopAndShoot" select x).First(); val30.movementType = (MovementType)1; } break; case 21: if (text == "LemurianMaster(Clone)") { AISkillDriver val31 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "ChaseAndBiteOffNodegraph" select x).First(); val31.maxDistance = 8f; AISkillDriver val32 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "ChaseAndBiteOffNodegraphWhileSlowingDown" select x).First(); val32.maxDistance = 0f; AISkillDriver val33 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "StrafeAndShoot" select x).First(); val33.minDistance = 10f; val33.maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; AISkillDriver val34 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "StrafeIdley" select x).First(); val34.minDistance = 10f; val34.maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; } break; case 19: if (text == "ParentMaster(Clone)") { AISkillDriver val16 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Teleport" select x).First(); val16.maxUserHealthFraction = 1f; } break; case 30: if (text == "SuperRoboBallBossMaster(Clone)") { AISkillDriver val = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "FireAndStop" select x).First(); val.movementType = (MovementType)2; } break; case 29: break; } } } }