Decompiled source of Enhanced Bots v1.2.5
EnhancedBots.dll
Decompiled 4 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Logging; using HarmonyLib; using InControl; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; using WeaponFramework; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyCompany("EnhancedBots")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.2.3.0")] [assembly: AssemblyInformationalVersion("1.2.3+54692bef5c141a92a946951efc97b841cfb84330")] [assembly: AssemblyProduct("EnhancedBots")] [assembly: AssemblyTitle("EnhancedBots")] [assembly: AssemblyVersion("1.2.3.0")] namespace EnhancedBots; internal class BotBrain : MonoBehaviour { private enum MeleeStyle { Rush, JumpIn, Feint, Bait } private enum Act { None, Idle, Stroll, Taunt, Trick, Copycat, Ringside, Invite, Fetch } private enum SpotTest { OtherBombSide, SolidAwayFrom, LaserCover, LobbyAllowed } private enum Seq { None, BlockPunchJump, Reload, ThrowHop } private struct Waypoint { public Vector3 Pos; public Move Kind; } private enum Read { None, Camping, Running, Stalling } private enum Stance { Fight, Vulture, Retreat } private struct Threat { public bool Any; public float T; public Vector3 Dir; public Fighter From; public bool Melee; public bool Unblockable; public bool Thrown; public bool Reflected; public Vector3 At; public float HitY; public float Damage; public float Speed; public float GravF; public float GravA; } private enum Taunt { None, Floss, Spin, ButtSlide, Teabag, Wave, JumpingJacks, PointAndLaugh, Dab, Headbang, Moonwalk, Shadowbox } private enum Trick { None, BunnyHops, Rocket, WallClimb, ThrowHop } private struct GuardTick { public float T; public float ThreatT; public bool Threat; public bool Melee; public bool Guard; public bool Release; public bool Held; public bool Up; public float Sbs; public float Clock; public string Mode; } private float parryAt = -10f; private float blockUntil; private Vector3 blockAim; private float shotAt = -10f; private float drawStart; private readonly Dictionary<Weapon, Transform> muzzles = new Dictionary<Weapon, Transform>(); private readonly Dictionary<int, bool> shotRolls = new Dictionary<int, bool>(); private float shotRollAt = -10f; private bool shotRollOk; private float bulletRollAt = -10f; private bool bulletRollOk; private Fighter lastSwinger; private float lastSwingAt; private float dodgeUntil; private float dodgeDir; private Fighter throwRolledFor; private float throwRolledAt = -10f; private bool throwRollOk; private float throwLoggedAt = -10f; private Weapon specialHeld; private int specialShots; private WeaponPickUp pickChasing; private WeaponPickUp pickBanned; private float pickBestD; private float pickProgressAt; private float pickBannedUntil; private float throwAimedAt = -10f; private float throwPrepAt; private bool lastReachable = true; private const float Hitscan = 1000f; private const float MaxLead = 1f; private Fighter fallOf; private float fallVy; private float fallAt; private float fallAcc; private WeaponInfo roundsOf; private WeaponInfo roundsInfo; private const float DisarmReach = 1.4f; private Fighter disarmTarget; private float disarmAt; private float disarmD; private float disarmY; private float lastSightAt; private float backOffSince; private float backOffLast = -10f; private float backOffFrom; private float noBackOffUntil; private float rangedAt; private Fighter sightOf; private int crateShots; private MeleeStyle style; private float styleUntil; private float feintStart = -10f; private Fighter styleTarget; private BotDevice dev; private Controller self; private Fighter me; private WeaponInfo held = WeaponInfo.Fists; private float wantMove; private bool wantDuck; private Vector3 wantAim; private bool aimSet; private bool fireHeld; private bool blockHeld; private Vector3 goal; private bool hasGoal; private bool goalIsPickup; internal Fighter Target; private float retargetAt; private float lastActionAt; private float lastHp = 100f; private float errorLogAt; public string Mode = ""; private string modeA; private string modeB; private string modeAB = ""; private static readonly string[] SlotNames = new string[8] { "P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8" }; internal Skill skill = Skill.Hard; private float pauseEnd; private float nextPause; private Vector3 aimNow; private bool wasAlive; private Vector3 lastAlivePos; private float statusAt; private float jumpTapAt; private float fireTapAt; private float throwTapAt; internal static readonly bool GangUp = Environment.GetEnvironmentVariable("ENHANCEDBOTS_GANGUP") == "1"; private const float FlyTop = 6f; private const float FlyBottom = -9f; private float flyBlockedSince = -1f; private float flyDetour; private float flyStuckSince = -1f; private bool flyConcede; private Ghosts.Plat hopTo; private int hopPiece = -1; private bool hopStatic; private Vector3 hopStaticPos; private float hopAt; private float hopLogAt; private Controller grudgeFrom; private float grudgeAt = -10f; private float hallowHp = 100f; private bool pumpkinWant; private float pumpkinDecideAt; private float pumpkinRollAt; private bool pumpkinRoll; private string pumpkinWhy = ""; private float pumpkinLogAt; private Fighter pumpkinRival; private float ghostHopAt; private float ghostDebugAt; private Vector3 bossSpot; private bool bossHasSpot; private float bossSpotAt; private float bossFireTapAt; private float bossSawAt; private float flyY; private bool flying; private float bossLogAt; private static readonly float BossRange = ParseRange(Environment.GetEnvironmentVariable("ENHANCEDBOTS_BOSSRANGE")); private Vector3 jink; private float jinkAt; private static readonly Collider[] airHits = (Collider[])(object)new Collider[16]; private static bool airLogged; private static readonly float[] DodgeVz = new float[7] { 0f, -7f, 7f, 0f, -7f, 7f, 0f }; private static readonly bool[] DodgeJump = new bool[7] { false, false, false, true, true, true, false }; private static readonly bool[] DodgeDuck = new bool[7] { false, false, false, false, false, false, true }; private float dodgeLogAt; private static readonly string JuggleEnv = Environment.GetEnvironmentVariable("ENHANCEDBOTS_JUGGLE"); private Fighter jug; private bool jugOn; private bool jugCounted; private bool jugWasAir; private float jugUntil; private float jugWhyAt; private float jugStart; private float jugNextLook; private float jugCooldownUntil; private float jugLastHitAt; private float jugLastSp = 9f; private float jugHp; private float jugAirSince; private float jugHomeZ; private float jugMinZ; private float jugMaxZ; private float jugFloorY; private float jugTopY; private float jugMyTopY; private int jugHits; private int jugStreaks; private int jugSessionHits; private int jugLaunchTry; private int jugPunches; private float jugHoldUntil; private float jugBrakeUntil; private float jugPressAt; private static readonly bool JuggleBrake = Environment.GetEnvironmentVariable("ENHANCEDBOTS_JUGGLE_NOBRAKE") != "1"; private Vector3 jugHoldAim; private Vector3 jugPrevCv; private Vector3 jugPrevMv; private Vector3 jugLastAim; private Vector3 jugPreCv; private Vector3 jugPreMv; private int jugLogIn; private float jugLogAt; private Fighter jugLogBody; private bool jugLogLaunch; private string jugHitNote; private string jugMiss = ""; private static int jugAllStreaks; private static int jugAllHits; private static int jugAllBest; private static int jugAllTries; private static int jugAllLaunches; private const float JuggleBerth = 10f; private const float JuggleReach = 1.9f; private string jugReject = "none"; private static readonly string ModeLaunch = "juggle: launch"; private static readonly string ModeUnder = "juggle"; private static readonly string ModeSurf = "juggle: surf"; private static float jugKick = 19.5f; private static readonly float JuggleCone = EnvFloat("ENHANCEDBOTS_JUGGLE_CONE", 35f); private static readonly bool JuggleRecover = Environment.GetEnvironmentVariable("ENHANCEDBOTS_NO_BODYKICK") != "1"; private static readonly bool JuggleTrace = Environment.GetEnvironmentVariable("ENHANCEDBOTS_JUGGLE_TRACE") == "1"; private static readonly float JuggleLead = EnvFloat("ENHANCEDBOTS_JUGGLE_LEAD", 0.15f); private const float JuggleBounce = 7f; private float bodyKickAt = -10f; private Fighter bodyKicked; private Fighter bodySaveFor; private float bodySaveFrom; private float labKickY = float.NaN; private float labPeak; private float labKickAt; private float labJumpAt; private float labVy; private const float GrudgeSeconds = 8f; private const float DoorKeepAway = 6f; private readonly Dictionary<Controller, float> grudges = new Dictionary<Controller, float>(); private bool hadGrudge; private int seenSwitches = -1; private float settleUntil; private float settleStart; private float pace = 1f; private Act act; private float actStart; private float actUntil; private Fighter buddy; private Vector3 playGoal; private WeaponPickUp fetch; private float ringSeenAt; private Vector3 ringMid; private float copyJumpWas; private float copyPunchWas; private static readonly Taunt[] Cheers = new Taunt[5] { Taunt.Wave, Taunt.JumpingJacks, Taunt.Spin, Taunt.Headbang, Taunt.Dab }; private static readonly Taunt[] Invites = new Taunt[6] { Taunt.Wave, Taunt.Dab, Taunt.Floss, Taunt.JumpingJacks, Taunt.Headbang, Taunt.Spin }; private readonly HashSet<Controller> aliveSeen = new HashSet<Controller>(); private readonly HashSet<Controller> metSeen = new HashSet<Controller>(); private bool metInit; private static readonly Collider[] nearby = (Collider[])(object)new Collider[48]; private float hazardLogAt; private const int NotPlayers = -270081; private int incomingId; private float incomingSince; private bool chargeHold; private Weapon trackWeapon; private int attacksWithHeld; private float lastCounter; private Vector3 lastPos; private float dashCheckAt = -1f; private Vector3 dashFrom; private Vector3 dashAim; private int dashIndex; private float altUntil; private float altNextAt; private Seq seq; private float seqStart; private float seqDir; private bool seqPunched; private float bpjQuietUntil; private float bpjAnchorAt = -10f; private Vector3 bpjAnchor; private int bpjCount; private float seqLandZ = float.NaN; private float lastBpjAt = -10f; private float recLogAt; private string landWhy = ""; private float recoverBlockUntil; private float recoverThrowAt; private float recoverUnsafeAt; private float recoverZ; private bool tasRecovering; private bool recoverZValid; private int recoverFrame = -1; private Vector3 stuckFrom; private float stuckCheckAt; private float gapJumpAt = -10f; private float gapJumpZ; private float gapJumpDir; private float gapFailZ; private float gapFailDir; private float gapFailAt = -100f; private int gapFails; private int stuckCount; private float giveUpUntil; private Vector3 stuckGoal; private float stuckGoalDist; private Fighter unreachable; private float unreachableUntil; private readonly List<Waypoint> route = new List<Waypoint>(); private int routeIdx; private float planAt; private float legStart; private Vector3 plannedFor; private Vector3 legFrom; private bool dropping; private readonly Dictionary<long, float> badLinks = new Dictionary<long, float>(); private float[] planG = new float[0]; private int[] planCame = new int[0]; private Move[] planKind = new Move[0]; private bool[] planClosed = new bool[0]; private readonly List<int> planOpen = new List<int>(); private readonly List<Waypoint> planRev = new List<Waypoint>(); private int wallJumps; private float wallJumpStartY; private float wallJumpAt; private float patienceMul = 1f; private float risk = 0.5f; private float gambleUntil; private float gambleRollAt; private float pride = 0.5f; private float showdownSince = -1f; private float slipRolledAt = -10f; private bool slipping; private int botsOnlyFrame = -1; private int botsOnly; private int sdPhase; private float sdAt; private float sdNext; private float sdAimFrom = -10f; private bool sdTossUp; private bool rallyThrow; internal bool Showtime; private float showtimeFrom = -1f; private float showtimeOffUntil; private const float ShowtimeRange = 19.5f; private const float ShowtimeGiveUp = 7f; private const float ShowtimeSlip = 0.6f; private const float ShowtimeAfter = 6f; private static readonly float RallyChance = ((Environment.GetEnvironmentVariable("ENHANCEDBOTS_RALLY") == "1") ? 1f : 0.35f); private float rallyRolledFor = -1f; private bool rallyShowdown; private float concedeDir; private float concedeLookAt = -10f; private float concedeMovedAt; private float concedeRound = -1f; private static float extLoggedFor = -1f; private Read read; private Fighter readOf; private Vector3 readAnchor; private float readAnchorAt; private float readSampleAt; private float readCloseAt; private float readCloseDist; private float readSeenAt; private float camperTauntAt; private int[] reachQueue = new int[0]; private bool[] reachSeen = new bool[0]; private int reachFor = -1; private int reachFrom = -1; private bool reachAnswer; private float reachAt; private Stance stance; private float stanceAt; private Vector3 spot; private bool hasSpot; private float atSpotSince = -1f; private float spotAt; private float spotProgressAt; private float spotProgressDist; private readonly Dictionary<int, float> badSpots = new Dictionary<int, float>(); private float[] spotKeys = new float[0]; private int[] spotOrder = new int[0]; private bool guardBlock; private bool guardRelease; private bool guardDuck; private bool guardHold; private bool guardImminent; private Vector3 guardAim; private Vector3 guardLastAim; private string guardMode; private float guardDue; private float guardThreatT; private bool guardThreatAny; private bool guardThreatMelee; private const float BlockWindow = 0.3f; private const float BlockCooldown = 0.3f; private float chainLogAt; private bool guardLift; private float lastThrowFromZ; private float throwLogAt; private const float ThrowDuckY = 1.75f; private const float ThrowHitRadius = 1.3f; private Fighter punchSeenFrom; private float punchSeenAt; private float punchSeenD; private float punchSeenHp; private float punchSeenClose; private float punchSeenAng; private string throwWhy; private static readonly HashSet<int> throwLogged = new HashSet<int>(); private const float PartRadius = 0.72f; private static readonly Dictionary<Weapon, Transform> muzzleOf = new Dictionary<Weapon, Transform>(); private static readonly Dictionary<Weapon, bool> unblockableOf = new Dictionary<Weapon, bool>(); private bool edgeBrake; private Taunt taunt; private float tauntFacing = 1f; private float moonDir = 1f; private int boxBeat; private float tauntStart; private float tauntUntil; private float nextTauntAt; private float tauntRollAt; private Vector3 corpse; private float killAt = -10f; private Fighter lastTarget; private static readonly Taunt[] IdleTaunts = new Taunt[5] { Taunt.Floss, Taunt.Spin, Taunt.ButtSlide, Taunt.Wave, Taunt.JumpingJacks }; private static readonly Taunt[] IdleTauntsWithBody = new Taunt[7] { Taunt.Floss, Taunt.Spin, Taunt.ButtSlide, Taunt.Wave, Taunt.JumpingJacks, Taunt.Teabag, Taunt.PointAndLaugh }; private static string[] tauntModes; private readonly List<Taunt> tauntPool = new List<Taunt>(); private Trick trick; private float trickStart; private float trickDir; private int trickPhase; private readonly List<Trick> trickPool = new List<Trick>(); private readonly Vector3[] trailPos = (Vector3[])(object)new Vector3[60]; private readonly Vector3[] trailVel = (Vector3[])(object)new Vector3[60]; private readonly string[] trailMode = new string[60]; private readonly float[] trailT = new float[60]; private int trailN; private float trailAt; private Vector3 spikeVel; private float spikeAt; private readonly GuardTick[] guardTrail = new GuardTick[256]; private int guardN; private Vector3 PumpkinPos { get { //IL_002f: 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) WeaponPickUp val = (((Object)(object)Spooky.Pumpkin != (Object)null) ? Spooky.Pumpkin : Spooky.PumpkinRef); if (!((Object)(object)val != (Object)null)) { return Vector3.zero; } return ((Component)val).transform.position; } } private static bool JugglePractice { get { if (!(JuggleEnv == "1") && !(JuggleEnv == "surf")) { return JuggleEnv == "surfz"; } return true; } } private static bool JuggleSurf { get { if (!(JuggleEnv == "surf")) { return JuggleEnv == "surfz"; } return true; } } private static bool JuggleLogs { get { if (!JugglePractice) { return !GameManager.stillInMenu; } return true; } } private float JuggleKick => jugKick; private static bool Lobby { get { if (GameManager.stillInMenu) { return !MatchmakingHandler.IsNetworkMatch; } return false; } } private bool CanBigJump { get { if (skill.Advanced) { return (Object)(object)me.Weapon == (Object)null; } return false; } } private bool CanTasJump { get { if (skill.Tas && !dev.Rounds) { return (Object)(object)me.Weapon == (Object)null; } return false; } } private bool Gambling { get { //IL_0033: 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) if (Impatient || Showdown) { return true; } Fighter target = Target; if (target != null && ((Object)(object)target.Brain != (Object)null || Performing) && Flat(target.Pos, me.Pos) < 3.5f && Time.time - lastActionAt > 1f) { return true; } if (Time.time >= gambleRollAt) { gambleRollAt = Time.time + Random.Range(0.8f, 1.6f); if (Random.value < 0.35f + risk * 0.5f + (float)BotsOnlyLevel * 0.15f) { gambleUntil = Time.time + Random.Range(0.5f, 1f); } } return Time.time < gambleUntil; } } private int BotsOnlyLevel { get { if (botsOnlyFrame == Time.frameCount) { return botsOnly; } botsOnlyFrame = Time.frameCount; botsOnly = 0; if (dev.Rounds || Lobby || GameManager.stillInMenu || me == null || !me.Alive) { return 0; } int num = 0; foreach (Fighter fighter in World.Fighters) { if (fighter != null && fighter.Alive) { if ((Object)(object)fighter.Brain == (Object)null) { return 0; } num++; } } botsOnly = ((num >= 2 && num <= 4) ? (5 - num) : 0); return botsOnly; } } private bool Showdown => BotsOnlyLevel == 3; private bool Performing => BotsOnlyLevel > 0; private bool RallyShowdown { get { if (!Showdown || !skill.Tas || dev.Rounds) { return false; } Fighter target = Target; if (target == null || (Object)(object)target.Brain == (Object)null || !target.Brain.skill.Tas) { return false; } if (rallyRolledFor != World.FightStartAt) { rallyRolledFor = World.FightStartAt; rallyShowdown = Random.value < RallyChance; if (rallyShowdown) { Plugin.Log.LogInfo((object)(((InputDevice)dev).Name + " [" + skill.Name + "] rally showdown.")); } } if (!rallyShowdown) { if (target.Brain.rallyShowdown) { return target.Brain.rallyRolledFor == World.FightStartAt; } return false; } return true; } } private bool Closer { get { int botsOnlyLevel = BotsOnlyLevel; if (botsOnlyLevel < 1 || botsOnlyLevel > 2 || !skill.Tactics) { return false; } if (Time.time - World.LastDamageAt < ((botsOnlyLevel == 1) ? 12f : 9f)) { return false; } foreach (Fighter fighter in World.Fighters) { if (fighter != null && fighter.Alive && fighter != me && !((Object)(object)fighter.Brain == (Object)null) && (fighter.Brain.risk > risk || (fighter.Brain.risk == risk && fighter.Slot < me.Slot))) { return false; } } return true; } } private float WinHp => 35f + risk * 30f; private float CampSeconds { get { if (!skill.Tas) { return 6f; } return 3f; } } private float PatienceSeconds { get { if (GameManager.stillInMenu) { return 3.5f; } return ((skill.Expert && EnemiesAlive() >= 2) ? 7f : 4f) * patienceMul * ((BotsOnlyLevel == 0) ? 1f : ((BotsOnlyLevel == 1) ? 0.75f : ((BotsOnlyLevel == 2) ? 0.5f : 0.3f))); } } private bool Impatient { get { if (!(Time.time - lastActionAt > PatienceSeconds)) { return Closer; } return true; } } private bool TakeChance { get { if (!skill.Tas || dev.Rounds || Lobby || me == null) { return false; } if (Impatient || Showdown) { return true; } Fighter target = Target; if (target == null || !target.Alive || EnemiesAlive() != 1) { return false; } if (!(target.Hp <= WinHp) && !(target.Fight.counter < -0.5f) && !(target.Info.sinceFallen < 0f)) { if ((Object)(object)target.Weapon == (Object)null) { return me.HasGun; } return false; } return true; } } internal Vector3 AimForDebug => wantAim; private bool BladeDodge(Fighter from, float due) { return false; } private bool BladeSpacing(Fighter t, float d, float reach, bool canSwing) { //IL_009f: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: 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) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0259: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)t.Weapon == (Object)null || t.HasGun || !Unblockable(t.Weapon)) { return false; } float num = WeaponInfo.Of(t.Weapon).MaxRange + 0.9f; float num2 = t.Weapon.cd - t.Fight.counter; bool flag = t.Fight.isSwinging && t.Fight.sincePunch < 0.22f; Rigidbody component = ((Component)t.Weapon).GetComponent<Rigidbody>(); Vector3 worldDir = (((Object)(object)component != (Object)null) ? component.worldCenterOfMass : ((Component)t.Weapon).transform.position) - me.HeadPos; worldDir.x = 0f; if (((Vector3)(ref worldDir)).magnitude < 2.1f && canSwing && (Object)(object)me.Weapon == (Object)null) { Aim(worldDir); Swing(); lastActionAt = Time.time; Mode = "disarm"; return true; } float num3 = Mathf.Max(0f, d - reach) / 9f + 0.12f; if (!flag && num2 > num3) { goal = t.Pos; hasGoal = true; Aim(t.HeadPos - me.Pos); if (d < reach && canSwing) { Swing(); lastActionAt = Time.time; } Mode = "punish the blade"; return true; } if (d > num + 0.6f) { return false; } float num4 = Mathf.Sign(me.Pos.z - t.Pos.z); if (World.SafeGround(me.Pos + new Vector3(0f, 0.5f, num4 * 1.2f), 6f)) { hasGoal = false; wantMove = ((d < num + 0.3f) ? num4 : 0f); } else if (me.Grounded && World.SafeGround(new Vector3(0f, t.Pos.y + 0.5f, t.Pos.z - num4 * 2f), 4f)) { StartBlockPunchJump(0f - num4, fromWall: false, t.Pos.z - num4 * 2f); } AimAt(t.HeadPos); Mode = "space the blade"; return true; } private bool Defend() { //IL_0016: 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_00a3: 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_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0252: 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) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0371: 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_037b: 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_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) if (Time.time < blockUntil) { blockHeld = true; Aim(blockAim); return true; } foreach (Shot shot in World.Shots) { if ((shot.Team == me.Slot && !shot.Reflected) || (Object)(object)shot.Shooter == (Object)(object)self || shot.Age < skill.ShotReaction || (!Incoming(shot, me.Pos, 1.1f) && !Incoming(shot, me.HeadPos, 0.7f))) { continue; } if (!Lobby || World.NoHumansAlive || Holds(shot.Shooter)) { if (dev.Rounds) { if (CanParry() && RollRoundsParry(shot.Id)) { StartParry(-shot.Dir, Random.Range(0.3f, 0.4f)); Mode = "block shot"; return true; } } else if (CanParry() && RollBulletParry()) { Fighter fighter = (((Object)(object)shot.Shooter != (Object)null) ? World.Get(shot.Shooter) : null); StartParry((fighter != null && fighter.Alive) ? (fighter.HeadPos - me.HeadPos) : (-shot.Dir)); Mode = "parry shot"; return true; } } if (shot.Explosive) { float num = Mathf.Sign(me.Pos.z - (shot.Pos.z + shot.Dir.z * 3f)); if (World.SafeGround(me.Pos + new Vector3(0f, 0.5f, num * 1.5f), 6f)) { wantMove = num; } if (me.Grounded) { Jump(); } } else if (me.Grounded && Incoming(shot, me.HeadPos, 0.7f)) { wantDuck = true; } } if (Time.time < dodgeUntil) { hasGoal = false; wantMove = dodgeDir; Mode = "sidestep"; return true; } foreach (Fighter fighter3 in World.Fighters) { if (!IsEnemy(fighter3)) { continue; } bool num2 = (Object)(object)fighter3.Weapon == (Object)null || !fighter3.Weapon.isGun; bool flag = fighter3.Fight.counter >= skill.Reaction && fighter3.Fight.counter < skill.Reaction + 0.1f; if (!num2 || !flag || (fighter3 == lastSwinger && Time.time - lastSwingAt < 0.25f)) { continue; } Vector3 val = me.Pos - fighter3.Pos; val.x = 0f; float num3 = (((Object)(object)fighter3.Weapon == (Object)null) ? 1.9f : (WeaponInfo.Of(fighter3.Weapon).MaxRange + 0.3f)) + Mathf.Max(0f, Vector3.Dot(fighter3.Vel, ((Vector3)(ref val)).normalized)) * 0.2f; if (!(((Vector3)(ref val)).magnitude > num3) && !(Vector3.Angle(fighter3.AimDir, val) > 55f)) { lastSwinger = fighter3; lastSwingAt = Time.time; bool flag2 = World.SafeGround(me.Pos + new Vector3(0f, 0.5f, Mathf.Sign(val.z) * 1.5f), 6f); if (CanParry() && (Random.value < skill.ParryChance || !flag2)) { StartParry(-val); Mode = "parry punch"; return true; } if (flag2) { dodgeDir = Mathf.Sign(val.z); dodgeUntil = Time.time + 0.3f; hasGoal = false; wantMove = dodgeDir; Mode = "sidestep"; return true; } } } if (dev.Rounds && skill.RoundsBlock > 0f && CanParry() && Random.value < 1f - Mathf.Pow(1f - skill.RoundsBlock, Time.deltaTime)) { Fighter fighter2 = null; float num4 = 5f; foreach (Fighter fighter4 in World.Fighters) { if (IsEnemy(fighter4)) { float num5 = Flat(fighter4.Pos, me.Pos); if (num5 < num4) { num4 = num5; fighter2 = fighter4; } } } if (fighter2 != null) { StartParry(fighter2.HeadPos - me.HeadPos, Random.Range(0.3f, 0.4f), action: false); Mode = "block"; return true; } } return false; } private bool RollRoundsParry(int id) { if (shotRolls.TryGetValue(id, out var value)) { return value; } if (Time.time - shotRollAt < 0.1f) { value = shotRollOk; } else { value = Random.value < skill.RoundsParry; shotRollAt = Time.time; shotRollOk = value; } if (shotRolls.Count > 64) { shotRolls.Clear(); } shotRolls[id] = value; return value; } private bool RollBulletParry() { if (Time.time - bulletRollAt > 0.3f) { bulletRollAt = Time.time; bulletRollOk = Random.value < skill.BulletParry; } return bulletRollOk; } private float Judgement(int id) { return (float)((uint)((id * 73856093) ^ (dev.Number * 19349663)) % 2001u) / 1000f - 1f; } private static bool Incoming(Shot s, Vector3 point, float radius) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) Vector3 val = point - s.Pos; val.x = 0f; float num = Vector3.Dot(val, s.Dir); if (num <= 0f) { return false; } Vector3 val2 = val - s.Dir * num; if (((Vector3)(ref val2)).magnitude > radius) { return false; } return num / Mathf.Max(1f, s.Speed) < 0.25f; } private bool CanParry() { if (((Object)(object)me.Weapon == (Object)null || dev.Rounds) && me.Fight.counter >= 0f && Time.time - parryAt > 0.34f && Time.time > blockUntil + 0.04f) { return me.Info.sinceFallen > 0f; } return false; } private void StartParry(Vector3 dir, float hold = 0.3f, bool action = true) { //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_0027: Unknown result type (might be due to invalid IL or missing references) parryAt = Time.time; blockUntil = Time.time + hold; blockAim = dir; blockHeld = true; Aim(dir); if (action) { lastActionAt = Time.time; } } private bool ThrowForKill() { //IL_0037: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: 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) Fighter target = Target; if ((Object)(object)me.Weapon == (Object)null || target == null || skill.ThrowChance <= 0f) { return false; } float num = Flat(me.HeadPos, target.HeadPos); if (num < 1.2f || num > skill.ThrowRange || !World.LineClear(me.HeadPos, target.HeadPos)) { return false; } float num2 = 100f / (float)Mathf.Max(1, OptionsHolder.HP) * HitScale(target); float num3 = 55f * num2; if (55f * target.HeadMult * num2 < target.Hp) { return false; } bool flag = num3 < target.Hp; if (flag && num > skill.ThrowRange * 0.7f) { return false; } if (me.HasGun) { bool num4 = held.Damage * target.HeadMult * num2 >= target.Hp && !held.Explosive && num / Mathf.Max(1f, held.Speed) < 0.28f; bool flag2 = me.Bullets > 0 && held.Cd - me.Fight.counter < 0.3f; bool isBlocking = target.Block.isBlocking; if (num4 && flag2 && !isBlocking) { return false; } } int num5 = 0; bool flag3 = false; foreach (Fighter fighter in World.Fighters) { if (IsEnemy(fighter)) { num5++; if (fighter != target && fighter.HasGun && World.LineClear(fighter.HeadPos, me.HeadPos)) { flag3 = true; } } } if (flag3 && num5 > 1) { return false; } if (throwRolledFor != target || Time.time - throwRolledAt > 1f) { throwRolledFor = target; throwRolledAt = Time.time; throwRollOk = Random.value < skill.ThrowChance; } if (!throwRollOk) { return false; } if (BotsOnlyLevel > 0 && (Object)(object)target.Brain != (Object)null && Random.value < 0.6f) { throwRolledAt = Time.time; throwRollOk = false; return false; } if (ThrowAt(target, flag) && Time.time - throwLoggedAt > 1f) { throwLoggedAt = Time.time; Plugin.Log.LogInfo((object)string.Format("{0} [{1}] throws {2} at P{3} ({4:0} hp, {5}, {6:0.0} away) for the kill.", ((InputDevice)dev).Name, skill.Name, held.Name, target.Slot + 1, target.Hp, flag ? "head" : "body", num)); } Mode = "throw for the kill"; return true; } private bool ManageWeapon() { //IL_016e: 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_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) if (dev.Rounds) { return false; } if (ShowdownTrick()) { return true; } if (ThrowForKill()) { return true; } if (SpecialUse()) { return true; } if (me.HasGun && held.Ammo > 1) { int bullets = me.Bullets; if (bullets <= Mathf.Max(1, Mathf.CeilToInt((float)held.Ammo * 0.2f))) { if (bullets <= 1 && Target != null && Flat(Target.Pos, me.Pos) < 11f && World.LineClear(me.HeadPos, Target.HeadPos)) { ThrowAt(Target); Mode = "throw empty gun"; return true; } if (skill.ThrowReload && NearestEnemyDistance() > 5f && ArmedThreat() == null) { StartReload(); if (seq == Seq.Reload) { return true; } } } } if (skill.Tas && !dev.Rounds && (Object)(object)me.Weapon == (Object)null && ArmedClose(5f) != null) { return false; } WeaponPickUp val = BestPickup(); if ((Object)(object)val == (Object)null) { return false; } goal = ((Component)val).transform.position; hasGoal = true; goalIsPickup = true; SetMode("get ", WeaponInfo.OfIndex(val.id).Name); float num = Flat(goal, me.Pos); if ((Object)(object)val != (Object)(object)pickChasing) { pickChasing = val; pickBestD = num; pickProgressAt = Time.time; } else if (num < pickBestD - 0.5f) { pickBestD = num; pickProgressAt = Time.time; } else if (Time.time - pickProgressAt > 2.5f) { pickBanned = val; pickBannedUntil = Time.time + 8f; pickChasing = null; hasGoal = false; return false; } if (me.HasGun && me.Bullets > 1 && !held.Explosive && World.IceInTheWay(Muzzle(), goal, out var at) && Flat(at, me.Pos) < 10f && at.y > me.Pos.y - 0.6f && !World.IceUnder(me.Pos, at)) { Vector3 val2 = at - Muzzle(); val2.x = 0f; Aim(val2); if (me.Fight.counter > held.Cd && Vector3.Angle(((Component)me.Weapon).transform.forward, val2) < 6f) { if (held.FullAuto) { fireHeld = true; } else { FireOnce(); } } Mode = "shoot the ice"; return true; } if ((Object)(object)me.Weapon != (Object)null && OptionsHolder.pickup != 1 && Flat(goal, me.Pos) < 3.5f) { if (Target != null && Flat(Target.Pos, me.Pos) < 11f) { ThrowAt(Target); } else { Aim(new Vector3(0f, -0.3f, (me.Pos.z > goal.z) ? 1f : (-1f))); Throw(); } return true; } float num2 = Mathf.Sign(goal.z - me.Pos.z); foreach (Fighter fighter in World.Fighters) { if (IsEnemy(fighter)) { Vector3 val3 = fighter.Pos - me.Pos; if (Mathf.Sign(val3.z) == num2 && Mathf.Abs(val3.z) < 1.4f && Mathf.Abs(val3.y) < 1.2f && me.Grounded) { StartBlockPunchJump(num2); break; } } } if (Target != null && (me.HasGun || Flat(goal, me.Pos) < 3f)) { if (me.HasGun) { ShootAt(Target, allowFire: false); } else { AimAt(Target.HeadPos); } } return true; } private bool SpecialUse() { //IL_00b2: 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_0114: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)me.Weapon != (Object)(object)specialHeld) { specialHeld = me.Weapon; specialShots = 0; } if ((Object)(object)me.Weapon == (Object)null) { return false; } bool flag = held.Use == WeaponInfo.Usage.ThrowAway || (held.Use == WeaponInfo.Usage.ShootThenThrow && (specialShots >= 2 || (held.Ammo > 0 && me.Bullets <= 0))); if (held.Use == WeaponInfo.Usage.Ball && Target != null && Flat(Target.Pos, me.Pos) < skill.ThrowRange && World.LineClear(me.HeadPos, Target.HeadPos) && !FanHelps(Target)) { flag = true; } if (!flag) { return false; } if (Target != null && Flat(Target.Pos, me.Pos) < 11f && World.LineClear(me.HeadPos, Target.HeadPos)) { ThrowAt(Target); } else { Aim(new Vector3(0f, 0.2f, (Target != null) ? Mathf.Sign(Target.Pos.z - me.Pos.z) : 1f)); Throw(); } SetMode("throw ", held.Name); return true; } private bool FanHelps(Fighter t) { //IL_0001: 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_0022: 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_004c: 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_0068: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) float num = Flat(t.Pos, me.Pos); if (num > 8f) { return false; } float num2 = Mathf.Sign(t.Pos.z - me.Pos.z); for (float num3 = 1.5f; num3 <= 4.5f; num3 += 1.5f) { Vector3 val = t.Pos + new Vector3(0f, 0.5f, num2 * num3); if (!World.SafeGround(val, 12f) || World.BodyHazard(val + Vector3.down * 1.6f, 0.5f) < 0.8f) { return true; } } if (num < 3f) { return !t.HasGun; } return false; } private WeaponPickUp BestPickup() { //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017f: 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) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: 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) float num = 1f; if (me.HasGun && held.Ammo > 1) { num = Mathf.Clamp01(0.3f + 0.7f * (float)me.Bullets / (float)held.Ammo); } float num2 = held.Score * num + 10f; WeaponPickUp result = null; foreach (WeaponPickUp pickup in World.Pickups) { if ((Object)(object)pickup == (Object)null || pickup.cantBePickledUpFor > 0.8f || ((Object)(object)pickup == (Object)(object)pickBanned && Time.time < pickBannedUntil)) { continue; } Vector3 position = ((Component)pickup).transform.position; if ((!me.HasGun && World.IceInTheWay(me.HeadPos, position, out var at) && World.IceInTheWay(me.Pos + Vector3.up * 0.4f, position, out at)) || !World.SafeGround(position + Vector3.up * 0.3f, 25f)) { continue; } WeaponInfo weaponInfo = WeaponInfo.OfIndex(pickup.id); float num3 = Flat(position, me.Pos); float num4 = weaponInfo.Score - num3 * 0.8f - Mathf.Max(0f, position.y - me.Pos.y - 6f) * 2f; foreach (Fighter fighter in World.Fighters) { if (IsEnemy(fighter) && EngagedWith(fighter) != me && Flat(position, fighter.Pos) + 2f < num3) { num4 -= 12f; break; } } if ((Object)(object)me.Weapon == (Object)null && weaponInfo.IsGun) { num4 += 15f; } if (World.IceMap && weaponInfo.IsGun && !me.HasGun) { num4 += 10f; } if (Showdown && skill.Tas && weaponInfo.IsGun && !me.HasGun) { num4 += 12f; } num4 += Judgement(((Object)pickup).GetInstanceID()) * skill.WeaponNoise; if (HalloweenPickup(pickup, ref num4) && num4 > num2) { num2 = num4; result = pickup; } } return result; } private bool ThrowAt(Fighter t, bool head = false) { //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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_003e: 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_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_0061: 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_0082: 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_0084: 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_008c: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) Vector3 headPos = me.HeadPos; float num = Flat(headPos, t.HeadPos) / 35f; Vector3 vel = t.Vel; if (t.Grounded) { vel.y = 0f; } Vector3 val = (head ? t.HeadPos : t.Pos) + vel * Mathf.Min(num, 0.5f); val.y += 0.5f * (0f - Physics.gravity.y) * num * num; Vector3 val2 = val - headPos; Aim(val2); float num2 = ((Mathf.Abs(val2.z) > 0.5f) ? Mathf.Sign(val2.z) : 0f); if (Time.time - throwAimedAt > 0.4f) { throwPrepAt = Time.time; } throwAimedAt = Time.time; if (num2 != 0f && me.Grounded) { hasGoal = false; wantMove = num2; bool flag = me.Vel.z * num2 > 2f; if (skill.Advanced && !flag && Time.time - throwPrepAt < 0.25f) { return false; } } if (Vector3.Angle(me.AimDir, new Vector3(0f, val2.y, val2.z)) >= 5f) { return false; } Throw(); lastActionAt = Time.time; return true; } private void Engage() { //IL_0019: 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_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) if (Target == null) { Mode = "hold"; if (Mathf.Abs(me.Pos.z) > 4f) { goal = new Vector3(0f, me.Pos.y, 0f); hasGoal = true; } } else if (stance == Stance.Retreat) { Retreat(); } else if (stance == Stance.Vulture) { Vulture(); } else if (!AnswerRead()) { if ((me.HasGun && !held.Melee) || ((Object)(object)me.Weapon != (Object)null && (held.IsGun || held.Use != WeaponInfo.Usage.Normal))) { Ranged(); } else { Melee(); } } } private void Ranged() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: 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_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) Fighter target = Target; WeaponInfo weaponInfo = held; float num = ShootAt(target, allowFire: true); bool flag = World.ShotClear(Muzzle(), target.HeadPos); if (flag || target != sightOf || Time.time - rangedAt > 1f) { lastSightAt = Time.time; crateShots = 0; sightOf = target; } rangedAt = Time.time; Fighter fighter = ArmedThreat(); bool flag2 = me.Fight.counter > weaponInfo.Cd; if (skill.Tactics && fighter != null && (!flag2 || !flag) && !Impatient && !Showdown) { if (!TakeCover(fighter)) { wantDuck = true; } Mode = "cover"; } else { if (ShowtimeSetup(target, weaponInfo, num, flag)) { return; } if (num < weaponInfo.MinRange && (BackOffHelps(target, flag, weaponInfo) || (weaponInfo.Explosive && !MoveToBestSpot(ranged: true, weaponInfo.BestRange)))) { BackOff(target); Mode = "back off"; return; } if (num < weaponInfo.MinRange && weaponInfo.Explosive) { Mode = "reposition"; return; } if (!flag && skill.Tactics && target.Grounded && !weaponInfo.Explosive && me.Fight.counter > weaponInfo.Cd) { GroundInfo groundInfo = World.Probe(target.Pos, 3f); Vector3 val = Muzzle(); if (groundInfo.Found && groundInfo.Breakable && !World.LineClear(val, groundInfo.Point + Vector3.up * 0.05f)) { Vector3 val2 = groundInfo.Point - val; if (World.Cast(val, val2, ((Vector3)(ref val2)).magnitude + 0.3f, out var hit) && (Object)(object)((Component)((RaycastHit)(ref hit)).collider).GetComponentInParent<DestructiblePiece>() != (Object)null) { Aim(val2); if (Vector3.Angle(((Component)me.Weapon).transform.forward, new Vector3(0f, val2.y, val2.z)) < 4f) { if (weaponInfo.FullAuto) { fireHeld = true; } else { FireOnce(); } } Mode = "shoot the ice"; return; } } } if (!flag || num > weaponInfo.BestRange * 1.4f || (dev.Rounds && !lastReachable)) { bool flag3 = !flag && Impatient && Time.time - lastSightAt > 5f; if (!flag && Impatient && ShootObstacle(target, weaponInfo)) { Mode = "shoot the crate"; return; } if (skill.Tactics && !flag3 && MoveToBestSpot(ranged: true, (Impatient || Showdown) ? (weaponInfo.BestRange * 0.6f) : weaponInfo.BestRange)) { if (Flat(spot, me.Pos) < 1.2f && me.Grounded) { if (atSpotSince < 0f) { atSpotSince = Time.time; } else if (Time.time - atSpotSince > 1.5f) { badSpots[SpotKey(spot)] = Time.time + 8f; hasSpot = false; atSpotSince = -1f; } } else { atSpotSince = -1f; } if (hasSpot) { Mode = "reposition"; return; } } goal = target.Pos; hasGoal = true; Mode = "close in"; } else { Mode = "shoot"; TryAltFire(target, num, flag); if (!dev.Rounds && num < 3f && me.Bullets >= 2 && Time.time - shotAt < 0.15f && !target.HasGun) { ThrowAt(target); } } } } private float ShootAt(Fighter t, bool allowFire) { //IL_001b: 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_0023: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00ce: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_008b: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) WeaponInfo weaponInfo = held; if (!weaponInfo.Charged) { drawStart = 0f; } Vector3 val = Muzzle(); float flight; bool reachable; Vector3 val2 = LeadPoint(t, val, weaponInfo, out flight, out reachable); lastReachable = reachable; Vector3 val3 = val2 - val; val3.x = 0f; float magnitude = ((Vector3)(ref val3)).magnitude; if (dev.Rounds && weaponInfo == roundsInfo && dev.RoundsAimLift > 0f && magnitude > 0.01f) { val3 = Unlift(val3 / magnitude, dev.RoundsAimLift) * magnitude; } Vector3 forward = ((Component)me.Weapon).transform.forward; forward.x = 0f; float num = SignedAngle(forward, val3); Aim(skill.Advanced ? Rotate(val3, Mathf.Clamp(num * 0.7f, -20f, 20f)) : val3); if (!allowFire) { return magnitude; } float num2 = Mathf.Max(0.5f, Mathf.Atan2(0.2f, Mathf.Max(magnitude, 0.5f)) * 57.29578f); if (weaponInfo.Spread > 0.05f) { num2 *= 1.5f; } num2 *= skill.FireTolerance; bool flag = me.Fight.counter > weaponInfo.Cd; bool flag2 = (((weaponInfo.Drop != 0f || weaponInfo.Kick != 0f) && !weaponInfo.Lobbed) ? ArcClear(val, val2, weaponInfo.Drop, weaponInfo.Kick, flight) : World.ShotClear(val, val2)); bool flag3 = !weaponInfo.Explosive || (magnitude > weaponInfo.BlastRadius + 1f && ClearFor(val, val3, weaponInfo.BlastRadius + 1f)); bool flag4 = magnitude < weaponInfo.MaxRange && reachable; if (skill.Tas && !dev.Rounds && CanParry(t, flight) && !Gambling) { flag = false; } if (flag && flag2 && flag4 && flag3 && me.Grounded && FlashyFinish(t, weaponInfo) && Mathf.Abs(num) < 30f) { Jump(); return magnitude; } if (weaponInfo.Charged) { bool flag5 = drawStart > 0f && chargeHold; if (flag2 && flag4 && flag) { if (!flag5) { drawStart = Time.time; chargeHold = true; } } else if (!flag5 || Time.time - drawStart >= 3f) { drawStart = 0f; chargeHold = false; } if (flag5 && FullyDrawn() && flag2 && flag3 && Mathf.Abs(num) < num2 && FireAllowed() && DashSafe(val3)) { ReleaseCharge(); } return magnitude; } if (weaponInfo.Use == WeaponInfo.Usage.Fan) { if (flag2 && Mathf.Abs(num) < 25f && FanHelps(t)) { fireHeld = true; lastActionAt = Time.time; } return magnitude; } if (weaponInfo.Use == WeaponInfo.Usage.Ball && !FanHelps(t)) { return magnitude; } if (weaponInfo.Dash > 0f && !DashSafe(val3)) { return magnitude; } if (flag2 && flag && flag3 && flag4 && Mathf.Abs(num) < num2) { if (weaponInfo.Use == WeaponInfo.Usage.ShootThenThrow && Time.time - shotAt > weaponInfo.Cd + 0.1f) { specialShots++; } if (weaponInfo.FullAuto) { fireHeld = true; } else { FireOnce(); } shotAt = Time.time; lastActionAt = Time.time; } else if (weaponInfo.FullAuto && flag2 && flag3 && flag4 && Mathf.Abs(num) < num2 * 3f) { fireHeld = true; } return magnitude; } private bool FullyDrawn() { Weapon weapon = me.Weapon; float num = Time.time - drawStart; if (held.ChargeTime > 0f) { return num >= held.ChargeTime + 0.05f; } if (num > 1.3f) { return true; } if ((Object)(object)weapon == (Object)null || !weapon.isCharged || weapon.maxChargeTime <= 0f) { return num > 0.9f; } if (num > 0.6f) { return weapon.currentCharge >= weapon.maxChargeTime * 1.4f * 0.98f; } return false; } private static Vector3 Unlift(Vector3 d, float lift) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_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_0039: 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_005c: 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) Vector3 val = (lift * d.y + Mathf.Sqrt(Mathf.Max(0f, lift * lift * d.y * d.y - lift * lift + 1f))) * d - Vector3.up * lift; if (!(((Vector3)(ref val)).sqrMagnitude > 0.0001f)) { return d; } return ((Vector3)(ref val)).normalized; } private Vector3 LeadPoint(Fighter t, Vector3 muzzle, WeaponInfo w, out float flight, out bool reachable) { //IL_0009: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_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_00e6: 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_018f: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0175: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: 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) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((!w.Explosive) ? t.HeadPos : (t.Grounded ? (t.Pos + Vector3.down * 0.6f) : t.Pos)); Vector3 vel = t.Vel; vel.x = 0f; bool flag = !t.Grounded; if (!flag) { vel.y = 0f; } float num = ((w.Speed > 1f) ? w.Speed : 25f); float num2 = 1f - skill.LeadError; float g = ((num > 1000f) ? 0f : (w.Drop * (1f + Judgement(91) * skill.LeadError * 0.5f))); float num3 = ((num > 1000f) ? 0f : w.Kick); flight = Flat(muzzle, val) / num; float num4 = 0f; float num5 = float.NegativeInfinity; if (flag) { num4 = TargetFall(t); Vector3 p = t.Pos + vel * Mathf.Min(flight, 1f) * num2; p.y = t.Pos.y; GroundInfo groundInfo = World.Probe(p, 30f); if (groundInfo.Found) { num5 = Mathf.Min(val.y, groundInfo.Point.y + 1.1f + (val.y - t.Pos.y)); } } Vector3 val2 = val; reachable = true; for (int i = 0; i < 4; i++) { float num6 = Mathf.Min(flight, 1f) * num2; Vector3 val3 = val + vel * num6; if (flag) { val3.y = Mathf.Max(val3.y + 0.5f * num4 * num6 * num6, num5); } if (w.Lobbed) { val2 = val3; if (w.Drop > 0f) { val2.y += 0.5f * w.Drop * flight * flight; } val2.y += Flat(muzzle, val2) * 0.12f; flight = Flat(muzzle, val2) / num; } else { val2 = Ballistic(muzzle, val3 + Vector3.down * num3 * flight, num, g, out flight, out reachable); } } return val2; } private static Vector3 Ballistic(Vector3 from, Vector3 target, float speed, float g, out float flight, out bool reachable) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_005f: 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_00f1: 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) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) Vector3 val = target - from; val.x = 0f; float num = Mathf.Abs(val.z); reachable = true; if (Mathf.Abs(g) < 0.01f || num < 0.05f) { flight = ((Vector3)(ref val)).magnitude / speed; return target; } float num2 = Mathf.Abs(g); float num3 = ((g > 0f) ? val.y : (0f - val.y)); float num4 = speed * speed; float num5 = num4 * num4 - num2 * (num2 * num * num + 2f * num3 * num4); float num6; if (num5 >= 0f) { num6 = Mathf.Atan((num2 * num * num + 2f * num3 * num4) / (num * (num4 + Mathf.Sqrt(num5)))); } else { num6 = (float)Math.PI / 4f; reachable = false; } float num7 = Mathf.Cos(num6); flight = num / (speed * num7); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(0f, (g > 0f) ? Mathf.Sin(num6) : (0f - Mathf.Sin(num6)), Mathf.Sign(val.z) * num7); return from + val2 * speed * flight; } private static bool ArcClear(Vector3 muzzle, Vector3 point, float g, float kick, float flight) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_0043: 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_004f: 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) Vector3 a = muzzle; for (int i = 1; i <= 4; i++) { float num = (float)i / 4f; float num2 = num * flight; Vector3 val = muzzle + (point - muzzle) * num; val.y += kick * num2 - 0.5f * g * num2 * num2; if (!World.ShotClear(a, val)) { return false; } a = val; } return true; } private float TargetFall(Fighter t) { //IL_0027: 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_006d: 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) float time = Time.time; if (fallOf != t || time - fallAt > 0.3f) { fallOf = t; fallVy = t.Vel.y; fallAt = time; fallAcc = Physics.gravity.y; return fallAcc; } float num = time - fallAt; if (num >= 0.05f) { fallAcc = Mathf.Lerp(fallAcc, Mathf.Clamp((t.Vel.y - fallVy) / num, -80f, 0f), 0.5f); fallVy = t.Vel.y; fallAt = time; } return fallAcc; } private WeaponInfo RoundsBullets(WeaponInfo w) { Weapon weapon = me.Weapon; if (!dev.Rounds || dev.RoundsBulletSpeed <= 0f || (Object)(object)weapon == (Object)null || !w.IsGun || ((Component)weapon).transform.GetSiblingIndex() != 0) { return w; } if (roundsOf != w) { roundsOf = w; roundsInfo = w.Copy(); } float roundsBulletSpeed = dev.RoundsBulletSpeed; roundsInfo.Speed = roundsBulletSpeed; roundsInfo.Drop = ((roundsBulletSpeed > 1000f) ? 0f : dev.RoundsBulletDrop); roundsInfo.Kick = ((roundsBulletSpeed > 1000f) ? 0f : dev.RoundsBulletKick); roundsInfo.Lobbed = false; float num = Mathf.Min(w.MaxRange, Mathf.Max(8f, roundsBulletSpeed * 0.9f)); float num2 = Mathf.Abs(roundsInfo.Drop); if (num2 > 0.01f) { num = Mathf.Min(num, roundsBulletSpeed * roundsBulletSpeed / num2 * 0.9f); } roundsInfo.MaxRange = Mathf.Max(3f, num); roundsInfo.BestRange = Mathf.Min(w.BestRange, roundsInfo.MaxRange * 0.65f); return roundsInfo; } private bool ClearFor(Vector3 from, Vector3 dir, float distance) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) RaycastHit hit; return !World.Cast(from, dir, distance, out hit); } private Vector3 Muzzle() { //IL_001b: 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) Weapon weapon = me.Weapon; if ((Object)(object)weapon == (Object)null) { return me.HeadPos; } if (!muzzles.TryGetValue(weapon, out var value) || (Object)(object)value == (Object)null) { Shoot componentInChildren = ((Component)weapon).GetComponentInChildren<Shoot>(true); value = (((Object)(object)componentInChildren != (Object)null) ? ((Component)componentInChildren).transform : ((Component)weapon).transform); muzzles[weapon] = value; } return value.position; } private static Vector3 GunAt(Fighter t) { //IL_0027: 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) Rigidbody component = ((Component)t.Weapon).GetComponent<Rigidbody>(); if (!((Object)(object)component != (Object)null)) { return ((Component)t.Weapon).transform.position; } return component.worldCenterOfMass; } private float GunDist(Fighter t) { //IL_0015: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)t.Weapon == (Object)null) { return -1f; } Vector3 val = GunAt(t) - me.HeadPos; val.x = 0f; return ((Vector3)(ref val)).magnitude; } private void DisarmReport() { if (disarmTarget != null && !(Time.time < disarmAt + 0.3f)) { Plugin.Log.LogInfo((object)("[disarm] " + ((InputDevice)dev).Name + " punched at a gun " + disarmD.ToString("0.00") + " away (dy " + disarmY.ToString("0.00") + "): " + (((Object)(object)disarmTarget.Weapon == (Object)null) ? "DROPPED" : "still held") + ((me.Fight.sincePunch < 0.32f) ? "" : " (no punch thrown)"))); disarmTarget = null; } } private bool GunDisarm(Fighter t, bool canSwing) { //IL_000d: 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_001c: 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_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_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_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_00fe: 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_00f0: Unknown result type (might be due to invalid IL or missing references) Rigidbody component = ((Component)t.Weapon).GetComponent<Rigidbody>(); Vector3 val = GunAt(t) + ((((Object)(object)component != (Object)null) ? component.velocity : t.Vel) - me.Vel) * 0.07f; Vector3 val2 = val - me.HeadPos; val2.x = 0f; goal = t.Pos; hasGoal = true; if (((Vector3)(ref val2)).magnitude < 1.4f && canSwing && me.PunchCd > 0f) { Aim(val2); Swing(); lastActionAt = Time.time; Mode = "disarm gun"; if (TasHitLog.On && disarmTarget == null) { disarmTarget = t; disarmAt = Time.time; disarmD = ((Vector3)(ref val2)).magnitude; disarmY = val2.y; } return true; } AimAt(val); Mode = "rush the gun"; return true; } private Fighter ArmedClose(float range) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Fighter result = null; float num = range; foreach (Fighter fighter in World.Fighters) { if (IsEnemy(fighter) && !((Object)(object)fighter.Weapon == (Object)null) && !(fighter.Fight.counter < -0.5f)) { float num2 = Flat(fighter.Pos, me.Pos); if (num2 < num) { num = num2; result = fighter; } } } return result; } private Fighter ArmedThreat() { //IL_003d: 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_004d: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) Fighter result = null; float num = float.MaxValue; foreach (Fighter fighter in World.Fighters) { if (!IsEnemy(fighter) || !fighter.HasGun) { continue; } Vector3 val = me.Pos - fighter.Pos; val.x = 0f; if (!(Vector3.Angle(((Component)fighter.Weapon).transform.forward, val) > 20f) && !(fighter.Fight.counter < WeaponInfo.Of(fighter.Weapon).Cd * 0.7f) && World.LineClear(fighter.HeadPos, me.HeadPos)) { float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < num) { num = magnitude; result = fighter; } } } return result; } private bool TakeCover(Fighter threat) { //IL_001e: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0063: 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_0069: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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) for (int i = 0; i <= 8; i++) { for (int j = -1; j <= 1; j += 2) { if (i != 0 || j != 1) { Vector3 val = me.Pos + new Vector3(0f, 0f, (float)i * 0.8f * (float)j); if (World.Ground(val + Vector3.up, 2.5f, out var _, out var safe) && safe && !World.LineClear(threat.HeadPos, val + Vector3.up * 0.9f)) { goal = val; hasGoal = true; AimAt(threat.HeadPos); return true; } } } } return false; } private bool BackOffHelps(Fighter t, bool los, WeaponInfo w) { //IL_001b: 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) if ((!los && !w.Explosive) || Time.time < noBackOffUntil) { return false; } float num = Flat(t.Pos, me.Pos); if (Time.time - backOffLast > 0.5f) { backOffSince = Time.time; backOffFrom = num; } backOffLast = Time.time; if (Time.time - backOffSince > 2.5f) { if (num < backOffFrom + 1f) { noBackOffUntil = Time.time + 4f; return false; } backOffSince = Time.time; backOffFrom = num; } return true; } private bool ShootObstacle(Fighter t, WeaponInfo w) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0061: 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_009e: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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) if (w.Explosive || w.Charged || w.Use != WeaponInfo.Usage.Normal || me.Bullets <= 1 || crateShots >= 4) { return false; } Vector3 val = Muzzle(); Vector3 val2 = t.HeadPos - val; val2.x = 0f; if (((Vector3)(ref val2)).magnitude > 6f) { return false; } if (!World.Cast(val, val2, ((Vector3)(ref val2)).magnitude, out var hit)) { return false; } Rigidbody rigidbody = ((RaycastHit)(ref hit)).rigidbody; if ((Object)(object)rigidbody == (Object)null || rigidbody.isKinematic || rigidbody.mass > 200f) { return false; } Aim(val2); if (me.Fight.counter > w.Cd && Vector3.Angle(((Component)me.Weapon).transform.forward, new Vector3(0f, val2.y, val2.z)) < 6f) { if (w.FullAuto) { fireHeld = true; } else { FireOnce(); } if (Time.time - shotAt > w.Cd) { crateShots++; } shotAt = Time.time; } return true; } private void BackOff(Fighter t) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_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_004f: 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_0061: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Sign(me.Pos.z - t.Pos.z); Vector3 val = me.Pos + new Vector3(0f, 0f, num * 3f); if (World.SafeGround(val + Vector3.up, 6f)) { goal = val; hasGoal = true; return; } float num2 = t.Pos.z - num * 1.8f; if (me.Grounded && World.SafeGround(new Vector3(0f, t.Pos.y + 0.5f, num2), 4f)) { StartBlockPunchJump(0f - num, fromWall: false, num2); } } private void RollStyle(Fighter t) { if (Time.time < styleUntil && styleTarget == t) { return; } styleTarget = t; styleUntil = Time.time + Random.Range(1.2f, 2.6f); if (!skill.MeleeStyles) { style = MeleeStyle.Rush; return; } if (skill.Tas && !dev.Rounds) { bool flag = (Object)(object)t.Brain != (Object)null && t.Brain.skill.Tas; bool flag2 = (Object)(object)t.Weapon == (Object)null && !Impatient && !Showdown && !flag && Random.value < 0.65f - risk * 0.5f; style = (flag2 ? MeleeStyle.Bait : ((Random.value < 0.15f) ? MeleeStyle.JumpIn : MeleeStyle.Rush)); return; } bool flag3 = (Object)(object)t.Weapon == (Object)null && !Impatient; float value = Random.value; if (value < 0.35f) { style = MeleeStyle.Rush; } else if (value < 0.6f) { style = MeleeStyle.JumpIn; } else if (value < 0.8f || !flag3) { style = MeleeStyle.Feint; } else { style = MeleeStyle.Bait; } feintStart = -10f; } private void Melee() { //IL_0008: 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_001d: 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_0090: 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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Unknown result type (might be due to invalid IL or missing references) //IL_0792: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07e4: Unknown result type (might be due to invalid IL or missing references) //IL_07e9: Unknown result type (might be due to invalid IL or missing references) //IL_07a5: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_07b4: Unknown result type (might be due to invalid IL or missing references) //IL_07b9: Unknown result type (might be due to invalid IL or missing references) //IL_07be: Unknown result type (might be due to invalid IL or missing references) //IL_0682: Unknown result type (might be due to invalid IL or missing references) //IL_0687: Unknown result type (might be due to invalid IL or missing references) //IL_0802: Unknown result type (might be due to invalid IL or missing references) //IL_080d: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_07d9: Unknown result type (might be due to invalid IL or missing references) //IL_0720: Unknown result type (might be due to invalid IL or missing references) //IL_0721: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_076f: Unknown result type (might be due to invalid IL or missing references) //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_075d: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Unknown result type (might be due to invalid IL or missing references) //IL_06a8: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_0651: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_05ea: Unknown result type (might be due to invalid IL or missing references) //IL_0886: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Unknown result type (might be due to invalid IL or missing references) //IL_0864: Unknown result type (might be due to invalid IL or missing references) Fighter target = Target; Vector3 val = target.Pos - me.Pos; val.x = 0f; float magnitude = ((Vector3)(ref val)).magnitude; float y = val.y; bool flag = (Object)(object)me.Weapon != (Object)null; float num = (flag ? held.MaxRange : 1.75f); float num2 = (flag ? held.Dash : 0f); if (num2 > 0f && magnitude > num && World.LineClear(me.Pos, target.Pos)) { num = Mathf.Max(num, Mathf.Min(num2, 9f) * 0.75f); } bool flag2 = target.Fight.counter < -0.3f; bool flag3 = me.Fight.counter > (flag ? me.Weapon.cd : 0.3f) || (flag && held.Charged); bool flag4 = (Object)(object)target.Weapon == (Object)null && target.Fight.counter > 0.15f; if (skill.Tas && !dev.Rounds && (((CanParry(target, 0.12f) || WouldClash(target, 0.2f)) && !Gambling) || (flag4 && !ClashRoom(target.Pos - me.Pos) && ((!Performing && !((Object)(object)target.Brain != (Object)null)) || !Gambling)))) { flag3 = false; } if (flag && held.Charged && magnitude < num + 4f) { BeginCharge(); } bool flag5 = ((Object)(object)target.Weapon == (Object)null || !target.Weapon.isGun) && target.Fight.counter > Mathf.Max(0.05f, skill.Reaction) && target.Fight.counter < 0.28f; if (skill.Tas && !dev.Rounds && !flag && target.HasGun && GunDisarm(target, flag3)) { return; } if (skill.Tactics && target.HasGun && !Impatient && !Showdown && ArmedThreat() == target) { if (!TakeCover(target)) { wantDuck = true; } AimAt(target.HeadPos); Mode = "dodge gun"; } else { if (skill.Tas && !dev.Rounds && BladeSpacing(target, magnitude, num, flag3)) { return; } RollStyle(target); bool flag6 = target.Block.isBlocking && target.Block.sinceBlockStart >= skill.Reaction && Vector3.Angle(-target.Block.blockAngle, val) < Mathf.Max(25f, target.Block.blockForce * 40f); bool flag7 = false; if (skill.Expert && magnitude < 3.5f && Mathf.Abs(y) < 1.5f) { float num3 = Mathf.Sign(val.z); bool flag8 = DangerBehind(me.Pos, 0f - num3); bool flag9 = DangerBehind(target.Pos, num3); float num4 = target.Pos.z + num3 * 1.8f; bool flag10 = World.SafeGround(new Vector3(0f, target.Pos.y + 0.5f, num4), 4f); if (flag8 && !flag9 && flag10 && me.Grounded && (Object)(object)me.Weapon == (Object)null) { StartBlockPunchJump(num3, fromWall: false, num4); Mode = "swap sides"; return; } if (flag9 && !flag8) { flag7 = true; style = MeleeStyle.Rush; } } if ((flag2 || (flag5 && !flag6)) && magnitude < num + 1.4f) { goal = target.Pos; hasGoal = true; Aim(((num2 > 0f && magnitude > 2.5f) ? target.Pos : target.HeadPos) - me.Pos); if (magnitude < num && flag3) { Swing(); lastActionAt = Time.time; } Mode = (flag2 ? "riposte" : "punish whiff"); } else if (magnitude > num) { if (Unreachable(target)) { if (!MoveToBestSpot(ranged: false, 4f)) { hasGoal = false; } AimAt(target.HeadPos); Mode = "can't reach them"; return; } switch (style) { case MeleeStyle.Bait: if (magnitude < 2.5f && Mathf.Abs(y) < 1f) { Mode = "bait"; AimAt(target.Pos); return; } break; case MeleeStyle.Feint: if (magnitude < num + 0.9f && me.Grounded) { if (Time.time - feintStart > 0.9f) { feintStart = Time.time; } float num5 = Time.time - feintStart; float num6 = Mathf.Sign(val.z); hasGoal = false; wantMove = ((num5 < 0.25f) ? num6 : ((num5 < 0.55f) ? (0f - num6) : num6)); AimAt(target.Pos); Mode = "feint"; return; } break; case MeleeStyle.JumpIn: if (magnitude < 4f && me.Grounded && Mathf.Abs(y) < 1.5f && World.SafeGround(target.Pos + Vector3.up * 0.5f, 4f)) { if (magnitude > 2.4f) { StartBlockPunchJump(Mathf.Sign(val.z), fromWall: false, target.Pos.z); } else { Jump(); } } break; } Mode = "approach"; goal = target.Pos; hasGoal = true; if (!me.Grounded && y < -1.2f && Mathf.Abs(val.z) < 1.6f) { wantDuck = true; Mode = "slam"; } if (!me.Grounded && y < -0.3f && magnitude < num + 0.6f) { Aim(val); if (flag3) { Swing(); } } else { AimAt(target.Pos); } } else if (flag6 && !flag2) { if (magnitude < 1.1f && !flag) { Aim(-val); if (flag3) { FireOnce(); } Mode = "pull"; return; } if (me.Grounded) { Jump(); } if (y < -0.3f) { Aim(val); if (flag3) { Swing(); } } goal = target.Pos; hasGoal = true; Mode = "over the block"; } else { Vector3 val2 = target.HeadPos; if (!target.Grounded && y > 0.3f) { val2 = target.Pos + Vector3.down * 0.3f; } else if (num2 > 0f && magnitude > 2.5f) { val2 = target.Pos; } Aim(val2 - me.Pos); if (flag7) { Aim(new Vector3(0f, 0.35f, Mathf.Sign(val.z))); } if (flag3) { Swing(); lastActionAt = Time.time; } if (flag) { TryAltFire(target, magnitude, los: true); } Mode = (flag7 ? "knock off the edge" : "melee"); if (y < -0.8f && me.Grounded && Mathf.Abs(val.z) < 0.8f) { Jump(); } if (magnitude > 1f) { goal = target.Pos; hasGoal = true; } } } } private static bool DangerBehind(Vector3 pos, float dir) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due t