Merge branch 'bloodyCardTraits' into 'master'

CardTaits: make cardtraits inside LKI has the same id's as the in the original

See merge request core-developers/forge!197
This commit is contained in:
Michael Kamensky
2018-02-14 03:28:25 +00:00
36 changed files with 290 additions and 266 deletions

View File

@@ -2466,7 +2466,7 @@ public class ComputerUtilCombat {
for (SpellAbility sa : original.getSpellAbilities()) {
if (sa.getApi() == ApiType.SetState && ComputerUtilCost.canPayCost(sa, original.getController())) {
Card transformed = CardUtil.getLKICopy(original);
transformed.getCurrentState().copyFrom(original, original.getAlternateState());
transformed.getCurrentState().copyFrom(original.getAlternateState(), true);
transformed.updateStateForView();
return transformed;
}

View File

@@ -88,9 +88,9 @@ public class ChooseCardNameAi extends SpellAbilityAi {
Card copy = CardUtil.getLKICopy(card);
// for calcing i need only one split side
if (isOther) {
copy.getCurrentState().copyFrom(card, card.getState(CardStateName.RightSplit));
copy.getCurrentState().copyFrom(card.getState(CardStateName.RightSplit), true);
} else {
copy.getCurrentState().copyFrom(card, card.getState(CardStateName.LeftSplit));
copy.getCurrentState().copyFrom(card.getState(CardStateName.LeftSplit), true);
}
copy.updateStateForView();

View File

@@ -167,7 +167,7 @@ public class SetStateAi extends SpellAbilityAi {
// need a copy for evaluation
Card transformed = CardUtil.getLKICopy(card);
transformed.getCurrentState().copyFrom(card, card.getAlternateState());
transformed.getCurrentState().copyFrom(card.getAlternateState(), true);
transformed.updateStateForView();
// TODO: compareCards assumes that a creature will transform into a creature. Need to improve this

View File

@@ -29,7 +29,6 @@ import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType;
import forge.game.player.Player;
import forge.game.player.RegisteredPlayer;
import forge.game.spellability.AbilityActivated;
import forge.game.spellability.SpellAbility;
import forge.game.spellability.SpellAbilityRestriction;
import forge.game.spellability.SpellAbilityStackInstance;
@@ -263,15 +262,8 @@ public class GameCopier {
newCard.addStaticAbility(stAb);
}
for (SpellAbility sa : c.getSpellAbilities()) {
SpellAbility saCopy;
if (sa instanceof AbilityActivated) {
saCopy = ((AbilityActivated)sa).getCopy();
} else {
saCopy = sa.copy();
}
SpellAbility saCopy = sa.copy(newCard, true);
if (saCopy != null) {
saCopy.setHostCard(newCard);
newCard.addSpellAbility(saCopy);
} else {
System.err.println(sa.toString());