Add Fraying Omnipotence

master
Ada Joule 2018-11-09 03:54:27 +07:00 committed by Melvin Zhang
parent 363489b22a
commit 74c17bf066
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,33 @@
def choice = new MagicTargetChoice("a creature to sacrifice");
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Each player loses half their life, then discards half the cards in their hand, then sacrifices half the creatures they control. Round up each time."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
for (final MagicPlayer player : game.getAPNAP()) {
final int life = (int)((player.getLife()+1) / 2);
final int discard = (int)((player.getHandSize()+1) / 2);
final int sacrifice = (int)((player.getNrOfPermanents(MagicType.Creature)+1) / 2);
game.doAction(new ChangeLifeAction(player, -life));
game.addEvent(new MagicDiscardEvent(event.getSource(), player, discard));
sacrifice.times {
game.addEvent(new MagicSacrificePermanentEvent(
event.getSource(),
player,
choice
));
}
}
}
}
]

View File

@ -4,6 +4,6 @@ value=2.500
rarity=R
type=Sorcery
cost={3}{B}{B}
effect=Each player loses half their life, then discards half the cards in their hand, then sacrifices half the creatures they control. Round up each time.
timing=main
requires_groovy_code
oracle=Each player loses half their life, then discards half the cards in their hand, then sacrifices half the creatures they control. Round up each time.