78013 Commits

Author SHA1 Message Date
Charles Dang
99fe4293c0 IS_HERO/IS_LOYAL: use [object] instead of overlays= 2021-01-09 21:48:00 +11:00
Steve Cotton
0ba433203e Fix [resistance_defaults] and [terrain_defaults] (issue #5308)
These now work:

    [resistance_defaults]
        id="special_res_for_test"
        default="30"
    [/resistance_defaults]

    [resistance_defaults]
        id="copy_of_arcane"
        default="(arcane)"
    [/resistance_defaults]

and so do these:

    [terrain_defaults]
        id="special_terrain_for_test"
        [movement_costs]
            default="(swamp_water + 1)"
            orcishfoot="(vision_costs.swamp_water * 2)"
        [/movement_costs]
    [/terrain_defaults]
    [terrain_defaults]
        id="special_terrain_for_test"
        [defense]
            default="(20 + 7 * movement_costs.special_terrain_for_test)"
        [/defense]
    [/terrain_defaults]

For [terrain_defaults], I've approached it as a new feature rather than a
simple fix. The subtags now use the same names as the [movetype] subtags and
[effect]'s `apply_to` attribute, so [terrain_defaults][movement_costs] instead
of [terrain_defaults][movement].

The formula handling will now recognise "resistance", "movement_costs",
"vision_costs", "jamming_costs" and "defense". For [resistance_defaults], the
formula will recognise both "(arcane)" and "(resistance.arcane)" as equivalent,
similarly for [terrain_defaults] "(swamp_water)" is a shorthand for whichever
subtag is being patched.

A [terrain_defaults] tag may use data added in a previous [terrain_defaults],
as in the examples above where the second tag's [defense] is based on the first
tag's [movement_costs], this gives orcish grunts on the special terrain a 62%
chance to be hit. However, relying on data in the same [terrain_defaults] that
creates or changes it is unsupported - if the [movement_costs] and [defense]
were in a single [terrain_defaults] tag then the result would be implementation
defined, because no guarantee is made of the order in which the children of the
tag are processed.

The schema gets fixed for [resistance_defaults] and [terrain_defaults], as it
only allowed one instance of each tag. The subtags of [terrain_defaults]
already had the new names.

In the schema's MOVETYPE_PATCHING macro, the default= key is mandatory except
for the types that fallback to using movement costs as their default. The tag's
implementation doesn't need it, however omitting it seems more likely to be
an oversight than a deliberate use of an edge case.
2021-01-09 09:13:41 +01:00
Charles Dang
b466230ee8 Fixup ef5296f 2021-01-09 13:33:37 +11:00
Charles Dang
6ed4900aea Merge branch 'master' of github.com:wesnoth/wesnoth into master 2021-01-09 11:56:09 +11:00
Charles Dang
ef5296faf5 Game Config Manager: removed jump_to_editor ctor argument
This was taken from the value in game_launcher, which was set to true if commandline_options::editor was set.
This uses that value instead of passing in the flag manually, which is consistent with the other defines.

This also removes game_launcher::jump_to_editor since it's no longer needed.
2021-01-09 11:38:33 +11:00
Pentarctagon
736f20b67a
Small update to labeler for the servers. 2021-01-08 18:21:47 -06:00
Charles Dang
148574a3a9 Game Config Manager: simplified a util function 2021-01-09 11:05:51 +11:00
Pentarctagon
8b3498e3c5
Add underscore.
Both cfg and cfg_ refer to the same thing, which is why it works anyway, but it's still a typo.
2021-01-08 12:41:20 -06:00
Charles Dang
dbf9d355cf Moved advanced prefs manager out of game_launcher
It didn't really make much sense to keep it here. The manager singleton is now local to its implementation
and initialized in game_config_manager::init_game_config like the credits data.
2021-01-09 03:39:44 +11:00
Charles Dang
487a9fe079 Preferences/Game: minor code cleanup 2021-01-09 03:26:09 +11:00
Charles Dang
9514cb9a96 Preferences/Game: code formatting 2021-01-09 03:16:45 +11:00
Charles Dang
2f62412900 Merge branch 'master' of github.com:wesnoth/wesnoth into master 2021-01-08 23:28:18 +11:00
Charles Dang
d0cdad5546 GUI2/Title Screen: return before reloading
Keeps the same codepath as F5 reloading.
2021-01-08 23:27:48 +11:00
Charles Dang
98057e2eb5 Dune Raider/Marauder: blit the torch overlay on the baseframe, not the other way around
Fixes a weird issue where the sprite would sometimes not have TC applied.
2021-01-08 23:26:04 +11:00
Pentarctagon
1061692215
Temporarily disable macOS ARM due to constant internal CI errors. 2021-01-07 09:12:35 -06:00
Charles Dang
2c06bd1e35 Cleaned up remaining cases of spaced closing template brackets 2021-01-07 21:43:08 +11:00
Charles Dang
1412fa500e GUI2/Title Screen: removed window argument from button_callback_multiplayer 2021-01-07 21:27:30 +11:00
Charles Dang
bc36c7ee65 GUI2/MP Method Selection: used an enum instead of ints for choices results 2021-01-07 18:44:37 +11:00
Charles Dang
480fc920dc Game Launcher: moved cache clear calls to change_language 2021-01-07 18:29:31 +11:00
Charles Dang
bcdf93c9fc Merge branch 'master' of github.com:wesnoth/wesnoth into master 2021-01-07 05:24:43 +11:00
Charles Dang
d4b5330b41 Game Board: code formatting 2021-01-07 05:22:15 +11:00
Charles Dang
50c4942bd9 Play Controller: used a lambda over a helper struct 2021-01-07 05:18:04 +11:00
Charles Dang
c21cb06f83 Cleaned up a bunch of uses of this-> 2021-01-07 05:15:46 +11:00
Iris Morelle
f558f4c6e3 Revert "campaignd: Don't bump download count when a delta is requested"
Turns out the add-ons client currently sends from_version= with a
non-empty string value even if the add-on being downloaded isn't already
installed (the default version_info string, "0.0.0").

This reverts commit 7d02fc884bd360d125acad4f7922e58c245ea16a.

Fixes #5411.
2021-01-06 15:14:18 -03:00
Charles Dang
4abc67c669 Play Controller: code formatting 2021-01-07 05:11:49 +11:00
Charles Dang
cefda7e177 Fixup unused variable 2021-01-07 04:21:21 +11:00
Charles Dang
4a86e4e17b Game Launcher: used a scoped enum for reload_mode (formerly RELOAD_GAME_DATA) 2021-01-07 02:28:18 +11:00
Charles Dang
39ca794c2a Game Launcher: moved outtro handling to campaign_controller 2021-01-07 02:18:42 +11:00
Charles Dang
321b496362 Game Launcher: cleaned up jump_to_campaign_info 2021-01-07 01:58:55 +11:00
Charles Dang
4feb168fd1 Game Launcher: removed unused mark_completed_campaigns function 2021-01-06 06:22:05 +11:00
Charles Dang
73b72d2c56 Tutorial: added another newline before the "Press to continue" prompt 2021-01-06 05:31:15 +11:00
Pentarctagon
f1c4a83f20
Re-add MP test script to CI. 2021-01-05 11:38:46 -06:00
loonycyborg
27ea013763 Add -w option to wesnothd to print all WML it sends to stdout 2021-01-05 20:09:35 +03:00
Pentarctagon
922f2b6ad5
Default to an empty string rather than Unknown. 2021-01-05 10:26:20 -06:00
Charles Dang
baae3ba8d4 Commandline Options: format initializer list 2021-01-06 01:11:58 +11:00
Charles Dang
876ae66480 Game Launcher: removed show_preferences
This doesn't rely on anything in game_launcher so no need to have it a member function.
2021-01-06 01:10:42 +11:00
Charles Dang
5f0fe0474a Removed outdated documentation 2021-01-06 01:02:54 +11:00
Charles Dang
70f1a2643b Forgot to include this in ca00ca2 2021-01-06 00:32:08 +11:00
Charles Dang
4ccdc17b64 Used while(true) instead of for(;;) 2021-01-06 00:30:41 +11:00
Charles Dang
3932a11239 Removed redundant titlescreen control blocks in MP cases
No need to continue since we're already at the end of the loop. Regardless of the return value,
we want to loop again, in which case break handles that just fine.
2021-01-06 00:20:46 +11:00
Charles Dang
36bd3b262c Game Launcher: made play_multiplayer return true on success
So far this return value isn't actually really used for anything, but it's better to have it
return true on success than false in all cases (including error conditions).
2021-01-06 00:17:16 +11:00
Charles Dang
ca00ca27fb Game Launcher: used a scoped enum for mp_mode (renamed from mp_selection) 2021-01-06 00:01:45 +11:00
Charles Dang
1a1c629721 Game Launcher: made clear_loaded_game and start_wesnothd private
Also properly deleted the copy constructor and assignment operators.
2021-01-05 23:54:56 +11:00
Steve Cotton
a4711ebad9 Correct the editor help about loading editor-generated .cfg files
Somehow I forgot to test that it worked on 1.14.
2021-01-05 13:50:12 +01:00
Charles Dang
8b6def9678 Game Launcher: renamed is_loading to has_load_data for clarity 2021-01-05 23:47:26 +11:00
Charles Dang
7d4e5d5595 Fixed game possibly attempting to load in an error state
I'm not sure in what case game_launcher::load_game would return false here (I don't know if any of the exceptions
it catches can even be thrown from that code, for instance), but if for some reason that happens we don't want to
continue loading.
2021-01-05 23:42:33 +11:00
Charles Dang
5242fa370a Removed redundant calls to game_launcher::clear_loaded_game
Calling game_launcher::load_game already cleared the loaded data if present unconditionally.
2021-01-05 23:37:06 +11:00
Charles Dang
d9680a906c Simply a load_game_exception throw 2021-01-05 23:11:26 +11:00
Charles Dang
2a827fbefb Savegame: code formatting 2021-01-05 23:11:04 +11:00
Charles Dang
caab5b3dce GUI2/MP Create Game: removed unused game_config_view reference 2021-01-05 23:04:37 +11:00