mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Implemented Liliana's Contract
This commit is contained in:
parent
eadbf86b33
commit
35010e1e2c
2 changed files with 90 additions and 0 deletions
89
Mage.Sets/src/mage/cards/l/LilianasContract.java
Normal file
89
Mage.Sets/src/mage/cards/l/LilianasContract.java
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
package mage.cards.l;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
||||
import mage.abilities.effects.common.WinGameSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class LilianasContract extends CardImpl {
|
||||
|
||||
public LilianasContract(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}");
|
||||
|
||||
// When Liliana's Contract enters the battlefield, you draw four cards and you lose 4 life.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(
|
||||
new DrawCardSourceControllerEffect(4)
|
||||
.setText("you draw four cards")
|
||||
);
|
||||
ability.addEffect(
|
||||
new LoseLifeSourceControllerEffect(4)
|
||||
.setText("and you lose 4 life")
|
||||
);
|
||||
this.addAbility(ability);
|
||||
|
||||
// At the beginning of your upkeep, if you control four or more Demons with different names, you win the game.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(
|
||||
new WinGameSourceControllerEffect(),
|
||||
TargetController.YOU, false
|
||||
), LilianasContractCondition.instance,
|
||||
"At the beginning of your upkeep, "
|
||||
+ "if you control four or more Demons with different names, "
|
||||
+ "you win the game."
|
||||
));
|
||||
}
|
||||
|
||||
public LilianasContract(final LilianasContract card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LilianasContract copy() {
|
||||
return new LilianasContract(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum LilianasContractCondition implements Condition {
|
||||
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Set<String> demonNames = new HashSet();
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
||||
if (permanent == null
|
||||
|| !permanent.getControllerId().equals(source.getControllerId())
|
||||
|| !permanent.hasSubtype(SubType.DEMON, game)) {
|
||||
continue;
|
||||
}
|
||||
demonNames.add(permanent.getName());
|
||||
if (demonNames.size() > 3) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "you control four or more Demons with different names";
|
||||
}
|
||||
}
|
||||
|
|
@ -129,6 +129,7 @@ public final class CoreSet2019 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Lich's Caress", 105, Rarity.COMMON, mage.cards.l.LichsCaress.class));
|
||||
cards.add(new SetCardInfo("Lightning Mare", 151, Rarity.UNCOMMON, mage.cards.l.LightningMare.class));
|
||||
cards.add(new SetCardInfo("Lightning Strike", 152, Rarity.UNCOMMON, mage.cards.l.LightningStrike.class));
|
||||
cards.add(new SetCardInfo("Liliana's Contract", 107, Rarity.RARE, mage.cards.l.LilianasContract.class));
|
||||
cards.add(new SetCardInfo("Liliana's Spoils", 294, Rarity.RARE, mage.cards.l.LilianasSpoils.class));
|
||||
cards.add(new SetCardInfo("Liliana, the Necromancer", 291, Rarity.MYTHIC, mage.cards.l.LilianaTheNecromancer.class));
|
||||
cards.add(new SetCardInfo("Llanowar Elves", 314, Rarity.COMMON, mage.cards.l.LlanowarElves.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue