Card.fromPaperCard crashes on a specialize face
Describe the bug A MakeCard effect with "Name$ ChosenName" causes Forge to crash if the ChosenName is one of faces of a specialize card.
To Reproduce Steps to reproduce the behavior:
- Begin a Vanguard match using Maelstrom Archangel Avatar
- Attack and deal combat damage with either Gut, Devious Fanatic or Gut, Zealous Fanatic (as both of these specialize faces have unique mana costs not found on any other card)
- At end of combat, Maelstrom Archangel Avatar triggers; as your attacker is the only card with its mana cost, the randomly-chosen card with that cost will be another copy of the same card
- Forge crashes
Expected behavior The token should be created without the game crashing.
Desktop (please complete the following information):
- OS: Windows
- Version 1.6.60-SNAPSHOT-01-02
Additional context
Crash log:
java.lang.NullPointerException: Cannot invoke "forge.item.IPaperCard.getRules()" because "cp" is null at forge.game.card.CardFactory.getCard(CardFactory.java:223) at forge.game.card.CardFactory.getCard(CardFactory.java:220) at forge.game.card.Card.fromPaperCard(Card.java:7139) at forge.game.ability.effects.MakeCardEffect.resolve(MakeCardEffect.java:133) at forge.game.spellability.AbilitySub.resolve(AbilitySub.java:105) at forge.game.ability.AbilityUtils.resolveApiAbility(AbilityUtils.java:1454) at forge.game.ability.AbilityUtils.resolveSubAbilities(AbilityUtils.java:1438) at forge.game.ability.AbilityUtils.resolveApiAbility(AbilityUtils.java:1460) at forge.game.ability.AbilityUtils.resolve(AbilityUtils.java:1422) at forge.game.ability.effects.RepeatEachEffect.resolve(RepeatEachEffect.java:109) at forge.game.spellability.AbilitySub.resolve(AbilitySub.java:105) at forge.game.ability.AbilityUtils.resolveApiAbility(AbilityUtils.java:1454) at forge.game.ability.AbilityUtils.resolve(AbilityUtils.java:1422) at forge.player.HumanPlaySpellAbility.playAbility(HumanPlaySpellAbility.java:193) at forge.player.HumanPlay.playSpellAbilityNoStack(HumanPlay.java:180) at forge.player.PlayerControllerHuman.playSpellAbilityNoStack(PlayerControllerHuman.java:325) at forge.game.trigger.WrappedAbility.resolve(WrappedAbility.java:493) at forge.game.ability.AbilityUtils.resolveApiAbility(AbilityUtils.java:1454) at forge.game.ability.AbilityUtils.resolve(AbilityUtils.java:1422) at forge.game.zone.MagicStack.resolveStack(MagicStack.java:553) at forge.game.phase.PhaseHandler.startFirstTurn(PhaseHandler.java:1152) at forge.game.GameAction.startGame(GameAction.java:2106) at forge.game.Match.startGame(Match.java:90) at forge.gamemodes.match.HostedMatch$2.run(HostedMatch.java:255) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1623)
This crash also occurs when attempting to add a specialized face to the game directly via the dev tools, or when choosing a specialize face for Killer Cosplay. While testing, I found a non-crash oddity as well: choosing the back face of a dual-faced card (modal or transforming) for Killer Cosplay causes the choose-card-name menu to pop up again until you choose one that isn't a back face.
This issue has not been updated in a while and has now been marked as stale. Stale messages will be auto closed.
So I see a couple of possible options, but I'm not sure which is best from a rules standpoint... possibly we need to do both of these:
- don't allow other faces to be chosen randomly by ChooseCardNameEffect (line 139)
- figure out how to wire MakeCardEffect so we can "make" specialize faces
Right now we can add, say, "Arlinn, Embraced by the Moon" via dev mode. So it seems like we should be able to also wire up specialize faces?