- Removed the Effect type DebuffAll. The 5 cards that used it were converted to AnimateAll.

This commit is contained in:
Sloth
2014-10-19 20:37:04 +00:00
parent 61e8793a36
commit 29a8595752
11 changed files with 12 additions and 157 deletions

2
.gitattributes vendored
View File

@@ -76,7 +76,6 @@ forge-ai/src/main/java/forge/ai/ability/DamageEachAi.java -text
forge-ai/src/main/java/forge/ai/ability/DamagePreventAi.java -text forge-ai/src/main/java/forge/ai/ability/DamagePreventAi.java -text
forge-ai/src/main/java/forge/ai/ability/DamagePreventAllAi.java -text forge-ai/src/main/java/forge/ai/ability/DamagePreventAllAi.java -text
forge-ai/src/main/java/forge/ai/ability/DebuffAi.java -text forge-ai/src/main/java/forge/ai/ability/DebuffAi.java -text
forge-ai/src/main/java/forge/ai/ability/DebuffAllAi.java -text
forge-ai/src/main/java/forge/ai/ability/DelayedTriggerAi.java -text forge-ai/src/main/java/forge/ai/ability/DelayedTriggerAi.java -text
forge-ai/src/main/java/forge/ai/ability/DestroyAi.java -text forge-ai/src/main/java/forge/ai/ability/DestroyAi.java -text
forge-ai/src/main/java/forge/ai/ability/DestroyAllAi.java -text forge-ai/src/main/java/forge/ai/ability/DestroyAllAi.java -text
@@ -354,7 +353,6 @@ forge-game/src/main/java/forge/game/ability/effects/DamageDealEffect.java -text
forge-game/src/main/java/forge/game/ability/effects/DamageEachEffect.java -text forge-game/src/main/java/forge/game/ability/effects/DamageEachEffect.java -text
forge-game/src/main/java/forge/game/ability/effects/DamagePreventAllEffect.java -text forge-game/src/main/java/forge/game/ability/effects/DamagePreventAllEffect.java -text
forge-game/src/main/java/forge/game/ability/effects/DamagePreventEffect.java -text forge-game/src/main/java/forge/game/ability/effects/DamagePreventEffect.java -text
forge-game/src/main/java/forge/game/ability/effects/DebuffAllEffect.java -text
forge-game/src/main/java/forge/game/ability/effects/DebuffEffect.java -text forge-game/src/main/java/forge/game/ability/effects/DebuffEffect.java -text
forge-game/src/main/java/forge/game/ability/effects/DeclareCombatantsEffect.java -text forge-game/src/main/java/forge/game/ability/effects/DeclareCombatantsEffect.java -text
forge-game/src/main/java/forge/game/ability/effects/DelayedTriggerEffect.java -text forge-game/src/main/java/forge/game/ability/effects/DelayedTriggerEffect.java -text

View File

@@ -49,7 +49,6 @@ public enum SpellApiToAi {
apiToClass.put(ApiType.DealDamage, DamageDealAi.class); apiToClass.put(ApiType.DealDamage, DamageDealAi.class);
apiToClass.put(ApiType.Debuff, DebuffAi.class); apiToClass.put(ApiType.Debuff, DebuffAi.class);
apiToClass.put(ApiType.DebuffAll, DebuffAllAi.class);
apiToClass.put(ApiType.DeclareCombatants, CannotPlayAi.class); apiToClass.put(ApiType.DeclareCombatants, CannotPlayAi.class);
apiToClass.put(ApiType.DelayedTrigger, DelayedTriggerAi.class); apiToClass.put(ApiType.DelayedTrigger, DelayedTriggerAi.class);
apiToClass.put(ApiType.Destroy, DestroyAi.class); apiToClass.put(ApiType.Destroy, DestroyAi.class);

View File

@@ -1,64 +0,0 @@
package forge.ai.ability;
import com.google.common.base.Predicate;
import forge.ai.SpellAbilityAi;
import forge.game.card.Card;
import forge.game.card.CardLists;
import forge.game.combat.CombatUtil;
import forge.game.phase.PhaseType;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
import forge.game.zone.ZoneType;
import forge.util.MyRandom;
import java.util.List;
import java.util.Random;
public class DebuffAllAi extends SpellAbilityAi {
@Override
protected boolean canPlayAI(Player ai, SpellAbility sa) {
String valid = "";
final Random r = MyRandom.getRandom();
// final Card source = sa.getHostCard();
final Card hostCard = sa.getHostCard();
final Player opp = ai.getOpponent();
final boolean chance = r.nextFloat() <= Math.pow(.6667, sa.getActivationsThisTurn()); // to
// prevent
// runaway
// activations
if (sa.hasParam("ValidCards")) {
valid = sa.getParam("ValidCards");
}
List<Card> comp = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), valid, hostCard.getController(), hostCard);
List<Card> human = CardLists.getValidCards(opp.getCardsIn(ZoneType.Battlefield), valid, hostCard.getController(), hostCard);
// TODO - add blocking situations here also
// only count creatures that can attack
human = CardLists.filter(human, new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
return CombatUtil.canAttack(c, opp);
}
});
// don't use DebuffAll after Combat_Begin until AI is improved
if (ai.getGame().getPhaseHandler().getPhase().isAfter(PhaseType.COMBAT_BEGIN)) {
return false;
}
if (comp.size() > human.size()) {
return false;
}
return (r.nextFloat() < .6667) && chance;
} // debuffAllCanPlayAI()
@Override
protected boolean doTriggerAINoCost(Player aiPlayer, SpellAbility sa, boolean mandatory) {
return true;
}
}

View File

@@ -47,7 +47,6 @@ public enum ApiType {
DamageAll (DamageAllEffect.class), DamageAll (DamageAllEffect.class),
DealDamage (DamageDealEffect.class), DealDamage (DamageDealEffect.class),
Debuff (DebuffEffect.class), Debuff (DebuffEffect.class),
DebuffAll (DebuffAllEffect.class),
DeclareCombatants (DeclareCombatantsEffect.class), DeclareCombatants (DeclareCombatantsEffect.class),
DelayedTrigger (DelayedTriggerEffect.class), DelayedTrigger (DelayedTriggerEffect.class),
Destroy (DestroyEffect.class), Destroy (DestroyEffect.class),

View File

@@ -74,6 +74,11 @@ public class AnimateAllEffect extends AnimateEffectBase {
keywords.addAll(Arrays.asList(sa.getParam("Keywords").split(" & "))); keywords.addAll(Arrays.asList(sa.getParam("Keywords").split(" & ")));
} }
final ArrayList<String> removeKeywords = new ArrayList<String>();
if (sa.hasParam("RemoveKeywords")) {
removeKeywords.addAll(Arrays.asList(sa.getParam("RemoveKeywords").split(" & ")));
}
final ArrayList<String> hiddenKeywords = new ArrayList<String>(); final ArrayList<String> hiddenKeywords = new ArrayList<String>();
if (sa.hasParam("HiddenKeywords")) { if (sa.hasParam("HiddenKeywords")) {
hiddenKeywords.addAll(Arrays.asList(sa.getParam("HiddenKeywords").split(" & "))); hiddenKeywords.addAll(Arrays.asList(sa.getParam("HiddenKeywords").split(" & ")));
@@ -141,7 +146,7 @@ public class AnimateAllEffect extends AnimateEffectBase {
for (final Card c : list) { for (final Card c : list) {
final long colorTimestamp = doAnimate(c, sa, power, toughness, types, removeTypes, final long colorTimestamp = doAnimate(c, sa, power, toughness, types, removeTypes,
finalDesc, keywords, null, hiddenKeywords, timestamp); finalDesc, keywords, removeKeywords, hiddenKeywords, timestamp);
// give abilities // give abilities
final ArrayList<SpellAbility> addedAbilities = new ArrayList<SpellAbility>(); final ArrayList<SpellAbility> addedAbilities = new ArrayList<SpellAbility>();

View File

@@ -1,83 +0,0 @@
package forge.game.ability.effects;
import forge.GameCommand;
import forge.game.Game;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card;
import forge.game.card.CardCollectionView;
import forge.game.card.CardLists;
import forge.game.spellability.SpellAbility;
import forge.game.zone.ZoneType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class DebuffAllEffect extends SpellAbilityEffect {
/* (non-Javadoc)
* @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility)
*/
@Override
protected String getStackDescription(SpellAbility sa) {
if (sa.hasParam("DebuffAllDescription")) {
return sa.getParam("DebuffAllDescription");
}
return "";
} // debuffAllStackDescription()
/**
* <p>
* debuffAllResolve.
* </p>
* @param sa
* a {@link forge.game.spellability.SpellAbility} object.
* @param af
* a {@link forge.game.ability.AbilityFactory} object.
*/
@Override
public void resolve(SpellAbility sa) {
final Card hostCard = sa.getHostCard();
final List<String> kws = sa.hasParam("Keywords") ? Arrays.asList(sa.getParam("Keywords").split(" & ")) : new ArrayList<String>();
final Game game = sa.getActivatingPlayer().getGame();
String valid = "";
if (sa.hasParam("ValidCards")) {
valid = sa.getParam("ValidCards");
}
CardCollectionView list = game.getCardsIn(ZoneType.Battlefield);
list = CardLists.getValidCards(list, valid.split(","), hostCard.getController(), hostCard);
for (final Card tgtC : list) {
final ArrayList<String> hadIntrinsic = new ArrayList<String>();
if (tgtC.isInPlay() && tgtC.canBeTargetedBy(sa)) {
for (final String kw : kws) {
if (tgtC.getCurrentState().hasIntrinsicKeyword(kw)) {
hadIntrinsic.add(kw);
}
tgtC.removeIntrinsicKeyword(kw);
tgtC.removeExtrinsicKeyword(kw);
}
}
if (!sa.hasParam("Permanent")) {
game.getEndOfTurn().addUntil(new GameCommand() {
private static final long serialVersionUID = 7486231071095628674L;
@Override
public void run() {
if (tgtC.isInPlay()) {
for (final String kw : hadIntrinsic) {
tgtC.addIntrinsicKeyword(kw);
}
}
}
});
}
}
} // debuffAllResolve()
}

View File

@@ -1,7 +1,7 @@
Name:Blind Fury Name:Blind Fury
ManaCost:2 R R ManaCost:2 R R
Types:Instant Types:Instant
A:SP$ DebuffAll | Cost$ 2 R R | ValidCards$ Creature | Keywords$ Trample | SubAbility$ BlindFuryEffect | SpellDescription$ All creatures lose trample until end of turn. If a creature would deal combat damage to a creature this turn, it deals double that damage to that creature instead. A:SP$ AnimateAll | Cost$ 2 R R | ValidCards$ Creature | RemoveKeywords$ Trample | SubAbility$ BlindFuryEffect | SpellDescription$ All creatures lose trample until end of turn. If a creature would deal combat damage to a creature this turn, it deals double that damage to that creature instead.
SVar:BlindFuryEffect:DB$ Effect | Name$ Blind Fury Effect | ReplacementEffects$ FuryCombatEvent | SVars$ DmgTwiceCombat,X SVar:BlindFuryEffect:DB$ Effect | Name$ Blind Fury Effect | ReplacementEffects$ FuryCombatEvent | SVars$ DmgTwiceCombat,X
SVar:FuryCombatEvent:Event$ DamageDone | ValidSource$ Creature | ValidTarget$ Creature | ReplaceWith$ DmgTwiceCombat | IsCombat$ True | Description$ If a creature would deal combat damage to a creature this turn, it deals double that damage to that creature instead. SVar:FuryCombatEvent:Event$ DamageDone | ValidSource$ Creature | ValidTarget$ Creature | ReplaceWith$ DmgTwiceCombat | IsCombat$ True | Description$ If a creature would deal combat damage to a creature this turn, it deals double that damage to that creature instead.
SVar:DmgTwiceCombat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X SVar:DmgTwiceCombat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X

View File

@@ -1,7 +1,7 @@
Name:Invert the Skies Name:Invert the Skies
ManaCost:3 GU ManaCost:3 GU
Types:Instant Types:Instant
A:SP$ DebuffAll | Cost$ 3 GU | ValidCards$ Creature.OppCtrl | Keywords$ Flying | ConditionManaSpent$ G | SubAbility$ UPaid | SpellDescription$ Creatures your opponents control lose flying until end of turn if {G} was spent to cast CARDNAME, and creatures you control gain flying until end of turn if {U} was spent to cast it. (Do both if {G}{U} was spent.) A:SP$ AnimateAll | Cost$ 3 GU | ValidCards$ Creature.OppCtrl | RemoveKeywords$ Flying | ConditionManaSpent$ G | SubAbility$ UPaid | SpellDescription$ Creatures your opponents control lose flying until end of turn if {G} was spent to cast CARDNAME, and creatures you control gain flying until end of turn if {U} was spent to cast it. (Do both if {G}{U} was spent.)
SVar:UPaid:DB$ PumpAll | ValidCards$ Creature.YouCtrl | KW$ Flying | ConditionManaSpent$ U SVar:UPaid:DB$ PumpAll | ValidCards$ Creature.YouCtrl | KW$ Flying | ConditionManaSpent$ U
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/invert_the_skies.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/invert_the_skies.jpg

View File

@@ -4,6 +4,6 @@ Types:Creature Elemental
PT:3/4 PT:3/4
K:Flying K:Flying
A:AB$ TapAll | Cost$ 3 U | ValidCards$ Creature.toughnessLE2 | SpellDescription$ Tap all creatures with toughness 2 or less. A:AB$ TapAll | Cost$ 3 U | ValidCards$ Creature.toughnessLE2 | SpellDescription$ Tap all creatures with toughness 2 or less.
A:AB$ DebuffAll | Cost$ 3 U | ValidCards$ Creature.Other | Keywords$ Flying | SpellDescription$ All other creatures lose flying until end of turn. A:AB$ AnimateAll | Cost$ 3 U | ValidCards$ Creature.Other | RemoveKeywords$ Flying | SpellDescription$ All other creatures lose flying until end of turn.
SVar:Picture:http://www.wizards.com/global/images/magic/general/thundercloud_elemental.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/thundercloud_elemental.jpg
Oracle:Flying\n{3}{U}: Tap all creatures with toughness 2 or less.\n{3}{U}: All other creatures lose flying until end of turn. Oracle:Flying\n{3}{U}: Tap all creatures with toughness 2 or less.\n{3}{U}: All other creatures lose flying until end of turn.

View File

@@ -1,8 +1,9 @@
Name:Whiteout Name:Whiteout
ManaCost:1 G ManaCost:1 G
Types:Instant Types:Instant
A:SP$ DebuffAll | Cost$ 1 G | ValidCards$ Creature | Keywords$ Flying | SpellDescription$ All creatures lose flying until end of turn. A:SP$ AnimateAll | Cost$ 1 G | ValidCards$ Creature | RemoveKeywords$ Flying | SpellDescription$ All creatures lose flying until end of turn.
A:AB$ ChangeZone | Cost$ Sac<1/Land.Snow/snow land> | ActivationZone$ Graveyard | Defined$ Self | Origin$ Graveyard | Destination$ Hand | SpellDescription$ Return CARDNAME from your graveyard to your hand. A:AB$ ChangeZone | Cost$ Sac<1/Land.Snow/snow land> | ActivationZone$ Graveyard | Defined$ Self | Origin$ Graveyard | Destination$ Hand | SpellDescription$ Return CARDNAME from your graveyard to your hand.
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/whiteout.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/whiteout.jpg
Oracle:All creatures lose flying until end of turn.\nSacrifice a snow land: Return Whiteout from your graveyard to your hand. Oracle:All creatures lose flying until end of turn.\nSacrifice a snow land: Return Whiteout from your graveyard to your hand.

View File

@@ -2,6 +2,6 @@ Name:Wind Shear
ManaCost:2 G ManaCost:2 G
Types:Instant Types:Instant
A:SP$ PumpAll | Cost$ 2 G | ValidCards$ Creature.withFlying+attacking | NumAtt$ -2 | NumDef$ -2 | SubAbility$ DBDebuff | IsCurse$ True | SpellDescription$ Attacking creatures with flying get -2/-2 and lose flying until end of turn. A:SP$ PumpAll | Cost$ 2 G | ValidCards$ Creature.withFlying+attacking | NumAtt$ -2 | NumDef$ -2 | SubAbility$ DBDebuff | IsCurse$ True | SpellDescription$ Attacking creatures with flying get -2/-2 and lose flying until end of turn.
SVar:DBDebuff:DB$ DebuffAll | ValidCards$ Creature.withFlying+attacking | Keywords$ Flying SVar:DBDebuff:DB$ AnimateAll | ValidCards$ Creature.withFlying+attacking | RemoveKeywords$ Flying
SVar:Picture:http://www.wizards.com/global/images/magic/general/wind_shear.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/wind_shear.jpg
Oracle:Attacking creatures with flying get -2/-2 and lose flying until end of turn. Oracle:Attacking creatures with flying get -2/-2 and lose flying until end of turn.