mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Fixed issue #56. Tokens don't match enters the battlefield abilities because of missing attributes.
This commit is contained in:
parent
bb49122ef9
commit
6b42b9726c
2 changed files with 6 additions and 5 deletions
|
@ -28,14 +28,14 @@
|
|||
|
||||
package mage.game.permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.token.Token;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -45,10 +45,11 @@ public class PermanentToken extends PermanentImpl<PermanentToken> {
|
|||
|
||||
protected Token token;
|
||||
|
||||
public PermanentToken(Token token, UUID controllerId, String expansionSetCode) {
|
||||
public PermanentToken(Token token, UUID controllerId, String expansionSetCode, Game game) {
|
||||
super(controllerId, controllerId, token.getName());
|
||||
this.token = token;
|
||||
this.expansionSetCode = expansionSetCode;
|
||||
this.token = token;
|
||||
this.copyFromToken(this.token, game); // needed to have e.g. subtypes for entersTheBattlefield replacement effects
|
||||
}
|
||||
|
||||
public PermanentToken(final PermanentToken permanent) {
|
||||
|
|
|
@ -113,7 +113,7 @@ public class Token extends MageObjectImpl<Token> {
|
|||
if (!game.replaceEvent(event)) {
|
||||
amount = event.getAmount();
|
||||
for (int i = 0; i < amount; i++) {
|
||||
PermanentToken permanent = new PermanentToken(this, controllerId, setCode);
|
||||
PermanentToken permanent = new PermanentToken(this, controllerId, setCode, game);
|
||||
game.getState().addCard(permanent);
|
||||
game.getBattlefield().addPermanent(permanent);
|
||||
this.lastAddedTokenId = permanent.getId();
|
||||
|
|
Loading…
Reference in a new issue