mirror of
https://github.com/correl/mage.git
synced 2024-12-27 11:07:39 +00:00
Made Halls of Mist a blanket effect instead of granting one to each creature
This commit is contained in:
parent
571a8af65a
commit
f05b805611
1 changed files with 8 additions and 11 deletions
|
@ -34,14 +34,12 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.effects.RestrictionEffect;
|
import mage.abilities.effects.RestrictionEffect;
|
||||||
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
|
||||||
import mage.abilities.keyword.CumulativeUpkeepAbility;
|
import mage.abilities.keyword.CumulativeUpkeepAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.StaticFilters;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.watchers.common.AttackedLastTurnWatcher;
|
import mage.watchers.common.AttackedLastTurnWatcher;
|
||||||
|
@ -59,9 +57,7 @@ public class HallsOfMist extends CardImpl {
|
||||||
this.addAbility(new CumulativeUpkeepAbility(new GenericManaCost(1)));
|
this.addAbility(new CumulativeUpkeepAbility(new GenericManaCost(1)));
|
||||||
|
|
||||||
// Creatures that attacked during their controller's last turn can't attack.
|
// Creatures that attacked during their controller's last turn can't attack.
|
||||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackIfAttackedLastTurnEffect());
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackIfAttackedLastTurnAllEffect()), new AttackedLastTurnWatcher());
|
||||||
ability.addWatcher(new AttackedLastTurnWatcher());
|
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false).setText("Creatures that attacked during their controller's last turn can't attack")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public HallsOfMist(final HallsOfMist card) {
|
public HallsOfMist(final HallsOfMist card) {
|
||||||
|
@ -74,19 +70,20 @@ public class HallsOfMist extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CantAttackIfAttackedLastTurnEffect extends RestrictionEffect {
|
class CantAttackIfAttackedLastTurnAllEffect extends RestrictionEffect {
|
||||||
|
|
||||||
public CantAttackIfAttackedLastTurnEffect() {
|
public CantAttackIfAttackedLastTurnAllEffect() {
|
||||||
super(Duration.WhileOnBattlefield);
|
super(Duration.WhileOnBattlefield);
|
||||||
|
this.staticText = "Creatures that attacked during their controller's last turn can't attack";
|
||||||
}
|
}
|
||||||
|
|
||||||
public CantAttackIfAttackedLastTurnEffect(final CantAttackIfAttackedLastTurnEffect effect) {
|
public CantAttackIfAttackedLastTurnAllEffect(final CantAttackIfAttackedLastTurnAllEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||||
return permanent.getId().equals(source.getSourceId());
|
return permanent.isCreature();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -103,8 +100,8 @@ class CantAttackIfAttackedLastTurnEffect extends RestrictionEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CantAttackIfAttackedLastTurnEffect copy() {
|
public CantAttackIfAttackedLastTurnAllEffect copy() {
|
||||||
return new CantAttackIfAttackedLastTurnEffect(this);
|
return new CantAttackIfAttackedLastTurnAllEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue