Merge branch 'master' into 'master'

VentureAi timing tweaks, minor AI hint

See merge request core-developers/forge!5525
This commit is contained in:
Michael Kamensky
2021-10-08 14:56:59 +00:00
2 changed files with 13 additions and 1 deletions

View File

@@ -4,6 +4,8 @@ import com.google.common.collect.Lists;
import forge.ai.AiPlayDecision;
import forge.ai.PlayerControllerAi;
import forge.ai.SpellAbilityAi;
import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType;
import forge.game.player.Player;
import forge.game.player.PlayerActionConfirmMode;
import forge.game.spellability.SpellAbility;
@@ -15,7 +17,16 @@ import java.util.Map;
public class VentureAi extends SpellAbilityAi {
@Override
protected boolean canPlayAI(Player aiPlayer, SpellAbility sa) {
// TODO: is it ever a bad idea to venture into a dungeon?
// If this has a mana cost, do it at opponent's EOT if able to prevent spending mana early; if sorcery, do it in Main2
PhaseHandler ph = aiPlayer.getGame().getPhaseHandler();
if (sa.getPayCosts().hasManaCost() || sa.getPayCosts().hasTapCost()) {
if (SpellAbilityAi.isSorcerySpeed(sa)) {
return ph.is(PhaseType.MAIN2, aiPlayer);
} else {
return ph.is(PhaseType.END_OF_TURN) && ph.getNextTurn() == aiPlayer;
}
}
return true;
}

View File

@@ -4,4 +4,5 @@ Types:Creature Orc Knight
PT:4/4
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPumpAll | TriggerDescription$ Beacon of Hope — When CARDNAME enters the battlefield, creatures you control get +1/+1 and gain vigilance until end of turn.
SVar:TrigPumpAll:DB$ PumpAll | ValidCards$ Creature.YouCtrl | NumAtt$ +1 | NumDef$ +1 | KW$ Vigilance
SVar:PlayMain1:TRUE
Oracle:Beacon of Hope — When Devoted Paladin enters the battlefield, creatures you control get +1/+1 and gain vigilance until end of turn.