mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 07:22:03 -08:00
[VOW] Implemented Savior of Ollenbock
This commit is contained in:
parent
8a3baf6779
commit
51e88b8e19
4 changed files with 157 additions and 2 deletions
121
Mage.Sets/src/mage/cards/s/SaviorOfOllenbock.java
Normal file
121
Mage.Sets/src/mage/cards/s/SaviorOfOllenbock.java
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetForSourceEffect;
|
||||
import mage.abilities.keyword.TrainingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInGraveyardOrBattlefield;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SaviorOfOllenbock extends CardImpl {
|
||||
|
||||
public SaviorOfOllenbock(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{W}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.SOLDIER);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Training
|
||||
this.addAbility(new TrainingAbility());
|
||||
|
||||
// Whenever Savior of Ollenbock trains, exile up to one other target creature from the battlefield or creature card from a graveyard.
|
||||
this.addAbility(new SaviorOfOllenbockTriggeredAbility());
|
||||
|
||||
// When Savior of Ollenbock leaves the battlefield, put the exiled cards onto the battlefield under their owners' control.
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(new SaviorOfOllenbockEffect(), false));
|
||||
}
|
||||
|
||||
private SaviorOfOllenbock(final SaviorOfOllenbock card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SaviorOfOllenbock copy() {
|
||||
return new SaviorOfOllenbock(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SaviorOfOllenbockTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
SaviorOfOllenbockTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new ExileTargetForSourceEffect());
|
||||
this.addTarget(new TargetCardInGraveyardOrBattlefield(
|
||||
0, 1,
|
||||
StaticFilters.FILTER_CARD_CREATURE,
|
||||
StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE
|
||||
));
|
||||
}
|
||||
|
||||
private SaviorOfOllenbockTriggeredAbility(final SaviorOfOllenbockTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SaviorOfOllenbockTriggeredAbility copy() {
|
||||
return new SaviorOfOllenbockTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.TRAINED_CREATURE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return event.getTargetId().equals(getSourceId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever {this} trains, exile up to one other target " +
|
||||
"creature from the battlefield or creature card from a graveyard.";
|
||||
}
|
||||
}
|
||||
|
||||
class SaviorOfOllenbockEffect extends OneShotEffect {
|
||||
|
||||
SaviorOfOllenbockEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "put the exiled cards onto the battlefield under their owners' control";
|
||||
}
|
||||
|
||||
private SaviorOfOllenbockEffect(final SaviorOfOllenbockEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SaviorOfOllenbockEffect copy() {
|
||||
return new SaviorOfOllenbockEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source));
|
||||
return player != null && exileZone != null && !exileZone.isEmpty() && player.moveCards(
|
||||
exileZone.getCards(game), Zone.BATTLEFIELD, source, game,
|
||||
false, false, true, null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -259,6 +259,7 @@ public final class InnistradCrimsonVow extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Sanctify", 33, Rarity.COMMON, mage.cards.s.Sanctify.class));
|
||||
cards.add(new SetCardInfo("Sanguine Statuette", 177, Rarity.UNCOMMON, mage.cards.s.SanguineStatuette.class));
|
||||
cards.add(new SetCardInfo("Savage Packmate", 234, Rarity.UNCOMMON, mage.cards.s.SavagePackmate.class));
|
||||
cards.add(new SetCardInfo("Savior of Ollenbock", 34, Rarity.MYTHIC, mage.cards.s.SaviorOfOllenbock.class));
|
||||
cards.add(new SetCardInfo("Sawblade Slinger", 217, Rarity.UNCOMMON, mage.cards.s.SawbladeSlinger.class));
|
||||
cards.add(new SetCardInfo("Scattered Thoughts", 74, Rarity.COMMON, mage.cards.s.ScatteredThoughts.class));
|
||||
cards.add(new SetCardInfo("Screaming Swarm", 75, Rarity.UNCOMMON, mage.cards.s.ScreamingSwarm.class));
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ package mage.abilities.keyword;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
|
|
@ -18,7 +20,7 @@ import java.util.Objects;
|
|||
public class TrainingAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public TrainingAbility() {
|
||||
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
|
||||
super(Zone.BATTLEFIELD, new TrainingAbilityEffect());
|
||||
}
|
||||
|
||||
private TrainingAbility(final TrainingAbility ability) {
|
||||
|
|
@ -58,3 +60,33 @@ public class TrainingAbility extends TriggeredAbilityImpl {
|
|||
"with greater power, put a +1/+1 counter on this creature.)</i>";
|
||||
}
|
||||
}
|
||||
|
||||
class TrainingAbilityEffect extends OneShotEffect {
|
||||
|
||||
TrainingAbilityEffect() {
|
||||
super(Outcome.Neutral);
|
||||
}
|
||||
|
||||
private TrainingAbilityEffect(final TrainingAbilityEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrainingAbilityEffect copy() {
|
||||
return new TrainingAbilityEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(), source, game);
|
||||
game.fireEvent(GameEvent.getEvent(
|
||||
GameEvent.EventType.TRAINED_CREATURE,
|
||||
source.getSourceId(), source, source.getControllerId()
|
||||
));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -394,6 +394,7 @@ public class GameEvent implements Serializable {
|
|||
EVOLVED_CREATURE,
|
||||
EMBALMED_CREATURE,
|
||||
ETERNALIZED_CREATURE,
|
||||
TRAINED_CREATURE,
|
||||
ATTACH, ATTACHED,
|
||||
UNATTACH, UNATTACHED,
|
||||
/* ATTACH, ATTACHED,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue