Unit tests for [drains], [poison] and [slow], with apply_to=opponent #6625
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Slightly different to PR #6582, which was the 1.16 version of this. The five
lines that were labelled
preserving known bug
are changed to test that it'sbeen fixed. Once #6582 is approved, I'm intending to merge this too.
Here
apply_to=opponent
means that the weapon special gives the opponent theability, the unit that should get poisoned or slowed is the unit that has the
weapon special.
There's a known bug in 1.16, that
apply_to=opponent
check the wrong unit tosee it it's
unpoisonable
,undrainable
etc. It also checks the wrong unit tosee if it's already poisoned or slowed, so a battle between two units that both
have reverse-poison results in at most one being poisoned.
Most of the credit for this is Newfrenchy's, as he's already written a fix
and a WML based test. This commit uses a Lua test instead to test more
combinations of statuses.
This adds a
COMMON_KEEP_A_B_UNIT_TEST
macro, which is a counterpart to theGENERIC_UNIT_TEST
macro that starts the leaders next to each other, readyto attack. The
A_B
is because I'm planning a multiple-side variant too.There's no test for [petrify], as simulate_combat doesn't provide a stat for it.
This tests only 3 of the 6 abilities whose behavior changed in 650f704.
My thoughts on testing the others are: