Skip to content

Commit

Permalink
Changed defaults a bit more: now guts can't auto resist, along with m…
Browse files Browse the repository at this point in the history
…aking panic a bit more likelier to happen.

Also nerfed how much lance morale can help with the panic check.
  • Loading branch information
RealityMachina committed May 21, 2018
1 parent f32f4b2 commit c6e0fd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions PunchinOut/BasicPanic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public static bool IsPanicking(Mech mech)
return true;
}
}
if (mech.Combat.GetAllAlliesOf(mech).TrueForAll(m => m.IsDead || m == mech as AbstractActor))
if (mech.Combat.GetAllAlliesOf(mech).TrueForAll(m => m.IsDead || m.GUID == mech.GUID))
{
return true;
}
Expand Down Expand Up @@ -331,7 +331,7 @@ public static bool ShouldPanic(Mech mech, AttackDirector.AttackSequence attackSe
if(mech.team == mech.Combat.LocalPlayerTeam)
{
MoraleConstantsDef moraleDef = mech.Combat.Constants.GetActiveMoraleDef(mech.Combat);
panicModifiers -= Math.Max(mech.Combat.LocalPlayerTeam.Morale - moraleDef.CanUseInspireLevel, 0);
panicModifiers -= Math.Max(mech.Combat.LocalPlayerTeam.Morale - moraleDef.CanUseInspireLevel, 0) / 2;
}

//reduce modifiers by 5 to account change to D20 roll instead of D100 roll, then min it t0 20 or modified floor
Expand All @@ -350,11 +350,11 @@ public static bool ShouldPanic(Mech mech, AttackDirector.AttackSequence attackSe
}
PanicRoll = UnityEngine.Random.Range(PanicRoll, 20); // actual roll
//we get this far, we reduce total to under the max panic chance
total = Math.Min(total, 20 - 1);
total = Math.Min(total, (int)BasicPanic.Settings.MaxPanicResistTotal);

int rngRoll = UnityEngine.Random.Range(total, 20);

if(rngRoll < PanicRoll)
if(rngRoll <= PanicRoll)
{

if (Holder.TrackedPilots[index].trackedPilot == pilot.GUID && Holder.TrackedPilots[index].pilotStatus == PanicStatus.Fatigued)
Expand Down Expand Up @@ -405,7 +405,7 @@ internal class ModSettings
//max guts and tactics almost prevents any panicking (or being the player character, by default)
public bool AtLeastOneChanceToPanic = true;
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;
Expand All @@ -421,7 +421,7 @@ internal class ModSettings
//+5 to being hit
public float PanickedAimModifier = -15;
public float PanickedToHitModifier = 5;
public bool GutsTenAlwaysResists = true;
public bool GutsTenAlwaysResists = false;
public bool ComboTenAlwaysResists = false;
public bool TacticsTenAlwaysResists = false;
public int MinimumHealthToAlwaysEjectRoll = 1;
Expand Down
3 changes: 2 additions & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

"AtLeastOneChanceToPanic": true,
"AlwaysGatedChanges": true,
"MaxPanicResistTotal": 15,
"FatiguedAimModifier": -5,
"StressedAimModifier": -10,
"StressedToHitModifier": 5,
Expand All @@ -21,7 +22,7 @@

"MinimumHealthToAlwaysEjectRoll": 1,
"MaxEjectChance": 50,
"GutsTenAlwaysResists": true,
"GutsTenAlwaysResists": false,
"ComboTenAlwaysResists": false,
"TacticsTenAlwaysResists": false,
"KnockedDownCannotEject": true,
Expand Down

0 comments on commit c6e0fd2

Please sign in to comment.