Decompiled source of Pepsiman v1.2.4

plugins/PepsimanMod.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Captain.Weapon;
using EntityStates.CaptainSupplyDrop;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using On.RoR2;
using PepsimanMod.Components;
using PepsimanMod.Modules;
using PepsimanMod.States;
using PepsimanMod.States.Alt;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Achievements;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using RoR2BepInExPack.GameAssetPathsBetter;
using RoR2BepInExPack.VanillaFixes;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.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 PepsimanMod
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.halfmuletwo.pepsiman", "Pepsiman", "1.2.4")]
	public class PepsimanPlugin : BaseUnityPlugin
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Action <0>__Run;

			public static Action <1>__Begin;

			public static Action <2>__Begin;

			public static Action <3>__Begin;

			public static StatHookEventHandler <4>__OnGetStatCoefficients;

			public static Action<DamageReport> <5>__OnServerDamageDealt;
		}

		public const string MODUID = "com.halfmuletwo.pepsiman";

		public const string MODNAME = "Pepsiman";

		public const string MODVERSION = "1.2.4";

		public static PepsimanPlugin instance;

		public static ConfigEntry<bool> autoRunConfig;

		public static bool PauseNearPickers = true;

		public static bool AutoRun = true;

		public static ConfigEntry<bool> freezeOnAttackConfig;

		public static ConfigEntry<bool> fizzDecayConfig;

		public static bool FizzDecay = false;

		public static ConfigEntry<float> podLowerConfig;

		public static float PodLowerBy = 0f;

		public static bool FreezeOnAttack = false;

		public static ConfigEntry<float> heightConfig;

		public static float ModelHeight = 2.6f;

		public static ManualLogSource Log => ((BaseUnityPlugin)instance).Logger;

		public void Awake()
		{
			instance = this;
			autoRunConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("Movement", "AutoRun", true, "Pepsiman always runs forward (camera direction). A/D steer sideways, S is ignored.");
			freezeOnAttackConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("Movement", "FreezeOnAttack", false, "Stop moving while a melee attack or the Pepsi Machine is playing (lunges still move you).");
			heightConfig = ((BaseUnityPlugin)this).Config.Bind<float>("Body", "Height", 2.6f, "Pepsiman's height in metres. Loader is ~2.8, Captain ~2.4, Mercenary ~2.3, Commando ~2.0.");
			ModelHeight = Mathf.Clamp(heightConfig.Value, 1.4f, 3.4f);
			fizzDecayConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("Fizz", "DecayOverTime", false, "If true, Fizz also fades after a few seconds without landing a hit. Default off: Fizz is only lost when you take damage.");
			FizzDecay = fizzDecayConfig.Value;
			podLowerConfig = ((BaseUnityPlugin)this).Config.Bind<float>("Pod", "LowerBy", 0f, "Extra metres to lower the spawn vending machine into the ground (negative raises it). Use if it still floats or sinks.");
			PodLowerBy = Mathf.Clamp(podLowerConfig.Value, -3f, 3f);
			AutoRun = autoRunConfig.Value;
			PauseNearPickers = ((BaseUnityPlugin)this).Config.Bind<bool>("Movement", "PauseNearPickers", true, "Stop the forced run while a Command cube / scrapper pickup panel is open or within 7 m, so you can stop and pick an item.").Value;
			FreezeOnAttack = freezeOnAttackConfig.Value;
			Tokens.Init();
			AltTokens.Init();
			Buffs.Init();
		}

		public void Update()
		{
			FizzBar.EnsureOnAllHuds();
		}

		public void Start()
		{
			Unlocks.Init();
			Unlocks.Hook();
			Prefabs.Init();
			CanProjectile.Init();
			AltProjectiles.Init();
			AltPrefabs.Init();
			Skills.Init(Prefabs.bodyPrefab);
			Survivors.Register();
			new ContentPacks().Initialize();
			Hook();
			AltHooks.Init();
			Sfx.Init();
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(SelfCheck.Run));
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AutoTest.Begin));
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AltTest.Begin));
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(HeightProbe.Begin));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"[Pepsiman] loaded");
		}

		private void Hook()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<4>__OnGetStatCoefficients;
			if (obj == null)
			{
				StatHookEventHandler val = OnGetStatCoefficients;
				<>O.<4>__OnGetStatCoefficients = val;
				obj = (object)val;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj;
			GlobalEventManager.onServerDamageDealt += OnServerDamageDealt;
		}

		private static void OnGetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)sender))
			{
				int buffCount = sender.GetBuffCount(Buffs.fizz);
				if (buffCount > 0)
				{
					args.moveSpeedMultAdd += (float)buffCount * 0.027f;
					args.armorAdd += (float)buffCount * 1.5f;
				}
				if (sender.HasBuff(Buffs.armored))
				{
					args.armorAdd += 200f;
				}
				AltHooks.Stats(sender, args);
			}
		}

		private static void OnServerDamageDealt(DamageReport report)
		{
			if (report == null || report.damageDealt <= 0f || !Object.op_Implicit((Object)(object)report.victimBody))
			{
				return;
			}
			GameObject val = ((report.damageInfo != null) ? report.damageInfo.inflictor : null);
			if (Object.op_Implicit((Object)(object)val) && ((Object)val).name.StartsWith("PepsimanCanProjectile") && Object.op_Implicit((Object)(object)report.attackerBody))
			{
				FizzTracker component = ((Component)report.attackerBody).GetComponent<FizzTracker>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.Add(2f);
				}
			}
			AltHooks.OnDamage(report);
			CanProjectile.TryCounter(report);
			FizzTracker component2 = ((Component)report.victimBody).GetComponent<FizzTracker>();
			if (Object.op_Implicit((Object)(object)component2))
			{
				if (report.victimBody.HasBuff(Buffs.armored))
				{
					component2.LoseStacks(1);
				}
				else
				{
					component2.LoseFraction(1f / 3f);
				}
			}
		}
	}
	public static class StaticValues
	{
		public const int maxFizz = 15;

		public const float fizzDecayGrace = 2f;

		public const float fizzDecayInterval = 0.2f;

		public const float moveSpeedPerFizz = 0.027f;

		public const float armorPerFizz = 1.5f;

		public const float fizzLostOnHit = 1f / 3f;

		public const int fizzLostOnArmoredHit = 1;

		public const float multiTargetFalloff = 0.6f;

		public const float multiTargetFloor = 0.2f;

		public const float barrierPerHit = 0.025f;

		public const float barrierSwingCap = 0.08f;

		public const float slideBarrierCap = 0.12f;

		public const float carryLead = 1.05f;

		public const float carryDuration = 0.35f;

		public const float airHoldDuration = 0.3f;

		public const float armorWindowBuff = 200f;

		public const float punchDamage = 2.5f;

		public const float kickDamage = 3.2f;

		public const float punchBaseDuration = 0.5f;

		public const float comboCooldown = 0.35f;

		public const float punchLunge = 0.7f;

		public const float kickLunge = 1.1f;

		public const float lungeSpeedScale = 0.015f;

		public const float uppercutDamage = 4f;

		public const float uppercutLaunch = 14f;

		public const float uppercutEnemyLaunch = 14f;

		public const int uppercutStocks = 2;

		public const float uppercutRecharge = 4f;

		public const float canShotDamage = 3f;

		public const float canShotSpeed = 90f;

		public const float canShotRange = 80f;

		public const float canShotFizz = 2f;

		public const float slideDamage = 2.5f;

		public const float slideDuration = 0.7f;

		public const float slideCooldown = 5f;

		public const float machineMinDamage = 6f;

		public const float machineMaxDamage = 15f;

		public const float machineRadius = 11f;

		public const float machineCooldown = 20f;

		public const float canHealFraction = 0.06f;

		public const float machineLifetime = 6f;

		public const float canLifetime = 25f;

		public static readonly Color pepsiBlue = new Color(0f, 0.32f, 0.78f);

		public static readonly Color pepsiRed = new Color(0.86f, 0.1f, 0.15f);

		public static int CanPairs(int fizzStacks)
		{
			return 1 + fizzStacks / 5;
		}
	}
}
namespace PepsimanMod.States
{
	public class PepsiMachine : BaseSkillState
	{
		private const float baseDuration = 1f;

		private const float callFraction = 0.49f;

		private const float throwRange = 22f;

		public bool hasTarget;

		public Vector3 target;

		private float duration;

		private bool called;

		private int stacks;

		public float Duration => duration;

		public override void OnEnter()
		{
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			Sfx.Play("machine_throw", ((EntityState)this).characterBody);
			if (Random.value < 0.5f)
			{
				Sfx.Play("voice_taunt", ((EntityState)this).characterBody, 1f, 0f, 4f);
			}
			duration = 1f / ((BaseState)this).attackSpeedStat;
			((BaseState)this).StartAimMode(duration + 0.5f, false);
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.special))
			{
				((EntityState)this).skillLocator.special.DeductStock(1);
			}
			if (NetworkServer.active)
			{
				FizzTracker component = ((Component)((EntityState)this).characterBody).GetComponent<FizzTracker>();
				stacks = (Object.op_Implicit((Object)(object)component) ? component.ConsumeAll() : 0);
			}
			if (!hasTarget)
			{
				target = FallbackTarget();
			}
		}

		private Vector3 FallbackTarget()
		{
			//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_0009: 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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: 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_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: 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_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_00b5: 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_00cf: 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)
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 val = new Vector3(((Ray)(ref aimRay)).direction.x, 0f, ((Ray)(ref aimRay)).direction.z);
			Vector3 val2 = ((Vector3)(ref val)).normalized;
			if (val2 == Vector3.zero)
			{
				val2 = ((EntityState)this).transform.forward;
			}
			Vector3 val3 = ((EntityState)this).characterBody.footPosition + val2 * 9f;
			RaycastHit val4 = default(RaycastHit);
			if (Physics.Raycast(aimRay, ref val4, 22f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
			{
				return ((RaycastHit)(ref val4)).point;
			}
			if (Physics.Raycast(val3 + Vector3.up * 6f, Vector3.down, ref val4, 40f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
			{
				return ((RaycastHit)(ref val4)).point;
			}
			return val3;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (!called && ((EntityState)this).fixedAge >= duration * 0.49f)
			{
				called = true;
				if (NetworkServer.active)
				{
					CallDown();
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void CallDown()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: 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_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: 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)
			float num = (float)stacks / 15f;
			GameObject obj = Object.Instantiate<GameObject>(Prefabs.machinePrefab, target + Vector3.up * Prefabs.machineSpawnLift, Quaternion.Euler(0f, ((EntityState)this).characterBody.transform.eulerAngles.y + 180f, 0f));
			PepsiMachineDrop component = obj.GetComponent<PepsiMachineDrop>();
			component.ownerObject = ((EntityState)this).gameObject;
			component.team = ((BaseState)this).GetTeam();
			component.damage = ((BaseState)this).damageStat * Mathf.Lerp(6f, 15f, num);
			component.crit = ((BaseState)this).RollCrit();
			component.stacks = stacks;
			NetworkServer.Spawn(obj);
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			((BaseSkillState)this).OnSerialize(writer);
			writer.Write(hasTarget);
			writer.Write(target);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			//IL_0015: 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)
			((BaseSkillState)this).OnDeserialize(reader);
			hasTarget = reader.ReadBoolean();
			target = reader.ReadVector3();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class PepsiMachineAim : BaseSkillState
	{
		internal static bool testConfirm;

		internal static bool testCancel;

		private PlacementInfo placement;

		private GameObject blueprintObject;

		private BlueprintController blueprint;

		private OverrideRequest crosshair;

		private bool hasCrosshair;

		private LineRenderer ring;

		private Material ringMaterial;

		private bool specialReleased;

		private bool primaryWasDown;

		private bool secondaryWasDown;

		public override void OnEnter()
		{
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			if (((EntityState)this).isAuthority)
			{
				primaryWasDown = Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && ((EntityState)this).inputBank.skill1.down;
				secondaryWasDown = Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && ((EntityState)this).inputBank.skill2.down;
				if (Object.op_Implicit((Object)(object)SetupSupplyDrop.blueprintPrefab))
				{
					blueprintObject = Object.Instantiate<GameObject>(SetupSupplyDrop.blueprintPrefab);
					blueprint = blueprintObject.GetComponent<BlueprintController>();
				}
				if (Object.op_Implicit((Object)(object)SetupSupplyDrop.crosshairOverridePrefab))
				{
					crosshair = CrosshairUtils.RequestOverrideForBody(((EntityState)this).characterBody, SetupSupplyDrop.crosshairOverridePrefab, (OverridePriority)1);
					hasCrosshair = true;
				}
				GameObject val = new GameObject("PepsiAimRing");
				ring = val.AddComponent<LineRenderer>();
				ring.useWorldSpace = true;
				ring.loop = true;
				ring.positionCount = 48;
				ring.widthMultiplier = 0.25f;
				ringMaterial = Art.LineMaterial(StaticValues.pepsiBlue);
				((Renderer)ring).sharedMaterial = ringMaterial;
				((Renderer)ring).shadowCastingMode = (ShadowCastingMode)0;
				((BaseState)this).StartAimMode(10f, false);
			}
		}

		public override void Update()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: 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_00c1: 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_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).Update();
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			placement = SetupSupplyDrop.GetPlacementInfo(((BaseState)this).GetAimRay(), ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)blueprint))
			{
				blueprint.PushState(placement.position, placement.rotation, placement.ok);
			}
			if (!Object.op_Implicit((Object)(object)ring))
			{
				return;
			}
			((Renderer)ring).enabled = placement.ok;
			if (placement.ok)
			{
				Art.SetLineColor(ringMaterial, Color.Lerp(StaticValues.pepsiRed, Color.white, 0.5f + 0.5f * Mathf.Sin(Time.time * 10f)));
				for (int i = 0; i < 48; i++)
				{
					float num = (float)i / 48f * MathF.PI * 2f;
					ring.SetPosition(i, placement.position + new Vector3(Mathf.Cos(num), 0.25f, Mathf.Sin(num)) * 11f);
				}
			}
		}

		public override void FixedUpdate()
		{
			//IL_010a: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority)
			{
				bool down = ((EntityState)this).inputBank.skill4.down;
				if (!down)
				{
					specialReleased = true;
				}
				if (!((EntityState)this).inputBank.skill1.down)
				{
					primaryWasDown = false;
				}
				if (!((EntityState)this).inputBank.skill2.down)
				{
					secondaryWasDown = false;
				}
				bool flag = (((EntityState)this).inputBank.skill1.down && !primaryWasDown) || testConfirm;
				bool num = (((EntityState)this).inputBank.skill2.down && !secondaryWasDown) || (down && specialReleased) || testCancel;
				testConfirm = (testCancel = false);
				if (num)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
				else if (flag && placement.ok)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new PepsiMachine
					{
						hasTarget = true,
						target = placement.position
					});
				}
				else if (((EntityState)this).characterBody.HasBuff(Buffs.DisableAllSkills.buffIndex))
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)blueprintObject))
			{
				EntityState.Destroy((Object)(object)blueprintObject);
			}
			if (Object.op_Implicit((Object)(object)ring))
			{
				EntityState.Destroy((Object)(object)((Component)ring).gameObject);
			}
			if (hasCrosshair)
			{
				crosshair.Dispose();
			}
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)3;
		}
	}
	public class PepsimanMain : GenericCharacterMain
	{
		private float lastDiag;

		private readonly MoveSfx moveSfx = new MoveSfx();

		public override void FixedUpdate()
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			((GenericCharacterMain)this).FixedUpdate();
			if (((EntityState)this).isAuthority)
			{
				moveSfx.Tick(((EntityState)this).characterBody, ((EntityState)this).characterMotor, Time.fixedDeltaTime);
			}
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && PepsimanPlugin.FreezeOnAttack && Attacking())
			{
				((EntityState)this).characterMotor.moveDirection = Vector3.zero;
				Vector3 velocity = ((EntityState)this).characterMotor.velocity;
				velocity.x = 0f;
				velocity.z = 0f;
				((EntityState)this).characterMotor.velocity = velocity;
			}
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
			{
				Vector3 val = (PepsimanPlugin.AutoRun ? base.moveVector : ((EntityState)this).inputBank.moveVector);
				bool flag = ((Vector3)(ref val)).magnitude > 0.5f;
				((EntityState)this).characterBody.isSprinting = flag;
				if (flag && Time.time - lastDiag > 3f)
				{
					lastDiag = Time.time;
					PepsimanPlugin.Log.LogInfo((object)("[Pepsiman] sprint diag: isSprinting=" + ((EntityState)this).characterBody.isSprinting + " moveSpeed=" + ((EntityState)this).characterBody.moveSpeed.ToString("F2") + " flags=" + ((object)Unsafe.As<BodyFlags, BodyFlags>(ref ((EntityState)this).characterBody.bodyFlags)/*cast due to .constrained prefix*/).ToString()));
				}
			}
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterBody.HasBuff(Buffs.airHold) && !((EntityState)this).characterMotor.isGrounded)
			{
				Vector3 velocity2 = ((EntityState)this).characterMotor.velocity;
				if (velocity2.y < 0f)
				{
					velocity2.y = 0f;
					((EntityState)this).characterMotor.velocity = velocity2;
				}
			}
		}

		public override void GatherInputs()
		{
			//IL_001a: 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_002e: 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_0038: Unknown result type (might be due to invalid IL or missing references)
			((GenericCharacterMain)this).GatherInputs();
			base.sprintInputReceived = true;
			if (PepsimanPlugin.AutoRun && !Movement.PickerNearby(((EntityState)this).characterBody.corePosition))
			{
				base.moveVector = Movement.Forced(base.aimDirection, base.moveVector);
			}
		}

		private bool Attacking()
		{
			EntityStateMachine val = EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Weapon");
			if (Object.op_Implicit((Object)(object)val))
			{
				if (!(val.state is Punch) && !(val.state is Uppercut))
				{
					return val.state is PepsiMachine;
				}
				return true;
			}
			return false;
		}

		public override bool TryPerformJump(float horizontalBonus, float verticalBonus)
		{
			bool num = ((GenericCharacterMain)this).TryPerformJump(horizontalBonus + 0.25f, verticalBonus);
			if (num)
			{
				moveSfx.Jumped(((EntityState)this).characterBody);
				AltEvents.RaiseJumped(((EntityState)this).characterBody);
			}
			return num;
		}
	}
	public class Punch : BaseSkillState, IStepSetter
	{
		private const float fireFraction = 0.4f;

		private const float lungeTime = 0.12f;

		private int step;

		private float duration;

		private bool fired;

		private Vector3 dir;

		private float lungeDistance;

		public bool IsKick => step % 3 == 2;

		public string Clip
		{
			get
			{
				if (step % 3 != 0)
				{
					if (step % 3 != 1)
					{
						return "Kick";
					}
					return "PunchR";
				}
				return "PunchL";
			}
		}

		public float Duration => duration;

		public float ClipFitSeconds => duration * 0.4f / (IsKick ? 0.5f : 0.33f);

		public void SetStep(int i)
		{
			step = i;
		}

		public override void OnEnter()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: 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)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = 0.5f / ((BaseState)this).attackSpeedStat;
			((BaseState)this).StartAimMode(0.5f + duration, false);
			((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 val = new Vector3(((Ray)(ref aimRay)).direction.x, 0f, ((Ray)(ref aimRay)).direction.z);
			dir = ((Vector3)(ref val)).normalized;
			if (dir == Vector3.zero)
			{
				dir = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).transform.forward);
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = dir;
			}
			float num;
			if (!Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				num = 0f;
			}
			else
			{
				val = new Vector3(((EntityState)this).characterMotor.velocity.x, 0f, ((EntityState)this).characterMotor.velocity.z);
				num = ((Vector3)(ref val)).magnitude;
			}
			float num2 = num;
			lungeDistance = (IsKick ? 1.1f : 0.7f) + num2 * 0.015f;
		}

		public override void FixedUpdate()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_0078: 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_00ef: 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_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).fixedAge >= duration * 0.4f - 0.06f && ((EntityState)this).fixedAge < duration * 0.4f + 0.06f)
			{
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += dir * (lungeDistance * Time.fixedDeltaTime / 0.12f);
			}
			if (!fired && ((EntityState)this).fixedAge >= duration * 0.4f)
			{
				fired = true;
				Sfx.Play(IsKick ? "kick_swing" : "punch_swing", ((EntityState)this).characterBody, 0.9f);
				if (NetworkServer.active)
				{
					Melee.Strike(((EntityState)this).characterBody, ((EntityState)this).characterBody.corePosition + dir * 1.7f, IsKick ? 3.1f : 2.7f, new Melee.Hit
					{
						damageCoefficient = (IsKick ? 3.2f : 2.5f),
						fizzPerHit = 1f,
						carryDuration = 0.35f,
						holdAir = true,
						grantBarrier = true,
						force = 0f
					});
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			if (IsKick && ((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.AddTimedBuffAuthority(Buffs.comboCooldown.buffIndex, 0.35f);
			}
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			if (((EntityState)this).fixedAge >= duration * 0.6f)
			{
				return (InterruptPriority)0;
			}
			return (InterruptPriority)1;
		}
	}
	public class Slide : BaseState
	{
		private const float tickInterval = 0.1f;

		private Vector3 dir;

		private float speed;

		private float tickTimer;

		private HashSet<HealthComponent> hitSet = new HashSet<HealthComponent>();

		private Melee.BarrierBudget barrierBudget = new Melee.BarrierBudget(0.12f);

		public override void OnEnter()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: 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_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: 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_0066: 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_0080: 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_0093: 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_0099: 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_00b7: 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_010c: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 input = (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) ? ((EntityState)this).inputBank.moveVector : Vector3.zero);
			Vector3 val = new Vector3(((Ray)(ref aimRay)).direction.x, 0f, ((Ray)(ref aimRay)).direction.z);
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			dir = ((PepsimanPlugin.AutoRun && !Movement.PickerNearby(((EntityState)this).characterBody.corePosition)) ? Movement.Forced(((Ray)(ref aimRay)).direction, input) : ((((Vector3)(ref input)).sqrMagnitude > 0.01f) ? ((Vector3)(ref input)).normalized : normalized));
			if (dir == Vector3.zero)
			{
				dir = ((EntityState)this).transform.forward;
			}
			speed = base.moveSpeedStat * 1.7f + 5f;
			Sfx.Play("slide", ((EntityState)this).characterBody, 0.9f);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = dir;
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.armored, 0.48999998f);
			}
		}

		public override void FixedUpdate()
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: 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_009e: 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_0114: 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_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			float num = ((EntityState)this).fixedAge / 0.7f;
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				float num2 = speed * Mathf.Lerp(1f, 0.55f, Mathf.Clamp01((num - 0.5f) / 0.5f));
				Vector3 velocity = ((EntityState)this).characterMotor.velocity;
				velocity.x = dir.x * num2;
				velocity.z = dir.z * num2;
				((EntityState)this).characterMotor.velocity = velocity;
				((EntityState)this).characterMotor.moveDirection = dir;
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
				{
					((EntityState)this).characterDirection.forward = dir;
				}
			}
			tickTimer -= Time.fixedDeltaTime;
			if (NetworkServer.active && tickTimer <= 0f && num < 0.9f)
			{
				tickTimer = 0.1f;
				Melee.Strike(((EntityState)this).characterBody, ((EntityState)this).characterBody.corePosition + dir * 1.2f, 2.6f, new Melee.Hit
				{
					damageCoefficient = 2.5f,
					fizzPerHit = 1.5f,
					carryDuration = 0.55f,
					holdAir = false,
					grantBarrier = true
				}, hitSet, barrierBudget);
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.7f)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			if (NetworkServer.active)
			{
				AltEvents.RaiseSlideEnded(((EntityState)this).characterBody, hitSet.Count);
			}
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class Uppercut : BaseSkillState
	{
		private const float baseDuration = 0.45f;

		private const float fireFraction = 0.15f;

		private float duration;

		private bool fired;

		private Vector3 dir;

		public float Duration => duration;

		public override void OnEnter()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = 0.45f / ((BaseState)this).attackSpeedStat;
			((BaseState)this).StartAimMode(0.5f + duration, false);
			((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 val = new Vector3(((Ray)(ref aimRay)).direction.x, 0f, ((Ray)(ref aimRay)).direction.z);
			dir = ((Vector3)(ref val)).normalized;
			if (dir == Vector3.zero)
			{
				dir = ((EntityState)this).transform.forward;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = dir;
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.armored, duration + 0.2f);
			}
		}

		public override void FixedUpdate()
		{
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: 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_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: 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_00bb: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: 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)
			((EntityState)this).FixedUpdate();
			if (!fired && ((EntityState)this).fixedAge >= duration * 0.15f)
			{
				fired = true;
				Sfx.Play("uppercut_swing", ((EntityState)this).characterBody, 0.9f);
				if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					if (Object.op_Implicit((Object)(object)((BaseCharacterController)((EntityState)this).characterMotor).Motor))
					{
						((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
					}
					Vector3 velocity = ((EntityState)this).characterMotor.velocity;
					velocity.y = 14f;
					((EntityState)this).characterMotor.velocity = velocity;
					CharacterMotor characterMotor = ((EntityState)this).characterMotor;
					characterMotor.rootMotion += dir * 0.5f;
					PepsimanPlugin.Log.LogInfo((object)("[Pepsiman] uppercut diag: set vy=" + velocity.y + " grounded=" + ((EntityState)this).characterMotor.isGrounded + " authority=" + ((EntityState)this).isAuthority));
				}
				if (NetworkServer.active)
				{
					Melee.Strike(((EntityState)this).characterBody, ((EntityState)this).characterBody.corePosition + dir * 1.5f + Vector3.up * 0.5f, 3.2f, new Melee.Hit
					{
						damageCoefficient = 4f,
						fizzPerHit = 2f,
						carryDuration = 0.6f,
						holdAir = true,
						launchSpeed = 14f,
						grantBarrier = true
					});
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			if (NetworkServer.active)
			{
				CanProjectile.UppercutEnded(((EntityState)this).characterBody);
			}
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
}
namespace PepsimanMod.States.Alt
{
	internal static class AltUtil
	{
		public static readonly string OmniFx = "Prefabs/Effects/OmniEffect/OmniExplosionVFX";

		public static Vector3 FlatAim(BaseState s)
		{
			//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_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: 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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = s.GetAimRay();
			Vector3 forward = default(Vector3);
			((Vector3)(ref forward))..ctor(((Ray)(ref aimRay)).direction.x, 0f, ((Ray)(ref aimRay)).direction.z);
			if (((Vector3)(ref forward)).sqrMagnitude < 0.0001f)
			{
				forward = ((EntityState)s).transform.forward;
			}
			return ((Vector3)(ref forward)).normalized;
		}

		public static void Burst(Vector3 position, float scale)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: 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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			GameObject val = LegacyResourcesAPI.Load<GameObject>(OmniFx);
			if (Object.op_Implicit((Object)(object)val))
			{
				EffectManager.SpawnEffect(val, new EffectData
				{
					origin = position,
					scale = scale
				}, true);
			}
		}
	}
	public class CanToss : BaseSkillState, IPepsimanClip
	{
		private float duration;

		private bool fired;

		public string ClipName => "PunchR";

		public float FitSeconds => duration;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = 0.32f / ((BaseState)this).attackSpeedStat;
			((BaseState)this).StartAimMode(2f, false);
			((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
		}

		public override void FixedUpdate()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!fired && ((EntityState)this).fixedAge >= duration * 0.35f)
			{
				fired = true;
				Sfx.Play("punch_swing", ((EntityState)this).characterBody, 0.8f);
				if (((EntityState)this).isAuthority)
				{
					AltProjectiles.Fire(AltProjectiles.canToss, ((BaseState)this).GetAimRay(), ((EntityState)this).gameObject, ((BaseState)this).damageStat * 1.6f, ((BaseState)this).RollCrit(), 200f);
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class SlamDunk : BaseSkillState, IPepsimanClip
	{
		private float riseTime;

		private float landAt;

		private bool diveStarted;

		private bool slammed;

		private Vector3 dir;

		public string ClipName
		{
			get
			{
				if (!(((EntityState)this).fixedAge < riseTime))
				{
					if (!slammed)
					{
						return "Fall";
					}
					return "Land";
				}
				return "UppercutRise";
			}
		}

		public float FitSeconds => 0f;

		public override void OnEnter()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			dir = AltUtil.FlatAim((BaseState)(object)this);
			((BaseState)this).StartAimMode(1.5f, false);
			bool flag = Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded;
			riseTime = (flag ? 0.04f : 0.22f);
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !flag)
			{
				if (Object.op_Implicit((Object)(object)((BaseCharacterController)((EntityState)this).characterMotor).Motor))
				{
					((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
				}
				Vector3 velocity = ((EntityState)this).characterMotor.velocity;
				velocity.y = 15f;
				((EntityState)this).characterMotor.velocity = velocity;
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.armored, riseTime + 1.2f);
			}
		}

		public override void FixedUpdate()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: 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_0147: 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_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: 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_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!diveStarted && ((EntityState)this).fixedAge >= riseTime)
			{
				diveStarted = true;
				float num = 6f;
				RaycastHit val = default(RaycastHit);
				if (Physics.Raycast(((EntityState)this).characterBody.footPosition + Vector3.up * 0.5f, Vector3.down, ref val, 250f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
				{
					num = Mathf.Max(0.5f, ((RaycastHit)(ref val)).distance - 0.5f);
				}
				landAt = riseTime + Mathf.Max(0.12f, num / 42f);
				Sfx.Play("uppercut_swing", ((EntityState)this).characterBody);
			}
			if (diveStarted && !slammed && ((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				Vector3 velocity = ((EntityState)this).characterMotor.velocity;
				velocity.x = dir.x * ((BaseState)this).moveSpeedStat * 0.5f;
				velocity.z = dir.z * ((BaseState)this).moveSpeedStat * 0.5f;
				velocity.y = -42f;
				((EntityState)this).characterMotor.velocity = velocity;
			}
			if (diveStarted && !slammed && ((EntityState)this).fixedAge >= landAt)
			{
				slammed = true;
				Sfx.Play("machine_impact", ((EntityState)this).characterBody.footPosition);
				if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					Vector3 velocity2 = ((EntityState)this).characterMotor.velocity;
					velocity2.y = 17f;
					((EntityState)this).characterMotor.velocity = velocity2;
				}
				if (NetworkServer.active)
				{
					AltUtil.Burst(((EntityState)this).characterBody.footPosition, 6.5f);
					Melee.Strike(((EntityState)this).characterBody, ((EntityState)this).characterBody.footPosition + Vector3.up * 0.6f, 6.5f, new Melee.Hit
					{
						damageCoefficient = 5f,
						fizzPerHit = 2f,
						carryDuration = 0.4f,
						holdAir = false,
						launchSpeed = 12f,
						grantBarrier = true,
						force = 600f,
						damageType = (DamageType)32
					});
				}
			}
			if (((EntityState)this).isAuthority && ((slammed && ((EntityState)this).fixedAge >= landAt + 0.25f) || ((EntityState)this).fixedAge > 3f))
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class RoundhouseRush : BaseSkillState, IPepsimanClip
	{
		private float duration;

		private bool fired;

		private Vector3 dir;

		public string ClipName => "Kick";

		public float FitSeconds => duration;

		public override void OnEnter()
		{
			//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_005b: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = 0.6f / ((BaseState)this).attackSpeedStat;
			dir = AltUtil.FlatAim((BaseState)(object)this);
			((BaseState)this).StartAimMode(0.5f + duration, false);
			((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = dir;
			}
		}

		public override void FixedUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: 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_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).fixedAge < duration * 0.45f)
			{
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += dir * (1.4f * Time.fixedDeltaTime / (duration * 0.45f));
			}
			if (!fired && ((EntityState)this).fixedAge >= duration * 0.3f)
			{
				fired = true;
				Sfx.Play("kick_swing", ((EntityState)this).characterBody);
				if (NetworkServer.active)
				{
					Melee.Strike(((EntityState)this).characterBody, ((EntityState)this).characterBody.corePosition, 4.6f, new Melee.Hit
					{
						damageCoefficient = 3.4f,
						fizzPerHit = 1f,
						carryDuration = 0f,
						holdAir = false,
						grantBarrier = true,
						force = 1800f
					});
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			if (((EntityState)this).fixedAge >= duration * 0.6f)
			{
				return (InterruptPriority)0;
			}
			return (InterruptPriority)1;
		}
	}
	public class ShoulderCharge : BaseState, IPepsimanClip
	{
		private Vector3 dir;

		private float speed;

		private float tick;

		private bool bashed;

		private readonly HashSet<HealthComponent> hitSet = new HashSet<HealthComponent>();

		public string ClipName => "SlideLoop";

		public float FitSeconds => 0f;

		public override void OnEnter()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			dir = AltUtil.FlatAim((BaseState)(object)this);
			speed = base.moveSpeedStat * 2.4f + 8f;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = dir;
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.armored, 0.6f);
			}
			Sfx.Play("slide", ((EntityState)this).characterBody);
		}

		public override void FixedUpdate()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: 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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: 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_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: 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_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				Vector3 velocity = ((EntityState)this).characterMotor.velocity;
				velocity.x = dir.x * speed;
				velocity.z = dir.z * speed;
				((EntityState)this).characterMotor.velocity = velocity;
				((EntityState)this).characterMotor.moveDirection = dir;
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
				{
					((EntityState)this).characterDirection.forward = dir;
				}
			}
			tick -= Time.fixedDeltaTime;
			if (NetworkServer.active && tick <= 0f && ((EntityState)this).fixedAge < 0.5f)
			{
				tick = 0.08f;
				Melee.Strike(((EntityState)this).characterBody, ((EntityState)this).characterBody.corePosition + dir * 1.4f, 2.6f, new Melee.Hit
				{
					damageCoefficient = 3.5f,
					fizzPerHit = 2f,
					carryDuration = 0.6f,
					holdAir = false,
					grantBarrier = true
				}, hitSet);
			}
			if (!bashed && ((EntityState)this).fixedAge >= 0.5f)
			{
				bashed = true;
				Sfx.Play("punch_hit", ((EntityState)this).characterBody.corePosition + dir * 1.5f);
				if (NetworkServer.active)
				{
					Melee.Strike(((EntityState)this).characterBody, ((EntityState)this).characterBody.corePosition + dir * 1.8f, 4f, new Melee.Hit
					{
						damageCoefficient = 2f,
						fizzPerHit = 1f,
						carryDuration = 0f,
						grantBarrier = false,
						force = 900f,
						damageType = (DamageType)32
					});
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.6f)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class FizzShake : BaseSkillState, IPepsimanClip
	{
		private const float duration = 0.45f;

		private bool fired;

		public string ClipName => "ThrowMachine";

		public float FitSeconds => 0.45f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			((BaseState)this).StartAimMode(0.5f, false);
			Sfx.Play("can_open", ((EntityState)this).characterBody);
			if (NetworkServer.active)
			{
				FizzTracker component = ((Component)((EntityState)this).characterBody).GetComponent<FizzTracker>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.LoseStacks(5);
				}
				((EntityState)this).characterBody.AddTimedBuff(Buffs.armored, 0.9f);
			}
		}

		public override void FixedUpdate()
		{
			//IL_0054: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!fired && ((EntityState)this).fixedAge >= 0.17999999f)
			{
				fired = true;
				Sfx.Play("machine_impact", ((EntityState)this).characterBody, 0.9f);
				if (NetworkServer.active)
				{
					AltUtil.Burst(((EntityState)this).characterBody.corePosition, 9f);
					Melee.Strike(((EntityState)this).characterBody, ((EntityState)this).characterBody.corePosition, 9f, new Melee.Hit
					{
						damageCoefficient = 3f,
						fizzPerHit = 0f,
						carryDuration = 0f,
						grantBarrier = true,
						force = 2200f,
						damageType = (DamageType)32
					});
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.45f)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class Lob : BaseSkillState, IPepsimanClip
	{
		private const float duration = 0.5f;

		private bool fired;

		public string ClipName => "ThrowMachine";

		public float FitSeconds => 0.5f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			((BaseState)this).StartAimMode(1f, false);
			((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
		}

		public override void FixedUpdate()
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: 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_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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)
			((EntityState)this).FixedUpdate();
			if (!fired && ((EntityState)this).fixedAge >= 0.2f)
			{
				fired = true;
				Sfx.Play("machine_throw", ((EntityState)this).characterBody, 0.9f);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					Vector3 val = ((Ray)(ref aimRay)).direction + Vector3.up * 0.18f;
					((Ray)(ref aimRay)).direction = ((Vector3)(ref val)).normalized;
					AltProjectiles.Fire(AltProjectiles.lob, aimRay, ((EntityState)this).gameObject, ((BaseState)this).damageStat * 4f, ((BaseState)this).RollCrit(), 800f);
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.5f)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class VendingBarricade : BaseSkillState, IPepsimanClip
	{
		private const float duration = 0.55f;

		private bool placed;

		private Vector3 dir;

		public string ClipName => "ThrowMachine";

		public float FitSeconds => 0.55f;

		public override void OnEnter()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			dir = AltUtil.FlatAim((BaseState)(object)this);
			((BaseState)this).StartAimMode(1f, false);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = dir;
			}
		}

		public override void FixedUpdate()
		{
			//IL_002e: 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_003e: 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_0048: 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_004a: 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_006f: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: 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_00ec: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!placed && ((EntityState)this).fixedAge >= 0.2475f)
			{
				placed = true;
				Vector3 val = ((EntityState)this).characterBody.footPosition + dir * 6f;
				RaycastHit val2 = default(RaycastHit);
				if (Physics.Raycast(val + Vector3.up * 4f, Vector3.down, ref val2, 30f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
				{
					val = ((RaycastHit)(ref val2)).point;
				}
				Sfx.Play("machine_impact", val, 1.1f);
				if (NetworkServer.active && Object.op_Implicit((Object)(object)AltPrefabs.barricade))
				{
					GameObject obj = Object.Instantiate<GameObject>(AltPrefabs.barricade, val, Quaternion.LookRotation(dir));
					BarricadeAura component = obj.GetComponent<BarricadeAura>();
					if (Object.op_Implicit((Object)(object)component))
					{
						component.team = ((BaseState)this).GetTeam();
					}
					NetworkServer.Spawn(obj);
					AltUtil.Burst(val, 4f);
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.55f)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class PepsiRush : BaseSkillState, IPepsimanClip
	{
		private const float duration = 0.45f;

		private bool started;

		public string ClipName => "UppercutWindup";

		public float FitSeconds => 0.45f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			Sfx.Play("voice_taunt", ((EntityState)this).characterBody, 1f, 0f);
		}

		public override void FixedUpdate()
		{
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!started && ((EntityState)this).fixedAge >= 0.135f)
			{
				started = true;
				if (NetworkServer.active)
				{
					FizzTracker component = ((Component)((EntityState)this).characterBody).GetComponent<FizzTracker>();
					int num = (Object.op_Implicit((Object)(object)component) ? component.ConsumeAll() : 0);
					float num2 = 3f + 0.4f * (float)num;
					((EntityState)this).characterBody.AddTimedBuff(Buffs.pepsiRush, num2);
					AltUtil.Burst(((EntityState)this).characterBody.corePosition, 5f);
					PepsimanPlugin.Log.LogInfo((object)("[Pepsiman] Pepsi Rush for " + num2.ToString("F1") + " s (" + num + " Fizz)"));
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.45f)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class PepsiTruckCall : BaseSkillState, IPepsimanClip
	{
		private const float duration = 0.65f;

		private bool called;

		private Vector3 dir;

		public string ClipName => "ThrowMachine";

		public float FitSeconds => 0.65f;

		public override void OnEnter()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			dir = AltUtil.FlatAim((BaseState)(object)this);
			((BaseState)this).StartAimMode(1f, false);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = dir;
			}
			Sfx.Play("voice_taunt", ((EntityState)this).characterBody, 1f, 0f, 2f);
		}

		public override void FixedUpdate()
		{
			//IL_0065: 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_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: 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_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: 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_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!called && ((EntityState)this).fixedAge >= 0.325f)
			{
				called = true;
				if (NetworkServer.active && Object.op_Implicit((Object)(object)AltPrefabs.truck))
				{
					FizzTracker component = ((Component)((EntityState)this).characterBody).GetComponent<FizzTracker>();
					int num = (Object.op_Implicit((Object)(object)component) ? component.Stacks : 0);
					Vector3 val = ((EntityState)this).characterBody.footPosition + dir * 4f;
					RaycastHit val2 = default(RaycastHit);
					if (Physics.Raycast(val + Vector3.up * 6f, Vector3.down, ref val2, 30f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
					{
						val = ((RaycastHit)(ref val2)).point;
					}
					GameObject obj = Object.Instantiate<GameObject>(AltPrefabs.truck, val, Quaternion.LookRotation(dir));
					PepsiTruck component2 = obj.GetComponent<PepsiTruck>();
					component2.ownerObject = ((EntityState)this).gameObject;
					component2.team = ((BaseState)this).GetTeam();
					component2.damage = ((BaseState)this).damageStat * (8f + 0.3f * (float)num);
					component2.crit = ((BaseState)this).RollCrit();
					NetworkServer.Spawn(obj);
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.65f)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class Hurdle : BaseState, IPepsimanClip
	{
		private Vector3 dir;

		private float speed;

		private float flightTime;

		private bool landed;

		public string ClipName
		{
			get
			{
				if (!landed)
				{
					if (!(((EntityState)this).fixedAge < 0.2f))
					{
						return "AirLoop";
					}
					return "JumpStart";
				}
				return "Land";
			}
		}

		public float FitSeconds => 0f;

		public override void OnEnter()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: 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_0063: 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_00b5: 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)
			//IL_00cd: 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)
			((BaseState)this).OnEnter();
			dir = AltUtil.FlatAim((BaseState)(object)this);
			speed = base.moveSpeedStat * 1.3f + 8f;
			flightTime = 34f / Mathf.Max(5f, Mathf.Abs(Physics.gravity.y));
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = dir;
			}
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				if (Object.op_Implicit((Object)(object)((BaseCharacterController)((EntityState)this).characterMotor).Motor))
				{
					((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
				}
				Vector3 velocity = dir * speed;
				velocity.y = 17f;
				((EntityState)this).characterMotor.velocity = velocity;
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.armored, 0.55f);
			}
			Sfx.Play("jump", ((EntityState)this).characterBody);
		}

		public override void FixedUpdate()
		{
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: 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_00fb: 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)
			//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_0074: 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)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !landed && ((EntityState)this).fixedAge > 0.1f)
			{
				Vector3 velocity = ((EntityState)this).characterMotor.velocity;
				velocity.x = dir.x * speed;
				velocity.z = dir.z * speed;
				((EntityState)this).characterMotor.velocity = velocity;
			}
			if (!landed && ((EntityState)this).fixedAge >= flightTime)
			{
				landed = true;
				Sfx.Play("land", ((EntityState)this).characterBody);
				if (NetworkServer.active)
				{
					AltUtil.Burst(((EntityState)this).characterBody.footPosition, 6f);
					Melee.Strike(((EntityState)this).characterBody, ((EntityState)this).characterBody.footPosition + Vector3.up * 0.6f, 6f, new Melee.Hit
					{
						damageCoefficient = 3f,
						fizzPerHit = 1.5f,
						carryDuration = 0.3f,
						grantBarrier = true,
						force = 500f,
						damageType = (DamageType)32
					});
				}
			}
			if (((EntityState)this).isAuthority && ((landed && ((EntityState)this).fixedAge >= flightTime + 0.15f) || ((EntityState)this).fixedAge > 2.5f))
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class TruckDodge : BaseState, IPepsimanClip
	{
		private Vector3 dir;

		public string ClipName => "SlideStart";

		public float FitSeconds => 0.35f;

		public override void OnEnter()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//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_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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			Vector3 val = AltUtil.FlatAim((BaseState)(object)this);
			Vector3 val2 = Vector3.Cross(Vector3.up, val);
			float num = (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) ? Vector3.Dot(((EntityState)this).inputBank.moveVector, val2) : 0f);
			dir = val2 * ((num < -0.1f) ? (-1f) : 1f);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.45f);
				((EntityState)this).characterBody.AddTimedBuff(Buffs.dodging, 0.45f);
				((EntityState)this).characterBody.AddTimedBuff(Buffs.armored, 0.55f);
			}
			Sfx.Play("jump", ((EntityState)this).characterBody, 0.8f);
		}

		public override void FixedUpdate()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).fixedAge < 0.35f)
			{
				float num = 1f - ((EntityState)this).fixedAge / 0.35f * 0.5f;
				Vector3 velocity = ((EntityState)this).characterMotor.velocity;
				velocity.x = dir.x * 24f * num;
				velocity.z = dir.z * 24f * num;
				((EntityState)this).characterMotor.velocity = velocity;
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.35f)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class DrinkBreak : BaseState, IPepsimanClip
	{
		private const float healTick = 0.25f;

		private float nextHeal;

		public string ClipName => "Idle";

		public float FitSeconds => 0f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			Sfx.Play("can_open", ((EntityState)this).characterBody);
			nextHeal = 0.25f;
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.drinking, 1.6f);
				FizzTracker component = ((Component)((EntityState)this).characterBody).GetComponent<FizzTracker>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.Add(7f);
				}
			}
		}

		public override void FixedUpdate()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: 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)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				Vector3 velocity = ((EntityState)this).characterMotor.velocity;
				velocity.x = 0f;
				velocity.z = 0f;
				((EntityState)this).characterMotor.velocity = velocity;
				((EntityState)this).characterMotor.moveDirection = Vector3.zero;
			}
			if (NetworkServer.active && ((EntityState)this).fixedAge >= nextHeal && ((EntityState)this).fixedAge <= 1.51f)
			{
				nextHeal += 0.25f;
				float num = 0.05f;
				((EntityState)this).characterBody.healthComponent.HealFraction(num, default(ProcChainMask));
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 1.5f)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
}
namespace PepsimanMod.Modules
{
	public static class AltHooks
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_TakeDamage <0>__TakeDamage;

			public static Action<DamageReport> <1>__OnDeath;
		}

		public static void Init()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__TakeDamage;
			if (obj == null)
			{
				hook_TakeDamage val = TakeDamage;
				<>O.<0>__TakeDamage = val;
				obj = (object)val;
			}
			HealthComponent.TakeDamage += (hook_TakeDamage)obj;
			GlobalEventManager.onCharacterDeathGlobal += OnDeath;
		}

		public static void Stats(CharacterBody sender, StatHookEventArgs args)
		{
			if (Sfx.IsPepsiman(sender))
			{
				if (sender.HasBuff(Buffs.drinking))
				{
					args.armorAdd -= 30f;
				}
				if (sender.HasBuff(Buffs.pepsiRush))
				{
					args.damageMultAdd += 0.4f;
					args.attackSpeedMultAdd += 0.4f;
					args.moveSpeedMultAdd += 0.3f;
					args.armorAdd += 80f;
				}
				switch (AltPassive.Of(sender))
				{
				case PassiveKind.CanCollector:
					args.armorAdd -= (float)sender.GetBuffCount(Buffs.fizz) * 1.5f * 1f;
					break;
				case PassiveKind.Hurdler:
					args.jumpPowerMultAdd += 0.15f;
					break;
				}
			}
		}

		public static float FizzGainScale(CharacterBody body)
		{
			if (AltPassive.Of(body) != PassiveKind.Hurdler)
			{
				return 1f;
			}
			return 0.75f;
		}

		public static void OnDamage(DamageReport report)
		{
			CharacterBody attackerBody = report.attackerBody;
			CharacterBody victimBody = report.victimBody;
			GameObject val = ((report.damageInfo != null) ? report.damageInfo.inflictor : null);
			if (Object.op_Implicit((Object)(object)attackerBody) && Sfx.IsPepsiman(attackerBody) && Object.op_Implicit((Object)(object)val))
			{
				string name = ((Object)val).name;
				FizzTracker component = ((Component)attackerBody).GetComponent<FizzTracker>();
				if (name.StartsWith("PepsimanCanToss"))
				{
					if (Object.op_Implicit((Object)(object)component))
					{
						component.Add(0.5f);
					}
				}
				else if (name.StartsWith("PepsimanLobCan"))
				{
					if (Object.op_Implicit((Object)(object)component))
					{
						component.Add(1f);
					}
				}
				else if (name.StartsWith("PepsimanCanProjectile"))
				{
					AltEvents.RaiseCounterCanHit(attackerBody);
				}
				else if (name.StartsWith("PepsiMachineProp"))
				{
					AltEvents.RaiseMachineHit(attackerBody, ((Object)val).GetInstanceID());
				}
			}
			if (Sfx.IsPepsiman(victimBody) && victimBody.HasBuff(Buffs.armored))
			{
				AltEvents.RaiseArmoredHit(victimBody);
			}
		}

		private static void TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && damageInfo != null && damageInfo.damage > 0f && self.body.HasBuff(Buffs.dodging) && (Object)(object)damageInfo.attacker != (Object)(object)((Component)self).gameObject)
			{
				FizzTracker component = ((Component)self.body).GetComponent<FizzTracker>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.Add(2f);
				}
				AltEvents.RaiseDodged(self.body);
			}
			orig.Invoke(self, damageInfo);
		}

		private static void OnDeath(DamageReport report)
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: 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_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)
			if (NetworkServer.active && report != null && Object.op_Implicit((Object)(object)report.attackerBody) && Object.op_Implicit((Object)(object)report.victimBody))
			{
				CharacterBody attackerBody = report.attackerBody;
				if (Sfx.IsPepsiman(attackerBody) && AltPassive.Of(attackerBody) == PassiveKind.CanCollector && !(Random.value > 0.2f) && Object.op_Implicit((Object)(object)Prefabs.healthCanPrefab))
				{
					GameObject obj = Object.Instantiate<GameObject>(Prefabs.healthCanPrefab, report.victimBody.corePosition + Vector3.up * 0.8f, Quaternion.identity);
					obj.GetComponent<PepsiPickup>().owner = attackerBody;
					NetworkServer.Spawn(obj);
				}
			}
		}
	}
	public static class AltPrefabs
	{
		public static GameObject barricade;

		public static GameObject truck;

		public static void Init()
		{
			barricade = BuildBarricade();
			truck = BuildTruck();
		}

		private static GameObject Box(Transform parent, string name, Vector3 pos, Vector3 scale, Color color, PrimitiveType type = (PrimitiveType)3)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			GameObject obj = GameObject.CreatePrimitive(type);
			((Object)obj).name = name;
			Object.Destroy((Object)(object)obj.GetComponent<Collider>());
			obj.transform.SetParent(parent, false);
			obj.transform.localPosition = pos;
			obj.transform.localScale = scale;
			obj.GetComponent<Renderer>().sharedMaterial = Art.MakeMaterial(color);
			return obj;
		}

		private static GameObject BuildBarricade()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: 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_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: 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_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("PepsiBarricade");
			val.AddComponent<NetworkIdentity>();
			Transform transform = new GameObject("Visual").transform;
			transform.SetParent(val.transform, false);
			GameObject val2 = (Object.op_Implicit((Object)(object)ModelSwap.bundle) ? ModelSwap.bundle.LoadAsset<GameObject>("PepsiMachineModel") : null);
			float num = 1.3f;
			float num2 = 1.3f;
			if (Object.op_Implicit((Object)(object)val2))
			{
				Material sharedMaterial = Art.MakeTexturedMaterial((Texture)(object)ModelSwap.bundle.LoadAsset<Texture2D>("texPepsiMachineAlbedo"), (Texture)(object)ModelSwap.bundle.LoadAsset<Texture2D>("texPepsiMachineNormal"));
				for (int i = -1; i <= 1; i++)
				{
					GameObject obj = Object.Instantiate<GameObject>(val2, transform);
					((Object)obj).name = "Machine" + i;
					obj.transform.localPosition = new Vector3((float)i * num, 0f, 0f);
					obj.transform.localRotation = Quaternion.identity;
					obj.transform.localScale = Vector3.one * num2;
					Renderer[] componentsInChildren = obj.GetComponentsInChildren<Renderer>(true);
					for (int j = 0; j < componentsInChildren.Length; j++)
					{
						componentsInChildren[j].sharedMaterial = sharedMaterial;
					}
				}
			}
			else
			{
				for (int k = -1; k <= 1; k++)
				{
					Box(transform, "Body" + k, new Vector3((float)k * 1.7f, 1.2f, 0f), new Vector3(1.55f, 2.4f, 0.95f), StaticValues.pepsiBlue, (PrimitiveType)3);
					Box(transform, "Stripe" + k, new Vector3((float)k * 1.7f, 1.55f, 0.03f), new Vector3(1.6f, 0.45f, 0.98f), StaticValues.pepsiRed, (PrimitiveType)3);
					Box(transform, "Window" + k, new Vector3((float)k * 1.7f, 1f, 0.5f), new Vector3(1f, 0.9f, 0.05f), Color.white, (PrimitiveType)3);
				}
				num = 1.7f;
			}
			BoxCollider obj2 = val.AddComponent<BoxCollider>();
			obj2.center = new Vector3(0f, 1.2f, 0f);
			obj2.size = new Vector3(num * 3f, 2.4f, 1.1f);
			val.AddComponent<BarricadeAura>();
			val.AddComponent<DestroyOnTimer>().duration = 7f;
			val.layer = LayerIndex.world.intVal;
			GameObject result = PrefabAPI.InstantiateClone(val, "PepsiBarricade", true);
			Object.Destroy((Object)(object)val);
			return result;
		}

		private static GameObject BuildTruck()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: 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_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: 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)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: 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_0106: 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_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: 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_01af: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("PepsiTruckProp");
			val.AddComponent<NetworkIdentity>();
			Transform transform = new GameObject("Visual").transform;
			transform.SetParent(val.transform, false);
			Box(transform, "Trailer", new Vector3(0f, 1.9f, -2.2f), new Vector3(2.8f, 2.8f, 5.2f), StaticValues.pepsiBlue, (PrimitiveType)3);
			Box(transform, "Stripe", new Vector3(0f, 1.9f, -2.2f), new Vector3(2.85f, 0.7f, 5.25f), StaticValues.pepsiRed, (PrimitiveType)3);
			Box(transform, "Cab", new Vector3(0f, 1.5f, 1.2f), new Vector3(2.6f, 2f, 1.9f), Color.white, (PrimitiveType)3);
			Box(transform, "Glass", new Vector3(0f, 1.9f, 2.17f), new Vector3(2.2f, 0.9f, 0.05f), new Color(0.2f, 0.3f, 0.4f), (PrimitiveType)3);
			float[] array = new float[3] { 1.4f, -1.2f, -3.4f };
			foreach (float num in array)
			{
				float[] array2 = new float[2] { -1.45f, 1.45f };
				foreach (float num2 in array2)
				{
					Box(transform, "Wheel", new Vector3(num2, 0.55f, num), new Vector3(0.5f, 0.55f, 1.1f), Color.black, (PrimitiveType)2).transform.localRotation = Quaternion.Euler(0f, 0f, 90f);
				}
			}
			val.AddComponent<PepsiTruck>();
			val.AddComponent<DestroyOnTimer>().duration = 2.2f;
			GameObject result = PrefabAPI.InstantiateClone(val, "PepsiTruckProp", true);
			Object.Destroy((Object)(object)val);
			return result;
		}
	}
	public static class AltProjectiles
	{
		public const string CanTossName = "PepsimanCanToss";

		public const string LobName = "PepsimanLobCan";

		internal static readonly List<GameObject> projectilePrefabs = new List<GameObject>();

		public static GameObject canToss;

		public static GameObject lob;

		public static void Init()
		{
			canToss = Make("PepsimanCanToss", new string[2] { "Prefabs/Projectiles/MageFireboltBasic", "Prefabs/Projectiles/FMJ" }, 75f, gravity: false, 0f);
			lob = Make("PepsimanLobCan", new string[1] { "Prefabs/Projectiles/CommandoGrenadeProjectile" }, 38f, gravity: true, 7f);
		}

		private static GameObject Make(string name, string[] candidates, float speed, bool gravity, float blastRadius)
		{
			GameObject val = null;
			string text = null;
			foreach (string text2 in candidates)
			{
				val = LegacyResourcesAPI.Load<GameObject>(text2);
				if (Object.op_Implicit((Object)(object)val))
				{
					text = text2;
					break;
				}
			}
			if (!Object.op_Implicit((Object)(object)val))
			{
				PepsimanPlugin.Log.LogWarning((object)("[Pepsiman] no base projectile for " + name + ", that skill will do nothing"));
				return null;
			}
			PepsimanPlugin.Log.LogInfo((object)("[Pepsiman] " + name + " based on " + text));
			GameObject val2 = PrefabAPI.InstantiateClone(val, name);
			ProjectileSimple component = val2.GetComponent<ProjectileSimple>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.desiredForwardSpeed = speed;
				component.lifetime = Mathf.Max(component.lifetime, 3f);
			}
			Rigidbody component2 = val2.GetComponent<Rigidbody>();
			if (Object.op_Implicit((Object)(object)component2))
			{
				component2.useGravity = gravity;
			}
			ProjectileImpactExplosion component3 = val2.GetComponent<ProjectileImpactExplosion>();
			if (Object.op_Implicit((Object)(object)component3) && blastRadius > 0f)
			{
				((ProjectileExplosion)component3).blastRadius = blastRadius;
			}
			ProjectileController component4 = val2.GetComponent<ProjectileController>();
			if (Object.op_Implicit((Object)(object)component4) && Object.op_Implicit((Object)(object)component4.ghostPrefab))
			{
				component4.ghostPrefab = CanProjectile.BuildGhost(component4.ghostPrefab, name + "Ghost");
			}
			projectilePrefabs.Add(val2);
			return val2;
		}

		public static void Fire(GameObject prefab, Ray aim, GameObject owner, float damage, bool crit, float force = 400f)
		{
			//IL_001c: 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_0035: 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_0044: 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_0052: 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_005c: 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)
			if (Object.op_Implicit((Object)(object)prefab) && Object.op_Implicit((Object)(object)ProjectileManager.instance))
			{
				ProjectileManager.instance.FireProjectile(new FireProjectileInfo
				{
					projectilePrefab = prefab,
					position = ((Ray)(ref aim)).origin + ((Ray)(ref aim)).direction * 1f,
					rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aim)).direction),
					owner = owner,
					damage = damage,
					force = force,
					crit = crit
				});
			}
		}
	}
	public static class AltSkills
	{
		public class FizzCostSkillDef : SkillDef
		{
			public int fizzCost;

			public override bool IsReady(GenericSkill skillSlot)
			{
				if (((SkillDef)this).IsReady(skillSlot) && Object.op_Implicit((Object)(object)skillSlot.characterBody))
				{
					return skillSlot.characterBody.GetBuffCount(Buffs.fizz) >= fizzCost;
				}
				return false;
			}

			public override bool CanExecute(GenericSkill skillSlot)
			{
				if (((SkillDef)this).CanExecute(skillSlot) && Object.op_Implicit((Object)(object)skillSlot.characterBody))
				{
					return skillSlot.characterBody.GetBuffCount(Buffs.fizz) >= fizzCost;
				}
				return false;
			}
		}

		internal static readonly List<Type> entityStates = new List<Type>
		{
			typeof(CanToss),
			typeof(SlamDunk),
			typeof(RoundhouseRush),
			typeof(ShoulderCharge),
			typeof(FizzShake),
			typeof(Lob),
			typeof(Hurdle),
			typeof(TruckDodge),
			typeof(DrinkBreak),
			typeof(VendingBarricade),
			typeof(PepsiRush),
			typeof(PepsiTruckCall)
		};

		public static void Register(GameObject bodyPrefab, SkillLocator locator)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: 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_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_0376: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
			Add(locator.primary, "Primary", Make<SkillDef>("PEPSIMAN_CANTOSS", typeof(CanToss), "Weapon", 1, 0f, (InterruptPriority)1, StaticValues.pepsiRed, "icoCanToss", mustKeyPress: false, passive: false), "CanToss");
			Add(locator.primary, "Primary", Make<SkillDef>("PEPSIMAN_SLAMDUNK", typeof(SlamDunk), "Weapon", 1, 4f