Steve Cotton 0f6a94f2a7 Unit tests for [drains], [poison] and [slow], with apply_to=opponent
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's
been fixed.

Here `apply_to=opponent` means that the weapon special gives the opponent the
ability, 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 to
see it it's `unpoisonable`, `undrainable` etc. It also checks the wrong unit to
see 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 the
`GENERIC_UNIT_TEST` macro that starts the leaders next to each other, ready
to 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 650f70405ff.
My thoughts on testing the others are:
* [firststrike]'s test is in 650f70405ff.
* [drains], [poison] and [slow] are tested here.
* [petrify] ends combat, it's also not exposed in simulate_combat's stats.
* [plague] triggers after combat ends.
2022-04-19 15:27:49 +02:00
2022-04-01 21:43:46 -05:00
2022-04-05 10:34:19 +10:00
2022-04-17 03:29:07 +03:00
2022-04-17 03:29:07 +03:00
2022-04-16 19:34:19 -05:00
2022-03-21 13:26:17 -05:00
2022-03-09 15:01:37 -06:00
2022-04-16 19:35:46 -05:00
2022-03-09 15:01:37 -06:00
2022-03-09 15:01:37 -06:00
2022-04-16 19:35:46 -05:00
2022-03-17 10:02:52 -04:00
2022-04-16 19:35:46 -05:00
2022-03-12 13:51:03 -06:00
2022-03-12 13:47:46 -06:00
2022-03-12 13:47:46 -06:00

License: GPL v2

About

The Battle for Wesnoth is an Open Source, turn-based tactical strategy game with a high fantasy theme, featuring both singleplayer and online/hotseat multiplayer combat. Fight a desperate battle to reclaim the throne of Wesnoth, or take hand in any number of other adventures.

Community

The official Battle for Wesnoth Forums: https://forums.wesnoth.org/

Discord: https://discord.gg/battleforwesnoth

IRC: https://wiki.wesnoth.org/Support#IRC

Twitter: https://twitter.com/Wesnoth

Steam forums: https://steamcommunity.com/app/599390/discussions/

Installing

Wesnoth can be played on Windows, macOS, and Linux, and can be installed using:

Additionally, Wesnoth is available for iOS and Android.

To build the game from source, see INSTALL for instructions.

Contributing

Wesnoth is most in need of skilled C++ developers (C++14 and later), however there are things that nearly anyone can help with from simpler tasks in C++, the Lua and WML used for content scripting, Python used by various external tools, and even things like play testing and giving feedback on updated campaigns. Additionally, Wesnoth lacks art for a variety of unit animations - anyone who would be interested in lending a hand updating existing unit sprites or creating animations should take a look at the Art Forum as well as contact our current art director.

See also: CONTRIBUTING

For any questions, the best place to start is to simply join Wesnoth's forums, Discord, or IRC and start asking!

Donations

Donations can be sent via Liberapay as well as when downloading through itch.io. All money donated is used to pay for project expenses such as server rent and art commissions, and is very much appreciated.

License

All source code is licensed under the GNU GPL v2+. Most art and music is also licensed under the GNU GPL v2+, however new contributions are now licensed under the Creative Commons BY-SA v4.0. For more detailed information on Wesnoth's licensing, see the wiki:

https://wiki.wesnoth.org/Wesnoth:Copyrights

More Information

For extensive documentation about all aspects of the game, see the official Battle for Wesnoth web site:

https://www.wesnoth.org/ https://wiki.wesnoth.org/

A (translated) description of how to play the game can be found in doc/manual/manual.*.html, or online at:

https://wiki.wesnoth.org/WesnothManual

For information on creating your own maps, scenarios, and other content, see:

https://wiki.wesnoth.org/Create

Description
韦诺之战
Readme 10 GiB
Languages
INI 51.6%
C++ 35.9%
Lua 5.7%
Python 4.3%
Emacs Lisp 1%
Other 1.1%