mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-18 23:49:17 +00:00

A new test of what happens when a unit with only a ranged weapon fights a unit with only a melee weapon. This commit is just the test, it depends on the engine fix in a previous commit. This only tests the filtering so far. There should probably be another additional test to check what the combat results are, however that would need an ability such as the Deep Elves' Stardust that passively affects the amount of damage taken. It can't be tested with Slows, as that needs the defender to hit with a weapon first.
This directory contains both the scenarios used by C++ unit tests and those which are WML unit tests. For the C++ unit tests, it is recommended to reuse the same scenario file as much as possible and just inject WML into it. Injection can be done by adding a config object containing event code and then registering that manually for game_events. WML unit tests are self-contained scenario files to test a specific area of WML. They can be implemented with the GENERIC_UNIT_TEST macro.