mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Added the initial boolean flags for advanced Flash AI.
- Refactored the adv Flash logic to its own method.
This commit is contained in:
@@ -83,7 +83,7 @@ public class PermanentCreatureAi extends PermanentAi {
|
|||||||
advancedFlash = ((PlayerControllerAi)ai.getController()).getAi().getBooleanProperty(AiProps.FLASH_ENABLE_ADVANCED_LOGIC);
|
advancedFlash = ((PlayerControllerAi)ai.getController()).getAi().getBooleanProperty(AiProps.FLASH_ENABLE_ADVANCED_LOGIC);
|
||||||
}
|
}
|
||||||
if (advancedFlash) {
|
if (advancedFlash) {
|
||||||
|
return doAdvancedFlashLogic(card, ai, sa);
|
||||||
} else {
|
} else {
|
||||||
// save cards with flash for surprise blocking
|
// save cards with flash for surprise blocking
|
||||||
if (card.withFlash(ai)
|
if (card.withFlash(ai)
|
||||||
@@ -102,6 +102,22 @@ public class PermanentCreatureAi extends PermanentAi {
|
|||||||
return super.checkPhaseRestrictions(ai, sa, ph);
|
return super.checkPhaseRestrictions(ai, sa, ph);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean doAdvancedFlashLogic(Card card, Player ai, SpellAbility sa) {
|
||||||
|
PhaseHandler ph = ai.getGame().getPhaseHandler();
|
||||||
|
|
||||||
|
boolean hasETBTrigger = card.hasETBTrigger(true);
|
||||||
|
boolean hasAmbushAI = card.hasSVar("AmbushAI");
|
||||||
|
boolean hasFloatMana = ai.getManaPool().totalMana() > 0;
|
||||||
|
boolean willDiscardNow = ph.is(PhaseType.END_OF_TURN, ai) && ai.getCardsIn(ZoneType.Hand).size() > ai.getMaxHandSize();
|
||||||
|
boolean wantToCastInMain1 = ph.is(PhaseType.MAIN1, ai) && ComputerUtil.castPermanentInMain1(ai, sa);
|
||||||
|
boolean valuableBlocker = false; // TODO: implement this
|
||||||
|
|
||||||
|
boolean isOwnEOT = ph.is(PhaseType.END_OF_TURN, ai);
|
||||||
|
boolean isEOTBeforeMyTurn = ph.is(PhaseType.END_OF_TURN) && ph.getNextTurn().equals(ai);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean checkApiLogic(Player ai, SpellAbility sa) {
|
protected boolean checkApiLogic(Player ai, SpellAbility sa) {
|
||||||
|
|
||||||
|
|||||||
@@ -9,5 +9,6 @@ SVar:DBEffect:DB$ Effect | Triggers$ ComeBack | RememberObjects$ TriggeredCard |
|
|||||||
SVar:ComeBack:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.IsImprinted | Execute$ TrigReturn | TriggerZones$ Command | TriggerController$ You | Static$ True | TriggerDescription$ That creature is exiled until EFFECTSOURCE leaves the battlefield
|
SVar:ComeBack:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.IsImprinted | Execute$ TrigReturn | TriggerZones$ Command | TriggerController$ You | Static$ True | TriggerDescription$ That creature is exiled until EFFECTSOURCE leaves the battlefield
|
||||||
SVar:TrigReturn:DB$ ChangeZoneAll | Origin$ Exile | Destination$ Battlefield | ChangeType$ Card.IsRemembered | SubAbility$ ExileSelf
|
SVar:TrigReturn:DB$ ChangeZoneAll | Origin$ Exile | Destination$ Battlefield | ChangeType$ Card.IsRemembered | SubAbility$ ExileSelf
|
||||||
SVar:ExileSelf:DB$ ChangeZone | Origin$ Command | Destination$ Exile | Defined$ Self
|
SVar:ExileSelf:DB$ ChangeZone | Origin$ Command | Destination$ Exile | Defined$ Self
|
||||||
|
SVar:AmbushAI:True
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/hixus_prison_warden.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/hixus_prison_warden.jpg
|
||||||
Oracle:Flash (You may cast this spell any time you could cast an instant.)\nWhenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.
|
Oracle:Flash (You may cast this spell any time you could cast an instant.)\nWhenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.
|
||||||
|
|||||||
Reference in New Issue
Block a user