mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
fixed embalm and eternalize sometimes giving the token to the wrong player
This commit is contained in:
parent
ab632ef1d0
commit
9b51694908
2 changed files with 41 additions and 39 deletions
|
@ -105,23 +105,24 @@ class EmbalmEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && card != null) {
|
||||
EmptyToken token = new EmptyToken();
|
||||
CardUtil.copyTo(token).from(card); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer)
|
||||
token.getColor(game).setColor(ObjectColor.WHITE);
|
||||
if (!token.hasSubtype(SubType.ZOMBIE, game)) {
|
||||
token.getSubtype(game).add(0, SubType.ZOMBIE);
|
||||
}
|
||||
token.getManaCost().clear();
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.EMBALMED_CREATURE, token.getId(), source.getSourceId(), controller.getId()));
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId(), false, false, null);
|
||||
// Probably it makes sense to remove also the Embalm ability (it's not shown on the token cards).
|
||||
// Also it can never get active or? But it's not mentioned in the reminder text.
|
||||
return true;
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
Player controller = game.getPlayer(card.getOwnerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
EmptyToken token = new EmptyToken();
|
||||
CardUtil.copyTo(token).from(card); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer)
|
||||
token.getColor(game).setColor(ObjectColor.WHITE);
|
||||
if (!token.hasSubtype(SubType.ZOMBIE, game)) {
|
||||
token.getSubtype(game).add(0, SubType.ZOMBIE);
|
||||
}
|
||||
token.getManaCost().clear();
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.EMBALMED_CREATURE, token.getId(), source.getSourceId(), controller.getId()));
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), controller.getId(), false, false, null);
|
||||
// Probably it makes sense to remove also the Embalm ability (it's not shown on the token cards).
|
||||
// Also it can never get active or? But it's not mentioned in the reminder text.
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -59,11 +59,11 @@ public class EternalizeAbility extends ActivatedAbilityImpl {
|
|||
this.timing = TimingRule.SORCERY;
|
||||
setRule(cost, card);
|
||||
}
|
||||
|
||||
|
||||
public EternalizeAbility(Cost cost, Card card, String rule) {
|
||||
this(cost, card);
|
||||
this.rule = rule;
|
||||
}
|
||||
}
|
||||
|
||||
public EternalizeAbility(final EternalizeAbility ability) {
|
||||
super(ability);
|
||||
|
@ -110,26 +110,27 @@ class EternalizeEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && card != null) {
|
||||
EmptyToken token = new EmptyToken();
|
||||
CardUtil.copyTo(token).from(card); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer)
|
||||
token.getColor(game).setColor(ObjectColor.BLACK);
|
||||
if (!token.hasSubtype(SubType.ZOMBIE, game)) {
|
||||
token.getSubtype(game).add(0, SubType.ZOMBIE);
|
||||
}
|
||||
token.getManaCost().clear();
|
||||
token.removePTCDA();
|
||||
token.getPower().modifyBaseValue(4);
|
||||
token.getToughness().modifyBaseValue(4);
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.ETERNALIZED_CREATURE, token.getId(), source.getSourceId(), controller.getId()));
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId(), false, false, null);
|
||||
// Probably it makes sense to remove also the Eternalize ability (it's not shown on the token cards).
|
||||
// Also it can never get active or? But it's not mentioned in the reminder text.
|
||||
return true;
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
Player controller = game.getPlayer(card.getOwnerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
EmptyToken token = new EmptyToken();
|
||||
CardUtil.copyTo(token).from(card); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer)
|
||||
token.getColor(game).setColor(ObjectColor.BLACK);
|
||||
if (!token.hasSubtype(SubType.ZOMBIE, game)) {
|
||||
token.getSubtype(game).add(0, SubType.ZOMBIE);
|
||||
}
|
||||
token.getManaCost().clear();
|
||||
token.removePTCDA();
|
||||
token.getPower().modifyBaseValue(4);
|
||||
token.getToughness().modifyBaseValue(4);
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.ETERNALIZED_CREATURE, token.getId(), source.getSourceId(), controller.getId()));
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), controller.getId(), false, false, null);
|
||||
// Probably it makes sense to remove also the Eternalize ability (it's not shown on the token cards).
|
||||
// Also it can never get active or? But it's not mentioned in the reminder text.
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue