Add Liliana's Contract

master
Ada Joule 2018-11-10 03:59:06 +07:00 committed by Melvin Zhang
parent 8494b8712d
commit 46ab35094d
2 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1,19 @@
[
new AtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer upkeepPlayer) {
return new MagicEvent(
permanent,
this,
"If PN controls four or more Demons with different names, PN wins the game."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final Collection<MagicPermanent> demons = event.getPlayer().getPermanents().findAll({ it.hasSubType(MagicSubType.Demon) });
if (demons.unique(false, { it.getName() }).size() >= 4) {
game.doAction(new LoseGameAction(event.getPlayer().getOpponent()));
}
}
}
]

View File

@ -4,7 +4,7 @@ value=2.500
rarity=R
type=Enchantment
cost={3}{B}{B}
ability=When SN enters the battlefield, you draw four cards and you lose 4 life.;\
At the beginning of your upkeep, if you control four or more Demons with different names, you win the game.
ability=When SN enters the battlefield, you draw four cards and you lose 4 life.
timing=enchantment
requires_groovy_code
oracle=When Liliana's Contract enters the battlefield, you draw four cards and you lose 4 life.\nAt the beginning of your upkeep, if you control four or more Demons with different names, you win the game.