StaticAbilityContinuous: fix AddType ChosenType

This commit is contained in:
Hans Mackowiak
2020-02-08 04:44:45 +00:00
committed by Michael Kamensky
parent 22a6a72f12
commit 55ed4c1bc0
2 changed files with 12 additions and 0 deletions

View File

@@ -343,6 +343,17 @@ public final class StaticAbilityContinuous {
} }
}); });
addTypes.addAll(newTypes); addTypes.addAll(newTypes);
addTypes = Lists.transform(addTypes, new Function<String, String>() {
@Override
public String apply(String input) {
if (hostCard.hasChosenType()) {
input = input.replaceAll("ChosenType", hostCard.getChosenType());
}
return input;
}
});
} }
if (layer == StaticAbilityLayer.TYPE && params.containsKey("RemoveType")) { if (layer == StaticAbilityLayer.TYPE && params.containsKey("RemoveType")) {

View File

@@ -2158,6 +2158,7 @@ public class GameSimulatorTest extends SimulationTestCase {
simGame.getPhaseHandler().devAdvanceToPhase(PhaseType.MAIN2); simGame.getPhaseHandler().devAdvanceToPhase(PhaseType.MAIN2);
assertEquals(21, simGame.getPlayers().get(0).getLife()); assertEquals(21, simGame.getPlayers().get(0).getLife());
assertEquals(true, simGoblin.isRed() && simGoblin.isBlack());
assertEquals(true, simGoblin.getType().hasSubtype("Zombie")); assertEquals(true, simGoblin.getType().hasSubtype("Zombie"));
} }
} }