mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 20:59:14 -08:00
CreateTokenTargetEffect added
This commit is contained in:
parent
dbdcf7e924
commit
996779c237
2 changed files with 70 additions and 22 deletions
|
|
@ -38,6 +38,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
|
|
@ -62,7 +63,7 @@ public class HuntedLammasu extends CardImpl<HuntedLammasu> {
|
|||
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// When Hunted Lammasu enters the battlefield, put a 4/4 black Horror creature token onto the battlefield under target opponent's control.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new HuntedLammasuEffect(), false);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new CreateTokenTargetEffect(new HorrorToken()), false);
|
||||
Target target = new TargetOpponent();
|
||||
target.setRequired(true);
|
||||
ability.addTarget(target);
|
||||
|
|
@ -79,27 +80,6 @@ public class HuntedLammasu extends CardImpl<HuntedLammasu> {
|
|||
}
|
||||
}
|
||||
|
||||
class HuntedLammasuEffect extends OneShotEffect<HuntedLammasuEffect> {
|
||||
HuntedLammasuEffect() {
|
||||
super(Constants.Outcome.PutCreatureInPlay);
|
||||
staticText = "put a 4/4 black Horror creature token onto the battlefield under target opponent's control";
|
||||
}
|
||||
|
||||
HuntedLammasuEffect(final HuntedLammasuEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return new HorrorToken().putOntoBattlefield(1, game, source.getSourceId(), targetPointer.getFirst(source));
|
||||
}
|
||||
|
||||
@Override
|
||||
public HuntedLammasuEffect copy() {
|
||||
return new HuntedLammasuEffect();
|
||||
}
|
||||
}
|
||||
|
||||
class HorrorToken extends Token {
|
||||
HorrorToken() {
|
||||
super("Horror", "a 4/4 black Horror creature token");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue