TokenEffect: make the Kalitas + Anointed Possession working

This commit is contained in:
Hanmac
2017-07-13 17:07:20 +00:00
parent 02ba6bc889
commit 690dba8549
3 changed files with 10 additions and 11 deletions

View File

@@ -185,6 +185,13 @@ public class TokenEffect extends SpellAbilityEffect {
final Card host = sa.getHostCard();
final SpellAbility root = sa.getRootAbility();
readParameters(sa);
// Cause of the Token Effect, in general it should be this
// but if its a Replacement Effect, it might be something else or null
SpellAbility cause = sa;
if (root.isReplacementAbility() && root.hasReplacingObject("Cause")) {
cause = (SpellAbility)root.getReplacingObject("Cause");
}
String cost = "";
@@ -266,7 +273,7 @@ public class TokenEffect extends SpellAbilityEffect {
final String imageName = imageNames.get(MyRandom.getRandom().nextInt(imageNames.size()));
final CardFactory.TokenInfo tokenInfo = new CardFactory.TokenInfo(substitutedName, imageName,
cost, substitutedTypes, this.tokenKeywords, finalPower, finalToughness);
final List<Card> tokens = CardFactory.makeToken(tokenInfo, controller);
final List<Card> tokens = CardFactory.makeToken(tokenInfo, controller, cause != null);
// Grant rule changes
if (this.tokenHiddenKeywords != null) {

View File

@@ -796,10 +796,6 @@ public class CardFactory {
return new TokenInfo(tokenInfo[0], imageName, manaCost, types, keywords, power, toughness);
}
}
public static List<Card> makeToken(final TokenInfo tokenInfo, final Player controller) {
return makeToken(tokenInfo, controller, true);
}
public static List<Card> makeToken(final TokenInfo tokenInfo, final Player controller, final boolean applyMultiplier) {
final List<Card> list = Lists.newArrayList();