mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Rewrote Choose Blockers effect to ContinuousRuleModifyingEffectImpl
This commit is contained in:
parent
c5399460b9
commit
5d126afc18
1 changed files with 11 additions and 19 deletions
|
@ -33,7 +33,7 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.ReplacementEffectImpl;
|
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||||
import mage.abilities.effects.common.GainLifeEffect;
|
import mage.abilities.effects.common.GainLifeEffect;
|
||||||
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
||||||
import mage.abilities.effects.common.combat.BlocksIfAbleAllEffect;
|
import mage.abilities.effects.common.combat.BlocksIfAbleAllEffect;
|
||||||
|
@ -71,7 +71,7 @@ public class BrutalHordechief extends CardImpl {
|
||||||
|
|
||||||
// {3}{R/W}{R/W}: Creatures your opponents control block this turn if able, and you choose how those creatures block.
|
// {3}{R/W}{R/W}: Creatures your opponents control block this turn if able, and you choose how those creatures block.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BlocksIfAbleAllEffect(filter, Duration.EndOfTurn), new ManaCostsImpl("{3}{R/W}{R/W}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BlocksIfAbleAllEffect(filter, Duration.EndOfTurn), new ManaCostsImpl("{3}{R/W}{R/W}"));
|
||||||
ability.addEffect(new BrutalHordechiefReplacementEffect());
|
ability.addEffect(new BrutalHordechiefChooseBlockersEffect());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,20 +123,20 @@ class BrutalHordechiefTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class BrutalHordechiefReplacementEffect extends ReplacementEffectImpl {
|
class BrutalHordechiefChooseBlockersEffect extends ContinuousRuleModifyingEffectImpl { // TODO: reverse the resolution order in case of effect multiples
|
||||||
|
|
||||||
public BrutalHordechiefReplacementEffect() {
|
public BrutalHordechiefChooseBlockersEffect() {
|
||||||
super(Duration.EndOfCombat, Outcome.Benefit);
|
super(Duration.EndOfTurn, Outcome.Benefit, false, false);
|
||||||
staticText = ", and you choose how those creatures block";
|
staticText = "You choose which creatures block this turn and how those creatures block";
|
||||||
}
|
}
|
||||||
|
|
||||||
public BrutalHordechiefReplacementEffect(final BrutalHordechiefReplacementEffect effect) {
|
public BrutalHordechiefChooseBlockersEffect(final BrutalHordechiefChooseBlockersEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BrutalHordechiefReplacementEffect copy() {
|
public BrutalHordechiefChooseBlockersEffect copy() {
|
||||||
return new BrutalHordechiefReplacementEffect(this);
|
return new BrutalHordechiefChooseBlockersEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -153,15 +153,7 @@ class BrutalHordechiefReplacementEffect extends ReplacementEffectImpl {
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
Player blockController = game.getPlayer(source.getControllerId());
|
Player blockController = game.getPlayer(source.getControllerId());
|
||||||
if (blockController != null) {
|
if (blockController != null) {
|
||||||
return true;
|
game.informPlayers(source.getSourceObject(game).getIdName() + " applies");
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
|
||||||
Player blockController = game.getPlayer(source.getControllerId());
|
|
||||||
if (blockController != null) {
|
|
||||||
game.getCombat().selectBlockers(blockController, game);
|
game.getCombat().selectBlockers(blockController, game);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue