mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
* War's Toll - Fixed the implementation of the restriction effect.
This commit is contained in:
parent
79f5d7a358
commit
b2a8d4293a
4 changed files with 44 additions and 37 deletions
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
package mage.abilities;
|
||||
|
||||
import mage.constants.AbilityType;
|
||||
|
|
@ -12,7 +10,11 @@ import mage.constants.Zone;
|
|||
public abstract class EvasionAbility extends StaticAbility {
|
||||
|
||||
public EvasionAbility() {
|
||||
super(AbilityType.EVASION, Zone.ALL);
|
||||
this(Zone.ALL);
|
||||
}
|
||||
|
||||
public EvasionAbility(Zone zone) {
|
||||
super(AbilityType.EVASION, zone);
|
||||
}
|
||||
|
||||
public EvasionAbility(final EvasionAbility ability) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
|
||||
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.EvasionAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
||||
|
||||
import mage.constants.Zone;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -14,7 +11,11 @@ import mage.abilities.effects.Effect;
|
|||
public class SimpleEvasionAbility extends EvasionAbility {
|
||||
|
||||
public SimpleEvasionAbility(Effect effect) {
|
||||
super();
|
||||
this(effect, Zone.ALL);
|
||||
}
|
||||
|
||||
public SimpleEvasionAbility(Effect effect, Zone zone) {
|
||||
super(zone);
|
||||
if (effect != null) {
|
||||
this.addEffect(effect);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package mage.abilities.effects;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.EffectType;
|
||||
|
|
@ -7,8 +8,6 @@ import mage.constants.Outcome;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
|
|
@ -36,16 +35,17 @@ public abstract class RestrictionEffect extends ContinuousEffectImpl {
|
|||
|
||||
// canUseChooseDialogs -- restrict checks can be called by rules engine and by card info engine,
|
||||
// last one uses for info only and can't use dialogs, e.g. canUseChooseDialogs = false
|
||||
|
||||
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param attacker
|
||||
* @param defenderId id of planeswalker or player to attack, can be empty for general checks
|
||||
* @param defenderId id of planeswalker or player to attack, can be empty
|
||||
* for general checks
|
||||
* @param source
|
||||
* @param game
|
||||
* @param canUseChooseDialogs
|
||||
* @return
|
||||
*/
|
||||
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
|
||||
|
|
@ -61,6 +61,7 @@ public abstract class RestrictionEffect extends ContinuousEffectImpl {
|
|||
* @param blocker
|
||||
* @param source
|
||||
* @param game
|
||||
* @param canUseChooseDialogs
|
||||
* @return
|
||||
*/
|
||||
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
|
||||
|
|
@ -81,6 +82,7 @@ public abstract class RestrictionEffect extends ContinuousEffectImpl {
|
|||
* @param attacker
|
||||
* @param source
|
||||
* @param game
|
||||
* @param canUseChooseDialogs
|
||||
* @return true = block is ok false = block is not valid (human: back to
|
||||
* defining blockers, AI: remove blocker)
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue