Partially reverts 6a21fdc6750a8342846ef18248517808316c4118
Fixes#5643Fixes#7238
There's a bunch of global things that can be accessed either via global
pointers in the `resource` namespace, or via `display::get_singleton()`. The
singleton and these global pointers are set up in `play_controller::init`,
however there's a section where things are available via the global pointers
but the `display` singleton doesn't exist yet. During that time, checking
whether an ability is active can crash the game.
Removing the global pointers is a good goal, but detouring through a GUI class
to access the data causes its own problems.
The "has already been confirmed valid by both callers" comment is replaced with
an assert, because there's currently at least three callers.
Units still using this in their descriptions will have the player-visible
header change from "Special Notes:" to "Special Notes (1.14-style, please
update to the new list format)".
The SPECIAL_NOTES macro was originally removed early in the 1.17 dev cycle.
That removal was reverted and postponed in the roadmap until Jan 2023, on the
grounds that it's a lot easier to test 1.17 when the big add-ons from 1.16 can
run on it.
In 1.16, UMC that hasn't upgraded yet already has a cosmetic bug - the help
pages of units still using the {SPECIAL_NOTES} macro will include duplicate
notes (assuming the expected usage of {SPECIAL_NOTES} as a heading in
[unit_type]description=, which is followed by old-style notes). These are minor
cosmetic bugs, which are expected to be removed as UMC gets updated.
That leaves the issue of what to do with the deprecated macro in 1.18. My
feeling is that we can easily continue to support the macro, albeit with the
cosmetic bug, so we should keep it for 1.18. However we could make it clearer
that the duplicated notes should be removed from the UMC.
This also removes some docs about NOTE_*s, those macros have already been
removed after being deprecated in 3568b5ff66ece00ec09f40059e552123f356d962.
Covers the math for [attack]add=, [attack]divide=, [attack]multiply= and
[attack]sub=. The behavior is the same in 1.16.
* 5 + 2 = 7
* 5 - 3 = 2
* 5 + 2 - 3 = 2. Yes it does, that's half of why this unit test exists ...
* 5 + 2 + 3 = 8
* 5 + 3 + 2 = 8
* 5 + 2 - (-3) = 7
* 3 * 3.34 = 10
* 3 * 3.334 = 9. ... and that's the other half of why this unit test exists.
* WML: Adjust the weapon selection logic for [kill]
The previous logic simply did not make sense, especially for the secondary weapon.
For example, it would ignore the secondary weapon specification if the primary weapon was not found on the secondary unit, which does not make any sense.
The cases that this changes are:
- There is a secondary unit and a primary attack, but no matching attack was found. Previously it would use the default, now it pretends that attack exists.
- There is a secondary attack specified, but no primary attack, either because it was unspecified or because it didn't match any attack on the secondary unit
In both these cases, the animation runs as if a matching attack exists, rather than using no attack and choosing the default animation.
Adjust the log level too.
* Escape < and > even if only one of them exists
In python negative index counts from the end, so without this change or another solution
"example with only < one side" would be converted to
"example with only < one sid>example with only < one side"
* Escape < and > even if found multiple times