- AI improvements of AF Play.

This commit is contained in:
Sloth
2012-02-17 10:55:11 +00:00
parent bb83d51c71
commit f2a93f223a
3 changed files with 7 additions and 14 deletions

View File

@@ -5,7 +5,7 @@ Text:no text
PT:5/8 PT:5/8
K:Islandwalk K:Islandwalk
K:Swampwalk 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: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:TrigPlay:DB$ Play | Defined$ Targeted | WithoutManaCost$ True
SVar:Rarity:Mythic SVar:Rarity:Mythic

View File

@@ -242,16 +242,8 @@ public final class AbilityFactoryPlay {
* @return a boolean. * @return a boolean.
*/ */
private static boolean PlayTriggerAI(final AbilityFactory af, final SpellAbility sa, final boolean mandatory) { 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 return false;
// always false.
/*
* if (af.hasSubAbility()) { final AbilitySub abSub =
* sa.getSubAbility(); if (abSub != null) { return randomReturn &&
* abSub.chkAIDrawback(); } }
*/
return randomReturn;
} }
/** /**
@@ -307,10 +299,11 @@ public final class AbilityFactoryPlay {
newSA.setManaCost(""); newSA.setManaCost("");
newSA.setDescription(sa.getDescription() + " (without paying its mana cost)"); newSA.setDescription(sa.getDescription() + " (without paying its mana cost)");
AllZone.getGameAction().playSpellAbility(newSA); AllZone.getGameAction().playSpellAbility(newSA);
} else if (tgtSA.canPlayAI()) { } else {
if (sa instanceof Spell) { if (tgtSA instanceof Spell) {
Spell spell = (Spell) sa; Spell spell = (Spell) tgtSA;
if (spell.canPlayFromEffectAI(false, true)) { if (spell.canPlayFromEffectAI(false, true)) {
//System.out.println("canPlayFromEffectAI: " + this.getHostCard());
ComputerUtil.playSpellAbilityWithoutPayingManaCost(tgtSA); ComputerUtil.playSpellAbilityWithoutPayingManaCost(tgtSA);
} }
} }

View File

@@ -555,7 +555,7 @@ public class AbilityFactoryPump {
*/ */
private boolean pumpTgtAI(final SpellAbility sa, final int defense, final int attack, final boolean mandatory) { private boolean pumpTgtAI(final SpellAbility sa, final int defense, final int attack, final boolean mandatory) {
if (!mandatory if (!mandatory
&& sa.getPayCosts() != null && !sa.isTrigger()
&& AllZone.getPhaseHandler().isAfter(Constant.Phase.COMBAT_DECLARE_BLOCKERS_INSTANT_ABILITY) && AllZone.getPhaseHandler().isAfter(Constant.Phase.COMBAT_DECLARE_BLOCKERS_INSTANT_ABILITY)
&& !(this.abilityFactory.isCurse() && ((defense < 0) || !this && !(this.abilityFactory.isCurse() && ((defense < 0) || !this
.containsCombatRelevantKeyword(this.keywords)))) { .containsCombatRelevantKeyword(this.keywords)))) {