forked from External/mage
Change all line endings to LF
This commit is contained in:
parent
13d9a56b7a
commit
430ae503c7
17069 changed files with 1263498 additions and 1263497 deletions
|
|
@ -1,77 +1,77 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.EvasionAbility;
|
||||
import mage.abilities.MageSingleton;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* 702.13. Intimidate #
|
||||
*
|
||||
* 702.13a Intimidate is an evasion ability.
|
||||
*
|
||||
* 702.13b A creature with intimidate can't be blocked except by artifact creatures
|
||||
* and/or creatures that share a color with it. (See rule 509, "Declare Blockers Step.") #
|
||||
*
|
||||
* 702.13c Multiple instances of intimidate on the same creature are redundant.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class IntimidateAbility extends EvasionAbility implements MageSingleton {
|
||||
private static final IntimidateAbility fInstance = new IntimidateAbility();
|
||||
|
||||
public static IntimidateAbility getInstance() {
|
||||
return fInstance;
|
||||
}
|
||||
|
||||
private IntimidateAbility() {
|
||||
this.addEffect(new IntimidateEffect());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Intimidate";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IntimidateAbility copy() {
|
||||
return fInstance;
|
||||
}
|
||||
}
|
||||
|
||||
class IntimidateEffect extends RestrictionEffect implements MageSingleton {
|
||||
public IntimidateEffect() {
|
||||
super(Duration.EndOfGame);
|
||||
}
|
||||
|
||||
public IntimidateEffect(final IntimidateEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
return permanent.getAbilities().containsKey(IntimidateAbility.getInstance().getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
boolean result = false;
|
||||
if (blocker.getCardType().contains(CardType.ARTIFACT) && (blocker.getCardType().contains(CardType.CREATURE))) {
|
||||
result = true;
|
||||
}
|
||||
if (attacker.getColor(game).shares(blocker.getColor(game))) {
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IntimidateEffect copy() {
|
||||
return new IntimidateEffect(this);
|
||||
}
|
||||
}
|
||||
package mage.abilities.keyword;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.EvasionAbility;
|
||||
import mage.abilities.MageSingleton;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* 702.13. Intimidate #
|
||||
*
|
||||
* 702.13a Intimidate is an evasion ability.
|
||||
*
|
||||
* 702.13b A creature with intimidate can't be blocked except by artifact creatures
|
||||
* and/or creatures that share a color with it. (See rule 509, "Declare Blockers Step.") #
|
||||
*
|
||||
* 702.13c Multiple instances of intimidate on the same creature are redundant.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class IntimidateAbility extends EvasionAbility implements MageSingleton {
|
||||
private static final IntimidateAbility fInstance = new IntimidateAbility();
|
||||
|
||||
public static IntimidateAbility getInstance() {
|
||||
return fInstance;
|
||||
}
|
||||
|
||||
private IntimidateAbility() {
|
||||
this.addEffect(new IntimidateEffect());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Intimidate";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IntimidateAbility copy() {
|
||||
return fInstance;
|
||||
}
|
||||
}
|
||||
|
||||
class IntimidateEffect extends RestrictionEffect implements MageSingleton {
|
||||
public IntimidateEffect() {
|
||||
super(Duration.EndOfGame);
|
||||
}
|
||||
|
||||
public IntimidateEffect(final IntimidateEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
return permanent.getAbilities().containsKey(IntimidateAbility.getInstance().getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
boolean result = false;
|
||||
if (blocker.getCardType().contains(CardType.ARTIFACT) && (blocker.getCardType().contains(CardType.CREATURE))) {
|
||||
result = true;
|
||||
}
|
||||
if (attacker.getColor(game).shares(blocker.getColor(game))) {
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IntimidateEffect copy() {
|
||||
return new IntimidateEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue