1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-02 03:18:09 -09:00

Minor updates to cards from pull requests.

This commit is contained in:
LevelX2 2015-03-25 22:02:25 +01:00
parent 4e84a96833
commit 4d48ce60a8
5 changed files with 47 additions and 35 deletions
Mage.Sets/src/mage/sets

View file

@ -45,7 +45,6 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author JotaPeRL
@ -60,12 +59,11 @@ public class AnthemOfRakdos extends CardImpl {
Effect effect = new BoostTargetEffect(2, 0, Duration.EndOfTurn);
effect.setText("it gets +2/+0 until end of turn");
Ability ability = new AttacksCreatureYouControlTriggeredAbility(effect, false, true);
Effect dcEffect = new DamageControllerEffect(1);
dcEffect.setText("and {this} deals 1 damage to you");
ability.addEffect(dcEffect);
effect = new DamageControllerEffect(1);
effect.setText("and {this} deals 1 damage to you");
ability.addEffect(effect);
this.addAbility(ability);
// Hellbent - As long as you have no cards in hand, if a source you control would deal damage to a creature or player, it deals double that damage to that creature or player instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AnthemOfRakdosHellbentEffect()));
}
@ -98,8 +96,8 @@ class AnthemOfRakdosHellbentEffect extends ReplacementEffectImpl {
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE) ||
event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER);
return event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE)
|| event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER);
}
@Override
@ -116,6 +114,5 @@ class AnthemOfRakdosHellbentEffect extends ReplacementEffectImpl {
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
event.setAmount(event.getAmount() * 2);
return false;
}
}
}

View file

@ -44,6 +44,12 @@ import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect;
import mage.abilities.effects.common.combat.CantBeBlockedAttachedEffect;
import mage.abilities.keyword.ReachAbility;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
@ -65,7 +71,9 @@ public class TreetopBracers extends CardImpl {
this.addAbility(ability);
// Enchanted creature gets +1/+1 and can't be blocked except by creatures with flying.
this.addAbility(new TreetopBracersAbility());
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1,1, Duration.WhileOnBattlefield));
ability.addEffect(new TreetopBracersRestrictEffect());
this.addAbility(ability);
}
public TreetopBracers(final TreetopBracers card) {
@ -78,31 +86,37 @@ public class TreetopBracers extends CardImpl {
}
}
class TreetopBracersAbility extends StaticAbility {
private static FilterCreaturePermanent onlyFlyingCreatures = new FilterCreaturePermanent("except by creatures with flying");
static {
onlyFlyingCreatures.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
class TreetopBracersRestrictEffect extends RestrictionEffect {
public TreetopBracersRestrictEffect() {
super(Duration.WhileOnBattlefield);
staticText = "and can't be blocked except by creatures with flying";
}
public TreetopBracersAbility() {
super(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield));
Effect cantBeBlocked = new CantBeBlockedByCreaturesAttachedEffect(Duration.WhileOnBattlefield, onlyFlyingCreatures, AttachmentType.AURA);
cantBeBlocked.setText("and can't be blocked except by creatures with flying.");
addEffect(cantBeBlocked);
public TreetopBracersRestrictEffect(final TreetopBracersRestrictEffect effect) {
super(effect);
}
public TreetopBracersAbility(TreetopBracersAbility ability) {
super(ability);
}
/**
* Creates a fresh copy of this ability.
*
* @return A new copy of this ability.
*/
@Override
public TreetopBracersAbility copy() {
return new TreetopBracersAbility(this);
public boolean applies(Permanent permanent, Ability source, Game game) {
Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment != null && equipment.getAttachedTo() != null) {
Permanent equipped = game.getPermanent(equipment.getAttachedTo());
if (permanent.getId().equals(equipped.getId())) {
return true;
}
}
return false;
}
@Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
return blocker.getAbilities().contains(FlyingAbility.getInstance()) || blocker.getAbilities().contains(ReachAbility.getInstance());
}
@Override
public TreetopBracersRestrictEffect copy() {
return new TreetopBracersRestrictEffect(this);
}
}

View file

@ -62,6 +62,7 @@ public class TreetopSentinel extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from green
this.addAbility(new ProtectionAbility(filter));
}

View file

@ -45,11 +45,11 @@ import mage.filter.predicate.mageobject.AbilityPredicate;
/**
*
* @author Jason E. Wall
*
*/
public class TreetopScout extends CardImpl {
private static FilterCreaturePermanent onlyFlyingCreatures = new FilterCreaturePermanent("except by creatures with flying");
private final static FilterCreaturePermanent onlyFlyingCreatures = new FilterCreaturePermanent("except by creatures with flying");
static {
onlyFlyingCreatures.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));

View file

@ -44,11 +44,11 @@ import mage.filter.predicate.mageobject.AbilityPredicate;
/**
*
* @author Jason E. Wall
*
*/
public class TreetopRangers extends CardImpl {
private static FilterCreaturePermanent onlyFlyingCreatures = new FilterCreaturePermanent("except by creatures with flying");
private final static FilterCreaturePermanent onlyFlyingCreatures = new FilterCreaturePermanent("except by creatures with flying");
static {
onlyFlyingCreatures.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));