mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Implemented Mtenda Lion
This commit is contained in:
parent
69b06087f2
commit
193182aa3d
3 changed files with 86 additions and 15 deletions
78
Mage.Sets/src/mage/cards/m/MtendaLion.java
Normal file
78
Mage.Sets/src/mage/cards/m/MtendaLion.java
Normal file
|
@ -0,0 +1,78 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.PreventCombatDamageBySourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class MtendaLion extends CardImpl {
|
||||
|
||||
public MtendaLion(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}");
|
||||
|
||||
this.subtype.add(SubType.CAT);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever Mtenda Lion attacks, defending player may pay {U}. If that player does, prevent all combat damage that would be dealt by Mtenda Lion this turn.
|
||||
this.addAbility(new AttacksTriggeredAbility(new MtendaLionEffect(), false));
|
||||
}
|
||||
|
||||
private MtendaLion(final MtendaLion card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MtendaLion copy() {
|
||||
return new MtendaLion(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MtendaLionEffect extends OneShotEffect {
|
||||
|
||||
MtendaLionEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "defending player may pay {U}. If that player does, " +
|
||||
"prevent all combat damage that would be dealt by {this} this turn.";
|
||||
}
|
||||
|
||||
private MtendaLionEffect(final MtendaLionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MtendaLionEffect copy() {
|
||||
return new MtendaLionEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(game.getCombat().getDefendingPlayerId(source.getSourceId(), game));
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Cost cost = new ManaCostsImpl("{U}");
|
||||
if (!player.chooseUse(outcome, "Pay {U} to prevent damage?", source, game)
|
||||
|| !cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
|
||||
return false;
|
||||
}
|
||||
game.addEffect(new PreventCombatDamageBySourceEffect(Duration.EndOfTurn), source);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -208,6 +208,7 @@ public final class Mirage extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Mountain", 346, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Mtenda Griffin", 28, Rarity.UNCOMMON, mage.cards.m.MtendaGriffin.class));
|
||||
cards.add(new SetCardInfo("Mtenda Herder", 29, Rarity.COMMON, mage.cards.m.MtendaHerder.class));
|
||||
cards.add(new SetCardInfo("Mtenda Lion", 128, Rarity.COMMON, mage.cards.m.MtendaLion.class));
|
||||
cards.add(new SetCardInfo("Mystical Tutor", 80, Rarity.UNCOMMON, mage.cards.m.MysticalTutor.class));
|
||||
cards.add(new SetCardInfo("Natural Balance", 231, Rarity.RARE, mage.cards.n.NaturalBalance.class));
|
||||
cards.add(new SetCardInfo("Nettletooth Djinn", 232, Rarity.UNCOMMON, mage.cards.n.NettletoothDjinn.class));
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
@ -9,33 +7,27 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class PreventCombatDamageBySourceEffect extends PreventionEffectImpl {
|
||||
|
||||
public PreventCombatDamageBySourceEffect(Duration duration) {
|
||||
super(duration, Integer.MAX_VALUE, true);
|
||||
staticText = "Prevent all combat damage that would be dealt by {this}" + duration.toString();
|
||||
super(duration, Integer.MAX_VALUE, true);
|
||||
staticText = "Prevent all combat damage that would be dealt by {this}" + duration.toString();
|
||||
}
|
||||
|
||||
public PreventCombatDamageBySourceEffect(final PreventCombatDamageBySourceEffect effect) {
|
||||
super(effect);
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PreventCombatDamageBySourceEffect copy() {
|
||||
return new PreventCombatDamageBySourceEffect(this);
|
||||
return new PreventCombatDamageBySourceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (super.applies(event, source, game)) {
|
||||
if (event.getSourceId().equals(source.getSourceId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return super.applies(event, source, game)
|
||||
&& event.getSourceId().equals(source.getSourceId());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue