78937 Commits

Author SHA1 Message Date
Steve Cotton
c560b0efab Add attribute apply_to_vision to [effect]apply_to=movement
When processing [effect]apply_to=movement, if apply_to_vision is 'yes'
(which is the default) then the vision points will change by the same amount.
Previously, it sometimes affected vision and sometimes didn't; for most cases
where it makes a difference, I expect it to be a change from unanticipated
behavior to expected behavior.

Please refer to the new unit test added in this commit for more detailed docs;
that test is also a rough draft for the Wiki update needed when this merges.

The reason it sometimes affected vision was that the special value of -1 vision
points was interpreted as "use the value of the max movement points instead".
The special value of -1 is still supported and frequently used, and refactor that
is out of scope for this commit - it's easy to check when the code path changed
in this commit is used, however it's considerably more complex to find all
routes that create a unit with vision set to -1.

I'm expecting one add-on, Rebirth In Nature, to need a large update for this;
as well as a trivial change needed to the Add Creature Pack.

There are several mods that have their own handling for vision, recalculate the
values frequently, and are expected to continue working as before, as they'll
just overwrite any changes that the engine makes.
* Proper Flying Mod / Proper Vision Mod
* LotI
* Blessed Altar Mod
* Shards Era's `CALCULATE_WEAPONS_ONLY` macro
* Castle of Evil Spirit

Rebirth In Nature is an RPG-style campaign that expects the player's unit to
have vision separated from movement along with right-click menus that change
the character's movement, this will probably need `apply_to_vision=no` in
many places. OTOH, its `item_id=mobility` uses `apply_to=movement` followed by
`apply_to=vision` to implement in 1.14 what this change will make default
behavior in 1.16.

There are a few sharpshooter units which have vision better than their
movement. If given a buff which boosts their movement, this will give
them a buff to vision too; likely a change towards expected behavior.
* Archaic Era's Royal Ranger
* Ageless Era's Royal Ranger and Dwarvish Forest Sniper
* Eastern Europe at War's Yacht and Great Yacht
* Era of More Units's Lone Wolf
* Southernerns has several sharpshooters
* WWII Era has several sharpshooters
* War of Dominions has some guard towers with very low movement

Silver Age has abilities that modify vision based on time-of-day, but unlike
the Proper Flying Mod and LotI these are done by adding and removing objects
that add or subtract one vision point, these should be unaffected by this
change. Unrelated to that, it declares values for `[unit_type]vision=` even
when the value is the same as max moves - like the sharpshooters this means
that buffs to their movement wouldn't have buffed their vision but now do.

There are few units with vision less than movement. Generally these seem to be
missile weapons that are represented as units, and they probably won't meet any
apply_to=movement statements - even if a movement power-up is available, the
player would probably choose a different unit.

The Add Creature Pack has two creatures (the Cactose Elder and Carnivore Fatal
Plant) that have reduced vision, along with AMLAs that increase those units'
movement; these AMLAs will need to use `apply_to_vision=no`. These two
creatures are used in Castle of Evil Spirit, but they won't get enough
experience to get an AMLA there.

Fixes #3356.
2021-05-13 18:02:36 +02:00
Sean Yeh
7eedae4ee8 Only show notifications for visible mp games
Previously, users would get desktop notifications for all mp games
created, ignoring game filters
2021-05-13 16:06:41 +02:00
Steve Cotton
b7f5a2c52d Add missing terminator in the Lua filesystem module 2021-05-13 14:39:42 +02:00
Pentarctagon
4030e572ea
Fix autorevision target not working on win32 or when disabled. 2021-05-12 23:44:14 -05:00
Iris Morelle
6794f231e5 config: Don't create differently-typed copies of input in loops
This is prompted by 1f8101ef22bb23699421505235f4962802773c77. This
approach should still be correct while hopefully not bothering any
compilers *and* avoiding unnecessary copies or conversions until the
input actually needs to be converted to a different type (in this case
std::string_view, which is cheaper than std::string).
2021-05-12 20:15:45 -04:00
Pentarctagon
24a5ea9a8a
Remove unused systemd check from cmake. 2021-05-12 18:40:14 -05:00
Iris Morelle
b8fbdbbde6 Update Czech translation credits 2021-05-12 18:16:12 -04:00
Pentarctagon
7608cdbaa4 Better handle unexpected return codes. 2021-05-12 13:54:12 -05:00
newfrenchy83
612e6c5f84 update codeblock projectfiles 2021-05-12 13:23:35 -05:00
Steve Cotton
6a1d7cf385 Credits: hide the blank section for Friulian
When an [about] section has a title but no [entry] tags, it's automatically
hidden in the credits. The entry with name="" was causing the title to show
up with a blank section under it.

[ci skip]
2021-05-12 16:28:04 +02:00
Steve Cotton
e7e3ae76d8 Refactor the woptipng script
If a tool made the image bigger, the debug message was the same as if the tool
had made the image's pixel change. Clarify that into two separate messages.

As each verify_images() call checks that the file became smaller, the removed
print statement would never be reached.
2021-05-12 16:04:32 +02:00
Steve Cotton
1bc7378c0d Run woptipng on the new horses
57 of 57 files optimized, 678061 bytes reduced to 586300 bytes; -91761 bytes, -13.53%
This was running with the -t0 option, so that it considers any reduction good, even
if it's less than 10% on the big portrait images.
2021-05-12 15:33:20 +02:00
loonycyborg
1f8101ef22
Fix -Wrange-loop-construct from gcc11 2021-05-12 13:39:47 +03:00
Pentarctagon
3e8d81f473
Temporarily enable verbose WML unit test output. 2021-05-11 19:31:22 -05:00
Celtic Minstrel
5b27f81e59 Define WESNOTH_VERSION during schema validation 2021-05-11 19:37:45 -04:00
Celtic Minstrel
e2181215fe Update changelog 2021-05-11 19:23:48 -04:00
Celtic Minstrel
6584302d41
Merge pull request #5537 from wesnoth/lua_reorg
Various Lua reorganization work
2021-05-11 19:12:40 -04:00
Celtic Minstrel
0970880910 whitespace fixes 2021-05-11 14:52:22 -04:00
Celtic Minstrel
574bc1a36e Resolve [terrain_mask]mask_file= relative to the [binary_path] like map_file= is 2021-05-11 14:52:22 -04:00
Celtic Minstrel
ccb9f4f0e9 Update mainline uses of have_file and read_file 2021-05-11 14:52:21 -04:00
Celtic Minstrel
45cb8dc428 Add a filesystem module
This currently contains have_file, read_file, canonical_path, get_image_size, and new functions that work with binary_path files.
2021-05-11 14:52:21 -04:00
Celtic Minstrel
bf746a0207 Update mainline content to use the wesnoth.scenario module 2021-05-11 14:52:21 -04:00
Celtic Minstrel
97a96cbbd1 Add a new scenario module and move some functions there and to game_config
Addresses #4907
2021-05-11 14:52:21 -04:00
Celtic Minstrel
1410b5cef9 Allow accessing variables through the new APIs in the mapgen kernel
This also reverses the deprecation of wml.tovconfig and friends in the mapgen kernel.
2021-05-11 14:52:20 -04:00
Celtic Minstrel
05b0b7a1df Update uses of wesnoth.fire 2021-05-11 14:52:20 -04:00
Celtic Minstrel
e8381ea9da Update uses of eval_conditional 2021-05-11 14:52:20 -04:00
Celtic Minstrel
2ea92baa13 Move some more functions to the wml module
- eval_conditional and fire
- the internal set|get_variable functions
2021-05-11 14:52:20 -04:00
Celtic Minstrel
603ecdfb99 Move the deprecation for wesnoth.modify_ai to Lua so that it honours --strict-lua 2021-05-11 14:52:19 -04:00
Celtic Minstrel
9bf189a615 Move wesnoth.create_side -> wesnoth.sides.create 2021-05-11 14:52:19 -04:00
Celtic Minstrel
1205e3fd25 Move the Lua global variable helpers from WC to a new "experimental" module 2021-05-11 14:52:19 -04:00
Celtic Minstrel
f4d528f616 Make it easier to deprecate Lua attributes in C++ __index metafunctions 2021-05-11 14:52:19 -04:00
Celtic Minstrel
e7ec2fbca2 Deprecate wesnoth.game_config.version
There's no point having the same info in two places
2021-05-11 14:52:19 -04:00
Celtic Minstrel
c88e60b98e Now color_adjust takes three arguments instead of a config
Consider it part of the public API now.
2021-05-11 14:52:19 -04:00
Celtic Minstrel
ea5367de17 Move create_animator and create_weapon into the units module 2021-05-11 14:52:18 -04:00
Celtic Minstrel
7b2ceb863c Move open_help to the gui module (as show_help)
This also exposes it in kernels besides the game kernel.
2021-05-11 14:52:18 -04:00
Celtic Minstrel
6e9826cfcd Update mainline content to use the wesnoth.audio module 2021-05-11 14:52:18 -04:00
Celtic Minstrel
dddd551765 Add an audio module 2021-05-11 14:52:17 -04:00
Celtic Minstrel
2a1fc43860 Add a versions userdata for a cleaner way to compare and manipulate game versions 2021-05-11 14:50:29 -04:00
Hejnewar
d3e8bb18a3
Merge pull request #5772 from Hejnewar/wesnoth.special_locations-fix
Remove remaining uses of wesnoth.special_locations and fix deprecation message
2021-05-10 19:00:57 +02:00
Hejnewar
16c8fcc49c Remove remaining uses of wesnoth.special_locations 2021-05-10 11:26:12 +02:00
Hejnewar
e1a79988b4 Fix deprecation message 2021-05-10 11:23:54 +02:00
doofus-01
0db6ac37c2
Update changelog.md 2021-05-09 20:42:44 -07:00
doofus-01
540be634df
horse things (#5738)
* some basic cataphract frames for all attacks

* horse unit

* zombie horse variation

* horse soulless

* White Horse variation

* Dark Horse variation

* horse-related attack icons

* adding seahorse unit

* wmlindent corrections
2021-05-09 20:40:05 -07:00
Nils Kneuper
dcf3825fae updated Russian translation 2021-05-09 10:45:49 +02:00
Celtic Minstrel
1dccc3ad76 Update mainline content to use the mathx module 2021-05-08 17:20:49 -04:00
Celtic Minstrel
1fc31c23d0 Replace all uses of get_time_stamp -> ms_since_init 2021-05-08 17:20:49 -04:00
Celtic Minstrel
7e1f3bc27f Rename get_time_stamp to ms_since_init
This better reflects what it actually does - it is not and has never been a timestamp.
2021-05-08 17:20:49 -04:00
Celtic Minstrel
a09f88c1c9 Start a Lua mathx module to hold round, shuffle, random, and a few other things 2021-05-08 17:20:47 -04:00
Celtic Minstrel
c4d9590e71 WFL: Add recall list to the side object 2021-05-08 17:15:02 -04:00
Celtic Minstrel
96964f0dd1 Log any Lua errors during map generation 2021-05-08 17:15:02 -04:00