mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
Implemented Revival // Revenge
This commit is contained in:
parent
ddcb383486
commit
dab064696d
2 changed files with 88 additions and 2 deletions
86
Mage.Sets/src/mage/cards/r/RevivalRevenge.java
Normal file
86
Mage.Sets/src/mage/cards/r/RevivalRevenge.java
Normal file
|
@ -0,0 +1,86 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.SplitCard;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SpellAbilityType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class RevivalRevenge extends SplitCard {
|
||||
|
||||
private static final FilterCard filter
|
||||
= new FilterCreatureCard("creature card with converted mana cost 3 or less from your graveyard");
|
||||
|
||||
static {
|
||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, 4));
|
||||
}
|
||||
|
||||
public RevivalRevenge(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W/B}{W/B}", "{4}{W}{B}", SpellAbilityType.SPLIT);
|
||||
|
||||
// Revival
|
||||
// Return target creature card with converted mana cost 3 or less from your graveyard to the battlefield.
|
||||
this.getLeftHalfCard().getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
|
||||
this.getLeftHalfCard().getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter));
|
||||
|
||||
// Revenge
|
||||
// Double your life total. Target opponent loses half their life, rounded up.
|
||||
this.getRightHalfCard().getSpellAbility().addEffect(new RevivalRevengeEffect());
|
||||
this.getRightHalfCard().getSpellAbility().addTarget(new TargetOpponent());
|
||||
}
|
||||
|
||||
private RevivalRevenge(final RevivalRevenge card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RevivalRevenge copy() {
|
||||
return new RevivalRevenge(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RevivalRevengeEffect extends OneShotEffect {
|
||||
|
||||
RevivalRevengeEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Double your life total. Target opponent loses half their life, rounded up.";
|
||||
}
|
||||
|
||||
private RevivalRevengeEffect(final RevivalRevengeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RevivalRevengeEffect copy() {
|
||||
return new RevivalRevengeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (controller == null || player == null) {
|
||||
return false;
|
||||
}
|
||||
controller.gainLife(controller.getLife(), game, source);
|
||||
int life = player.getLife();
|
||||
player.loseLife(Math.floorDiv(life, 2) + (life % 2), game, false);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -4,7 +4,6 @@ import mage.cards.ExpansionSet;
|
|||
import mage.cards.repository.CardCriteria;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.cards.t.ThrashThreat;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SetType;
|
||||
|
@ -118,6 +117,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Rakdos, the Showstopper", 199, Rarity.MYTHIC, mage.cards.r.RakdosTheShowstopper.class));
|
||||
cards.add(new SetCardInfo("Rampage of the Clans", 134, Rarity.RARE, mage.cards.r.RampageOfTheClans.class));
|
||||
cards.add(new SetCardInfo("Ravager Wurm", 200, Rarity.MYTHIC, mage.cards.r.RavagerWurm.class));
|
||||
cards.add(new SetCardInfo("Revival // Revenge", 228, Rarity.RARE, mage.cards.r.RevivalRevenge.class));
|
||||
cards.add(new SetCardInfo("Rhythm of the Wild", 201, Rarity.UNCOMMON, mage.cards.r.RhythmOfTheWild.class));
|
||||
cards.add(new SetCardInfo("Rix Maadi Reveler", 109, Rarity.RARE, mage.cards.r.RixMaadiReveler.class));
|
||||
cards.add(new SetCardInfo("Sauroform Hybrid", 140, Rarity.COMMON, mage.cards.s.SauroformHybrid.class));
|
||||
|
@ -142,7 +142,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Teysa Karlov", 212, Rarity.RARE, mage.cards.t.TeysaKarlov.class));
|
||||
cards.add(new SetCardInfo("The Haunt of Hightower", 273, Rarity.MYTHIC, mage.cards.t.TheHauntOfHightower.class));
|
||||
cards.add(new SetCardInfo("Theater of Horrors", 213, Rarity.RARE, mage.cards.t.TheaterOfHorrors.class));
|
||||
cards.add(new SetCardInfo("Thrash // Threat", 229, Rarity.RARE, ThrashThreat.class));
|
||||
cards.add(new SetCardInfo("Thrash // Threat", 229, Rarity.RARE, mage.cards.t.ThrashThreat.class));
|
||||
cards.add(new SetCardInfo("Titanic Brawl", 146, Rarity.COMMON, mage.cards.t.TitanicBrawl.class));
|
||||
cards.add(new SetCardInfo("Tithe Taker", 27, Rarity.RARE, mage.cards.t.TitheTaker.class));
|
||||
cards.add(new SetCardInfo("Trollbred Guardian", 148, Rarity.UNCOMMON, mage.cards.t.TrollbredGuardian.class));
|
||||
|
|
Loading…
Reference in a new issue