magefree / magefree/mage

battle token caused error

Open
#10,609 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
2.4k
Forks
940
Avg merge
2d 12h
Merged PRs (30d)
160

Description

Last counter removed from a token copy of a battle and cause this error.

Game exception occurred:

java.lang.IllegalArgumentException: Wrong code usage: getSecondFaceSpellAbility can only be used for double faced card (main side), broken card: Invasion of Innistrad
Server version: 1.4.52-V4-beta7 (build: 2023-07-07 12:15)
Stack trace:
mage.cards.CardImpl.getSecondFaceSpellAbility(CardImpl.java:640)
mage.abilities.common.SiegeDefeatedEffect.apply(SiegeAbility.java:108)
mage.abilities.AbilityImpl.resolveMode(AbilityImpl.java:199)
mage.abilities.AbilityImpl.resolve(AbilityImpl.java:183)
mage.abilities.TriggeredAbilityImpl.resolve(TriggeredAbilityImpl.java:152)
mage.game.stack.StackAbility.resolve(StackAbility.java:87)
mage.game.GameImpl.resolve(GameImpl.java:1691)
mage.game.GameImpl.playPriority(GameImpl.java:1616)
mage.game.turn.Step.priority(Step.java:65)
mage.game.turn.CombatDamageStep.priority(CombatDamageStep.java:31)
mage.game.turn.Phase.playStep(Phase.java:184)
mage.game.turn.Phase.play(Phase.java:89)
mage.game.turn.Turn.play(Turn.java:125)
mage.game.GameImpl.playTurn(GameImpl.java:1088)
mage.game.GameImpl.play(GameImpl.java:997)
mage.game.GameImpl.start(GameImpl.java:973)
mage.server.game.GameWorker.call(GameWorker.java:34)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with mage.abilities.common.SiegeAbility.java at line 108 and mage.cards.CardImpl.java at line 640, following the stack trace from the defeated battle token scenario. Reproduce the case where the last counter is removed from a token copy of a battle; done means that scenario no longer raises the reported IllegalArgumentException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.