mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Added some basic handling for tokens to the copyCard function (looks like it's used in places where this is necessary).
This commit is contained in:
@@ -153,9 +153,6 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
copy = CardFactory.getCard(CardDb.getCard(c), sa.getActivatingPlayer());
|
copy = CardFactory.getCard(CardDb.getCard(c), sa.getActivatingPlayer());
|
||||||
|
|
||||||
// when copying something stolen:
|
|
||||||
copy.setController(controller, 0);
|
|
||||||
|
|
||||||
copy.setToken(true);
|
copy.setToken(true);
|
||||||
copy.setCopiedToken(true);
|
copy.setCopiedToken(true);
|
||||||
} else { // isToken()
|
} else { // isToken()
|
||||||
@@ -164,8 +161,6 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
|
|||||||
copy.setName(c.getName());
|
copy.setName(c.getName());
|
||||||
copy.setImageKey(c.getImageKey());
|
copy.setImageKey(c.getImageKey());
|
||||||
|
|
||||||
copy.setController(controller, 0);
|
|
||||||
|
|
||||||
copy.setManaCost(c.getManaCost());
|
copy.setManaCost(c.getManaCost());
|
||||||
copy.setColor(c.getColor());
|
copy.setColor(c.getColor());
|
||||||
copy.setToken(true);
|
copy.setToken(true);
|
||||||
@@ -181,6 +176,9 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// when copying something stolen:
|
||||||
|
copy.setController(controller, 0);
|
||||||
|
|
||||||
// add keywords from sa
|
// add keywords from sa
|
||||||
for (final String kw : keywords) {
|
for (final String kw : keywords) {
|
||||||
copy.addIntrinsicKeyword(kw);
|
copy.addIntrinsicKeyword(kw);
|
||||||
|
|||||||
@@ -87,9 +87,26 @@ public class CardFactory {
|
|||||||
alternate = true;
|
alternate = true;
|
||||||
in.setState(CardCharacteristicName.Original);
|
in.setState(CardCharacteristicName.Original);
|
||||||
}
|
}
|
||||||
final Card out = assignNewId
|
Card out = null;
|
||||||
? getCard(CardDb.getCard(in), in.getOwner())
|
if (!in.isToken() || in.isCopiedToken()) {
|
||||||
: getCard(CardDb.getCard(in), in.getOwner(), in.getUniqueNumber());
|
out = assignNewId ? getCard(CardDb.getCard(in), in.getOwner()) : getCard(CardDb.getCard(in), in.getOwner(), in.getUniqueNumber());
|
||||||
|
} else { // token
|
||||||
|
out = assignNewId ? new Card(in.getGame().nextCardId()) : new Card(in.getUniqueNumber());
|
||||||
|
out = CardFactory.copyStats(in, in.getController());
|
||||||
|
|
||||||
|
out.setName(in.getName());
|
||||||
|
out.setImageKey(in.getImageKey());
|
||||||
|
out.setManaCost(in.getManaCost());
|
||||||
|
out.setColor(in.getColor());
|
||||||
|
out.setType(in.getType());
|
||||||
|
out.setBaseAttack(in.getBaseAttack());
|
||||||
|
out.setBaseDefense(in.getBaseDefense());
|
||||||
|
|
||||||
|
CardFactoryUtil.addAbilityFactoryAbilities(out);
|
||||||
|
for (String s : out.getStaticAbilityStrings()) {
|
||||||
|
out.addStaticAbility(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
CardFactory.copyCharacteristics(in, out);
|
CardFactory.copyCharacteristics(in, out);
|
||||||
|
|||||||
Reference in New Issue
Block a user