mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Initial setup for advanced Flash.
This commit is contained in:
@@ -113,7 +113,8 @@ public enum AiProps { /** */
|
|||||||
MOJHOSTO_CHANCE_TO_PREFER_JHOIRA_OVER_MOMIR ("50"), /** */
|
MOJHOSTO_CHANCE_TO_PREFER_JHOIRA_OVER_MOMIR ("50"), /** */
|
||||||
MOJHOSTO_CHANCE_TO_USE_JHOIRA_COPY_INSTANT ("20"), /** */
|
MOJHOSTO_CHANCE_TO_USE_JHOIRA_COPY_INSTANT ("20"), /** */
|
||||||
AI_IN_DANGER_THRESHOLD("4"), /** */
|
AI_IN_DANGER_THRESHOLD("4"), /** */
|
||||||
AI_IN_DANGER_MAX_THRESHOLD("4"); /** */
|
AI_IN_DANGER_MAX_THRESHOLD("4"), /** */
|
||||||
|
FLASH_ENABLE_ADVANCED_LOGIC("true"); /** */
|
||||||
// Experimental features, must be promoted or removed after extensive testing and, ideally, defaulting
|
// Experimental features, must be promoted or removed after extensive testing and, ideally, defaulting
|
||||||
// <-- There are no experimental options here -->
|
// <-- There are no experimental options here -->
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package forge.ai.ability;
|
package forge.ai.ability;
|
||||||
|
|
||||||
import forge.ai.ComputerUtil;
|
import forge.ai.*;
|
||||||
import forge.ai.ComputerUtilCard;
|
|
||||||
import forge.ai.ComputerUtilCost;
|
|
||||||
import forge.card.mana.ManaCost;
|
import forge.card.mana.ManaCost;
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
@@ -79,16 +77,26 @@ public class PermanentCreatureAi extends PermanentAi {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// save cards with flash for surprise blocking
|
// Flash logic
|
||||||
if (card.withFlash(ai)
|
boolean advancedFlash = false;
|
||||||
&& (ai.isUnlimitedHandSize() || ai.getCardsIn(ZoneType.Hand).size() <= ai.getMaxHandSize()
|
if (ai.getController().isAI()) {
|
||||||
|| ph.getPhase().isBefore(PhaseType.END_OF_TURN))
|
advancedFlash = ((PlayerControllerAi)ai.getController()).getAi().getBooleanProperty(AiProps.FLASH_ENABLE_ADVANCED_LOGIC);
|
||||||
&& ai.getManaPool().totalMana() <= 0
|
}
|
||||||
&& (ph.isPlayerTurn(ai) || ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS))
|
if (advancedFlash) {
|
||||||
&& (!card.hasETBTrigger(true) || card.hasSVar("AmbushAI")) && game.getStack().isEmpty()
|
|
||||||
&& !ComputerUtil.castPermanentInMain1(ai, sa)) {
|
} else {
|
||||||
// AiPlayDecision.AnotherTime;
|
// save cards with flash for surprise blocking
|
||||||
return false;
|
if (card.withFlash(ai)
|
||||||
|
&& (ai.isUnlimitedHandSize() || ai.getCardsIn(ZoneType.Hand).size() <= ai.getMaxHandSize()
|
||||||
|
|| ph.getPhase().isBefore(PhaseType.END_OF_TURN))
|
||||||
|
&& ai.getManaPool().totalMana() <= 0
|
||||||
|
&& (ph.isPlayerTurn(ai) || ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS))
|
||||||
|
&& (!card.hasETBTrigger(true) && !card.hasSVar("AmbushAI"))
|
||||||
|
&& game.getStack().isEmpty()
|
||||||
|
&& !ComputerUtil.castPermanentInMain1(ai, sa)) {
|
||||||
|
// AiPlayDecision.AnotherTime;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.checkPhaseRestrictions(ai, sa, ph);
|
return super.checkPhaseRestrictions(ai, sa, ph);
|
||||||
|
|||||||
Reference in New Issue
Block a user