mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +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.common.SimpleActivatedAbility;
|
||||
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.LoseLifeTargetEffect;
|
||||
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.
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -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() {
|
||||
super(Duration.EndOfCombat, Outcome.Benefit);
|
||||
staticText = ", and you choose how those creatures block";
|
||||
public BrutalHordechiefChooseBlockersEffect() {
|
||||
super(Duration.EndOfTurn, Outcome.Benefit, false, false);
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrutalHordechiefReplacementEffect copy() {
|
||||
return new BrutalHordechiefReplacementEffect(this);
|
||||
public BrutalHordechiefChooseBlockersEffect copy() {
|
||||
return new BrutalHordechiefChooseBlockersEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -153,18 +153,10 @@ class BrutalHordechiefReplacementEffect extends ReplacementEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Player blockController = game.getPlayer(source.getControllerId());
|
||||
if (blockController != null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player blockController = game.getPlayer(source.getControllerId());
|
||||
if (blockController != null) {
|
||||
game.informPlayers(source.getSourceObject(game).getIdName() + " applies");
|
||||
game.getCombat().selectBlockers(blockController, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue