Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of MandoGaming v1.4.6
MandoGamingRewrite.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 BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Commando.CommandoWeapon; using EntityStates.Mage.Weapon; using MandoGaming; using MandoGamingRewrite.EntityStates; using MandoGamingRewrite.Keywords; using MandoGamingRewrite.Projectiles; using MandoGamingRewrite.Unlocks; using On.RoR2; using R2API; using RoR2; using RoR2.Achievements; using RoR2.Orbs; using RoR2.Skills; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [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 = "")] [assembly: AssemblyCompany("MandoGamingRewrite")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("MandoGamingRewrite")] [assembly: AssemblyTitle("MandoGamingRewrite")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace MandoGaming { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("HIFU.MandoGaming", "MandoGaming", "1.4.5")] public class Main : BaseUnityPlugin { public const string PluginGUID = "HIFU.MandoGaming"; public const string PluginAuthor = "HIFU"; public const string PluginName = "MandoGaming"; public const string PluginVersion = "1.4.5"; public static ConfigFile MandoGamingConfig; public static ManualLogSource MandoGamingLogger; public static AssetBundle mandogaming; public void Awake() { //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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) MandoGamingLogger = ((BaseUnityPlugin)this).Logger; MandoGamingConfig = ((BaseUnityPlugin)this).Config; mandogaming = AssetBundle.LoadFromFile(Assembly.GetExecutingAssembly().Location.Replace("MandoGamingRewrite.dll", "mandogaming")); Unlocks.Create(); Keywords.Create(); HeavyTapTracer.Create(); PlasmaTapTracer.Create(); IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(SkillDefBase)) select type; MandoGamingLogger.LogInfo((object)"==+----------------==SKILLS==----------------+=="); foreach (Type item in enumerable) { SkillDefBase skillDefBase = (SkillDefBase)Activator.CreateInstance(item); if (ValidateSkillDef(skillDefBase)) { skillDefBase.Init(); } } bool flag = default(bool); ContentAddition.AddEntityState(typeof(HeavyTapState), ref flag); ContentAddition.AddEntityState(typeof(PlasmaTapState), ref flag); ContentAddition.AddEntityState(typeof(PRFRVWildfireStormState), ref flag); } public bool ValidateSkillDef(SkillDefBase sdb) { if (sdb.isEnabled && ((BaseUnityPlugin)this).Config.Bind<bool>(sdb.NameText, "Enable?", true, "Vanilla is false").Value) { return true; } return false; } } public abstract class SkillDefBase { public SkillDef skillDef; public SkillLocator commandoSkillLocator = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoBody.prefab").WaitForCompletion().GetComponent<SkillLocator>(); public abstract string NameToken { get; } public abstract string NameText { get; } public abstract string DescriptionText { get; } public abstract SerializableEntityStateType ActivationState { get; } public abstract string ActivationStateMachineName { get; } public abstract int BaseMaxStock { get; } public abstract float BaseRechargeInterval { get; } public abstract bool BeginSkillCooldownOnSkillEnd { get; } public abstract bool CanceledFromSprinting { get; } public abstract bool CancelSprintingOnActivation { get; } public virtual bool FullRestockOnAssign { get; } = true; public abstract InterruptPriority SkillInterruptPriority { get; } public abstract bool IsCombatSkill { get; } public abstract bool MustKeyPress { get; } public abstract int RechargeStock { get; } public abstract Sprite Icon { get; } public abstract int StockToConsume { get; } public abstract string[] KeywordTokens { get; } public abstract bool ResetCooldownTimerOnUse { get; } public abstract int RequiredStock { get; } public abstract SkillSlot SkillSlot { get; } public virtual bool isEnabled { get; } = true; public abstract UnlockableDef UnlockableDef { get; } public T ConfigOption<T>(T value, string name, string description) { return Main.MandoGamingConfig.Bind<T>(NameText, name, value, description).Value; } public string d(float f) { return f * 100f + "%"; } public virtual void Init() { //IL_007b: 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_0103: 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) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Expected O, but got Unknown //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) string text = "COMMANDO_" + NameToken.ToUpper() + "_NAME"; string text2 = "COMMANDO_" + NameToken.ToUpper() + "_DESCRIPTION"; LanguageAPI.Add(text, NameText); LanguageAPI.Add(text2, DescriptionText); skillDef = ScriptableObject.CreateInstance<SkillDef>(); skillDef.skillNameToken = text; skillDef.skillDescriptionToken = text2; skillDef.activationState = ActivationState; skillDef.activationStateMachineName = ActivationStateMachineName; skillDef.baseMaxStock = BaseMaxStock; skillDef.baseRechargeInterval = BaseRechargeInterval; skillDef.beginSkillCooldownOnSkillEnd = BeginSkillCooldownOnSkillEnd; skillDef.canceledFromSprinting = CanceledFromSprinting; skillDef.cancelSprintingOnActivation = CancelSprintingOnActivation; skillDef.fullRestockOnAssign = FullRestockOnAssign; skillDef.interruptPriority = SkillInterruptPriority; skillDef.isCombatSkill = IsCombatSkill; skillDef.mustKeyPress = MustKeyPress; skillDef.rechargeStock = RechargeStock; skillDef.icon = Icon; skillDef.stockToConsume = StockToConsume; skillDef.keywordTokens = KeywordTokens; skillDef.resetCooldownTimerOnUse = ResetCooldownTimerOnUse; skillDef.requiredStock = RequiredStock; ContentAddition.AddSkillDef(skillDef); SkillFamily skillFamily = commandoSkillLocator.GetSkill(SkillSlot).skillFamily; Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef, unlockableDef = UnlockableDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; Main.MandoGamingLogger.LogInfo((object)("Added " + NameText)); } } public abstract class SkillDefBase<T> : SkillDefBase where T : SkillDefBase<T> { public static T instance { get; set; } public SkillDefBase() { if (instance != null) { throw new InvalidOperationException("Singleton class " + typeof(T).Name + " was instantiated twice"); } instance = this as T; } } } namespace MandoGaming.Skills { public class HeavyTapSD : SkillDefBase { public override string NameToken => "HEAVYTAP"; public override string NameText => "Heavy Tap"; public override string DescriptionText => "<style=cIsDamage>Frictionless</style>. Shoot twice for <style=cIsDamage>2x155% damage</style>."; public override SerializableEntityStateType ActivationState => new SerializableEntityStateType(typeof(HeavyTapState)); public override string ActivationStateMachineName => "Weapon"; public override int BaseMaxStock => 1; public override float BaseRechargeInterval => 1f; public override bool BeginSkillCooldownOnSkillEnd => true; public override bool CanceledFromSprinting => false; public override bool CancelSprintingOnActivation => true; public override InterruptPriority SkillInterruptPriority => (InterruptPriority)0; public override bool IsCombatSkill => true; public override bool MustKeyPress => false; public override int RechargeStock => 0; public override Sprite Icon => Main.mandogaming.LoadAsset<Sprite>("HeavyTap.png"); public override int StockToConsume => 0; public override string[] KeywordTokens => new string[1] { "KEYWORD_FRICTIONLESS" }; public override bool ResetCooldownTimerOnUse => true; public override int RequiredStock => 1; public override SkillSlot SkillSlot => (SkillSlot)0; public override UnlockableDef UnlockableDef => Unlocks.heavyTap; } public class PlasmaTapSD : SkillDefBase { public override string NameToken => "PLASMATAP"; public override string NameText => "Plasma Tap"; public override string DescriptionText => "<style=cIsDamage>Arcing</style>. Fire a burst of lightning that deals <style=cIsDamage>100% damage</style> in a cone."; public override SerializableEntityStateType ActivationState => new SerializableEntityStateType(typeof(PlasmaTapState)); public override string ActivationStateMachineName => "Weapon"; public override int BaseMaxStock => 1; public override float BaseRechargeInterval => 1f; public override bool BeginSkillCooldownOnSkillEnd => false; public override bool CanceledFromSprinting => false; public override bool CancelSprintingOnActivation => true; public override InterruptPriority SkillInterruptPriority => (InterruptPriority)0; public override bool IsCombatSkill => true; public override bool MustKeyPress => false; public override int RechargeStock => 1; public override Sprite Icon => Main.mandogaming.LoadAsset<Sprite>("PlasmaTap.png"); public override int StockToConsume => 0; public override string[] KeywordTokens => new string[1] { "KEYWORD_ARC" }; public override bool ResetCooldownTimerOnUse => true; public override int RequiredStock => 1; public override SkillSlot SkillSlot => (SkillSlot)0; public override UnlockableDef UnlockableDef => Unlocks.plasmaTap; } public class PRFRVWildfireStormSD : SkillDefBase { public override string NameToken => "PRFRVWILDFIRESTORM"; public override string NameText => "PRFR-V Wildfire Storm"; public override string DescriptionText => "Fire a continuous stream of flame that deals <style=cIsDamage>550% damage</style> per second and has a chance to <style=cIsDamage>ignite</style> enemies."; public override SerializableEntityStateType ActivationState => new SerializableEntityStateType(typeof(PRFRVWildfireStormState)); public override string ActivationStateMachineName => "Weapon"; public override int BaseMaxStock => 1; public override float BaseRechargeInterval => 4f; public override bool BeginSkillCooldownOnSkillEnd => false; public override bool CanceledFromSprinting => false; public override bool CancelSprintingOnActivation => true; public override InterruptPriority SkillInterruptPriority => (InterruptPriority)0; public override bool IsCombatSkill => true; public override bool MustKeyPress => true; public override int RechargeStock => 1; public override Sprite Icon => Main.mandogaming.LoadAsset<Sprite>("PRFRVWildfireStorm.png"); public override int StockToConsume => 1; public override string[] KeywordTokens => null; public override bool ResetCooldownTimerOnUse => false; public override int RequiredStock => 1; public override SkillSlot SkillSlot => (SkillSlot)1; public override UnlockableDef UnlockableDef => Unlocks.prfrVWildfireStorm; } } namespace MandoGamingRewrite.Unlocks { [RegisterAchievement("CommandoHeavyTap", "Commando.Skills_HeavyTap", null, null)] public class HeavyTapAchievement : BaseAchievement { private int primaryUseCount; public override BodyIndex LookUpRequiredBodyIndex() { //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_000e: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("CommandoBody"); } public override void OnBodyRequirementMet() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown ((BaseAchievement)this).OnBodyRequirementMet(); CharacterBody.OnSkillActivated += new hook_OnSkillActivated(CharacterBody_OnSkillActivated); TeleporterInteraction.onTeleporterChargedGlobal += TeleporterInteraction_onTeleporterChargedGlobal; Run.onRunStartGlobal += Run_onRunStartGlobal; Stage.onServerStageBegin += Stage_onServerStageBegin; } public override void OnBodyRequirementBroken() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterBody.OnSkillActivated -= new hook_OnSkillActivated(CharacterBody_OnSkillActivated); TeleporterInteraction.onTeleporterChargedGlobal -= TeleporterInteraction_onTeleporterChargedGlobal; Run.onRunStartGlobal -= Run_onRunStartGlobal; Stage.onServerStageBegin -= Stage_onServerStageBegin; ((BaseAchievement)this).OnBodyRequirementBroken(); } private void Run_onRunStartGlobal(Run obj) { primaryUseCount = 0; } private void Stage_onServerStageBegin(Stage obj) { primaryUseCount = 0; } private void TeleporterInteraction_onTeleporterChargedGlobal(TeleporterInteraction _) { if (primaryUseCount == 0) { ((BaseAchievement)this).Grant(); } } private void CharacterBody_OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { LocalUser localUser = ((BaseAchievement)this).localUser; if ((Object)(object)((localUser != null) ? localUser.cachedBody : null) != (Object)null && (Object)(object)self == (Object)(object)((BaseAchievement)this).localUser.cachedBody && (Object)(object)skill == (Object)(object)((BaseAchievement)this).localUser.cachedBody.skillLocator.primary) { primaryUseCount++; } orig.Invoke(self, skill); } } [RegisterAchievement("CommandoPlasmaTap", "Commando.Skills_PlasmaTap", null, null)] public class PlasmaTapAchievement : BaseAchievement { private float zapCount; public override BodyIndex LookUpRequiredBodyIndex() { //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_000e: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("CommandoBody"); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt; Run.onRunStartGlobal += Run_onRunStartGlobal; } public override void OnBodyRequirementBroken() { GlobalEventManager.onServerDamageDealt -= GlobalEventManager_onServerDamageDealt; Run.onRunStartGlobal -= Run_onRunStartGlobal; ((BaseAchievement)this).OnBodyRequirementBroken(); } private void Run_onRunStartGlobal(Run obj) { zapCount = 0f; } private void GlobalEventManager_onServerDamageDealt(DamageReport damageReport) { LocalUser localUser = ((BaseAchievement)this).localUser; if ((Object)(object)((localUser != null) ? localUser.cachedBody : null) != (Object)null && (Object)(object)((BaseAchievement)this).localUser.cachedBody == (Object)(object)damageReport.attackerBody) { if (((ProcChainMask)(ref damageReport.damageInfo.procChainMask)).HasProc((ProcType)3)) { zapCount += 1f; } if (zapCount >= 70f) { ((BaseAchievement)this).Grant(); } } } } [RegisterAchievement("CommandoPRFRVWildfireStorm", "Commando.Skills_PRFRVWildfireStorm", null, null)] public class PRFRVWildfireStormAchievement : BaseAchievement { private float igniteCount; public override BodyIndex LookUpRequiredBodyIndex() { //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_000e: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("CommandoBody"); } public override void OnBodyRequirementMet() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown ((BaseAchievement)this).OnBodyRequirementMet(); GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt; GlobalEventManager.ProcIgniteOnKill += new hook_ProcIgniteOnKill(GlobalEventManager_ProcIgniteOnKill); Run.onRunStartGlobal += Run_onRunStartGlobal; Stage.onServerStageBegin += Stage_onServerStageBegin; } public override void OnBodyRequirementBroken() { //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; GlobalEventManager.ProcIgniteOnKill -= new hook_ProcIgniteOnKill(GlobalEventManager_ProcIgniteOnKill); Run.onRunStartGlobal -= Run_onRunStartGlobal; Stage.onServerStageBegin -= Stage_onServerStageBegin; ((BaseAchievement)this).OnBodyRequirementBroken(); } private void Run_onRunStartGlobal(Run obj) { igniteCount = 0f; } private void Stage_onServerStageBegin(Stage obj) { igniteCount = 0f; } private void GlobalEventManager_ProcIgniteOnKill(orig_ProcIgniteOnKill orig, DamageReport damageReport, int igniteOnKillCount, CharacterBody victimBody, TeamIndex attackerTeamIndex) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) LocalUser localUser = ((BaseAchievement)this).localUser; if ((Object)(object)((localUser != null) ? localUser.cachedBody : null) != (Object)null && (Object)(object)((BaseAchievement)this).localUser.cachedBody == (Object)(object)damageReport.attackerBody) { if (igniteOnKillCount > 0) { igniteCount += 1f; } if (igniteCount >= 30f) { ((BaseAchievement)this).Grant(); } } orig.Invoke(damageReport, igniteOnKillCount, victimBody, attackerTeamIndex); } private void GlobalEventManager_onServerDamageDealt(DamageReport damageReport) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Invalid comparison between Unknown and I4 LocalUser localUser = ((BaseAchievement)this).localUser; if ((Object)(object)((localUser != null) ? localUser.cachedBody : null) != (Object)null && (Object)(object)((BaseAchievement)this).localUser.cachedBody == (Object)(object)damageReport.attackerBody) { if ((damageReport.damageInfo.damageType & 0x80) > 0) { igniteCount += 1f; } if (igniteCount >= 30f) { ((BaseAchievement)this).Grant(); } } } } public static class Unlocks { public static UnlockableDef heavyTap; public static UnlockableDef plasmaTap; public static UnlockableDef prfrVWildfireStorm; public static void Create() { heavyTap = ScriptableObject.CreateInstance<UnlockableDef>(); heavyTap.achievementIcon = Main.mandogaming.LoadAsset<Sprite>("HeavyTap.png"); heavyTap.cachedName = "Commando.Skills_HeavyTap"; heavyTap.nameToken = "ACHIEVEMENT_COMMANDOHEAVYTAP_NAME"; LanguageAPI.Add("ACHIEVEMENT_COMMANDOHEAVYTAP_NAME", "Commando: Have a Blast"); LanguageAPI.Add("ACHIEVEMENT_COMMANDOHEAVYTAP_DESCRIPTION", "As Commando, complete a stage without using your Primary skill."); plasmaTap = ScriptableObject.CreateInstance<UnlockableDef>(); plasmaTap.achievementIcon = Main.mandogaming.LoadAsset<Sprite>("PlasmaTap.png"); plasmaTap.cachedName = "Commando.Skills_PlasmaTap"; plasmaTap.nameToken = "ACHIEVEMENT_COMMANDOPLASMATAP_NAME"; LanguageAPI.Add("ACHIEVEMENT_COMMANDOPLASMATAP_NAME", "Commando: Arch Essence"); LanguageAPI.Add("ACHIEVEMENT_COMMANDOPLASMATAP_DESCRIPTION", "As Commando, chain lightning 70 times in a single run."); prfrVWildfireStorm = ScriptableObject.CreateInstance<UnlockableDef>(); prfrVWildfireStorm.achievementIcon = Main.mandogaming.LoadAsset<Sprite>("PRFRVWildfireStorm.png"); prfrVWildfireStorm.cachedName = "Commando.Skills_PRFRVWildfireStorm"; prfrVWildfireStorm.nameToken = "ACHIEVEMENT_COMMANDOPRFRVWILDFIRESTORM_NAME"; prfrVWildfireStorm.sortScore = plasmaTap.sortScore + 1; LanguageAPI.Add("ACHIEVEMENT_COMMANDOPRFRVWILDFIRESTORM_NAME", "Commando: Catch Fire"); LanguageAPI.Add("ACHIEVEMENT_COMMANDOPRFRVWILDFIRESTORM_DESCRIPTION", "As Commando, burn enemies 30 times on a single stage."); ContentAddition.AddUnlockableDef(heavyTap); ContentAddition.AddUnlockableDef(plasmaTap); ContentAddition.AddUnlockableDef(prfrVWildfireStorm); } } } namespace MandoGamingRewrite.Projectiles { public static class HeavyTapTracer { public static GameObject prefab; public static void Create() { //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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) prefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Junk/Bandit/TracerBanditShotgun.prefab").WaitForCompletion(), "HeavyTapTracer", false); Tracer component = prefab.GetComponent<Tracer>(); component.length *= 1.8f; component.beamDensity *= 1.5f; LineRenderer[] componentsInChildren = ((Component)component).GetComponentsInChildren<LineRenderer>(); foreach (LineRenderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val)) { val.endColor = new Color(0.025f, 0.02f, 0.3f); val.startColor = new Color(0.2f, 0.175f, 0.7f); } } ((Component)component).gameObject.AddComponent<VFXAttributes>(); ((Component)component).GetComponent<VFXAttributes>().vfxPriority = (VFXPriority)1; ((Component)component).GetComponent<VFXAttributes>().vfxIntensity = (VFXIntensity)1; ContentAddition.AddEffect(((Component)component).gameObject); } } public static class PlasmaTapTracer { public static GameObject prefab; public static void Create() { //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_0057: 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_008e: 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) prefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/TracerHuntressSnipe.prefab").WaitForCompletion(), "PlasmaTapTracer", false); Tracer component = prefab.GetComponent<Tracer>(); component.length = 40f; component.beamDensity = 5f; ((Component)component).gameObject.AddComponent<VFXAttributes>(); ((Component)component).GetComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; ((Component)component).GetComponent<VFXAttributes>().vfxIntensity = (VFXIntensity)2; LineRenderer component2 = ((Component)((Component)component).transform.Find("TracerHead")).GetComponent<LineRenderer>(); component2.startColor = new Color(0.1f, 0.2f, 0.7f); Material val = Object.Instantiate<Material>(((Renderer)component2).material); val.SetColor("_TintColor", new Color(0.1f, 0.2f, 0.7f)); ((Renderer)component2).material = val; component2.startWidth *= 0.4f; component2.endWidth *= 0.4f; ContentAddition.AddEffect(((Component)component).gameObject); } } } namespace MandoGamingRewrite.Keywords { public static class Keywords { public static void Create() { LanguageAPI.Add("KEYWORD_ARC", "<style=cKeywordName>Arcing</style><style=cSub>Arc lighting up to 4 enemies for 30% damage per hit.</style>"); LanguageAPI.Add("KEYWORD_FRICTIONLESS", "<style=cKeywordName>Frictionless</style><style=cSub>Suffers no damage falloff.</style>"); } } } namespace MandoGamingRewrite.EntityStates { internal class HeavyTapState : BaseSkillState { public float duration; public static float baseDuration = 0.15f; public static float secondDuration = 0.35f; public int remainingShots = 2; public bool finalShot = false; public static string fireHeavyPistolSoundString = "play_bandit_M2_shot"; public GameObject tracerEffectPrefab = HeavyTapTracer.prefab; public GameObject hitEffectPrefab = Resources.Load<GameObject>("prefabs/effects/impacteffects/Hitspark1"); public static float recoilAmplitude = 1f; private Ray aimRay; public static float maxRange = 250f; public static float damageCoefficient = 1.55f; public static float force = 40f; public override void OnEnter() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; if (finalShot) { duration = secondDuration / ((BaseState)this).attackSpeedStat; } aimRay = ((BaseState)this).GetAimRay(); ((BaseState)this).StartAimMode(aimRay, 3f, false); if (remainingShots % 2 == 0) { ((EntityState)this).PlayAnimation("Gesture Additive, Left", "FirePistol, Left"); FireBullet("MuzzleLeft"); } else { ((EntityState)this).PlayAnimation("Gesture Additive, Right", "FirePistol, Right"); FireBullet("MuzzleRight"); } } public void FireBullet(string targetMuzzle) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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) //IL_0124: 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_0136: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound(fireHeavyPistolSoundString, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)FirePistol2.muzzleEffectPrefab)) { EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, targetMuzzle, false); } ((BaseState)this).AddRecoil(-0.45f * recoilAmplitude, 0.9f * recoilAmplitude, -0.34f * recoilAmplitude, 0.34f * recoilAmplitude); if (((EntityState)this).isAuthority) { new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, minSpread = 0f, maxSpread = 0f, damage = damageCoefficient * ((BaseState)this).damageStat, force = force, tracerEffectPrefab = tracerEffectPrefab, muzzleName = targetMuzzle, hitEffectPrefab = hitEffectPrefab, isCrit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), radius = 0.4f, smartCollision = true, falloffModel = (FalloffModel)0, maxDistance = maxRange, procCoefficient = 0.9f }.Fire(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge < duration || !((EntityState)this).isAuthority) { return; } remainingShots--; if (remainingShots == 0) { duration = baseDuration; finalShot = false; ((EntityState)this).outer.SetNextStateToMain(); return; } HeavyTapState heavyTapState = new HeavyTapState(); if (remainingShots == 1) { heavyTapState.finalShot = true; } heavyTapState.remainingShots = remainingShots; ((EntityState)this).outer.SetNextState((EntityState)(object)heavyTapState); } 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; } } internal class PlasmaTapState : BaseSkillState, IStepSetter { public float duration; public static float baseDuration = 0.25f; public static float maxRange = 100f; public int pistol = 2; private Ray aimRay; public static float damageCoefficient = 1f; public static float damageArcing = 0.3f; public GameObject hitEffectPrefab = Resources.Load<GameObject>("prefabs/effects/impacteffects/LightningFlash"); public static string attackSoundString = "Play_item_proc_chain_lightning"; public static float recoilAmplitude = 1f; private HurtBox initialOrbTarget; private readonly BullseyeSearch search = new BullseyeSearch(); private ChildLocator childLocator; private Transform modelTransform; void IStepSetter.SetStep(int i) { pistol = i; } public override void OnEnter() { //IL_001c: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; aimRay = ((BaseState)this).GetAimRay(); ((BaseState)this).StartAimMode(aimRay, 3f, false); modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { childLocator = ((Component)modelTransform).GetComponent<ChildLocator>(); } if (pistol % 2 == 0) { ((EntityState)this).PlayAnimation("Gesture Additive, Left", "FirePistol, Left"); FireBullet("MuzzleLeft"); } else { ((EntityState)this).PlayAnimation("Gesture Additive, Right", "FirePistol, Right"); FireBullet("MuzzleRight"); } SearchForTarget(aimRay); FireOrb(); } private void SearchForTarget(Ray aimRay) { //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_0017: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) search.teamMaskFilter = TeamMask.GetUnprotectedTeams(((EntityState)this).teamComponent.teamIndex); search.filterByLoS = true; search.searchOrigin = ((Ray)(ref aimRay)).origin; search.searchDirection = ((Ray)(ref aimRay)).direction; search.sortMode = (SortMode)1; search.maxDistanceFilter = 100f; search.maxAngleFilter = 360f; search.RefreshCandidates(); search.FilterOutGameObject(((EntityState)this).gameObject); initialOrbTarget = search.GetResults().FirstOrDefault(); } private void FireOrb() { //IL_0013: 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_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_0031: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { LightningOrb val = new LightningOrb { lightningType = (LightningType)0, damageValue = damageArcing * ((BaseState)this).damageStat, isCrit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject), attacker = ((EntityState)this).gameObject, procCoefficient = 0.15f, bouncesRemaining = 1, speed = 120f, bouncedObjects = new List<HealthComponent>(), range = 30f, targetsToFindPerBounce = 3 }; HurtBox val2 = initialOrbTarget; if (Object.op_Implicit((Object)(object)val2)) { Transform val3 = childLocator.FindChild("HandR"); Transform val4 = childLocator.FindChild("HandL"); ((Orb)val).origin = ((pistol % 2 == 0) ? val4.position : val3.position); ((Orb)val).target = val2; OrbManager.instance.AddOrb((Orb)(object)val); } } } public void FireBullet(string targetMuzzle) { //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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_0101: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound(attackSoundString, ((EntityState)this).gameObject); Util.PlaySound("Play_mage_m1_cast_lightning", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)FirePistol2.muzzleEffectPrefab)) { EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, targetMuzzle, false); } ((BaseState)this).AddRecoil(-0.4f * recoilAmplitude, 0.8f * recoilAmplitude, -0.3f * recoilAmplitude, 0.3f * recoilAmplitude); if (((EntityState)this).isAuthority) { new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, minSpread = 0f, maxSpread = 0f, damage = damageCoefficient * ((BaseState)this).damageStat, tracerEffectPrefab = PlasmaTapTracer.prefab, muzzleName = targetMuzzle, hitEffectPrefab = hitEffectPrefab, isCrit = ((BaseState)this).RollCrit(), radius = 1f, smartCollision = true, falloffModel = (FalloffModel)2, maxDistance = maxRange }.Fire(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown ((EntityState)this).FixedUpdate(); if (!(((EntityState)this).fixedAge < duration) && ((EntityState)this).isAuthority) { if (((BaseSkillState)this).activatorSkillSlot.stock <= 0) { ((EntityState)this).outer.SetNextState((EntityState)new ReloadPistols()); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } public override void OnSerialize(NetworkWriter writer) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) NetworkExtensions.Write(writer, HurtBoxReference.FromHurtBox(initialOrbTarget)); } public override void OnDeserialize(NetworkReader reader) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) HurtBoxReference val = NetworkExtensions.ReadHurtBoxReference(reader); initialOrbTarget = ((HurtBoxReference)(ref val)).ResolveHurtBox(); } } internal class PRFRVWildfireStormState : BaseState { public static float baseFlameTimer = 1f; public static float baseTickFrequency = 11f; public static float tickDamage = 0.5f; public static float tickProc = 1f; public float force = 50f; private float stopwatch; public static float baseEntryTimer = 0.2f; private float entryTimer; private bool flameInitiated; private float flameStopwatch; private float tickFrequency; private float flameTimer; private static string startFlameAttackString = "Play_item_proc_fireRingTornado_start"; private static string endFlameAttackString = "Play_item_proc_fireRingTornado_end"; private ChildLocator childLocator; private Transform leftFlame; private Transform rightFlame; private Transform leftMuzzle; private Transform rightMuzzle; private Transform transformer; private Transform transformer2; private bool isCrit; private const float flameDistance = 20f; public static float recoilForce = 290f; public override void OnEnter() { ((BaseState)this).OnEnter(); stopwatch = 0f; flameInitiated = false; entryTimer = baseEntryTimer / base.attackSpeedStat; flameTimer = baseFlameTimer; tickFrequency = 3.2f * (base.attackSpeedStat - 1f) + baseTickFrequency; Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { ((EntityState)this).characterBody.SetAimTimer(entryTimer + flameTimer + 1f); } if (Object.op_Implicit((Object)(object)modelTransform)) { childLocator = ((Component)modelTransform).GetComponent<ChildLocator>(); leftMuzzle = childLocator.FindChild("MuzzleLeft"); rightMuzzle = childLocator.FindChild("MuzzleRight"); } if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { isCrit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master); } } public override void OnExit() { Util.PlaySound(endFlameAttackString, ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("Gesture, Additive", "FireFMJ", "FireFMJ.playbackRate", 0.6f); ((EntityState)this).PlayAnimation("Gesture, Override", "FireFMJ", "FireFMJ.playbackRate", 0.6f); if (Object.op_Implicit((Object)(object)leftFlame)) { EntityState.Destroy((Object)(object)((Component)leftFlame).gameObject); } if (Object.op_Implicit((Object)(object)rightFlame)) { EntityState.Destroy((Object)(object)((Component)rightFlame).gameObject); } ((EntityState)this).OnExit(); } public override void FixedUpdate() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown ((EntityState)this).FixedUpdate(); ((EntityState)this).characterBody.isSprinting = false; Flamethrower val = new Flamethrower(); stopwatch += Time.fixedDeltaTime; if (stopwatch >= entryTimer && !flameInitiated) { flameInitiated = true; Util.PlaySound(startFlameAttackString, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)childLocator)) { transformer = childLocator.FindChild("MuzzleLeft"); transformer2 = childLocator.FindChild("MuzzleRight"); } if (Object.op_Implicit((Object)(object)transformer)) { leftFlame = Object.Instantiate<GameObject>(val.flamethrowerEffectPrefab, transformer).transform; } if (Object.op_Implicit((Object)(object)transformer2)) { rightFlame = Object.Instantiate<GameObject>(val.flamethrowerEffectPrefab, transformer2).transform; } if (Object.op_Implicit((Object)(object)leftFlame)) { ((Component)leftFlame).GetComponent<ScaleParticleSystemDuration>().newDuration = flameTimer; } if (Object.op_Implicit((Object)(object)rightFlame)) { ((Component)rightFlame).GetComponent<ScaleParticleSystemDuration>().newDuration = flameTimer; } Flame("MuzzleCenter"); } if (flameInitiated) { flameStopwatch += Time.deltaTime; if (flameStopwatch > 1f / tickFrequency) { flameStopwatch -= 1f / tickFrequency; Flame("MuzzleCenter"); } UpdateFlame(); } if (stopwatch >= flameTimer + entryTimer && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void UpdateFlame() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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) Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; Vector3 direction2 = ((Ray)(ref aimRay)).direction; if (Object.op_Implicit((Object)(object)leftFlame)) { leftFlame.forward = direction; } if (Object.op_Implicit((Object)(object)rightFlame)) { rightFlame.forward = direction2; } } private void Flame(string muzzleString) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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) //IL_0027: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); if (((EntityState)this).isAuthority) { new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, minSpread = 0f, damage = tickDamage * base.damageStat, force = force, muzzleName = muzzleString, hitEffectPrefab = Flamethrower.impactEffectPrefab, isCrit = isCrit, radius = Flamethrower.radius, falloffModel = (FalloffModel)0, stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask, procCoefficient = tickProc, maxDistance = 20f, smartCollision = true, damageType = (DamageType)(Util.CheckRoll(30f, ((EntityState)this).characterBody.master) ? 128 : 0) }.Fire(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.ApplyForce(((Ray)(ref aimRay)).direction * (0f - recoilForce), false, false); } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } }