mirror of
https://github.com/magefree/mage.git
synced 2026-01-19 18:00:01 -08:00
* Sentinel - Fixed target handling.
This commit is contained in:
parent
e9f58d20a5
commit
7e04e65e6f
1 changed files with 7 additions and 9 deletions
|
|
@ -33,7 +33,6 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.continuous.SetToughnessSourceEffect;
|
import mage.abilities.effects.common.continuous.SetToughnessSourceEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
|
@ -66,13 +65,12 @@ public class Sentinel extends CardImpl {
|
||||||
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking or blocked by Sentinel");
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking or blocked by Sentinel");
|
||||||
filter.add(Predicates.or(new BlockedByIdPredicate(this.getId()),
|
filter.add(Predicates.or(new BlockedByIdPredicate(this.getId()),
|
||||||
new BlockingAttackerIdPredicate(this.getId())));
|
new BlockingAttackerIdPredicate(this.getId())));
|
||||||
// 0: Change Sentinel's base toughness to 1 plus the power of target creature blocking or blocked by Sentinel. (This effect lasts indefinitely.)
|
// 0: Change Sentinel's base toughness to 1 plus the power of target creature blocking or blocked by Sentinel. (This effect lasts indefinitely.)
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SentinelEffect(), new GenericManaCost(0));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SentinelEffect(), new GenericManaCost(0));
|
||||||
ability.addTarget(null);
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Sentinel(final Sentinel card) {
|
public Sentinel(final Sentinel card) {
|
||||||
|
|
@ -86,21 +84,21 @@ public class Sentinel extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
class SentinelEffect extends OneShotEffect {
|
class SentinelEffect extends OneShotEffect {
|
||||||
|
|
||||||
public SentinelEffect() {
|
public SentinelEffect() {
|
||||||
super(Outcome.Detriment);
|
super(Outcome.Detriment);
|
||||||
this.staticText = "Change {this}'s base toughness to 1 plus the power of target creature blocking or blocked by {this}. <i>(This effect lasts indefinitely.)</i>";
|
this.staticText = "Change {this}'s base toughness to 1 plus the power of target creature blocking or blocked by {this}. <i>(This effect lasts indefinitely.)</i>";
|
||||||
}
|
}
|
||||||
|
|
||||||
public SentinelEffect(final SentinelEffect effect) {
|
public SentinelEffect(final SentinelEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SentinelEffect copy() {
|
public SentinelEffect copy() {
|
||||||
return new SentinelEffect(this);
|
return new SentinelEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue