From 03a605392c5bfa21552699d5c6c1d00750d07065 Mon Sep 17 00:00:00 2001 From: MgAl2O4 <51430403+MgAl2O4@users.noreply.github.com> Date: Thu, 11 Feb 2021 21:00:52 -0500 Subject: [PATCH] tweaked purify burst conditions during revive/ship phase --- SINoCOLO/GameLogic.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/SINoCOLO/GameLogic.cs b/SINoCOLO/GameLogic.cs index e9d8924..7182ac3 100644 --- a/SINoCOLO/GameLogic.cs +++ b/SINoCOLO/GameLogic.cs @@ -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);