mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
Small changes and fixes
This commit is contained in:
parent
0e632acbb1
commit
9c779595b3
8 changed files with 52 additions and 37 deletions
|
|
@ -49,7 +49,7 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author anonymous
|
* @author Loki
|
||||||
*/
|
*/
|
||||||
public class SkeletalVampire extends CardImpl<SkeletalVampire> {
|
public class SkeletalVampire extends CardImpl<SkeletalVampire> {
|
||||||
|
|
||||||
|
|
@ -87,7 +87,7 @@ public class SkeletalVampire extends CardImpl<SkeletalVampire> {
|
||||||
|
|
||||||
class BatToken extends Token {
|
class BatToken extends Token {
|
||||||
BatToken() {
|
BatToken() {
|
||||||
super("Bat", "1/1 black Bat creature tokens with flying");
|
super("Bat", "1/1 black Bat creature token with flying");
|
||||||
cardType.add(CardType.CREATURE);
|
cardType.add(CardType.CREATURE);
|
||||||
color = ObjectColor.BLACK;
|
color = ObjectColor.BLACK;
|
||||||
subtype.add("Bat");
|
subtype.add("Bat");
|
||||||
|
|
|
||||||
|
|
@ -112,19 +112,19 @@ class VengefulArchonEffect extends PreventionEffectImpl<VengefulArchonEffect> {
|
||||||
if (!game.replaceEvent(preventEvent)) {
|
if (!game.replaceEvent(preventEvent)) {
|
||||||
Player player = game.getPlayer(source.getFirstTarget());
|
Player player = game.getPlayer(source.getFirstTarget());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
|
int damage = event.getAmount();
|
||||||
if (event.getAmount() >= this.amount) {
|
if (event.getAmount() >= this.amount) {
|
||||||
int damage = event.getAmount();
|
event.setAmount(damage - this.amount);
|
||||||
event.setAmount(event.getAmount() - amount);
|
damage = this.amount;
|
||||||
player.damage(amount, source.getSourceId(), game, false, true);
|
|
||||||
this.used = true;
|
this.used = true;
|
||||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getControllerId(), source.getId(), source.getControllerId(), damage));
|
|
||||||
} else {
|
} else {
|
||||||
int damage = event.getAmount();
|
|
||||||
event.setAmount(0);
|
event.setAmount(0);
|
||||||
amount -= damage;
|
this.amount -= damage;
|
||||||
player.damage(damage, source.getSourceId(), game, false, true);
|
|
||||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getControllerId(), source.getId(), source.getControllerId(), damage));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player.damage(damage, source.getSourceId(), game, false, true);
|
||||||
|
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE,
|
||||||
|
source.getControllerId(), source.getId(), source.getControllerId(), damage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -90,17 +90,23 @@ class SpikeshotGoblinEffect extends OneShotEffect<SpikeshotGoblinEffect> {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
|
||||||
if (sourcePermanent == null) {
|
if (sourcePermanent == null) {
|
||||||
sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD);
|
sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD);
|
||||||
}
|
}
|
||||||
if (sourcePermanent != null && permanent != null) {
|
if (sourcePermanent == null) {
|
||||||
permanent.damage(sourcePermanent.getPower().getValue(), source.getId(), game, true, false);
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int damage = sourcePermanent.getPower().getValue();
|
||||||
|
|
||||||
|
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||||
|
if (permanent != null) {
|
||||||
|
permanent.damage(damage, sourcePermanent.getId(), game, true, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Player player = game.getPlayer(source.getFirstTarget());
|
Player player = game.getPlayer(source.getFirstTarget());
|
||||||
if (sourcePermanent != null && player != null) {
|
if (player != null) {
|
||||||
player.damage(sourcePermanent.getPower().getValue(), source.getSourceId(), game, false, true);
|
player.damage(damage, sourcePermanent.getId(), game, false, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -101,9 +101,9 @@ class ReinforcedBulwarkEffect extends PreventionEffectImpl<ReinforcedBulwarkEffe
|
||||||
if (damage > 0) {
|
if (damage > 0) {
|
||||||
event.setAmount(damage - 1);
|
event.setAmount(damage - 1);
|
||||||
this.used = true;
|
this.used = true;
|
||||||
|
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE,
|
||||||
|
source.getControllerId(), source.getId(), source.getControllerId(), 1));
|
||||||
}
|
}
|
||||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE,
|
|
||||||
source.getControllerId(), source.getId(), source.getControllerId(), damage));
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,17 +87,23 @@ class SpikeshotElderEffect extends OneShotEffect<SpikeshotElderEffect> {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
|
||||||
if (sourcePermanent == null) {
|
if (sourcePermanent == null) {
|
||||||
sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD);
|
sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD);
|
||||||
}
|
}
|
||||||
if (sourcePermanent != null && permanent != null) {
|
if (sourcePermanent == null) {
|
||||||
permanent.damage(sourcePermanent.getPower().getValue(), source.getId(), game, true, false);
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int damage = sourcePermanent.getPower().getValue();
|
||||||
|
|
||||||
|
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||||
|
if (permanent != null) {
|
||||||
|
permanent.damage(damage, sourcePermanent.getId(), game, true, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Player player = game.getPlayer(source.getFirstTarget());
|
Player player = game.getPlayer(source.getFirstTarget());
|
||||||
if (sourcePermanent != null && player != null) {
|
if (player != null) {
|
||||||
player.damage(sourcePermanent.getPower().getValue(), source.getSourceId(), game, false, true);
|
player.damage(damage, sourcePermanent.getId(), game, false, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import java.util.UUID;
|
||||||
import mage.Constants.CardType;
|
import mage.Constants.CardType;
|
||||||
import mage.Constants.Outcome;
|
import mage.Constants.Outcome;
|
||||||
import mage.Constants.Rarity;
|
import mage.Constants.Rarity;
|
||||||
|
import mage.Constants.Zone;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
|
|
@ -88,11 +89,14 @@ class WingPunctureEffect extends OneShotEffect<WingPunctureEffect> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent sourceDamage = (Permanent) game.getPermanent(source.getFirstTarget());
|
Permanent sourcePermanent = game.getPermanent(source.getFirstTarget());
|
||||||
Permanent target = (Permanent) game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
if (sourcePermanent == null) {
|
||||||
|
game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
|
||||||
|
}
|
||||||
|
|
||||||
if (sourceDamage != null && target != null) {
|
Permanent targetPermanent = (Permanent) game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||||
target.damage(sourceDamage.getPower().getValue(), sourceDamage.getId(), game, true, false);
|
if (sourcePermanent != null && targetPermanent != null) {
|
||||||
|
targetPermanent.damage(sourcePermanent.getPower().getValue(), sourcePermanent.getId(), game, true, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,9 @@
|
||||||
package mage.sets.shardsofalara;
|
package mage.sets.shardsofalara;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.Constants;
|
|
||||||
import mage.Constants.CardType;
|
import mage.Constants.CardType;
|
||||||
import mage.Constants.Rarity;
|
import mage.Constants.Rarity;
|
||||||
|
import mage.Constants.Zone;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
|
@ -53,18 +52,16 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
*/
|
*/
|
||||||
public class AngelsHerald extends CardImpl<AngelsHerald> {
|
public class AngelsHerald extends CardImpl<AngelsHerald> {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("Empyrial Archangel");
|
private static final FilterCard filter = new FilterCard("card named Empyrial Archangel");
|
||||||
|
|
||||||
private static final FilterControlledCreaturePermanent filterGreen = new FilterControlledCreaturePermanent("a green creature");
|
private static final FilterControlledCreaturePermanent filterGreen = new FilterControlledCreaturePermanent("a green creature");
|
||||||
private static final FilterControlledCreaturePermanent filterWhite = new FilterControlledCreaturePermanent("a white creature");
|
private static final FilterControlledCreaturePermanent filterWhite = new FilterControlledCreaturePermanent("a white creature");
|
||||||
private static final FilterControlledCreaturePermanent filterBlue = new FilterControlledCreaturePermanent("a blue creature");
|
private static final FilterControlledCreaturePermanent filterBlue = new FilterControlledCreaturePermanent("a blue creature");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
filter.add(new NamePredicate("Empyrial Archangel"));
|
||||||
filterGreen.add(new ColorPredicate(ObjectColor.GREEN));
|
filterGreen.add(new ColorPredicate(ObjectColor.GREEN));
|
||||||
filterWhite.add(new ColorPredicate(ObjectColor.WHITE));
|
filterWhite.add(new ColorPredicate(ObjectColor.WHITE));
|
||||||
filterBlue.add(new ColorPredicate(ObjectColor.BLUE));
|
filterBlue.add(new ColorPredicate(ObjectColor.BLUE));
|
||||||
|
|
||||||
filter.add(new NamePredicate("Empyrial Archangel"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AngelsHerald(UUID ownerId) {
|
public AngelsHerald(UUID ownerId) {
|
||||||
|
|
@ -77,12 +74,14 @@ public class AngelsHerald extends CardImpl<AngelsHerald> {
|
||||||
this.power = new MageInt(1);
|
this.power = new MageInt(1);
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// {2}{W}, {tap}, Sacrifice a green creature, a white creature, and a blue creature: Search your library for a card named Empyrial Archangel and put it onto the battlefield. Then shuffle your library.
|
// {2}{W}, {tap}, Sacrifice a green creature, a white creature, and a blue creature:
|
||||||
TargetCardInLibrary target = new TargetCardInLibrary(1, 1, new FilterCard(filter));
|
// Search your library for a card named Empyrial Archangel and put it onto the battlefield. Then shuffle your library.
|
||||||
Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(target), new ManaCostsImpl("{2}{W}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||||
|
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(1, 1, new FilterCard(filter))),
|
||||||
|
new ManaCostsImpl("{2}{W}"));
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterWhite, false)));
|
|
||||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterGreen, false)));
|
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterGreen, false)));
|
||||||
|
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterWhite, false)));
|
||||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterBlue, false)));
|
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterBlue, false)));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ import mage.target.TargetSpell;
|
||||||
*/
|
*/
|
||||||
public class Dispel extends CardImpl<Dispel> {
|
public class Dispel extends CardImpl<Dispel> {
|
||||||
|
|
||||||
private static FilterSpell filter = new FilterSpell("instant spell");
|
private static final FilterSpell filter = new FilterSpell("instant spell");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(new CardTypePredicate(CardType.INSTANT));
|
filter.add(new CardTypePredicate(CardType.INSTANT));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue