mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Convert Lich to Script
This commit is contained in:
@@ -769,32 +769,6 @@ public final class GameActionUtil {
|
||||
return;
|
||||
}
|
||||
|
||||
final List<Card> playerLiches = player.getCardsIn(ZoneType.Battlefield, "Lich");
|
||||
|
||||
for (final Card lich : playerLiches) {
|
||||
final SpellAbility ability = new Ability(lich, "0") {
|
||||
@Override
|
||||
public void resolve() {
|
||||
for (int i = 0; i < damage; i++) {
|
||||
List<Card> nonTokens = CardLists.filter(player.getCardsIn(ZoneType.Battlefield), Presets.NON_TOKEN);
|
||||
if (nonTokens.size() == 0) {
|
||||
player.loseConditionMet(GameLossReason.SpellEffect, lich.getName());
|
||||
} else {
|
||||
player.sacrificePermanent("Select a permanent to sacrifice", nonTokens);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append(lich.getName()).append(" - ").append(lich.getController());
|
||||
sb.append(" sacrifices ").append(damage).append(" nontoken permanents.");
|
||||
ability.setStackDescription(sb.toString());
|
||||
|
||||
Singletons.getModel().getGame().getStack().addSimultaneousStackEntry(ability);
|
||||
|
||||
}
|
||||
|
||||
c.getDamageHistory().registerDamage(player);
|
||||
|
||||
// Play the Life Loss sound
|
||||
|
||||
@@ -7,12 +7,10 @@ import com.google.common.collect.Iterables;
|
||||
import forge.Card;
|
||||
|
||||
import forge.CardLists;
|
||||
import forge.Command;
|
||||
import forge.Singletons;
|
||||
import forge.card.spellability.Ability;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.control.input.Input;
|
||||
import forge.game.GameLossReason;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.gui.GuiChoose;
|
||||
@@ -122,58 +120,5 @@ class CardFactoryEnchantments {
|
||||
nightSoil.setAfterPayMana(soilTarget);
|
||||
card.addSpellAbility(nightSoil);
|
||||
} // *************** END ************ END **************************
|
||||
|
||||
// *************** START *********** START **************************
|
||||
else if (cardName.equals("Lich")) {
|
||||
final SpellAbility loseAllLife = new Ability(card, "0") {
|
||||
@Override
|
||||
public void resolve() {
|
||||
final int life = card.getController().getLife();
|
||||
card.getController().loseLife(life);
|
||||
}
|
||||
};
|
||||
|
||||
final Command intoPlay = new Command() {
|
||||
private static final long serialVersionUID = 1337794055075168785L;
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append(cardName).append(" - ").append(card.getController());
|
||||
sb.append(" loses life equal to his or her life total.");
|
||||
loseAllLife.setStackDescription(sb.toString());
|
||||
|
||||
Singletons.getModel().getGame().getStack().addSimultaneousStackEntry(loseAllLife);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
final SpellAbility loseGame = new Ability(card, "0") {
|
||||
@Override
|
||||
public void resolve() {
|
||||
card.getController().loseConditionMet(GameLossReason.SpellEffect, card.getName());
|
||||
}
|
||||
};
|
||||
|
||||
final Command toGrave = new Command() {
|
||||
private static final long serialVersionUID = 5863295714122376047L;
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append(cardName).append(" - ").append(card.getController());
|
||||
sb.append("loses the game.");
|
||||
loseGame.setStackDescription(sb.toString());
|
||||
|
||||
Singletons.getModel().getGame().getStack().addSimultaneousStackEntry(loseGame);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
card.addComesIntoPlayCommand(intoPlay);
|
||||
card.addDestroyCommand(toGrave);
|
||||
} // *************** END ************ END **************************
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user