mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Converted Karma to script
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
Name:Karma
|
||||
ManaCost:2 W W
|
||||
Types:Enchantment
|
||||
Text:At the beginning of each player's upkeep, Karma deals damage to that player equal to the number of Swamps he or she controls.
|
||||
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Player | TriggerZones$ Battlefield | Execute$ TrigDamage | TriggerDescription$ At the beginning of each player's upkeep, CARDNAME deals damage to that player equal to the number of Swamps he or she controls.
|
||||
SVar:TrigDamage:AB$ DealDamage | Cost$ 0 | Defined$ TriggeredPlayer | NumDmg$ X | References$ X
|
||||
SVar:X:Count$Valid Swamp.ActivePlayerCtrl
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/karma.jpg
|
||||
Oracle:At the beginning of each player's upkeep, Karma deals damage to that player equal to the number of Swamps he or she controls.
|
||||
|
||||
@@ -94,7 +94,6 @@ public class Upkeep extends Phase {
|
||||
Upkeep.upkeepDemonicHordes(game);
|
||||
Upkeep.upkeepTangleWire(game);
|
||||
|
||||
Upkeep.upkeepKarma(game);
|
||||
Upkeep.upkeepOathOfDruids(game);
|
||||
Upkeep.upkeepOathOfGhouls(game);
|
||||
Upkeep.upkeepSuspend(game);
|
||||
@@ -875,46 +874,6 @@ public class Upkeep extends Phase {
|
||||
}
|
||||
} // Oath of Ghouls
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* upkeepKarma.
|
||||
* </p>
|
||||
*/
|
||||
private static void upkeepKarma(final GameState game) {
|
||||
final Player player = game.getPhaseHandler().getPlayerTurn();
|
||||
final List<Card> karmas =
|
||||
CardLists.filter(game.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals("Karma"));
|
||||
final List<Card> swamps = CardLists.getType(player.getCardsIn(ZoneType.Battlefield), "Swamp");
|
||||
|
||||
// determine how much damage to deal the current player
|
||||
final int damage = swamps.size();
|
||||
|
||||
// if there are 1 or more Karmas on the
|
||||
// battlefield have each of them deal damage.
|
||||
if (0 < karmas.size()) {
|
||||
for (final Card karma : karmas) {
|
||||
final Ability ability = new Ability(karma, ManaCost.ZERO) {
|
||||
@Override
|
||||
public void resolve() {
|
||||
if (damage > 0) {
|
||||
player.addDamage(damage, karma);
|
||||
}
|
||||
}
|
||||
}; // Ability
|
||||
if (damage > 0) {
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("Karma deals ").append(damage).append(" damage to ").append(player);
|
||||
ability.setStackDescription(sb.toString());
|
||||
ability.setDescription(sb.toString());
|
||||
ability.setActivatingPlayer(karma.getController());
|
||||
|
||||
game.getStack().addSimultaneousStackEntry(ability);
|
||||
}
|
||||
}
|
||||
} // if
|
||||
} // upkeepKarma()
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* upkeepPowerSurge.
|
||||
|
||||
Reference in New Issue
Block a user