From 57a68ab1eb41b1734fa40322dfa0131068bd61e5 Mon Sep 17 00:00:00 2001 From: RealityMachina Date: Mon, 21 May 2018 16:33:04 -0400 Subject: [PATCH] Fixed more logic and math errors. (My brain derped about zero-based arrays) --- PunchinOut/BasicPanic.cs | 35 +++++++++++++++++++++-------------- mod.json | 10 +++++----- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/PunchinOut/BasicPanic.cs b/PunchinOut/BasicPanic.cs index ba98eb7..2174c00 100644 --- a/PunchinOut/BasicPanic.cs +++ b/PunchinOut/BasicPanic.cs @@ -55,7 +55,7 @@ public static void Prefix(AbstractActor __instance) return; index = PanicHelpers.GetTrackedPilotIndex(pilot); - if (index > 0) + if (index > -1) { FoundPilot = true; } @@ -66,17 +66,20 @@ public static void Prefix(AbstractActor __instance) Holder.TrackedPilots.Add(new PanicTracker(pilot)); //add a new tracker to tracked pilot, then we run it all over again; index = PanicHelpers.GetTrackedPilotIndex(pilot); - if(index > 0) + if(index > -1) { FoundPilot = true; } + else + { + return; + } } if(FoundPilot && !Holder.TrackedPilots[index].ChangedRecently) { if(Holder.TrackedPilots[index].pilotStatus == PanicStatus.Fatigued) { - Holder.TrackedPilots[index].pilotStatus = PanicStatus.Normal; } @@ -151,7 +154,7 @@ public static bool IsPanicking(Mech mech) { int i = GetTrackedPilotIndex(pilot); - if (i > 0) + if (i > -1) { if (Holder.TrackedPilots[i].trackedPilot == pilot.GUID && Holder.TrackedPilots[i].pilotStatus == PanicStatus.Panicked) @@ -232,6 +235,10 @@ public static bool ShouldPanic(Mech mech, AttackDirector.AttackSequence attackSe Holder.TrackedPilots.Add(new PanicTracker(pilot)); //add a new tracker to tracked pilot, then we run it all over again; index = PanicHelpers.GetTrackedPilotIndex(pilot); + if(index < 0) + { + return false; + } } if (Holder.TrackedPilots[index].trackedPilot != pilot.GUID) @@ -411,20 +418,20 @@ internal class ModSettings public bool AlwaysGatedChanges = true; public float MaxPanicResistTotal = 15; //at least 20% chance to panic if you can't nullify the whole thing //fatigued debuffs - //-5 to aim - public float FatiguedAimModifier = -5; + //+1 difficulty to attacks + public float FatiguedAimModifier = 1; //stressed debuffs - //-10 to aim - //+5 to being hit + //+2 difficulty to attacks + //-1 difficulty to being hit - public float StressedAimModifier = -10; - public float StressedToHitModifier = 5; + public float StressedAimModifier = 2; + public float StressedToHitModifier = -1; //ejection - //-15 to aim - //+5 to being hit - public float PanickedAimModifier = -15; - public float PanickedToHitModifier = 5; + //+4 difficulty to attacks + //-2 difficulty to being hit + public float PanickedAimModifier = 4; + public float PanickedToHitModifier = -2; public bool GutsTenAlwaysResists = false; public bool ComboTenAlwaysResists = false; public bool TacticsTenAlwaysResists = false; diff --git a/mod.json b/mod.json index da77611..cec9fcd 100644 --- a/mod.json +++ b/mod.json @@ -14,11 +14,11 @@ "AtLeastOneChanceToPanic": true, "AlwaysGatedChanges": true, "MaxPanicResistTotal": 15, - "FatiguedAimModifier": -5, - "StressedAimModifier": -10, - "StressedToHitModifier": 5, - "PanickedAimModifier": -15, - "PanickedToHitModifier": 5, + "FatiguedAimModifier": 1, + "StressedAimModifier": 2, + "StressedToHitModifier": -1, + "PanickedAimModifier": 4, + "PanickedToHitModifier": -2, "MinimumHealthToAlwaysEjectRoll": 1, "MaxEjectChance": 50,