Skip to content

[M3C] Implement Desert Warfare - #13628

Open
balazskristof wants to merge 2 commits into
magefree:masterfrom
balazskristof:m3c-desert-warfare
Open

balazskristof wants to merge 2 commits into
magefree:masterfrom
balazskristof:m3c-desert-warfare

Conversation

@balazskristof

Copy link
Copy Markdown
Contributor

Implements Desert Warfare

It's messy.

@github-actions github-actions Bot added the cards label May 15, 2025
@Susucre

Susucre commented May 15, 2025

Copy link
Copy Markdown
Contributor

I would really appreciate some unit testing when adding such complex custom trigger.
Doesn't need to be exhaustif but some ideas of tests:

  • Sacrifice a Desert
  • Sacrifice a non-Desert
  • Have a Desert be destroyed from the battlefield
  • Discard a Desert
  • Discard a non-Desert
  • Mill some cards, including a few Deserts and at least one non-Desert

Comment thread Mage.Sets/src/mage/cards/d/DesertWarfare.java Outdated
Comment thread Mage.Sets/src/mage/cards/d/DesertWarfare.java Outdated
@balazskristof

Copy link
Copy Markdown
Contributor Author

Tests added, checks:

  • token generation
  • sacrifice (both in own and opponents' turn)
  • destroy
  • discard (both turns)
  • cycling (both turns)
  • mill (both turns)
  • "lands are Deserts" effects (in this case with Dune Chanter)

assertTokenCount(playerA, "Sand Warrior Token", 0);

setStopAt(2, PhaseStep.BEGIN_COMBAT);
execute();

@JayDi85 JayDi85 May 17, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Multiple executes in one test is outdated style with many limitations and bugs. Use real time waitStack and checkXXX commands to assert your game states in single test. For custom checks you can use runCode command (you can call assertXXX inside runCode too).
  2. Use setStrictMode true before each setStopAt or execute command — it will help to find missing choices (in non strict mode AI make that choices).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants