Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
tweaked purify burst conditions during revive/ship phase
Browse files Browse the repository at this point in the history
  • Loading branch information
MgAl2O4 committed Feb 12, 2021
1 parent 62568e6 commit 03a6053
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions SINoCOLO/GameLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,20 @@ private bool OnScan_ColoPurify(ScannerColoPurify.ScreenData screenData)
// if burst is ready, check if there's anything worth using it on
if (screenData.BurstState == ScannerColoPurify.EBurstState.ReadyAndCenter && (numBig > 0))
{
float SPAfterBurst = (screenData.SPIsValid ? screenData.SPFillPct : 1.0f) + (numBig * burstBigPct);
// always burst when prepping or during demon rush, time takes priority
bool hasDemon = (cachedDataColoCombat != null) && (cachedDataColoCombat.demonState != ScannerColoCombat.EDemonState.None);
bool shouldUseBurst = (SPAfterBurst < 0.99) || hasDemon;

// if ready, check how much SP would be wasted:
// - normal combat = don't waste, burst only to fill up
// - ship/revive = allow some wasting if already under 75%
bool bWantsToTopOff =
(cachedDataColoCombat.specialAction == ScannerColoCombat.ESpecialAction.AttackShip) ||
(cachedDataColoCombat.specialAction == ScannerColoCombat.ESpecialAction.Revive);

float SPCurrent = (screenData.SPIsValid ? screenData.SPFillPct : 1.0f);
float SPAfterBurst = SPCurrent + (numBig * burstBigPct);

bool shouldUseBurst = hasDemon || (SPAfterBurst < 0.99) || (bWantsToTopOff && SPCurrent < 0.75);

specialIdx = (int)(shouldUseBurst ? ScannerColoPurify.ESpecialBox.BurstReady : ScannerColoPurify.ESpecialBox.ReturnToBattle);
Rectangle actionBox = screenScanner.GetSpecialActionBox(specialIdx);
Expand Down

0 comments on commit 03a6053

Please sign in to comment.