mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- AI improvements of AF Play.
This commit is contained in:
@@ -5,7 +5,7 @@ Text:no text
|
||||
PT:5/8
|
||||
K:Islandwalk
|
||||
K:Swampwalk
|
||||
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigPump | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, you may cast target instant or sorcery card from that player's graveyard without paying its mana cost. If that card would be put into a graveyard this turn, exile it instead.
|
||||
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigPump | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, you may cast target instant or sorcery card from that player's graveyard without paying its mana cost. If that card would be put into a graveyard this turn, exile it instead.
|
||||
SVar:TrigPump:AB$ Pump | Cost$ 0 | TgtZone$ Graveyard | ValidTgts$ Instant.YouDontCtrl,Sorcery.YouDontCtrl | TgtPrompt$ Choose target instant or sorcery card from an opponent's graveyard | KW$ HIDDEN If CARDNAME would be put into a graveyard, exile it instead. | PumpZone$ Graveyard | SubAbility$ TrigPlay
|
||||
SVar:TrigPlay:DB$ Play | Defined$ Targeted | WithoutManaCost$ True
|
||||
SVar:Rarity:Mythic
|
||||
|
||||
@@ -242,16 +242,8 @@ public final class AbilityFactoryPlay {
|
||||
* @return a boolean.
|
||||
*/
|
||||
private static boolean PlayTriggerAI(final AbilityFactory af, final SpellAbility sa, final boolean mandatory) {
|
||||
final boolean randomReturn = false;
|
||||
|
||||
// comment out the af.hasSubAbility() until it's used. randomReturn is
|
||||
// always false.
|
||||
/*
|
||||
* if (af.hasSubAbility()) { final AbilitySub abSub =
|
||||
* sa.getSubAbility(); if (abSub != null) { return randomReturn &&
|
||||
* abSub.chkAIDrawback(); } }
|
||||
*/
|
||||
return randomReturn;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -307,10 +299,11 @@ public final class AbilityFactoryPlay {
|
||||
newSA.setManaCost("");
|
||||
newSA.setDescription(sa.getDescription() + " (without paying its mana cost)");
|
||||
AllZone.getGameAction().playSpellAbility(newSA);
|
||||
} else if (tgtSA.canPlayAI()) {
|
||||
if (sa instanceof Spell) {
|
||||
Spell spell = (Spell) sa;
|
||||
} else {
|
||||
if (tgtSA instanceof Spell) {
|
||||
Spell spell = (Spell) tgtSA;
|
||||
if (spell.canPlayFromEffectAI(false, true)) {
|
||||
//System.out.println("canPlayFromEffectAI: " + this.getHostCard());
|
||||
ComputerUtil.playSpellAbilityWithoutPayingManaCost(tgtSA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -555,7 +555,7 @@ public class AbilityFactoryPump {
|
||||
*/
|
||||
private boolean pumpTgtAI(final SpellAbility sa, final int defense, final int attack, final boolean mandatory) {
|
||||
if (!mandatory
|
||||
&& sa.getPayCosts() != null
|
||||
&& !sa.isTrigger()
|
||||
&& AllZone.getPhaseHandler().isAfter(Constant.Phase.COMBAT_DECLARE_BLOCKERS_INSTANT_ABILITY)
|
||||
&& !(this.abilityFactory.isCurse() && ((defense < 0) || !this
|
||||
.containsCombatRelevantKeyword(this.keywords)))) {
|
||||
|
||||
Reference in New Issue
Block a user