using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using CustomSkillsTutorial.MyEntityStates; using EntityStates; using EntityStates.Commando.CommandoWeapon; using Microsoft.CodeAnalysis; using R2API; using RoR2; using RoR2.Skills; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; [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("BanditRevolver")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BanditRevolver")] [assembly: AssemblyTitle("BanditRevolver")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 ExamplePlugin { internal static class Log { private 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 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); } } } namespace CustomSkillsTutorial { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.MelonGoonsquad.BanditRevolverPrimary", "BanditRevolverPrimary", "1.0.0")] public class CustomSkillTutorial : BaseUnityPlugin { public void Awake() { //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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_00c1: 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_0145: 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_0167: Expected O, but got Unknown //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/Bandit2Body.prefab").WaitForCompletion(); LanguageAPI.Add("COMMANDO_PRIMARY_SIMPLEBULLET_NAME", "Bullseye"); LanguageAPI.Add("COMMANDO_PRIMARY_SIMPLEBULLET_DESCRIPTION", "Fire a revolver round for 500% damage."); SkillDef val2 = ScriptableObject.CreateInstance(); SerializableEntityStateType activationState = default(SerializableEntityStateType); ((SerializableEntityStateType)(ref activationState))..ctor(typeof(SimpleBulletAttack)); val2.activationState = activationState; val2.activationStateMachineName = "Weapon"; val2.baseMaxStock = 0; val2.baseRechargeInterval = 0f; val2.beginSkillCooldownOnSkillEnd = true; val2.canceledFromSprinting = false; val2.cancelSprintingOnActivation = true; val2.fullRestockOnAssign = true; val2.interruptPriority = (InterruptPriority)0; val2.isCombatSkill = true; val2.mustKeyPress = false; val2.rechargeStock = 0; val2.requiredStock = 0; val2.stockToConsume = 0; val2.icon = Addressables.LoadAssetAsync((object)"RoR2/Junk/Bandit/texBanditSkill1Icon.png").WaitForCompletion(); val2.skillDescriptionToken = "COMMANDO_PRIMARY_SIMPLEBULLET_DESCRIPTION"; val2.skillName = "COMMANDO_PRIMARY_SIMPLEBULLET_NAME"; val2.skillNameToken = "COMMANDO_PRIMARY_SIMPLEBULLET_NAME"; ContentAddition.AddSkillDef(val2); bool flag = default(bool); ContentAddition.AddEntityState(ref flag); SkillLocator component = val.GetComponent(); SkillFamily skillFamily = component.primary.skillFamily; Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val3 = new Variant { skillDef = val2 }; ((Variant)(ref val3)).viewableNode = new Node(val2.skillNameToken, false, (Node)null); variants[num] = val3; } } } namespace CustomSkillsTutorial.MyEntityStates { public class SimpleBulletAttack : BaseSkillState { public float baseDuration = 1f; private float duration; public GameObject crosshairOverridePrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/Bandit2CrosshairPrepRevolverFire.prefab").WaitForCompletion(); private Animator animator; private int bodySideWeaponLayerIndex; public GameObject hitEffectPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/HitsparkBandit2Pistol.prefab").WaitForCompletion(); public GameObject tracerEffectPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/TracerBanditPistol.prefab").WaitForCompletion(); public GameObject baseSidearmState = Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/EntityStates.Bandit2.Weapon.BaseSidearmState.asset").WaitForCompletion(); public GameObject banditCrosshairPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/Bandit2CrosshairPrepRevolver.prefab").WaitForCompletion(); private OverrideRequest crosshairOverrideRequest; public override void OnEnter() { //IL_0067: 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) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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_017a: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: 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_01b3: 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_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); ((EntityState)this).skillLocator.primary.finalRechargeInterval = ((EntityState)this).skillLocator.primary.baseRechargeInterval / ((BaseState)this).attackSpeedStat; animator = ((EntityState)this).GetModelAnimator(); crosshairOverrideRequest = CrosshairUtils.RequestOverrideForBody(((EntityState)this).characterBody, banditCrosshairPrefab, (OverridePriority)1); duration = baseDuration / ((BaseState)this).attackSpeedStat; Ray aimRay = ((BaseState)this).GetAimRay(); ((BaseState)this).StartAimMode(aimRay, 2f, false); bodySideWeaponLayerIndex = animator.GetLayerIndex("Body, SideWeapon"); animator.SetLayerWeight(bodySideWeaponLayerIndex, 1f); ((EntityState)this).PlayAnimation("Gesture, Additive", "FireSideWeapon", "FireSideWeapon.playbackRate", duration, 0f); ((EntityState)this).PlayAnimation("Gesture, Additive", "FireSideWeapon", "FireSideWeapon.playbackRate", duration, 0f); Util.PlaySound(FireBarrage.fireBarrageSoundString, ((EntityState)this).gameObject); ((BaseState)this).AddRecoil(-2f, -8f, -2f, -3f); if (Object.op_Implicit((Object)(object)FireBarrage.effectPrefab)) { EffectManager.SimpleMuzzleFlash(FireBarrage.effectPrefab, ((EntityState)this).gameObject, "MuzzleRight", false); } 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 = ((EntityState)this).characterBody.spreadBloomAngle, bulletCount = 1u, procCoefficient = 1.2f, damage = ((EntityState)this).characterBody.damage * 5f, force = 4f, falloffModel = (FalloffModel)1, tracerEffectPrefab = tracerEffectPrefab, muzzleName = "MuzzlePistol", hitEffectPrefab = hitEffectPrefab, isCrit = ((BaseState)this).RollCrit(), HitEffectNormal = false, stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask, smartCollision = true, maxDistance = 9000f, damageType = DamageTypeCombo.GenericPrimary }.Fire(); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } }