Skip to content

Commit

Permalink
Fixed logic error with ShouldPanic()
Browse files Browse the repository at this point in the history
  • Loading branch information
RealityMachina committed May 21, 2018
1 parent c6e0fd2 commit ea37851
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions PunchinOut/BasicPanic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public static bool ShouldPanic(Mech mech, AttackDirector.AttackSequence attackSe
if(rngRoll <= PanicRoll)
{

if (Holder.TrackedPilots[index].trackedPilot == pilot.GUID && Holder.TrackedPilots[index].pilotStatus == PanicStatus.Fatigued)
if (Holder.TrackedPilots[index].trackedPilot == pilot.GUID && Holder.TrackedPilots[index].pilotStatus == PanicStatus.Normal)
{
mech.Combat.MessageCenter.PublishMessage(new AddSequenceToStackMessage(new ShowActorInfoSequence(mech, $"Fatigued!", FloatieMessage.MessageNature.Debuff, true)));
Holder.TrackedPilots[index].pilotStatus = PanicStatus.Fatigued;
Expand All @@ -368,7 +368,7 @@ public static bool ShouldPanic(Mech mech, AttackDirector.AttackSequence attackSe
mech.StatCollection.ModifyStat<float>("Panic Attack: Fatigued Aim", -1, "AccuracyModifier", StatCollection.StatOperation.Float_Add, BasicPanic.Settings.FatiguedAimModifier, -1, true);

}
else if (Holder.TrackedPilots[index].trackedPilot == pilot.GUID && Holder.TrackedPilots[index].pilotStatus == PanicStatus.Stressed)
else if (Holder.TrackedPilots[index].trackedPilot == pilot.GUID && Holder.TrackedPilots[index].pilotStatus == PanicStatus.Fatigued)
{
mech.Combat.MessageCenter.PublishMessage(new AddSequenceToStackMessage(new ShowActorInfoSequence(mech, $"Stressed!", FloatieMessage.MessageNature.Debuff, true)));
Holder.TrackedPilots[index].pilotStatus = PanicStatus.Stressed;
Expand All @@ -377,7 +377,7 @@ public static bool ShouldPanic(Mech mech, AttackDirector.AttackSequence attackSe
mech.StatCollection.ModifyStat<float>("Panic Attack: Stressed Aim", -1, "AccuracyModifier", StatCollection.StatOperation.Float_Add, BasicPanic.Settings.StressedAimModifier, -1, true);
mech.StatCollection.ModifyStat<float>("Panic Attack: Stressed Defence", -1, "ToHitThisActor", StatCollection.StatOperation.Float_Add, BasicPanic.Settings.StressedToHitModifier, -1, true);
}
else if (Holder.TrackedPilots[index].trackedPilot == pilot.GUID && Holder.TrackedPilots[index].pilotStatus == PanicStatus.Panicked)
else if (Holder.TrackedPilots[index].trackedPilot == pilot.GUID && Holder.TrackedPilots[index].pilotStatus == PanicStatus.Stressed)
{
mech.Combat.MessageCenter.PublishMessage(new AddSequenceToStackMessage(new ShowActorInfoSequence(mech, $"Panicked!", FloatieMessage.MessageNature.Debuff, true)));
Holder.TrackedPilots[index].pilotStatus = PanicStatus.Panicked;
Expand All @@ -387,6 +387,10 @@ public static bool ShouldPanic(Mech mech, AttackDirector.AttackSequence attackSe
mech.StatCollection.ModifyStat<float>("Panic Attack: Panicking Aim!", -1, "AccuracyModifier", StatCollection.StatOperation.Float_Add, BasicPanic.Settings.PanickedAimModifier, -1, true);
mech.StatCollection.ModifyStat<float>("Panic Attack: Panicking Defence!", -1, "ToHitThisActor", StatCollection.StatOperation.Float_Add, BasicPanic.Settings.PanickedToHitModifier, -1, true);
}
else
{
mech.Combat.MessageCenter.PublishMessage(new AddSequenceToStackMessage(new ShowActorInfoSequence(mech, $"Still Panicking!", FloatieMessage.MessageNature.Debuff, true)));
}
Holder.TrackedPilots[index].ChangedRecently = true;
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion PunchinOut/panicTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class PanicTracker
public PanicTracker(Pilot pilot)
{

trackedPilot = pilot.GUID;
trackedPilot = pilot.GUID;
pilotStatus = PanicStatus.Normal;
ChangedRecently = false;
}
Expand Down

0 comments on commit ea37851

Please sign in to comment.