mirror of
https://github.com/correl/mage.git
synced 2025-01-12 03:00:13 +00:00
[BRO] Fixed Gix's Command (first mode does not target)
This commit is contained in:
parent
69e4023fa6
commit
757d0740d2
1 changed files with 40 additions and 5 deletions
|
@ -8,7 +8,6 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.DestroyAllEffect;
|
||||
import mage.abilities.effects.common.SacrificeOpponentsEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
@ -23,9 +22,11 @@ import mage.filter.common.FilterCreaturePermanent;
|
|||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
import mage.filter.predicate.permanent.GreatestPowerControlledPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -52,10 +53,7 @@ public final class GixsCommand extends CardImpl {
|
|||
this.getSpellAbility().getModes().setMaxModes(2);
|
||||
|
||||
// * Put two +1/+1 counter on up to one creature. It gains lifelink until end of turn.
|
||||
this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2)));
|
||||
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(LifelinkAbility.getInstance())
|
||||
.setText("It gains lifelink until end of turn"));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1));
|
||||
this.getSpellAbility().addEffect(new GixsCommandCounterEffect());
|
||||
|
||||
// * Destroy each creature with power 2 or less.
|
||||
this.getSpellAbility().addMode(new Mode(new DestroyAllEffect(filter).setText("Destroy each creature with power 2 or less")));
|
||||
|
@ -77,6 +75,43 @@ public final class GixsCommand extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class GixsCommandCounterEffect extends OneShotEffect {
|
||||
|
||||
public GixsCommandCounterEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = "Put two +1/+1 counter on up to one creature. It gains lifelink until end of turn.";
|
||||
}
|
||||
|
||||
private GixsCommandCounterEffect(final GixsCommandCounterEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GixsCommandCounterEffect copy() {
|
||||
return new GixsCommandCounterEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1);
|
||||
target.setNotTarget(true);
|
||||
controller.chooseTarget(outcome, target, source, game);
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(2), source, game);
|
||||
GainAbilityTargetEffect effect = new GainAbilityTargetEffect(LifelinkAbility.getInstance());
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class GixsCommandReturnEffect extends OneShotEffect {
|
||||
|
||||
public GixsCommandReturnEffect() {
|
||||
|
|
Loading…
Reference in a new issue