mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -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
|
|
@ -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