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 EntityStates;
using EntityStates.Commando.CommandoWeapon;
using Microsoft.CodeAnalysis;
using On.EntityStates.Commando.CommandoWeapon;
using R2API;
using RoR2;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("CommandoBuff")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("CommandoBuff")]
[assembly: AssemblyTitle("CommandoBuff")]
[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 CommandoBuff
{
public class BetterSuppressiveFire : BaseState
{
public static GameObject effectPrefab = FireBarrage.effectPrefab;
public static GameObject hitEffectPrefab = FireBarrage.hitEffectPrefab;
public static GameObject tracerEffectPrefab = FireBarrage.tracerEffectPrefab;
public static float damageCoefficient = 2f;
public static float force = FireSweepBarrage.force;
public static float minSpread = FireBarrage.minSpread;
public static float maxSpread = FireBarrage.maxSpread;
public static float baseDurationBetweenShots = 1f;
public static float totalDuration = 2f;
public static float bulletRadius = 1.5f;
public static int baseBulletCount = FireBarrage.baseBulletCount;
public static string fireBarrageSoundString = FireBarrage.fireBarrageSoundString;
public static float recoilAmplitude = FireBarrage.recoilAmplitude;
public static float spreadBloomValue = FireBarrage.spreadBloomValue;
private int totalBulletsFired;
private int bulletCount;
public float stopwatchBetweenShots;
private Animator modelAnimator;
private Transform modelTransform;
private float duration;
private float durationBetweenShots;
public override void OnEnter()
{
((BaseState)this).OnEnter();
((EntityState)this).characterBody.SetSpreadBloom(0.2f, false);
durationBetweenShots = FireBarrage.baseDurationBetweenShots / (base.attackSpeedStat * 0.25f);
bulletCount = (int)((double)FireBarrage.baseBulletCount * (double)base.attackSpeedStat);
duration = durationBetweenShots * (float)bulletCount;
modelAnimator = ((EntityState)this).GetModelAnimator();
modelTransform = ((EntityState)this).GetModelTransform();
((EntityState)this).PlayCrossfade("Gesture, Additive", "FireBarrage", "FireBarrage.playbackRate", duration, 0.2f);
((EntityState)this).PlayCrossfade("Gesture, Override", "FireBarrage", "FireBarrage.playbackRate", duration, 0.2f);
if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
{
((EntityState)this).characterBody.SetAimTimer(2f);
}
FireBullet();
}
private void FireBullet()
{
//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_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: 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_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_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: 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_00fd: 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_010f: 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_0136: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: Unknown result type (might be due to invalid IL or missing references)
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
Ray aimRay = ((BaseState)this).GetAimRay();
string text = "MuzzleRight";
if (Object.op_Implicit((Object)(object)modelAnimator))
{
if (Object.op_Implicit((Object)(object)effectPrefab))
{
EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text, false);
}
((EntityState)this).PlayAnimation("Gesture Additive, Right", "FirePistol, Right");
}
((BaseState)this).AddRecoil(-0.8f * recoilAmplitude, -1f * recoilAmplitude, -0.1f * recoilAmplitude, 0.15f * 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 = minSpread,
maxSpread = maxSpread,
bulletCount = 1u,
falloffModel = (FalloffModel)0,
damage = damageCoefficient * base.damageStat,
force = force,
tracerEffectPrefab = tracerEffectPrefab,
muzzleName = text,
hitEffectPrefab = hitEffectPrefab,
isCrit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master),
radius = bulletRadius,
smartCollision = true,
damageType = (DamageType)32,
procCoefficient = 1f
}.Fire();
}
((EntityState)this).characterBody.AddSpreadBloom(spreadBloomValue);
totalBulletsFired++;
Util.PlaySound(fireBarrageSoundString, ((EntityState)this).gameObject);
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
stopwatchBetweenShots += Time.fixedDeltaTime;
if ((double)stopwatchBetweenShots >= (double)durationBetweenShots && totalBulletsFired < bulletCount)
{
stopwatchBetweenShots -= durationBetweenShots;
FireBullet();
}
if (totalBulletsFired == bulletCount && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
return (InterruptPriority)1;
}
}
[BepInPlugin("com.Nuxlar.CommandoBuff", "CommandoBuff", "1.0.1")]
public class CommandoBuff : BaseUnityPlugin
{
private GameObject nade = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoGrenadeProjectile.prefab").WaitForCompletion();
private GameObject commando = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoBody.prefab").WaitForCompletion();
public void Awake()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: 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_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Expected O, but got Unknown
bool flag = default(bool);
ContentAddition.AddEntityState<BetterSuppressiveFire>(ref flag);
((ProjectileExplosion)nade.GetComponent<ProjectileImpactExplosion>()).falloffModel = (FalloffModel)0;
SkillDef skillDef = commando.GetComponent<SkillLocator>().special.skillFamily.variants[0].skillDef;
skillDef.skillDescriptionToken = "<style=cIsDamage>Stunning</style>. Fire repeatedly for <style=cIsDamage>200% damage</style> per bullet. The number of shots increases with attack speed.";
skillDef.activationState = new SerializableEntityStateType(typeof(BetterSuppressiveFire));
skillDef.baseRechargeInterval = 5f;
FirePistol2.FireBullet += new hook_FireBullet(RemoveM1FallOff);
}
private void RemoveM1FallOff(orig_FireBullet orig, FirePistol2 self, string targetMuzzle)
{
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: 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_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: 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_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: 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_00f1: 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)
//IL_00fd: 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)
Util.PlaySound(FirePistol2.firePistolSoundString, ((EntityState)self).gameObject);
if (Object.op_Implicit((Object)(object)FirePistol2.muzzleEffectPrefab))
{
EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)self).gameObject, targetMuzzle, false);
}
((BaseState)self).AddRecoil(-0.4f * FirePistol2.recoilAmplitude, -0.8f * FirePistol2.recoilAmplitude, -0.3f * FirePistol2.recoilAmplitude, 0.3f * FirePistol2.recoilAmplitude);
if (((EntityState)self).isAuthority)
{
new BulletAttack
{
owner = ((EntityState)self).gameObject,
weapon = ((EntityState)self).gameObject,
origin = ((Ray)(ref self.aimRay)).origin,
aimVector = ((Ray)(ref self.aimRay)).direction,
minSpread = 0f,
maxSpread = ((EntityState)self).characterBody.spreadBloomAngle,
damage = FirePistol2.damageCoefficient * ((BaseState)self).damageStat,
force = FirePistol2.force,
tracerEffectPrefab = FirePistol2.tracerEffectPrefab,
falloffModel = (FalloffModel)0,
muzzleName = targetMuzzle,
hitEffectPrefab = FirePistol2.hitEffectPrefab,
isCrit = Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master),
radius = 0.1f,
smartCollision = true
}.Fire();
}
((EntityState)self).characterBody.AddSpreadBloom(FirePistol2.spreadBloomValue);
}
}
}