using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using ArthursCommandoTweaks.Skills; using BepInEx; using EntityStates; using EntityStates.Commando; using EntityStates.Commando.CommandoWeapon; using On.EntityStates; using On.EntityStates.Commando; using On.EntityStates.Commando.CommandoWeapon; using R2API; using RoR2; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("ArthursCommandoTweaks")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ArthursCommandoTweaks")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("adb1c7b9-72cc-48d3-b74f-a6c4185de018")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace ArthursCommandoTweaks { [BepInPlugin("com.asteristired.commandotweaks", "Arthurs Commando Tweaks", "1.1.0")] public class ArthurCommandoTweaks : BaseUnityPlugin { public void Awake() { RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad)); } public void OnLoad() { FragGrenade.Apply(); TacticalDive.Apply(); PhaseRound.Apply(); SuppressiveFire.Apply(); } } } namespace ArthursCommandoTweaks.Skills { internal class PhaseRound { public static void Apply() { ChangeSkillDef(); Hook(); } protected static void Hook() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown GenericProjectileBaseState.OnEnter += new hook_OnEnter(OnShoot); } private static void OnShoot(orig_OnEnter orig, GenericProjectileBaseState self) { if (self is FireFMJ) { self.damageCoefficient = 3.6f; } orig.Invoke(self); } protected static void ChangeSkillDef() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) foreach (GameObject allBodyPrefab in BodyCatalog.allBodyPrefabs) { if (((Object)allBodyPrefab).name != "CommandoBody") { continue; } Variant[] variants = allBodyPrefab.GetComponent().secondary.skillFamily.variants; for (int i = 0; i < variants.Length; i++) { SkillDef skillDef = variants[i].skillDef; if (skillDef.skillNameToken == "COMMANDO_SECONDARY_NAME") { LanguageAPI.Add(skillDef.skillDescriptionToken, "Fire a piercing bullet for 360% damage. Deals 40% more damage every time it passes through an enemy."); } } } } } internal class SuppressiveFire { public static void Apply() { Hook(); } protected static void Hook() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown FireBarrage.OnEnter += new hook_OnEnter(FireBarrage_OnEnter); } private static void FireBarrage_OnEnter(orig_OnEnter orig, FireBarrage self) { FireBarrage.baseBulletCount = 8; orig.Invoke(self); } } internal class TacticalDive { public static void Apply() { ChangeSkillDef(); Hook(); } protected static void Hook() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown DodgeState.OnEnter += new hook_OnEnter(OnDodgeStateEnter); } private static void OnDodgeStateEnter(orig_OnEnter orig, DodgeState self) { ((Component)((EntityState)self).outer).GetComponent().AddTimedBuff(Buffs.ArmorBoost, self.duration); orig.Invoke(self); } protected static void ChangeSkillDef() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) foreach (GameObject allBodyPrefab in BodyCatalog.allBodyPrefabs) { if (((Object)allBodyPrefab).name != "CommandoBody") { continue; } Variant[] variants = allBodyPrefab.GetComponent().utility.skillFamily.variants; for (int i = 0; i < variants.Length; i++) { SkillDef skillDef = variants[i].skillDef; if (skillDef.skillNameToken == "COMMANDO_UTILITY_NAME") { LanguageAPI.Add(skillDef.skillDescriptionToken, "Roll a short distance. You gain armor while rolling."); skillDef.baseRechargeInterval = 3f; } } } } } internal class FragGrenade { public static void Apply() { ChangeSkillDef(); ChangeProj(); Hook(); } protected static void Hook() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown GenericProjectileBaseState.OnEnter += new hook_OnEnter(GenericProjectileBaseState_OnEnter); } protected static void ChangeSkillDef() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) foreach (GameObject allBodyPrefab in BodyCatalog.allBodyPrefabs) { if (((Object)allBodyPrefab).name != "CommandoBody") { continue; } Variant[] variants = allBodyPrefab.GetComponent().special.skillFamily.variants; for (int i = 0; i < variants.Length; i++) { SkillDef skillDef = variants[i].skillDef; if (skillDef.skillNameToken == "COMMANDO_SPECIAL_ALT1_NAME") { skillDef.keywordTokens = new string[1] { "KEYWORD_IGNITE" }; LanguageAPI.Add(skillDef.skillDescriptionToken, "Ignite. Throw a grenade that explodes for 600% damage. Explodes on enemy contact. Can hold up to 2."); } } } } protected static void GenericProjectileBaseState_OnEnter(orig_OnEnter orig, GenericProjectileBaseState self) { if (self is ThrowGrenade) { self.damageCoefficient = 6f; } orig.Invoke(self); } protected static void ChangeProj() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) GameObject projectilePrefab = ProjectileCatalog.GetProjectilePrefab(ProjectileCatalog.FindProjectileIndex("CommandoGrenadeProjectile")); ProjectileImpactExplosion component = projectilePrefab.GetComponent(); ((ProjectileExplosion)component).falloffModel = (FalloffModel)0; component.destroyOnEnemy = true; component.detonateOnEnemy = true; projectilePrefab.GetComponent().damageType = DamageTypeCombo.op_Implicit((DamageType)128); SphereCollider component2 = projectilePrefab.GetComponent(); component2.radius *= 1.5f; } } }