Compare commits

...
Sign in to create a new pull request.

1921 commits

Author SHA1 Message Date
Jyrki Vesterinen
8ab4525034 Texture atlas generation itself 2019-03-31 16:52:23 +03:00
Jyrki Vesterinen
16f20d5286 High-level sprite packing code for the 'pack everything' case 2018-10-13 12:30:57 +03:00
Jyrki Vesterinen
62bbdab065 Low-level sprite packing code 2018-10-11 14:10:32 +03:00
Jyrki Vesterinen
af418d86f4 WIP: texture atlas class
Currently only loading images and applying IPFs is implemented.

Most code here is copy-pasted from picture.cpp, I'm planning to eventually
remove that file.

Next task is implementing the actual sprite packing.
2018-10-10 15:03:19 +03:00
Jyrki Vesterinen
c81095ac8b Really fix build 2018-09-29 13:50:41 +03:00
Jyrki Vesterinen
df37b11561 Fix build 2018-09-29 12:09:16 +03:00
Jyrki Vesterinen
6716227279 Thread pool can now receive tasks to do 2018-09-29 11:51:28 +03:00
Jyrki Vesterinen
9f1e4564df WIP: thread pool class
For now it's missing ability to, you know, actually run tasks.
2018-09-27 21:30:51 +03:00
Martin Hrubý (hrubymar10)
a18c475f38 Fix Xcode Project 2018-09-27 20:06:09 +03:00
Martin Hrubý (hrubymar10)
2973cedda2 Fix Xcode project after 3e96a3aa2c357c539c255dbe8b431f6857f8170a 2018-09-27 20:04:53 +03:00
Jyrki Vesterinen
34b7903d25 Add a shader class 2018-09-27 20:04:53 +03:00
Sofartin
7ed4e2c93a Fix xcode project after aff0465441c62f6932bf19ba42fbedeffc5fbf86 2018-09-27 20:04:53 +03:00
Jyrki Vesterinen
0992605c5d Add sprite, draw_op and vertex classes 2018-09-27 20:03:46 +03:00
Jyrki Vesterinen
73caa6da64 Add a texture class 2018-09-27 20:03:45 +03:00
Sofartin
6a18968df1 Fixed Xcode Project for OpenGL 2018-09-27 20:01:02 +03:00
pentarctagon
eec60d08aa Adds OpenGL/GLEW checks to scons.
Taken mostly verbatim from 3e2eba22a9
2018-09-27 20:00:01 +03:00
pentarctagon
ee59c2be97 Re-add travis' notifications. 2018-09-27 20:00:01 +03:00
pentarctagon
e0953798e4 Remove forgotten environment dump. 2018-09-27 20:00:01 +03:00
pentarctagon
4db3d913e6 Updates cmake and scons to be able to compile with OGL. 2018-09-27 20:00:01 +03:00
Jyrki Vesterinen
6e9576a282 Stop logging GL_VENDOR
I think the log output looks nicer without it in the end.
2018-09-27 20:00:01 +03:00
Sofartin
e2bbbbafd9 Fixed Xcode Project for OpenGL 2018-09-27 20:00:01 +03:00
Jyrki Vesterinen
695c8eebe8 Integrate GLEW to the Visual Studio project
I also removed USE_GL_RENDERING (OpenGL rendering is now used
unconditionally), moved initialization of gl::context out of the
constructor, and added some light logging about OpenGL (so that, in the
future with hardware-specific issues, we have a way to know which hardware
is affected).

This commit breaks build with anything except Visual Studio due to
requiring OpenGL and GLEW but not linking to them.
2018-09-27 19:56:22 +03:00
josteph
ae4ef058ed manpage: Fix option name typos and update documentation of --render-image. 2018-09-26 18:16:52 +11:00
jostephd
c55b0c6adb Commandline: Fix documentation of --render-image 2018-09-26 18:16:16 +11:00
josteph
c88a799b90 Help: Hide abilities with empty names.
Fixes empty name abilities in help in Liberty S1.
2018-09-26 18:14:37 +11:00
newfrenchy83
e395706309 Update Code::Blocks project (#3566) 2018-09-26 06:59:57 +03:00
josteph
4db974431d Unit Display: When the recruiting or recruited units is invisible, don't scroll to it.
When the enemy leader and the unit it recruits are both invisible,
scrolling to them would leak their location to the player.
2018-09-24 20:18:16 +03:00
josteph
9abdc20841 MP Create Game: Increase slider step size
Requested on the forums https://forums.wesnoth.org/viewtopic.php?t=48680
2018-09-23 17:02:42 +03:00
Jyrki Vesterinen
79206d92d5 Fix: Chance to hit wasn't protected from becoming negative
Manual merge of pull request #3550. Credit to @newfrenchy83.
2018-09-23 16:52:24 +03:00
mattsc
81ef9ea390
Merge pull request #3506 from mattsc/lua_ai_cleanup
Lua AI Cleanup
2018-09-22 06:18:33 -07:00
Jyrki Vesterinen
9536f3825e Fix #3567: error when trying to send an error message to the client
Simple_wml requires double quotes to be duplicated like this.
2018-09-22 12:29:52 +03:00
jostephd
3a3b752881 WML: Support [filter_side] in [item]. (#3533)
* WML: Support [filter_side] in [item].

If [filter_side] is present then "team_name" is ignored.

Fixes #1477.

* WML: Compare [item]team_name to [side]team_name using intersection.

Fixes problems with substrings and when one or the other is a
comma-separated list. See #3533

* WML: Rename [item][filter_side] to [item][filter_team]

* Add changelog entry
2018-09-21 21:11:08 -04:00
josteph
b64f4b42d6 Commandline: --campaign-skip-story skips [message]s during prestart and start events 2018-09-21 12:59:15 +03:00
josteph
1d1d260350 Commandline: Encapsulate skip_story in play_controller 2018-09-21 12:17:59 +03:00
josteph
f7be872da2 Commandline: Add --campaign-skip-story option
Fixes #3472
2018-09-21 12:17:40 +03:00
Sergey Popov
63d06f8a38
Merge pull request #3555 from jostephd/objectives-prestart-for-master
Fwdport b7cb36a711
2018-09-21 11:02:49 +03:00
Nils Kneuper
639c5087b9 updated Spanish translation 2018-09-20 20:46:41 +02:00
Nils Kneuper
9acb15674f updated Italian translation 2018-09-20 20:44:53 +02:00
V N
6010ffe98e prevent double execution of on_event.lua
makes it safe to dofile("on_event.lua")
2018-09-19 18:09:50 +02:00
Iris Morelle
2ea2a4da49 pofix: 1.14 announcement rules for 1.14.5
[ci skip]
2018-09-17 00:24:22 -03:00
Iris Morelle
7bb419abbf Multiple fixes to the changelog to make it look good on Steam
[ci skip]
2018-09-17 00:09:21 -03:00
Iris Morelle
a38466d0b5 Fix changelog indentation
[ci skip]
2018-09-16 23:25:24 -03:00
Severin Glöckner
b8d8be3436 THoT: replace [filter_wml]
[ci skip]
2018-09-16 00:46:27 +02:00
Severin Glöckner
e5b4fcdfd3 fixup
[ci skip]
2018-09-16 00:42:57 +02:00
Severin Glöckner
56111818e9 THoT: add potential workaround for #3547
It's anyway a good idea to change this code.

[ci skip]
2018-09-16 00:34:19 +02:00
Andras Szell
b16b7f032a Tutorial S1: display an undo message if impossible to reach next target
Fixes #3039

Until the elves attack the quintain it is not allowed to end turns
before completing the given tasks. Display a message how to undo if
there is not enough MP remaining to reach the current destination or
an enemy by either unit.

[ci skip]
2018-09-16 00:23:31 +02:00
Jyrki Vesterinen
57709d4ae4 Synchronized changelog with 1.14
[ci skip]
2018-09-15 20:58:22 +03:00
Nils Kneuper
c1ffe4ce39 updated Hungarian translation 2018-09-15 12:24:30 +02:00
Severin Glöckner
09f418bdd8 ANL: fix village gold being too low
[ci skip]
2018-09-15 01:12:12 +02:00
josteph
9f58a80635 Add const annotation to new function 2018-09-14 22:52:54 +00:00
josteph
d99f5b8a76 Reevaluate [show_if] conditions and delayed variable expansions before displaying objectives at start.
Fixes #3544.
2018-09-14 22:12:49 +00:00
Nils Kneuper
389cd9a831 updated Japanese translation 2018-09-15 00:07:16 +02:00
Nils Kneuper
7ac40296b1 updated Scottish Gaelic translation 2018-09-15 00:06:03 +02:00
Nils Kneuper
235a54a050 updated French translation 2018-09-15 00:04:47 +02:00
Nils Kneuper
eadbb1e086 updated British English translation 2018-09-15 00:02:28 +02:00
Nils Kneuper
918a812027 updated Czech translation 2018-09-15 00:01:08 +02:00
DisherProject
648035fa1e SoF: add [show_if] to the objectives 2018-09-14 23:32:45 +02:00
DisherProject
67f49712c6 SoF: Postpone Gryphon Riders availability 2018-09-14 23:32:45 +02:00
DisherProject
bc4a5e832b SoF S9: Fix some events and add TODOs 2018-09-14 23:32:45 +02:00
DisherProject
5013a9f3e5 SoF S7: Don't let the player kill all of the enemies 2018-09-14 23:32:45 +02:00
DisherProject
20cd56324c SoF S6: Set correct speaker for [message]
Alanin addresses Rugnur, and not Thursagan
2018-09-14 23:32:45 +02:00
DisherProject
5dc6b796d3 SoF S5: Place the elvish encampment when the leader arrives
So remove his starting castle from the map; otherwise the user
would see an empty keep and would know where the enemy is
going to spawn
2018-09-14 23:32:45 +02:00
DisherProject
49d12cf1ef SoF S4: Add the tunnel the dwarves came from to reach the mines 2018-09-14 23:32:45 +02:00
DisherProject
29cec1a770 SoF S2: Place glyphs during prestart
So we can see them while our ally is talking about them
2018-09-14 23:32:45 +02:00
DisherProject
76f081addf SoF S1: Remove Caravans' upkeep cost
In exchange, the player will have 2 starting villages
less than before
2018-09-14 23:32:45 +02:00
DisherProject
9e8fb2d3e0 SoF: General cleanup
1) Clear variables and macros
2) Remove default AI values
3) S7: Remove the ghost ship
2018-09-14 23:32:45 +02:00
DisherProject
effb865040 SoF S2t,S3t,S4t - Move scenery items to map file
The braziers will also be animated, while they were still
images before
2018-09-14 23:32:45 +02:00
Severin Glöckner
c5cabd960b Micro AI Demos: use Cme instead of Chw for lurkers map
[ci skip]
2018-09-14 22:50:31 +02:00
Severin Glöckner
c5d3539880 Micro AI Demos: save maps in new format
[ci skip]
2018-09-14 22:50:31 +02:00
josteph
3809b64cf4 WML [message]: Limit the text width for messages with portraits on both sides as already done for messages with one portrait. 2018-09-14 13:36:18 -05:00
josteph
fc9e5f0484 WML [message]: Add left padding when the portrait is shown on the right.
The text is now shown at exactly the same place regardless of which side
the portrait is on.

Fixes #1938.
2018-09-14 13:36:18 -05:00
joeylmaalouf
243a542edd Menu: campaign order tweaks 2018-09-14 08:45:46 -05:00
joeylmaalouf
a3a9b72311 Menu: re-order and re-rank campaigns (including new ranks) (fixes #1222) 2018-09-14 08:45:32 -05:00
Łukasz Hryniuk
7cf478e8d9 gui2: indicate that unit cannot advance 2018-09-13 18:43:53 +03:00
Celtic Minstrel
100565c7d8 Update changelog 2018-09-12 08:59:44 -04:00
josteph
046b141366 HttT S17: Show the 'Comic relief' comment to translators, too.
(cherry picked from commit 31d333cc62)
2018-09-12 16:08:28 +10:00
josteph
c006072356 HttT S17: Make Li'sar's dialog unconditional.
(cherry picked from commit 6ea39b33e6)
2018-09-12 16:08:26 +10:00
josteph
7b2289f818 HttT S17: Add comic relief.
(cherry picked from commit f3407fddc9)
2018-09-12 16:08:24 +10:00
josteph
15acd75636 HttT S17: Further updates to dialog
- Improve Konrad's line
- Use variant portraits for Konrad and Li'sar
- Update the mage's dialog to match the dwarf's

(cherry picked from commit f7d8d0d257)
2018-09-12 16:08:22 +10:00
josteph
865dcbf3a4 HttT S17: Further tweak dwarf's dialog.
(cherry picked from commit 3e3bd320c9)
2018-09-12 16:08:20 +10:00
josteph
0e9e3b30f9 HttT S17: Correct pronoun.
(cherry picked from commit 96387a55d5)
2018-09-12 16:08:18 +10:00
josteph
960a8fcc9f HttT S17: Add a po comments
(cherry picked from commit edcccc56a7)
2018-09-12 16:08:16 +10:00
josteph
25791d64e5 HttT S17: Change again due to an ambiguity.
(cherry picked from commit 18e886d82e)
2018-09-12 16:08:14 +10:00
josteph
c97fe98801 https://github.com/wesnoth/wesnoth/pull/3473#discussion_r211090169
(cherry picked from commit bc52143390)
2018-09-12 16:08:12 +10:00
josteph
0a0920fe79 HttT S17: Explain why Mages of Light aren't considered by the filter.
(cherry picked from commit 4c2f4f7eda)
2018-09-12 16:08:10 +10:00
josteph
2c9aeec8b0 fixup
(cherry picked from commit 62eb450da6)
2018-09-12 16:08:09 +10:00
josteph
fff478112c HttT S17: Fix "naught" and explain why only high-level mages.
(cherry picked from commit 7ed9f2db9a)
2018-09-12 16:08:07 +10:00
josteph
9072934d45 units: Add a po comment in Elvish High Lord.
(cherry picked from commit 1f0c466a3d)
2018-09-12 16:08:05 +10:00
josteph
f1d20c1edb HttT S17: Add po comment
(cherry picked from commit b7c431e7b3)
2018-09-12 16:08:03 +10:00
josteph
de9541fd76 HttT S17: Explain the lava mechanic
Gameplay is not affected. The player can still lose units to {EXPAND_LAVA}.

(cherry picked from commit a3be912487)
2018-09-12 16:08:01 +10:00
Jyrki Vesterinen
6234faa100 Changelog entries for changes I committed 2018-09-12 05:23:17 +03:00
gfgtdf
d0c0f406f2 fix #3532 : oos error in mp campaigns.
previously it would cause oos when a player that has not yet advanced to
the currrent scenario sends random seed requests.
2018-09-11 20:25:36 +02:00
loonycyborg
0b9565375f Prevent C++ exception from escaping from is_user_banned() 2018-09-11 16:41:38 +03:00
josteph
95b3ccd9fe HttT S6: Support unlikely player behavior.
Trigger the undead reinforcements even if the player skips the main cave entrance.
2018-09-11 03:36:37 +02:00
josteph
9509eecced HttT S6: Trigger the additional undead as soon as the player touches the cave entry.
Seen in :debug with a Nightgaunt. Not sure if it can happen in normal play.
2018-09-11 03:36:37 +02:00
josteph
e50b6fa7bd HttT S6: Allow canceling attack orders. 2018-09-11 03:36:37 +02:00
gfgtdf
69cdbe8da7 fix 3541 : crash in lua tstring comparision 2018-09-10 22:10:33 +02:00
gfgtdf
3591e82586 add game_config.combat experience
and make [harm_unit] use these values instead of hardcoded 8*level for
killing and level for combat.
2018-09-10 22:09:50 +02:00
gfgtdf
08b7d1b1ac fix #3396 lua_function= doesn't work in [effect][filter]
unfortunately this adds an annoying const_cast. The old code 'worked around'
this by getting a nonconst reference to the same unit via the unit map,
which i think is not better just hides the issue.
2018-09-10 22:08:27 +02:00
Severin Glöckner
00e41b9857 Core Macro Reference: Fix hint
[ci skip]
2018-09-10 00:37:51 +02:00
Severin Glöckner
f358beda51 TSG S5: fix typo in comment
[ci skip]
2018-09-10 00:37:51 +02:00
Severin Glöckner
7a29fc15b4 ANL: remove superfluous temp variables
The other variables in that event are not needed either, left them in for
readability for the time being.

[ci skip]
2018-09-10 00:37:51 +02:00
Severin Glöckner
001b444b10 core macros: don't clear nonexistant variable
A leftover from the switch from {FOREACH} to [foreach]

[ci skip]
2018-09-10 00:37:50 +02:00
Severin Glöckner
0ef3c0d5f9 MP Tombs of Kesorak: adjust comment, avoid darkening overlay
A better image is needed, I remove the darkening overlay, because it would be
missleading when a Mage of Light affects this field.

[ci skip]
2018-09-10 00:37:50 +02:00
newfrenchy83
7d6e2b2a10 Lua API: implicitly clear animator after playing it (#3536)
This prevents the animator from holding a strong reference to the target unit, which was keeping the unit object alive and thus preventing the unit halo, if any, from disappearing.
2018-09-09 18:47:56 +03:00
Charles Dang
6eba0cbace Sync 1.14.4+dev changelog section
[ci skip]
2018-09-09 19:29:03 +11:00
Celtic Minstrel
354f24e926 Allow lists in SLF location_id key (closes #3493) 2018-09-08 23:31:02 -04:00
Celtic Minstrel
59e78e5565 Move wmlxgettext to the data/tools directory so that it's automatically included in official packages 2018-09-08 18:07:42 -04:00
Rikard Falkeborn
cc98bcd9d0 Bugfix generate random map unique names
The used names was never set so the check for duplicated names did not
work. Detected by cppcheck.
2018-09-08 18:25:32 +03:00
Martin Hrubý (hrubymar10)
1af805ecf7
Fix unit tests in Xcode 2018-09-08 01:00:06 +02:00
Pentarctagon
09fcc6b051 Fixes #3518
Certain distro/compiler combinations will apparently warn about not optimizing when _FORTIFY_SOURCE is set.
2018-09-07 12:36:11 -05:00
mattsc
2591e435a5 EI custom ogre AI: remove a commented out line 2018-09-07 09:50:52 -07:00
mattsc
a781139536 generic_recruit_engine: remove unnecessary variable assignment 2018-09-07 09:50:51 -07:00
mattsc
dcadab91a4 Lua AIs: use ai_helper.get_locations_no_borders() 2018-09-07 09:50:42 -07:00
mattsc
10463fdf60 ai_helper: new function get_locations_no_borders() 2018-09-07 09:50:23 -07:00
newfrenchy83
3541629197 [heal_unit]: clear the animation after playing it (#3526)
Fixes another case of unit halo remaining after death.
2018-09-07 19:35:39 +03:00
Jyrki Vesterinen
e63bd35f9d [animate_unit]: clear the animation after playing it
This avoids a reference to the unit from being leaked, which prevented the
unit's halo (if any) from disappearing when the unit died.

Fixes #3509. Closes #3520.
2018-09-06 20:16:00 +03:00
Jyrki Vesterinen
9f43c4a10e Fix build
Regression from commit ca6e7aef7d.
2018-09-06 20:15:50 +03:00
gfgtdf
8ed601461e fix #3515 : random start time 2018-09-06 20:15:39 +03:00
mattsc
75843541bc Lua AIs: use ai_helper get_unit functions where applicable
The ai_helper functions are optimized for speed (as much as possible in a general setting) and do all the necessary tests.  For example, get_units_with_attacks() checks both whether the unit has attacks left, and whether it has any attacks in the first place.
2018-09-05 19:38:28 -07:00
mattsc
a7d80240f2 ai_helper: get_unit functions should only return live units
Live beiing defined as in get_live_units(), that is, non-petrified units
2018-09-05 19:34:44 -07:00
Severin Glöckner
b9396cd116 fix syntax error in Chinese manual
In Markup, only the normal quotes are allowed.

[ci skip]
2018-09-06 00:16:22 +02:00
Severin Glöckner
60f2158dfa add textdomains to appdata file:
One must compile wesnoth with -DLOCALEDIR=/usr/share/locale, as that's the place
where the system looks for translations.
(One can test it with gettext -s -d wesnoth "poisoned")

This is according to the docs, needs more testing if it works.
Doesn't work with Arch, though Arch doesn't support software centres well.

[ci skip]
2018-09-05 22:35:38 +02:00
Iris Morelle
444d6d63f6 gui2/unit_create: Use unit type ids as filtering criteria as well 2018-09-04 16:45:58 -03:00
mattsc
fdc3249496 Lua AIs: use ai_helper.robust_move_and_attack()
ai_helper.robust_move_and_attack() does the stop_unit_moves automatically if the unit is at the destination hex.
2018-09-04 07:16:56 -07:00
Severin Glöckner
d3d2decac9 forwardport changelog entries
[ci skip]
2018-09-04 03:37:19 +02:00
Severin Glöckner
eabf6e2635 remove superfluous space
[ci skip]
2018-09-04 00:50:09 +02:00
mattsc
23f35546fc Lua AIs: remove commented-out debug code 2018-09-03 14:48:10 -07:00
Severin Glöckner
76e7c8d19f Add keywords to the desktop file
They are as well used in the software centre.
Having keywords is a bonus, even if they are not matched.

[ci skip]
2018-09-03 22:58:54 +02:00
Severin Glöckner
d133b510c9 Appdata: change license identifier
former one is valid but deprecated

[ci skip]
2018-09-03 22:58:54 +02:00
gfgtdf
18526e499a fix crash in ai code when a side has multiple leaders
see https://github.com/wesnoth/wesnoth/issues/3240

Just fixing the crash, not sure how the code should behave in this case, it would be nice if someone who knows more about the ai code would either implement that todo or remove the second warning. An alternative fix would be to move the 'calculate_moves' inside the ai_leaders loop.
2018-09-03 22:58:54 +02:00
mattsc
ec45b53fe2 Experimental AI: rename config file
This stopped being a rush AI long ago.
2018-09-03 12:01:41 -07:00
mattsc
35ba820509 Experimental AI: adjustments to candidate action scores
The relative ranking of the CA scores is not changed, except for one case when two CAs had the same score.

Reasons:
- All scores should be lower than the scores of the default Goto CA (200,000) and the default scores of most Micro AIs (300,000).
- Break tie, resulting in uncertain order of execution, of place_healers and retreat_injured CA. Healers should be placed first, to allow retreating injured units to adjacent hexes.
- Set default for generic_recruit_engine to slightly above default AI recruiting score. That way it takes effect even if the default CA is not removed.
- Increase move_to_any_enemy CA score from 1 to 1,000. It is still the lowest score that way, but allows for setting up custom CAs with even lower scores (even if it is just for end-of-turn statistics or the like).
2018-09-03 11:05:49 -07:00
Severin Glöckner
a46c6edd5a Desktop file: start from a shell
output redirection is only possible when starting from a shell

[ci skip]
2018-09-03 19:52:39 +02:00
mattsc
b92d8e8226 recruit_rushers CA: don't reserve village for passive leader 2018-09-03 08:01:28 -07:00
mattsc
0bcb98cf50 recruit_rushers CA: check if castle_switch CA is present
So that it is possible to use the recruit_rushers CA without the castle_switch CA.
2018-09-03 07:40:27 -07:00
Severin Glöckner
ce056894da DM S21: use type_adv_tree
the one usage of type is left deliberately, to point out that it affects 3
instad of 2 or 4 types.

[ci skip]
2018-09-03 15:07:09 +02:00
Severin Glöckner
2e7d901517 NR deaths: use one event for both lich brothers
They text is the same, whoever of them dies

[ci skip]
2018-09-03 15:05:52 +02:00
Severin Glöckner
47c3947d0a NR S12: hide empty sides
There has been a report that some scenario would be nearly unbeatable if they
are empty in the first place, so this has the side effect of not showing the
player that he misses something. (Nevertheless, they should be hidden)

[ci skip]
2018-09-03 15:05:52 +02:00
Severin Glöckner
79993ea601 NR S13: slight bonus for AI controlled sides:
- allied AI leaders, whose death causes defeat, use passive_leader=yes
- increased amount of money which the lich brothers have, if one has not the
alternative leaders who can recall units
- also increased Krash's gold to the same amount of as Eryssa has (they are the
alternative leaders)

[ci skip]
2018-09-03 15:05:52 +02:00
joeylmaalouf
3d481c1b8b Allow ties to be reported as such in the turns_over_advantage calculation (fixes #1341) 2018-09-02 22:40:41 -05:00
mattsc
45a3bf9363 Lua AIs: replace tabs with spaces 2018-09-02 15:08:24 -07:00
mattsc
3bfd59f28b Lua AIs: do not use engine's 'data' variable unless necessary
Now that all the AIs use external CAs, there is no need to use the persistent 'data' variable any more, unless information is to be exchanged between different CAs or is supposed to be persistent across save/load cycles.
2018-09-02 13:20:34 -07:00
Martin Hrubý (hrubymar10)
6b5edeb9a8
Fix bug in Fix_Xcode_Dependencies 2018-09-02 21:09:15 +02:00
mattsc
62625fd5e2 Protect Unit MAI: remove unused configuration variables
They cannot be set for the MAI, and they would have to be set through 'cfg' not 'data' anyway.
2018-09-02 08:54:31 -07:00
DisherProject
9086e17b15 AOI: General AI rewrite
Removes all the default values and improves the syntax where
possible
2018-09-02 15:04:48 +03:00
DisherProject
240d235059 AOI S2: Prefer "id" to "speaker" in non-[message]'s SUFs 2018-09-02 15:04:48 +03:00
DisherProject
34f417c4eb AOI S3: Clear all enemies on victory
... for consistency with the previous message stating that
all orcs are killed by the elves.
2018-09-02 15:04:48 +03:00
DisherProject
64917b70b5 EI S13: Rewrite dragon's AI
Most part of the old AI had no evident effect: the dragon just
moved here and there without attacking you, and since he flied
over shallow water, it was impossible to chase him. The micro
ai makes Khrakhras wander around and attack you when you
approach his castle.
2018-09-02 15:00:30 +03:00
DisherProject
50e4cc5d3f EI S12-S16: Split objectives into main and alternative ones
Also adds a new objective in S16, which was not stated but
actually makes you win.
2018-09-02 15:00:30 +03:00
DisherProject
643f1336dd EI S8: Fix event not being fired
The second event took as filtered unit an ogre that has reached
the border of the map. Unfortunately, he was removed by the map
before such event was fired, causing it to never happen.
2018-09-02 15:00:30 +03:00
DisherProject
e07819619c EI: Remove old TODO and add a new one 2018-09-02 15:00:30 +03:00
Iris Morelle
b7c7fca8b1 gui2/unit_create: Allow searching by race name as well 2018-09-01 18:48:29 -03:00
Iris Morelle
26629d4a62 gui2/unit_create: Fix segfault on empty list when updating unit preview
This happens when the list comes up empty because of a non-matching
filter, e.g. "Elvish Archer222" and the user clicks on one of the gender
options in this state.

Ideally we should clear the preview pane and disable the options and OK
button here, but the former appears impossible and for some reason
changing the pane's visibility in filter_text_changed() doesn't work
reliably.
2018-09-01 18:48:27 -03:00
mattsc
42b4430841 Lua AIs: avoid calling wesnoth.get_terrain() more than needed
It probably doen't make a noticeable difference for these AIs, but in general we should not call the slow functions more than necessary.
2018-09-01 14:29:51 -07:00
josteph
bcb6153b89 Liberty S8: Fix family reference
According to po comments in S1, Baldras is Harper's mother's brother.

Also change "mom"/"dad" to "mother"/"father" to match the general
medieval setting of dialogs.
2018-09-01 13:43:19 -05:00
josteph
4c612400cf Liberty S8: Fix ambiguous pronoun 2018-09-01 13:43:09 -05:00
mattsc
5474785718 Experimental AI: convert to using external CAs 2018-08-31 18:31:29 -07:00
Nils Kneuper
2436d700f2 updated Chinese (Traditional) translation 2018-08-31 21:04:17 +02:00
Nils Kneuper
ff861673a4 updated Ukrainian translation 2018-08-31 21:02:20 +02:00
mattsc
c2635abde1 Experimental AI: fix eval/exec debug output
This involves making the output independent of the stats CA (which is not used any more) and adding missing output to some CAs.
2018-08-31 07:04:58 -07:00
mattsc
1040dbe5c9 AToTB S2: rename custom AI file
For consistency with the other mainline campaigns
2018-08-30 18:08:04 -07:00
mattsc
35d257f8fd Lua AIs: don't compare variables with nil
... unless there is a difference between nil and false. Done mostly for consistency with all the other uses.
2018-08-30 17:37:12 -07:00
mattsc
a23f06dc20 Lua AIs: don't initiate variables as empty tables
... if they might not be needed.
2018-08-30 17:27:18 -07:00
gfgtdf
1ac635ec63 put [resource] before other content; fixes #3345
Now content that is loaded via [load_resource] is placed to the position
where the [load_resource] was. This fixes a problem where previously one could
not use lua variables/functions created by the [resource][lua] because the
engine would put the [lua] tags from the [resource] after the [resource] from the
scenario.
2018-08-30 22:48:19 +02:00
gfgtdf
144e8a1f8d fixup "fix oos when undoing after ally chat"
this also caused errors later when saving replays because the server would concatinate all [turn] leading to dublicate undo=no attributes.
2018-08-30 22:48:18 +02:00
josteph
8fd1b822db Liberty S3: Play orcish war drums 2018-08-30 15:09:13 -05:00
josteph
6a1b59327e Fix various typos.
AOI S3: Address Erlornas as "lord" in lowercase as done elsewhere in the
scenario.
2018-08-30 14:49:42 -05:00
josteph
e2c591edbd Liberty S3: Add a story part 2018-08-30 14:40:23 -05:00
josteph
012142a3c6 Lua Console: Print an error message when not opening the console because :debug hasn't been run. 2018-08-30 14:37:00 -05:00
mattsc
0e7c09f7b5 Lua AIs: no need to set variables to nil explicitely
This is mostly done for consistency across the Lua AI code
2018-08-30 07:35:57 -07:00
mattsc
80ae232935 Herding Micro AI: fix variabls not being local 2018-08-30 07:23:41 -07:00
mattsc
cb423b2fbd Lua AIs: use math.huge to initialize extrema variables 2018-08-30 07:18:04 -07:00
mattsc
f4f2a441e4 Fast Micro AI: code cleanup
Most of the Fast MAI attack utils had been taken from a more general codebase and included things not needed here. This AI is supposed to be a slimmed down version doing only the absolutely necessary in as fast as possible a fashion.
2018-08-29 19:26:49 -07:00
mattsc
1680436f72 Lua AIs: remove another unused library inclusion 2018-08-29 08:48:30 -07:00
mattsc
8a996c55b9 Lua AIs: remove inclusions of unused libraries 2018-08-29 08:00:32 -07:00
mattsc
5335a2af33 Lua AI utility functions: fix for chance-to-hit specials without id
All mainline chance-to-hit weapon specials have ids, but it is not required for UMC specials.
2018-08-29 07:27:24 -07:00
mattsc
aa59ac5455 Lua AIs: avoid using __cfg for accessing weapon specials 2018-08-28 19:07:42 -07:00
Gregory A Lundberg
616ae9b472 Fix error: no previous declaration
No used outside the source file, so marked as a static function.
2018-08-28 13:57:47 +03:00
Gregory A Lundberg
3826c263b1 Fix error: missing noexcept
GCC 8.2.0 -Wnoexcept flags two functions which should be marked as not throwing.
2018-08-28 13:57:24 +03:00
mattsc
133568efe6 Micro AIs: simplify unit variable handling functions
The main reason for doing this, besides simplifying the code, is to avoid using the WML table dump __cfg, which is slow. This includes a change of the format in which the variables are stored, but since these are internal Micro AI utility functions, that does not matter.
2018-08-27 18:39:41 -07:00
mattsc
8af988c697 Lua AIs: get unit cost/level directly from proxy unit
These used to be accessible only through unit.__cfg or wesnoth.unit_types.  The Fast Micro AI is not included here as it requires a larger clean-up.
2018-08-27 12:34:29 -07:00
Jyrki Vesterinen
c59ae5204a Pofix: fix incorrect removal of a space
Thanks to @jostephd for pointing out that it shouldn't be removed.

[ci skip]
2018-08-27 19:57:09 +03:00
jostephd
6f670556a1 Game Load: Show list of enabled modifications (#3495) 2018-08-27 19:46:35 +03:00
mattsc
3f54908b0b Lua AIs: replace print() by std_print() 2018-08-27 07:30:24 -07:00
mattsc
83c4ef2418 Lua AIs: remove unused debug output 2018-08-27 07:29:24 -07:00
mattsc
b3058e8e8e Messenger MAI Lua code: change proxy unit location directly 2018-08-27 07:13:18 -07:00
mattsc
a6866390df Lua AIs: use unit methods instead of wesnoth functions 2018-08-27 07:05:43 -07:00
Jyrki Vesterinen
328a9c9a83 Another build fix 2018-08-27 11:43:54 +03:00
Jyrki Vesterinen
8f40b51a77 Attempted build fix 2018-08-27 11:21:08 +03:00
jostephd
24cb784d4b Don't scroll to an enemy leader that has an effective [hides] ability (#3492) 2018-08-27 10:35:11 +03:00
Severin Glöckner
5f7b1853dd TSG S8a: add redraw calls
Recalling units may increase the vision area when playing with shroud/fog.

[ci skip]
2018-08-27 04:02:19 +02:00
Severin Glöckner
ddc763f324 TSG S7b: use 1.13 code and make it debug safe
The invulnerable status is player-visible and does not insert new events which
are checked at each attack.

[ci skip]
2018-08-27 04:02:19 +02:00
Severin Glöckner
f84d6808e9 TSG S6a: Mermen will leave afterwards
The text has already been prepared for this in 1.13

[ci skip]
2018-08-27 04:02:19 +02:00
Severin Glöckner
07c2125afc TSG 9a: gender handling
[ci skip]
2018-08-27 04:02:19 +02:00
Severin Glöckner
c030249043 TSG S5: reformat comments, add translation hint
[ci skip]
2018-08-27 04:02:19 +02:00
Severin Glöckner
f04cdd3803 TSG S2: add female strings for the units placed at start
On the other hand, all these units could as well use custom names.
[ci skip]
2018-08-27 04:02:19 +02:00
Severin Glöckner
18db086025 TSG S6a: may the queen be always female and have a more prominent ellipse
And remove one mention of Mebrin before meeting him in S7b.
[ci skip]
2018-08-27 04:02:19 +02:00
Severin Glöckner
657bf305f5 TSG 5: ensure no additional event is triggered during allying
Ensure that allying with the bandits does not trigger the lich sighted event.
It's unlikely that the bandits advanced that far though.

[ci skip]
2018-08-27 04:02:18 +02:00
Severin Glöckner
a46d3f1eb3 TSG S4: minor optimizations
Made it impossible that the undead leader can advance to a lich - though you do
sth. badly wrong if he advances at all. Also, some more 1.13 syntactic sugar.

[ci skip]
2018-08-27 04:02:18 +02:00
Severin Glöckner
63333c688e TSG S5: Beast of the Lake is now loyal
It shall not hinder the recruiting capabilities of side 3 if the player spawns
the monster.

[ci skip]
2018-08-27 04:02:18 +02:00
Severin Glöckner
8960da0591 TSG S7b & S8b: use undead encampments instead of ordinary ones
[ci skip]
2018-08-27 04:02:18 +02:00
Severin Glöckner
29b4196556 TSG: change inclusion of death events
That way less events need to be duplicated in scenarios.
It also does not include the full Hylas death event in S7a to S9a.
Previously the Jarek event was not present in one of the final scenarios,
now both include it, but the shorter variant of it.

[ci skip]
2018-08-27 04:02:18 +02:00
Severin Glöckner
4fecc83f17 TSG S4: add female name string
For some reason they never had one.
[ci skip]
2018-08-27 04:02:18 +02:00
Severin Glöckner
e43b3507fa TSG S4: Avoid submerging Rangers
If no suitable forest hex is found, the radius of the locations considered is
extended instead of placing the unit next to Ethiliel.

Also, a change of behaviour:
 * non-free hexes will not be considered
 * the bodyguards won't be placed adjacent to other units, like the ambush
 ability works normally
 * this includes Ethiliel
In general that means that units may be placed farther away than before.

[ci skip]
2018-08-27 04:02:18 +02:00
Severin Glöckner
f1a465b377 TSG S5: Duo leader setup for the zombies
This adds on the one hand a second leader with secons keep in the same caslte.
for the same side, on the other hand ich changes the speack when they die.
They adverturers are not assuming they killed the undead masters anymore if they
saw the lich before.

(mentioned in #1954)

[ci skip]
2018-08-27 04:02:18 +02:00
Severin Glöckner
7c89b101b8 TSG S8b: allow while mages to be loyal and have random gender
[ci skip]
2018-08-27 04:02:18 +02:00
Severin Glöckner
ee09bc3b63 TSG S2: adjust AI settings
This follows the earlier commit which unified side 2 and 3.

In the first rounds the AI behaves like former side 3, later like side 2.

This is seemlessly possible, because side 3's AI settings were having practical
effect at the beginning of the game, and side 2's conflicing settings don't come
into action before the recruited troops met the ones of the player.

(bug #3032)

[ci skip]
2018-08-27 04:02:18 +02:00
Severin Glöckner
00574c0814 TSG S7a: duplicate less WML
use monstrous event instead of monstrous macro

[ci skip]
2018-08-27 04:02:18 +02:00
Severin Glöckner
0dd48bf581 NR: use 1.13 syntax for finding suitable units for [role]
[ci skip]
2018-08-27 04:02:09 +02:00
Severin Glöckner
b681ad8cd9 TSG S7a-S9a: prepare to let Hylas die
(FR #3316)

This includes changing when the overlays and ellipses for the hero units are
changed, and for better testing part of the event is split into a victory event
in S6a.

[ci skip]
2018-08-27 03:42:06 +02:00
Severin Glöckner
0c5467c28a TSG S2: fix issues with killing the bandit leader first
- The peasants told Deoran to go for the already defeated bandit leader.
- The pesants were useless at that time - they are now instead spawned when
  defeating the bandit leader or when Deoran arrives, whatever happens first.
  They may still have a fight with remaining bandits – or provoke their attack.
- The dialogue when reaching the citadel after having defeated the bandits got a
  slight change, to better switch to the victory dance event.

(issue #1954)

[ci skip]
2018-08-27 03:42:06 +02:00
Severin Glöckner
d749005d21 TSG S2: avoid the possibility of the AI neutralizing villages...
...which it neither burns or captures.
The AI has two sides which are presented as one to the player. It's not the best
approach, because it is possible that the player realizes it looking at the side
informations, e.g. how many units the enemy side has listed there.

This commit unifies both sides, while still keeping the units from formerly side
3 being unable to burn villages, but, as now being in a side with a leader, they
can capture them.

An advantage of having two sides was, that the units could have different AI
settings, and that the leaderless side was not interrested in villages.
The AI settings will be adressed in a seperate commit.

(bug #3032)

[ci skip]
2018-08-27 03:42:06 +02:00
Severin Glöckner
bbc31e623b TSG S3: support debug mode :n and :cl
[ci skip]
2018-08-27 03:42:06 +02:00
Severin Glöckner
101cb21a95 TSG S3: change side switch procedure for Ethiliel
Ethiliel remains on side 3, but a copy of her is added to the player's recall
list for next scenario. The loyal trait is obtained at that point.

[ci skip]
2018-08-27 03:42:06 +02:00
Severin Glöckner
baec30bb0c TSG S3: Don't kill the elves at the end
This is a relict from when they had not their own side, and needed to be killed
to not be added to the recall list.

[ci skip]
2018-08-27 03:42:05 +02:00
Severin Glöckner
844e56b8e0 TSG: S8b don't show the objectives when the mages arrive again
This is one of the few cases where it is not only a refactoring, but has
an actual advanatge to use [show_if] - the note can be removed from the
objectives witout showing them to the player.

[ci skip]
2018-08-27 03:42:05 +02:00
Severin Glöckner
440efd2560 DiD utils: use 1.13 syntax
It's now possible to have this logic as part of [role]

[ci skip]
2018-08-27 03:42:05 +02:00
Severin Glöckner
4e11d419b5 NR S02a: restrict movement by costs instead moves
because it is not obviously shown in the sidebar

[ci skip]
2018-08-27 03:41:50 +02:00
Severin Glöckner
bed3524567 DiD S10: use self dacaying object
use one event with an object instead of two events

[ci skip]
2018-08-27 03:40:29 +02:00
Jyrki Vesterinen
20bfb35bdd Fix another pofix mistake
That comma wasn't supposed to be replaced with a period, and I didn't
notice the mistake before pushing the commit.

[ci skip]
2018-08-26 13:42:41 +03:00
Jyrki Vesterinen
3df91c9fc1 Pofix fixes
The tool that generates .po files splits lines in order to limit line
length, and pofix can't track split strings. Thus, pofix search rules need
to be shorter so that pofix finds the affected strings.

I also moved the replacements to the right text domains, placed wesnoth-l
to the right spot, and removed the "Asheviere is the Queen of Wesnoth"
replacement because it isn't pofixable. (The second part of the string
becomes just "Queen of Wesnoth." and "queen of Wesnoth." with lowercase Q
is used legitimately elsewhere.)

[ci skip]
2018-08-26 13:37:12 +03:00
Jyrki Vesterinen
217eba5f97 Add pofix entries for the recent typo fixes (resolves #3377)
Manual merge of pull request #3490. I also ran pofix.

[ci skip]
2018-08-26 12:25:09 +03:00
josteph
937e971e50 Game Load: Show the user-name difficulty name instead of the internal name.
The internal name (Easy/Medium/Hard/Nightmare) will only be shown if the campaign
is not installed, or doesn't declare the saved difficulty.
2018-08-25 16:58:46 +03:00
Severin Glöckner
c3227f53d7 fixup, use same capitalization
[ci skip]
2018-08-24 18:04:27 +02:00
Severin Glöckner
1867274d25 ANL worker: converting to flatland is not the same as creating a farm
Farms have a multi turn cycle:
1) crate farm (converts to Re)
2) end turn on the filed to harvest (Re has been automatically converted)
3) convert to grasland [othrwise the fields remains unusable for building]

Step 3 was labeled the same as step 1.

[ci skip]
2018-08-24 18:04:27 +02:00
josteph
d27b09a3dc HttT units: Fix typo
Thanks 613TheEvil https://forums.wesnoth.org/viewtopic.php?p=619347#p619347
2018-08-22 15:51:48 +02:00
josteph
eb763789ae HttT S20b: Fix typos 2018-08-22 15:51:48 +02:00
josteph
9e296b4c5b Help: Re-fix Ancient Wose description.
Thanks @CelticMinstrel
2018-08-22 15:51:44 +02:00
josteph
59299ade4b TSG S4: Fix typo. 2018-08-22 15:37:58 +02:00
josteph
86eba2b600 Help: Fix typos. 2018-08-22 15:37:58 +02:00
gfgtdf
6b58ce7c04 Revert "preserve traslatable strings in simple_wml."
This reverts commit 4f3ce6865c.
This reverts commit 20128ac991.

see issue #3454, there were problems caused by simple_wml when
joining/observing games and this commit is the obvious suspect
so i'm reverting it until we can fix that one.
2018-08-22 15:06:55 +02:00
gfgtdf
08bb6a4e96 fixup 'fix game freezes on droiding when using dsu #3453'
fixes https://github.com/wesnoth/wesnoth/issues/3486
2018-08-22 15:05:50 +02:00
gfgtdf
6781fe17ca show add-on loading times on --log-debug=config 2018-08-22 15:05:27 +02:00
gfgtdf
cbf078a030 fix editor cannot add starting location for > 9 players.
previously attempting to place a starting location for side 10 or higher would result in a "invalid location id" error.
2018-08-22 15:04:33 +02:00
Wedge009
087a18a156 Slightly rewrite dialogue (fixes #3386)
Some non-native English readers may find use of the word 'disposed' confusing.
2018-08-22 14:48:22 +02:00
Nobun
4b79c263d3 wmlxgettext: fix #3469: lua plural strings not recognized in some context (#3481)
* bugfix: https://github.com/wesnoth/wesnoth/issues/3469

* wmlxgettext: removed a debug comment forgotten on the previous bugfix
2018-08-22 07:10:30 +03:00
Iris Morelle
c589e39098 pofix: Genericize the Lua version number for the 1.14 announcement
Otherwise people will keep complaining that it doesn't reflect the
latest 1.14 version since the original number was valid for 1.14.0 and
1.14.4.

[ci skip]
2018-08-20 01:31:59 -03:00
Severin Glöckner
12369a2fa4 Capitalize Pango
[ci skip]
2018-08-20 05:07:31 +02:00
Severin Glöckner
6998885cc1 clarify that pango markup is the cause
changed as proposed by soliton
2018-08-20 04:56:50 +02:00
Severin Glöckner
c998f13a45 Linux Packaging: Don't store log info which nobody will read
So it may not be saved in ~/.xession-errors
or cluttering up disk space another way
2018-08-18 19:02:59 +02:00
sigurdfdragon
7aced87548 SotA S14: Add hint about needing plenty of gold for the next scenario 2018-08-18 12:57:54 -04:00
Martin Hrubý (hrubymar10)
6f8c504121
Use MacCompileStuff for every macOS package 2018-08-18 10:08:35 +02:00
joeylmaalouf
df8a6f5557 Make Dune Burner line naphtha icons consistent and remove outdated comment 2018-08-18 01:06:22 -05:00
joeylmaalouf
3d47ed8ab4 NR S14: Update epilogue map to match previous scenario (fixes #3385) 2018-08-17 17:56:09 -05:00
josteph
a3047f37d3 Fix crash after hitting enter when no units match the recall list filter
Fixes #3475
2018-08-17 17:41:59 -05:00
Iris Morelle
d3650a7814 Revert unwanted binary file change in previous commit
[ci skip]
2018-08-17 16:09:28 -03:00
Iris Morelle
36cf8c8d70 gui2/game_load: Constrain leader sprites to 72x72 using image path functions
Fixes #3474.
2018-08-17 15:45:20 -03:00
Konrad2
cf999f7365 Made Thursagens words fit the timeframe 2018-08-17 18:52:41 +02:00
Martin Hrubý
50301f84e3 Fix building with Xcode 10 (#3460)
Resolves #3458.
2018-08-16 15:06:00 +03:00
sigurdfdragon
638fd4bda0 Fixup ed50b6b
[ci skip]
2018-08-15 23:13:55 -04:00
mattsc
c59a084f11 Update changelog 2018-08-15 12:40:17 -07:00
mattsc
d4213371b1 Fast Micro AI: fix for chance-to-hit specials without id
All mainline chance-to-hit weapon specials have ids, but it is not required for UMC specials.
2018-08-15 12:13:55 -07:00
sigurdfdragon
ce6826d80e Units: Have Saurian warriors be female to fit lore in mainline
Fixes #3392 & goes along with #3372.
2018-08-14 23:12:11 -04:00
sigurdfdragon
ed50b6bec4 Help: Add Saurian race description (fix #3372)
[ci skip]
2018-08-14 23:08:09 -04:00
Nils Kneuper
2f313455b8 updated British English translation 2018-08-14 22:16:03 +02:00
newfrenchy83
ae11499486 Update wesnoth.cbp 2018-08-14 07:05:46 -05:00
Pentarctagon
0f5899b163 Fixes track titles not being set from WML.
The current implementation of the [music] tag sets the title after adding the track, however the title field was read only.  This makes the field writable.
2018-08-14 01:57:26 -05:00
gfgtdf
7d44782e5c fixup [terrain_mask] 2018-08-13 17:53:16 +02:00
gfgtdf
09c56ef2fe move [terrain_mask] to lua
and implement it using wesnoth.terrain_mask.

This also fixes an issue where [terrain_mask] would not remove
removed villages from the teams villages list after [terrain_mask].

This also adds an alignment parameter to [terrain_mask].
2018-08-13 15:25:41 +02:00
gfgtdf
6cd9de1202 fix villages after terrain_mask 2018-08-13 15:24:23 +02:00
gfgtdf
a3367ee848 add wesnoth.terrain_mask lua function
`[terrain_mask]` had multiple unexpected behviours, see for example #3364
in parituclar `wesnoth.wml_actions.terrain_mask { x =2, y=2, mask="Ww"}`
will change the tile at (1,2) instead of (2,2), so instead of reusing
the old terrain mask code i wrote a new function that behaves as one
would expect. `wesnoth.terrain_mask` does not have a `border=` parameter
but a `is_odd` parameter that specifies that a map is in the odd format
 __    __
/00\__/20\__
\__/10\__/30\
/01\__/21\__/
\__/11\__/31\
/02\__/22\__/
\__/  \__/

instead of the even map format
    __    __
 __/10\__/30\
/00\__/20\__/
\__/11\__/31\
/01\__/21\__/
\__/12\__/32\
   \__/  \__/

(Monospaced font required to see ascii images.)

The lua function also has a lua interfacte, meaning it does not take wml
tables but normal lua tables making it easier to use from lua code.
2018-08-13 15:23:30 +02:00
gfgtdf
8d6524c6e2 deploy string_view 2018-08-13 15:22:54 +02:00
gfgtdf
9bb601e2da add debug info 2018-08-13 15:21:41 +02:00
gfgtdf
e90f0fce13 remove outdated code
substr cannot throw bad_lexical_cast
2018-08-13 15:21:32 +02:00
gfgtdf
1646a7b906 fix game freezes on droiding when using dsu #3453 2018-08-13 14:03:14 +02:00
gfgtdf
7e2dc296ba boost::ptr_vector -> std::vector<unique_ptr>
boost::ptr_vector has some nice features, but vector<unique_ptr> is still
easier to use for most people basicially becasue people know it better.
Also boost::ptr_vector does not support move ctors and also does not
use std::unique_ptr, probably because it tries to stay compatible with
c++03 so one has to use 'ptr_vector::auto_type' with it instead which
has a different interface than std::unique_ptr
2018-08-13 14:02:50 +02:00
gfgtdf
f03e3e8d6d fix 'start game' locked when other players abort flg dialog #3452 2018-08-13 14:00:57 +02:00
gfgtdf
bd16aeec02 improve wesnoth version warning 3
suggested by soliton
2018-08-13 14:00:56 +02:00
gfgtdf
9a3917dc35 fix missing map previews in the lobby
regression from 'fix require_scenario & require_era'
2018-08-13 14:00:56 +02:00
gfgtdf
7e0d63d7c3 fix segfault in wesnothd
broken in commit 'preserve traslatable strings in simple_wml.'
2018-08-13 14:00:55 +02:00
gfgtdf
c685031d1c fix oos when undoing after ally chat 2
for extra safety we add code to ensure undo=no for [speak] commands to the client aswell, this is not really needed as i just added a code that sets undo=yes to the server code, but it's an advantage to be able to safely connect to older servers aswell.
2018-08-13 14:00:55 +02:00
gfgtdf
02bed5c033 fix oos when undoing after ally chat
previously the server would send [speak] commands that had no undo=no attributes so that the game would remove the speak command from the replay instead of the actual undoable action when undoing an action.
2018-08-13 14:00:55 +02:00
gfgtdf
7bf37a1e64 fix game crashing on 'reset replay'
fixes #3439
2018-08-13 14:00:55 +02:00
Elvish_Hunter
b1ec52cab8 wmllint: added [lua] to the allowed children of [if] 2018-08-12 23:10:09 +02:00
Elvish_Hunter
6e696661fd wmllint: don't even try to convert _info.cfg 2018-08-12 23:10:09 +02:00
Elvish_Hunter
2d045f2a6a wmllint: do not warn about unknown IDs in [tunnel], except inside of [filter] 2018-08-12 23:10:09 +02:00
Elvish_Hunter
2dda3280c1 wmllint: do not warn about unknown IDs in [remove_event] 2018-08-12 23:10:09 +02:00
Elvish_Hunter
9b5c0dda5c wmllint: do not warn about unknown IDs in [aspect] 2018-08-12 23:10:09 +02:00
Martin Hrubý (hrubymar10)
b6507cbbf2
We no longer support OS X Lion - remove legacy code 2018-08-12 22:27:08 +02:00
Martin Hrubý (hrubymar10)
29c5d25e27
Update changelog 2018-08-11 14:07:31 +02:00
Martin Hrubý
4282ee3fdc Rewrite macOS version detection (#3448)
This new implementation works more reliably, avoids spawning subshells, and is faster.
2018-08-11 14:38:09 +03:00
Martin Hrubý
7dcc0d4696 Fix for #3444 (#3449) 2018-08-11 11:28:43 +02:00
Severin Glöckner
cd5b3f785e use & to denote team setup in MP
code it as &amp; to avoid a pango warning in stderr
3ec26df changed it previously to '+' to work around that warning
also change it for the untranslatable strings in the credits
[ci skip]
2018-08-11 01:49:45 +02:00
Martin Hrubý (hrubymar10)
2226c4cd32
Remove xcode version definition from travis leaving it fallback to default version 2018-08-10 23:40:05 +02:00
Martin Hrubý (hrubymar10)
03be7cc571 Remove xcode version definition from travis leaving it fallback to default version 2018-08-10 23:35:29 +02:00
Martin Hrubý (hrubymar10)
8114ec213f Use standart fonts.conf in macOS packages 2018-08-10 20:18:40 +02:00
Martin Hrubý (hrubymar10)
9bbb1771fa Remove old macOS specific fonts.conf 2018-08-10 18:26:13 +02:00
Martin Hrubý (hrubymar10)
4e6ffed7a5 Fix macOS specific warning "Class SDLApplication is implemented in both ..." 2018-08-10 13:21:56 +02:00
Martin Hrubý (hrubymar10)
19db23437a Fix indentation 2018-08-09 23:32:41 +02:00
Martin Hrubý
0711e24d8e Better macOS version report 2018-08-09 23:23:13 +02:00
Martin Hrubý
be0bd05ab0 Fix localised Multiplayer causes preferences window use scrollbar #2855 2018-08-09 22:13:33 +02:00
Elvish_Hunter
3b8a684551 wmllint: avoid inserting image=wesnoth-icon.png if there's already an image 2018-08-09 20:11:14 +02:00
Elvish_Hunter
c08963a2e7 wmllint: fixed 'unknown id' errors in [fire_event] referred to event IDs 2018-08-09 20:04:38 +02:00
Elvish_Hunter
cc178ad474 wmllint: fixed a regex that didn't match augmentation tags 2018-08-09 19:57:52 +02:00
Elvish_Hunter
8bea419899 wmllint: added side_name to the list of translatable keys 2018-08-09 19:53:06 +02:00
Elvish_Hunter
de99a38172 Prevent wmllint from converting Dunefolk names similar to Khalifate units 2018-08-08 22:12:36 +02:00
Elvish_Hunter
3caf128378 wmllint: added a missing conversion rule for the Qatif-al-nar unit 2018-08-08 22:08:59 +02:00
Jyrki Vesterinen
395eaf5251 Use localized chat room names (#2709)
Turns out that a t_string doesn't automatically obtain the correct
translated value. Thus, I'll simply get it by calling
translation::dsgettext() directly. I also changed the translated string to
be used in the tab label as well.
2018-08-07 21:13:50 +03:00
Jyrki Vesterinen
1eec7ef8d9 Make chat room names localizable (#2709) 2018-08-07 20:13:09 +03:00
Steve Cotton
a6bd0c87ac SoF S9: Rephrase the intro text (fixes #3405) (#3437)
The original text that referred to Knalga was confusing if the
player thought of Knalga as "dwarvish territory", and most of
the campaign's scenarios have been somewhere in Knalga.
2018-08-06 08:34:53 +03:00
Jyrki Vesterinen
5bbc7fedca Fix #3436: pot-update failing 2018-08-05 19:19:11 +03:00
Nils Kneuper
a3bb7b655f updated Chinese (Traditional) translation 2018-08-05 14:18:46 +02:00
Konrad2
37ddf43d3a Updated credits for @Konrad22 (#3430) 2018-08-04 21:34:30 +11:00
josteph
ef71d0efcb Addon Manager: Unabbreviate "asc" and "desc".
@jyrkive https://github.com/wesnoth/wesnoth/pull/3418#issuecomment-410433850
2018-08-04 12:47:55 +03:00
josteph
569e1d85a5 Addon Manager: Don't use "ascending" and "descending" to describe how dates are sorted. 2018-08-04 12:47:50 +03:00
Jyrki Vesterinen
fb5f46c52a Help: update the "Installing Add-ons" page (addresses #2703)
[ci skip]
2018-08-04 11:03:39 +03:00
Jyrki Vesterinen
40205c55fb Help: document cores (#2703)
[ci skip]
2018-08-04 11:01:47 +03:00
Steve Cotton
66c56403db SoF S4: Improved the reminder to recruit miners (#3422) (fixes #3394)
Updated to [allow_undo], because the hint message shouldn't block undoing a
recall.  Recruiting can't be undone, even with [allow_undo], so this isn't
allowing a cheater's opportunity to recruit units with desired traits.
2018-08-04 08:46:27 +03:00
Celtic Minstrel
ff4e1b2e61 Add new contributors since 1.14.0 to the credits
Anyone who prefers to be credited some other way (or whose name I misspelled) can feel free to open another PR

@Byteron @rrigby @DisherProject @Ferk @Konrad22 @lilinitsy @UnwiseOwl @bandita137@Ordoviz
2018-08-03 20:50:10 -04:00
rrigby
16e858263c Add categories to appdata
following https://standards.freedesktop.org/menu-spec/latest/apas02.html
2018-08-03 15:07:51 +02:00
josteph
f293c7cb32 GUI: Fix check for no usable weapons.
Fixes #3424.
2018-08-03 15:43:48 +03:00
Jyrki Vesterinen
46bec21fa3 Fix: halo (if any) remains when wesnoth.put_recall_unit() is used
Based on the suggested fix in #3425. Closes #3425.
2018-08-03 12:02:53 +03:00
sigurdfdragon
c6d2a0febc NR: Ensure Krash doesn't overwrite other units and is properly placed.
This could happen if a player has Krash and skipped S10a.
2018-08-02 22:57:08 -04:00
joeylmaalouf
4befb3580d NR S7-8: avoid recreating the new companions from scratch 2018-08-03 01:54:20 +02:00
joeylmaalouf
7c70c1d985 NR S7: give Stalrag traits for consistency 2018-08-03 01:54:20 +02:00
Nils Kneuper
8fb7429ca8 updated Italian translation 2018-08-02 21:30:20 +02:00
Nils Kneuper
bcce3fb4cc updated French translation 2018-08-02 21:29:21 +02:00
Konrad2
87eb901c10 SoF S01: Added snowy mountains to right map edge (#3401) (fixes #3383)
New map for SoF - Sc1 to fix #3383 (removing the fast way to reach the elvish leader, by replacing some regular mountains with snowy mountains).
2018-08-01 10:10:07 +03:00
josteph
55e4147213 debug: Give feedback for :droid.
#2819
2018-07-31 22:59:14 +02:00
josteph
0f520ad8a6 debug: Fix ":droid" always toggling droid on/off even when given two arguments (":droid <side> off"). 2018-07-31 22:59:04 +02:00
gfgtdf
936516c83b fix game crashing when showing a too large tooltip
previously the game would go into an infinite loop at
https://github.com/wesnoth/wesnoth/blob/1.14.4/src/gui/widgets/window.cpp#L1046
when a tooltip doesn't fit on screen, this could in particular happen in
the mp lobby when hovering over the 'i' of a game that uses a ridiculous
amount of modifications.

I currently don't see any case where the game is actually able to 'fix'
a bad height that was reported from reevaluate_best_size. so i just
disable reevaluate_best_size for floating tooltips.

If there exists such a case, an alternative fix could be to change the
reevaluate loop in window::layout to also stop when a new iteration
returned the same size as the previous iteration.
2018-07-31 22:58:45 +02:00
gfgtdf
90fb50d70f improve wesnoth version warning further 2018-07-31 22:58:36 +02:00
gfgtdf
ba18e17e43 improve wesnoth version warning. 2018-07-31 22:58:28 +02:00
gfgtdf
610e4f2969 add server notifications about outdated wesnoth versions. 2018-07-31 22:58:18 +02:00
gfgtdf
f84d79e033 fix skip replay being active in later scenarios
in mp campaigns.
2018-07-31 22:58:09 +02:00
gfgtdf
eec8b674de fix require_scenario & require_era
previously both were broken:
1) 'require_scenario' was only checked if the scenario was installed
which obviously doesn't make any sense at all.
2) 'require_scenario' was read from the local scenario data instead from
the remote scenario.
3) 'require_era' was only checked when the scenario was not installed,
so people who do have an outated version of the era installed could not
join bacause it assumed require_era=yes in that case.
4) the server tried to read 'require_scenario' from the wrong wml node,
'require_scenario' is an attribute of [scenario] and not of savefile
toplevel.
2018-07-31 22:58:00 +02:00
gfgtdf
15c59037d3 mplobby: add debug info 2018-07-31 22:57:51 +02:00
gfgtdf
367aec2bb2 don't process a corrupted gamelist_diff further
fixes #3017, assuming that the error is actually casued by the
'process_gamelist_diff failed'

As process_gamelist_diff simply returns after getting an error its quite
likeley that the gamelist is then in a  corrupted state so we stop
processing it until we get a fresh gamelist.
2018-07-31 22:57:38 +02:00
gfgtdf
edc57d2388 add comment 2018-07-31 22:57:26 +02:00
gfgtdf
eb23ac5646 preserve traslatable strings in simple_wml.
previously it would happen that for example an attribute like
`side_name=_"female^Footpads"` in side would get its translatable mark (_)
removed after the game has started. This meant that observers that enterd
the game after it started would see the literal string "female^Footpads"
in the status side overview window.

The new code marks all translatable simple_wml attributes to make sure their
translatable mark is preserved along with their textdomain. It can still
happen though that attributes will appear in the the wrong textdomain area
after simple_wml processing though because in some cases note::output
might skip over textdomain markers. It is still not as bad as string like
"female^Footpads" appearing in the ui though.

An alterntive appraoch to fix this issue would be to carefully make sure
not to change any atributes of wml tags that can also contain translatable
attributes, which would probably imply not editing the wml objects received
by the client at all and instead storing the new information (in particular
side information like is_local=yes/no) in a seperate wml object. (that would
then be sended to the clients along with the original scenario wml objects.)

fixes #1420
2018-07-31 22:57:16 +02:00
gfgtdf
c4aacbe31f don't use std::pair
instead we use a custom struct. std::pair is bad becasue you never know
what "first" or "second" mean.
2018-07-31 22:57:06 +02:00
gfgtdf
44734570dd fix attacks beein wrongly disabled
as said in the comment, that get_special_bool might return the wrong value, as since 5f58cd7c6d the bc_vector no longer contains disabled attacks we can just remove this code.

fixes #3324
2018-07-31 22:56:53 +02:00
gfgtdf
97b5612691 ignore [delay] during preload,prestart and initial lua.
as the ingame ui is not shown yet, [delay] would only result in showing a black screen,

Also in the case of initial lua it might result in crashes because of the threaded loadingscren, or simply because parts of the ui are not initialized yet.
2018-07-31 22:56:41 +02:00
Iris Morelle
12a3b973b9 pofix: 1.14 announcement rules for 1.14.4
Also fixes a mistake from the 1.14.3 rules that caused "xxx MiB" to be
replaced with "xxx MB MiB" for all platforms. Oops. Nobody noticed
anyway (?).

[ci skip]
2018-07-31 14:59:59 -04:00
Severin Glöckner
c2064827e4 THoT S6: minor changes for difficulty and map
Uses an Orcish castle instead of destroyes human. Troll would maybe fit best,
but it doesn't fit well with the surrounding. Has now only 2 castle hexes.

On easy difficulty, reduced turns by two, it should be enought turns.
Also added one more enemy, as there are less wolves spawned on easy.
And income for Gryphons once again increased by 1, they are very expensive.

Reminding events have been adjusted to turns.

[ci skip]
2018-07-30 17:25:26 +02:00
Severin Glöckner
390d66fda1 THoT S6: Let the AI avoid the mage's hut
Until he is found. This also means one less villages for side 2, increased
their income thatfor,

[ci skip]
2018-07-30 17:25:26 +02:00
josteph
92bb1c263b THoT S6: Now that the player is told which hut to look at, don't trigger Ratheln if the player ignores the hint.
Suggested by @sevu.
2018-07-30 17:25:06 +02:00
sigurdfdragon
c2cf0288fc Update changelog 2018-07-29 12:43:56 -04:00
sigurdfdragon
46cc9a5289 SotA S21: Slight touchups
Only recruit level 2 to match what nagas arrive with.
2018-07-29 12:43:48 -04:00
sigurdfdragon
32a630bd3f SotA S21: Fix #3294 properly
It is the Saurians that have their males killed in S11, so the females
take revenge.
2018-07-29 12:43:41 -04:00
sigurdfdragon
7ced35839b Revert "SotA S11 & 21: Fix #3294"
This reverts commit a4bad90bad.

It is supposed to be the male Saurians that get killed in S11, and the
females seek revenge in S21.
2018-07-29 12:43:35 -04:00
josteph
f0ed45bde9 THoT S6: Let a Scout be the first to smell Ratheln's cooking.
[ci skip]
2018-07-29 17:51:33 +02:00
Jyrki Vesterinen
74d8cfa98e WML unit tests: port ability to override strict mode from 1.14
The ability isn't needed in master because none of the unit tests call
deprecated functions here, but it may be useful in the future or make
cherry-picking of future changes easier.
2018-07-28 08:18:59 +03:00
Jyrki Vesterinen
6450bada57 Lua: delete loadstring()
Fixes the vulnerability introduced in commit 52ae31efb2.
2018-07-28 08:16:00 +03:00
Jyrki Vesterinen
aa73b83600 Extend the first CVE-2018-1999023 unit test to also try loadstring()
Like @gfgtdf pointed out, loadstring() is still supported by Lua in the
name of backwards compatibility, even though it was deprecated in Lua 5.2
and is no longer mentioned in Lua manual. Thus, as of committing this it's
actually possible to load Lua bytecode.

Let's unit test this to ensure that we don't reintroduce this
vulnerability.
2018-07-28 08:12:48 +03:00
DisherProject
d13c451afb Liberty S8: Fix some event filters 2018-07-27 20:01:29 -04:00
DisherProject
f32dfaa917 Liberty S8: Remove unnecessary hidden side
Side 3 was composed by enemy reinforcements. Since they were
spawned on the right corner of the map, and since side 2
was blocked inside Halstead by and [avoid] tag, it was
necessary to add a new hidden side which could move freely
on the map.
If we upgrade the AI, removing the [avoid] tag, this hidden
side becomes unnecessary.
2018-07-27 20:01:29 -04:00
DisherProject
e63a15fc91 Liberty S8: General fix and cleanup to the AI goals
All sides will now head to the central fortress. Orcs
should now be a bit smarter, and they should not suicide
during the morning or the afternoon. The humans in Halstead
will initially remain inside their fortress, until the enemy
arrival.
2018-07-27 20:01:29 -04:00
DisherProject
4ced6c7526 Liberty S1-S7: Fire victory when enemies are defeated
Instead of checking whether there are no enemy units left
every time one of them dies, use the "enemies defeated"
event.
2018-07-27 20:01:29 -04:00
DisherProject
cbe2bcef6b Liberty S1: Filter event by condition instead of using an
if-then clause
2018-07-27 20:01:29 -04:00
DisherProject
ddf9949cff Liberty S5-S6: Replace deprecated keys
"share_maps" and "share_view" have been replaced in
favour of "share_vision"
2018-07-27 20:01:29 -04:00
Iris Morelle
3b91481a0c UtBS: Improve Eloh's attack animation timings
Also remove a Kate modeline I didn't intend to push.

[ci skip]
2018-07-27 19:32:30 -04:00
Iris Morelle
c56e8aa695 Sync 1.14 changelog
[ci skip]
2018-07-27 19:08:38 -04:00
Iris Morelle
6e1a861bda UtBS: New graphics for Eloh by me
There are two layers of halos and they are applied in a somewhat
convoluted fashion. I should probably explain why.

The bottom halo is designed so it's drawn *below* the main unit sprite
so as to not muddle the colours on it. Halos are normally drawn *on top*
of sprites.

The back halo is specifically masked so it's drawn behind the main unit
sprite without overlapping any of its pixels, but it's asymmetrical and
supposed to flip along with the unit sprite depending on the direction
it's facing. Halos do not do that currently, at least not without using
animation WML conditionals. Unfortunately, for some reason, using a
standing animation that's nothing but conditionals causes the game to
crash at the moment.

Taking all this into consideration, using the blit IPF is a much easier
mechanism to avoid both issues at once, even if it makes the code
slightly awkward.

If someone can think of an alternative method, they're more than welcome
to change the code as long as the sprite's composition remains exactly
the same as it is now. I'm just the artist in this case.

[ci skip]
2018-07-27 19:08:38 -04:00
josteph
a08b7c3ab3 THoT S10: Clarify objectives.
[ci skip]
2018-07-27 23:03:50 +02:00
josteph
5758c900e2 THoT S6: Rephrase Ratheln cue.
It didn't make sense for the dwarves to only notice "glowing" after night had ended.

[ci skip]
2018-07-27 23:03:22 +02:00
Jyrki Vesterinen
212601deab check_utf8.sh: don't check the second Lua bytecode test scenario
This avoids the other file with binary data.
2018-07-27 23:53:58 +03:00
Jyrki Vesterinen
8dc60ae98f check_utf8.sh: don't check the Lua bytecode file
This avoids one of the two files which are currently causing macOS SCons
builds to fail in the master branch.
2018-07-27 23:52:38 +03:00
loonycyborg
0c3ba36d68 scons: fix strict hardened builds on Gentoo 2018-07-27 16:28:23 +03:00
Jyrki Vesterinen
52ae31efb2 Lua: implement our own load() instead of monkey-patching Lua code
Monkey-patching has multiple problems. The biggest problem for a security
fix like this is that it's way too easy to forget to re-apply when we
update Lua to a newer version.

Instead, we now have the implementation of load() under our control and can
update Lua without risk of reintroducing CVE-2018-1999023.
2018-07-27 15:36:56 +03:00
gfgtdf
6b13a63bb0 wml test for cve-2018-1999023
this test whether we succesfully prevent the exceution and parsing of
precompiled lua chunks, which can be used to break the lua sandbox.
This test does not cover all affected functions in particular not the ai
code that loads lua chunks.
2018-07-27 15:36:56 +03:00
gfgtdf
2554c166dd disallow loading lua bytecode via load/dofile (CVE-2018-1999023)
This could otherwise be used to escape the lua sandbox, as described in
multiple sources. For example one can use it to reenable the os.execute
function to do shell commands

The affected functions were
load,loadstring,wesnoth.dofile,wesnoth.require and various places in the
wesnoth source where lua chunks were loaded for example by the ai code.

This commit also changes the lua source to change luas load (which is
the same as loadstring), alternatively we could add a wrapper around the
original load function that always passes "t" as third parameter, i went
this way mostly because it was easier to implement, but also because i
was not 100% sure that is is impossible to query the upvalues of a
function via lua (wesnoth disables debug.getupvalue but still).

There is also an occurance in the application_lua_kernel that was not fixed
because i assumed that umc cannot contian application lua scipts.

As further security measure we might want to disable printing the function
adress in luas tostring for c functions, this cannot be exploited by itself
but it can be used to defeat ASLR in some cases.
2018-07-27 15:36:56 +03:00
ln-zookeeper
386493790e Updated snowy hut tile icons 2018-07-27 14:00:35 +03:00
doofus-01
9042b0beb7 Additional village variations (#3342)
* revised and additional snowed hut villages, with night-light TOD variations

* remove spaces to keep column alignment
2018-07-27 13:32:12 +03:00
Jyrki Vesterinen
e961cc0899 Fix: we negate an unsigned integer
Negating an unsigned integer still returns an unsigned value
(in other words, always positive) which isn't what we want.
2018-07-27 11:35:54 +03:00
jostephd
6e31c83c64 Fix sorting of units by level in Recall List and Unit List (#3370)
Now the triangle points down when the list is sorted by level descending.
2018-07-27 10:29:02 +03:00
joeylmaalouf
96d8ee06b0 updated contributors list 2018-07-25 19:29:55 -04:00
joeylmaalouf
05c6e397ba Tutorial: standardize Menu references 2018-07-25 19:29:49 -04:00
joeylmaalouf
9240d6d23d Tutorial: provide more detail about the Status Table 2018-07-25 19:29:42 -04:00
sigurdfdragon
ee798121e4 DM: Add last breath dialog for Zorlan 2018-07-25 19:29:37 -04:00
sigurdfdragon
3cfa413cbc DM: Generalize death message so it works when Delfador is young and old 2018-07-25 19:29:31 -04:00
ProditorMagnus
625f18ab2e Make /q sl and status case insensitive 2018-07-24 22:26:30 +03:00
Toom
aab10daac4 Show "failed to fit" message with single timestamp (#3367)
Before:

20180724 17:21:37 error gui/layout: Failed to fit vertical list to requested rect; expected bottom edge was 277
20180724 17:21:37 error gui/layout: , actual bottom edge was 195
20180724 17:21:37 error gui/layout:  (top edge is 113)

After:

20180724 17:34:30 error gui/layout: Failed to fit vertical list to requested rect; expected bottom edge was 277, actual bottom edge was 195 (top edge is 113)
2018-07-24 17:57:05 +03:00
Nils Kneuper
36ecc030a6 updated British English translation 2018-07-23 23:16:44 +02:00
Toom
c0727bacf3 Fix 4801629ab1 typos
[ci skip]
2018-07-23 17:34:22 +03:00
gfgtdf
b684c8b3aa fixup update changelog.md 2018-07-23 17:33:41 +03:00
gfgtdf
4801629ab1 Update changelog.md 2018-07-23 17:33:30 +03:00
Jyrki Vesterinen
d8e2498dde Create a named struct for terrain name and movement pair
This allows the sorting logic top be shared between the sidebar and the
unit preview pane. It also means that we no longer need to create a lambda
to sort them.

I also refactored the generation of movement cost data in help. In
particular, we're no longer extracting the struct to named local variables.
2018-07-23 17:25:24 +03:00
lilinitsy
61b7e7298b Sort the movement costs in the tooltip in ascending order (#3305)
Sort movement costs in tooltip, unit preview pane, and unit description alphabetically.
2018-07-23 17:16:56 +03:00
Jyrki Vesterinen
aea5d67f93 Changelog: fix issue #3277 being mistyped as 3722 2018-07-23 15:13:56 +03:00
Martin Hrubý (hrubymar10)
097c89f916 Update README.md for Xcode builds 2018-07-23 09:42:49 +02:00
Iris Morelle
74cbae01c4 pofix: Rule for an http:// → https:// conversion in translatable strings 2018-07-22 07:31:32 -04:00
Iris Morelle
bb86afcb72 gui2/unit_recall: Fix i18n issues
The original commit adding the Rename Unit button marked two strings in
the C++ source for extraction without making them translatable.
2018-07-22 07:30:46 -04:00
Elvish_Hunter
af63d17e32 wmlindent: fixed crash on non-existent paths
Fixes #3346
2018-07-21 21:12:20 +02:00
sigurdfdragon
f6f1093661 SotA S21: Fix #3293: Nagas stealing villages
By having the nagas be able to recruit and put the gold to use.
Fits dialog better, improves play, & makes naga leader less suicidal.
2018-07-20 21:12:03 -04:00
Nils Kneuper
99cfb028d8 updated British English translation 2018-07-19 21:39:41 +02:00
Charles Dang
263ad96ad3 VS: updated README
[ci skip]
2018-07-19 19:41:24 +11:00
Severin Glöckner
0ca460efcd Macro reference: Add hint to clear variable afterwards
[ci skip]
2018-07-19 01:45:47 +02:00
Nils Kneuper
111b5db7b4 updated Bulgarian translation 2018-07-17 22:57:35 +02:00
Nils Kneuper
6295e82238 updated British English translation 2018-07-17 22:50:25 +02:00
Martin Hrubý (hrubymar10)
bc4d22dc72 Migrate links to https if available - Fwd c18537edc0 2018-07-16 19:07:08 +11:00
Łukasz Hryniuk
c11ac9081b Add about.cfg entry 2018-07-16 08:16:51 +11:00
Łukasz Hryniuk
349b18b216 gui2: allow renaming units in the Recall dialog 2018-07-16 08:16:51 +11:00
Celtic Minstrel
45674a3d79 Fix AI ignoring teleport locations when moving leader to leader goals 2018-07-15 10:56:17 -04:00
Celtic Minstrel
99233339dd wesnoth.find_path: Allow specifying custom flags (in particular teleport) when using a custom cost function 2018-07-15 10:56:17 -04:00
josteph
d2c8c1ae0d THoT S9: Implement a victory condition closer to the one described in the objectives.
The previous condition was, "Win as soon as Aiglondur and Angarthing
have each touched the signpost".  The new condition is, "Win as soon
as Aiglondur is on the signpost and Angarthing is next to him, or the
other way around".

[ci skip]
2018-07-15 16:29:54 +02:00
Severin Glöckner
74b39ef3d6 Tutorial S1: followup previous commits
- Removed need for quick trait by spawning quantain next to Delfador
- Disabled movement point tracking due to #3344
- Use only one [label] tag to place both labels
- Removed id's of later quintains, as they are not used
- added some whitespaces

[ci skip]
2018-07-15 16:29:46 +02:00
Andras Szell
e3a95cc039 Tutorial S1: prevent getting stuck next to Delfador, unable to end turn
Fixes #1584 1c - Delfador summons the puppet, you have 0 MP left but the
                 puppet is not adjacent to you, and can't attack or undo

Changed Delfador's initial position to match the quintain's, and made him
step away to summon in the original place next to us, so we don't need to
move again to attack after we reach him.
The movement points of the mage are now updated and he gained quick trait
to fit for the more movements he does.
Final movement also touched, so he does not seem to sidestep the new
enemies when leaving the map.
2018-07-15 16:29:46 +02:00
josteph
af71bfe9c7 WML: Support the the 'jamming' key in [unit].
This syntax is already in use in the test scenario.
2018-07-15 09:43:05 -04:00
Charles Dang
06c723636a Fixed base64 images not being translated to textures 2018-07-15 21:33:00 +11:00
Charles Dang
300197e9c0 GUI2/Dispatcher: pass the message parameter for message events around as const
Really no reason for it to be non-const. That would imply the message's contents should
be modifiable, but that doesn't make sense.
2018-07-15 16:49:49 +11:00
Charles Dang
b47b6f1359 GUI2/Dispatcher: simplified callback function aliases with an alias template
This guarantees all events have the same initial four parameters. Also improved documentation.
2018-07-15 15:49:37 +11:00
Nils Kneuper
e4da51adc3 updated Czech translation 2018-07-14 23:54:08 +02:00
josteph
f4aa5ac66a THoT S6: Highlight the hut mentioned in dialog.
[ci skip]
2018-07-14 21:41:58 +02:00
josteph
96fffa2182 THoT S3: Marth-Tak faces east before hailing Aiglondur.
[ci skip]
2018-07-14 21:41:58 +02:00
josteph
fbd08b006e THoT S4: Let the enemy recruit level 2 units on normal difficulty.
[ci skip]
2018-07-14 21:41:58 +02:00
Severin Glöckner
3c57546e89 THoT S6: improve mage appearance event
- is now less odd if the event is triggered from the map borders
- works with debug mode

[ci skip]
2018-07-14 21:39:27 +02:00
sigurdfdragon
d0931ae9cf DM: Fixup 370e50c 2018-07-14 13:35:21 -04:00
Jyrki Vesterinen
d11d8ec8e1 Help: Hide "Lit Stone Wall" terrain (#2966)
The terrain was deprecated in commit 64493b256f.
@Vultraz has said in comments of #2966 that deprecated terrains aren't
supposed to be shown in help.

Fixes #2966.

[ci skip]
2018-07-14 17:00:24 +03:00
Nils Kneuper
0a35507f3f updated British English translation 2018-07-14 11:02:35 +02:00
gfgtdf
08d907e570 add a comment 2018-07-14 16:57:37 +11:00
Charles Dang
c0b09315d1 Language Selection: declared an execute function 2018-07-14 16:20:34 +11:00
Charles Dang
637e69f271 Used the return value of modal_dialog::show instead of an explicit retval check when possible 2018-07-14 16:17:59 +11:00
Charles Dang
85e9b40495 GUI2: added/renamed widget data types aliases
Also moved the string_map alias into the GUI2 namespace and renamed it widget_item.
It's the same as utils::string_map, but this makes its purpose clearer.
2018-07-14 16:07:12 +11:00
Charles Dang
e62ec5f806 GUI2/Tree View: use NOTIFY_MODIFIED events instead of manual callbacks
Unlike other widgets where `this` is the event target, the tree nodes fire the event
with the tree widget itself as the target.

I had added a fire-event call in f97dc8ae12, but with
the target as the node. I don't think there was any way that would have worked...
changed.
2018-07-14 12:09:06 +11:00
Charles Dang
996551e6f7 GUI2/Tree View [Node]: formatting cleanup 2018-07-14 11:54:35 +11:00
DisherProject
d5e22a32c3 DM: add some TODOs 2018-07-13 20:28:23 -04:00
DisherProject
d0a369c65d DM S21: Add some visual effects
1) Give elves orcish bows
2) Animate the first two riders when they're spawned, so it
looks like they've been recruited
2018-07-13 20:28:23 -04:00
DisherProject
370e50c5a6 DM utils/sides.cfg: follow up FIXME 2018-07-13 20:28:23 -04:00
DisherProject
289af5ba1b DM S14: follow up TODO 2018-07-13 20:28:23 -04:00
DisherProject
4a9c6610d4 DM S08: Remove some (apparently) unused stuff 2018-07-13 20:28:23 -04:00
Nils Kneuper
fb4dbb3fce updated Japanese translation 2018-07-14 01:21:52 +02:00
Nils Kneuper
3a3bf21e37 updated Hungarian translation 2018-07-14 01:15:20 +02:00
Charles Dang
8da9f0cc04 GUI2/Tree View Node: used std::make_shared when possible
Child nodes were still managed with unique_ptrs in 1.14, so we couldn't use make_unique
there. Child nodes are now managed with shared_ptrs here on master.
2018-07-14 06:38:08 +11:00
Charles Dang
ae7d05e8fc MP Staging: move side nodes when changing teams instead of recreating them
Mp Join Game will require further refactoring; it recreates the entire tree when receiving data...
2018-07-14 06:32:44 +11:00
Charles Dang
fa7c967c0a GUI2/Tree View: added interface for moving nodes between parent nodes 2018-07-14 06:32:43 +11:00
Charles Dang
d5972c6f43 Synced 1.14.3+dev changelog section with the 1.14 branch
[ci skip]
2018-07-13 21:03:51 +11:00
Charles Dang
8fcd3f2a83 Reapply d0100758f8 2018-07-13 21:02:13 +11:00
Charles Dang
264389807c Upgrade to Lua 5.3.5 2018-07-13 21:02:12 +11:00
Charles Dang
8abb1965cb Fixup f7cf733 again 2018-07-13 18:30:52 +11:00
Charles Dang
64067dde09 Attempt to fixup f7cf733
Also made the map generator array static
2018-07-13 18:19:37 +11:00
Charles Dang
5bb72d7c89 Remove reference to players_changelog 2018-07-13 16:58:28 +11:00
Charles Dang
f7cf73307b Convert some more C arrays to std::array 2018-07-13 16:15:00 +11:00
Charles Dang
4c29a0dd58 Use '\t' instead of static_cast<char>(9) 2018-07-13 15:53:20 +11:00
Charles Dang
ce85c17020 Convert a few remaining C-style casts (for char) too static_cast 2018-07-13 15:48:20 +11:00
Charles Dang
5595c12e93 Removed players_changelog.md
[ci kip]

We decided to no longer use this and everything in here is also in the full changelog.
2018-07-13 08:45:50 +11:00
Nils Kneuper
9f16ce658b updated Spanish translation 2018-07-12 22:29:40 +02:00
Nils Kneuper
94b5e1fc52 updated Scottish Gaelic translation 2018-07-12 22:28:23 +02:00
Jyrki Vesterinen
95f19745ca Fix #2813: wrong chat color after a side is unassigned from a player
Regression from commit 36e9290.

As @gfgtdf pointed out in the bug report, because old_player was a
reference to the shared_ptr, resetting the shared_ptr in sides_ also
changed old_player, and thus 'the player lost his last side' check never
passed.

Thanks to @gfgtdf for figuring out the cause.
2018-07-12 07:35:19 +03:00
Severin Glöckner
5f7e8bd749 UtBS: change weapon name of the corrupted elf
to match the one of the Champion, and to match his sprite.

closes #3323
[ci skip]
2018-07-11 15:58:22 +02:00
Severin Glöckner
591b1cd68e TSG, end of campaign: Use linger mode to allow to review the current scenario.
Only after pressing the 'End Scenario' button the epilogue will be shown.

closes #3058
[ci skip]
2018-07-11 15:44:49 +02:00
Jyrki Vesterinen
1699c0d3f9 Fix #2789: lobby chat scrolls to top on new messages if not at bottom 2018-07-10 19:54:34 +03:00
sigurdfdragon
4fbeff273a Update changelog 2018-07-10 12:44:53 -04:00
sigurdfdragon
831e3e86d8 DM: Fix #3277
Make heroes have no upkeep, and remove hero status from character that
didn't need it. Minor touch ups.
2018-07-10 12:44:16 -04:00
Severin Glöckner
d4a6df034e TSG S4: improve magican's movement behaviour
- the movement restriction won't be applied if the magican is not
  in the caslte (due to the one exception).
- As for the exception, it's not enough if the magican has only one
  unit left, but this unit has to be on the caslte.

To sum up, the magican never leaves the castle, unless he has
(before recruiting) one last unit which is on the castle. (Maybe
from last turn's recruiting).
In case he left the castle, he goes back next to the keep next turn,
as leaders usually do.

[ci skip]
2018-07-10 01:59:58 +02:00
Charles Dang
d8426ac37a Updated changelog
[ci skip]

The chatbox entry was redundant.
2018-07-09 14:58:10 +11:00
Charles Dang
60950a797f Unit Recall: marked some sorting options as translatable
This matches Unit List.
2018-07-09 14:48:03 +11:00
Charles Dang
94db6ba8c5 Unit List/Unit Recall: simplified level sorting functionality 2018-07-09 14:47:24 +11:00
Charles Dang
c41da8255d GUI2: cleaned up a whole bunch of widget-related includes
gui/widgets/settings.hpp was rendered unnecessary in almost all dialog and widget files
as of 6759f41b1e, since it was no longer needed to implement
the internal functions wrapped by the REGISTER_DIALOG and REGISTER_WIDGET macros. Those
were register_window() and register_widget(), respectively.
2018-07-09 13:42:05 +11:00
Nils Kneuper
8b7410317a updated Chinese (Simplified) translation 2018-07-08 23:24:48 +02:00
Charles Dang
19c78fc1c2 Help: removed an unnecessary use of t_string as a map key 2018-07-09 08:03:44 +11:00
Iris Morelle
aa1976f090 pofix: Add rules for whitespace/dot count-changing commits
[ci skip]
2018-07-08 04:55:53 -04:00
Iris Morelle
de8d468b14 Fix excessive dots in ellipses in several mainline scenarios
[ci skip]
2018-07-08 04:49:37 -04:00
Iris Morelle
b8b403185e gui2/preferences: Use curly quotes in quoted text in tooltips
[ci skip]
2018-07-08 04:49:33 -04:00
josteph
dcbdac8ab5 Help: only use male_name/female_name if the unit has male/female variants. 2018-07-08 15:54:54 +11:00
josteph
a4b0de5ece Help: Use female_name and name as fallback when male_name is empty and don't list hidden traits.
This algorithm was lifted from help::generate_trait_topics().

Fixes #3284
2018-07-08 15:54:41 +11:00
josteph
29e814d8f4 THoT S7: Select Darchas so the narrator's reference to him isn't dangling. 2018-07-08 15:53:40 +11:00
Severin Glöckner
7ea951d5b9 TSG 04: Better implementation to protect the magican
The player can all the time view the stats of any unit in the sidebar. This allowed to
see that he doesn't attack because he has only one move. There is no way to see the
movement costs directly, and as long as they are higher than the max_moves it's not
possible to figure out that this is not AI behavior but a game restriction.

Additionally, as the player has to kill both leaders to continue, try to not let the
player camp around the castle for the rest of the game, by giving the leader a possiblity
to attack if he recruited last turn a unit.

[ci skip]
2018-07-06 22:33:56 +02:00
Jyrki Vesterinen
00d8548c24 Damage prediction: round very close slow probabilities to 0 or 1
In the case in bug #3321, damage prediction code somehow receives a
combatant whose probability to be slowed is very close to one of those
values but not quite it. I couldn't figure out how it's possible because
only damage prediction code itself is supposed to emit slow probabilities,
and it's not producing such a probability in this case.

Without more information, I'm simply fixing the bug by force. If the
probability is in the problematic area, we simply round it to 0 or 1. This
way such probabilities are impossible later on when we try to scale the HP
distributions so that they add to 1.

Fixes #3321.
2018-07-06 22:55:14 +03:00
Severin Glöckner
5bd6221c44 slight text edits
- missing dots in some MP strings
- superfluous space in some MP strings
-ran wmlinden on UtBS scenarios

[ci skip]
2018-07-05 08:38:26 +02:00
Severin Glöckner
2a5ea00ad0 Replace deprecated macro with terrain code in MP: Tombs of Kesorak
[ci skip]
2018-07-05 08:38:26 +02:00
Severin Glöckner
f5890c10a2 Change campfire timezones in MP: Tombs of Kesorak
Instead of having another ToD, the image of the current ToD is used,
but illuminated. This is a visual change, no gameplay changes included.

For the always dark one exists no immage, uses one from after the fall,
with slightly adjusted ToD shifting as it looked to weak.

The 1 hex small campfires look best with dusk.

part of #3056

[ci skip]
2018-07-05 08:38:26 +02:00
Severin Glöckner
f2a1acd97e Change Campfire timezones in TSG S8b
Instead of having another ToD, the image of the current ToD is used,
but illuminated. This is an visual change, no gameplay changes included.

Due to the lack of a save I could not view the result myself,
I chose the ToD shifting colors based on the other scenarios.

part of #3056

[ci skip]
2018-07-05 08:38:26 +02:00
Severin Glöckner
c7d8d23256 Change campfire timezones in UtBS S3
Instead of having another ToD, the image of the current ToD is used,
but illuminated. This is a visual change, no gameplay changes included.

The ToD shifting for 'dawn' looked better than for 'dusk', and was
conidered better looking than having no ToD shift compared to the
surrounding.

part of #3056

[ci skip]
2018-07-05 08:38:26 +02:00
Celtic Minstrel
41e757be9f Fix incorrect formatting of probabilities in the sidebar
This resulted from an incorrect use of std::setprecision, which sets the number of significant figures to display, not the number of decimal places.
2018-07-05 12:49:12 +11:00
josteph
045d331da8 WML: Don't add a \n before condition=lose objectives if there are no objectives listed before them. 2018-07-05 12:46:44 +11:00
Choicerer
02bdd17994 Fix team chat not being marked on remote clients (#3314)
Fixing the lack of stars on the remote client when sending a team/observer message.
This commit didn't modify the necessary lines in replay.cpp:
6aa3b3b
(of which the chat_msg::chat_msg one has already been fixed)

Fixes #3119
2018-07-05 12:46:43 +11:00
Choicerer
f50b644c30 Fixes broken tooltips for the unit_side flag and the unit name. (#3315)
Fixes #3306
2018-07-05 12:46:42 +11:00
Severin Glöckner
785f91065b NR: Disallow lvl 0 recruits after scenario 5.
Don't bother carrying them through the whole campaign.
This scenario seems like a good time, because there begins a new episide in the story
and all the level 1 advancement are available now too.

closes #3074

[ci skip]
2018-07-05 02:04:23 +02:00
sigurdfdragon
d22c1746e8 SotA S21: Set facing for naga appearance 2018-07-04 18:06:57 -04:00
sigurdfdragon
7d60eeeefb Update changelog 2018-07-04 17:43:42 -04:00
sigurdfdragon
2f710f83bf SotA S11 & 21: Fix #3294
Adjust units to have appropriate gender for story reasons.
2018-07-04 17:13:15 -04:00
sigurdfdragon
fd43d8454c SotA S16: Simplify dialog to fix #3291 2018-07-04 13:52:48 -04:00
Severin Glöckner
a62264412d DiD S10: add a redraw
apparently it happens normally only after dismissing the objectives

[ci skip]
2018-07-04 15:45:39 +02:00
Severin Glöckner
090ad3140f TSG S4: prevent leader of the undeads from suiciding
This is generally a problem with most leaders, but here it's worse.

Also changed his keep to the ruined version.
(Not the ajdacent castle tiles as it looks better that way.)

[ci skip]
2018-07-04 15:45:39 +02:00
Severin Glöckner
a66b30312b wmlxgettext: insert links which use ssl
[ci skip]
2018-07-04 03:46:37 +02:00
newfrenchy83
411eb6105d Update CB project (#3307) 2018-07-03 20:50:36 +11:00
Severin Glöckner
5dc80e7428 TSG S5: fix an unlikely scenario outcome
In case the player goes south and runs away fromt he bandits, and defeats
the lich first, then the choice to side or not with the bandits would
happen very late.
In case he allied with them and the other undead leader still lived, he
could end the scenario still by triggering "enemies defeated". If they were
already defeated, the scenario could not end anymore. Furthermore, the
storytext doesn't make sense anymore, at least the ending dilogue would
miss,
In case of siding with the elves one can still win by defeating Urza Afalas.
and the story still makes sense,

To solve this, in this special situation the player has no choice anymore,
the path of the elves is chosen.

(the diff may be hard to read; a good part has been wrappend with an [if])

[ci skip]
2018-07-03 04:12:51 +02:00
josteph
ea62caadf0 TSG S05: Merge all instances of [objectives].
Suggested by @sevu.
2018-07-03 00:48:34 +02:00
josteph
f4ba5cbcb8 TSG S05: Hide completed objectives.
Fixes #3031.
2018-07-03 00:48:34 +02:00
Charles Dang
c39aa72f56 Fixup 7807694
[ci skip]
2018-07-03 06:58:31 +11:00
Charles Dang
78076941a0 DiD S6: fixed previously stored orc leader ending up in the wrong place (fixes #3304)
[ci skip]
2018-07-03 06:48:57 +11:00
Charles Dang
e2fd9749a6 Re-enable the --new-widgets tests for general dialogs 2018-07-03 04:44:13 +11:00
Martin Hrubý (hrubymar10)
dc6d5850f5
Fix Xcode project after 458dd284b8 2018-07-02 18:59:35 +02:00
Charles Dang
162b9de330 Updated VS projectfile
[ci skip]
2018-07-02 22:25:51 +11:00
Charles Dang
458dd284b8 GUI2: removed 2010 experimental listbox
This was never finished, is not maintained, suffers from a lack of features the "old" listbox
class now has, and seems (according to the logs) to be have been superceded by the pane widget.
At the very least, the pane widget seems to be what mordante was working with in his early
prototype of a new addon manager, and not this 2010 list class.
2018-07-02 22:22:17 +11:00
Severin Glöckner
9a37fe3a07 copied German translation to maser
primary reason is rather to have less problems if
someone uses the master files when translating for 1.14

[ci skip]
2018-07-02 04:20:47 +02:00
Charles Dang
9fe86315f5 GUI2: dropped a remaining t-prefix from a type 2018-07-02 13:08:48 +11:00
Charles Dang
6cc3d1427c Disable in-game HUD for now
Need to sort out the problems with dispatching events to the HUD or the gamemap, respectively.
Disabling the HUD for now so it should be possible to interact with the map in case someone
wants to work on its rendering.
2018-07-01 23:41:08 +11:00
Nils Kneuper
478df79f31 updated Chinese (Traditional) translation 2018-07-01 11:09:28 +02:00
newfrenchy83
882eeb52ab Enable C++17 in Code::Blocks 2018-06-30 11:42:45 +03:00
Jyrki Vesterinen
d8eada856a Fix build 2018-06-30 10:57:42 +03:00
Jyrki Vesterinen
3a5c2df0a1 Remove unnecessary heap allocation 2018-06-30 09:47:37 +03:00
Charles Dang
fa01fb14d2 MP Join Game: cleaned up implementation of the recent players-choose-factions changes 2018-06-30 17:23:17 +11:00
gfgtdf
a2a4dff050 fix code dublication of mp_join_game::show_flg_select
this also fixes a bug where the side number in the initial flg dialog would be off by one.

This is also a slight behviour change where not finding [era] in mp_join_game::fetch_game_config no longer throws config::error but just returns false (=cannot join game)
2018-06-30 01:12:15 +02:00
gfgtdf
0296b6068c add a comment 2018-06-30 01:11:54 +02:00
gfgtdf
c555127552 mp join: fix crash when the dialog is updated while the flg dialog is open.
we cannnot call show_flg_select from inside the select_leader_buttons callback because that select_leader_buttons might be deleted/recreated while that dialog is open whihc leads to crashes, so what we do is executing the show_flg_select
 in a seperate callstack by using a 0 ms non-repeating timer
2018-06-30 01:08:07 +02:00
gfgtdf
2dd6557449 cancel faction_select when the game starts
or when the hosts assigned  control of  that side to another player.
2018-06-30 01:07:50 +02:00
gfgtdf
c805897797 make flg manager not store confg& side_
in the non-host case the clients might get updates that change the [side] config while the flg dialog is open which might result in invalid pointers,  note that flg_manager::default_leader_cfg_ is still there but this is no problm because that is never dereferenced it's only compared to other pointers.

we also make a copy of all [multiplayer_side] on the non hosts side for the same reason.
2018-06-30 01:07:40 +02:00
gfgtdf
5ba389111e allow non hosts to change factions later.
previously players had to leave an rejoin the game to change their faction.
this was most annoying in coop games where you want might want to choose
your faction in consultation with the other players. Also you previously could
not even checkout the different available factions again after you joined
the game.
2018-06-30 01:07:30 +02:00
gfgtdf
26b5ca55e4 disallow attacking with disabled attacks via [do_command]
this fixes some rare cheats in mp.
2018-06-30 01:06:59 +02:00
pentarctagon
649fdc9a62 Remove unused images from Dead Water.
Also confirmed via PM with beetlenaut that they can be removed, and aren't supposed to still be there.
2018-06-29 15:35:22 -05:00
Charles Dang
2ad6b60c94 CVideo: tweaked non_interactive logic
"Fake interactive" mode seems like it was meant to be an interactive version of fake mode.
However, since we're using it to stop the UI drawing and the unit tests (which use it)
don't seem to display a window at all (not entirely sure why), it's weird that "fake interactive"
mode would be considered interactive.
2018-06-30 05:26:36 +11:00
Charles Dang
87ae234022 Revert recent test changes 2018-06-30 04:02:55 +11:00
Charles Dang
55caeebffe More testing... 2018-06-30 03:54:42 +11:00
Charles Dang
58110b6818 Fixup b0be17b 2018-06-30 03:41:46 +11:00
Charles Dang
b0be17b398 Experiment: don't run the unit tests in fake interactive mode
This might not be needed anymore now that we no longer have a framebuffer surface.
2018-06-30 03:28:30 +11:00
Charles Dang
98ddc311fc Preferences: added a mention of the in-game accelerated speed toggle
[ci skip]
2018-06-29 18:21:55 +11:00
Charles Dang
10e663ed6c Preferences: shifted the Skip AI Moves button around
[ci skip]

Makes it clear it's not intrinsically tied to the Accelerated Speed factor.
2018-06-29 18:21:55 +11:00
Charles Dang
cb7a679142 Preferences Dialog: drop characters_per_line from hotkey list
[ci skip]

For some reason, this made the entire page stack thinner than it should be. I have
no idea why, and I'm not sure wrap= here instead does anything (namely, wrap if it
gets too long), but it's better than what was happening before.
2018-06-29 18:10:02 +11:00
Charles Dang
226a7f7d02 Removed preference to disable halos
There's really no reason to have this anymore. It was (AFAIK) introduced years ago
as a performance-saving measure, then was moved to Advanced Preferences in 1.13 since
modern PCs mostly have no issues. With accelerated rendering, there's even less of a
reason to have this.
2018-06-29 15:07:48 +11:00
Charles Dang
399851d035 Sneaky C-style arrays be hiding
Also dropped some unused code in unit_type.

And there's still one in language.cpp, but I'm not entirely sure if it's safe to
drop the last empty entry there so I left it.
2018-06-29 14:55:02 +11:00
Gunter Labes
51b5549bd2 Fix line endings
[ci skip]
2018-06-28 22:02:17 +02:00
Charles Dang
9e29c2f1d1 Editor: don't make unit type copies in the editor palette 2018-06-29 05:53:44 +11:00
Charles Dang
292d6f407c Plugins/Context: removed C-style array ctor and use
This likely existed because this code was added in 2014 before we switched to C++11
and initializer lists.
2018-06-28 17:21:54 +11:00
Iris Morelle
ceca46c553 wmllint: Exit with non-zero status after failing to read any directories
[ci skip]
2018-06-28 00:32:18 -04:00
Iris Morelle
fbc9ac5a52 wmllint: Skip inexistent paths passed in the command line
Fixes issue #3286.

[ci skip]
2018-06-28 00:27:28 -04:00
Jyrki Vesterinen
7fc6a23643 Fix insufficient struct initialization in init_mouse_location()
See pull request #3252. This is the fix @Vultraz prefers to the PR.
2018-06-28 06:37:40 +03:00
Charles Dang
9c311e2ca5 MP Lobby: escape any game name formatting *after* receiving it from server
This avoids an issue where people could still apply formatting by using an older client.
Granted, any formatting would still appear in-lobby to anyone using an older client, but
this at least prevents the possibility of formatting appearing indefinitely if a game host
happens to never update their own client.
2018-06-28 10:42:44 +11:00
Charles Dang
0cbbed2832 Updated a credits entry regarding the Dunefolk
[ci skip]
2018-06-28 10:42:44 +11:00
Charles Dang
87fcacbd28 Revert "MP Create Game: escape any formatting applied to game name"
This reverts commit 58a2e23a0c.
2018-06-28 10:42:19 +11:00
Charles Dang
58a2e23a0c MP Create Game: escape any formatting applied to game name
This is a good point since it ensures any place that might use the title before the lobby
(don't think there's any such places right now) won't inadvertently get formatted.

Also might be worth looking into a way to just strip formatting completely.
2018-06-28 09:41:46 +11:00
Iris Morelle
c92e167a14 wmllint: Leave gzipped binary files alone, they're not safe for consumption
Fixes wmllint crashing like this upon encountering a gzip tarball in an
add-on:

  Traceback (most recent call last):
    File "/home/shadowm/bin/wmllint-1.14", line 3188, in <module>
      for fn in allcfgfiles(directory):
    File "/home/shadowm/bin/wmllint-1.14", line 2944, in allcfgfiles
      if interesting(os.path.join(root, name)):
    File "/home/shadowm/bin/wmllint-1.14", line 2927, in interesting
      return fn.endswith(".cfg") or is_map(fn) or issave(fn)
    File "/home/shadowm/src/wesnoth-1.14/data/tools/wesnoth/wmltools3.py", line 270, in issave
      return firstline.startswith("label=")
  TypeError: startswith first arg must be bytes or a tuple of bytes, not str

[ci skip]
2018-06-27 03:42:58 -04:00
gfgtdf
ff82a007d5 wb: fix wrong simulated movement points when planning to capture a village. 2018-06-27 11:20:34 +11:00
gfgtdf
17a9164904 wb: remove outcommented code 2018-06-27 11:20:33 +11:00
gfgtdf
3a28c3a346 wb: don't remove invalid actions from other players
this would bring the whiteboard data of the differnt clients out of sync  which could be a problem since the wb network protocoll identifies the actions to be removed ot replaced by index.
2018-06-27 11:20:32 +11:00
gfgtdf
ee00b88427 wb: dont send delete of actions of other sides 2018-06-27 11:20:32 +11:00
Jyrki Vesterinen
4bda3e7311 Fixed saving a map as a scenario not enabling scenario editor tools 2018-06-26 20:31:30 +03:00
Andras Szell
1ea4149a44 Fix: add redraw to narrator's message so village count is refreshed
Fixes: https://forums.wesnoth.org/viewtopic.php?f=21&t=48370

In the tutorial when we occupy the first village the message tells us the
village count got incremented, but in the old version it was incremented
only afterwards. Non-narrator messages were updated properly. By adding the
redraw, narrator messages triggered by capture event produce the same
result as other speakers.
2018-06-26 18:45:17 +11:00
DisherProject
902cf6dcfb Fix weapon specials marked as inactive 2018-06-25 21:30:52 -04:00
Charles Dang
0aa60a7b4c Revert "Swapped the first watch and second watch ToD graphics"
[ci skip]

This reverts commit 11ca2d8ad8.
2018-06-25 22:49:19 +11:00
Charles Dang
893860321a Unit Advance: left-align header
[ci skip]
2018-06-25 21:59:45 +11:00
Charles Dang
b40c666ad2 Convert a bunch of C-style arrays to std::array 2018-06-25 18:38:00 +11:00
Charles Dang
fbcdec7142 Lobby Data: removed unused era_short field 2018-06-25 18:04:10 +11:00
Charles Dang
3147be8771 Fixup 862b086 2018-06-25 17:03:54 +11:00
Martin Hrubý (hrubymar10)
fe8e1ce397
Fix Xcode project after dd69107c9b 2018-06-25 07:45:42 +02:00
Charles Dang
862b086ba9 Fixup tests for 4eee386 2018-06-25 16:38:23 +11:00
Charles Dang
dd69107c9b Removed scaling algorithm customization
We're going to be using NN scaling for the map, and that's already handled automatically
by SDL (and in the future, OGL). We don't need these settings for surface SCALED_TO_ZOOM
and SCALED_TO_HEX scaling. In any case, if we want to scale a surface to zoom or hex, it
will almost certainly be for map rendering (such scaling methods don't make sense in the
UI, for example), so just defaulting to NN is simplest.

As for why I've decided to stick with nearest-neighbor scaling for zoom, it happens to look
a lot better when done on the GPU than on the CPU for some reason (perhaps having to do with
the old rendering pipeline in which we were doing surface scaling), and it's better to have
a consistent scaling look as you zoom in, especially if we wanted to do animated zoom-ins.

This change drops the option to use Linear or xBRZ scaling for map zooming. This was already
the practical case due to me converting map rendering to use textures. NN was used for all
zoom levels, and it's fast and looks good.
2018-06-25 16:37:27 +11:00
Charles Dang
feb99c384a Cleaned up a few game_config_manager.hpp includes 2018-06-25 15:15:25 +11:00
Charles Dang
4eee386664 Stop passing a milion game_config refs around during game initializaton
There are only 3 places where it's actually really needed. Used the game_config_manager
singleton to retrieve a reference in those cases.
2018-06-25 14:57:05 +11:00
Charles Dang
11ca2d8ad8 Swapped the first watch and second watch ToD graphics
[ci skip]

See #1905.
2018-06-25 13:41:46 +11:00
Charles Dang
cd3c13aca2 Cleaned up addon loading process
This makes it so addon metadata (title, version) will be fetched from _server.pbl if
present and _info.cfg if not (see #3278).

This also eliminates the temporary addon_source struct and unifies the metadata parsing
and actual loading stages. They used to be separate since single-file addons were a
thing, but those were removed in 3f640b8e71.

Also a bunch of minor code cleanup.
2018-06-25 07:15:36 +11:00
josteph
fb88f40b61 Replay: Don't disable the "Point of view" button after reset
Fixes #3107
2018-06-24 18:48:52 +03:00
Iris Morelle
1db6fb393e campaignd: Detect .po files in add-ons and add them to the list of locales 2018-06-24 04:52:56 -04:00
Martin Hrubý (hrubymar10)
583b0f14b4
Remove old_markup.*pp from Xcode project 2018-06-24 09:18:21 +02:00
Iris Morelle
e46c05162f sound: Halt sound sources that go inaudible instead of fading them out
Fixes #3280.
2018-06-24 00:36:36 -04:00
Charles Dang
15917733e0 GUI2: removed legacy DescriptionWML parser
It's no longer needed.
2018-06-24 04:15:58 +11:00
Charles Dang
5c860aee48 GUI2/Message: removed deprecated handling of legacy DescriptionWML
Left a TODO to implement the "specify options with a single string" thing the
old comment mentioned.
2018-06-24 04:15:58 +11:00
Charles Dang
c8a8b82b9f Game Events/Menu Item: removed deprecated handling of legacy DescriptionWML 2018-06-24 04:15:57 +11:00
josteph
bad6897cbc Revert "Excluded data/test/ from tarball"
This reverts commit c934825607.

Keep data/test/ in 'scons dist' tarballs to match official tarballs.
2018-06-23 09:33:30 +03:00
josteph
0ee4854157 Fix 'scons dist'
This makes 'scons dist' work, although the resulting tarballs are not
yet identical to cmake tarballs.

Remove awk usage made obsolete by the git transition
(7f85fa000c).

Update src/revision.hpp reference to use src/revision.h.  The former
name is unused since at least 7625b1e079.
2018-06-23 09:33:30 +03:00
Charles Dang
aca7d4e6df Select Orb Colors: used a widget iterator instead of a walker
The documentation indicates you're not really meant to use the walker directly.
They're part of the implementation of the iterators. They could be used directly,
as shown here, but this is shorter.
2018-06-23 16:29:53 +11:00
Charles Dang
1eaa51b3f9 GUI2/Iterator: added some alias templates and a get() function 2018-06-23 16:27:35 +11:00
Charles Dang
1778dd8581 Actually fixup c3ed9d2bc7 2018-06-23 16:27:22 +11:00
Charles Dang
cd3f7fd8e9 Revert "Fixup c3ed9d2"
This reverts commit 39efb7a2e4.
2018-06-23 07:43:53 +11:00
Charles Dang
39efb7a2e4 Fixup c3ed9d2 2018-06-23 07:26:02 +11:00
Charles Dang
c3ed9d2bc7 GUI2/Iterator/Policy Order: updated for 3bc7c6a 2018-06-23 07:18:52 +11:00
Charles Dang
3bc7c6a3a0 GUI2: manager walker objects with unique_ptrs from the get-go
Needed the extra includes since walker_base's dtor needs to be visible to
unique_ptr's ctor.
2018-06-23 06:54:16 +11:00
Charles Dang
48c13761cc Updated changelog
[ci skip]
2018-06-23 06:03:50 +11:00
Charles Dang
f59f68a527 GUI2/Unit Preview Pane: fixed default race icon not showing for units
Missed in 207e763401. Was only working for unit types.
2018-06-23 05:50:12 +11:00
Charles Dang
6920729812 Pango/Escape: used a stringstream for constructing the escaped text 2018-06-23 04:46:03 +11:00
Charles Dang
b6a0b2cb87 Drop Down List: added documentation and did some code cleanup 2018-06-23 04:41:19 +11:00
josteph
46fb1b6d48 Rename unit_recall_default_compare to default_compare 2018-06-23 04:40:43 +11:00
josteph
5316a83349 Unit List: Sort by XP as second criterion when sorting by level.
Fixes #3260.
2018-06-23 04:40:42 +11:00
Severin Glöckner
37566db87c NR S5a: clarify text
[ci skip]
2018-06-22 18:51:08 +02:00
Pentarctagon
c954117677 Disabling hardening on Windows due to tdm-gcc's poor support.
As per sigurd's trial and error: RELRO's options are unknown entirely and -fstack-protector-strong results in compile errors.  Building with just PIE and _FORTIFY_SOURCE enabled does then compile, but results in a broken executable.
2018-06-22 08:46:34 -05:00
Severin Glöckner
e1cd47b8ec NR S7a: remove dots from objectives
[ci skip]
2018-06-22 11:57:55 +02:00
josteph
175aa81941 MP Faction Select dialog: Always show the leading unit information, never "Unknown Unit". 2018-06-21 06:36:54 +03:00
Jyrki Vesterinen
18c266c2e7 Removed code that creates a help_manager
Adjusts the changes for commit 20a58fd8f8.
2018-06-21 06:34:27 +03:00
josteph
a8f83f6e68 MP Faction Select dialog: Show leader unit details.
If the leader hasn't been discovered, the "Unknown Unit" topic will be shown.

Fixes #1491
2018-06-21 06:30:20 +03:00
Nils Kneuper
e94af64b8d updated Slovak translation 2018-06-20 22:02:22 +02:00
Nils Kneuper
63e4c16f1d updated French translation 2018-06-20 22:01:36 +02:00
josteph
8481927a5a GUI: Fix the direction of the arrow on a listbox sort column header.
This affects the files list in the the "Load Game" dialog.
2018-06-20 18:47:11 +11:00
Pentarctagon
0a7ed44c08 Remove unused test file and images. 2018-06-20 18:46:01 +11:00
newfrenchy83
9bcaf3a897 Update wesnothd.cbp 2018-06-19 21:03:25 +11:00
newfrenchy83
cffd51a425 Update wesnoth.cbp 2018-06-19 21:03:25 +11:00
Iris Morelle
0c2298d8c2 config/cache: Ensure built-in symbols like WESNOTH_VERSION are always defined
Half-fix for issue #1634 and issue #1924.

The issue that remains to be solved is that on subsequent sessions after
a campaign has failed to load, it is possible for the game to generate a
cache entry for it that only contains the main menu WML for it.
Apparently the config cache transactions mechanism causes the game to
try to generate a cache entry with the wrong defines (a define set that
doesn't include the campaign's symbol, for instance) instead of the ones
that are actually needed and used to match the cache entry's filename
via checksumming. As a result, on subsequent sessions the failed
campaign is aborted with "failed to load the scenario" instead of
displaying the real WML error again (since the error is not hit again if
it depends on the campaign's symbol being defined).

In the meantime, this at least removes the red herring error and makes
the underlying issue a bit more visible. It's a very crude hack but it
does the job.
2018-06-18 18:34:02 -04:00
Severin Glöckner
9d95aa776c SotA: reuse mainline string for ancient lich
[ci skip]
2018-06-18 20:11:29 +02:00
loonycyborg
f597494157 flatpak: pass hardening options when building static boost 2018-06-18 12:49:21 +03:00
Charles Dang
c5d6f695dd GUI2/Chatbox: limit input to 256 characters (fixes #3267)
[ci skip]
2018-06-18 20:28:33 +11:00
Iris Morelle
6b2ca32026 U does not precede G in the English alphabet
[ci skip]
2018-06-18 04:49:54 -04:00
Iris Morelle
cdc8da25ae wesnothd: Fix lobby messages and whispers not being truncated as they should
For lobby messages, there was a length cap in place already, but the
truncated message was lost in processing because it ended up in a WML
document that isn't the one relayed to listening clients.

On the other hand, whisper messages were missing the truncate logic
entirely. Oops.

(The logic for in-game messages does truncate messages correctly as far
as I can tell, and additionally the client UI doesn't allow overlong
messages.)

Thanks to Soliton for pointing me towards the faulty code.
2018-06-18 04:48:29 -04:00
Iris Morelle
be41a692fb wesnothd: Only disclose the number of online admins to admins using adminmsg 2018-06-18 00:30:16 -04:00
ln-zookeeper
a98c658742 UtBS: Cropped Kaleh's base sprite back to 72x72
[ci skip]
2018-06-17 11:05:05 +03:00
ln-zookeeper
a702674da2 EI S17b: Prevent spell breaking effect playing out twice (fixes #3254) 2018-06-17 10:53:32 +03:00
Iris Morelle
7294878745 pofix: Add rules to address typographical fixes to race descriptions
NOTE: the rule for the "true orc" case does not work. The string in
question will just have to be fuzzied.

[ci skip]
2018-06-17 02:01:58 -04:00
Iris Morelle
61e94c21a9 Fix several typographical style errors in recent race descriptions
[ci skip]
2018-06-17 01:54:10 -04:00
josteph
d95efd3409 Preferences: Improve label and tooltip of 'Accelerated speed' slider. 2018-06-17 10:42:48 +11:00
josteph
e126e5ba36 Preferences: Keep the acceleration speed slider enabled even when the checkbox is disabled.
Apparently, this also causes the slider's value to be saved when dismissing the dialog with the checkbox disabled.

Fixes #2741
2018-06-17 10:42:47 +11:00
Pentarctagon
2771582222 Fixup hardening options for Windows. 2018-06-16 13:29:15 -05:00
doofus-01
41adc41093 UtBS S08: mostly cosmetic changes to map 2018-06-17 00:32:40 +11:00
doofus-01
13ec0493fc UtBS S06b and S07b: cosmetic changes to maps, to make them more fitting with dialogs 2018-06-17 00:32:39 +11:00
doofus-01
ea3ee2a336 UtBS S06b: make sure dwarf sergeant is facing the right way in comic-relief dialog 2018-06-17 00:32:39 +11:00
doofus-01
a3294cd04d change sun-sylph halo to be warmer, sunny color, instead of clean, holy color 2018-06-17 00:32:38 +11:00
doofus-01
f0b963a2b1 slight tweak to Kalehs base sprite 2018-06-17 00:32:37 +11:00
doofus-01
5fbd494244 UtBS S05: replace troll camps with actual troll camps instead of orc castles 2018-06-17 00:32:36 +11:00
doofus-01
4b1a06a82d UtBS S04 and S05: some variations in scenery items 2018-06-17 00:32:36 +11:00
Nils Kneuper
37ccd83215 updated Slovak translation 2018-06-16 11:15:34 +02:00
Charles Dang
30121aeb9c Select Orb Colors: cleaned up dialog implementation
Also fixes #2958 in the process since the entire setup process isn't repeated
when resetting selections.
2018-06-16 19:58:00 +11:00
Charles Dang
ea2ae55159 Attempt to fix console spam about images not drawing when running the tests
I don't think there's really any point drawing the UI in non-interactive mode.
2018-06-16 15:20:23 +11:00
Charles Dang
f54b3f7225 GUI2/Multimenu Button: fixed maximum_shown defaulting to 0 instead of 1
Fixes the campaign selection dialog's modification dropdown saying "1 other" for
the first mod you select.
2018-06-16 15:06:49 +11:00
Charles Dang
23740ea3cf GUI2/Multimenu Button: store max shown count as an unsigned int
A negative count here makes no sense...
2018-06-16 15:03:45 +11:00
Charles Dang
f95dc40f13 Cleaned up two emplace_back calls 2018-06-16 14:56:12 +11:00
Charles Dang
e8bd3c26d2 GUI2/Menu Button: store selected index as an unsigned int
Also initialized it to 0 in the ctor instead of relying on that being set
via set_values().
2018-06-16 14:54:58 +11:00
Charles Dang
3526aa8e86 Fixup unused parameter 2018-06-16 14:26:07 +11:00
Charles Dang
c2c613325b Faction Select: fixed changes persisting even if you cancel the dialog 2018-06-16 14:03:01 +11:00
Charles Dang
0632f91bd6 Faction Select: declared an execute() helper 2018-06-16 13:47:25 +11:00
Charles Dang
a5169f7c50 GUI2/Menu Button: allow changing selections with the scrollwheel (closes #3251)'
The changelog entry is under 1.14.3+dev since this is going to be backported.
2018-06-16 13:43:42 +11:00
Charles Dang
55f14ff22c GUI2/Menu Button: changed callbacks to NOTIFY_MODIFIED ones
menu_button doesn't even actually inherit from clickable_item. The only reason
[dis]connect_click_handler was declared in this class is the original implementation
was copied extensively from the Button widget.

Using NOTIFY_MODIFIED also means callbacks can fire if set_value/set_selected is used
on a menu_button.

The [dis]connect_click_handler functions were also removed from multimenu_button. All
callbacks for this widget type already used NOTIFY_MODIFIED signals.
2018-06-16 13:26:29 +11:00
Charles Dang
2d9b7d82c6 GUI2/[Multi]Menu Button: removed retval handling
Retvals are only relevant for widgets that are supposed to trigger something
like a window closure, and that makes sense for neither of these widgets. The
only reason the Menu Button widget has it is its original implementation was
largely copied from the Button widget, and the Multimenu Button widget copied
from the Menu Button widget.
2018-06-16 12:53:11 +11:00
Charles Dang
d7edb83b16 GUI2: added a bunch of missing virtual specifiers 2018-06-16 12:46:42 +11:00
Steve Cotton
ad7bc19dd9 Prose: the Storm Trident's description uses "merfolk" (issue #2936)
Also update Dead Water's copy of it to use race= instead of a
list of unit types (as done for the core object in 613dd431).
2018-06-15 21:02:56 +02:00
Steve Cotton
d5f6c17239 Dead Water: Change "mermen" to "merfolk" (part of #2940)
This commit excludes changes to S05 Tirigaz, I think changing the dialogue
there is going to be more complicated, and it's better for that to have a
separate PR.
2018-06-15 21:02:56 +02:00
Steve Cotton
94dd2880c6 DW: Change the team name from Merman Forces to Merfolk 2018-06-15 21:02:56 +02:00
Pentarctagon
da6ebc7423 Fixup for osx hardening options. 2018-06-15 02:18:32 -05:00
Pentarctagon
3290961db2 Enabled hardened executables by default.
The result of running "hardening-check wesnoth" now shows:
* Position Independent Executable: yes
* Stack protected: yes
* Fortify Source functions: yes (some protected functions found)
* Read-only relocations: yes
* Immediate binding: yes
2018-06-15 01:31:31 -05:00
Charles Dang
01d37ca795 End Credits: reduced text surface size by 42%
[ci skip]

Really no reason for the text area to grow since the text is set in pre_show and
therefor the widget is always the right size. >_<
2018-06-15 13:21:11 +11:00
Steve Cotton
ce093e2290 DW S05: Add a po hint about the orc saying "mermen" (part of #2940) (#3243)
The orc calls them fish-men several times, so changing it to "merfolk"
wouldn't fit.

Also a whitespace fix from wmlindent.

[ci skip]
2018-06-13 13:55:04 +02:00
ln-zookeeper
c9bb31d1cc EI S11: Fixed missing prisoners (fixes #3237)
The problem was introduced by commit 0f511e8 due to the [modify_unit] tag apparently causing prisoners to disappear because technically they were duplicates as they had merely been unstored and still existed on the recall list as well.
2018-06-12 23:16:44 +03:00
Iris Morelle
d05de7ced8 doc/wesnoth(6): 'none' is a keyword in the --log-<level> description
[ci skip]
2018-06-12 03:40:15 -04:00
Iris Morelle
e636549497 pofix: Update with 1.14.3 -> 1.14.3a (macOS) rules for the website
[ci skip]
2018-06-11 18:14:50 -04:00
Thom Diment
b3c40498d8 DW 5 Tirigaz - Changes to orc leader death event (#3103)
DW 5 Tirigaz - Changes to orc leader death event

Fixes #3092 - Updates objectives if orc leader is killed first, and gives additional dialogue
Fixes #3903 - Gold event doesn't fire if ghosts kill the orc leader
2018-06-11 14:40:47 +02:00
loonycyborg
c78e95cf6c Update flatpak manifest 2018-06-11 12:18:20 +03:00
doofus-01
636575627d UtBS S12: Make alien central body vulnerability more visible to player 2018-06-11 16:43:36 +11:00
doofus-01
7924649319 UtBS S11: Citadel graphics, drawn over the cavewall donut 2018-06-11 16:43:35 +11:00
Iris Morelle
73680ed764 pofix: Update with 1.14.2 -> 1.14.3 rules for the website
[ci skip]
2018-06-10 22:50:42 -04:00
Charles Dang
e8d55062c4 Fixed MP admins being unable to observe private games (fixes #2851)
This was due to the change in the MP initialization process wherein the lobby wouldn't
show up until the initial gamelist was received. Since the admin auth message is sent
after [join_game] and before the initial gamelist, and the chatbox widget handled parsing
the auth message, the client was never marked as authenticated and therefor couldn't
observe private games. This fixes that by adding auth parsing to the MP initialization
process.

Note this doesn't fix the issue of the auth confirmation not showing up in the lobby chat
(issue #2920). I'll have to think of a way to fix that separately.
2018-06-11 13:05:11 +11:00
Pentarctagon
5a2d1bc992 Fix stack protection with LTO. 2018-06-10 20:23:27 -05:00
Steve Cotton
fbc74bf007 Update core/about.cfg to use "merfolk" instead of "mermen" (part of #2940) 2018-06-11 01:22:06 +11:00
Iris Morelle
a92b83e404 tools: Add steam-changelog
This is a script to take a changelog section (provided in the command
line as such: `steam-changelog changelog.md X.Y.Z`) and convert it to
BBCode for posting on Steam.

[ci skip]
2018-06-10 03:25:43 -04:00
Charles Dang
f1d2f85479 Statistics Dialog: keep the same stat selected between scenario selections
Fixes #3223, closes #3226.
2018-06-10 14:50:14 +11:00
Charles Dang
802443eaf9 Updated changelog
[ci skip]
2018-06-10 14:37:21 +11:00
doofus-01
3f3e13c0b4 peasant attack animations 2018-06-10 14:37:20 +11:00
doofus-01
c398a8fa86 change ruffian attack anim timings 2018-06-10 14:37:19 +11:00
Charles Dang
8baeb8457d Added an advanced preference for the PRNG combat option
[ci skip]
2018-06-10 14:24:02 +11:00
Celtic Minstrel
93d4a12375
Remove duplicate changelog entries 2018-06-09 22:32:57 -04:00
Charles Dang
b27d1c21f5 Changelog: moved an entry, fixed a typo
[ci skip]
2018-06-10 13:28:34 +11:00
Charles Dang
92c67f5244 Removed a duplicate changelog entry I missed
[ci skip]
2018-06-10 13:25:29 +11:00
Charles Dang
70a1cdd3e6 Removed duplicate changelog entries under the 1.15.0-dev header
[ci skip]

These were all mentioned between 1.13.13 and 1.14.3, meaning the remaining changes
are everything new in 1.15.0-dev so far. Also removed one entry that was mentioned
twice in the WML Engine section.
2018-06-10 13:21:44 +11:00
Charles Dang
142a2f20ca Statistics Dialog: merge unit name and count labels
Makes it easier for translators to do something specific with this label if needs
be. I remember the reason the count (NUMx) label was moved prior to the name had
to do with language conventions too, so this should alleviate any other such issues.

Also made the name label default size instead of small.
2018-06-10 12:57:37 +11:00
Charles Dang
b5f1e1a48a Statistics Dialog: remove mode toggle in favor of an All Scenarios menu entry
Closes #2886.
2018-06-10 12:57:35 +11:00
Charles Dang
556d088e57 Added 1.13.13 - 1.14.3 changelog sections
[ci skip]

Duplicate entry cleanup for the 1.15.0-dev section to come
2018-06-10 11:15:25 +11:00
Charles Dang
500259a7c2 DiD S6: shift the escape location slightly to account for the map redraw
[ci skip]
2018-06-10 10:57:36 +11:00
Charles Dang
b6416b8329 DiD S1/S6: new Parthyn maps
[ci skip]
2018-06-10 10:45:29 +11:00
Iris Morelle
ce8bf3cfc3 Move changelog entry around
[ci skip]
2018-06-09 19:43:45 -04:00
Charles Dang
42349651cb Fixed [scenario] map_file basically being unusable
Automatically checking the path relative to a maps/ directory without binary
path support results in an invalid path almost every single time. If I remember
correctly from my testing, the only time that worked was if I added a data/maps
folder.
2018-06-10 10:32:39 +11:00
Iris Morelle
5871557dbf Fix Lua errors when failing to set a music track on an empty playlist
Closes #3194.
2018-06-09 18:55:03 -04:00
Charles Dang
c8fc88454b Shuffled a few credits entries around
[ci skip]
2018-06-10 08:35:26 +11:00
gfgtdf
25840c8a4b fix teamchat not marked #3119 2018-06-10 07:17:43 +11:00
gfgtdf
c79e1645c8 fix issues caused by empty save id
ee50171d13 broke some codes that relied on
unique save ids, that is in particular the statistic code and
scoped_recall_unit, so now these codes fallback to the side number if
the save id is empty.
2018-06-10 07:17:42 +11:00
Charles Dang
8fea48ab85 Preferences Dialog: cleaned up advanced prefs widget setup 2018-06-10 07:14:02 +11:00
Jyrki Vesterinen
f0896bdf8c Remove game_events::wml_event_pump::wml_tracking()
The variable **always** changed when event handlers were run, and thus the
optimizations to avoid updating some status after WML/Lua has run weren't
doing anything. In addition, commit 62ec3b3951 removed the most
important optimization that relied on wml_tracking().

Resolves #2578.
2018-06-09 19:35:01 +03:00
Nils Kneuper
92816d42d5 updated Japanese translation 2018-06-09 12:58:42 +02:00
Nils Kneuper
725f6eba04 updated Czech translation 2018-06-09 12:57:18 +02:00
Iris Morelle
45ab8e5b62 Make Credits page on wiki.w.o use the new TOC markup for mobile support
[ci skip]
2018-06-09 03:07:23 -04:00
stevecotton
8d055bf038 DiD S2: When ambushed by goblins, cancel any pending attack (#3227)
This happens in a village-capture event, so the unit has finished
moving for this turn in any case.
2018-06-09 01:09:53 +03:00
Nils Kneuper
f8742ccce4 updated Scottish Gaelic translation 2018-06-08 20:29:50 +02:00
Nils Kneuper
e464082e06 updated French translation 2018-06-08 20:27:44 +02:00
Nils Kneuper
ca25c0dc5c updated Spanish translation 2018-06-08 20:26:31 +02:00
Charles Dang
00e58f12f9 Unit Attack: fixed issues arising from displayed items potentially not equally available items
Since there were weapons included that weren't shown, it was possible for the best
weapon selection to be a hidden one (in which case, the initial selection would be
wrong, and it was possible for the returned index to point to a hidden, disabled
weapon.

This resolves both issues by excluding these disabled attacks from the weapon choices
list altogether. They aren't considered when calculating the best attack either.

mouse_handler::fill_weapon_choices is also used in mouse_handler::attack_enemy_, but
I don't foresee this change should cause any issues there, since you aren't supposed
to be able to actually attack with disabled weapons anyway.
2018-06-09 03:34:22 +11:00
Severin Glöckner
18a101be66 Tutorial: show the female fighteress in the help (if she is chosen)
Uses the workaround mentioned in #3012

[ci skip]
2018-06-08 18:01:23 +02:00
Thom Diment
7feb9aee11 UtBS 5: changes to scenario locations (#3104)
* UtBS 5: changes to scenario locations

Fixes #3077:
* Moved AI leader spawns to keeps
* Changed spawn of trolls that were spawning in walls
* Sanity-checked village ownership in cavern

Fixes #3078:
* Changed spawn of Eastern Troll Flamecaster
* Fixed entry routes of Troll Flamecasters

From author notes:
* Made 'Wounded Dwarf' a wounded unit
2018-06-08 16:40:22 +02:00
Charles Dang
eade3dd494 Fixup ea5945b (fixes #3221) 2018-06-08 22:36:44 +11:00
Charles Dang
ea5945b357 Fixup 79adc68 2018-06-08 20:05:51 +11:00
Charles Dang
424e0e0ab4 Fixup this atomic_bool again
Apparently atomic types aren't copy-assignable.
2018-06-08 19:45:52 +11:00
Charles Dang
79adc68ef6 Attempt to update tests for 3d894fa 2018-06-08 19:43:07 +11:00
Charles Dang
bc0ad54ab0 Added missing <atomic> include 2018-06-08 19:28:15 +11:00
Charles Dang
58d3cad315 Merge branch 'gui2_widget_ptr_init_refactor' 2018-06-08 19:17:48 +11:00
Charles Dang
34195ae654 GUI2: removed now-redundant type parameter from build_single_widget_and_cast_to 2018-06-08 19:16:52 +11:00
Charles Dang
52f7fcf5cc GUI2: added a public static type getter to all widgets implementing get_control_type
Fixes #2400. See comment in styled_widget.hpp for details.
2018-06-08 19:16:19 +11:00
Charles Dang
3d894faf11 GUI2: made widget initialization process more secure against memory leaks
This commit is the followup to a similar one I did regarding window initialization. Instead
of widgets being created on the heap and not being managed by a smart pointer until they're
added to a grid, they are now always managed by a shared_ptr. To that end, this commit covers
bunch of things:

* builder_widget::build (both overloads) and all its overrides (which have now been marked
  as such) now return shared_ptr<widget>.
* The builder_grid::build() override now returns the same instead of grid* since you can't
  use covariant return types with smart pointers.
* The two implementation build helpers in builder_grid have been combined with an optional
  replacement map as the second parameter. Uses of the version that took a grid pointer could
  be easily converted to pass a reference instead.
* The pane, matrix, and viewport build() functions were removed in favor of making the ctor
  public. In case there was a deprecated ctor, that was removed.
* The viewport now keeps a widget shared_ptr instead of a reference that was then deleted
  by address-of. This was both better design and necessary to fix a crash.
* build_single_widget_instance_helper and build_single_widget_instance were renamed to
  build_single_widget and build_single_widget_and_cast_to to better represent their roles
  and to indicate the latter was more a convenience extension for the latter than the other
  way around.
2018-06-08 18:27:35 +11:00
ln-zookeeper
131868581d Restructured WC/Soulless bat variation defense animation (fixes #3215)
There were two overlapping problems: 1) the branching was written incorrectly (due to combining top-level and [if] filters) and 2) the first [defend] tag getting merged with the base WC/Soulless defense animation.
2018-06-08 00:38:34 +03:00
Charles Dang
b70463b6ad Ensure events::call_in_main_thread is thread-safe 2018-06-08 07:33:42 +11:00
mattsc
7afe6adbee Update changelog with Lua AI efficiency improvements 2018-06-07 06:55:10 -07:00
mattsc
7ed5b210b5 Changelog: collect AI entries in 'AI' section 2018-06-07 06:52:27 -07:00
mattsc
6c38b8ce93 Goto Micro AI: add [and] to a filter
Another efficiency improvement.  This ensures that the side of the unit
is checked first before the potentially complex rest of the filter is
evaluated.
2018-06-07 06:45:30 -07:00
mattsc
0dcbe1d0d0 Goto Micro AI: change order of SLF and SUF evaluation
This is for efficiency reasons, as location filters do not necessarily
change throughout a side’s turn, while fewer and fewer units have moves
left.
2018-06-07 06:45:14 -07:00
mattsc
972ecc2f56 AI helper: improve efficiency of get_unit functions
The old method is very slightly faster in some circumstances (e.g. for
simple filters and when all units have moves/attacks/etc. left), but we
are talking fractions of micro seconds. By contrast, depending on the
filter used, the new method can save large amounts of evaluation time
once some units have move or attacked.
2018-06-07 06:44:55 -07:00
doofus-01
9bb6cbb82c UtBS: Graphics update for Giant Ant (#3190)
* graphics update for giant ant unit

* slight revision to ant base sprite
2018-06-07 11:48:40 +03:00
Nils Kneuper
c9b7d5b22f updated Italian translation 2018-06-06 22:08:15 +02:00
Nils Kneuper
5e35e4e8f3 updated British English translation 2018-06-06 22:07:12 +02:00
loonycyborg
787a1a0dae wesnothd: fix prematurely adding new players to games_and_users_list_
If dc happens during asio read that would call server::add_player
then a "ghost" player will appear in games_and_users_list_. Fix works by
moving the list update into the handler, it will be called only if read is
successful.

This should prevent issue #2989 unless it has some other mechanism
2018-06-06 19:47:20 +03:00
Iris Morelle
94a85e0185 Changelog entry for the fix for issue #3206
[ci skip]
2018-06-06 04:22:08 -04:00
Iris Morelle
085236f556 gui2/unit_create: Do not exclude do_not_list units
This is a debug mode-only dialog. If I want to spawn a unit, the game
had better allow me to spawn any unit I want. do_not_list was created
for use by wmlunits anyway.
2018-06-06 03:14:07 -04:00
Jyrki Vesterinen
91afbfd586 Fix #2602: music doesn't change immediately on loading a save
This time I added an option to disable the feature to allow the currently
playing track to finish when changing the playlist. This allows more
fine-grained control of distinct use cases.

In wesnoth.cpp:do_gameloop(), I reversed the order of the title screen
music and default music because otherwise adding the default music would
enable play_once for the title screen music and prevent instant music
change when the player loads a save. I play title screen music with
immediate=yes, so it's still played first.
2018-06-05 20:45:04 +03:00
Jyrki Vesterinen
cafede479c Revert "Fix #2602: music doesn't change immediately on loading a save"
This reverts commit 94b69e0281.
2018-06-05 20:44:31 +03:00
loonycyborg
0c0bf7f91d wesnothd: fix server terminating in response to unregistered login
if unregistered logins are allowed
2018-06-05 14:27:45 +03:00
loonycyborg
a251808933 wesnothd: avoid needlessly casting pointer to long int 2018-06-05 14:27:45 +03:00
Iris Morelle
051182fa1c Fall back to the unit type name for [message] captions for nameless units
Fixes #3211.
2018-06-05 04:44:28 -04:00
Jyrki Vesterinen
b7c1007f34 Changelog entry for commit 94b69e0281 2018-06-05 08:40:06 +03:00
Jyrki Vesterinen
94b69e0281 Fix #2602: music doesn't change immediately on loading a save 2018-06-05 08:38:57 +03:00
sigurdfdragon
c9c689da66 Update changelogs 2018-06-04 23:57:53 -04:00
sigurdfdragon
85ba7797b2 DW: Fix #3207
...by preventing any allied units from moving to the sword.
2018-06-04 23:56:39 -04:00
Iris Morelle
4e37cdc713 Don't allow [kill] animate=yes to scroll to units through fog and shroud
Restores 1.12's behaviour.
2018-06-04 16:15:37 -04:00
Severin Glöckner
fc427ce58c NR S5a: more bugfixes
* now the situation can appear that spiders can attack Malifor,
  this handles it.
* add *^Xo Terrain to the filter. While there is no bug to fix,
  it looks like it belongs there too.
* work around a tile glitching with an [item] at 22,4
* remove code referring to removed variables

* and run wmlindent

[ci skip]
2018-06-04 19:42:42 +02:00
Thom Diment
913b77d79d NR5_1: Fixes to Malifor attack and secret door events (#3154)
NR S5a: bugfixes

* Fixes #3117 - Malifor damage event now occurs on defence as well on attack

* Fixes #3116: - Doors to the study can now be opened from inside

[ci skip]
2018-06-04 18:52:20 +02:00
loonycyborg
4eea1b5f0d wesnothd: restore lan server auto-shutdown functionality 2018-06-04 16:38:42 +03:00
loonycyborg
0714d488bc wesnothd: restore functionality to log stats every 5 minutes 2018-06-04 14:36:48 +03:00
loonycyborg
57da02a919 Update server to use new way of getting wesnoth version 2018-06-04 13:21:20 +03:00
loonycyborg
aaabbf2687 server: remember client's ip in player_connections_ and use it in remove_player()
this is needed so ip is properly logged even if socket is closed or invalid
2018-06-04 13:16:58 +03:00
Severin Glöckner
4b7a6a98ec remove a duplicated space in a translatable string
...thiugh, in this case it has no effect.

[ci skip]
2018-06-04 02:44:49 +02:00
Charles Dang
c7a06939ab Tutorial S2: made enemy starting gold equal to that of the player
[ci skip]
2018-06-04 06:42:32 +11:00
Gunter Labes
0362e36305 check for empty parameters before looping over all players 2018-06-04 06:08:01 +11:00
gfgtdf
0853b2718d rename mp command player_version to version 2018-06-04 06:08:00 +11:00
gfgtdf
ba6afa4d17 add player_version mp command
to tell you what wesnoth version another player is using.
2018-06-04 06:07:59 +11:00
Nils Kneuper
ad0b8bce8c updated French translation 2018-06-03 12:09:48 +02:00
Nils Kneuper
87552f083b updated Italian translation 2018-06-03 12:09:03 +02:00
Nils Kneuper
3a8343b4dd updated Chinese (Traditional) translation 2018-06-03 12:08:00 +02:00
Charles Dang
011cbfe3b8 Game Config Manager: handle clearing image cache in main thread
See comment for explanation. This was a better solution that adding mutexes to
the cache accessors; that had performance downsides.
2018-06-03 05:21:02 +11:00
Charles Dang
b8ad791a1d Revert "Fixed an occasional crash resulting from multi-thread access of the image cache"
This reverts commit 6d0b7c8424. Turns out there's
a better way to fix this problem without using mutexes, which have a noticeable
performance hit (5.2% of the execution time of game_display::draw_invalidated()
according to @jyrkive).
2018-06-03 05:20:43 +11:00
Charles Dang
bf92dbbfd2 Campaign Dialog: renamed Deterministic Mode label to "Save random seed"
[ci skip]

This better conveys its behavior, especially with the introduction of the hidden PRNG
preference.
2018-06-03 05:18:42 +11:00
Charles Dang
20af37d527 NR S10 - 14: minor cosmetic map tweaks
[ci skip]
2018-06-03 05:18:41 +11:00
Charles Dang
a46eaa2874 NR S13: further reduce enemy gold
[ci skip]

Also fixed an error in my last commit that gave your ally Dwarvish side *more*
gold on higher difficulties.
2018-06-03 00:57:35 +11:00
loonycyborg
d96d5c506c scons: add missing winapi lib dependencies to mingw build 2018-06-02 11:53:35 +03:00
loonycyborg
b347bc70b1 scons: don't let pkg-config to add prefix on msys2
This is workaround for windows style path confusing scons if they appear
in CPPATH etc. Paths without prefix still happen to be valid and they
start with "/", not "c:".
2018-06-02 11:53:35 +03:00
loonycyborg
aa925e1fc6 scons: use pkg-config on msys platform for sdl 2018-06-02 11:53:35 +03:00
loonycyborg
d8743f8e6e scons: set env["PLATFORM"] to "win32" on msys 2018-06-02 11:53:35 +03:00
loonycyborg
2bc7cc3e61 scons: workaround for msys2's build's of sdl "#define main" breaking non-sdl checks 2018-06-02 11:53:35 +03:00
Charles Dang
5adb931b2a NR S11 - 13: reduced enemy starting gold and income (resolves #3198)
[ci skip]

Also similarly reduced one of your ally's starting gold in S13.
2018-06-02 09:23:44 +11:00
loonycyborg
f53237b20f Change GL include in scons check so it actually works under mingw 2018-06-01 14:36:37 +03:00
gfgtdf
575e104ca5 fix possible 'manditory child missing' when loading mp campaign games
the error could happen a soon as you advance to the next scenario if you reload a campaign save from another player.
2018-06-01 12:54:03 +11:00
sigurdfdragon
03d0e5deee Update changelogs 2018-05-31 19:41:22 -04:00
sigurdfdragon
047ededd9e SotA S09: Fix #3192
...by making the filter more exact.
2018-05-31 19:38:23 -04:00
loonycyborg
d35f22e077 scons: fix issue #3132 2018-05-31 19:50:08 +03:00
Charles Dang
2503ac8897 MP Lobby: added translation hints for C/S markers 2018-06-01 02:00:22 +11:00
gfgtdf
9cc32ebc46 wb: fixup "fix incorrect handling of skirmisher." 2018-06-01 01:58:27 +11:00
loonycyborg
8b1a5c0dde Enable ASLR and NX bit security features for mingw builds 2018-05-31 12:07:27 +03:00
Charles Dang
3d8d38983d MP Staging: removed gender tooltip (resolves #2998)
I had only added it originally in case someone didn't know the symbols offhand,
but sevu is right that they can get a bit annoying.
2018-05-31 19:41:28 +11:00
Charles Dang
6cc91794f5 MP Lobby: display self before friends in player list (fixes #3185) 2018-05-31 19:41:27 +11:00
gfgtdf
0dd382eab3 fix seed not resetting in lua mapgen. 2018-05-31 19:21:57 +11:00
gfgtdf
84d94ca305 add mapgen debug info. 2018-05-31 19:21:56 +11:00
gfgtdf
8e3ee5c597 add mapgen debug info. 2018-05-31 19:21:24 +11:00
gfgtdf
f69af8533a add mapgen debug info. 2018-05-31 19:21:23 +11:00
gfgtdf
af6559af75 fix unit filter always evaluating [and] even if it is not needed. 2018-05-31 19:21:23 +11:00
Charles Dang
8c3673dfa0 GUI2/Chatbox: removed spurious newline from initial PM notice 2018-05-31 19:20:31 +11:00
Pentarctagon
9242a5ffd0 Fixup goblin description.
Somehow missed removing the part about the failing bloodline.
2018-05-31 03:04:39 -05:00
Pentarctagon
0b7ca63a86 Updated goblin spearman description.
See: https://forums.wesnoth.org/viewtopic.php?f=32&t=48137&start=60#p628424 and related posts.
2018-05-31 01:49:58 -05:00
Pentarctagon
d913aafc53 Add a couple missing things from the PR that added the units.
Added the elemental trait to the Jinn. Added the undead_variation key to the Jinn, Wyvern Rider, and Wild Wyvern.
2018-05-31 01:22:13 -05:00
Byteron
7f2a8f7c19 TSG: Deoran can't recruit Peasants anymore
for the whole campaign, only in the first two scenarios

closes #3051 [ci skip]
2018-05-30 21:47:42 +02:00
Charles Dang
aad64d72cf Made vgettext/vngetext internals harder to use accidentally (resolves #2716)
Also removed the two implementation function overloads that did not take a textdomain.
2018-05-30 15:15:34 +11:00
Charles Dang
a08af0c1da Fixup cc2cc29 2018-05-30 13:57:37 +11:00
Charles Dang
569d86277a GUI2/Dispatcher: added a connect_signal convenience wrapper for draw callbacks
Didn't use this in the window widget since that doesn't specify front_child as
the queue position. I need to evaluate whether draw callbacks need to be in that
position anyway. AFAIR I only started adding them there since I noticed the one
in the debug clock dialog used that.
2018-05-30 12:15:57 +11:00
Charles Dang
31c4d09528 GUI2: praise auto 2018-05-30 12:15:57 +11:00
Charles Dang
cc2cc29376 Deployed std::make_unique and std::make_shared in more places 2018-05-30 12:15:56 +11:00
Nils Kneuper
29c9f1d298 updated French translation 2018-05-29 23:41:26 +02:00
Charles Dang
4b03168fec Fixup f72f89f 2018-05-29 21:11:57 +11:00
Charles Dang
eddbaa2159 Events: minor cleanup 2018-05-29 21:01:17 +11:00
Charles Dang
f72f89f4d5 Campaign Difficulty: consolidated both lines into a single label 2018-05-29 21:00:34 +11:00
Charles Dang
61694688a8 Updated changelog
[ci skip]
2018-05-29 20:56:14 +11:00
Charles Dang
6d0b7c8424 Fixed an occasional crash resulting from multi-thread access of the image cache
This was a problem as of 52db950e94 since the loading
screen could access the image cache while the worker thread cleared it.
2018-05-29 14:00:47 +11:00
Jyrki Vesterinen
ae8baa6356 Changelog entries 2018-05-28 22:15:06 +03:00
Jyrki Vesterinen
472b0cbbfb Fix #3042: attack prediction gives wrong results for HP <= 0 units
One_strike_fight() assumed that if HP distribution hadn't been calculated,
the unit is alive. It would normally be a valid assumption, but the Wesnoth
engine allows units with negative HP (although things aren't guaranteed to
work correctly in the presence of such units).

The assumption, together with a completely wrong calculation for the
probability that the opponent will counterattack, resulted in badly
incorrect results. That, in turn, caused the calculated probability that
the opponent to kill us to become negative (I observed -75 % when
debugging), making the calculated probability to be poisoned/slowed to
exceed 100 %, and that finally caused an assert if the AI simulated another
fight for the same unit.

I have now fixed those issues. I also noticed that rounding error allowed
the probability to be killed to still become slightly negative, and thus
changed std::min() to utils::clamp() to limit the value to the allowed
range.
2018-05-28 22:13:37 +03:00
Jyrki Vesterinen
0200487aad Revert "Disallow units with negative HP"
This reverts commit ef60deaa2b.

@ln-zookeeper pointed out that units with negative HP are documented in
the wiki, and thus disallowing them is an API
change.
2018-05-28 22:12:33 +03:00
Jyrki Vesterinen
050bb3fa2c Revert "Allow modifying dead units in last_breath and die event handlers"
This reverts commit 15446acb2a.
2018-05-28 22:12:22 +03:00
Jyrki Vesterinen
58dca3a884 Revert "Throw a Lua exception when creating a negative-HP unit in a Lua context"
This reverts commit 258a0e4689.
2018-05-28 22:12:08 +03:00
Jyrki Vesterinen
70be1d2932 Revert "Allow modifying dead units in more event handlers"
This reverts commit 9110e49760.
2018-05-28 22:11:55 +03:00
Charles Dang
019848a28f Events: removed unused sdl_handler virtual functions
volatile draw had to do with drawing map labels pre-accelerated rendering. They're unused
now and I don't foresee using them again since they don't offer anything the regular draw
functions don't and they aren't needed for the map labels anymore.

Tooltips are handled by handled by GUI2. There are no more help strings since the related
interface in CVideo got removed.
2018-05-28 17:40:37 +11:00
Charles Dang
3c4da4035f Fixup 40d9b99 again (more unused variables) 2018-05-28 16:44:37 +11:00
Charles Dang
3cc8544488 Fixup 40d9b99 (unused variables) 2018-05-28 16:12:00 +11:00
Charles Dang
40d9b9953b Cleaned up some unused stuff from the display class
Namely complete_redraw_event(), recalculate_minimap(), and redraw_minimap(). I had
been keeping the last around for reference (see f5ec886cb5) but I
figure it's not really worth it since this isn't the drawing method we'll want to
be using in the end anyway.
2018-05-28 15:14:39 +11:00
Charles Dang
ed8a8a48f7 Used std::string::front() and back() in more places 2018-05-28 15:14:37 +11:00
Charles Dang
c5ba6f01a8 Cleaned up utils::apply_modifier a bit 2018-05-28 15:14:36 +11:00
Iris Morelle
0ca8227959 pofix: Update with 1.14.1 -> 1.14.2 rules for the website
[ci skip]
2018-05-27 23:02:00 -04:00
Celtic Minstrel
d03829dfd0
Fixup previous commit
Accidentally removed the third parameter for `increase_movement` instead of `increase_accuracy`. Whoops!
2018-05-27 11:27:58 -04:00
Celtic Minstrel
1413dfd4f3
Fix effects being unable to decrease weapon parry/accuracy
fixes #3181
2018-05-27 10:33:44 -04:00
Charles Dang
8ecbed0205 Fixed CVIdeo::quit being swallowed in invoked_function_data::call 2018-05-27 22:22:42 +11:00
Charles Dang
5588588b55 Fixup 86792656ae (re-add ctor) 2018-05-27 22:02:57 +11:00
Charles Dang
86792656ae Handle exceptions thrown by call_in_main_thread in the caller thread
Also removes an unnecessary ctor and adds docs.
2018-05-27 17:36:29 +11:00
Nils Kneuper
183bc272ea updated Italian translation 2018-05-26 21:41:08 +02:00
Charles Dang
99c2ed8f65 MP Staging: simplify a call 2018-05-27 03:04:09 +11:00
Charles Dang
050430460a Moved faction sorting from the FLG manager to the connect engine
This list in the connect engine was passed to each of its side engine's flg managers,
where it was then sorted by update_choosable_factions(). Basically, a whole bunch of
unnecessary sorting. This makes it so the list is already sorted when it's passed to
each side engine.

None of the post-processing of the faction list (in populating available_leaders_)
should mess with the order, as far as I can tell.
2018-05-27 03:04:08 +11:00
gfgtdf
0c3ca19e9d remove useless code in unit::advance_to
the line above does exactly the same as the line inside that if(){..} so it has no effect.

Also, what the comment says is wrong. We do not want to keep the old recall cost if it is different from the original recall cost because  doing that would break removing objects that change recall cost.
2018-05-26 23:58:11 +11:00
gfgtdf
f093341bb4 automaticially end replaymode at the end of a mp turn replay.
previously it did happen that users did not know how to 'escape'
from the replay mode in that case.
2018-05-26 14:09:54 +02:00
gfgtdf
beeb5b43e2 fix [animate_unit] freezing the game
#2970
#3084
2018-05-26 14:09:41 +02:00
Charles Dang
dab7022552 GUI2/Addon List: don't hardcode green text color for publishable addons 2018-05-26 19:04:10 +11:00
Charles Dang
107ef77e45 Used RAL 6038 (#00b51a) for font::GOOD_COLOR
This is apparently the closest RAL color to RGB 0,255,0 and it happens to look good.
2018-05-26 19:04:09 +11:00
Charles Dang
0f1029a933 Surface: restrict a workaround to SDL 2.0.6 only
It was fixed in 2.0.7.
2018-05-26 18:10:06 +11:00
Charles Dang
ff2c729991 Updated changelog
[ci skip]
2018-05-26 17:02:53 +11:00
Jyrki Vesterinen
cf2b1ed873 Changelog entry for pull request #3169 2018-05-26 09:01:30 +03:00
newfrenchy83
5386841088 Update advancement.cpp 2018-05-26 08:55:11 +03:00
Severin Glöckner
307d1d1d44 SotA: transform units in S5 instead of S18
this commit differs from the 1.14 one

[ci skip]
2018-05-26 03:52:09 +02:00
Severin Glöckner
3a103e6bbf SotA & UtBS: replace deprecated code
[ci skip]
2018-05-26 03:36:44 +02:00
Severin Glöckner
fec49a53a6 SotA S21: fix terrain filter
The map has been adjusted before, but not the filter

[ci skip]
2018-05-26 03:36:31 +02:00
Severin Glöckner
4db9f17e09 SotA: fix S20, was broken with the removal of the old gates
[ci skip]
2018-05-26 03:36:31 +02:00
Severin Glöckner
627c39a3a8 SotA S18: move DA transformation to lua
[ci skip]
2018-05-26 03:36:31 +02:00
gfgtdf
acf9a9874c
fix untranslatable string. 2018-05-26 03:16:43 +02:00
Severin Glöckner
9f37896f32 DiD S7: compensate -1 income with +1 support
[ci skip]
2018-05-25 20:51:29 +02:00
Severin Glöckner
c0d6d4ed94 DiD S7: make villages unattractive
they give no income anymore, but still support

closes #3162

[ci skip]
2018-05-25 20:34:40 +02:00
Severin Glöckner
cca5b6f776 NR Path B:
* to enable playing the path in debug mode
  * set the betrayed friend variable in S5
  * overwrite redruits and gold
* use lua for unit transformations
* clean up code in S5
* fix ellipse change having no effect (probably since 1.12)
  * work around bug 3172

[ci skip]
2018-05-25 19:50:39 +02:00
ln-zookeeper
8b467104bf NR: Gave the Rod of Justice the magical special and improved animation
The animation now uses all three bolt animations (instead of just one), and has a somewhat different color.
2018-05-25 15:33:29 +03:00
Charles Dang
47bef433a9 Campaign Difficulty: restore the description parentheses on request 2018-05-25 12:00:13 +11:00
Charles Dang
47d766d374 Bump font::GRAY_COLOR from #777 to #888
Bit brighter, looks a bit better.
2018-05-25 11:59:41 +11:00
Charles Dang
67530c4375 Campaign Difficulty: rearranged entry layout 2018-05-25 11:46:58 +11:00
Charles Dang
b24de54fb9 Removed now-unused preference getters/setters 2018-05-25 11:26:02 +11:00
Charles Dang
4300cb8263 Updated changelog
[ci skip]
2018-05-25 11:17:56 +11:00
Charles Dang
e754e64987 MP Lobby: removed manual player list sorting
It didn't make much sense to have these since there's really no situation you'd want
the "default" sorting order, which is however the server decided to send the list.
2018-05-25 11:16:40 +11:00
Charles Dang
e6183aa0d4 Campaign Difficulty: colored description column gray 2018-05-25 09:32:52 +11:00
Severin Glöckner
51db9d01bf DiD S11, Sota S18: move unit type transformation to lua
[ci_skip]
2018-05-24 23:59:57 +02:00
Severin Glöckner
a24068ad02 DiD S11 & S12: transform all Mages instead of changing their advancements
This has the advantage that they use the same help page as newwly
recruited ons, and their advancement options are correctly shown there.

The transformation code is taken from SotA S18

[ci_skip]
2018-05-24 23:17:20 +02:00
Severin Glöckner
0f511e8e55 EI S11: use same approach as in 1e58164
to simplify scenario

[ci_skip]
2018-05-24 23:17:20 +02:00
Severin Glöckner
1e58164961 DiD: fix bug for units not being loyal anymore after leveling up
fixes #3163

[ci_skip]
2018-05-24 23:16:39 +02:00
Severin Glöckner
1315c660e7 Did S5: make campaign easier to debug
by moving an important change into it's own victory event

[ci skip]
2018-05-24 23:10:16 +02:00
Nils Kneuper
cb43b894ee updated Chinese (Simplified) translation 2018-05-24 21:33:53 +02:00
Nils Kneuper
1122ea7264 updated Spanish translation 2018-05-24 21:31:24 +02:00
Jyrki Vesterinen
f5609d6911 Changelog entry for commit f861883683 2018-05-24 20:36:22 +03:00
Jyrki Vesterinen
bd5be036b7 terrain_filter::match_internal(): use std::make_shared() 2018-05-24 20:33:44 +03:00
Jyrki Vesterinen
f861883683 Fix memory leak in terrain filter matching 2018-05-24 20:33:30 +03:00
Charles Dang
27d0a6f6fe Fixed animation-wide text_color and blend_color keys being overwritten
Regression from a0199c73f9. This should fix
an issue where levein/levelout fading was sometimes black instead of white.
2018-05-24 13:36:56 +11:00
Charles Dang
c48a8e7edd Fixup 9bf7a4c (WFL comment syntax)
[ci skip]
2018-05-24 11:16:34 +11:00
Iris Morelle
f30634842e gui2/preferences: Add margin around the version info button
[ci skip]
2018-05-23 19:50:32 -04:00
Iris Morelle
2bc7be607e Add a couple of entries to players_changelog
[ci skip]
2018-05-23 19:47:40 -04:00
Iris Morelle
e8c803d426 gui2/preferences: Add version info button
Also simplifies the layout of the bottom-most row of the dialog a bit.
2018-05-23 19:39:55 -04:00
Charles Dang
9bf7a4c8fb GUI2/Message: tweaked Magic Numbers to fix layout failure with large portraits
[ci skip]

Fixes #2912
2018-05-24 10:26:31 +11:00
gfgtdf
fef4254c84 fix different carryover when loading startofscenario-save
this removes a hack in connect_engine.cpp that set save_id to a value to make sure that other connect_engine.cpp code does not chnge it later to the plyers id, (it did so at some point iirc).

Instead we update carryover.cpp to make sure that a side with no save_id  (or id since save_id defaults to id) is not carried over to the next scenario,

fixes #3152
2018-05-24 10:25:52 +11:00
gfgtdf
fb54b0376d don't autosave after using 'back to turn' in mp 2018-05-23 22:02:04 +11:00
gfgtdf
31d4579500 fix oos when using 'back to turn' in mp 2018-05-23 22:02:03 +11:00
Charles Dang
a1de152ded Game Events/Manager: formatting cleanup 2018-05-23 12:49:24 +11:00
Charles Dang
b011faa244 GUI2/Canvas: merge draw() and render() and remove commented-out blur code 2018-05-22 22:40:10 +11:00
Charles Dang
6e4327f313 GUI2/Canvas: reset size_changed_ flag after setting formula variables (fixup 02858f2) 2018-05-22 22:20:54 +11:00
Charles Dang
1a9c6a7eca Removed an outdated comment
Outdated as of b2fc0f2.
2018-05-22 22:15:08 +11:00
Charles Dang
2819f549a1 GUI2:Canvas: remove custom drawing function interface
This was only needed for the minimap since each canvas had its own texture, and the
minimap widget's canvas texture needed to be passed to image::render_minimap (that
function operated on the current render target, in this case, the canvas texture).
As of 02858f2259 we render directly to the screen instead,
so this isn't needed anymore.
2018-05-22 22:14:34 +11:00
Charles Dang
b2fc0f25e0 GUI2: removed unused offset parameters from drawing functions
These were added in 8f945cf235, but since the "new" listbox
implementation never came to be, these have just been unused clutter. There was one place
they were used as parameters in a manual call to calculate_blitting_rectangle, but that was
refactored out in 3332ae9757.

This also removes an overload of widget::draw_debug_border, since without the offsets, both
functions now did the same thing.

This affects:
* widget::draw_background
* widget::draw_children
* widget::draw_foreground
* widget::impl_draw_background (offset overload removed)
* widget::impl_draw_children
* widget::impl_draw_foreground
* widget::calculate_blitting_rectangle
* widget::calculate_clipping_rectangle
* widget::draw_debug_border
2018-05-22 21:33:21 +11:00
Charles Dang
eecc46f02f GUI2/Canvas: restored handling of immutable shapes (fixup 02858f2) 2018-05-22 20:59:29 +11:00
Charles Dang
02858f2259 GUI2/Canvas: discard individual canvas texture in favor of direct-to-screen rendering
This is a lot more efficient since it allows the GPU to parallelize draws AND it magically
fixes the bad alpha rendering we've been having!

Fixes #1568
Fixes #1744
2018-05-22 19:37:21 +11:00
ln-zookeeper
cdea2e70cf SoF S9: Removed garbage terrain code 2018-05-22 11:23:41 +03:00
ln-zookeeper
59b69288ba Updated changelogs 2018-05-22 15:14:27 +11:00
ln-zookeeper
0de4a4c706 TRoW S15: Increased the amount of lvl2 units enemies recruit
This will make enemies recruit equally many lvl1 and lvl2 units, thus decreasing the amount of units overall and making it less feasible to last indefinitely due to hordes of lvl1 units blocking better damage-dealers from reaching player units.
2018-05-22 15:12:52 +11:00
ln-zookeeper
bd23bb3253 HttT S08: Increased Li'sar's income slightly 2018-05-22 15:12:51 +11:00
ln-zookeeper
856b8ce78b TSG S03: Made the scenario very subtly harder
Increased the number of bats/undead the enemy can recruit, and made the terrain east of the enemy camp more easily passable.
2018-05-22 15:12:50 +11:00
ln-zookeeper
c0583a1842 SoF S9: Fixed some issues with the volcano eruption (fixes #3099)
This merely patches the worst problems (multiple successive [endlevel] calls, inconsistent [endlevel] contents, recursive elf die event, lava fills visually broken); ideally the whole scenario should be rewritten and redesigned.

The mask changes only consist of re-sizing them to match the map size.
2018-05-22 15:12:49 +11:00
gfgtdf
7eec132d76 don't generate a savegame snapshot unless needed
fixes #3150
2018-05-22 15:11:21 +11:00
Charles Dang
8d3f54ce7c [remove_sound_source] now accepts a comma-separated ID list
[ci skip]

Lack of this pointed out by @shikadiqueen.
This change will also throw an error if id= is missing. Not sure if it did so before.
2018-05-22 14:55:34 +11:00
Iris Morelle
8ae38ac19f Do not allow [message] to scroll to units through fog/shroud
This was a regression from 1.12.
2018-05-21 23:23:06 -04:00
Iris Morelle
df782f5401 Fix broken TC in a north-facing standing animation frame for the Revenant
[ci skip]
2018-05-21 21:32:02 -04:00
gfgtdf
29120661f4 remove 'cannot handle require_scenario=' warning
since it triggers on mainline content
2018-05-22 10:39:01 +11:00
Severin Glöckner
f291deb6cf LoW 2 S7 - fix repeated endlevel execution
[ci skip]
2018-05-21 18:31:16 +02:00
Martin Hrubý (hrubymar10)
6f2235088c Xcode Disable -Wsign-conversion and -Wshorten-64-to-32 flags 2018-05-21 18:19:27 +02:00
Charles Dang
998cf67e1a Updated changelog
[ci skip]
2018-05-22 00:52:05 +11:00
Jyrki Vesterinen
1066de1a82 Revert "Preallocate memory for image/file presence caches"
This reverts commit a3ef80853c.

Vector reallocation cost is logarithmic. Assuming that a vector
starts at a size of one and doubles its size in each allocation, the
result is 11 allocations - completely negligible compared with, you
know, loading 20 000 images from disk.
2018-05-21 16:33:50 +03:00
Charles Dang
949266b5aa Preallocate memory for image/file presence caches
Should avoid unnecessary reallocations.
2018-05-22 00:28:26 +11:00
Martin Hrubý (hrubymar10)
dee670d2b5
Switch travis Xcode to DEBUG scheme 2018-05-21 14:26:04 +02:00
Nils Kneuper
6bfc5623e7 updated Japanese translation 2018-05-21 13:07:23 +02:00
Nils Kneuper
a7dbdb4aa2 updated French translation 2018-05-21 13:03:32 +02:00
Nils Kneuper
d942bead18 updated Scottish Gaelic translation 2018-05-21 13:02:38 +02:00
gfgtdf
5dffb16d5e wb: dont resend 'bump_later' commands
these caused 'illegal whiteboard data' messages from the mp server.
2018-05-21 21:34:52 +11:00
Severin Glöckner
36026a5ff7 manpages: clarify deprecation logdomain
[ci skip]
2018-05-21 09:14:07 +02:00
Severin Glöckner
fd8473e3da GUI: add a translation prefix
Depending on the context there are different possible word
to translate 'to' with.

[ci skip]
2018-05-21 08:52:50 +02:00
Severin Glöckner
69f17c775d name generators: update translation hint
[ci skip]
2018-05-21 08:52:05 +02:00
Charles Dang
d9315199ee Remove the CMake/Scons compile-time check for IEEE 754 compliance
Now handled by a static assertion.
2018-05-21 14:38:16 +11:00
Iris Morelle
6eddc6f978 Remove door terrains that were supposed to be removed by 1.14
If someone was using these despite being hidden and everything they were
really asking to get shot in the foot at some point.
2018-05-20 23:08:43 -04:00
Charles Dang
1bfa8e363c Added a static assertion for IEEE 754 floating point compliance 2018-05-21 14:07:03 +11:00
Iris Morelle
ae127ea73a Clamp tod_color values in the [-510, 510] range instead of [-255, 255]
[color_adjust] needs to be able to use absolute values as large as
2*255 in certain edge cases to set the screen a single solid colour when
interacting with time of day colour shifts.

Fixes #3144.
2018-05-20 21:12:34 -04:00
Charles Dang
7f673dcd1f Unit Recall: select the first row after applying sorting
Reported on the forums: https://forums.wesnoth.org/viewtopic.php?f=4&t=48219
2018-05-21 10:36:53 +11:00
mattsc
ee62a75be2 Update changelog 2018-05-20 15:26:52 -07:00
mattsc
a6c0012689 Experimental AI recruiting: use math.huge instead of 9e99 2018-05-20 14:55:17 -07:00
mattsc
f810504306 Experimental AI: clear recruit cache when no recruit action found 2018-05-20 14:55:01 -07:00
mattsc
a65605c547 Fix Experimental AI not working without enemy units
An example are the first two turns of Dark Forecast.
2018-05-20 14:54:45 -07:00
ln-zookeeper
43c5b6fbb2 UtBS: Re-numbered Nym's sword animation frames
Also optimized them.
2018-05-21 00:01:29 +03:00
Pentarctagon
d02e16d712 Fixup: Vyncyn was already listed in the credits. 2018-05-20 09:35:59 -05:00
gfgtdf
0f2b4fae1d wb: fixup fix handling of extra_recruit and [filter_recall]
this was probably lost during rebasing.
2018-05-20 22:44:58 +11:00
Charles Dang
23732cf40f Removed useless Hide Help entry for debug terrain info 2018-05-20 16:02:47 +11:00
doofus-01
c585ac4462 kaleh sword animation 2018-05-20 14:55:00 +11:00
gfgtdf
5785ef7925 wb: fix handling of extra_recruit and [filter_recall]
fixes #3100
2018-05-20 13:55:20 +11:00
Iris Morelle
e82d811ab0 Fix [change_theme] crashing when theme= isn't specified
Leaving theme= unspecified ought to have the same effect as providing it
and setting it to an empty string. Without the check for a nil value,
however, it would result in a crash like this:

  20180519 22:31:54 error scripting/lua: lua/wml-tags.lua:922: bad argument #3 to '__newindex' (string expected, got nil)
  stack traceback:
          [C]: in metamethod '__newindex'
          lua/wml-tags.lua:922: in local 'cmd'
          lua/wml-utils.lua:145: in field 'handle_event_commands'
          lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>
2018-05-19 22:38:06 -04:00
gfgtdf
7ef9f9a18f fix require_resource in [resource]
previously 918cdfcb36/src/saved_game.cpp (L293) would fail for [resource] because cfg["addon_id"] was empty.
2018-05-20 12:19:04 +11:00
Celtic Minstrel
c9d5832845 Fix preprocessor error with deprecated macros intended to be used as an attribute value 2018-05-19 20:52:08 -04:00
Charles Dang
91150f2504 THoT S2: fixed misspelled event name (fixes #3131)
[ci skip]
2018-05-20 10:25:46 +11:00
gfgtdf
a10287c5c2 fix require_scenario=yes not working with map_generation
this fixes require_scenario=yes for scenarios that use map_generation or
scenario_generation, the problem was that create_engine does not call
saved_game::expand_scenario for random maps, (which is the function that
checks require_scenario=yes)

fixes #3105
2018-05-20 10:09:48 +11:00
Pentarctagon
16bfab0b0a Add new units as discussed on the forums.
See https://forums.wesnoth.org/viewtopic.php?f=32&t=47721&start=450#p625660

All images but the young roc/roc would remain under the GPL, since Kwandulin based them on images by Sleepwalker and I wasn't able to contact him about using the CC BY-SA for them.  The young roc base and attack sprites are under the CC BY-SA, and are by Vyncyn(forum username).
2018-05-19 15:28:42 -05:00
Celtic Minstrel
691435ed4c Documentation for the translation completeness command-line flags 2018-05-19 16:19:13 -04:00
Celtic Minstrel
51f6f52709 Update changelog 2018-05-19 16:07:29 -04:00
Celtic Minstrel
b28c61c6dc Remove now-obsolete compile flag for disabling translation completion filtering 2018-05-19 16:03:49 -04:00
Celtic Minstrel
fc74e782b7 Add a command-line option to show incomplete translations in the language list 2018-05-19 16:02:04 -04:00
Celtic Minstrel
5e28c13b87 Sort command-line options so the comment isn't lying 2018-05-19 15:58:23 -04:00
Martin Hrubý (hrubymar10)
d19a82801f Xcode enable all warnings in DEBUG scheme 2018-05-19 21:36:55 +02:00
Nils Kneuper
132f67395a updated Spanish translation 2018-05-19 20:07:50 +02:00
Nils Kneuper
71a6488419 updated Chinese (Simplified) translation 2018-05-19 20:06:16 +02:00
Jyrki Vesterinen
a388c2d891 Fix build with -Werror=unused-variable 2018-05-19 16:41:15 +03:00
Jyrki Vesterinen
c68a7ba5f6 Changelog entry for commit 3deef64439
[ci skip]
2018-05-19 15:37:26 +03:00
Jyrki Vesterinen
3deef64439 Listbox: don't try to keep the selected item visible (#3016)
@Vultraz stated in Discord that list box should keep the scroll position
instead.

Resolves #3016.
2018-05-19 15:34:03 +03:00
Celtic Minstrel
4a3508f13f
Support [break], [continue], and [return] in [random_placement] 2018-05-19 00:42:23 -04:00
Nils Kneuper
1b7d8b2f60 updated Chinese (Simplified) translation 2018-05-19 01:30:17 +02:00
Nils Kneuper
63bac52b71 updated Italian translation 2018-05-19 01:28:52 +02:00
Nils Kneuper
7877bc3ef4 updated Italian translation 2018-05-17 21:23:28 +02:00
Nils Kneuper
83e1f6ad1c updated Galician translation 2018-05-17 21:22:28 +02:00
Nils Kneuper
20f92c3838 updated French translation 2018-05-17 21:21:00 +02:00
Nils Kneuper
2efd2c1d30 updated British English translation 2018-05-17 21:18:51 +02:00
Nils Kneuper
20532e3382 updated Czech translation 2018-05-17 21:17:41 +02:00
doofus-01
29f97cd2fe Nym sword attack animation 2018-05-17 16:41:34 +11:00
Severin Glöckner
3730ff9738 NR S2: let Hammel not take part in combat
All this trouble is about keeping him alive after all.
And fix a spelling mistake resuling in always false.

[ci skip]
2018-05-17 03:04:30 +02:00
Charles Dang
80e0463131 Begone, MENU_IMG_TXT!
[ci skip]

This utilized the deprecated DescriptionWML syntax.
2018-05-17 11:28:50 +11:00
Charles Dang
505d6264ac Removed deprecated objective text macros
[ci skip]

These are incorporated into the objectives dialog automatically. They lack a deprecation
notice, but they should be given level 3 status on the 1.14 branch.
2018-05-17 11:09:18 +11:00
Charles Dang
fc6825fcd5 Removed deprecated put_unit arg orders
x, y, unit and plain unit
2018-05-17 11:08:01 +11:00
Wedge009
e161d59536 Revert "Revert "'moreso' isn't a word in any dialect of English.""
This reverts commit 4d5a3de4e6.

Restoring correction at @Vultraz's request.

[ci skip]
2018-05-16 15:39:18 +10:00
Jyrki Vesterinen
9110e49760 Allow modifying dead units in more event handlers
Namely attacker_hits, attacker_misses, defender_hits and defender_misses.
2018-05-16 05:13:40 +03:00
Charles Dang
e0beff6615 Rename gettext_boost.cpp to gettext.cpp
Since there isn't another version anymore.
2018-05-16 12:06:48 +11:00
Aaron Winter
77fd148f06 SotBE: Changed a few dates to fit the tweaked timeline from the forums
Discussed in detail in https://forums.wesnoth.org/viewtopic.php?f=12&t=46460
2018-05-16 01:30:22 +03:00
Pentarctagon
fd34fe8497 Don't require SDL2 or OGL for building the servers.
Requiring SDL2 was masking needing to add -lpthread explicitly.
2018-05-15 16:16:09 -05:00
Charles Dang
ba6fa1e46b Convert a few remaining cases of boost::uint32_t to uint32_t 2018-05-16 07:38:47 +11:00
Charles Dang
1097bad28c Revert "Save custom options data in a more concise way"
This reverts commit e3db7cc225. Turns out the
id = value syntax did not work for options in an array since '.' is not a
valid config key name.
2018-05-16 07:21:19 +11:00
Nils Kneuper
2d9e02cffa updated Spanish translation 2018-05-15 22:20:23 +02:00
Jyrki Vesterinen
258a0e4689 Throw a Lua exception when creating a negative-HP unit in a Lua context
Instead of throwing a WML error. This allows the UMC author to get a stack
trace if the unit creation was triggered from Lua.

Requested by @gfgtdf in a comment of #3042.
2018-05-15 20:23:14 +03:00
Severin Glöckner
ddaf9f5a87 NR S2: fix filters for Micro AIs
and allow L2 recruits if the dwarves are under attack in late game.

[ci skip]
2018-05-15 16:44:15 +02:00
Charles Dang
2d600d10dc Wesnothd: minor code cleanup 2018-05-15 21:49:48 +11:00
Charles Dang
9a2d09f97e Wesnothd: formatting cleanup 2018-05-15 21:49:48 +11:00
Charles Dang
b623e7a647 Wesnothd: dropped a giant block of commented-out code
This is a relic from the old pro-Boost ASIO implementation.
2018-05-15 21:49:48 +11:00
Charles Dang
946e9c31b4 Fixup 2a585118d8 (forgot to bump defines on all configurations)
[ci skip]
2018-05-15 19:08:18 +11:00
Charles Dang
10e43a6642 GUI2/Canvas: simplify clear_shapes logic 2018-05-15 19:03:56 +11:00
Charles Dang
3d73dfdb15 Campaign Difficulty: cleaned up a few things left over from 50a3960
Also a small logic cleanup.
2018-05-15 19:03:40 +11:00
Charles Dang
50a3960abd Removed a bunch of things deprecated at level 3
* Legacy campaign difficulty syntax
* [combo] in [modification]s
* Support for legacy DescriptionWML in the MP Faction Select dialog
2018-05-15 11:53:24 +11:00
Charles Dang
3e9424fa33 Removed macros deprecated at level 2 and 3
[ci skip]
2018-05-15 11:38:49 +11:00
mattsc
66b9e11a2d Replace remaining uses of FOREACH macro 2018-05-14 17:13:42 -07:00
Severin Glöckner
fd9fc26ca0 NR S2: balance imporvements between AIs
* castle of the southwestern leader has been moved down a bit
* fixup for  gate event and troll die event not properly working
* give dwarves more gold if they are in trouble, increased income of trolls
* added micro AIs, currently not working as expected
* other minor map edits
* removed patch 9b9aa13 for #3073, the village had been moved down one hex
  for visual reasons

[ci skip]
2018-05-15 00:28:18 +02:00
Jyrki Vesterinen
15446acb2a Allow modifying dead units in last_breath and die event handlers
Fixes an unintentional API change from commit 3c344e8da5, discussed in
comments of #3042.
2018-05-14 22:07:48 +03:00
Severin Glöckner
ed46bc1d2b wmllint: add campaign abilites & specials
So far only stun was in the list

[ci skip]
2018-05-14 06:11:29 +02:00
mattsc
4b6681a300 Do not load helper.lua where it is not used any more 2018-05-13 20:53:01 -07:00
mattsc
1684e2f5da Remove unnecessary inclusions of helper.set_wml_action_metatable {} 2018-05-13 20:52:51 -07:00
mattsc
08a000a7da Lua code: remove deprecated helper.set_wml_var_metatable() call
It’s not needed here.
2018-05-13 20:52:40 -07:00
mattsc
3c792fc7d7 Lua code: replace deprecated helper.[gs]et_variable_array() calls 2018-05-13 20:52:17 -07:00
mattsc
7c137e1a33 Lua code: replace deprecated helper.child_range() calls 2018-05-13 20:52:08 -07:00
mattsc
f0bb40590f Lua code: replace deprecated helper.get_child() calls 2018-05-13 20:51:56 -07:00
mattsc
f153279e87 Lua code: replace deprecated helper.get_variable_proxy_array() call 2018-05-13 20:51:35 -07:00
mattsc
64f7ad2560 Lua code: replace deprecated wesnoth.get_all_vars() calls 2018-05-13 20:50:49 -07:00
Charles Dang
8f93d0a7c6 Saved Game: reame "starting pos" to "starting point" to avoid confusion
The old name was too easy to confuse with a side's map staring position, something
I've done several times.
2018-05-14 14:45:54 +11:00
mattsc
ce7faae4f4 Lua code: replace deprecated wesnoth.set_variable() calls 2018-05-13 20:35:20 -07:00
mattsc
0f157bff27 Prevent definition of wml.variables to cause deprecation warnings 2018-05-13 20:20:43 -07:00
Charles Dang
ba0a12b918 Clarify the Dunefolk are human
[ci skip]
2018-05-14 14:17:00 +11:00
mattsc
f1764d182f Lua code: replace deprecated wesnoth.get_variable() calls 2018-05-13 20:03:34 -07:00
mattsc
138107c8f6 Lua code: replace deprecated wesnoth.tovconfig() calls 2018-05-13 19:54:14 -07:00
doofus-01
16d5bc5028 clean-up of unit cfg 2018-05-14 13:51:20 +11:00
doofus-01
90fefabc4e quenoth fighter attack animation 2018-05-14 13:51:19 +11:00
Thom Diment
b7b6ff34df changed SE path to remove 1-hex bottlenecks
This allows player 3 to send more enemies against the human player sooner. If this is an issue, may be necessary to  consider changing the scenario wml to delay this player spawning by a turn.
2018-05-14 11:56:18 +11:00
doofus-01
a943e1c55d outrider defense animation 2018-05-14 11:42:04 +11:00
doofus-01
fc639f6cc0 pathfinder defense animation 2018-05-14 11:42:04 +11:00
mattsc
5e5a9e69e5 MAI test scenarios: remove uses of deprecated MESSAGE macro 2018-05-13 15:41:10 -07:00
ln-zookeeper
9c65035075 Fixed a remaining glitch with off-map<->water transitions 2018-05-14 00:24:15 +03:00
catagent101
743be1522c TSG S07a: Fix dialogue not triggering in TSG 'Into the Depths' (#3048) 2018-05-14 00:00:43 +03:00
doofus-01
fa59b1084c [UtBS] replacing horses with dustboks (#3049)
* removing horses from text strings - replaced with dustboks

* adding a riderless dustbok to monsters race, needs description and probably other adjustments

* removing disengage ability and translation mark from dustbok unit file

* adding #po translation hint for name
2018-05-13 23:42:02 +03:00
gfgtdf
e88a73fc2a fix uncaught stoi exception 2018-05-13 16:14:06 +02:00
gfgtdf
fd48bad8d9 wb: fix segfault when ending the game
fixes #3008

This is not the prettiest fix, but in particular for 1.14 stable it's
less risky than some big refactor.
2018-05-13 16:11:35 +02:00
gfgtdf
eaabf1648d wb: fix incorrect handling of skirmisher.
fixes #3014
2018-05-13 16:11:26 +02:00
gfgtdf
6a9e2c260d wb: add a assertion 2018-05-13 16:11:07 +02:00
gfgtdf
5884aa27ea wb: don't clear undo stack when dsu is active
since that might lead to assertion failures&oos later, fixes #3029
2018-05-13 16:09:09 +02:00
gfgtdf
5c278a3936 editor: don't allow bad location id strings
in particular using spaces or commas here results in invalid map files when the map is written to disk. (repoted on the forum)
2018-05-13 16:06:03 +02:00
Charles Dang
0d15c1e19e Formatting cleanup: convert remaining cases of > > to >> 2018-05-14 00:09:23 +11:00
Charles Dang
2c57dc3705 Convert a bunch more C-style casts I missed in 0dc5656 to static_cast 2018-05-14 00:07:27 +11:00
Charles Dang
cc86502700 Fixup ccbb736 2018-05-14 00:03:50 +11:00
Charles Dang
0dc5656c32 Convert C-style casts to static_cast 2018-05-13 22:36:50 +11:00
Charles Dang
36e83e646c Use std::tm instead of plain C tm 2018-05-13 22:28:12 +11:00
Charles Dang
00bea6494f Use std::localtime() instead of plain C localtime() 2018-05-13 22:26:10 +11:00
Charles Dang
d26824901d Use std::time() instead of plain C time() 2018-05-13 22:22:07 +11:00
Charles Dang
ccbb736a18 Use std::time_t instead of plain C time_t 2018-05-13 22:13:33 +11:00
Martin Hrubý (hrubymar10)
e16373bada
Fix Xcode project after e0192b1b1f 2018-05-13 13:09:33 +02:00
Charles Dang
1e84ec2b94 Added the appropriate check to enable std::filesystem when using GCC 8 2018-05-13 21:46:54 +11:00
Nils Kneuper
f9b9d5018f remove executable flag from italian translation images 2018-05-13 11:27:29 +02:00
Nils Kneuper
4918a6234e updated Italian translation (images) 2018-05-13 11:23:45 +02:00
Nils Kneuper
adb4c511e2 updated French translation 2018-05-13 11:20:58 +02:00
Jyrki Vesterinen
91e60267ba MP lobby: don't attempt to restore player list scroll position too early
Fixes error messages in the log when joining the lobby.
2018-05-13 12:16:33 +03:00
Iris Morelle
c8c3625e3a wesnothd: Fix typo introduced recently causing build errors
Fixes commit 2bf4d68c87.
2018-05-13 04:06:23 -04:00
Iris Morelle
ba64a502e1 bi: Refactor report headers generation 2018-05-13 01:45:59 -04:00
Charles Dang
0d1571a0b2 MP Lobby: used "not installed" instead of "missing" 2018-05-13 16:17:09 +11:00
Charles Dang
2bf4d68c87 Catch all exceptions (where possible) as const references
A few catch blocks modify something in their exceptions, so those are kept non-const.
2018-05-13 15:48:14 +11:00
Charles Dang
74f86aea1d Mark wml_exception::show const and formula_ai::handle_exception's argument const 2018-05-13 15:46:31 +11:00
Jyrki Vesterinen
c3d711632e Fix compiler warning about unreferenced variable 2018-05-13 07:32:47 +03:00
Fernando Carmona Varo
026ea6ee78 tutorial: add labels to villages and keep
Prevents new players from mistaking the graphics
2018-05-13 14:02:21 +11:00
mattsc
7d0d9e19a5 Lua random map generator: fix off-by-one error in flip transforms
Among other things, this gave HttT S17 (Sceptre of Fire) a 50% chance
of crashing at scenario start.
2018-05-12 18:43:16 -07:00
Severin Glöckner
1b1762cdf2 UtBS utils: add female string (fixup)
[ci skip]
2018-05-13 01:23:52 +02:00
Charles Dang
f34db1b8ac MP Lobby: removed "illegal map" error (see #3095)
There's still the "Error while loading the map:" error emitted by the minimap
widget, but this at least curbs the duplicates.
2018-05-13 08:53:56 +11:00
Severin Glöckner
9baee77e4a NR S2: fixup prose
[ci_skip]
2018-05-12 22:08:02 +02:00
Severin Glöckner
41298d76c7 NR S2: better conditional for victory event
previousl one could trigger victory while being at
the other side of the cave wall

[ci skip]
2018-05-12 21:42:27 +02:00
Severin Glöckner
1d288355b0 Change Death Knights axe icon to fitting axe
[ci skip]
2018-05-12 20:32:23 +02:00
Severin Glöckner
682a84ffec NR S2: improve balancing
[ci skip]
2018-05-12 20:32:23 +02:00
Severin Glöckner
0ad223ab85 NR S2: flavor event: fix coordinates
[ci skip]
2018-05-12 20:32:23 +02:00
Severin Glöckner
255e77115d Nr S2: edited map:
* make north gate obvious to players
* mitigate bridges transition
* use less human castles
* don't break northern train line
* move the bridges in the Trolls keep farther behind, to be less
  vulnerabe to the northern leader

[ci skip]
2018-05-12 20:32:23 +02:00
Severin Glöckner
401eba49e2 NR S2: show message for northern border too
[ci skip]
2018-05-12 20:32:23 +02:00
Charles Dang
e0192b1b1f Renamed filesystem_boost.cpp to filesystem.cpp 2018-05-13 00:10:56 +11:00
Charles Dang
231d97c27f Filesystem: added (currently incomplete) support for using std::filesystem
Not usable until I figure out how to convert the return value of std::filesystem::last_write_time
to time_t, but this lays the groundwork.
2018-05-13 00:06:19 +11:00
Nils Kneuper
0b8c90e752 updated Ukrainian translation 2018-05-12 10:54:04 +02:00
Nils Kneuper
ecedf14aa7 updated Italian translation 2018-05-12 10:52:53 +02:00
Nils Kneuper
488c587f8e updated British English translation 2018-05-12 10:51:14 +02:00
Jyrki Vesterinen
ab0d3747aa Changelog entry for commit a3658473c9 2018-05-12 09:55:06 +03:00
Jyrki Vesterinen
a3658473c9 MP lobby: fix player list scrolling to top when it changes 2018-05-12 09:51:44 +03:00
Charles Dang
36c0b6b648 MP Lobby: removed "Registered Users Only" from settings list in info tooltip
This isn't really relevant anymore since everyone is registered on the official server.
2018-05-12 15:33:30 +11:00
Charles Dang
c20eab0a5e MP Lobby: sort mods list alphabetically and color "missing" text 2018-05-12 15:33:29 +11:00
Charles Dang
ee90182886 Actions/Create: formatting cleanup 2018-05-12 14:30:22 +11:00
Severin Glöckner
1f75c5b14d NR S2: remove second endlevel event for hamels death
This level has it's own event to handle this situation.

closes #3091
[ci skip]
2018-05-11 21:38:42 +02:00
Severin Glöckner
52d8cef080 NR S2: refactor objectives
[ci skip]
2018-05-11 20:32:07 +02:00
Severin Glöckner
76134436fc NR S2: Avoid Tallin talking to himself
(part of #3086)
[ci skip]
2018-05-11 20:32:07 +02:00
Pentarctagon
34965741bd Fix FindGLEW being incorrectly named.
It was .make, it should be .cmake.
2018-05-11 11:22:20 -05:00
Pentarctagon
8582ce1044 Mark OpenGL and GLEW as required in cmake. 2018-05-11 11:22:20 -05:00
Pentarctagon
7a3fb8815b Fix missing SDLMain.mm. 2018-05-11 11:22:20 -05:00
Pentarctagon
f5d74cd5ed Fix building with osx+cmake on travis. 2018-05-11 11:22:20 -05:00
Pentarctagon
f53c6b84cd Add osx+cmake support to travis. 2018-05-11 11:22:20 -05:00
mattsc
9b9aa13a3d Northern Rebirth S02_01: keep side 8 leader from wandering off too far
If he ends up on the tiny keep in the south, he can only recruit one
unit per turn, which affects the intended balance of the scenario.
Fixes #3073
2018-05-11 09:09:36 -07:00
Severin Glöckner
4873f1a41e UtBS S1: change terrain code of the death tree hex
Visually it has no effect since the embelishment is
covered by the tree image.
In the help it is now not only displayed as grass.

[ci skip]
2018-05-11 14:07:53 +02:00
Severin Glöckner
8ac1518884 UtBS: add female variations for all ability names
including the ones which do not require it,
to make it easier to reuse them

[ci skip]
2018-05-11 14:07:23 +02:00
Charles Dang
f279ad5fc0 Whiteboard: avoid the use of a deprecated C++17 function
shared_ptr::unique() is equivalent to use_count() == 1. A few of these checks should probably
be > 1 to account for 0, but this is a direct logical translation.
2018-05-11 16:10:56 +11:00
Charles Dang
1c575f59fa Work around some weird compiler bug with VS using C++17
Without this, I get the error "syntax error: '<'" and a reference to the function's
opening bracket... No idea why. It build fine on VS 15.7.1 with C++14.
2018-05-11 16:08:42 +11:00
Charles Dang
0f9a0fac5e Filesystem/Boost: don't import boost::fileystem::path class to global namespace
This makes it a *lot* clearer that we're using the bfs class and not some function
or class defined elsewhere in our code.
2018-05-11 12:08:56 +11:00
Charles Dang
c643b765dd Filesystem/Boost: range-for 2018-05-11 11:54:37 +11:00
Charles Dang
32111ae5e9 Filesystem/Boost: made use of std::make_unique 2018-05-11 11:54:36 +11:00
Charles Dang
f105fa2036 Filesystem/Boost: formatting cleanup 2018-05-11 11:54:35 +11:00
David white
3886228447 added use_prng preference which adds a new experimental pseudo-RNG for casual campaign play 2018-05-11 11:23:01 +11:00
Charles Dang
b89b89abea Only redefine VOLUME_NAME_NONE if it's not previously defined 2018-05-11 11:22:25 +11:00
Charles Dang
41b436abd3 Fixup 497d58d (forgot to free the doc path) 2018-05-11 11:15:40 +11:00
Charles Dang
2a585118d8 Bump min required Windows version to 7
Technically, all this code should work on Vista, (including the recent switch to using
SHGetKnownFolderPath), but since we're also considering requiring Visual Studio 2017
for building, we need Windows 7.
2018-05-11 10:56:11 +11:00
Charles Dang
497d58df6f Convert use of deprecated SHGetFolderPathW to SHGetKnownFolderPath 2018-05-11 10:29:12 +11:00
Jyrki Vesterinen
9db47334a9 Changelog entry for commit 8fa3f6a6d4 2018-05-10 11:09:41 +03:00
Jyrki Vesterinen
8fa3f6a6d4 Fix #3065: unit halo remains after undoing a recall 2018-05-10 11:07:24 +03:00
Iris Morelle
fc002f49a9 pofix: Update with 1.14.0 -> 1.14.1 file size rules for the website
[ci skip]
2018-05-09 18:38:31 -03:00
Iris Morelle
c517abb122 pofix: Update with 1.14.0 -> 1.14.1 rules for the website
[ci skip]
2018-05-09 17:53:51 -03:00
Jyrki Vesterinen
ef60deaa2b Disallow units with negative HP
Damage calculation code can't tolerate presence of such units.

Fixes #3042.
2018-05-09 21:38:55 +03:00
Charles Dang
05774a3df5 Changelog: fixed inaccuracy
[ci skip]
2018-05-09 23:58:41 +11:00
Charles Dang
4c937c10c7 Fixed a crash when using certain invalid color= values
The specific case that brought this to our attention was color=100. In case such values
are used, the color reverts back to the default color for that side, as before.

The new codepath (team::get_side_color_id_from_config) is essentially the same as the old
one but more robust (range checking, for example, the lack of which was causing the crash
before).
2018-05-09 23:58:40 +11:00
Charles Dang
6a7bd05250 Revert "MP Lobby: reduced frequency of network polls (100ms -> 1000ms)"
This reverts commit 5fd833a91a. It was causing the lobby to
lag up to *three minutes* behind current activity due to multiple data packets being queued
(see #3046). It seems 100 ms was enough to mask this issue.
2018-05-09 23:58:40 +11:00
Charles Dang
fd86d1ff8c UtBS: wmlindent run
[ci skip]
2018-05-09 23:58:39 +11:00
Iris Morelle
92812588b3 Add changelog entries for the workaround for issue #3050
[ci skip]
2018-05-09 04:57:59 -03:00
Pentarctagon
96b43a9af4 Warn about use of trampolines for nested functions.
Use of this feature with GCC in particular causes the stack to become marked as executable.
2018-05-09 10:38:23 +03:00
gfgtdf
a3decde67f more debug information in icompare 2018-05-09 03:32:10 -03:00
Iris Morelle
4335bedeff wam: Allow using embedded data URIs as add-on icons
[ci skip]
2018-05-08 02:26:34 -03:00
Iris Morelle
c92b9de1db Update own credits entries
[ci skip]
2018-05-08 02:25:30 -03:00
ln-zookeeper
f8a02e5e6d Updated changelog 2018-05-08 00:53:52 +03:00
ln-zookeeper
083066bff2 UtBS: Fixed a bug in the formation ability
If a unit had for example 3 other formation units adjacent but only needed 1 to reach 70% defense, it didn't receive any benefit at all (as the corresponding [chance_to_hit] tag remained inactive).

Spotted and fix provided by beetlenaut.
2018-05-08 00:42:08 +03:00
Nils Kneuper
add4ea3d95 updated German translation 2018-05-07 23:04:05 +02:00
Nils Kneuper
de2b3d186e updated Chinese (Simplified) translation 2018-05-07 19:45:06 +02:00
Nils Kneuper
6d0f7c3a62 updated Japanese translation 2018-05-07 19:44:05 +02:00
Nils Kneuper
587c280d41 updated Italian translation 2018-05-07 19:39:59 +02:00
Nils Kneuper
7290b1b3ab updated Galician translation 2018-05-07 19:38:22 +02:00
Nils Kneuper
6c01d8494b updated Scottish Gaelic translation 2018-05-07 19:37:01 +02:00
Nils Kneuper
255be2e003 updated Spanish translation 2018-05-07 19:35:35 +02:00
Jyrki Vesterinen
057e53a463 Partial case insensitivity for translation::icompare() fallback 2018-05-07 19:46:42 +03:00
Iris Morelle
871189cc36 i18n: Blind fix attempt for std::bad_cast being thrown on Windows
Several reports on Steam and our forums point at std::bad_cast being
thrown when accessing Preferences and the Multiplayer menu amongst
others. It's possible that the locale configuration on those systems is
not quite right, and compare() and icompare() are able to throw
std::bad_cast when this happens as they both use std::use_facet().

Note that much like the macOS/iOS version of icompare(), this stopgap
patch doesn't attempt to provide any form of case-insensitive fallback
and just uses a case-sensitive comparison instead.
2018-05-07 19:46:31 +03:00
Charles Dang
26c8860b6c Preferences Dialog: fixed inconsistent label sizes in hotkeys list 2018-05-07 13:56:45 +11:00
Charles Dang
58ebc064e9 MP Lobby: bunch of small UI and text formatting tweaks 2018-05-07 11:42:11 +11:00
doofus-01
21708d8add [UtBS]-Graphics Update, mostly defense animations (#3035)
* quenoth ranger defense anim

* youth leading animations

* Kaleh bolas anim

* quenoth flanker defense anim

* quenoth druid defense anim

* quenoth archer defense anim
2018-05-07 11:42:09 +11:00
Nils Kneuper
69bc5b614f updated Slovak translation 2018-05-06 23:05:16 +02:00
Nils Kneuper
58bfca286a updated Czech translation 2018-05-06 23:03:19 +02:00
sigurdfdragon
a67e068178 Help: Add wolves race description
From https://forums.wesnoth.org/viewtopic.php?f=32&t=43721&start=75#p597028

[ci skip]
2018-05-06 12:44:07 -04:00
sigurdfdragon
e9ab1ce8d1 Help: Add falcons race description
From https://forums.wesnoth.org/viewtopic.php?f=32&t=43721&p=593757#p593757

[ci skip]
2018-05-06 12:44:07 -04:00
Wedge009
d85e2a2886 Update text to match game-play changes (fixes #2950).
[ci skip]
2018-05-06 18:40:35 +02:00
Wedge009
f1bcdc7f1b Update text to match changes in dialogues (fixes #2882).
[ci skip]
2018-05-06 18:40:35 +02:00
Nils Kneuper
d0ebbbb7c3 updated Chinese (Simplified) translation 2018-05-06 17:13:12 +02:00
Charles Dang
79c9862129 MP Lobby: reduced frequency of network polls (100ms -> 1000ms)
This also affects MP Staging and MP Join Game.
2018-05-06 22:59:21 +11:00
Charles Dang
6d84ee70c5 MP Lobby: rearrange player list nodes and have Selected Game also expanded by default 2018-05-06 22:59:20 +11:00
Charles Dang
be580a1973 GUI2/Chatbox: attempt to send roomless messages to the active room first
Fixes #2775. Server messages in particular are roomless, so now they should appear in
whatever tab (PMs included) you have open.
2018-05-06 22:59:19 +11:00
Charles Dang
2769345f55 Increased in-game chat size. This makes it render more smoothly
Thanks to @ProditorMagnus for the suggestion. Note that here on master, this code isn't
really used right now, so it's mostly here for completeness if it turns out to be needed.
2018-05-06 22:59:18 +11:00
Charles Dang
fe10bc0315 MP Lobby: removed Refresh button
I'm not 100% sure about this change, but I think its presence was rather confusing and
it (hopefully) shouldn't ever be needed.
2018-05-06 22:59:17 +11:00
Nils Kneuper
d98d711e24 updated British English translation 2018-05-06 13:44:26 +02:00
Lipka Boldizsár
7b5cf85461 Fix excessive mp lobby refreshing. 2018-05-06 22:42:33 +11:00
Nils Kneuper
0dda29b238 updated Czech translation 2018-05-06 13:32:14 +02:00
Lipka Boldizsár
8bd6646182 Revert "Fix excessive mp lobby refreshing."
This reverts commit 590fd3c4d5.
2018-05-06 13:02:56 +02:00
Lipka Boldizsár
590fd3c4d5 Fix excessive mp lobby refreshing. 2018-05-06 12:55:29 +02:00
Iris Morelle
9850d3fa9c Update changelog for #3019
[ci skip]
2018-05-06 07:14:40 -03:00
Alexander van Gessel
6444ebde60 Reject bad data URIs 2018-05-06 07:13:21 -03:00
Iris Morelle
622b1936bc Update changelog for MP server stuff from me and loonycyborg
[ci skip]
2018-05-06 05:29:05 -03:00
Iris Morelle
c0f160b351 fuh: Add NOTE on the status of glob bans
[ci skip]
2018-05-06 05:25:23 -03:00
Iris Morelle
80d6dbbaf9 mp: Add client-side localization support for user_handler bans 2018-05-06 05:25:16 -03:00
Iris Morelle
d48c84236c wesnothd/fuh: Check IP address bans before everything else
There isn't much point in doing more expensive ban look ups first.

(Also, yes, I am aware that as it is there's still two SELECT queries
that could be coalesced into a single one -- namely, the ones for the
user_email and user_id columns.)
2018-05-06 05:25:10 -03:00
Iris Morelle
749e684f03 wesnothd: Report different user_handler ban types
This enables reporting back to the client the specific type of ban that
affects the account. This information is already normally provided by
phpBB when trying to view a page while banned, so we are not leaking any
new information here.

There isn't an API to retrieve the (user-visible) ban reason from the
ban list yet. It's probably not worth worrying about it since affected
users can see it when navigating to forums.wesnoth.org anyway.
2018-05-06 05:25:06 -03:00
Iris Morelle
f2c06f0a4e wesnothd: Initial support for checking forum bans during login
This adds a user_is_banned() method to the user_handler classes that
returns whether a given username (and optionally IP address) is banned
by the user_handler platform. Obviously right now this is only intended
to work with forum_user_handler and phpBB.

Forum bans are checked against entries in the banlist table using
username (actually user id), IP address, and email address where
applicable. A user matching a ban on any of those three items will not
be permitted into the server *unless* they have the moderator flag set.
It might be worth making an exception for board founders as well,
although that is probably orthogonal to this patchset.

Right now there are a few missing items:

 * The server sends clients an error that allows them to try again with
   a different username/password combination immediately. Nothing stops
   them from causing noise in the server logs this way, so we probably
   need to ensure this counts as an authentication failure for the
   purpose of temporarily and automatically banning the IP address.

 * The user handler doesn't allow retrieving details about the ban, so
   all that the main server code can do is report back to the client as
   their nickname being banned, when this is not necessarily the case
   (email or IP address bans). I need to figure out a better API for
   retrieving this info.

 * Likewise, the server does not log the specifics about the matched ban
   yet unless the mp_user_handler log domain is set to the info log
   level.

 * There's no i18n support on the client side for the error message sent
   by the server -- which is going to change anyway.

 * Testing this patch uncovered an issue with the MP client not
   displaying messages sent during the login sequence, including the mod
   authentication notice.
2018-05-06 05:25:02 -03:00
Charles Dang
851b28e24b * MP Method Selection: clarified the account requirement for the official server
Also sets the tooltip type for this dialog back to bottom-of-the-screen ones instead
of floating ones. And some formatting cleanup to the C++.
2018-05-06 16:39:31 +11:00
Iris Morelle
d39d1b87fd pofix: Add 1.14 announcement typo fix
[ci skip]
2018-05-06 02:38:14 -03:00
Iris Morelle
d727cf2c99 gui2/unit_attack: Only display active specials on the weapons list
This fixes issues reported on the forums where the weapons list now
includes weapon specials even when they aren't active, a regression from
1.12.x.

Closes #3033.
2018-05-06 00:40:11 -03:00
Celtic Minstrel
ebf3866132
Update credits
* Add @neoedmund, @fujimo-t, and Zoomo
* Add @singalen's alias
* Correct @GregoryLundberg's alias
2018-05-05 21:13:30 -04:00
mattsc
a82971e48d changelog entry for custom AI for AToTB S2 2018-05-05 13:58:51 -07:00
mattsc
bbb151fa71 AToTB Chase: add custom AI controlling Muff Toras 2018-05-05 13:54:49 -07:00
Charles Dang
a8ce08fc23 UtBS: wmlindent pass
[ci skip]
2018-05-06 06:39:10 +11:00
gfgtdf
775f3ec995 wb: prevent unit id conflics
the wb recruit actions store temp units with fake ids and live longer
than a turn, so resetting the underlying id counter between turns might
result in dublicate id errors in wb recruit actions ( #1517 ), which
might lead to errors later.

With this it is of course possible to get erros when more than 2^31 (or
2^63 on a 64 bit wesnoth version.) fake units are generated during a
game, but that is less likely.
2018-05-06 06:30:55 +11:00
gfgtdf
8b745095ab add a comment 2018-05-06 06:30:53 +11:00
gfgtdf
cdb98f75a4 wb: fix 'insufficient movement' wanring when a move is interrupted 2018-05-06 06:30:52 +11:00
gfgtdf
2635c7014f wb: more detailed error message 2018-05-06 06:30:51 +11:00
gfgtdf
4725ba9f35 add todo 2018-05-06 06:30:50 +11:00
gfgtdf
aa3a357bfc wb: fix planned units under fog cannot be selected 2018-05-06 06:30:49 +11:00
gfgtdf
51189881dc wb: silence "Unable to build future map" warning 2018-05-06 06:30:48 +11:00
gfgtdf
5a3eec5398 fix comment 2018-05-06 06:30:47 +11:00
gfgtdf
14a0e3744f wb: fix rare OOS caused by recall action
previously having a planned recall action could change the order of
units in the recall list, which might for example change which unit is
recalled by a [recall].
2018-05-06 06:30:46 +11:00
gfgtdf
19e123e38b wb: fix recall actions changing gamestate
The firstproblem was that:
apply_temp_modifier adds the temp_unit_ to the map, then
remove_temp_modifier adds the temp_unit_ from the map to the recall
list, which resulted in the original recall unit beeing replaced by the
temp_unit_ of the recall_action We fix that by making sure that
temp_unit_ is always the same as athe recall unti not just a copy.

The second problem was that remove_temp_modifier reset the unit mp/ap to
a value differnt form the original mp/ap which could casue OOS later
since the ap/mp might be changed form that unsynced context, we fix that
by resetting the mp/ap in remove_temp_modifier
2018-05-06 06:30:45 +11:00
gfgtdf
97a5810f2d wb: fix moved becoming invalid after recruit is executed 2
turned out 8bdccca7 was not enough because the mapbuilder erroneously
reset the units movement to full directly before it was applied. Since
the `resetters_` code in mapbuilder.cpp does not apply to
recruited/recalled units, we also have to reset the units mp in
remove_temp_modifier.
2018-05-06 06:28:46 +11:00
pentarctagon
6c5fc82b1b Add option to build wesnoth with hardening options. 2018-05-05 10:05:53 -05:00
loonycyborg
10ee2b2d29 wesnothd: add a check to prevent crash from accessing game owner not in player_connections_ 2018-05-05 15:09:49 +03:00
gfgtdf
c580156716 remvoe spammy debug message. 2018-05-05 18:10:54 +11:00
gfgtdf
8bdccca7e3 wb: fix moved becoming invalid after recruit is executed 2018-05-05 18:10:53 +11:00
Charles Dang
717578b8a3 MP Lobby: kept the titles of reloaded games with vacant slots yellow 2018-05-05 14:00:21 +11:00
Charles Dang
7983b283ce Yet even more additional supplementary additive fixup 2018-05-05 13:31:16 +11:00
Charles Dang
77922e5450 Fixup 18afe08 2018-05-05 13:00:10 +11:00
Celtic Minstrel
acb48da5d2 SotA: Avoid use of 'kids' to address Carcyn and Shynal
This is intended to address concerns raised by @beetlenaut that the two are not young enough to be referred to as 'kids'.
2018-05-05 12:58:40 +11:00
Charles Dang
2f565b8e90 MP Lobby: base resolution selection on window width not height
[ci skip]

Height isn't the problem. The default lobby can display fine even at 600 px h. Width is
the problem the default layout faces at low resolutions, and it was quite odd to have a
really wide window use the low resolution layout, despite there obviously being enough
horizontal space to fit the sidebar.
2018-05-05 12:35:27 +11:00
Charles Dang
d789c2e773 MP Lobby: fixed every single user name being bold
If everyone's registered... no one is. :P
2018-05-05 12:35:05 +11:00
Charles Dang
08d0f6983f MP Lobby: decreased size of scenario/era name label
[ci skip]

Will slightly mitigate the issue of it potentially getting too long...
2018-05-05 12:35:04 +11:00
Charles Dang
0db17bbcf1 MP Lobby: shifted game info icon to the left
[ci skip]
2018-05-05 12:35:03 +11:00
Charles Dang
819947f95f MP Lobby: added status text for full games 2018-05-05 12:35:02 +11:00
Charles Dang
b17e9fa9b1 MP Lobby: restored Era info to main game display
Includes some slight spacing tweaks.
2018-05-05 12:35:00 +11:00
Charles Dang
b947e7f63d Added some changelog entries for UtBS
[ci skip]
2018-05-05 12:34:36 +11:00
Charles Dang
d9e3983e97 MP Create Game: cap custom game names at 50 characters
[ci skip]
2018-05-05 12:34:00 +11:00
Charles Dang
18afe08a7b GUI2/Size Lock: ensure formula sizes are recalculated as necessary.
This is similar to the change made for spacers in da5f00c2b6.
It also fixes an issue with the MP Lobby chat box (and other such widgets that use formulas
for their fixed dimensions) where it would stay too small after a window resize (the chat
box formulas in all three dialogs it appears in are a percentage of window height).
2018-05-05 12:33:38 +11:00
loonycyborg
6a310f0c79 wesnothd: process wml commands one at a time in handle_read_from_player
as is done in rest of wesnothd. This also fixes crash from self-kick
due to it trying to continue processing looking for further tags
after /query kick kicked the user in quesion.
2018-05-04 19:08:24 +03:00
Iris Morelle
3259ef75b9 Fixed some issues with desynced changelogs and incorrect capitalization/order
[ci skip]
2018-05-04 07:05:31 -03:00
Iris Morelle
c503c2ce35 mp: Improve display of wesnothd client errors in general
Besides replacing the "End of file" error when getting disconnected from
the server under unexpected circumstances (e.g. because the server died)
with a translatable and more intuitive message, this also makes it so
other network error messages ("Connection refused", "Host not found",
etcetera) are displayed in the UI in a slightly clearer fashion, and in
an error dialog that must be dismissed with a click on a button, instead
of a transient message that can be easily missed due to an accidental
misclick.

Closes #3005.
2018-05-04 07:05:31 -03:00
ln-zookeeper
195d5a93db UtBS: Fixed some obsolete references to old elf units, weapons and hair
In S03, also removed one extra instance of the word "champion" from the same string.
2018-05-04 12:58:40 +03:00
loonycyborg
40ae6c5356 wesnothd: fix game host kick command kicking host itself instead of intended target 2018-05-04 12:27:10 +03:00
ln-zookeeper
d217dfc13c EI S11: Fixed units incorrectly costing upkeep after leveling up 2018-05-04 11:21:27 +03:00
Pentarctagon
5fed276ad7 Fix cmake compiling with spaces in directory names. 2018-05-04 01:30:44 -05:00
Charles Dang
195eb0ce73 MP Lobby: improved low-resolution layout
[ci skip]

* Removed unnecessary spacer line.
* Increased chat area height by 10% .
2018-05-04 17:17:53 +11:00
Severin Glöckner
774471ba29 Lobby mouseover: rename Gold to Gold per Village 2018-05-04 06:54:19 +02:00
Charles Dang
3e27ccaf18 MP Lobby: highlight the titles of MP games with vacant slots 2018-05-04 15:03:17 +11:00
Charles Dang
3d158130f4 MP Lobby: used specific colors instead of pango presets
The Pango presets are usually a little darker than we want, so this makes the colors POP.
2018-05-04 15:02:52 +11:00
Charles Dang
65a554f41d GUI2/Chatbox: fixed close button being shown for lobby tab when reloading log
Fixes #2992.
2018-05-04 13:09:32 +11:00
Charles Dang
ffe71c5157 MP Lobby: removed individual Join/Observe buttons for each game 2018-05-04 13:09:30 +11:00
loonycyborg
b0cbe3adf7 wesnothd: fix crash from using reference to deleted object 2018-05-04 02:58:46 +03:00
gfgtdf
04d0dcdf65 wb: fix moves for planned recruits
the for those moves get_unit() might return nullptr when it is
when the future map is not applied and some codes deduced from
that that the action is invalid. So we make sure that code does
not rely on get_unit().
2018-05-04 10:51:03 +11:00
gfgtdf
c9df4bf02a wb: add debug info 2018-05-04 10:50:39 +11:00
gfgtdf
6cfe64e4da wb: cleanups & add debug message 2018-05-04 10:50:38 +11:00
gfgtdf
4f161d889c wb: fix crash when using planning mode mode with dsu
fixes #1599 . we now automaticllay disable dsu when enabling planning mode
2018-05-04 10:50:37 +11:00
gfgtdf
2174bfc215 wb: update following moves when a recruit is executed
After a recruit action was executed the id of the unit was changed so we
need to update the unitid of all following actions on that unit
2018-05-04 10:50:36 +11:00
gfgtdf
5847615a77 wb: refactor out get_unit() calls
there have been reported many assertion failures due to get_unit()
returning nullptr, so we try not to rely on get_unit() whenever
possible.
2018-05-04 10:48:57 +11:00
gfgtdf
00f90eabe6 wb: fix nullptr assertion when log is enabled 2018-05-04 10:48:56 +11:00
gfgtdf
195913fc4b wb: more robust side_actions_container::erase
i don't really know why the old code had a special case for
`get_turn(next) != turn_of_position`, from what i see `turn_end(0)`
would basicially return the same value as `next`. The new code removes
that special case which resulted in assertion failures before (#1841)
and also consiers the case where `position` appears multiple times in
`turn_beginnings_`
2018-05-04 10:48:55 +11:00
gfgtdf
ba6495c96a wb: more robust side_actions_container::get_turn
the assumption

(turn_beginnings_[num] == it) => (get_turn(it) == num)

might be wrong in case that we have a turn with no actions, in which
case turn_beginnings_ contains duplicates and we actually want the upper
bound of (x <= it) in turn_beginnings_
2018-05-04 10:46:45 +11:00
gfgtdf
9277a6cf53 wb: fix future unit sprite missing
fixes #2124
2018-05-04 10:46:44 +11:00
Nils Kneuper
c19590fc45 updated Galician translation 2018-05-03 21:22:12 +02:00
Iris Morelle
006bd4d099 Fix wesnoth(6) claiming the default log level is error
It's been warning since version 1.9.0.

[ci skip]
2018-05-03 14:08:14 -03:00
loonycyborg
688ae150cc wesnothd: Fix remaining incorrect uses of simple_wml::get_attr instead of get_attr_dup 2018-05-03 12:14:34 +03:00
doofus-01
f880f40254 fix TOD lighting for sleeping Kaleh, and make sure Zhul is facing the right way in opening scene 2018-05-03 05:34:34 +11:00
doofus-01
ee04db61eb Bolas animations for Nym 2018-05-03 05:34:33 +11:00
doofus-01
de25b87924 defense animations for shaman 2018-05-03 05:34:32 +11:00
doofus-01
ad8bc76144 update to flanker and ranger base sprites 2018-05-03 05:34:32 +11:00
doofus-01
6ceedb4053 quenoth shaman and druid sprites 2018-05-03 05:34:31 +11:00
doofus-01
961bcb861d edit first scenario to remove female gender specifications for units that have no such variation. 2018-05-03 05:34:30 +11:00
doofus-01
faee9b7f3f smashed tree is no longer a terrain, just a scenario graphic 2018-05-03 05:34:28 +11:00
doofus-01
23e6481389 adding smashed tree terrain for first scenario 2018-05-03 05:34:26 +11:00
doofus-01
2e62fc22ec dead elf image requested in issue #2962 2018-05-03 05:34:25 +11:00
doofus-01
966c2205c8 adding minimal bow frames for quenoth youth Kaleh 2018-05-03 05:34:24 +11:00
doofus-01
9fd0286a65 minor orcish flag update 2018-05-03 05:34:23 +11:00
galegosimpatico
bbd83f17ed Bump program version. 2018-05-03 05:28:33 +11:00
Charles Dang
8582240d79 Slightly less harsh unknown map terrain code error message 2018-05-03 05:24:28 +11:00
Charles Dang
eacc1e0f6b Ditch the "titlescreen" nomenclature for player-visible strings 2018-05-03 05:24:27 +11:00
Jyrki Vesterinen
f074f812ca Changelog entry for commit 93f956ed4c 2018-05-02 14:55:26 +03:00
Jyrki Vesterinen
93f956ed4c Error message when trying to save a screenshot in an unsupported format 2018-05-02 14:51:55 +03:00
Charles Dang
f33111e86b Changelog entry for the misleading tooltip text fix
[ci skip]
2018-05-02 18:57:13 +11:00
Severin Glöckner
c8e3856f51 TRoW: readd leaderhip
(as 1st ability)

[ci skip]
2018-05-02 07:25:30 +02:00
Severin Glöckner
a96c9ac7aa TRoW: Remove leadership from Lvl. 1 Wesfolk leader
as there are no Lvl. 0 units.
2018-05-02 07:06:51 +02:00
Severin Glöckner
be221b5ef0 UtBS: remove submerge ability from Skeleton Rider
since he can't move onto deep water.
(and there is no deep water in the relevant scenario either)
Supposed to look better in the help.

[ci skip]
2018-05-02 07:06:51 +02:00
Charles Dang
2064e1e16c Threw out the extraneous default core description
[ci skip]
2018-05-02 15:48:54 +11:00
Charles Dang
6f057d8b02 MP Method Selection: removed text saying registered nicknames are optional
[ci skip]

This is currently only the case on the 1.14 server, but it's easiest just to
remove the line completely rather than constantly adding or re-adding it based
on whether you're using a or dev series.
2018-05-02 12:33:35 +11:00
Charles Dang
7d3d9daf0c Added trailers credits section
[ci skip]
2018-05-02 11:20:59 +11:00
Nils Kneuper
4f85e158c6 updated Spanish translation 2018-05-02 00:02:07 +02:00
Martin Hrubý (hrubymar10)
f217062116
Use pango and cairo from MCS until #2859 will be fixed 2018-05-01 19:02:00 +02:00
Charles Dang
f37f235b3e Attempt to fix build
I *think* the problem is the downcasting...but I don't know.
2018-05-01 13:48:49 +11:00
Charles Dang
c06810876d Clean up utils::parse_ranges 2018-05-01 13:44:22 +11:00
Charles Dang
6dca50ac10 AI/Contexts: simplify range check 2018-05-01 13:20:03 +11:00
Charles Dang
b5cb4b2bcc AI/configuration: minor code cleanup
Mostly involving avoiding unnecessary config copying.
2018-05-01 12:41:20 +11:00
Charles Dang
cc1b4825d9 AI/Configuration: formatting cleanup 2018-05-01 12:40:23 +11:00
Charles Dang
1c744875d3 AI/Actions: avoid inline ternaries in place of if blocks 2018-05-01 12:05:42 +11:00
Charles Dang
18d597e374 AI/Contexts: deployed std::make_shared in a place I missed 2018-05-01 12:00:34 +11:00
Charles Dang
691276a0b7 AI: removed duplicate composite AI typedef used a unique_ptr for it 2018-05-01 11:59:43 +11:00
Charles Dang
18b50f06fb AI: made use of unique_ptrs for action results
I had to move the implementations of certain context-related functions into the cpp
file since the result types were incomplete in the header, which doesn't work with a
unique_ptr (you get errors about being unable to delete an incomplete type).
2018-05-01 11:51:44 +11:00
Charles Dang
9756847d3b AI/Contexts: formatting cleanup 2018-05-01 11:28:45 +11:00
Charles Dang
81aba251fc AI/Actions: formatting cleanup 2018-05-01 10:51:58 +11:00
Charles Dang
344d7c6799 AI/Actions: use an initializer list for the error code name map 2018-05-01 10:37:47 +11:00
Charles Dang
64bd866ef2 AI/Lua: formatting cleanup 2018-05-01 10:11:01 +11:00
Victor Sergienko
dbffb51394 #2971 Scrolling with arrow keys can get stuck 2018-04-30 20:16:40 +03:00
pentarctagon
5e36a90039 Updates cmake and scons to be able to compile with OGL.
Scons OpenGL/GLEW test taken mostly verbatim from 3e2eba22a9
2018-04-30 17:14:18 +03:00
Nils Kneuper
9db34c2170 updated French translation 2018-04-30 13:48:12 +02:00
Charles Dang
e17b79cbee Repair 7db83e3 in the upwards direction
[ci skip]
2018-04-30 22:23:45 +11:00
Charles Dang
7db83e3a0e GUI2: removed unnecessary spaces and newlines from color macros
[ci skip]

Since these are usually used inline or as key values, we don't need the extra padding.
2018-04-30 22:20:40 +11:00
Charles Dang
604dcd8008 MP Create Game: keep background image width proportional to its height
[ci skip]
2018-04-30 21:21:19 +11:00
Charles Dang
09f7237631 Skeletal Dragon: discarded colored background full-alpha pixels I noticed
[ci skip]
2018-04-30 13:02:59 +11:00
Charles Dang
71d7f6a237 TRoW: new Lord Logalmier sprite by Kasdel with minor tweeks by @doofus-01
[ci skip]

See https://forums.wesnoth.org/viewtopic.php?p=625519#p625519
Resolves #2985.
2018-04-30 12:10:54 +11:00
Charles Dang
a6adb1a4b1 AI/Manager: deployed formatter() 2018-04-30 11:03:11 +11:00
Charles Dang
ffee80aa1f AI/Manager: formatting cleanup 2018-04-30 11:02:41 +11:00
gfgtdf
2e5d7139b9 fixup 2018-04-29 20:53:19 +02:00
gfgtdf
7751b790eb fix [on_undo] in menu items and custom_command
also fixes menu items beeing marked as undoabel even if they used the
synced rng.

#2979
2018-04-29 20:25:38 +02:00
Celtic Minstrel
5795892649 GUI.pyw: Fix wmlxgettext run failing if the output file already exists 2018-04-29 14:04:12 -04:00
Jyrki Vesterinen
33fa7d8b76 Fix possible null pointer dereference in display::init_flags()
Regression from commit 69d7413a75.

Found by Coverity.
2018-04-29 17:23:27 +03:00
gfgtdf
06ebcebed5 improve side drop message fixes #2820 2018-04-29 14:19:34 +02:00
Nils Kneuper
ce35c7b7bf update Slovak translation 2018-04-29 11:30:17 +02:00
Nils Kneuper
f677e3f2ad updated Italian translation 2018-04-29 11:28:24 +02:00
Nils Kneuper
64fe3988d8 fixed issues with building translation via cmake
commit 3effecd added an "if" block in CMakeLists with a variable that
does not exist ("NLS"). This breaks running translation updates for
every cmake user. Changed the variable to the existing "ENABLE_NLS".

@Pentarctagon I don't know if the travis script has to be adjusted as
well. Please test.
2018-04-29 11:26:01 +02:00
Celtic Minstrel
07e465e57b Support male_voice and female_voice in [message] 2018-04-28 23:09:29 -04:00
ln-zookeeper
ab1de53b4a UtBS: Include both Kaleh and Nym in Quenoth Youth unit description 2018-04-29 12:56:16 +11:00
ln-zookeeper
cd00b55d2a UtBS S09: Avoid random gender and traits for Hekuba
The simplest if not the most elegant fix.
2018-04-29 12:56:15 +11:00
ln-zookeeper
4956bfcbba UtBS: Avoid random traits for Eloh's appearances 2018-04-29 12:56:14 +11:00
ln-zookeeper
9113478690 UtBS: Use core portraits for Esanoo, Rogrimir and Grog
These were the only remaining character portraits in the old style, so they would stick out among the new ones.
2018-04-29 12:56:14 +11:00
Charles Dang
69d7413a75 Display: some code cleanup
* Consolidate reinit_flags_for_side and init_flags_for_side_internal
* Made use of the team/map/unit getters.
2018-04-29 12:56:13 +11:00
gfgtdf
d31e74aee0 improve mp sync waiting message 2018-04-28 23:02:16 +02:00
Charles Dang
b47837b3c0 GUI2/Dialogs: cleaned up a bunch of unnecessary forward declarations 2018-04-29 06:52:36 +11:00
Charles Dang
78ea6db7e8 Cleaned up a few unnecessary AI-related includes outside ai/ 2018-04-29 06:45:41 +11:00
Charles Dang
ba150c0298 AI: deployed std::make_shared in a whole bunch of places
Also simplified a few instance of shared_ptr assignment. No need to create a temp ptr
just to immediately assign them.
2018-04-29 06:09:51 +11:00
Charles Dang
1e846aced2 AI: deployed typesafe_aspect_ptr consistently
No reason this couldn't have used aspect_type<t>typesafe_ptr before, so this just
makes uses of this specific type easier to find.
2018-04-29 05:58:44 +11:00
Charles Dang
1b8bfa6ab4 AI: simplify some typedefs with template aliases 2018-04-29 05:53:41 +11:00
Charles Dang
78e8ac51d7 Fixed Boost header deprecation warning on 1.67 and later
Also removed one unnecessary inclusion of the header of the same.
2018-04-29 05:34:56 +11:00
Charles Dang
1af08fb58e AI/Game Info: formatting/forward declaration cleanup 2018-04-29 05:25:36 +11:00
gfgtdf
6c802b5016 fix a %->$ in german translation 2018-04-28 13:07:29 +02:00
gfgtdf
41d7df970c fix segfault on area= filter.
areas_ might be empty, so areas_[0] might crash, also returning areas_[0].hexes didn't really make sense in the first place
2018-04-28 13:07:28 +02:00
Gregory A Lundberg
092f8f325c
Fix doccomment error
Remove lame doccomments.
2018-04-27 23:17:56 -05:00
pentarctagon
3effecdb06 Don't copy the po/ directory into the docker image for non-NLS jobs. 2018-04-27 16:00:04 -05:00
pentarctagon
ea4d85a06e Running the translations is short, so do them through scons and cmake. 2018-04-27 16:00:04 -05:00
pentarctagon
eb0a290ca1 Put the docker image on its own line. 2018-04-27 16:00:04 -05:00
Steve Cotton
f259976659 Make CMake error-out if required libraries aren't found
It seems that FIND_PACKAGE_HANDLE_STANDARD_ARGS is doing a case-sensitive
search for whether the find_package flags included REQUIRED.
2018-04-27 15:58:03 -05:00
gfgtdf
15c331281f editor: don't write default values when saving a scenario 2018-04-27 21:45:44 +02:00
Iris Morelle
ae5ab22b1a gui2/log_settings: Permit disabling logdomains (log level -1) 2018-04-27 01:52:40 -03:00
pentarctagon
2aed8af606 Adds lld to the 1804 docker image.
The gold linker is available already, but lld is not installed along with clang.
2018-04-26 23:44:13 -05:00
Charles Dang
6dfb87103c Made use of config_attribute_value::to_time_t 2018-04-27 13:15:07 +11:00
Nils Kneuper
c1f3cffa1c updated Italian translation 2018-04-26 22:55:18 +02:00
Charles Dang
f5626ddc30 Campaignd: made use of vector::at
This work since vector::at throws if i < size(), and the current check was for
> size() - 1, which equated to >= size(), which is equivalent to not < size().

It does lose the error message, though.
2018-04-26 20:55:45 +11:00
Wedge009
817f612f29 Update VC project files.
* Add missing project configurations.
* Remove remaining OpenMP support.
* Tidy filters.

[ci skip]
2018-04-26 18:37:50 +10:00
Matthias Krüger
29089a4736 cmake/scons: if sanitizers are enabled, also add -fno-omit-frame-pointer and -fno-optimize-sibling-calls.
Otherwise, if we build with sanitizers and optimizations, the sanitizer stacktraces can become quite hard to read.
2018-04-25 19:08:14 -05:00
pentarctagon
07e01cd9b8 Fix a header file being in a source list. 2018-04-25 18:45:10 -05:00
Charles Dang
23c2c2e2ae UtBS: removed existing story images
[ci skip]

Not up to current standards, and besides, one of them uses the old Kaleh portrait.
2018-04-26 04:34:54 +11:00
Severin Glöckner
f1e2e8ce7f Adjust the weapon names of the heroes to better fit their portraits
[ci skip]
2018-04-25 19:29:39 +02:00
Charles Dang
45b4bb5b27 UtBS: final set of updated character portraits by LordBob
Elyssa no longer has a Silver Mage portrait variant.
2018-04-25 23:45:46 +11:00
Charles Dang
9c5ec1c3b7 Better cordoning off of translation completion filtering 2018-04-25 16:58:37 +11:00
Charles Dang
6d09f702a5 Fixup 301fb93 2018-04-25 16:31:57 +11:00
Charles Dang
301fb933ac Cleaned up language completion filtering, but left it disabled here
We don't want this enabled on the dev branch.
2018-04-25 16:13:12 +11:00
Charles Dang
6eab44c4f3 Added and made use of a move ctor in battle_context
(and emplace_back). No reason to use the copy ctor in these cases.
2018-04-25 15:45:52 +11:00
Charles Dang
f3a77bf310 More changelog updates
[ci skip]
2018-04-25 14:25:19 +11:00
Charles Dang
4219e13ac5 Changelog entry for the Dark Forecast fix
[ci skip]
2018-04-25 14:16:33 +11:00
Charles Dang
d3e35f6c1f UtBS: new Quenoth Shyde sprite by Jetrel
[ci skip]
2018-04-25 14:09:00 +11:00
gfgtdf
438ca7bc1e fix lua error in 2p_Dark_Forecast 2 2018-04-25 14:01:46 +11:00
Jyrki Vesterinen
4c258ff550 Show chat logs (excluding lobby) also in MP Join Game 2018-04-24 19:29:53 +03:00
Jyrki Vesterinen
d628a73fab Hide lobby chat log in MP staging screen
Because updating and sending messages to lobby in staging screen hasn't
been implemented, showing lobby history there would be confusing
(it would look as if everyone had stopped talking).
2018-04-24 19:19:17 +03:00
Iris Morelle
f52828db88 pofix changes for UtBS S10 typo fix
[ci skip]
2018-04-24 09:00:06 -03:00
Iris Morelle
a2cfb3cf4c Run pofix for wesnoth-sota changes that were just fwd-ported to master
[ci skip]
2018-04-24 08:58:33 -03:00
Celtic Minstrel
3768dc687d Fix pofix
Two of these strings were not a fix, just a removed string, so no need for pofix.
The other was not specific enough for pofix to match unambiguously.
Also, someone forgot a comma somewhere, causing a syntax error.
2018-04-24 08:57:08 -03:00
Charles Dang
087d9bb5af Pofix entry for fc6c3ac04b
[ci skip]
2018-04-24 08:57:00 -03:00
Charles Dang
c638d71bf9 Pofix entry for b86a2968fe
[ci skip]
2018-04-24 08:56:53 -03:00
Charles Dang
9531e29b5d Pofix entry for ab9f29a7a4
[ci skip]
2018-04-24 08:56:40 -03:00
Iris Morelle
4d5a3de4e6 Revert "'moreso' isn't a word in any dialect of English."
This reverts commit fb866c6d13.

This fix is specific to master and translators aren't supposed to be
touching master at this time. There is no point to its existence.
2018-04-24 08:55:43 -03:00
Iris Morelle
70257c9af7 UtBS S10: Fix typo reported by zookeeper
[ci skip]
2018-04-24 08:46:51 -03:00
Iris Morelle
f6a369a1d0 THoT: Port prose punctuation fix from core
This is from commit 1340c005b3.

[ci skip]
2018-04-24 08:46:47 -03:00
ln-zookeeper
02ef3a6a99 UtBS: Remove old Naga Hunter portrait and use core Naga Fighter instead 2018-04-24 13:58:31 +03:00
ln-zookeeper
2bb16149af UtBS S08: Use Eloh's raged portrait variation when she gets angry 2018-04-24 13:58:30 +03:00
ln-zookeeper
8c2df1f18c UtBS: Wire in Nym's moody portrait variation 2018-04-24 13:58:29 +03:00
ln-zookeeper
71178e99f8 UtBS: Wire in Zhul's winged portrait variation 2018-04-24 13:58:28 +03:00
ln-zookeeper
ec63cff8fb UtBS: Fixed some missing/erroneous special notes 2018-04-24 13:58:28 +03:00
Charles Dang
a85b14cfb7 Various changelog updates
[ci skip]
2018-04-24 18:47:24 +11:00
Charles Dang
f17703a76f UtBS: initial set of new character portraits by LordBob (more to come)
[ci skip]

Nym's moody variant and Zhul's Shyde variant aren't wired in yet.
2018-04-24 18:28:23 +11:00
Nils Kneuper
28fc12ebd0 updated Slovak translation 2018-04-24 08:27:28 +02:00
Charles Dang
098bc1c0e8 Unit/Race: made use of std::array 2018-04-24 16:35:28 +11:00
Charles Dang
d2b3a25b9e Unit/Race: formatting cleanup 2018-04-24 16:05:05 +11:00
Charles Dang
c7b8694370 Unit: replace unit_ability_list::push_back with an emplace_back impl 2018-04-24 15:28:43 +11:00
Charles Dang
1749de1521 Units/Attack Type: moved the specials_context_t ctors to the more relevant file 2018-04-24 15:01:28 +11:00
Charles Dang
a1c440510c Unit/Attack Type: formatting cleanup 2018-04-24 14:57:40 +11:00
Charles Dang
0cdcfac5d3 Unit/Animation: emplace_back (mostly) ahoy
Three cases could not use emplace_back since the ctor they use is private... :(
Which sucks since unit_animation looks like it'd be a bit expensive to copy.
2018-04-24 14:56:54 +11:00
Nils Kneuper
b6f412fba1 updated Japanese translation 2018-04-23 23:40:15 +02:00
Nils Kneuper
b0f76a7d4d updated Japanese translation 2018-04-23 23:39:11 +02:00
Nils Kneuper
ff6aa075e5 updated Scottish Gaelic translation 2018-04-23 23:34:41 +02:00
Nils Kneuper
ce4d6bfea9 updated Spanish translation 2018-04-23 23:33:35 +02:00
Nils Kneuper
f3737d44ac updated Polish translation 2018-04-23 23:31:35 +02:00
Charles Dang
17da211d1f Fixup 1942627 2018-04-24 03:49:33 +11:00
Charles Dang
1942627052 Some refactoring of preferences-related hotkey info storage (fixes #2953)
This commit does a few things:

First, it moves the hotkey category names out of the preferences dialog and into
the more appropriate hotkey file. Each name is now properly mapped to its corresponding
category enum, so we don't have to worry about that anymore.

Second, it adds a new mapping of hotkey categories to commands so one can easily fetch
a list of hotkeys in a given category.

Third, it excludes categories with no hotkeys from the filter dropdown in the Prefs
dialog (this is the part that actually fixes the bug above).

This also includes a slight behavior change to hotkey type filtering. Previously, if a
hotkey's category didn't match any of the ones listed in the dropdown, that hotkey's
row visibility would be set to the toggle state of the first row in the filter dropdown.
Now it gets set to false.
2018-04-24 03:36:20 +11:00
Jyrki Vesterinen
4d569815d0 Fix rare crash in AI code
Reported in https://forums.wesnoth.org/viewtopic.php?p=626344#p626344

Regression from commit a3d5b9d603.

The crash occurred when
* the attacker had only one weapon
* the said weapon was disabled, and
    - the defender had no weapons
    - the defender had only one weapon, or
    - all defender's weapons were disabled
2018-04-23 19:30:55 +03:00
Severin Glöckner
8657fdb9a3 Dark Forecast: fix untranslatable string by
reusing the one from the Campaign Selection Menu

[ci skip]
2018-04-23 15:31:11 +02:00
loonycyborg
10122057e6 wesnothd: refuse to send whispers from observers to players in same game
wesnothd <= 1.12 did this too, this restores old behavior
2018-04-23 14:11:12 +03:00
Charles Dang
cb41d21423 UtBS: set campaign icon TC back to red
[ci skip]

Brown just didn't look great.
2018-04-23 17:10:01 +11:00
doofus-01
f871040a9d Kaleh base and two defense sprites 2018-04-23 17:08:38 +11:00
doofus-01
515af2f504 updates to Nym sprite and basic animations, and corrupt-elf sprite 2018-04-23 17:08:37 +11:00
Charles Dang
1f319e31fe Label Settings: minor code cleanup 2018-04-23 12:35:02 +11:00
Charles Dang
38e0b83cda Label Settings: formatting cleanup 2018-04-23 12:35:01 +11:00
Severin Glöckner
b8fe22877b Tutorial: fix two strings
This is one of the white on map messages
they never use punctuation characters for ending the instructions

Can't be pofixed.
[ci skip]
2018-04-23 01:11:15 +02:00
ln-zookeeper
221fe72dcb UtBS: Removed a remaining [on_redo]
Resulting problems reported on the forums, removal was apparently missed in df058356df.

[ci skip]
2018-04-23 10:04:06 +11:00
Iris Morelle
14ec9954f1 Replace a few instances of "mermen" with "merfolk" in core descriptions
These are only the ones were it's sufficiently unambiguous that the
description is referring to the merfolk race at whole. There are a few
instances I didn't touch were it's possible that the text refers
exclusively to mermen fighters (e.g. "the mermen armies").

See issue #2940.

[ci skip]
2018-04-22 17:42:44 -03:00
Iris Morelle
296894c515 Change the plural race name for merfolk to Merfolk
See issue #2940.

[ci skip]
2018-04-22 17:18:14 -03:00
Steve Cotton
eab86c3016 Tutorial: fix the overall translation hint comment
The comment at the start of 01_Tutorial_part_1.cfg wasn't immediately
before a string, so the hint for translators wasn't in the file that
goes to the translators. Fix it so that the tutorial shows working
usage of "# po:" style comments; this is probably more help to people
using the tutorial as a reference for WML, rather than the translators
themselves.
2018-04-22 15:52:43 -04:00
Severin Glöckner
3456b0a9cb Tutorial: remove forgotten bracket and superfluous space
[ci skip]
2018-04-22 20:37:14 +02:00
Celtic Minstrel
59e734615d Add translation hints for the village and terrain feature name generators 2018-04-22 14:23:19 -04:00
Nils Kneuper
25e3526a1f updated Czech translation 2018-04-22 09:21:00 +02:00
pentarctagon
5b94101975 Allow specifying a sanitizer with cmake. 2018-04-21 19:51:49 -05:00
Victor Sergienko
16cd19873d #2782 Crash when using composing like ˇ and ' in lobby on macOS.
Some backstory: https://github.com/wesnoth/wesnoth/pull/2644#issuecomment-382298822
2018-04-22 01:04:55 +11:00
Gunter Labes
616fdf3498 Detect disconnect when waiting on data from server
Fixes issue #2927.
Also shows that issue #2925 still results in a disconnect but the client
does not get stuck anymore at least.
2018-04-21 15:28:38 +02:00
Gunter Labes
6dd3223249 Fix debug message
This outputs the config not the number of read bytes.
The recv_queue_.back() call was also missing lock protection.
2018-04-21 15:28:37 +02:00
loonycyborg
99372123da wesnothd: always wait for next login attempt after login fail 2018-04-21 15:57:53 +03:00
Charles Dang
2ec5c6ee5c Cleaned up more unnecessary includes 2018-04-21 23:19:55 +11:00
Martin Hrubý (hrubymar10)
783738b2f5 Remove rest of Growl things which I forgot before 2018-04-21 13:06:08 +02:00
Charles Dang
f8b936c2d5 Revert "Attempt to fix infinite loading screen if server restarts during MP login"
This reverts commit 8a00056a22. This fix did not work,
and there's a proper one on the 1.14 branch that needs to be forward-ported
(a3243bb535).
2018-04-21 20:39:36 +11:00
pentarctagon
4157251f11 Enable building with mysql support on travis. 2018-04-21 04:31:53 -05:00
pentarctagon
96c41271d8 Print the value of STRICT and build_timeout. 2018-04-21 01:32:21 -05:00
pentarctagon
63ff641662 Adds the opt/OPT option to scons/cmake.
Travis now also makes use of this to set the optimization level for the -O0 builds, rather than extra_flags_*.  This additionally fixes an issue where using -O0 in the release build with LTO resulted in the individual *.o files being compiled with -O0, but LTO then still linked with release's default -O3.
2018-04-21 01:32:21 -05:00
Charles Dang
7241561554 Animated: simplified template stuff
Just... why was T_void_value a thing.
2018-04-21 16:04:16 +11:00
Charles Dang
8a00056a22 Attempt to fix infinite loading screen if server restarts during MP login
See #2927.
2018-04-21 14:12:25 +11:00
gfgtdf
3797837c74 fix handling of no_leader= (again)
previously, if people wanted to make use of mp leader selection in mp
campaign they had to sxplicitly set no_leader=no and faction_lock=no,
with the new code its clear that no_leader= is just an alias for
faction_lock with type
2018-04-21 04:29:33 +02:00
Severin Glöckner
8b492a3ab4 Tutorial: Button was renamed, update text accordingly
[ci skip]
2018-04-21 00:44:54 +02:00
Nils Kneuper
a8bc181b2b updated German translation 2018-04-20 23:33:50 +02:00
Nils Kneuper
7174b8e97d updated Czech translation 2018-04-20 23:32:35 +02:00
Charles Dang
d6718cd1f9 Cleaned up game_board.hpp and some related includes
Includes a minor cleanup of the Game Stats dialog to not use a game_board reference.
Dunno why I was taking a game_board reference in the show() function anyway... the
class held a display_context reference and didn't use any functions exclusive to
game_board.
2018-04-20 17:36:27 +11:00
Charles Dang
e05b1368ad Used display_context::get_team in a few places I missed 2018-04-20 17:23:03 +11:00
Charles Dang
4818312150 Display: renamed get_disp_context to current_display_context
This is to avoid confusion with filter_context::get_disp_context. display used to
inherit from filter_context, but that was refactored out a while back. I left
get_disp_context since it was used and useful, but I realize now it causes more
confusion than not.

Also converted help::load_terrain_types_data to use get_map() directly since I
noticed it.

And changed a stray use of `thedisp` to `disp` in unit_drawer. Doesn't do anything
but it was bugging me.
2018-04-20 17:00:40 +11:00
Charles Dang
a532cc4689 Unit/Abilities: formatting cleanup 2018-04-20 16:37:08 +11:00
Charles Dang
7e442cbb54 Units: refactor display_context parameter out of ability functions
This was essentially only needed for the affects_side() helper. THAT'S IT. All this code just for
one single line... Anyway...

Utilized the display singleton's display_context getter instead. This also means fewer explicit
uses of resources::gameboard as the display_context object, meaning more compatibility with the
editor (not that that's relevant for most of the changed usecases, such as the AI, but it does
affect unit::get_abilities, which might be useful there in the future).

This also removes the display_context parameter from unit::invisible() since it was only passed to
unit::get_ability_bool().

unit::is_visible_to_team() also had its display_context parameter removed. It was used once as an
argument for invisible() and the other case was replaced with display::get_map().
2018-04-20 16:06:19 +11:00
Charles Dang
882aba3349 Units/Display: minor code cleanup 2018-04-20 15:28:42 +11:00
Charles Dang
c7ad8153c7 Units/Display: formatting cleanup 2018-04-20 15:17:49 +11:00
Charles Dang
dab8498f97 Wesnothd/Player: removed unused selective_ping member 2018-04-20 14:36:08 +11:00
Charles Dang
b81a702cfa Removed unused Ping Timeout preference
It no longer had any effect. The selective_ping flag is set was ignored by the
server since it now utilizes TCP keepalive.
2018-04-20 13:07:36 +11:00
Charles Dang
6b359268f0 changelog entry for the UtBS portraits
[ci skip]
2018-04-20 12:01:04 +11:00
Charles Dang
efa798c72e UtBS: wmlindent pass
[ci skip]
2018-04-20 11:39:09 +11:00
Charles Dang
4153b6e8bc UtBS: renamed the Quenoth Sun Sylph's unit and image files to match her type
[ci skip]

Sun Sylph is the proper name, but some files were labeled Sun Shyde.
2018-04-20 11:35:35 +11:00
Charles Dang
755fe70cc9 UtBS: removed unused Quenoth Moon Singer and Quenoth Moon Shyde units
[ci skip]

These were part of an early iteration of the faction design but we decided against
the sun/moon motif.
2018-04-20 11:28:23 +11:00
Charles Dang
eec212e155 UtBS: added new Quenoth faction portraits by LordBob 2018-04-20 11:19:59 +11:00
Charles Dang
e583c470be Display: cleaned up overlay map getter interface
Instead of a pointer to a member of a derived class, used a virtual function implemented
in both derived classes (game_display and editor_display) that return an reference to the
appropriate object.

Also removed the overlay.hpp include from display.hpp. We can forward-declare the overlay
struct.
2018-04-20 10:48:39 +11:00
Severin Glöckner
f0f664b636 Fix misplaced </span> tag 2018-04-20 01:31:28 +02:00
Severin Glöckner
beaddeee64 Revert "tutorial: add translation note"
This should be addressed another way, not with a translation hint

This reverts commit 7a020c3130.
2018-04-20 01:29:35 +02:00
Charles Dang
f2a870b97c Game Display: removed unused variable
No idea what this did. It was added 11 years ago (9f11735f32)
but became unused at some point.
2018-04-20 10:23:43 +11:00
Nils Kneuper
767c9aa101 updated Scottish Gaelic translation 2018-04-19 21:41:03 +02:00
Charles Dang
3792612fb7 Removed OpenMP-related code
After some discussion, we concluded that this code was unmaintained, not even used in
some places (display.cpp, units/frame.cpp), leaving the only area that really used it
at all the image surface cache. Considering there was never really a conclusive benchmark
of its benefits and because said surface cache will be used a lot less going forward,
we're just removing it and simplifying everything for everyone.

Closes #1260 since it's now irrelevant.
2018-04-19 23:06:04 +11:00
pentarctagon
f4db76fe0f Re-add boost-thread to INSTALL and changelog. 2018-04-19 03:21:04 -05:00
pentarctagon
135921ad10 Re-add boost-thread.
Also add in opengl packages while I'm at it.
2018-04-19 02:51:58 -05:00
Nils Kneuper
5bb1089abc updated German translation 2018-04-19 08:19:21 +02:00
Charles Dang
9148ce2b99 UtBS: fixed some opaque shadows on rider units due to indexed pngs
[ci skip]
2018-04-19 11:23:43 +11:00
Iris Morelle
fa15142150 gui2/title_screen: Make Version label formatted and translatable
Closes #2914.

This doesn't break the string freeze since it reuses a format string
from the same textdomain required by gui2/game_version for the exact
same purpose.
2018-04-18 21:16:14 -03:00
Charles Dang
42e69ee483 UtBS: improved the Quenoth Flagbearer's flag
[ci skip]
2018-04-19 11:14:14 +11:00
Nils Kneuper
ef7c0a7b64 updated Slovak translation 2018-04-18 21:54:07 +02:00
loonycyborg
c51065e39c Fix build against static libboost 2018-04-18 15:42:29 +03:00
Martin Hrubý (hrubymar10)
5c8e957355
Fix Xcode project after a02100a0f1 2018-04-18 11:15:33 +02:00
Charles Dang
44feb05ae0 Attempt to fix tests
Fixup a02100a0f1.
2018-04-18 16:06:29 +11:00
Charles Dang
c085c380f6 Loading Screen: rethrow exception if worker thread creation fails 2018-04-18 15:37:39 +11:00
Charles Dang
baab5a8156 Loading Screen: temporarily disable animation rate limiter
Seems to make the loading screen progress faster and gets rid of the weird issue
where the animation sometime wouldn't show up on game launch. Odd.
2018-04-18 15:16:13 +11:00
Severin Glöckner
7a020c3130 tutorial: add translation note
[ci skip]
2018-04-18 05:40:30 +02:00
Charles Dang
be4b2c246f Random formatting cleanup I had sitting around 2018-04-18 13:52:39 +11:00
Charles Dang
86b3e6959b Loading Screen: refactor and clean up implementation
This covers several things:

Instead of creating a new worker thread manually and having it set class member state flags,
I instead utilized std::future and std::async. As far as I can tell, this should avoid the
(albeit unlikely) potential race condition wherein the ls could close before loading at all
if the thread was delayed in starting.

Removed the timer interface and split it into two components:
* A drawing callback that handles the animation. This has its granularity retained at 100 ms,
  but can be easily adjusted if we want it to go faster.
* A pump monitor that runs much more frequently (every time events::run_event_loop is called,
  technically). This handles checking the state of the std::future object and will then close
  the window. This makes the loading screen a bit speedier compared to the previous iteration
  since it no longer wastes time waiting for the next timer callback to close.

The one bit I'm not 100% sure about is the check for the future object's ready state in the dtor.
Though, relatedly, I wonder if perhaps we should wait for the worker thread to complete in that
case instead of exiting....

Also shuffled a few things around, such as immediately setting enter/esc disabled in pre_show
instead of waiting for everything there to finish.

Do note there occasionally seem to be a few odd issues with the dot animation after this commit.
Will look into that. But it may be some texture cache-related issue...

This also cleans up some unused log defines and a VS 2013 conditional include.
2018-04-18 13:52:07 +11:00
Iris Morelle
fc88cdff3b Fix segfault when trying to log into the MP server with an empty password
Probable regression introduced in commit
02ab29d2f1 (1.13.14).
2018-04-17 22:09:23 -03:00
Charles Dang
a7e1ff85ed Fixup c57a175fee
Turns out remove_const alone only removes the const from the pointer, not from the type
itself, so the expression wasn't returning true. This strips the pointer out before removing
const and matches against char instead of char*
2018-04-18 10:35:26 +11:00
Jyrki Vesterinen
fc3ca7a783 Changelog entry for commit a02100a0f1 2018-04-17 22:31:40 +03:00
Jyrki Vesterinen
a02100a0f1 Implement saving MP chat message history (#1194, #2802) 2018-04-17 22:29:26 +03:00
Charles Dang
28b1ab2861 Revert "Utilized 2x xBRZ scaling for portraitless units in game dialog"
This reverts commit 601c67d970 and 98ed802290.
2018-04-18 01:59:28 +11:00
Charles Dang
c57a175fee Lexical Cast: remove use of boost::mpl
The code was checking that the From type was either char* or const char*. Replaced it
with an equality check against char* with the const stripped from From so both match.
2018-04-18 01:40:26 +11:00
Charles Dang
1ec2de449e Revert some changes from 0b45363 I didn't mean to commit 2018-04-17 22:00:12 +11:00
Charles Dang
0b45363c95 GUI2: finished refactoring out usage of boost::mpl
dispatcher::has_event called the private find() function, which after a whole bunch of
jumping around essentially checked that the signal queue for the given event was not
empty. This was a run-time op, yet the code was set up using SFINAE in order to for
has_handler::oper() to call the event_signal function corresponding to the event's queue
(ie, the mouse queue for a mouse-type event).

Since this code was written before the era of constexpr, event type validation was done
using boost::mpl, which, in this case, resulted in a monstrous amalgamation of build-time
template specialization for a run-time check. I'm not certain, but I believe it might
have resulted in an specialization of find() (or at least, implementation::find()) for
every single event type (each member of the ui_event enum).

This converts the code to a purely run-time check and throws out all the template stuff.
It also removes the relevant event_signal overload dealing with events in a set. The
version dealing with function types is preserved as it's used in the fire_event()
implementation and is a fairly standard usecase of SFINAE.

The has_handler class has also been converted to a static function since it's no longer
needed for template specializations in find().

And finally, is_raw_event had to be renamed to is_raw_event_event to allow simple name
completion in IMPLEMENT_RUNTIME_EVENT_SIGNAL_CHECK. I could have also renamed the raw event
queue to signal_raw_queue but I figured keeping the name as signal_raw_event_queue made
its purpose clearer.
2018-04-17 21:52:28 +11:00
pentarctagon
dd4b525c40 Make the C++17 build fail on warnings. 2018-04-17 02:36:14 -05:00
pentarctagon
fed813ef34 Revert "String View: use std::string_view on C++17 (untested)"
This reverts commit 00d87f8fe4.
2018-04-17 02:36:14 -05:00
pentarctagon
479d5fd01f Revert "Expand and fixup 00d87f8"
This reverts commit 52a516cfb7.
2018-04-17 02:36:14 -05:00
pentarctagon
298f1dc9c1 Attempt to fix UNUSEDNOWARN travis+gcc warnings. 2018-04-17 02:36:14 -05:00
pentarctagon
5dd5b6ec0b Attempt to fix travis error. 2018-04-17 02:36:14 -05:00
pentarctagon
33ad6be326 Adds a c++17 build using the pre-release Ubuntu 18.04.
Though given 00d87f8fe4 I would say this is better than nothing.
2018-04-17 02:36:14 -05:00
Iris Morelle
6d5f5d4299 campaignd: Remove last remaining trace of the master_password functionality 2018-04-17 02:42:38 -03:00
Iris Morelle
7d5d7ee7d4 campaignd: Add 'hide'/'unhide' control FIFO commands and hidden= attribute
These are used to hide an add-on from listings and deny the author the
ability to upload or delete it or change its passphrase. This is
meant to be used when enforcing add-ons server rules that do not justify
deleting all of the add-on's metadata (for example, issues with icons or
descriptions).
2018-04-17 02:42:15 -03:00
Iris Morelle
0475c349b8 campaignd: Add 'delete' control FIFO command 2018-04-17 02:42:02 -03:00
Iris Morelle
957be8b53e campaignd: Refactor add-on deletion code into its own method
This changes the order in which the hook_post_erase hook (currently
unused in production and fully untested) is fired so it will be run
*before* displaying the confirmation message to clients. This might need
to be changed at a later point if the hook functionality ever gets used
again, but for now it'll do.
2018-04-17 02:39:56 -03:00
Charles Dang
98ed802290 Fixup 601c67d970
Turns out that commit broke TC on unit images in messages since it broke the equality
check in lua_unit.cpp. Added the XBRZ IPF as part of the Lua unit portrait attribute
instead.

I *think* this is the proper place to do it.
2018-04-17 10:15:55 +11:00
Charles Dang
54cacf815d Changelog entry for 30257af
[ci skip]
2018-04-17 05:07:07 +11:00
Jyrki Vesterinen
76ed49a45f [heal_unit]: ensure that heal amount is an integer 2018-04-16 20:55:23 +03:00
Jyrki Vesterinen
f2284e2e79 Revert "Display amount healed as an integer in [heal_unit]"
This reverts commit 0294bd81b2.

Changing display is unnecessary when the healed amount itself is forced
to be an integer (next commit).
2018-04-16 20:54:20 +03:00
Charles Dang
601c67d970 Utilized 2x xBRZ scaling for portraitless units in game dialog 2018-04-17 03:03:09 +11:00
Severin Glöckner
ae0420108f finish renaming of the Horseman to Pathfinder
forward ported from 1.14, but without unit type alias

[ci skip]
2018-04-16 15:40:19 +02:00
Charles Dang
30257afd3f Drop Down Menu: allow right clicks to dismiss the window (fixes #2910) 2018-04-16 21:10:30 +11:00
Celtic Minstrel
0294bd81b2
Display amount healed as an integer in [heal_unit] 2018-04-16 01:27:12 -04:00
Celtic Minstrel
7821f470c2 fixup! Support location_id in [recall] and [unstore_unit] 2018-04-16 00:55:55 -04:00
Celtic Minstrel
ea6578a87a fixup! Support location_id in [recall] and [unstore_unit] 2018-04-16 00:49:28 -04:00
Celtic Minstrel
ecc8785edb Support location_id in [recall] and [unstore_unit] 2018-04-16 00:00:51 -04:00
Celtic Minstrel
ceea173eb4 Remove redundant unused column in stats 2018-04-15 14:04:31 -04:00
Celtic Minstrel
ddd3222b3d Swap count and name columns in statistics (fixes #2893) 2018-04-15 13:58:01 -04:00
Nils Kneuper
6e85da54bc updated French translation 2018-04-15 19:49:54 +02:00
Nils Kneuper
c359b7a829 updated Galician translation 2018-04-15 11:20:32 +02:00
loonycyborg
2e24d20236 wesnothd: Fix UB caused by incorrect use of simple_wml::set_attr 2018-04-15 10:34:58 +03:00
Celtic Minstrel
0327085d99 Fix two of the dialog functions not accepting translatable strings 2018-04-15 02:03:31 -04:00
Iris Morelle
0720065d7a Remove stale include in test scenario causing errors 2018-04-15 02:50:37 -03:00
Iris Morelle
529e551d9e Changelog entry for MP lobby message fixes
[ci skip]
2018-04-15 02:49:19 -03:00
Iris Morelle
47b6b7f2a4 wesnothd: Use actual username when sending lobby messages too 2018-04-15 02:42:25 -03:00
Charles Dang
03d80a0b2b Better changelog entry for the MP password fix
[ci skip]
2018-04-15 15:16:16 +11:00
ln-zookeeper
cc4171e207 UtBS: Removed obsolete slows note from Quenoth Scout
[ci skip]
2018-04-15 13:49:01 +11:00
Celtic Minstrel
0f267d0ede Fix #2894 2018-04-14 21:09:40 -04:00
loonycyborg
f5ab654760 wesnothd: made server fill in sender when forwarding whispers 2018-04-15 03:40:32 +03:00
Severin Glöckner
5e1f6af8dd utbs: replace true by yes
[ci skip]
2018-04-14 21:25:32 +02:00
Severin Glöckner
2e8f6c2a79 utbs: change traits for higher unit types too,
because they are nowadays displayed in the help.
Also keep them sorted the same way as usual.

[ci skip]
2018-04-14 21:25:32 +02:00
Severin Glöckner
ea656a8cc7 remove movetypes and abilities only used by old desert elves
[ci skip]
2018-04-14 21:25:32 +02:00
ln-zookeeper
33e924dc35 Updated changelog
[ci skip]
2018-04-14 19:24:51 +03:00
Celtic Minstrel
8e4de9db67 Editor: Refresh named locations list when map context changes (fixes #1023)
This solution is a bit of a hack, but odds are this code will be
majorly refactored in 1.15 anyway. The important thing is that
this works.
2018-04-14 12:05:41 -04:00
Charles Dang
35590fd842 Lobby Info: filter on game name first
It's more common to want a name.
2018-04-15 02:53:01 +11:00
Charles Dang
227c8ba20c Changelog entry for ab54b62
[ci skip]
2018-04-15 02:40:30 +11:00
Charles Dang
ab54b62553 Attempt to fix non-required era being flagged for download
See #2747.
2018-04-15 02:02:14 +11:00
Charles Dang
29fcbd053d Replaced round_double and round_portable with std::round
std::round(double) uses the desired half-away-from-0 method.
2018-04-15 01:45:18 +11:00
newfrenchy83
606981bd22 Update wesnoth.cbp (#2890) 2018-04-14 14:58:08 +03:00
Charles Dang
7621719c9a CVideo: added a macOS codepth for DIP fetch in screen_area() 2018-04-14 22:12:58 +11:00
Charles Dang
dbb56599c5 GUI2/Canvas: consolidate set_width and set_height into a single function
This is to enable me to do some testing with high DPI support.
Also there's never a situation where you'd only want to set one of these.
2018-04-14 21:15:53 +11:00
Charles Dang
c43f801aff Fixup 66dc671 (fixes #2887)
These changes somehow got lost in rebase...
2018-04-14 20:45:29 +11:00
Charles Dang
66dc67140f CVideo: removed "help string" interface
These will be handled by GUI2 tooltips once we get the editor all converted to
the new UI system.
2018-04-14 20:25:36 +11:00
pentarctagon
7aeca70cb0 Allow setting c++17 in scons. 2018-04-14 11:39:20 +03:00
pentarctagon
5d970e40cd Add a check to fail the job if compiling takes too long.
The intent behind this is that, if there most likely wouldn't be enough time left to complete the unit tests anyway, then just fail the job after compiling so the cache can be updated.  Otherwise, if the unit tests were run and the job timed out, then the cache would not be uploaded at all and the next time the job ran it would be from scratch again.
2018-04-14 11:39:20 +03:00
pentarctagon
92f74c39f6 Allow setting a sanitizer to use.
Note: UBSan at least does seem to take a fairly significant amount of extra time to compile and run the WML tests with.
2018-04-14 11:39:20 +03:00
pentarctagon
2ed9d2c0c4 Allow setting EXTRA_FLAGS_RELEASE to something other than -O0. 2018-04-14 11:39:20 +03:00
pentarctagon
66caa190f6 Make LTO controllable via travis env variable. 2018-04-14 11:39:20 +03:00
Charles Dang
52a516cfb7 Expand and fixup 00d87f8 2018-04-14 17:25:19 +11:00
Charles Dang
9977addd64 Removed duplicate config_key_type alias
This isn't used in config_attribute_value.*pp but rather in config.*pp.
2018-04-14 17:25:14 +11:00
Martin Hrubý (hrubymar10)
9329daf0da
Fix Xcode project after d384b96d97 2018-04-14 07:19:37 +02:00
Charles Dang
96681151f0 Expand NORETURN, enable C99 unconditionally on MSVC
[[noreturn]] is supported on all the compilers we support. Still need to decide
the exact minimum versions and figure out what to do with DEPRECATED and FALLTHROUGH,
so leaving those for now.

And since we require VS 2015 and up we can enable C99 unconditionally.
2018-04-14 16:04:16 +11:00
Charles Dang
00d87f8fe4 String View: use std::string_view on C++17 (untested) 2018-04-14 16:04:03 +11:00
Charles Dang
17fc9d71db Removed bind_void
This is no longer needed with the compilers we support. It is needed on VS 2013, but
we dropped that. Don't know when GCC or Clang stopped needed it (if they ever did).

I'm guessing the "function that returns a value cannot be bound in a function type
that returns void" behavior wasn't an intentional design. Additionally, I don't believe
point 1 raised in the accompanying comment has ever been true... if so, pretty sure
we wouldn't have been able to build at all.

Also removed unnecessary global.hpp include from functional.hpp.
2018-04-14 15:53:13 +11:00
Charles Dang
07b69bdd32 Updated VS projectfile
[ci skip]
2018-04-14 15:17:00 +11:00
Charles Dang
164b6af766 Cleaned up even more joystick-related code... 2018-04-14 14:56:34 +11:00
Charles Dang
50407c1e8e Cleaned up some joystick-related code I missed (fixup d384b96) 2018-04-14 14:33:56 +11:00
Charles Dang
d384b96d97 Removed joystick code
This was never fully implemented and has been essentially abandoned. If we want to
add this again, we should look to adding full game controller support (Steam controller,
for example), though I don't know how suited this game is for controller support. As for
as I can tell, the only working part was ever map scrolling.

Includes a sqrt -> std::sqrt conversion I forgot in this file awhile back.
2018-04-14 14:16:18 +11:00
pentarctagon
52f8e8233c Remove boost-thread from dockerfile. 2018-04-13 17:14:08 -05:00
Martin Hrubý (hrubymar10)
6314c6ab05
Remove Boost thread from Xcode project 2018-04-14 00:09:25 +02:00
Martin Hrubý (hrubymar10)
68c1dbeab2
Update link to new MacCompileStuff repo 2018-04-13 22:51:34 +02:00
Nils Kneuper
cff478f9d3 updated Polish translation 2018-04-13 22:49:56 +02:00
Nils Kneuper
6034cc50d1 updated Italian translation 2018-04-13 22:48:49 +02:00
Jyrki Vesterinen
c5802cdcda Changelog entry for commit 82e04ab761 2018-04-13 22:51:15 +03:00
Jyrki Vesterinen
82e04ab761 Fix #2850: [modify_side] share_vision=yes doesn't do anything
Thanks to @gfgtdf for the suggested fix that works well.
2018-04-13 22:49:51 +03:00
Charles Dang
9de7aff904 Removed Boost Thread as a built-time dependency
We use std::thread now.
2018-04-13 23:55:25 +11:00
Charles Dang
7cf9341379 Removed last boost/thread.hpp include
Locale doesn't rely on boost, so it must have been some other issue in Boost 1.60
that was incidentally fixed by including that file. If anyone ever happens to build
with 1.60 again we can revisit this.

For the record, there are no issues with VS 2017 and Boost 1.66.
2018-04-13 23:52:56 +11:00
loonycyborg
846bf8f208 Fix "host networked game" option
It was broken by b95c9996bf because
ignoring SIGCHLD makes it impossible to query exit status of wesnothd
subprocess. Fix this by spawning a thread to wait for the browser
instead of ignoring SIGCHLD.
2018-04-13 15:45:19 +03:00
Charles Dang
593e673734 Shot-in-the-dark attempt to fix the tests 2018-04-13 23:28:44 +11:00
Charles Dang
802bbe8cdc Game Load: added a convenient button in Load Game to open your saves folder 2018-04-13 18:21:35 +11:00
Severin Glöckner
469488d981 update 2nd stunned event as well with additions from 1.13.2
[ci skip]
2018-04-12 22:27:26 -04:00
Charles Dang
90d45dcf07 ANL: removed unused macro (closes #2878)
[ci skip]
2018-04-13 11:49:57 +11:00
Charles Dang
fee641516b Fixup 7767902 2018-04-13 10:49:38 +11:00
Charles Dang
7767902261 Update tests for acc3fe8
We can just use a wesnothd_connection object directly here.
2018-04-13 10:42:39 +11:00
Charles Dang
acc3fe8906 Refactor out custom wesnothd_connection_ptr class again
I originally did this in 699047766a and then reverted it in
08a866dc20 due to @gfgtdf pointing out the object was never
actually destroyed since io_service::stop was never called (issue #1927).

This new method foregoes the custom wrapper class and instead waits for the worker thread
to terminate in the wesnothd_connection dtor. The use of the wrapper class is also why using
thread::detach alone worked (@jyrkive) and using join did not.

Additionally, the ptr alias is now of a unique_ptr instead of a shared_ptr.

I have verified that the connection dtor is actually called. This new method makes it clearer
what's actually going on.
2018-04-13 10:24:25 +11:00
Severin Glöckner
533c7e9822 remove unneded keys
[ci skip]
2018-04-12 22:10:08 +02:00
Severin Glöckner
7d427aedee INSTALL had been renamed to INSTALL.md
[ci skip]
2018-04-12 21:43:39 +02:00
Jyrki Vesterinen
8667e5bbdd Hotkey manager: drop duplicate commands
We use both SDL_KEYDOWN and SDL_TEXTINPUT events for hotkeys. It's possible
for both events (caused by the same keypress) to trigger the hotkey command
and we don't want that. Hence, let's drop duplicate commands.

Fixes #1736.
2018-04-12 19:46:56 +03:00
Charles Dang
2edcbdced8 Convert uses of boost::thread to std::thread
Also covers uses of boost::this_thread.

Turns out std::thread calls std::terminate if it's destroyed while still joinable.
thread::detach needs to be called or else the program will crash.

There's also no standard library equivalent of boost:🧵:timed_join so I just
replaced it with the is_worker_running_ variable.
2018-04-13 01:08:41 +11:00
loonycyborg
19d9e150e1 Fix issue #1757: prevent abnormal termination if failed to bind address 2018-04-12 14:30:45 +03:00
Iris Morelle
cfd5d5289d Update changelog
[ci skip]
2018-04-12 06:15:19 -03:00
Iris Morelle
8c97458a76 Add team colouring to some Aethermaw props missing it
[ci skip]
2018-04-12 06:04:29 -03:00
Celtic Minstrel
191c23c194
Update changelog.md 2018-04-11 22:51:32 -04:00
Celtic Minstrel
b062b19e10 Add [move_unit]clear_shroud= as an attempt to clear shroud as the unit moves (untested) 2018-04-11 22:46:48 -04:00
Celtic Minstrel
68b33cf6bd Allow [move_unit]dir= to perform relative movements 2018-04-11 22:46:48 -04:00
Celtic Minstrel
622db9d08b Allow [move_unit]to_location to take a list of waypoints 2018-04-11 22:46:48 -04:00
Charles Dang
3d71caff38 TRoW: removed old, now-unused story art
[ci skip]
2018-04-12 13:19:01 +11:00
ln-zookeeper
eaf186e021 TRoW: New set of story art by LordBob
In scenarios 06 and 14 I turned the opening narrator message into story text instead. The image for 03 isn't used yet as there's no text to accompany it.
2018-04-12 12:21:51 +11:00
Iris Morelle
0610b48d7e Fix test scenario references to Kaleh's WML
This is required after commit cbedd09ec2.
2018-04-11 22:06:40 -03:00
Celtic Minstrel
8f6613ea09 Fix #2745 2018-04-11 21:05:31 -04:00
Celtic Minstrel
bf70d50b80 Fix #2875 2018-04-11 21:03:24 -04:00
Iris Morelle
7f8cb13bd3 help: Use new attack stats separator in unit descriptions
Closes #2873.

(This is part of a commented-out block in master because Vultraz hasn't
updated the code yet. He said I could forward-port the patch into it
anyway. For the time being unit descriptions are just completely missing
because of this.)
2018-04-11 22:02:14 -03:00
Nils Kneuper
90dba93784 updated Czech translation 2018-04-11 21:39:25 +02:00
Nils Kneuper
7ab1da24a5 updated Galician translation 2018-04-11 20:33:02 +02:00
Nils Kneuper
5f201e17f0 updated Chinese (Simplified) translation 2018-04-11 20:27:59 +02:00
Jyrki Vesterinen
934f0326d8 Revert "Fix #1736: on GNU/Linux, a hotkey can trigger multiple commands"
This reverts commit c42401a8de.

As @CelticMinstrel pointed out, that commit made it impossible to input characters which require
AltGr to type (e.g. @, € and $ in Finnish keyboard).

Reopens #1736.
2018-04-11 18:58:15 +03:00
Jyrki Vesterinen
2562a7e3b0 Revert "Changelog entry for commit c42401a8deb92acc16039fbeed0acf16287e286c"
This reverts commit c23fc2b666.
2018-04-11 18:57:59 +03:00
Charles Dang
607bc4c935 Fixup 4b6e547 because apparently I cannot write
[ci skip]
2018-04-11 17:43:47 +11:00
Charles Dang
4b6e5478be Fixup a1810bde32 (better comment)
[ci skip]
2018-04-11 17:40:58 +11:00
Charles Dang
1068ca128c UtBS: removed old Desert Elves and accompanying scenarios and loading code
[ci skip]

Also fixed the campaign icon to use the new Kaleh sprite instead of the old one.
2018-04-11 14:38:02 +11:00
Celtic Minstrel
7661c655b0 Fix gender-dependent strings in SotA involving the kids 2018-04-10 22:23:04 -04:00
Celtic Minstrel
04d51a4b17 Fix #2848 2018-04-10 22:23:02 -04:00
Celtic Minstrel
b46381c83a Fix #2857 2018-04-10 22:23:01 -04:00
Charles Dang
a1810bde32 Game Events/Manager: skip disabled assertion if write_events is called mid-event
This reverts afaa75842c and replaces it with a more general
no-assert-during-events check. This is because there are other instances besides [inspect]
where this function can be called mid-event, and it wouldn't be convenient to add nested
'strict' parameters to multiple functions just to handle them.

Fixes #2750.
2018-04-11 13:08:27 +11:00
Charles Dang
b0f767bdb5 Changelog entry for 79072b7c3d
[ci skip]
2018-04-11 11:52:01 +11:00
Charles Dang
1c8b508777 Connect Engine: attempt to fix fallback user team name not being translated
See #2863.
2018-04-11 10:46:51 +11:00
Charles Dang
275057df59 Gettext: used [[maybe_unused]] for UNUSEDNOWARN on C++17 2018-04-11 10:46:45 +11:00
Charles Dang
a4dd74c32a MP Create Game: fixed campaign player numbers label being untranslatable
Fixes #2861.

Also changed the logic for when the "min to max" label is shown from != to >.
2018-04-11 10:14:45 +11:00
Jyrki Vesterinen
c23fc2b666 Changelog entry for commit c42401a8de 2018-04-10 19:08:10 +03:00
Jyrki Vesterinen
c42401a8de Fix #1736: on GNU/Linux, a hotkey can trigger multiple commands
SDL_TEXTINPUT events aren't generated on Windows when Alt is held down.
Let's ensure that the behavior is the same on all platforms.
2018-04-10 19:05:40 +03:00
Charles Dang
15fdabbac9 Removed now-unused storage of team colors in the image namespace
Was used by ~TC(). That now uses the team class color helpers.
2018-04-10 21:20:36 +11:00
Charles Dang
c446e679f0 IPFs: simplify ~TC() implementation
This results in the same behavior as before (default color outside a scenario, side's
chosen color during one) and is more consistent with other places in the code. They
both end up accessing `game_config::team_rgb_range` anyway, this is just in a slightly
more roundabout way.
2018-04-10 21:02:48 +11:00
Charles Dang
325691107a Spritesheet Generator: implemented multi-thread image loading
This results in a rough performance increase of anywhere from 30% - 50%.
2018-04-10 17:00:23 +11:00
Charles Dang
f9e44ea282 Spritesheet Generator: simplified intermediate surface data storage 2018-04-10 13:48:12 +11:00
Charles Dang
d6ee95c763 Spritesheet Generator: simplified sheet height calculation 2018-04-10 13:19:38 +11:00
Jyrki Vesterinen
134a51204b Convert README for manual images to Markdown
I also updated the filenames for the images, changed the recommended
format for screenshots other than "fullscreen" screenshots to PNG,
and removed the (no longer true) claim that the example places to create
the screenshots match where the English screenshots were taken.

Resolves #2856.

[ci skip]
2018-04-09 21:53:09 +03:00
Nils Kneuper
fd4f36e3c9 updated Chinese (Simplified) translation 2018-04-09 20:11:23 +02:00
Charles Dang
f7d2924b27 Added initial implementation of a dynamic spritesheet generator
This isn't used anywhere yet. Right now it only takes a directory and generates one
sheet for all the images in that directory and its sub-directories. The sheets are
fully-functional textures, and a path -> rect mapping exists, but I haven't added anything
that uses it yet.

This will definitely need some improvements and changes to properly integrate with @jyrkive 's
OGL work.
2018-04-10 03:03:56 +11:00
Sofartin
769f102f2e Add new packager 2018-04-09 10:35:17 +02:00
Celtic Minstrel
81b4ef1d7c Update changelog
[ci skip]
2018-04-08 14:00:23 -04:00
Celtic Minstrel
46c46b5548 Add u and v variables to pixel_callable
It's currently calculated from x,y and w,h, but with the switch to shaders
this situation could be reversed to calculate x,y from u,v and w,h
2018-04-08 13:56:25 -04:00
Charles Dang
dba3d409fc MP Staging: made the faction select button about as prominent as you can get
[ci skip]

Thanks to grzywacz for pointing out the possible use of the unit icon.
2018-04-09 00:22:42 +11:00
Charles Dang
7942b53ee8 Changelog entry for recent SotA fixes
[ci skip]
2018-04-08 22:30:32 +11:00
Charles Dang
57c797d516 SotA S8: fixed inconsistent Ghost name (fixes #2846)
[ci skip]

The dashed version is used in prior scenarios.
2018-04-08 22:25:09 +11:00
Charles Dang
565c4dbf60 SotA S7: fixed inconsistent town name (fixes #2845)
[ci skip]

The two r's version is used in two other locations.
2018-04-08 22:21:17 +11:00
Charles Dang
1f0588883c MP Staging: make Faction Select button's purpose more clear
[ci skip]
2018-04-08 21:04:14 +11:00
Charles Dang
77863cc526 SotA S2: fixed inconsistency between unit name and dialog (fixes #2844)
[ci skip]
2018-04-08 13:34:47 +11:00
Charles Dang
48010f514e SotA S2: fixed units with translatable IDs........
[ci skip[
2018-04-08 13:33:21 +11:00
Charles Dang
ccce10511a Unit Create: fixed unit selection not persisting between uses (fixes #2822)
I had been unconditionally selecting the first entry after setting the active
sorting option. This overrode the previous unit selection.

Regression from 6b52d16fae.
2018-04-08 13:11:27 +11:00
Celtic Minstrel
8581637b51 Update changelog 2018-04-07 12:26:16 -04:00
Celtic Minstrel
4b2dd68595 Support alignment= in SUF 2018-04-07 12:24:21 -04:00
Celtic Minstrel
62d39d6532 Support usage= in SUF 2018-04-07 12:24:11 -04:00
Celtic Minstrel
46f4b51482 SWF: Support lists for special= and special_active= 2018-04-07 12:23:06 -04:00
Celtic Minstrel
c62a4820fc Deprecate [replace_map]map= in favour of [replace_map]map_data=
This gives greater consistency between similar APIs, and allows macros
intended to drop a map into [scenario] to also work in [replace_map].
2018-04-07 12:22:52 -04:00
loonycyborg
0e5463fd81 nsi script: update expected extensions of changelogs 2018-04-07 13:20:08 +03:00
Jyrki Vesterinen
e7ed3cbbb9 Fix linking of C++ unit tests with CMake
The problem with them is that the "libraries" into which Wesnoth is split
have circular dependencies, and linking of the game succeeds only by chance
(everything just happens to be used by the time the linker encounters it).

Fixed by allowing the linker to use multiple passes over the libraries
until all references are resolved.
2018-04-07 13:15:01 +03:00
Martin Hrubý
165349104d
Merge pull request #2840 from newfrenchy83/patch-11
Update wesnoth.cbp
2018-04-07 12:01:22 +02:00
newfrenchy83
2c65dff722
Update wesnoth.cbp 2018-04-07 11:18:05 +02:00
Sofartin
d27e359d6e Add l10n-track to macOS Package - #2825 2018-04-07 10:54:26 +02:00
Charles Dang
d786fd6622 Image: handle case where l10n-track file is not present
Resolves #2825.
2018-04-07 19:34:10 +11:00
Nils Kneuper
6be41f51a5 updated French translation 2018-04-07 09:55:11 +02:00
stevecotton
2b406a37ec LoW S09 Lua cleanup: fix a line that was missed in 3783693cb (#2835)
3783693cbe was a general rename of
'V' to 'vars', and this line was missed. It caused an error at the
start of S09.

[ci skip]
2018-04-07 12:23:47 +11:00
Sofartin
83c0fc5073 Bump wesnoth version 2018-04-07 01:11:34 +02:00
Iris Morelle
3967fd190e gui2/log_settings: Make log options tooltips translatable
Fixes #2837.
2018-04-06 14:04:00 -03:00
loonycyborg
c955416ef2 flatpak-builder manifest: cleanup a buildtime only dependency 2018-04-06 11:23:15 +03:00
Charles Dang
3e7159e78e Minimap: removed old surface-based drawing implementation
Also cleaned up a minimap.hpp include.
2018-04-06 15:53:41 +11:00
Charles Dang
f5ec886cb5 Display: removed minimap drawing code
I kept some helper code (mainly the redraw_minimap function so I know where it needs
to be called) around for references.
2018-04-06 15:52:21 +11:00
Charles Dang
24d787c593 Minimap: added support for drawing unit markers
This moves the logic from the display class here. Will be utilized by the upcoming
interactive minimap widget I'm working on.
2018-04-06 15:39:50 +11:00
Charles Dang
e7a8af0c40 Renamed two t-prefix typedefs
[ci skip]
2018-04-06 12:20:35 +11:00
Celtic Minstrel
2afb40e3e9 Remove ai.synced_command stub 2018-04-05 19:45:36 -04:00
Sofartin
756f24d85e Remove libpng headers 2018-04-05 19:21:15 +02:00
Martin Hrubý
31192cb44b Fixed typo 2018-04-05 16:00:41 +03:00
Sofartin
0d4bd9f908 Update Xcode project after 3922a48c5c 2018-04-05 12:59:17 +02:00
Charles Dang
3c5eb48601 Removed unused image::set_pixel_format
Its use was dropped when I got rid of the window framebuffer surface.
Also removed the image.hpp include from video.hpp.
2018-04-05 13:01:31 +11:00
Charles Dang
3922a48c5c Removed GUI1 formatting deliminator definitions 2018-04-05 12:45:21 +11:00
Charles Dang
b82516ffe6 Team: cleaned up some redundancy in color getters
* The one case of get_side_color_range().mid() was converted to get_side_color();
  These are equivalent
* get_side_rgb() was removed. Before color_range was refactored to use color_t
  (f2ab245e8d), the only difference between it and
  get_side_color() was that the former used to return uint32_t (the color they returned
  was the same.
* get_side_rgb_min() and get_side_rgb_max() were renamed to get_side_color_min() and
  get_side_color_max(), respectively. Both were unused in any case.
* get_side_highlight_pango() was renamed get_side_color_pango() and now takes a 1-indexed
  side like the other color functions instead of taking 0-indexed and adding 1.
2018-04-05 12:27:33 +11:00
Charles Dang
594877aaaa Game Config: removed unused UI sound variables
These were used by GUI1. GUI2 doesn't need them; it defines its sounds elsewhere
(see data/gui/default.cfg);
2018-04-05 11:40:39 +11:00
gfgtdf
0f756b8189 fix [message] side_for= not working for the last side.
fixes #2776
2018-04-05 10:39:52 +11:00
Nils Kneuper
b45b0a3cbd updated Polish translation 2018-04-04 21:36:11 +02:00
Charles Dang
1deacd89f6 Convert custom unicode type aliases to proper types (available as of C++11)
This changes:
utf8::char_t   ->  char
utf8::string   ->  std::string
utf16::char_t  ->  char16_t
utf16::string  ->  std::u16string
ucs4::char_t   ->  char32_t
ucs4::string   ->  std::u32string

utf16::string and ucs4::string are now proper strings instead of vectors of characters too.

In order to get this change to compile at all, I needed to add a ucs4_convert_impl::convert_impl
specialization for wchar_t alongside the new char16_t specialization; both point to the same
conversion implementation type.

This commit doesn't do any additional cleanup. I'm sure if we looked, we could get rid of a
lot of the custom conversion code and probably a bunch of stuff that might have had to do with
supporting utf16::string and ucs4::string being vectors instead of basic_string specializations.
Either way, I don't know the code (or encoding handling in general) to make a call as to what's
needed or not. I'll let someone else do that.
2018-04-04 18:54:29 +03:00
Charles Dang
cc78bb3b1c Preprocessor: cleaned up an unnecessary header include
enum classes can be forward-declared. Also removed redundant version.hpp include
and did some include re-ordering.
2018-04-04 22:20:54 +11:00
Charles Dang
b8d051cb72 Moved game version stuff from game_config.hpp to version.hpp
They're still in the game_config namespace but are now in a more logical header.

game_config::version has been replaced with wesnoth_version.str(), save for one case
where it was replaced with wesnoth_version directly (it was a comparison against another
version_info object; no need to compare against a string...).

Also cleaned up a bunch of game_config.hpp includes.
2018-04-04 22:08:18 +11:00
Charles Dang
6babb773d2 Fixed images with no alpha channel rendering incorrectly
See https://forums.wesnoth.org/viewtopic.php?p=625159#p625159

Since this problem can also be solved with make_neutral_surface, and is_neutral already
check a surface's alpha mask, I moved the is-not-indexed check to is_neutral and made use
of it for the on-load standardization check.
2018-04-04 20:16:43 +11:00
Charles Dang
464f7ce628 GUI2: minor refactoring of window construction to guard against memory leaks
This ensures the window object is managed by a smart pointer from the moment of its
creation, instead of being passed around as a raw pointer first. If an exception were
thrown during window creation, it would have resulted in a memory leak.

* Moved window_ member assignment to build_window() in both modal_dialog and modeless_dialog.
* Added an assertion after window creation in modeless_dialog.
* Renamed the global build() function to build_window_impl() to avoid confusion with
  builder_widget::build.
2018-04-04 17:05:51 +11:00
Charles Dang
f4fb2a6dcc Changelog entry for c4cf0c9
[ci skip]
2018-04-04 10:52:37 +11:00
gfgtdf
c4cf0c9da4 fix filter not working in [disable] (#2826)
The problem was that the specials_context was not set during those
two get_special_bool calls

This removes what seems to be a rather useless optimisation in
battle_context::battle_context since choose_attacker_weapon would
just return 0 in that case.

fixes #2801
2018-04-04 10:43:27 +11:00
gfgtdf
79072b7c3d fix OOS when undoing actions with synced choices
The problm was that the old code tried to use `undo_stack().can_undo()`
to check whether the current action can be undone. But
`undo_stack().can_undo()` uses the undo stack which is only updated at
the end of each action, so it cannot be used to check whether the action
that is currently executed can be undone.

This code removes some assertion that were wrong due to the
justmentioned.
2018-04-04 10:43:26 +11:00
newfrenchy83
596f3f1bda Update wesnoth.cbp 2018-04-03 08:46:36 -05:00
Charles Dang
bd00adffd4 Help Browser: don't generate nodes for hidden topics, updated link color
See 1903b05 for GUI2 label link color change. Really, this shouldn't be hardcoded here,
but I'll get to that.
2018-04-03 20:30:26 +11:00
Charles Dang
e8b750f8a7 Help: fixed unit section such as the Walking Corpse's not generating
I didn't realize that is_valid_id was only meant to check IDs provided in the help config and
not IDs generated dynamically; the latter are always correct. Granted, the old code did actually
call its analogous codepath for race and era generation, but it did not for unit sections. My
refactor made it so this check happened *any* time a section was created, regardless of its source.

To rectify that, I moved ID validation for sections into the static section generation loop like
for topics. I also moved the topic id validation prior to the ToD generation, tweaked the invalid
id message, and renamed a variable for clarity and consistency.
2018-04-03 20:19:02 +11:00
Sofartin
2ae6c9e4d0 Fix Xcode Project after 23e78abb20 2018-04-03 10:27:15 +02:00
Charles Dang
6615aa7efe Swapped the position and formatting of game names and titles in the MP lobby
Addresses point 2 of #2815.
2018-04-03 19:11:29 +11:00
Charles Dang
384ba46c86 GUI2/Label: tweaked link confirmation prompt 2018-04-03 15:30:43 +11:00
Charles Dang
1903b05ab1 GUI2/Label: tweaked link color
[ci skip]
2018-04-03 15:25:44 +11:00
Charles Dang
4bd08cefb9 Fixup 7f60fb0 (missing include) 2018-04-03 15:23:30 +11:00
Charles Dang
754d326098 Help/Manager: dead code begone! 2018-04-03 15:04:05 +11:00
Celtic Minstrel
7f60fb0fbc Add [filter_second_weapon] to leadership and resistance abilities
Closes #2761
2018-04-02 23:56:18 -04:00
Charles Dang
30455d52a2 Help: moved a util function to the only file in which it is used 2018-04-03 14:49:17 +11:00
Martin Hrubý
bca6203bf4 Updated changelog style (#2680)
* Updated changelog style

I have to do that because maximum size for textfield is 1000x1000 so full changelog doesn't fit there

* Disaled Spell Checking and bumped to 1.13.13
2018-04-02 23:38:30 -04:00
Charles Dang
26b6ca54bb Fixed crash when starting the editor (fixes #2816)
If no display_context was passed to the display ctor (such as is the case in the editor),
the terrain_builder's gamemap pointer would be null. Really not sure why this didn't cause
a crash n the 1.14 branch, but oh well.

I just removed the ctor call to rebuild_all() since it's not really needed. The map is
rebuilt when change_display_context is called anyway, which both the editor_controller and
play_controller do.
2018-04-03 13:53:30 +11:00
Charles Dang
973a8f54f9 Help: mark currently unused-parameter as such for now 2018-04-03 13:36:17 +11:00
Charles Dang
09f6cec0c1 Fixup 3865a16 2018-04-03 13:23:03 +11:00
Charles Dang
3865a16288 Help: fixed ambiguous overload, config copying 2018-04-03 13:09:00 +11:00
Charles Dang
3fc01cadf4 Help: removed useless 'is nonnull' debug info from terrain topics
is_nonnull() just means "is not "none" or void terrain".
2018-04-03 12:59:14 +11:00
Charles Dang
b0d72724a0 Fix extra qualifier on function declaration 2018-04-03 12:55:24 +11:00
Charles Dang
a064b4f66b Help/Manager: don't need to keep a game config pointer anymore
I had removed the code that used it. We can just keep a help config pointer.
2018-04-03 12:54:14 +11:00
Charles Dang
3cba52c607 How did these sneak past... (fixup 23e78ab) 2018-04-03 11:54:00 +11:00
Charles Dang
23e78abb20 Help: massive refactor and cleanup of the help backend
This basically splits all the stuff in help/help_impl.*pp into multiple files by their
function, and refactors the entire workflow into a proper object-oriented interface in
modern C++.

There are still a features missing (such as hidden section parsing in the manager) that
I'll get back to.

Few incidental changes and fixes:
* Terrain topics now sorted alphabetically.
* Help text now small
* Fixed wrong toggle button id in browser. This is what was making it impossible to expand
  any sections.

The GUI2 help browser is now back in working order, inasmuch as you can view all sections'
and topics' text (save units').
2018-04-03 11:51:57 +11:00
Steve Cotton
2caed06cdb THoT S12 Fix some "x=" tests that should be "x,y=" tests
Taking the chest south of the start hid the door and chest that are
north of the start.

The sneak-door opened much earlier in the level, allowing the undead
from the south-east lich to go north to the spider room.  The ghosts
and nightstalkers that are supposed to ambush the player's forces in
the south (after opening the 3-hex door) instead go north and end up
joining the spider fight.  The slower-moving undead also go north,
and are easily fought one-by-one in the sneak passage instead of the
south-east.

[ci skip]
2018-04-03 07:59:26 +11:00
Nils Kneuper
65f690d905 updated Polish translation 2018-04-02 10:42:00 +02:00
Charles Dang
4ae9278eb0 Units: convert header and italic help markup to Pango markup
[ci skip]
2018-04-02 15:40:06 +11:00
Charles Dang
838ef5761f MP Factions: converted bold help markup to Pango markup
[ci skip]
2018-04-02 15:33:37 +11:00
Charles Dang
fb2c76d301 I missed a case of <header>
[ci skip]
2018-04-02 15:31:54 +11:00
Charles Dang
c12cbaa116 Help: explicitly sort Terrain sections
[ci skip]

This happened incidentally with the current help implementation, but that no longer happens
with my in-progress refactor. We still want these sections sorted, though.

The removal of the "sort_sections=generated" key from the Eras section is a forward-port of
6b20ccdb62 from 1.14.
2018-04-02 15:24:27 +11:00
Charles Dang
65a5216bc0 Terrains: convert italic help formatting to Pango markup
[ci skip]
2018-04-02 15:22:09 +11:00
Charles Dang
636ada65a8 Use proper bool instead of yes/no when setting config values 2018-04-02 13:36:51 +11:00
pentarctagon
3f67c2fbf0 Create travis dockerfile in the travis script step.
This allows having multiple Dockerfile-base-* files without also needing to add a separate Dockerfile-travis-* file due to the FROM line changing.
2018-04-01 15:05:20 -05:00
Celtic Minstrel
fed46ec45f Support location_id in [teleport] 2018-04-01 14:05:33 -04:00
Celtic Minstrel
d2a8c5bb32 Fix incorrect error message when encountering an unknown persistent tag 2018-04-01 14:02:51 -04:00
Steve Cotton
d6661fdb80 THoT S12 Put the sneak-passageway's door on the right hex (fixes #2804)
This matches with the "Another old caved-in passageway..." event
around line 835, the trigger is on 55,33 and the walls that open are

        [terrain]
            x=55,55
            y=34,35
            terrain=Uu
        [/terrain]

Debian bug #483893, for which the original fix in
4c473187e6 changed the wrong digit.

This is a cherry-pick from 1.14 to master (fixes #2804) of
bcaac1ef (the change) and 5b7aca97 (the changelog).

[ci skip]
2018-04-01 16:04:15 +03:00
Nils Kneuper
7f35558799 updated Spanish translation 2018-04-01 00:00:51 +02:00
Nils Kneuper
742c378361 updated Czech translation 2018-03-31 22:10:38 +02:00
Sofartin
62febff94e Remove redundand cp 2018-03-31 21:03:29 +03:00
Sofartin
2e2015b6da Enable Testability for macOS DEBUG builds 2018-03-31 20:59:43 +03:00
Sofartin
0a9b10cfa8 Fix Wesnoth's Application Support dir name 2018-03-31 20:52:50 +03:00
gfgtdf
9593062fc6 guard against calling user_choice_manager::pull() recursively 2018-03-31 19:44:14 +02:00
gfgtdf
bce8c29568 treat local choices as like sycned contexts in replay.cpp
this makes more sense as the game cannot handle sycned commands while
executing local choices. It also fixes an OOS in
wesnoth.synchronize_choices
2018-03-31 19:44:05 +02:00
gfgtdf
edd7a82255 pull remote user input even if we are doing a local choice.
this mainly effects wesnoth.synchronize_choices:
previously the client would not process incoming choices from other
players while it was exeucting its own local choice (usually a dialog).
The problem this commit fixes is that with the old behaviour any choice
from another player would block the incoming queue, in particular
chatmessages after that command would be delayed until the
wesnoth.synchronize_choices is finished.
2018-03-31 19:44:03 +02:00
Nils Kneuper
a32d689c46 updated French translation 2018-03-31 14:24:10 +02:00
ln-zookeeper
d0a2fde239 ANL: Fixed scenario brokenness stemming from force_lock_settings=yes
[ci skip]
2018-03-31 14:07:40 +03:00
Sofartin
917401acaa Remove rest of Growl things and CodeSign everything after copy 2018-03-30 18:42:07 -05:00
Celtic Minstrel
8becc799c1 Update changelog 2018-03-30 18:43:41 -04:00
Celtic Minstrel
6184489a65 Fix an incorrect error message in [clear_global_variable] 2018-03-30 18:39:24 -04:00
Celtic Minstrel
ea0bcec92f Support facing in [role][auto_recall] 2018-03-30 18:39:11 -04:00
Celtic Minstrel
325f4c4070 Support force_scroll in [move_units_fake] (same as in [move_unit_fake]) 2018-03-30 18:38:58 -04:00
Celtic Minstrel
7a3d6f958a Support root=cube and root=int in [set_variable] 2018-03-30 18:38:47 -04:00
Celtic Minstrel
15ae9fcb0c Use wesnoth.format instead of string.format for translateable strings in [objectives] 2018-03-30 18:38:37 -04:00
Celtic Minstrel
c835e5b7e6 Nicer handling of some Pango formatting attributes in [message] 2018-03-30 18:38:25 -04:00
Celtic Minstrel
d48206bdbe Remove speaker=id support from SUF 2018-03-30 18:38:14 -04:00
Celtic Minstrel
2bd2a8b1b6 Handle speaker=id directly in [message] instead of relying on SUF 2018-03-30 18:38:03 -04:00
Celtic Minstrel
beb5dc75aa Support [set_variable]round=trunc 2018-03-30 18:37:39 -04:00
Celtic Minstrel
5ee9b09470 Add a way in [filter_wml] to match key values against a glob 2018-03-30 18:37:20 -04:00
Celtic Minstrel
b483d96f50 Fix [filter_wml] implementation so that [or] tags actually work 2018-03-30 18:36:56 -04:00
Vasya
2b8782923a Lua API: simplify functional.reduce (#2788)
simplify code and remove `indentity or 0` VS `indentity` inconsistency.
2018-03-30 13:23:39 -04:00
Celtic Minstrel
79bc18fe95
Fix unintended change to the semantics of [modify_side]income= 2018-03-30 11:05:31 -04:00
doofus-01
816dd075dc [UtBS] Quenoth elf animations (#2679)
* sun-shyde standing animations, draft

* additions to sun-shyde floating animation

* singer defense animation

* defense animations for sun-singer and sun-shyde

* try to make scout less leaning backwards

* champion defense animation

* fixing and rounding out basic animations (esp. wrt to floating/standing) for sun_shyde
2018-03-30 14:35:25 +03:00
pentarctagon
1bb5fdf283 Add using dockerfiles based on the LTS and BRANCH env vars
This makes it simpler in the future to have branches that have dependencies that are different from master, rather than having a single image with all necessary dependencies installed, which may at some point end up not being possible to do.
2018-03-30 12:08:56 +03:00
Celtic Minstrel
dd4f80fdd1
Fix scenario editor writing to wrong key 2018-03-29 21:48:07 -04:00
Nils Kneuper
57c1a67134 updated British English translation 2018-03-29 22:56:58 +02:00
Nils Kneuper
4bcfada88a updated Ukrainian translation 2018-03-29 22:55:14 +02:00
Nils Kneuper
f19db187fa updated Scottish Gaelic translation 2018-03-29 22:53:24 +02:00
Charles Dang
01bcee6be7 Merge branch 'master' of github.com:wesnoth/wesnoth 2018-03-29 20:33:51 +11:00
Charles Dang
20a58fd8f8 Removed help_manager struct (it will be replaced)
This is in preparation for a larger refactor.
2018-03-29 20:33:00 +11:00
Iris Morelle
8a905134a4 wesnothd, campaignd: Fix warning about uninitialized field on _WIN32 2018-03-29 05:23:15 -03:00
pentarctagon
de48b9fbb1 Don't copy the .git directory into docker. 2018-03-29 01:28:17 -05:00
Wedge009
fb866c6d13 'moreso' isn't a word in any dialect of English.
[ci skip]
2018-03-29 12:03:30 +11:00
Victor Sergienko
004d7b541b Credits for Chinese translation of iOS announcements 2018-03-28 18:43:49 -03:00
Martin Hrubý
212cb9be18
Updated Xcode's README.md 2018-03-28 14:37:55 -05:00
pentarctagon
0bbc78945e Remove tools-external-libs.
Also put Boost_RANDOM_LIBRARY, CRYPTO_LIBRARY, and MYSQL_LIBS into server-external-libs.
2018-03-27 19:21:16 -05:00
Iris Morelle
56470323c3 SotA: Drop UMC translations section from the campaign's credits
[ci skip]
2018-03-27 19:26:59 -03:00
Iris Morelle
9808a6a722 UtBS: Hide technical terrains in the Help browser
[ci skip]
2018-03-27 19:07:07 -03:00
Iris Morelle
0cdee6b04c Update changelog
[ci skip]
2018-03-27 18:58:23 -03:00
Iris Morelle
4799ca05fe cmake, scons: Drop option to enable or disable the removed SDL_SavePNG code
Commit dfc42e8a8d removed said code since
Wesnoth can use IMG_SavePNG() from SDL_image 2.0 instead. However, the
author left the build-time configuration options intact, and also part
of the necessary code for CMake to link Wesnoth against libpng.

Note that this change also eliminates an unnecessary direct link-time
dependency on libpng when using both CMake and SCons.
2018-03-27 18:56:03 -03:00
Nils Kneuper
065e8cc128 updated Spanish translation 2018-03-27 22:01:33 +02:00
Nils Kneuper
40d63a4a25 updated Chinese (Simplified) translation 2018-03-27 22:00:03 +02:00
Jyrki Vesterinen
706015ab85 Remove some unreachable code 2018-03-27 21:34:37 +03:00
Charles Dang
8d2244628a Updated Visual Studio projectfile readme
[ci skip]
2018-03-28 05:20:19 +11:00
Iris Morelle
139695d7b1 Sync changelogs across branches
[ci skip]
2018-03-27 05:07:15 -03:00
Iris Morelle
ecb80e607e Fix up previous commit to match 1.14
[ci skip]
2018-03-27 05:00:20 -03:00
Iris Morelle
66b60f4731 Update changelog for the synced debug command UX changes
[ci skip]
2018-03-27 04:54:21 -03:00
Iris Morelle
6b67c18d89 scons: Sort help text with a custom function that will run on Python 3 2018-03-27 03:52:43 -03:00
Iris Morelle
a31b5ebcba Sort scons --help output 2018-03-27 03:46:02 -03:00
Iris Morelle
51111db8f7 wam: Add *.ini to upload blacklist to match the engine, reorder a few items
[ci skip]
2018-03-27 03:06:51 -03:00
Hironori Fujimoto
f63ca02984 UtBS: Fix Nym's hit sound to be female 2018-03-26 22:47:05 -04:00
Celtic Minstrel
3939c332b9 Remove some uses of set_wml_tag_metatable 2018-03-26 22:42:48 -04:00
loonycyborg
abcded267b pot-update and regenerate doc files 2018-03-27 04:30:08 +03:00
loonycyborg
3221e22599 scons: look for xhtml.xsl in several dirs as its location can vary 2018-03-27 04:11:08 +03:00
gfgtdf
a1c06fbc65 disable debug command off-turn in mp
the serer wouldn't accept these commands anyways.
2018-03-26 18:48:03 +02:00
lundberg
d322e1fb97 Suppress VC warning 4706 for campaignd 2018-03-26 10:07:20 -05:00
newfrenchy83
cf70a6bb54 Update wesnoth.cbp 2018-03-26 09:49:30 -05:00
pentarctagon
3343a9451a Remove SDL2_TTF 2018-03-26 17:56:36 +11:00
Charles Dang
8fc49bdce1 Fixed some stuff causing compiler errors 2018-03-26 17:55:24 +11:00
Iris Morelle
28c35e71fa Alphabetical order, alphabetical order, alphabetical order...
[ci skip]
2018-03-26 03:40:55 -03:00
Sofartin
bc027b4fba Fixed Xcode project and removed SDL2_ttf 2018-03-26 17:33:53 +11:00
Iris Morelle
6f17695d7c Update changelog for issue #2732 and issue #2709
[ci skip]
2018-03-26 03:27:42 -03:00
Iris Morelle
56e7b01ac4 Refactor synced debug commands prompt to bring the string count down to 2
Otherwise there are too many repetitive strings for translators to work
with, which is rather unfair for an exception like this during the 1.14
RC phase. It also makes for better code.

Also added an article "The" at the start of the strings for :command
notifications.
2018-03-26 03:16:36 -03:00
Iris Morelle
eacbc5f695 gui2/text_box: Store hint text as a t_string
Storing it in a regular string results in issues with the game getting
stuck with the translation for the locale that was set during GUI2
initialization and not reflecting changes when switching languages later
on.
2018-03-26 03:16:36 -03:00
Gregory A Lundberg
49ecb08338
Add fonts.uuid to .gitignore for fontconfig 2.13.0 2018-03-26 01:15:19 -05:00
lundberg
8b7eb536eb Fix missing VC project options
campaignd project did not inherit warning supression for simple_wml from project/solution options.
2018-03-26 00:37:22 -05:00
Iris Morelle
cbec739e23 New translatable version of the synced debug command prompt text 2018-03-26 01:26:09 -03:00
Iris Morelle
b7e08977ed Set a custom dialog caption for the synced debug command prompt
This replaces the caption with something more apropos than the generic
"Save Game" caption. It necessitates a minor API change though.
2018-03-26 01:08:07 -03:00
Charles Dang
b4adec6ef5 Help Browser: removed custom formatting conversion for <bold>, <italic>, and <header> 2018-03-26 15:06:11 +11:00
Charles Dang
73d0bf10c3 Help: replaced custom <header> formatting tag with <big>
[ci skip]
2018-03-26 15:05:26 +11:00
Charles Dang
ecab22e6aa Help: replaced custom <bold> and <italic> formatting tags with Pango equivalents
[ci skip]
2018-03-26 15:00:04 +11:00
Charles Dang
8b6270f92f Fix some unused parameter warnings caused by recent commits 2018-03-26 14:36:15 +11:00
Charles Dang
b08fa98260 Removed CVideo::blit_surface
Used to be a surface drawing helper for blitting on the framebuffer surface.
I made it work with accelerated rendering by forwarding it to render_copy,
but we don't need it anymore. All but one of its usecases have been removed.
2018-03-26 14:15:38 +11:00
Charles Dang
c453a97dac Removed custom blit_surface function
Unused now. And we wanted to get rid of it anyway.
2018-03-26 14:11:41 +11:00
Charles Dang
c198be1fa8 Removed the SDL_TTF and GUI1 font rendering API and associated functions
This removes all functions related to:
* GUI1 font formatting
* GUI1 font rendering
* Manual text surface size calculations
* The font description interface. While it wasn't exclusive to the TTF rendering system,
  it was unused by Pango/Cairo rendering.

A huge chunk of the help browser code was commented out since we don't have font::line_width anymore.
Likewise, a hack was added to the GUI2 text box since we don't have have get_max_height anymore.

font::is_cjk_char was retained (as well as some related helpers) since they might be useful
later.

I'll leave it to someone else to update the CMake/Scons files to remove TTF as a build
dependency.
2018-03-26 14:08:45 +11:00
Iris Morelle
ab67b402d1 Let synced debug command notifications be localized, fix them up a bit
There's a gettext call but there was nothing to mark the strings as
translatable in xgettext's view. Additionally, fixed a minor case of
missing the colon before the command name, replaced ASCII apostrophes,
and rewrote a notification with awkward wording.
2018-03-25 23:49:32 -03:00
Charles Dang
34797ed1a2 Removed or commented out (for reference) all uses of the GUI1 button widget
And removed said widget.
2018-03-26 13:13:17 +11:00
Severin Glöckner
e0c9d7b9f6 install.md: cmake version requirement had changed
[ci skip]
2018-03-26 03:25:39 +02:00
Charles Dang
b32ccb05dd Help Browser: increased window height
[ci skip]
2018-03-26 12:21:24 +11:00
Charles Dang
0a67e9725c Help: marked "Level" string in unit topic description translatable
I apparently forgot to do this at some point... Fixes one of the issues mentioned in #2732.
2018-03-26 12:21:23 +11:00
lundberg
a8539cfca0 Fix VC warnings about upstream issues
Disable some warnings pertaining to Boost issues such as name-hides-global.
2018-03-25 20:14:54 -05:00
Charles Dang
db5abb7e63 GUI2/Text Box: refactored hint text interface
Previously, I had implemented the hint text ("Search)" and image (the magnifying glass)
as a custom text box definition. This caused some problems, though. Since the string was
hard-coded as part of a WFL formula, it couldn't be translated (see #2709 and #2732). It
also wasn't expandable to any other usecase.

Instead, I've added two new hint_text= and hint_image= keys to [text_box], wrapped the
"Search" text and magnifying image path in a helper macro, and refactored the default
definition to display the hint text and image when appropriate.

This also fixes a minor issue where selected text wouldn't remain highlighted when the
box wasn't focused when using the filter definition (it did with the default one).

This should fix the untranslatable "Search" text issue mentioned in both issues above.
The new string is in the wesnoth-lib textdomain.
2018-03-26 12:11:34 +11:00
Charles Dang
2b9c7b1abd GUI2/Canvas: allow formula values for [text] font_size= 2018-03-26 12:03:46 +11:00
Celtic Minstrel
229d2f0483 Allow percentages in [random_placement]num_items= 2018-03-25 20:56:11 -04:00
Celtic Minstrel
e4a2c14177 Allow WFL for [random_placement]num_items= 2018-03-25 20:51:03 -04:00
Severin Glöckner
409c596fa1 remove outdated information from install.md
[ci skip]
2018-03-26 02:46:19 +02:00
Celtic Minstrel
4427ee1936
Fix typo in 1dd411a84e 2018-03-25 19:52:22 -04:00
Charles Dang
46598681b6 Fixup 76c2cbac46
Using assignment is for 1.14. We can use `boost::optional::emplace` here on master.
2018-03-26 10:46:42 +11:00
newfrenchy83
76c2cbac46 Implement [filter_weapon] in leadership and resistance abilities
Closes #2718
2018-03-25 17:16:16 -04:00
Charles Dang
e52682e07b wesnothd: removed password reminder backend (closes #2753) 2018-03-26 07:50:27 +11:00
Charles Dang
ebec4d6ce8 MP Login: removed Password Reminder functionality
Resolves #2748.

Essentially, all this did was tell users to go use the forum, so it wasn't worth
it to keep it and solve the infinite loading screen issues it was causing.

The server backend still needs to be cleaned up.

Also removed a dead reference to some "Change Username" button in the Login dialog's
code.
2018-03-26 02:15:53 +11:00
gfgtdf
f219b527e4 fix playmp_controller reading later network packages
in linger mode.

playmp_controller::play_linger_turn calls play_slice after processing
end_linger/[notify_next_scenario] which would (after 'fix chat in
[delay]' commit) then read more data from the network in particular data
for the next scenario which will then be lost.
2018-03-26 01:55:06 +11:00
gfgtdf
94aa24c5a8 fix moves sometimes not undone when control is changed.
with the 'fix chat not working during delay/animation' it could happen
that play_slice_catch would process a incoming controller change in
which case that while loop would end without the code inside that 'if
(player_type_changed_)' being executed, which woudl lead to oos errors
since that client woudl have made moves that other players don't have.
2018-03-26 01:55:05 +11:00
gfgtdf
274da80788 fix chat during [delay] and animations
fixes #1856
2018-03-26 01:55:04 +11:00
Hironori Fujimoto
6b98bbdca1 Rename variable so that it's role becomes clearly 2018-03-25 16:49:13 +03:00
Hironori Fujimoto
6212a62a98 Use is_composing() instead of raw ime_in_progress_ 2018-03-25 16:48:50 +03:00
Hironori Fujimoto
5e22b2b714 Remove private member 'ime_length_'
In order to get length of composition text, just compare text_ and
text_cached
2018-03-25 16:46:02 +03:00
Hironori Fujimoto
16a8ac7e49 Turn ime_in_progress_ off when composition text is nothing 2018-03-25 16:43:02 +03:00
Martin Hrubý
39d1476ade Drop OS X 10.7 and Growl support (#2749) 2018-03-25 15:48:23 +03:00
newfrenchy83
f8abea0de4 Update wesnoth.cbp 2018-03-25 15:31:49 +03:00
Iris Morelle
3c6bb665c6 Update credits
[ci skip]
2018-03-25 05:35:40 -03:00
Iris Morelle
84ce75af19 gui2/unit_attack: Fix damage types and ranges being displayed in English
Part of issue #2732.
2018-03-25 04:41:22 -03:00
Iris Morelle
7056ae014c gui2/unit_attack: Fix alignments being displayed in English
Part of issue #2732.
2018-03-25 04:19:42 -03:00
Charles Dang
5ddc1d9a2e Merge branch 'master' of github.com:wesnoth/wesnoth 2018-03-25 17:02:22 +11:00
Charles Dang
0e9eac9ad8 Mouse Events: removed an override that only called the base method 2018-03-25 16:48:37 +11:00
Celtic Minstrel
1dd411a84e Support to_location in [move_unit] 2018-03-24 18:32:10 -04:00
Charles Dang
11e88dd1ca Updated DejaVu Sans font files to version 2.37 (from 2.35)
[ci skip]

Source: https://dejavu-fonts.github.io/Download.html
I haven't done any codepoint list updates in data/hardwired/fonts.cfg, but that's
not relevant anymore since it's for the legacy TTF rendering system which is in
the process of being removed.
2018-03-25 09:15:28 +11:00
Celtic Minstrel
7a1ea36d39 Update changelog 2018-03-24 18:11:56 -04:00
Celtic Minstrel
4e52d62963 Support formula= in [variable] ConditionalWML 2018-03-24 18:09:04 -04:00
Charles Dang
cef0edb4ac Updated Oldania font files to version 1.007 (FFEdit)
[ci skip]

Source: http://arkandis.tuxfamily.org/adffonts.html. Previous version was 1.006 (FFEdit).
Also includes the italic and bold variants we didn't have before.

Thanks to @sevu for finding this updated version. :)
2018-03-25 09:00:57 +11:00
pentarctagon
376f2e9dbe Explicitly set osx_image for osx+scons job.
This is the current default, and even though the job uses scons this also sets the osx version to use.  Therefore it's better to set it explicitly in case the default changes at some point.
2018-03-24 15:38:05 -05:00
Charles Dang
bad574f7c8 EI: fixed another Lua syntax error from 3783693cbe
[ci skip]

I misread the intent of that line in the original. It was supposed to clear the
var, not set it.
2018-03-25 06:28:11 +11:00
Charles Dang
915dfaa399 Quick fix for "Mandatory WML child missing" error when starting MP
This isn't a proper fix since then the minimap doesn't show, but it at least allows
you to start an MP game.

Fixes #2724.
2018-03-25 06:28:02 +11:00
Charles Dang
8d3dcb109b GUI2/Window: reverted some unintentional semantic changes from 88e5c49f5d
These were never intended to go in that commit at all. I accidentally included them.
This reverts the semantic changes. The rest was just formatting so I'm leaving it.
2018-03-25 05:10:26 +11:00
Charles Dang
e4b7820ab0 Fixed infinite loading screen when logging in with an invalid nickname
Fixes #2728.
2018-03-25 04:46:02 +11:00
gfgtdf
83007d4825 remove a [on_redo]
since it was removed in 10561d3e53 this will cause errors. Please make sure it is not used in mainline before you remove something.
2018-03-25 04:20:40 +11:00
gfgtdf
7621af926b show the oos savegame dialog when receiving a debug command in mp
with a different text of course.

fixes #2683
2018-03-25 04:16:44 +11:00
gfgtdf
da2081de77 fix initial selection of mods in sp 2018-03-25 04:15:07 +11:00
Charles Dang
afaa75842c Add ability to bypass strict no-disabled-events assertion when writing events
This is since the Gamestate Inspector can be invoked mid-event (using [inspect])
and it makes use of write_events().
2018-03-25 04:06:13 +11:00
Charles Dang
ef172d47fa Exclude command console and game ui dialogs from tests
They need to be more stable and complete before we test them.
2018-03-25 04:00:15 +11:00
Celtic Minstrel
cf385537c2 Fixup last commit 2018-03-24 12:42:13 -04:00
Celtic Minstrel
f7cc1842bb Don't bother trying to standardize event name if there isn't one 2018-03-24 12:40:58 -04:00
Charles Dang
89e0d7e2ae Events: ensure the global event context is always available
The Boost unit tests have been failing since I removed the GUI2 event context since the
code expects both that A: the topmost context is the global one and B: that you can't
use join() to join the global context. Removing the UI event context meant the test's
fake_display event_context became the only (and global) context, causing an assert.
2018-03-25 03:35:47 +11:00
Celtic Minstrel
e317f346e8 Don't show a message for missing name in [event] if it has an id 2018-03-24 12:32:04 -04:00
Sofartin
00e9f4482f Add new unit_tests dependencies 2018-03-24 15:27:41 +02:00
newfrenchy83
67f2ba9767 Update wesnothd.cbp 2018-03-24 15:10:57 +02:00
Jyrki Vesterinen
fbfa82c6b1 Remove error message if creating texture for floating label fails
Textures can't be created with faked video. That's pretty much the only
reason why creating that texture can ever fail (other cases, such as
credits, stress the text rendering system much more than floating labels).
2018-03-24 11:38:19 +02:00
Sofartin
29b12782a8 Fixed Xcode Project after 5ece7ac5b7 2018-03-24 11:12:53 +02:00
Jyrki Vesterinen
2257c03771 Fix build with GCC and Clang 2018-03-24 11:11:25 +02:00
Jyrki Vesterinen
d4c9db9e35 Visual Studio: increased warning level to /W4 even for release builds
In particular, this enables C4100, the warning for unreferenced function
parameters.

I also fixed some /W4 warnings.
2018-03-24 09:41:28 +02:00
Iris Morelle
f6a128579a Revert "Revert "Bump min Boost version to 1.56.0""
This reverts commit cdf9b465c6.

May this noise be my vengeance.
2018-03-24 01:53:47 -03:00
Iris Morelle
cdf9b465c6 Revert "Bump min Boost version to 1.56.0"
This reverts commit c82c1ff905.
2018-03-24 01:46:52 -03:00
Iris Morelle
5c59fade0f Use the correct textdomain for the random faction mirror options
Fixes up commit 2e502334f2.

See issue #2709.
2018-03-24 00:37:29 -03:00
Iris Morelle
9852064ba9 Fix warning about an unused method parameter 2018-03-24 00:37:29 -03:00
Charles Dang
49d36e6eb4 Display: always draw the map in the full window
This is a temporary measure that removes reliance on the theme map rect.
I need to ponder the best design to handle displaying the full map.
2018-03-24 14:36:40 +11:00
Charles Dang
5ece7ac5b7 Split the rect_of_hexes struct into its own file
And cleaned up it a bit. Made use of std::array and gave it a default ctor using
the values from display::hexes_under_rect.
2018-03-24 13:22:54 +11:00
Charles Dang
c76bef8bb8 Merge branch 'master' of github.com:wesnoth/wesnoth 2018-03-24 11:00:06 +11:00
pentarctagon
c456d4b288 Make UTF8 checks fail the build if they find anything.
Also fixes a comment typo in docker_run.sh.
2018-03-23 18:59:28 -05:00
pentarctagon
344b5c56b9 Removes a couple scripts that are not used.
utils/travis/install_deps.sh - no longer executes anything outside of the osx if block.
utils/travis/exit_wrapper.sh - I honestly don't know why this exists.
utils/travis/test_wrapper.sh - No longer used as of 7ca5a0df64.
2018-03-23 18:59:28 -05:00
pentarctagon
3b5cbc3e3c Add the updated Dunefolk race description.
See: https://forums.wesnoth.org/viewtopic.php?f=32&t=47721&start=375#p624668
[ci skip]
2018-03-23 18:42:11 -05:00
pentarctagon
994e6efa79 Remove deprecated Khalifate references. 2018-03-23 18:42:11 -05:00
Charles Dang
85dcef7fa0 Removed remaining references to window framebuffer surface 2018-03-24 10:31:04 +11:00
Charles Dang
c7367344b1 Removed surface_restorer class
This was only used in the GUI1 widget base class and isn't something we'll need
with accelerated rendering.
2018-03-24 10:28:51 +11:00
Charles Dang
3be39a98fe 0 -> nullptr in 2 places 2018-03-24 10:22:25 +11:00
Nils Kneuper
0bab3fb4d3 updated Spanish translation 2018-03-23 22:32:35 +01:00
Charles Dang
c2fd4f48f9 Cleaned up unnecessary instances of emplace_back(config {})
No need to invoke the copy ctor.
2018-03-24 00:55:28 +11:00
Charles Dang
2e502334f2 MP Create Game: attempt to fix RFM type labels being untranslated (#2709)
Since these are defined in their MAKE_ENUM enum with N_, we need to manually un-not-translate
them here.
2018-03-24 00:55:27 +11:00
pentarctagon
b801140344 Remove debugging symbols from Travis xcode build.
This removes the -g option from the xcode travis build, since debugging information isn't needed and the increased size was causing the cache to timeout when compressing and uploading it.  ccache max cache size is also decreased from 2 GBs to 200 MBs, which matches the linux+cmake builds.  Fixes #2670.
2018-03-23 03:10:27 -05:00
Charles Dang
57700090d8 GUI2: reimplemented [dis]connect_signal SFINAE using constexpr functions
This replaces the use of the boost::mpl::set lists. It replaces those damn things with simple
constexpr functions that check the template parameter against an accepted list for each event
type. This is a *lot* simpler.

These helpers are also used in the runtime checks in dispatcher::fire.

I've had to leave the mpl sets in, though, since I can't figure out how to convert the last
place where they're used. The presence of a type is required for SFINAE in
dispatcher_implementation::event_signal, and I can't figure out a new design that avoids the
need for the template parameters.
2018-03-23 18:46:20 +11:00
Iris Morelle
9d76278e71 Update the changelog
[ci skip]
2018-03-23 04:35:13 -03:00
Iris Morelle
94c5f64cc6 i18n: Remove no-op translation::init() function
This function only ever had an implementation when building the i18n API
to use libintl instead of Boost.Locale was possible, in which case its
implementation would be a std::setlocale() call specific to POSIX
systems.

I'm not backporting this to 1.14 since it's an inconsequential cosmetic
thing, or so I'd like to think. Last time someone tried to remove a
similarly empty "init" function elsewhere, things went south pretty
quickly.
2018-03-23 04:20:22 -03:00
Iris Morelle
a602391168 i18n: Make VGETTEXT()/VNGETTEXT() always require a GETTEXT_DOMAIN to be defined
This drops a preprocessor conditional branch that is dead code now that
the file pulls gettext.hpp and the GETTEXT_DOMAIN defaults with it.

See also PR #2711.
2018-03-23 04:18:46 -03:00
Iris Morelle
5c28dcaab6 i18n: Forcefully pull gettext.hpp into formula/string_utils.hpp
There are cases (deprecation.cpp for one) where string_utils.hpp is
included first, which causes the VGETTEXT/VNGETTEXT definition to use
the textdomain-less (a.k.a. forced wesnoth-lib textdomain) overloads of
vgettext() and vngettext(), because GETTEXT_DOMAIN has not yet been
defined by anything. This again results in strings being looked up in
catalogues where xgettext is not adding them.

This is a companion for PR #2711 I should've noticed sooner. Without it,
there were still cases where interpolated strings would not be
translated due to vgettext() using the wrong textdomain for them.

I ran a quick scan on the codebase to make sure there aren't any files
including formula/string_utils.hpp before defining their own
GETTEXT_DOMAIN instead of the gettext.hpp default.
2018-03-23 04:18:36 -03:00
Iris Morelle
c5b3947e4a Replace all instances of naked vgettext() calls with VGETTEXT()
The vgettext() function, while declared in src/formula/string_utils.hpp,
actually has its implementation out-of-line in
src/formula/string_utils.cpp where GETTEXT_TEXTDOMAIN is defined to
"wesnoth-lib". Because vgettext() is implemented in terms of the _()
function (an inline wrapper around translation::dsgettext()), it passes
the textdomain defined in the file where it was implemented as a
parameter.

This means that every case of vgettext() being used in other code units
where GETTEXT_TEXTDOMAIN is not defined to "wesnoth-lib", is broken if
the string being looked upon doesn't coincidentally exist in the
wesnoth-lib textdomain.

Ages ago, to work around this limitation, an overload of vgettext() that
takes the textdomain name as a parameter was introduced (see commit
0ba3d05204). Since this form of vgettext()
is rather unwieldy to use (and in particular, the xgettext message
extraction tool mistakes the first argument for the msgid, see below), a
VGETTEXT() macro was also added that uses the GETTEXT_TEXTDOMAIN symbol
defined in the file where the call is made, and thus we get the correct
string from the correct textdomain.

Switching all cases of naked vgettext() in mainline to VGETTEXT() fixes
a myriad of situations where an interpolated string that has an extant
translation does not actually get translated in practice because of the
mismatched textdomain reference (see issue #2709 for an example with MP
game titles). I couldn't find any cases of the companion vngettext()
function (which handles plurals) being used in the wild naked, but for
future reference it also has a companion VNGETTEXT() macro to pass the
correct textdomain to its textdomain-parameter overload.

One caveat is that this commit DOES break the string freeze in one
particular case -- src/units/unit.cpp has a case where the
textdomain-parameter version of naked vgettext() was in use with
"wesnoth" as the first parameter, and xgettext misidentified this as a
translation entry for a "wesnoth" string in the file's assigned
textdomain (which is the default textdomain, wesnoth). So this will
result in the next pot-update both removing the spurious "wesnoth"
string AND adding the correct string to the relevant catalogue template
("<span color=\"$color\">$number_or_percent</span> HP").
to that textdomain.

Other than that, I believe this does not break the string freeze in any
other fashion and it shouldn't result in any regressions for i18n.

It might be worth considering in the future renaming vgettext() and
vngettext() to names that make people less likely to misidentify them as
functions they can freely call directly without regard to the textdomain
assignment issue.
2018-03-23 04:18:01 -03:00
Charles Dang
7a9ed8d363 Used UNUSED macro instead of (void) where applicable 2018-03-23 12:29:56 +11:00
Charles Dang
b6c4f0f6ae Display: removed redraw observer interface
This won't be needed once we get everything sorted out and refactored.
2018-03-23 12:23:58 +11:00
Alexander van Gessel
8179c7226b Invert a conditional
Found by coverity.
2018-03-22 16:52:45 +01:00
Gregory A Lundberg
812de972ac
Fix unused parameter
If you're going to stub a function, please remember to clean up its parameters as well.
2018-03-22 10:12:52 -05:00
Charles Dang
410398a70b Used stdlib math functions instead of global C versions 2018-03-22 23:25:23 +11:00
Charles Dang
4abbb7b9f9 Display: more code cleanup, mostly of stuff I noticed while formatting 2018-03-22 23:01:52 +11:00
Charles Dang
c195ff25d9 Display: formatting cleanup 2018-03-22 22:48:25 +11:00
Charles Dang
6721c84f7e Display: minor code cleanup 2018-03-22 22:34:03 +11:00
Charles Dang
8d1ec6216b Added two missing textdomain headers
[ci skip]

Should fix two of the issues mentioned in 2709.
2018-03-22 22:08:38 +11:00
Lari Nieminen
4d86af796c
EI: Fix Lua syntax error from 3783693cbe
[ci skip]
2018-03-22 09:51:37 +02:00
Charles Dang
4ea25d5df5 Display: removed more theme handling stuff 2018-03-22 14:46:34 +11:00
Charles Dang
75954109c5 Fake Display: cleanup
* Removed now-unused reports member (as of cdb11c2)
* Formatting cleanup
* 0 -> nullptr
* Removed commented-out dtor
2018-03-22 06:45:30 +11:00
Gregory A Lundberg
cdb11c2109
Fix bad initializer 2018-03-21 14:35:15 -05:00
Charles Dang
eeffa82e2b Fixup 37dee4b (unused variable) 2018-03-22 04:51:15 +11:00
Charles Dang
db64bc7126 Command Executor: removed set_button_state()
This had to do with setting up GUI1 theme buttons.
2018-03-22 04:35:02 +11:00
Charles Dang
d6cc93be1b Font/Pango Text: added debug assertion 2018-03-22 04:25:03 +11:00
Charles Dang
37dee4b1ff Display: removed all code related to report drawing
Report drawing was handled in draw_sidebar, so that function was also removed. The display
class won't be handling sidebar drawing anymore anyway.

Also removed display::invalidate_game_status and game_display::invalidate_unit which were
both used to set a flag dealing with report drawing.

This should finally get the display class close to map drawing only.
2018-03-22 04:20:38 +11:00
Charles Dang
d0f7bfbf37 Floating Label: added text to debug output if texture creation fails 2018-03-22 03:43:25 +11:00
Charles Dang
a9afee6104 Floating Label: don't attempt to render empty text 2018-03-21 20:49:16 +11:00
ln-zookeeper
3be2ff5187 EI S03: Changed Mal-Kallat back to male
He was changed to female in f4d67031a4 even though he's addressed as "brother" in dialogue. Reported on the forums.
2018-03-21 11:25:28 +02:00
Charles Dang
94f172dbdd Display: removed unnecessary getSurface check 2018-03-21 20:18:55 +11:00
Charles Dang
f081a1c133 Revert "Convert uses of boost::regex and related functions/types to their stdlib counterparts"
This reverts commit 29ee9a7150. It broke GUI2 schema validation
for keys with formulas. Also, it seems std::regex does have a form of match_not_dot_null
(std::regex_constants::match_not_null). Will need to rethink.

StackOverflow tells me boost::regex used Perl regex, whereas the stdlib regex does not. Shall
have to confer with @celticminstrel...
2018-03-21 18:13:36 +11:00
Sofartin
00dac71a90 Fixed Xcode Project 2018-03-21 18:01:20 +11:00
Charles Dang
4cf1f8dc9d GUI2/Grid: made use of std::exchange 2018-03-21 17:52:39 +11:00
Charles Dang
1e9f2548a6 Cleaned up MSVC 2013 compatibility code
We no longer support that compiler.
2018-03-21 17:52:24 +11:00
Charles Dang
29ee9a7150 Convert uses of boost::regex and related functions/types to their stdlib counterparts
This was put off when we first transitioned to C++11 since GCC 4.8 didn't have full
regex support. Since we now support at least GCC 5, we can commit this.

This covers:
* boost::regex
* boost::regex_match
* boost::smatch
* boost::sregex_iterator
* boost::sregex_token_iterator

boost::regex_constants::match_not_dot_null doesn't have a stdlib counterpart, but according to
@celticminstrel it should be alright to remove it.
2018-03-21 17:06:29 +11:00
Charles Dang
112ada179c GUI2: added display and execute wrappers for a bunch more dialogs
Made use of them where applicable. There are a whole bunch of cases where the dialog
object only exists to check its return value, but I'll update those separately.
2018-03-21 16:47:36 +11:00
Charles Dang
5145b009a5 Display: removed code to draw theme panels/labels
Again, going to be handled by a GUI2 dialog.
2018-03-21 14:38:51 +11:00
Charles Dang
72c451d2ae Display: restored background drawing
I think we indeed want this to be handled here, since it's the gamemap background,
not the UI's background. Made it a class member.
2018-03-21 14:15:52 +11:00
Charles Dang
e1e7f65ec1 Display: removed interface that set up theme buttons
Unused now, since we're moving to GUI2 for the ingame UI. The functions to get buttons
are left, but they always return nullptr.
2018-03-21 14:15:50 +11:00
Iris Morelle
39b05dd0db wam: Update description and name for Modifications
They are no longer just for multiplayer mode (see issue #1475, commit
a09e2bb858).

[ci skip]
2018-03-21 00:14:41 -03:00
Charles Dang
9bc19d7e02 Fixup 3254bb2 (forgot to include this) 2018-03-21 13:40:29 +11:00
Charles Dang
a971af89d7 Playcampaign: formatting cleanup 2018-03-21 13:37:01 +11:00
Charles Dang
0552175693 Merge branch 'master' of github.com:wesnoth/wesnoth 2018-03-21 13:14:26 +11:00
Charles Dang
3254bb2c7d Moved UI object from display to play_controller
Design change from 075a9bac34.

After discussion with @celticminstrel, we decided it better for the controller to
own the UI object as well as the display object, instead of the display owning the UI.

I've added a pure virtual function declaration to controller_base to ensure all controllers
implement this.
2018-03-21 13:13:54 +11:00
Charles Dang
a5344ae52a Play Controller: formatting cleanup 2018-03-21 12:42:28 +11:00
gfgtdf
439340ce78
update INSTALL.md for c++14 requirement
clang 3.8 is needed for "Money, Time, and hexfloat I/O manipulators (N2071)" (a c++11 feature)
2018-03-20 23:22:14 +01:00
Charles Dang
fef1310890 Attempt to fix build 2018-03-21 08:26:32 +11:00
Jyrki Vesterinen
e70a9c769d Fix size of fake screen
Unit tests (WML and C++ alike) require that the fake screen has nonzero
size. Thus, we again report a nonzero screen size with a fake screen.

Unfortunately, this didn't fix the unit test I was testing
(test_end_turn). The problem is that the null theme is returning that
the game area has zero size; however, I haven't found any differences
between 1.13 and master that would explain why the problem occurs in
master but not 1.13. I'll need to debug 1.13 separately later on...
2018-03-20 20:54:29 +02:00
Charles Dang
239fde451a Removed the old surface drawing queue implementation, except for the layer enum
Kept that since it's still used in some places and is good for reference.
Also removed display::get_screen_surface which was used in said impl.
2018-03-20 22:07:34 +11:00
Charles Dang
0b8e86df85 Help: formatting/doc/include cleanup 2018-03-20 21:40:43 +11:00
Charles Dang
28d2be4bec Removed a whole bunch of GUI1 stuff
This almost completely removes GUI1, save for the button widget (will remove once I get
all the Theme handling sorted out) and the editor's own GUI1 widgets.

This includes the GUI1 textbox, scrollbar, scrollarea, and menu widgets, as well as the
dialog_frame and dialog_manager classes. I've also removed floating_textbox. It was only
kept around for reference (it's unused as of the inclusion of the GUI2 command console).

gui::in_dialog has been replaced by GUI2's is_in_dialog directly now that we have no more
GUI1 dialogs.

\o/
2018-03-20 21:07:59 +11:00
Charles Dang
6ea405174e Updated VS projectfile for 5022a38
[ci skip]
2018-03-20 19:34:04 +11:00
Charles Dang
5022a38608 Removed GUI1 Help interface code
Not needed anymore since we're moving to GUI2 for this dialog.
2018-03-20 19:21:33 +11:00
Sofartin
1e96d9c87b Fixed Xcode Project 2018-03-20 10:16:48 +02:00
Wedge009
899b4b73b2 Update VC project files.
* Switch libeay32 to libcrypto for OpenSSL 1.1.0 update in https://github.com/aquileia/external/
* Added recent source additions not yet present in MSVC projects.
* Miscellaneous minor tidying/sorting in filters and build configurations.

[ci skip]
2018-03-20 15:16:53 +11:00
Sofartin
9e73b49d86 Fixed Xcode project 2018-03-20 06:10:06 +02:00
Charles Dang
625135eb0d Rename events::pump to events::run_event_loop
To make its purpose clearer.
2018-03-20 11:26:54 +11:00
Charles Dang
123dd952c0 Made CVideo::render_screen private
It's not supposed to be called outside events::pump.
2018-03-20 10:33:58 +11:00
Charles Dang
504d4d2ff4 Display: removed now-unused map_screenshot_surface_
Unused as of 3a768cbdbe. It was needed for get_screen_surface(), which is used in
drawing_queue, but that's going to be removed soon.
2018-03-20 10:29:42 +11:00
Charles Dang
f80fabfe30 Help: removed code to show old GUI1 help browser
Attempting to launch it crashes the game (probably to do with a null video surface),
and since it's being replaced there's no point in restoring it to functionality.

The implementation details (help_menu, etc) have been left for now. Will remove soon.

This also means the GUI2 help browser is shown by default now.
2018-03-20 10:26:09 +11:00
Charles Dang
77f2c758ca GUI2/Window: cleaned up some commented-out code 2018-03-20 09:02:25 +11:00
Gregory A Lundberg
de218da637
Bypass unused code so we still compile while the mountains crumble and smoke rises from the waters. 2018-03-19 16:47:32 -05:00
Charles Dang
f62ad8b1df Fixup 3a768cbdbe
Output is good now :P
2018-03-20 07:37:15 +11:00
Charles Dang
3a768cbdbe Display: got map screenshots working again
Output is not perfect, but that can be solved later.
2018-03-20 07:29:37 +11:00
Jyrki Vesterinen
e43d1f5430 Restore ability to recruit full keep of one unit by holding Ctrl+Alt+R 2018-03-19 20:38:25 +02:00
Charles Dang
075a9bac34 Get the GUI2 in-game UI at least appearing
I decided to go with a modular approach, where both in-game and editor UI dialogs inherit
from a single base class, a pointer of which is owned by the display class. That can be
used for common functionality that needs be shared by all in-game dialogs.

Right now the new UI is just static. It works with most stuff, but not key presses. Working
on that...
2018-03-20 04:47:42 +11:00
Charles Dang
b2d3da4a1e Removed non-functional video2::draw_layering class
Will possibly re-implement this in a different way.
2018-03-20 04:47:40 +11:00
Gregory A Lundberg
419385d934
Disable entire function
Leaving bits and pieces around leads to compiler warnings.
2018-03-19 12:13:31 -05:00
lundberg
c187f069e8 Suppress upstream variable-hide-variable errors. 2018-03-19 11:21:37 -05:00
lundberg
58f585b6e5 Fix variable-hides-variable 2018-03-19 11:21:37 -05:00
Sofartin
a766c00b7e Fixed campaignd Xcode target 2018-03-19 16:18:33 +02:00
Sofartin
d584ebded6 Fix InfoPlist.strings encoding 2018-03-19 12:28:01 +02:00
Charles Dang
d4a2ddb688 Display: disabled all in-game theme drawing
We're moving this to GUI2.
2018-03-19 17:03:45 +11:00
Charles Dang
ace03abef5 Display: removed unused redraw_everything function 2018-03-19 17:00:15 +11:00
Charles Dang
9063736fd4 Display: removed drawing_queue_ member
This was the core of the surface-based drawing engine. Unused now. The drawing_queue_add()
calls throughout the code have been left, but commented out, for reference while reimplementing
things. The actual drawing_queue code has been left to, since its layers are referenced in
places. Need to remove them.
2018-03-19 16:59:44 +11:00
Charles Dang
bb3d5b9a9d Updated VS projectfile for recent changes
[ci skip]
2018-03-19 16:14:40 +11:00
Charles Dang
fc2a58f693 Use std::size_t everywhere instead of plain size_t
Excludes:
* spirit_po/
* xBRZ/
2018-03-19 11:56:04 +11:00
Charles Dang
4225e1aa7c Small build fixup 2018-03-19 10:59:16 +11:00
Charles Dang
68f4bd14d6 Used std::exchange for a thing
Note we don't really need to set the other object's renderer ptr to null since
the canvas dtor doesn't destroy it anymore, but still. Good to do.
2018-03-19 10:48:52 +11:00
Charles Dang
1167e3e78b Some build fixups to reflect changes since the help commits were originally made 2018-03-19 10:48:48 +11:00
Charles Dang
5193c7e7bf Help Browser: removed help topic padding 2018-03-19 10:48:06 +11:00
Charles Dang
75639bafd1 Help Browser: fixup topic title layout 2018-03-19 10:48:04 +11:00
Celtic Minstrel
5d918cd5a5 Help Browser: Support arbitrary initial topic
Hidden topics still untested.
2018-03-19 10:48:02 +11:00
Celtic Minstrel
b5c0da9e37 Help Browser: Don't double-list a section's root topic 2018-03-19 10:45:11 +11:00
Celtic Minstrel
854ade5d5c Help Browser: Show topic title 2018-03-19 10:45:09 +11:00
Celtic Minstrel
f2434d6572 Help Browser: Fix back button being visible when dialog opens 2018-03-19 10:45:07 +11:00
Charles Dang
71a89de7b2 Help Browser: properly implement toggling by clicking the book icons 2018-03-19 10:45:06 +11:00
Celtic Minstrel
a96c270b32 Fix GUI1 help topics not showing 2018-03-19 10:45:04 +11:00
Celtic Minstrel
cdea534ee0 Help Browser: Implement history 2018-03-19 10:45:03 +11:00
Charles Dang
c514c95a1f Moved new help entry point to a common location 2018-03-19 10:45:01 +11:00
Charles Dang
231a8ccbf2 Help Browser: implemented viewing of sub-sections/topics 2018-03-19 10:44:01 +11:00
Celtic Minstrel
11dbcb1464 Help Viewer: Parse help markup to Pango markup... mostly.
The help parser now outputs a config rather than a vector of strings of
which some should be taken literally and others parsed as WML.
2018-03-19 10:43:59 +11:00
Charles Dang
19eee7e806 Help Browser: improved layout stability and added next/back buttons (non-functional, of course) 2018-03-19 10:43:38 +11:00
Celtic Minstrel
d61af99a9b Help: That parameter isn't really needed 2018-03-19 10:43:36 +11:00
Celtic Minstrel
178dba8284 Help Viewer: Show topics with generated text 2018-03-19 10:43:27 +11:00
Celtic Minstrel
fbd42a7378 Help Browser: Actually show the correct topics with the correct icons
This also fixes the lag when opening help and makes the topic text appear.
(The topic text is not parsed at the moment, though.)
2018-03-19 10:43:25 +11:00
Gregory A Lundberg
22f0a89a64
Fix Coverity 1386194 Initialize class member
Only a problem if stuff is not done in the expected order. Initialize to zero so at least things go wrong but they don't go wildly wrong.
2018-03-18 17:05:55 -05:00
Celtic Minstrel
9902a2df31 Add the advanced prefs entry for the deprecation setting 2018-03-18 16:55:03 -04:00
Celtic Minstrel
49ad25fc69 Document --log-none command line option
This reverts commit e1ac4298eaf5bee6c885263e179588a051de24a8.
2018-03-18 16:51:39 -04:00
pentarctagon
983045718a Stop hard-coding cmake's -std version.
Adds the CXX_STD variable which can be set.  Currently defaults to 14.  This also now makes cmake honor the CXXSTD env variable set on travis.
2018-03-18 14:59:52 -05:00
Gunter Labes
b115be99e1 Enable lobby message logging again
Also re-enable flood protection and truncating too long messages.
2018-03-18 20:16:06 +01:00
Gregory A Lundberg
54b3f51a24
Fix more doccomments 2018-03-18 13:57:43 -05:00
Gregory A Lundberg
c7416ae7d9
Un-deprecate getMinimap
We can't use deprecated functions. If you want to replace it, replace it and delete the old function. But don't do half the job and expect a clean build!
2018-03-18 13:57:43 -05:00
Jyrki Vesterinen
950d4f86e5 Attempted fix for AppVeyor build failures on VS2015
Apparently AppVeyor uses VS2013 tools by default
_even in the VS2015 image_, which makes approximately zero sense.
2018-03-18 20:35:57 +02:00
Gregory A Lundberg
f97a617a26
Fix doccomments. 2018-03-18 13:18:12 -05:00
Gregory A Lundberg
ab36c8bcc2
More missing override specifiers. 2018-03-18 12:54:30 -05:00
Gregory A Lundberg
5b371161a7
Add missing override specifier. 2018-03-18 12:07:47 -05:00
pentarctagon
503e921d2f Set travis use c++14. 2018-03-18 18:54:24 +02:00
Gregory A Lundberg
2a17ecccfc Change SCons and CMake to C++14 2018-03-18 18:29:23 +02:00
Sofartin
4764dcaf5e Fixed Xcode Project for new Wesnoth 1.15 2018-03-18 18:06:43 +02:00
Charles Dang
61f653f91a Merge branch 'master' of github.com:wesnoth/wesnoth 2018-03-19 02:16:17 +11:00
Celtic Minstrel
b27c4c6512 Update gitignore for VC project file update 2018-03-18 11:12:40 -04:00
Charles Dang
7f81fba11a Fixup build again 2018-03-19 01:54:31 +11:00
Jyrki Vesterinen
750d558cd9 Fix #2681: minimap buttons don't do anything
Regression from commit ecc0dca665.
2018-03-18 16:48:05 +02:00
Charles Dang
af4db845d6 Cleaned up more framebuffer stuff that should have been in e205e42d44
Some additional uses from master that I forgot to add to the aforementioned commit,
and at least one thing I messed up in conflict resolution.
2018-03-19 01:45:43 +11:00
Charles Dang
cbf34d2db3 Video: we don't need to record the refresh rate anymore
Once we get OpenGL rendering all set up, double buffering will limit the frame rate for us.
2018-03-19 01:42:17 +11:00
Charles Dang
b7a717ff70 Fixup build (add missing include) 2018-03-19 01:32:33 +11:00
Charles Dang
90b2a51c46 display general compilation fixes 2018-03-19 01:31:34 +11:00
Charles Dang
079ec37909 Display: removed old software blitting routines from scroll 2018-03-19 01:31:33 +11:00
Charles Dang
11054e93f1 GUI2/Canvas: some refactoring to correctly reimplement the shape caching mechanism
The purpose of the shape caching is essentially to allow multiple draws to consecutively add to
previously drawn content. It essentially adds another condition for clearing the texture prior
to rendering.

I also moved the shape list handling into the draw function itself so it's only executed once
if needed instead multiple times when calling functions like set_variable - not that it actually
would have done anything after the first call, but this allows me to keep the clearing-the-texture
code in one place.
2018-03-19 01:31:31 +11:00
Charles Dang
16842ea2a8 Game Display: formatting update 2018-03-19 01:31:30 +11:00
Charles Dang
56c733268e Game Display: reimplemented more functionality in draw_movement_info
Not completely done yet, still need to get some stuff working, but this gets rid of the old commented-out
code and puts stuff mostly in the right place.
2018-03-19 01:31:29 +11:00
Charles Dang
d5249333d4 Unit/Frame: fixed alpha mods being applied to all units of the same type 2018-03-19 01:31:28 +11:00
Charles Dang
3332ae9757 GUI2/Minimap: refactored drawing code
Instead of using the minimap surface method (which was getting converted from surface to texture every
draw cycle since the caching mechanism the canvas implemented wasn't available and the weird custom
cache the widget implemented itself didn't seem to do actually do anything) we use the new render-to-
canvas-texture method which is a lot cleaner and should be a lot faster. This also means we no longer
override styled_widget::impl_draw_background.

Do note I might use the design of the removed cache here to add some age functionality to the
font::pango_text cache.
2018-03-19 01:31:27 +11:00
Charles Dang
ae106b5091 GUI2/Canvas: allow the default draw routine (shape drawing) to be overridden
Previously widgets that wanted to implement custom drawing behavior overrode styled_widget::impl_draw_background
or impl_draw_foreground. Those functions in the base class simply called the canvas render methods. Some widgets
such as the minimap ignored that rendered the contents on their own.

This new method allows rendering directly to the canvas's texture, meaning all the caching and sizing is already
handled by the canvas and doesn't need to be done by the widget; everything's always the right size and redrawn
when necessary.
2018-03-19 01:31:26 +11:00
Charles Dang
6c09c2b269 Added new minimap drawing method that works wholly with textures
I've left the old getMinimap function alone and added a new function that will eventually replace it
that utilizes texture rendering to a given texture instead of relying on surface blits and scaling.
This has the benefit of, well, reducing surface ops, for one, as well as removing the need to create
a new texture from the minimap surface every time it's updated.
2018-03-19 01:30:38 +11:00
Charles Dang
8190d67152 Allow render_target_setter to restore the last target when destroyed 2018-03-19 01:30:37 +11:00
Jyrki Vesterinen
dde06909f0 Fix build with Visual Studio 2018-03-19 01:30:36 +11:00
Charles Dang
c7ed5559a0 GUI2/Canvas: optimized cached texture management
Instead of throwing out the cached texture every time the canvas was dirty, I've added a flag so that
only happens if its size has actually changed. There still seem to be some issues in GUI2 where canvas
objects keep getting reset, but I'm not sure why. Will have to look into that.

Anyway, the addition of the SDL_RenderClear call also seems to have fixed the weird graphics bleed-through
I was getting when running the game with the OGL driver.

I don't know if the canvas copy or move ctors are needed for anything. I added them for a test, but I'll
leave them for now in case I need them later.
2018-03-19 01:30:35 +11:00
Charles Dang
5e35f6dbfe Moved SDL_SetRenderDrawColor wrapper to utils file and added a second overload
Also renamed the function to a more colloquial version.
2018-03-19 01:30:34 +11:00
Charles Dang
028b4ee73c Halos: fixed incorrect drawing origin when at non-default zoom 2018-03-19 01:30:32 +11:00
Charles Dang
2ba020a746 Display: avoid temp vectors when rendering partial fog/shround images on hex 2018-03-19 01:30:31 +11:00
Charles Dang
eeece5e3c7 Display: exit render_scaled_to_zoom early if passed texture is null 2018-03-19 01:30:30 +11:00
Charles Dang
d9f284f926 Font/Pango Text: fixed a weird crash in Cairo
See added comment for details.
2018-03-19 01:30:29 +11:00
Charles Dang
8eba15bffc Refactored handling of window/renderer size getters
* Removed display::screen_area(), display::w(), and display::h().
* Moved the global screen_area() function into the CVideo class.
* Renamed CVideo::getx() and gety() to get_width() and get_height()
* Made those two functions return the result of screen_area() instead of the other way around.
* Added preliminary support for high-DPI rendering to screen_area()

Note on the last point: When I fixed bug #1772 (aa8f6c7e7 right now but will probably change with rebasing)
I noted that SDL_GetWindowSize and SDL_GetRendererOutputSize returned the same results for me (even with
Window's automatic scaling for non-high-DPI-enabled apps disabled) but that the SDL documentation stated the
former returned screen coordinates and the latter pixels. In that same commit I changed the dimension functions
to use SDL_GetWindowSize. I've now reversed that decision and gone back to using SDL_GetRendererOutputSize so
I can guarantee output in pixels. If use_pixels is false, the code will return coordinates in 96 DPI, so I need
to have pixel measurements for the calculations.

Again, though, I do not know if SDL_GetWindowSize returns a different value that pixel size (which it's said
to do) on macOS or iOS. I'll need to do some testing. It's possible on those platforms I won't need the 96 DPI
measurements, but it's also possible it will be needed on on platforms, since all of our code relies on pixel
measurements.
2018-03-19 01:29:41 +11:00
Charles Dang
63398733b0 Controller Base: removed unused process_focus_keydown_event event
This was used before the command console was converted to GUI2.
2018-03-19 01:29:39 +11:00
Charles Dang
0032395ccf Floating Label: keep local pango_text object static
This also means I need to set set_add_outline every time create_texture is called to make sure the
text renderer has the correct settings.
2018-03-19 01:29:38 +11:00
Charles Dang
c72ac0079d Display: fixed moving units drawing under foreground terrains 2018-03-19 01:29:37 +11:00
Charles Dang
54fd91cc55 SDL/Texture: avoid unnecessary shared_ptr creation
Made use of shared_ptr::reset instead of creating temp shared_ptrs, assigning them to the class ptr,
then deleting them.
2018-03-19 01:29:36 +11:00
Charles Dang
beae56a4ea Display: simplified a few things 2018-03-19 01:29:35 +11:00
Charles Dang
3376ef04e3 Another large batch of progress, primarily in game_display
This is primarily focused on getting various areas of the game display drawing, such as footstep images
and the terrain defense indicators.

To facilitate the last, I've refactored draw_text_in_hex to utilize floating labels instead of drawing
to hex directly with surfaces. This probably isn't the most optimal solution, since labels are continuously
created and destroyed, but since their text is usually short and cached in the rendered text cache it
does for now.

Also includes some cleanup of deprecated functions in display, and slight reordering of drawing order of
certain elements.
2018-03-19 01:29:34 +11:00
Charles Dang
92d51b866d Added RAII helper struct to manage a floating label's lifetime 2018-03-19 01:29:32 +11:00
Charles Dang
07844f471b Comment out an unused parameter
Not sure if we'll need this again (perhaps to delay draws mid-action) so I'm not removing it yet.
2018-03-19 01:29:31 +11:00
Charles Dang
f8e71f4d9a Display: avoid unnecessarily (potentially) creating millions of temp vectors
I've moved the terrain hex drawing code directly into draw_visible_hexes instead of relying on get_terrain_images
to return a vector of all the necessary images for each visible hex and then drawing them. Instead, we now draw
each hex's images immediately without any intermediary container.

With the old method, after about 10 to 15 seconds of drawing we had already allocated (and destroyed) almost 180,000
temporary vectors (a new one was created for each hex, twice per draw cycle). It's obvious how quickly that would add
up over a normal play session, and though in this case the performance hit for creating each vector was probably tiny,
creating them likely would have added up.
2018-03-19 01:29:30 +11:00
Charles Dang
e9a8813b67 Floating Labels: use new pango_text functionality for generating text outline 2018-03-19 01:29:29 +11:00
Charles Dang
9add86d745 Avoid temporary object when creating new textures from disk 2018-03-19 01:29:28 +11:00
Charles Dang
2f2adc6899 Some updates to the texture wrapper class
* Made reset() a public function
* Added an assign() function
* Don't try to destroy null textures
* Updated doc comments

I left assign() as just taking an SDL_Texture ptr since having it take a texture ref would be
functionally equivalent to operator=.
2018-03-19 01:29:27 +11:00
Charles Dang
8bb6f193a9 Font/Pango Text: add extra stroke to text outline to compensate for alpha weirdness
Also added the outline to the hash.
2018-03-19 01:29:24 +11:00
Charles Dang
1fd9a16a86 GUI2/Canvas: handle text alpha as a render-time op
This reduces the number of times the text itself needs to be rendered, especially for areas like the
story viewer where the only difference is alpha.
2018-03-19 01:26:20 +11:00
Charles Dang
3bf6768685 Floating Label: header formatting updates 2018-03-19 01:26:19 +11:00
Charles Dang
8647ff63c0 Added a texture cache for pango_text render output 2018-03-19 01:26:18 +11:00
Charles Dang
a0f8ad67a5 GUI2/Canvas: don't skip drawing if canvas texture is null 2018-03-19 01:26:16 +11:00
Charles Dang
9d90539fc7 Display: re-enable fps counter with :fps 2018-03-19 01:26:15 +11:00
Charles Dang
78bcd85d9f Display: cleaned up a bunch of now-unused/unnecessary members and functions 2018-03-19 01:26:14 +11:00
Charles Dang
cdb43343b4 Marked sdl_handler::draw overrides as final 2018-03-19 01:26:12 +11:00
Charles Dang
dadb31aadf Display: header formatting and doc updates
Appropriate functions were also marked deprecated.
2018-03-19 01:26:11 +11:00
Charles Dang
e422261518 Removed external calls to display::redraw_everything() 2018-03-19 01:26:10 +11:00
Charles Dang
35a9dc6084 Video: don't render null textures 2018-03-19 01:26:09 +11:00
Charles Dang
345fa27565 Display: work on refactoring the main drawing system
Previously, every visible hex was iterated over and every element in that hex draw. This was inefficient
for two reasons: First, it meant the performance footprint for many operations like unit drawing was O(n²),
since the list of elements had to be checked for every single hex. Second, it meant the renderer had to
switch active textures many more times than necessary.

My new system involved drawing every element of a specific type at once - ie, all background terrains at
once, all units, all items, etc. This reduces lookup time from O(n²) to O(n) and results in a noticeable
performance increase. It also reduces the number of times the renderer needs to switch active textures,
since bulk draws such as the map grid overlay are now done all at once while that specific texture is
active.

There are still some layering issues and missing elements that need to be sorted, especially in game_display.
2018-03-19 01:26:07 +11:00
Charles Dang
0d69cbad69 SDL/Texture: made info struct take a texture ptr directly
Will allow me to construct one directly from a pointer if I don't have a wrapper object.
2018-03-19 01:26:06 +11:00
Charles Dang
2cddf5e2c5 Fixed some bad drawing offsets and sizes when zoomed in
This fixes HP/XP bar size (wasn't scaled to zoom) and placement, as well as crown/orb and main sprite placement.
2018-03-19 01:26:05 +11:00
Charles Dang
a86ac0675f Display: removed old drawing code and external draw calls 2018-03-19 01:23:09 +11:00
Charles Dang
9850e47720 Removed animation invalidation code
This no longer actually does anything now that location invalidation is removed. If you follow the code
animation_component::invalidate called unit_animation::invalidate which was responsible for generating
the overlaped_hex_ set. Previously, this is what locations were invalidated. Now it didn't do anything.
2018-03-19 01:23:07 +11:00
Charles Dang
c5be598cd0 Display: removed all the invalidated locations code
This removes all the code related to invalidating locations, any functions used to set, modify, or propagate
location invalidation, and several functions that no longer serve any purpose anymore since their only purpose
was to handle invalidated locations.
2018-03-19 01:23:06 +11:00
Charles Dang
ffc064eca2 SDL/Window: throw exception if render-to-texture is not enabled
NOTE: for some reason, if I remove the `SDL_RENDERER_TARGETTEXTURE` flag from sdl::window's ctor
render_flags argument, this assertion still doesn't throw. Not sure if that means by GPU supports
it by default, or what.
2018-03-19 01:22:31 +11:00
Charles Dang
48d61611f8 Fixed halos drawing over fog and shroud (fixes #1406) 2018-03-19 01:22:29 +11:00
Charles Dang
d23d1ea338 Renamed drawing_buffer to drawing_queue
Also renamed drawing_queue::drawing_layer to just 'layer'.
2018-03-19 01:22:28 +11:00
Charles Dang
46eea05a67 Refactor and cleanup of the drawing dispatch system
Previously, drawing was handled with custom DRAW and DRAW_ALL events which individual event handlers
managed. DRAW was used for only-as-needed draws, and DRAW_ALL for drawing everything. As we've switched
to accelerated rendering, we've switched to the latter model all the time; everything is always drawn.

Both DRAW and DRAW_ALL events aren't needed anymore and have been removed. Instead, we simply call each
handler's draw() function directly from events::pump. The two main cases that handled draw events - the
display class and GUI2 - just forwarded the event handler calls to their respective draw() functions anyway.

Awhile back to unconditionally send draw events to the event queue constantly every 20 ms. However, to prevent
draw calls from becoming backed up, the queue already had code to remove all but 1 draw event from the queue
anyway, so the actual rate of drawing was still reliant on the rate at which events::pump was called. Therefor
this commit should result in no change at the rate the screen is drawn.
2018-03-19 01:22:26 +11:00
Charles Dang
b746829692 Improved console output on IPF fail
Yes, I know the duplicate code should be consolidated.
2018-03-19 01:22:24 +11:00
Charles Dang
085bd42974 Display: restrict render clip rect setter to map drawing scope only
This prevents tooltips from being cut off.
2018-03-19 01:22:23 +11:00
Charles Dang
f25a404f37 Refactored floating_label implementation
* Store label as a texture instead of creating a texture from a surface every draw cycle
* Restored expired label removal and alpha fadeout (was accidentally removed earlier in my refactoring)
* Use alpha field of bg_color member for background color
* Draw tooltip backgrounds procedurally instead of with surfaces and part of the label texture itself.
  See included comment for small caveat.
2018-03-19 01:22:21 +11:00
Charles Dang
2c9d9efb1d Floating Label: formatting update 2018-03-19 01:22:20 +11:00
Charles Dang
ed27b67f1e Port floating textbox/command console to GUI2
The old floating textbox was extremely entwined with the controller_base, play_controller, and menu_handler
classes. controller_base::have_keyboard_focus essentially controlled whether some events were executed based
on whether the floating textbox was open or not. Additionally, those events weren't even reached if a UI dialog
was open at all.

The new design features a singleton console class that can be called from anywhere, not just the game. I've also
decoupled the execution object from play_controller. The relevant functions in menu_handler are now passed to
the console as callbacks.

To work around map events such as clicking not being available if the console was open, I removed the exclusionary
is-in-dialog check from controller_base::handle_event and instead exit early out certain types of events using
controller_base::have_keyboard_focus. As mentioned in the accompanying comment, this isn't the best solution, but
it will do for now.

The new console also isn't fully feature-comparable with the old GUI1 one. The following are still missing:
* The checkbox, for use when sending messages.
* Tab completion.
* A crash occurs when existing the app if a game was exited with the console open.

I'm leaving the old floating_textbox code around for now for reference.
2018-03-19 01:22:18 +11:00
Charles Dang
770664d1f3 Added a getter for a static pango_text object
The reason I added this was so I can refactor some temporary pango_text objects out of the display class.
styled_widget doesn't use this for reasons explained in the comment.
2018-03-19 01:22:16 +11:00
Charles Dang
2dca404a63 Split texture caches into linear and NN scaled versions
With textures, you can't change render scale quality once they've been created. To rectify this, I've
made the texture caches a map of caches, sorted by scale quality. This should result in no performance
overhead, since an image is simply added to the appropriate quality cache on creation instead of in
a single cache. If a different version of a texture is needed it will be loaded later.

By default, load_texture will return images using nearest neighbor scaling. GUI2 always fetches images
using linear scaling. This is consistent with the old software rendering method. Plus, we don't have
any way (as of now) to specify the render quality on a per-image basis.
2018-03-19 01:22:14 +11:00
Charles Dang
6c04ae29b9 GUI2/Window: removed empty undraw() function
This was emptied earlier in my refactor when window unrendering was removed. I simply hadn't
removed the function yet.
2018-03-19 01:22:13 +11:00
Charles Dang
3154ab419f Restored alpha handling of unit frames
Still need to figure out the blending effects or submerge alpha.
2018-03-19 01:22:12 +11:00
Charles Dang
c406a2067f Refactored halo code to bring it in line with new drawing methods
This basically rips out all the unrendering and invalidation code. Neither is needed anymore.
Instead, we can have a simple, clean, "just draw the managed halos" interface.

Note there's an issue unrelated to this where halos aren't removed when a unit is killed with
the debug kill menu command.
2018-03-19 01:22:10 +11:00
Charles Dang
f7de368551 Added some inline wrappers for SDL_SetTexture* functions 2018-03-19 01:22:09 +11:00
Charles Dang
ca44435550 SDL/Window: removed pixel format member and promoted renderer info wholly to class member
The pixel format member was really rather useless, since SDL_RenderInfo returns an array of supported
formats and only the first one was being saved.
2018-03-19 01:22:08 +11:00
Charles Dang
855345291b GUI2: removed some unnecessary calls to canvas::set_is_dirty
The one in Outro was unnecessary since set_variable already calls set_is_dirty.
The one in the Story Viewer was there to deal with some background redraw issues which no longer appear
with the new drawing methods.
2018-03-19 01:22:06 +11:00
Charles Dang
8396b535c8 GUI2/Window: draw background image first instead of last
Originally was going to do this as workaround for the background tiling over the borders,
but I fixed the root cause of that instead. Still, this just makes more sense.
2018-03-19 01:22:05 +11:00
Charles Dang
c8f36d2758 GUI2/Canvas: set clip rect when tiling images
This fixes an issue where images could be tiled outside their desired size area.
2018-03-19 01:22:04 +11:00
Charles Dang
af861f7292 Allowed IPFs to work again when using the texture cache
See create_texture_from_sub_file doc comment for more info.
2018-03-19 01:22:03 +11:00
Charles Dang
8a82d43855 Some initial code (disabled for now) for setting up an OGL context
In the interests of getting this all done faster, I've decided to postpone work on the OGL implementation for now
and focus on the SDL_Renderer version. This contains some basic code (include-guarded) for setting up an OGL context
for the main SDL window.
2018-03-19 01:22:01 +11:00
Charles Dang
61dcb43ee6 GUI2/Canvas: refactor surface use out of image rendering
The only real reason to keep using a surface was in order to have resize mode manipulations. I've now added
texture-only handling methods (the tiling one was borrowed from display.cpp's draw_background function).
2018-03-19 01:21:12 +11:00
Charles Dang
01d78cbb7f Trim ToD images to hex 2018-03-19 01:21:11 +11:00
Charles Dang
1cb496d966 Extended implementation of the texture cache
Instead of always loading a surface at the same time, textures are now loaded directly from disk if applicable.
Instead, surfaces are only loaded if applicable to apply some effect that cannot as of now be done with texture
manipulation since we dont have shader support yet.

In that vein, I've also added two new texture caches, one for masked-to-hex images and one for ToD colored images.
2018-03-19 01:21:10 +11:00
Charles Dang
250bb0b3af GUI2/Canvas: fixed mirrored images being flipped on the wrong axis. 2018-03-19 01:21:08 +11:00
Charles Dang
d748cbcd23 Units: fixed bad HP/XP bars fill rect offset 2018-03-19 01:21:07 +11:00
Charles Dang
37bcade3a1 Removed most call to raise_draw_event
These don't seem necessary anymore since draw handling happens per-frame and doesn't rely
on calling derived class's draw() member.
2018-03-19 01:21:06 +11:00
Charles Dang
d427bf1e65 Enabled more stuff drawing
Hex overlay, map items, fog/shroud transitions.
2018-03-19 01:21:05 +11:00
Charles Dang
643ebe221f Got a bunch more components drawing
Reachmaps, attack indicators, shroud/fog (incomplete).
2018-03-19 01:21:04 +11:00
Charles Dang
66f2d3f49c Video: removed unused arguments from make_test_fake 2018-03-19 01:21:03 +11:00
Charles Dang
e205e42d44 Video: (almost) completely removed framebuffer surface
Again, useless since there's no more window surface with accelerated rendering.
getSurface() remains since it's still used in quite a lot of places. Will removed ASAP.
2018-03-19 01:21:01 +11:00
Charles Dang
ea395c1fb5 Removed draw() calls into the display class
Not needed anymore since per-frame drawing is handled within said class.
2018-03-19 01:17:07 +11:00
Charles Dang
42894f6ac3 Another huge chunk of progress 2018-03-19 01:17:05 +11:00
Charles Dang
d614c71786 Uint: fixed bad bar alpha on unit mouseover 2018-03-19 01:16:30 +11:00
Charles Dang
b8a03da847 Fixed play_controller not joining current event context
Was broken when I moved the GUI2 drawing trigger code to global scope probably.
2018-03-19 01:16:29 +11:00
Charles Dang
ba9a0f7550 GUI2/Canvas: made use of CVideo::render_copy 2018-03-19 01:16:28 +11:00
Charles Dang
6fbc2491ea Video: expand render_copy to take flip arguments
Still needs to handle rotation.
2018-03-19 01:16:24 +11:00
Charles Dang
6fdf1bcc88 Draw units under bars/orbs/etc 2018-03-19 01:16:03 +11:00
Charles Dang
c52a2a1b75 GUI2: moved event handling into main context
Not sure why I need to call join() in connect() instead of the ctor, though.
2018-03-19 01:16:02 +11:00
Charles Dang
d2087a14c4 Initial refactor for main-screen accelerated rendering 2018-03-19 01:16:01 +11:00
Charles Dang
8dc661db40 Decoupled drawing buffer code from display class 2018-03-19 01:14:02 +11:00
Charles Dang
e30a2aa520 Added static prototype for GUI2 in-game theme 2018-03-19 01:14:00 +11:00
Charles Dang
758ad0bf23 GUI2/Miniap: draw any provided canvas data before the minimap 2018-03-19 01:13:59 +11:00
Charles Dang
441ec38adf Moved GUI2's per-frame drawing trigger to global scope
This is derived from work originally done by @aginor (48bcb277d4). I cherry-picked that commit and made a few alterations.
2018-03-19 01:13:58 +11:00
Charles Dang
eaac01c9a2 Enabled drawing of minimap in-game 2018-03-19 01:13:56 +11:00
Charles Dang
e7d1c970bc GUI2/Canvas: disable surface manip w/ accelerated rendering for stretch resize mode
RenderCopy handles that automatically.
2018-03-19 01:13:55 +11:00
Charles Dang
2d39d19af9 Texture: converted internal handling to use a shared_ptr
This allows multiple texture objects to refer to the same texture without destroying them prematurely.
This is different from the SDL_Surface wrapper's implementation since surfaces have their own internal
refcounting system; textures do not.
2018-03-19 01:13:54 +11:00
Charles Dang
3e2046b5d8 Added a texture cache
Note this probably doesn't work properly yet since I haven't properly implemented shared management
of textures in their wrapper class.
2018-03-19 01:13:53 +11:00
Charles Dang
da7917955b Use get_renderer() over *get_window()
This doesn't appear to have been an issue in the rectangle drawing code at least, but it should guard
against possible segfaults in the future.
2018-03-19 01:13:52 +11:00
Charles Dang
4a0f8d9db0 CVideo: convert blit_surface to handle input as textures instead of blitting to framebuffer 2018-03-19 01:13:51 +11:00
Charles Dang
81a62bf49c Moved renderer RAII helpers to their own file and added ones for clip rect and viewport
Do note that setting an empty rect in render_raii_rect_setter_base is not the same as passing nullptr.
If an empty rect is passed to SDL_RenderGetClipRect, for example, you can end up with nothing drawing
since everything is being clipped.
2018-03-19 01:13:49 +11:00
Charles Dang
a710d6d457 GUI2/Minimap: quick fix to get the minimap drawing again 2018-03-19 01:13:48 +11:00
Charles Dang
56a793c086 Added SDL_Texture wrapper class and some utility functions 2018-03-19 01:13:47 +11:00
Charles Dang
5c430f6096 GUI2/Canvas: add error logging if canvas texture creation fails 2018-03-19 01:13:46 +11:00
Charles Dang
894e9b6b3e Small code simplification 2018-03-19 01:13:44 +11:00
Charles Dang
aa2f266e87 GUI2/Canvas: removed surface_lock objects
The canvas surface isn't even passed to these functions anymore so I have no idea how this built.
2018-03-19 01:13:43 +11:00
Charles Dang
94f9303bde Removed some debug output
[ci skip]
2018-03-19 01:13:42 +11:00
Charles Dang
48d072a02e GUI2: refactored viewport setting and re-added clip rect setting
It turns out I had removed the clip rect setting in error; it prevented items in, say, a listbox from drawing
outside the widget's boundaries. I've re-added that now.

I've also moved viewport setting to the same place. It turns out it didn't need to be set every canvas draw.
The only reason the old code was passing the blitting rect to the canvas was it was needed for the sdl_blit call.
Since I can now set the viewport independent of a canvas state, there's no longer a need to set the viewport in
the canvas.
2018-03-19 01:13:41 +11:00
Charles Dang
78271d2302 Hack to get text to render right 2018-03-19 01:13:40 +11:00
Charles Dang
eb671aec48 GUI2: removed framebuffer code from draw impl functions 2018-03-19 01:13:38 +11:00
Charles Dang
c926ce76e0 GUI2/Canvas: renamed blit function and removed surface argument 2018-03-19 01:13:37 +11:00
Charles Dang
c6ed3f018e GUI2: removed dirty widget interface
This is no longer needed since we redraw everything every frame. The dirty flag in the canvas remains
as that controls whether the cached texture is used or recreated.
2018-03-19 01:13:36 +11:00
Charles Dang
7632004979 GUI2/Modal Dialog: removed set_restore interface
This was used to set the restore argument of gui2:🪟:show. It's not needed anymore
since the window class no longer uses surface restoring.
2018-03-19 01:13:34 +11:00
Charles Dang
ec2913ab3c GUI2/Window: removed restore flag and restorer surface 2018-03-19 01:13:33 +11:00
Charles Dang
4e2b34a5f2 GUI2/Window: re-implement drawing and removed commented-out restore code
We don't need all this dirty list or handling or surface restoration anymore.
2018-03-19 01:13:24 +11:00
Charles Dang
41f921bd38 GUI2/Canvas: refactor surface blitting out of drawing routines
This entirely refactors surface blitting out of the canvas. Instead, each canvas owns a texture. This texture
is completely redrawn any time the canvas if marked dirty, else the result is cached and drawn to the screen
each draw cycle.

All windows are now redrawn every draw cycle. The use of the cached canvas textures means there's no noticeable
performance difference (likely a performance gain, actually) from using surface blitting.

There's still some code to clean up and a few things to fix.
2018-03-19 01:13:23 +11:00
Charles Dang
1a24fd5872 Video: enabled accelerated rendering with texture target access 2018-03-19 01:13:21 +11:00
Charles Dang
e558044855 SDL/Window: set render scaling method to linear
This looks better than NN scaling (default);
2018-03-19 01:13:20 +11:00
Charles Dang
aa09dec0f3 Cleaned up one remaining use of HAVE_CXX14 and removed the macro altogether 2018-03-19 00:25:02 +11:00
Charles Dang
c1fcba17b7 Removed the type trait alias wrappers
This completely removes the wrappers for aliases included in c++14. It also enables
use of the value alias wrappers, since we now have variable templates.
2018-03-19 00:25:00 +11:00
Charles Dang
a57192db28 Removed HAVE_REF_QUALIFERS, HAVE_INHERITING_CTORS, and USE_HETEROGENOUS_LOOKUPS
Any code guarded by the first or last is now enabled by default. The second was unused.
2018-03-19 00:24:59 +11:00
Charles Dang
80c2d1a405 Used std::put time everywhere
The utils::put_time wrapper was only for GCC 4.x.
2018-03-19 00:24:58 +11:00
Charles Dang
8120843b2e Used constexpr and noexcept keywords directly
We can do this now since were bumping min compiler support.
2018-03-19 00:24:57 +11:00
ln-zookeeper
3cea4790b8 UtBS: Corrected Sun Singer movetype from float to foot 2018-03-18 14:30:02 +02:00
Jyrki Vesterinen
3555b6278c Update Visual Studio project file to VS2015 toolset
I also enabled /DEBUG:FASTLINK and /LTCG:incremental to speed up compile
times. VS2015 introduces support for both switches.
2018-03-18 11:57:14 +02:00
Charles Dang
0094a19e85 Post-release version bump
The stable 1.14 branch has now diverged, and master is back in development mode for
the 1.15 series. Therefor, bumping to 1.15.0-dev here on master.
2018-03-18 18:51:11 +11:00
3986 changed files with 214064 additions and 255028 deletions

View file

@ -1,29 +0,0 @@
version: Wesnoth-VS2013-{branch}-{build}
clone_folder: C:\projects\wesnoth
image: Visual Studio 2013
configuration:
- Release
- Debug
platform: win32
skip_branch_with_pr: true
shallow_clone: true
matrix:
fast_finish: true # Stop after a build failure
before_build:
- cd ..
- ps: wget https://github.com/aquileia/external/archive/VC12.zip -O VC12.zip
- 7z x VC12.ZIP
- ren external-VC12 external
- cd wesnoth
- set PATH=C:\projects\external\dll;%PATH%
notifications:
- provider: Webhook
url: http://ai0867.net:6661/wesnoth
headers:
User-Agent: WesnothAppveyor/1.0
Version: vs2013
Num-Versions: 3
Authorization: TODO
on_build_success: true
on_build_failure: true

View file

@ -15,11 +15,6 @@ before_build:
- 7z x VC14.ZIP
- ren external-VC14 external
- cd wesnoth
- mkdir projectfiles\VC14
- xcopy /E /I /H /Y projectfiles\VC12 projectfiles\VC14
- cd projectfiles\VC14
- "\"c:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\devenv.exe\" wesnoth.sln /upgrade"
- cd ..\..
- set PATH=C:\projects\external\dll;%PATH%
build_script:
- msbuild projectfiles\VC14\wesnoth.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

View file

@ -17,7 +17,7 @@ before_build:
- cd wesnoth
- set PATH=C:\projects\external\dll;%PATH%
build_script:
- msbuild projectfiles\VC12\wesnoth.sln /property:PlatformToolset=v141 /m /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- msbuild projectfiles\VC14\wesnoth.sln /property:PlatformToolset=v141 /m /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
artifacts:
- path: wesnoth.exe

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
.git

3
.gitignore vendored
View file

@ -49,7 +49,7 @@ projectfiles/**/*objs*
# Visual Studio
projectfiles/VC*
!projectfiles/VC12
!projectfiles/VC14
projectfiles/VC*/.vs/
projectfiles/VC*/*.vc.*db
projectfiles/VC*/*.sdf
@ -186,6 +186,7 @@ data/campaigns/**/images/**/.gitignore
[Tt]humbs.db
*Neuer Ordner*
.directory
fonts/.uuid
# extensions
*.pyc

View file

@ -11,31 +11,30 @@ cache:
matrix:
include:
- compiler: clang
env: TOOL=scons CXXSTD=11 NLS=true
- compiler: gcc
env: CXXSTD=14 NLS=true LTS=1604 BRANCH=master
- compiler: gcc
env: TOOL=scons CXXSTD=14 NLS=false
env: TOOL=scons CXXSTD=17 NLS=false LTS=1804 BRANCH=master
- compiler: gcc
env: TOOL=scons CXXSTD=11 NLS=false OPT=-O0
env: TOOL=scons CXXSTD=14 NLS=false LTS=1604 BRANCH=master OPT=-O0
- compiler: gcc
env: TOOL=cmake CXXSTD=11 NLS=false
env: TOOL=cmake CXXSTD=14 NLS=false LTS=1604 BRANCH=master
- compiler: clang
env: TOOL=scons CXXSTD=11 NLS=false OPT=-O0
env: TOOL=scons CXXSTD=14 NLS=false LTS=1604 BRANCH=master OPT=-O0
- compiler: clang
env: TOOL=cmake CXXSTD=11 NLS=false
env: TOOL=cmake CXXSTD=14 NLS=false LTS=1604 BRANCH=master
- os: osx
compiler: clang
env: TOOL=scons CXXSTD=11 NLS=false OPT=-O0
env: TOOL=scons CXXSTD=14 NLS=false OPT=-O0
- os: osx
compiler: clang
osx_image: xcode9.2
env: TOOL=xcodebuild
install:

View file

@ -1,4 +1,4 @@

# set minimum version
cmake_minimum_required(VERSION 2.8.5)
@ -56,26 +56,20 @@ option(ENABLE_SERVER "Enable compilation of MP server" ON)
option(ENABLE_MYSQL "Enable building MP/add-ons servers with mysql support" OFF)
option(ENABLE_TESTS "Build unit tests")
option(ENABLE_NLS "Enable building of translations" ${ENABLE_GAME})
option(ENABLE_OMP "Enables OpenMP, and has additional dependencies" OFF)
option(ENABLE_LIBPNG "Enable support for writing png files (screenshots, images)" ON)
option(ENABLE_HISTORY "Enable using GNU history for history in lua console" ON)
if(NOT CMAKE_CROSSCOMPILING)
try_run(IEEE754_TEST_RETURN_CODE IEEE754_TEST_COMPILED ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src/compile_time_tests/ieee_754.cpp
CMAKE_FLAGS "-DCMAKE_CXX_STANDARD=11" COMPILE_OUTPUT_VARIABLE IEEE754_TEST_COMPILE_OUTPUT)
if(NOT IEEE754_TEST_COMPILED)
message(WARNING "Failed to compile the IEEE 754 test. Skipping it.")
message(${IEEE754_TEST_COMPILE_OUTPUT})
elseif(NOT IEEE754_TEST_RETURN_CODE EQUAL 0)
message(FATAL_ERROR "Your platform does not represent floating point numbers in the IEEE 754 format.")
endif()
else()
message(WARNING "You are cross-compiling. Skipping IEEE 754 test.")
# set what std version to use
if(NOT CXX_STD)
set(CXX_STD "14")
endif()
find_package(SDL2 2.0.4 REQUIRED)
if(ENABLE_GAME OR ENABLE_TESTS)
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(SDL2 2.0.4 REQUIRED)
endif(ENABLE_GAME OR ENABLE_TESTS)
find_package(Crypto 1.0 REQUIRED)
find_package(Boost 1.56 REQUIRED COMPONENTS iostreams program_options regex system thread random)
find_package(Boost 1.56 REQUIRED COMPONENTS iostreams program_options regex system random)
# no, gettext executables are not required when NLS is deactivated
find_package(Gettext)
@ -152,6 +146,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
option(ENABLE_APPDATA_FILE "enable installation of an appdata file for appstream" ON)
endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
option(HARDEN "Whether to enable options to harden the executables" ON)
option(ENABLE_STRICT_COMPILATION "Sets the strict compilation mode" OFF)
option(ENABLE_PEDANTIC_COMPILATION "Sets the pedantic compilation mode" OFF)
option(ENABLE_DEBUG_WINDOW_LAYOUT "Add the debug option to allow the generation of debug layout files in dot format" OFF)
@ -199,7 +194,7 @@ if(NOT DEFINED CXX_FLAGS_USER)
endif(NOT DEFINED CXX_FLAGS_USER)
set(COMPILER_FLAGS "-std=c++11 -Wall -Wextra -Werror=non-virtual-dtor -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wold-style-cast")
set(COMPILER_FLAGS "-std=c++${CXX_STD} -Wall -Wextra -Werror=non-virtual-dtor -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wold-style-cast -Wtrampolines")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Qunused-arguments -Wno-unknown-warning-option -Wmismatched-tags -Wno-conditional-uninitialized")
@ -225,6 +220,14 @@ if(ENABLE_PEDANTIC_COMPILATION)
endif(ENABLE_PEDANTIC_COMPILATION)
# check for sanitizer options
if(SANITIZE)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fsanitize=${SANITIZE}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${SANITIZE}")
# manually disable some optimizations to get better stacktraces if sanitizers are used
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fno-omit-frame-pointer -fno-optimize-sibling-calls")
endif(SANITIZE)
### Set the final compiler flags.
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${CXX_FLAGS_USER}")
@ -240,6 +243,51 @@ if(NOT "${CMAKE_CXX_FLAGS}" STREQUAL "${COMPILER_FLAGS}")
)
endif(NOT "${CMAKE_CXX_FLAGS}" STREQUAL "${COMPILER_FLAGS}")
# #
# Determine optimization level
# #
if(NOT OPT)
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_DEBUG "-O0")
set(CMAKE_C_FLAGS_DEBUG "-O0")
if(PROFILER STREQUAL "perf")
set(CMAKE_CXX_FLAGS_PROFILE "-Og")
set(CMAKE_C_FLAGS_PROFILE "-Og")
else(PROFILER STREQUAL "perf")
set(CMAKE_CXX_FLAGS_PROFILE "-O0")
set(CMAKE_C_FLAGS_PROFILE "-O0")
endif(PROFILER STREQUAL "perf")
else(NOT OPT)
set(CMAKE_CXX_FLAGS_RELEASE "${OPT}")
set(CMAKE_C_FLAGS_RELEASE "${OPT}")
set(CMAKE_CXX_FLAGS_DEBUG "${OPT}")
set(CMAKE_C_FLAGS_DEBUG "${OPT}")
set(CMAKE_CXX_FLAGS_PROFILE "${OPT}")
set(CMAKE_C_FLAGS_PROFILE "${OPT}")
endif(NOT OPT)
# check for hardening options
if(HARDEN AND NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE -fstack-protector-strong")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE -fstack-protector-strong")
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIE -Wl,-pie")
else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIE -pie -Wl,-z,relro,-z,now")
endif()
if(NOT CMAKE_CXX_FLAGS_DEBUG STREQUAL "-O0")
add_definitions(-D_FORTIFY_SOURCE=2)
endif()
endif(HARDEN AND NOT WIN32)
if(UNIX AND NOT CMAKE_COMPILER_IS_GNUCXX)
# Assume the compiler is the clang compiler.
set(CMAKE_EXE_LINKER_FLAGS "-lstdc++ -lm ${CMAKE_EXE_LINKER_FLAGS}")
@ -270,9 +318,9 @@ RemoveFlag(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS SCRIPT "-rdynamic" "")
# #
# reset the base Release build option
MESSAGE("Replacing default flags used for Release build with -O3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_RELEASE}" CACHE STRING "Release build flags" FORCE)
set(CMAKE_C_FLAGS_RELEASE "-O3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_RELEASE}" CACHE STRING "Release build flags" FORCE)
MESSAGE("Replacing default flags used for Release build with ${OPT} ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_RELEASE}" CACHE STRING "Release build flags" FORCE)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_RELEASE}" CACHE STRING "Release build flags" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "" CACHE STRING "" FORCE)
# set the arch to use for Release build if provided
if(ARCH)
@ -369,9 +417,9 @@ set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_SOURCE_
# replace the default Debug flag of -g with -O0 -DDEBUG -ggdb3
# this matches the flags of scons' debug build
MESSAGE("Replacing flags used for Debug build -O0 -DDEBUG -ggdb3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -DDEBUG -ggdb3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_DEBUG}" CACHE STRING "change cmake's Debug flags to match scons' flags" FORCE)
set(CMAKE_C_FLAGS_DEBUG "-O0 -DDEBUG -ggdb3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_DEBUG}" CACHE STRING "change cmake's Debug flags to match scons' flags" FORCE)
MESSAGE("Replacing flags used for Debug build ${OPT} -DDEBUG -ggdb3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -ggdb3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_DEBUG}" CACHE STRING "change cmake's Debug flags to match scons' flags" FORCE)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG -ggdb3 ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_DEBUG}" CACHE STRING "change cmake's Debug flags to match scons' flags" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${LINK_EXTRA_FLAGS_CONFIG} ${LINK_EXTRA_FLAGS_DEBUG}" CACHE STRING "" FORCE)
# adds GLIBCXX_DEBUG definitions
@ -388,29 +436,29 @@ endif(GLIBCXX_DEBUG)
if(PROFILER STREQUAL "gprof" OR NOT PROFILER)
MESSAGE("Profiler is gprof")
set(CMAKE_CXX_FLAGS_PROFILE "-pg ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gprof" FORCE)
set(CMAKE_C_FLAGS_PROFILE "-pg ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gprof" FORCE)
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE} -pg ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gprof" FORCE)
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} -pg ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gprof" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${LINK_EXTRA_FLAGS_CONFIG} ${LINK_EXTRA_FLAGS_PROFILE}" CACHE STRING "" FORCE)
endif()
if(PROFILER STREQUAL "gcov")
MESSAGE("Profiler is gcov")
set(CMAKE_CXX_FLAGS_PROFILE "-fprofile-arcs -ftest-coverage ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gcov" FORCE)
set(CMAKE_C_FLAGS_PROFILE "-fprofile-arcs -ftest-coverage ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gcov" FORCE)
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE} -fprofile-arcs -ftest-coverage ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gcov" FORCE)
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} -fprofile-arcs -ftest-coverage ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gcov" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${LINK_EXTRA_FLAGS_CONFIG} ${LINK_EXTRA_FLAGS_PROFILE}" CACHE STRING "" FORCE)
endif()
if(PROFILER STREQUAL "gperftools")
MESSAGE("Profiler is gperftools")
set(CMAKE_CXX_FLAGS_PROFILE "${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gperftools" FORCE)
set(CMAKE_C_FLAGS_PROFILE "${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gperftools" FORCE)
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE} ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gperftools" FORCE)
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with gperftools" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "-Wl,--no-as-needed,-lprofiler ${LINK_EXTRA_FLAGS_CONFIG} ${LINK_EXTRA_FLAGS_PROFILE}" CACHE STRING "" FORCE)
endif()
if(PROFILER STREQUAL "perf")
MESSAGE("Profiler is perf")
set(CMAKE_CXX_FLAGS_PROFILE "-ggdb -Og ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with perf" FORCE)
set(CMAKE_C_FLAGS_PROFILE "-ggdb -Og ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with perf" FORCE)
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE} -ggdb ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with perf" FORCE)
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} -ggdb ${EXTRA_FLAGS_CONFIG} ${EXTRA_FLAGS_PROFILE}" CACHE STRING "Flags for profiling with perf" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${LINK_EXTRA_FLAGS_CONFIG} ${LINK_EXTRA_FLAGS_PROFILE}" CACHE STRING "" FORCE)
endif()
@ -443,12 +491,6 @@ if(DEFAULT_PREFS_FILE)
endif(NOT DEFAULT_PREFS_FILE MATCHES "^/")
endif(DEFAULT_PREFS_FILE)
if(ENABLE_OMP)
find_package(OpenMP REQUIRED)
set(CMAKE_C_FLAGS "${OpenMP_C_FLAGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_C_FLAGS}")
endif(ENABLE_OMP)
if(ENABLE_DEBUG_WINDOW_LAYOUT)
add_definitions(-DDEBUG_WINDOW_LAYOUT_GRAPHS)
endif(ENABLE_DEBUG_WINDOW_LAYOUT)
@ -463,7 +505,6 @@ endif(ENABLE_GAME OR ENABLE_TESTS)
if(ENABLE_GAME OR ENABLE_TESTS)
find_package( SDL2_mixer 2.0.0 REQUIRED )
find_package( SDL2_ttf 2.0.12 REQUIRED )
find_package(VorbisFile REQUIRED)
find_package( PkgConfig REQUIRED )
pkg_check_modules( CAIRO REQUIRED cairo>=1.10 )
@ -497,13 +538,6 @@ if(ENABLE_GAME)
unset(LIBDBUS_FOUND CACHE)
endif()
find_package( PNG )
if(ENABLE_LIBPNG AND PNG_FOUND)
add_definitions(-DHAVE_LIBPNG)
else(ENABLE_LIBPNG AND PNG_FOUND)
message("Could not find lib PNG. Disabling support for writing PNG images.")
endif(ENABLE_LIBPNG AND PNG_FOUND)
find_package( History )
if(ENABLE_HISTORY AND HISTORY_FOUND)
add_definitions(-DHAVE_HISTORY)
@ -520,9 +554,11 @@ if(ENABLE_POT_UPDATE_TARGET)
endif(ENABLE_POT_UPDATE_TARGET)
# get languages
file(READ po/LINGUAS LINGUAS)
string(REPLACE "\n" "" LINGUAS ${LINGUAS})
separate_arguments(LINGUAS)
if(ENABLE_NLS)
file(READ po/LINGUAS LINGUAS)
string(REPLACE "\n" "" LINGUAS ${LINGUAS})
separate_arguments(LINGUAS)
endif(ENABLE_NLS)
#
# Include subdirectories

View file

@ -38,7 +38,7 @@ PROJECT_NAME = "The Battle for Wesnoth"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 1.13.12
PROJECT_NUMBER = 1.15.0-dev
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View file

@ -10,8 +10,8 @@ Contents
## 1. Prerequisites
Wesnoth requires a compiler with sufficient C++11 support such as GCC 4.8 and
later, or Clang 3.3 and later.
Wesnoth requires a compiler with sufficient C++14 support such as GCC 5.0 and
later, or Clang 3.8 and later.
You'll need to have these libraries and their development headers installed in
order to build Wesnoth:
@ -30,7 +30,6 @@ order to build Wesnoth:
* SDL2 >= 2.0.4
* SDL2_image >= 2.0.0 (with PNG and JPEG support)
* SDL2_mixer >= 2.0.0 (with Ogg Vorbis support)
* SDL2_ttf >= 2.0.12
* Fontconfig >= 2.4.1
* Cairo >= 1.10.0
* Pango >= 1.22.0 (with Cairo backend)
@ -52,17 +51,11 @@ features:
Bidirectional text support for RTL languages (Hebrew, etc.) in some parts
of the user interface.
* Growl
Desktop notifications on OS X, particularly on 10.7.
Although not recommended, you may use libintl on platforms other than Windows
instead of Boost.Locale. For scons, set the `libintl` option to `true`.
## 2. Build Environment
You can obtain the source code tarball for the latest version from
<http://www.wesnoth.org/downloads>.
<https://www.wesnoth.org/downloads>.
Before building, make sure to untar the package and change into the newly
created directory:
@ -79,7 +72,7 @@ The following build systems are fully supported for compiling Wesnoth on Linux,
*BSD, and other Unix-like platforms:
* SCons >= 0.98.3
* CMake >= 2.6.0
* CMake >= 2.8.5
You will also need to have a working installation of GNU gettext to build the
translations.
@ -182,13 +175,10 @@ Some of the most important options follow.
CMAKE_BUILD_TYPE=<build type> (CMake)
Selects a specific build configuration when compiling. `release` produces
the default, optimized (-O2) build for regular use. `debug` produces a
the default, optimized (-O3) build for regular use. `debug` produces a
slower and larger unoptimized (-O0) build with full debug symbols, which is
often needed for obtaining detailed backtraces when reporting bugs.
NOTE: By default, CMake will produce `debug` builds unless a different
configuration option is passed in the command line.
* ENABLE_GAME=<boolean> (CMake)
Whether to build the game client binary. Use command line target selection

View file

@ -23,7 +23,7 @@ Please see the wiki for information regarding The Battle for Wesnoth's licensing
Installing
----------
See INSTALL for instructions on how to build the game from source code.
See INSTALL.md for instructions on how to build the game from source code.
More Information

View file

@ -69,6 +69,5 @@ KNOWN BUGS
[list]
[*]Trackpad tap clicking is sometimes not recognized ([url=http://forums.wesnoth.org/viewtopic.php?f=4&t=39788]forum post[/url]).
[*]Unofficial builds with OpenMP support enabled randomly freeze (bug [issue]1260[/issue]).
[/list]
[/raissue]

View file

@ -55,6 +55,8 @@ opts.AddVariables(
('extra_flags_profile', 'Extra compiler and linker flags to use for profile builds', ""),
BoolVariable('enable_lto', 'Whether to enable Link Time Optimization for build=release', False),
('arch', 'What -march option to use for build=release, will default to pentiumpro on Windows', ""),
('opt', 'override for the build\'s optimization level', ""),
BoolVariable('harden', 'Whether to enable options to harden the executables', True),
BoolVariable('glibcxx_debug', 'Whether to define _GLIBCXX_DEBUG and _GLIBCXX_DEBUG_PEDANTIC for build=debug', False),
EnumVariable('profiler', 'profiler to be used for build=profile', "gprof", ["gprof", "gcov", "gperftools", "perf"]),
EnumVariable('pgo_data', 'whether to generate profiling data for PGO, or use existing profiling data', "", ["", "generate", "use"]),
@ -79,7 +81,6 @@ opts.AddVariables(
PathVariable('python_site_packages_dir', 'sets the directory where python modules are installed', "lib/python/site-packages/wesnoth", PathVariable.PathAccept),
BoolVariable('notifications', 'Enable support for desktop notifications', True),
BoolVariable('nls','enable compile/install of gettext message catalogs',True),
BoolVariable('png', 'Clear to disable writing png files for screenshots, images', True),
PathVariable('prefix', 'autotools-style installation prefix', "/usr/local", PathVariable.PathAccept),
PathVariable('prefsdir', 'user preferences directory', "", PathVariable.PathAccept),
PathVariable('default_prefs_file', 'default preferences file name', "", PathVariable.PathAccept),
@ -108,8 +109,7 @@ opts.AddVariables(
BoolVariable('ccache', "Use ccache", False),
('ctool', 'Set c compiler command if not using standard compiler.'),
('cxxtool', 'Set c++ compiler command if not using standard compiler.'),
EnumVariable('cxx_std', 'Target c++ std version', '11', ['11', '1y', '14']),
BoolVariable('openmp', 'Enable openmp use.', False),
EnumVariable('cxx_std', 'Target c++ std version', '14', ['14', '17']),
('sanitize', 'Enable clang and GCC sanitizer functionality. A comma separated list of sanitize suboptions must be passed as value.', ''),
BoolVariable("fast", "Make scons faster at cost of less precise dependency tracking.", False),
BoolVariable("lockfile", "Create a lockfile to prevent multiple instances of scons from being run at the same time on this working copy.", False),
@ -182,6 +182,9 @@ if env['ccache']: env.Tool('ccache')
boost_version = '1.56.0'
def SortHelpText(a, b):
return (a > b) - (a < b)
Help("""Arguments may be a mixture of switches and targets in any order.
Switches apply to the entire build regardless of where they are in the order.
Important switches include:
@ -232,7 +235,7 @@ specifying --option-cache=FILE command line argument. Current option values can
If you set CXXFLAGS and/or LDFLAGS in the environment, the values will
be appended to the appropriate variables within scons.
""" + opts.GenerateHelpText(env))
""" + opts.GenerateHelpText(env, sort=SortHelpText))
if GetOption("help"):
Return()
@ -305,7 +308,7 @@ def Warning(message):
from metasconf import init_metasconf
configure_args = dict(
custom_tests = init_metasconf(env, ["ieee_754", "cplusplus", "python_devel", "sdl", "boost", "cairo", "pango", "pkgconfig", "gettext_tool", "lua"]),
custom_tests = init_metasconf(env, ["cplusplus", "python_devel", "sdl", "boost", "cairo", "pango", "pkgconfig", "gettext_tool", "lua", "gl"]),
config_h = "$build_dir/config.h",
log_file="$build_dir/config.log", conf_dir="$build_dir/sconf_temp")
@ -335,13 +338,6 @@ if env["prereqs"]:
conf.CheckLib("m")
conf.CheckFunc("round")
def CheckIEEE754(conf):
if not env["host"]:
return conf.CheckIEEE754()
else:
Warning("You are cross-compiling. Skipping IEEE 754 test.")
return True
def CheckAsio(conf):
if env["PLATFORM"] == 'win32':
conf.env.Append(LIBS = ["libws2_32"])
@ -355,12 +351,13 @@ if env["prereqs"]:
def have_sdl_other():
return \
conf.CheckSDL(require_version = '2.0.4') & \
conf.CheckSDL("SDL2_ttf", header_file = "SDL_ttf") & \
conf.CheckSDL("SDL2_mixer", header_file = "SDL_mixer") & \
conf.CheckSDL("SDL2_image", header_file = "SDL_image")
if sys.platform == "msys":
env["PKG_CONFIG_FLAGS"] = "--dont-define-prefix"
have_server_prereqs = (\
CheckIEEE754(conf) & \
conf.CheckCPlusPlus(gcc_version = "4.8") & \
conf.CheckLib("libcrypto") & \
conf.CheckBoost("iostreams", require_version = boost_version) & \
@ -368,9 +365,9 @@ if env["prereqs"]:
conf.CheckBoostIostreamsBZip2() & \
conf.CheckBoost("random", require_version = boost_version) & \
conf.CheckBoost("smart_ptr", header_only = True) & \
CheckAsio(conf) & \
conf.CheckBoost("thread") & \
conf.CheckBoost("locale") & \
CheckAsio(conf) & \
conf.CheckBoost("thread", require_version = boost_version) & \
conf.CheckBoost("filesystem") \
and Info("Base prerequisites are met")) \
or Warning("Base prerequisites are not met")
@ -378,6 +375,9 @@ if env["prereqs"]:
conf.CheckBoostLocaleBackends(["icu", "winapi"]) \
or Warning("Only icu and winapi backends of Boost Locale are supported. Bugs/crashes are very likely with other backends")
if env['harden']:
env["have_fortify"] = conf.CheckFortifySource()
env = conf.Finish()
client_env = env.Clone()
@ -387,6 +387,8 @@ if env["prereqs"]:
conf.CheckOgg())) & \
conf.CheckPNG() & \
conf.CheckJPG() & \
conf.CheckOpenGL() and \
conf.CheckGLEW() and \
conf.CheckCairo(min_version = "1.10") & \
conf.CheckPango("cairo", require_version = "1.22.0") & \
conf.CheckPKG("fontconfig") & \
@ -407,10 +409,6 @@ if env["prereqs"]:
if client_env['fribidi']:
client_env.Append(CPPDEFINES = ["HAVE_FRIBIDI"])
env["png"] = env["png"] and conf.CheckLib("png")
if env["png"]:
client_env.Append(CPPDEFINES = ["HAVE_LIBPNG"])
env["history"] = env["history"] and (conf.CheckLib("history") or Warning("Can't find GNU history, disabling history support."))
if env["history"]:
client_env.Append(CPPDEFINES = ["HAVE_HISTORY"])
@ -473,10 +471,7 @@ for env in [test_env, client_env, env]:
env.AppendUnique(CXXFLAGS = Split("-Wdocumentation -Wno-documentation-deprecated-sync"))
if "gcc" in env["TOOLS"]:
if env['openmp']:
env.AppendUnique(CXXFLAGS = ["-fopenmp"], LIBS = ["gomp"])
env.AppendUnique(CCFLAGS = Split("-Wno-unused-local-typedefs -Wno-maybe-uninitialized"))
env.AppendUnique(CCFLAGS = Split("-Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wtrampolines"))
env.AppendUnique(CXXFLAGS = Split("-Wold-style-cast"))
if env['strict']:
@ -486,12 +481,46 @@ for env in [test_env, client_env, env]:
env.AppendUnique(CXXFLAGS = Split("-Wctor-dtor-privacy -Wuseless-cast -Wnoexcept"))
if env['sanitize']:
env.AppendUnique(CCFLAGS = ["-fsanitize=" + env["sanitize"]], LINKFLAGS = ["-fsanitize=" + env["sanitize"]])
env.AppendUnique(CCFLAGS = Split("-fno-omit-frame-pointer -fno-optimize-sibling-calls"))
# #
# Determine optimization level
# #
if not env["opt"]:
if env["build"] == "release":
env["opt"] = "-O3 "
elif env["build"] == "profile" and env["profiler"] == "perf":
env["opt"] = "-Og "
else:
env["opt"] = "-O0 "
else:
env["opt"] = env["opt"]+" "
# #
# Add options to provide more hardened executables
# osx doesn't seem to support RELRO
# windows' tdm-gcc doesn't seem to provide good support for the hardening options in general
# #
if env['harden'] and env["PLATFORM"] != 'win32':
env.AppendUnique(CCFLAGS = ["-fPIE", "-fstack-protector-strong"])
if not env["have_fortify"] and "-O0" not in env["opt"]:
env.AppendUnique(CPPDEFINES = ["_FORTIFY_SOURCE=2"])
if env["enable_lto"] == True:
env.AppendUnique(LINKFLAGS = ["-fstack-protector-strong"])
if env["PLATFORM"] == 'darwin':
env.AppendUnique(LINKFLAGS = ["-fPIE", "-Wl,-pie"])
else:
env.AppendUnique(LINKFLAGS = ["-fPIE", "-pie", "-Wl,-z,relro,-z,now"])
# #
# Start determining options for debug build
# #
debug_flags = "-O0 -DDEBUG -ggdb3"
debug_flags = env["opt"]+"-DDEBUG -ggdb3"
if env["glibcxx_debug"] == True:
glibcxx_debug_flags = "_GLIBCXX_DEBUG _GLIBCXX_DEBUG_PEDANTIC"
@ -504,7 +533,7 @@ for env in [test_env, client_env, env]:
# #
# default compiler flags
rel_comp_flags = "-O3"
rel_comp_flags = env["opt"]
rel_link_flags = ""
# use the arch if provided, or if on Windows and no arch was passed in then default to pentiumpro
@ -543,25 +572,29 @@ for env in [test_env, client_env, env]:
rel_comp_flags = rel_comp_flags + " -flto=thin"
rel_link_flags = rel_comp_flags + " -fuse-ld=lld"
# Enable ASLR and NX bit support on mingw
if "mingw" in env["TOOLS"]:
rel_link_flags += "-Wl,--dynamicbase -Wl,--nxcompat"
# #
# End setting options for release build
# Start setting options for profile build
# #
if env["profiler"] == "gprof":
prof_comp_flags = "-pg"
prof_comp_flags = env["opt"]+"-pg"
prof_link_flags = "-pg"
if env["profiler"] == "gcov":
prof_comp_flags = "-fprofile-arcs -ftest-coverage"
prof_comp_flags = env["opt"]+"-fprofile-arcs -ftest-coverage"
prof_link_flags = "-fprofile-arcs"
if env["profiler"] == "gperftools":
prof_comp_flags = ""
prof_comp_flags = env["opt"]
prof_link_flags = "-Wl,--no-as-needed,-lprofiler"
if env["profiler"] == "perf":
prof_comp_flags = "-ggdb -Og"
prof_comp_flags = env["opt"]+"-ggdb"
prof_link_flags = ""
# #
@ -580,7 +613,7 @@ for env in [test_env, client_env, env]:
env[d] = os.path.join(env["prefix"], env[d])
if env["PLATFORM"] == 'win32':
env.Append(LIBS = ["wsock32", "iconv", "z", "shlwapi", "winmm"], CCFLAGS = ["-mthreads"], LINKFLAGS = ["-mthreads"], CPPDEFINES = ["_WIN32_WINNT=0x0501"])
env.Append(LIBS = ["wsock32", "iconv", "z", "shlwapi", "winmm", "ole32", "uuid"], CCFLAGS = ["-mthreads"], LINKFLAGS = ["-mthreads"], CPPDEFINES = ["_WIN32_WINNT=0x0601"])
if env["PLATFORM"] == 'darwin': # Mac OS X
env.Append(FRAMEWORKS = "Cocoa") # Cocoa GUI
@ -746,11 +779,11 @@ if 'dist' in COMMAND_LINE_TARGETS: # Speedup, the manifest is expensive
def dist_manifest():
"Get an argument list suitable for passing to a distribution archiver."
# Start by getting a list of all files under version control
lst = subprocess.check_output("git ls-files | grep -v 'data\/test\/.*' | awk '/^[^?]/ {print $4;}'", shell=True).split()
lst = subprocess.check_output("git ls-files", shell=True).splitlines()
lst = filter(os.path.isfile, lst)
return lst
dist_tarball = env.Tar('wesnoth-${version}.tar.bz2', [])
open("dist.manifest", "w").write("\n".join(dist_manifest() + ["src/revision.hpp"]))
open("dist.manifest", "w").write("\n".join(dist_manifest() + ["src/revision.h"]))
env.Append(TARFLAGS='-j -T dist.manifest --transform "s,^,wesnoth-$version/,"',
TARCOMSTR="Making distribution tarball...")
env.AlwaysBuild(dist_tarball)
@ -803,7 +836,6 @@ env.Alias("wesnoth-bundle",
Copy("${TARGET}/Contents/Resources/English.lproj", "projectfiles/Xcode/English.lproj"),
Copy("${TARGET}/Contents/Resources/fonts", "fonts"),
Copy("${TARGET}/Contents/Resources/fonts.conf", "projectfiles/Xcode/Resources/fonts.conf"),
Copy("${TARGET}/Contents/Resources/Growl Registration Ticket.growlRegDict", "projectfiles/Xcode/Resources/Growl Registration Ticket.growlRegDict"),
Copy("${TARGET}/Contents/Resources/icon.icns", "projectfiles/Xcode/Resources/icon.icns"),
Copy("${TARGET}/Contents/Resources/images", "images"),
Copy("${TARGET}/Contents/Resources/SDLMain.nib", "projectfiles/Xcode/Resources/SDLMain.nib"),

View file

@ -1,3 +1,524 @@
## Version 1.15.0-dev
### Campaigns
* A Tale of Two Brothers
* S2 'Chase': improved behavior of undead side leader with custom AI
### Engine
* Windows 7 is now the minimum supported Windows version.
* Removed incomplete joystick support.
* Removed map scaling algorithm customization. Nearest-neighbor scaling will now
always be used.
* Removed option to disable unit and item halos.
### Language and i18n
* Updated translations: British English, Bulgarian, Chinese (Simplified),
Chinese (Traditional), Czech, French, Galician, German, Hungarian, Italian,
Japanese, Polish, Scottish Gaelic, Slovak, Spanish, Ukrainian.
### Lua API
* Allow specifying custom flags (in particular teleport) when using a custom cost function in wesnoth.find_path
### Packaging
* OpenMP support has been removed. It is no longer an optional build-time dependency.
### Units
* Saurian warriors are now female. (issue #3392)
### WML engine
* Support formula= key in [variable] ConditionalWML
* Support to_location in [move_unit], taking a special location ID
* Support dir in [move_unit] to perform relative movements
* Support location_id in [teleport], [recall], [unstore_unit] for the target location
* Support a comma-separated list for location_id key in SLF
* Support [filter_weapon] in leadership and resistance abilities,
which activates the ability only when the affected unit is using
a matching weapon.
* Support [filter_second_weapon] in leadership and resistance abilities,
which activates the ability only when the affected unit's opponent
is using a matching weapon.
* Support WFL and percentages in [random_placement]num_items=
* Support [or] in [filter_wml] and similar places
* Support globbing in [filter_wml] via glob_on_* keys
* Add trunc as a valid value for [set_variable]round=
* Remove support for speaker=id in SUF (but retain in [message])
* Support saner units for some formatting options in [message]
* Support underline=yes|no in [message]
* Support [set_variable]root=cube and root=_integer_
* Support force_scroll in [move_units_fake] (default no)
* Support facing= in [role][auto_recall]
* Support lists for special and special_active in SWF
* Support usage and alignment in SUF
* Deprecate [replace_map]map= in favor of map_data=
* Add u and v variables in ~ADJUST_ALPHA() and ~CHAN()
* Add clear_shroud in [move_unit] to clear shroud as the unit moves
* Support male_voice and female_voice in [message]
* Support [break], [continue], and [return] in [random_placement]
* [remove_sound_source] now accepts a comma-separated ID list
* Support [filter_team] in [side] in addition to team_name=
## Version 1.14.4+dev
### AI
* Fixed crash in AI code when a side has multiple leaders.
* Fix AI ignoring teleport locations when moving leader to leader goals.
* Fast Micro AI: Fix bug crashing the AI when units with chance-to-hit
specials without id are on map.
### Campaigns
* Heir to the Throne:
* S6: Allow canceling an attack when a move+attack spawns enemy units (issue #3459).
* S6: Change the trigger for spawning undead reinforcements (issue #3459).
* S17: Add dialog explaining the lava game mechanic and an easter egg (issue #3473).
* Liberty:
* S3: Add story and war drums music.
* Northern Rebirth:
* S12: empty sides are hidden.
* S13: allied leaders whose death causes defeat won't leave their keep and
the lich brothers and Krash got more gold.
* Sceptre of Fire:
* S4: a cave entrance has been added.
* S5: Gryphon Riders are now available starting form S5 (formerly S3).
* S7: it's now impossible to kill all pursuers.
* Secrets of the Ancients:
* Fix dialog said by wrong unit & revert previous fix (issue #3294).
* The Hammer of Thursagan:
* S10: Fix objectives requiring too much of the player.
* The South Guard:
* S2: the case where Deoran is not sent to the Citadel is handled better.
* S2: enemy units will no longer neutralize villages instead of capturing or burning them.
This also means certain units will no longer be hidden in the Game Stats list.
* S4: bodyguards are never spawned next to other units, and always in forest.
* S5: zombies have now one castle with two leaders.
* S6a: mermen leave after this scenario and will no longer be available.
* S7a & S8a: a certain hero may now die.
* Tutorial:
* Added more information to the Status Table prompt about how to access it (issue #2883).
* Under the Burning Suns:
* New graphics for Eloh.
### Multiplayer
* A New Land: Fixed village gold being 1 instead of 2.
* Fixed Random Start Time not working (issue #3515).
* Fixed a possible crash when leaving a game as an observer (issue #3017).
* Fixed Start Game locked when other players abort the faction/leader selection
dialog (issue #3452).
* Fixed Skip Replay when joining MP campaigns.
* Fixed OOS errors when undoing after ally chat.
* Fixed game freezing upon droiding with Delayed Shroud Updates (issue #3453).
* Fixed require_scenario and require_era attributes.
### Language and i18n
* Updated translations: British English, Chinese (Traditional), Czech, French,
German, Hungarian, Italian, Japanese, Scottish Gaelic, Ukrainian.
### User Interface
* On laptop computers we now show how much battery you have left.
* MacOS: Fixed moving the mouse with a touchpad also scrolling GUI dialogs.
* MacOS: Add build number to OS version report.
* Fix layout of Preferences window with some localizations (such as Czech).
* Load Game now shows the chosen difficulty with the same name that you originally selected.
* Load Game now shows the modifications enabled in the selected savegame (issue #3495).
* Force leader sprites larger than 72x72 to be downscaled in Load Game (issue #3474).
* Add left padding to dialog messages shown with a portrait on the right (issue #1938).
* Addon Manager uses clearer terms for sort order.
* Fix reversed sort order by unit level in Unit List and Recall Unit.
* Fixed crash in Recall Unit when no units match the filter (issue #3475).
### WML engine
* Fixed [animate_unit] and [heal_unit] preventing unit halo from disappearing if the unit
dies later (issue #3509).
### Miscellaneous and bug fixes
* Fix some minor problems with the macOS package.
* Fixed crash when trying to attack with a unit without usable weapons (issue #3424).
* Fixed the debug mode Create Unit dialog crashing when changing the gender
of the previous selection after causing the list to come up empty using
the filter box.
* Allow searching by race and internal unit type id with the Create Unit
filter box as well.
* wmlxgettext is now included in release packages, so a separate download is no longer required to use it with GUI.pyw.
* Fixed crash when pressing Reset replay (issue #3439).
* Fixed editor cannot add starting location for > 9 players.
* Fixed crash in Lua tstring comparision (issue #3541).
* Fixed objectives at scenario start using old/cached values of conditions/variables (issue #3544).
* Show an error message when trying to open the Lua console while not in debug mode.
* On enemy side's turn, don't scroll to that side's leader if it's invisible.
* Fixed :droid ignoring its second argument.
* Fixed :droid giving no feedback when successful.
## Version 1.14.4
### Security Fixes
* Fixed Lua being able to escape sandboxing via load/loadstring (CVE-2018-1999023).
### Add-ons server
* Made it so plain-text .po catalogues in add-ons are detected and added to
the list of translations for them.
### Campaigns
* Dead Water:
* In 'Tirigaz', take the situation into account of orcs being killed either
first or by undead.
* Delfador's Memoirs:
* Fix hero units costing upkeep (issue #3277)
* Eastern Invasion:
* Fixed missing prisoners and loss of recallable units in 'Captured'.
* Northern Rebirth:
* Level 0 units are not available anymore after scenario 5
* Secrets of the Ancients:
* Adjust gender of enemies to better match story in S11 & 21 (issue #3294)
* Simplify dialog to fix possible confusion in S16 (issue #3291)
* Have nagas be able to recruit in S21 (issue #3293)
* The South Guard:
* S4: undead leader won't leave the castle anymore
* S5: the untypical situation that one can defeat the lich before finding
Urza Afalas is now handled
* Under the Burning Suns:
* S11: added custom graphics for the citadel.
* S12: clarified the alien bodies' weaknesses.
* Various visual improvements.
### Editor
* Fixed saving a map as a scenario not enabling scenario editor tools.
### Graphics
* New attack animation for the Peasant.
* Tweaked the Ruffian's attack animation timing.
### Language and i18n
* Updated translations: British English, Bulgarian, Chinese (Simplified),
Chinese (Traditional), Czech, French, German, Hungarian, Japanese,
Scottish Gaelic, Slovak, Spanish
### Lua API
* Upgrade to Lua 5.3.5.
### Multiplayer
* Non hosts can now change their faction in the mp wait dialog.
### Multiplayer server
* Fixed lobby and whisper messages not having a maximum length.
* Partly fixed the mp server breaking translatable strings.
### User interface
* Improved the layout of the Statistics dialog.
* Allow changing dropdown menu selections with the scrollwheel (FR #3251).
* Fixed lobby chat box scrolling to top on a new message if it isn't at the
bottom (issue #2789).
* Fixed the unit preview pane not showing the default race icon when detailing
a single unit's stats.
* Sort units secondarily by XP in the unit list dialog.
* Whiteboard related bugfixes
### WML engine
* Fixed errors about WESNOTH_VERSION not being defined when trying to load
add-ons that have preprocessor errors (issues #1924, #1634).
### Miscellaneous and bug fixes
* Added an advanced preference to enable experimental PRNG combat.
* Campfires use illumination instead of a different ToD.
* Linux builds now enable security hardening by default.
* Fixed MP admins being unable to observe private games.
* Fixed MP faction, leader, and leader gender changes persisting even if the
selection dialog is dismissed.
* Fixed an issue with positioned sound sources ignoring the volume set in
Preferences after going off the audible radius and back (issue #3280).
* Fixed wmllint choking on gzipped binary files (e.g. gzipped tarballs).
* Fixed wmllint crashing on nonexistent paths provided in the command line
(issue #3286).
* Slight changes to the objectives dialogue (pr #3309)
* Greatly improved touch control support.
* Fixed wmlindent crashing on nonexistent paths provided in the command line
(issue #3346).
* [do_command][attack] can no longer invoke disabled attacks.
* [delay] is now skipped during preload events.
* Fixed wrong simulated movement points when planning to capture a village.
* Fixed attacks wrongly being disabled in the UI.
## Version 1.14.3
### AI
* Fixed crash in presence of units with negative hitpoints (issue #3042).
* Efficiency improvements to filter evaluations in the Goto Micro AI and some
AI helper functions
### Campaigns
* Dead Water:
* Fix possibility of villagers blocking pickup of sword in S10 The Flaming
Sword (issue #3207).
* Descent Into Darkness:
* New Parthyn map in S1 and S6.
* Northern Rebirth:
* Reduced starting gold and income in scenarios 10 to 13
* Secrets of the Ancients:
* Fix S09 Training Session not ending when all dark adepts die (issue #3192)
* Tutorial:
* S2: made enemy starting gold equal to that of the player.
* Under the Burning Suns:
* Added portrait and updated sprite for Giant Ant.
### Language and i18n
* Updated translations: British English, Chinese (Traditional), Czech, French,
Italian, Japanese, Scottish Gaelic, Spanish
### Multiplayer server
* Fixed lan_server option not causing the server to exit once vacated, e.g.
when using the Host Networked Game option from the Multiplayer menu in the
game (issue #3206).
* It is now possible to query the client version of other players.
### Music and sound effects
* The music now changes immediately when you load a save file (issue #2602).
* Fixed Lua errors when setting a music track that cannot be found when the
playlist is already empty, e.g. if there's no music installed for the
game (issue #3194).
### WML engine
* Removed validation to ensure units cannot have negative hitpoints. We
learned that the ability to create such units is documented, and thus
disallowing it was an API change. Since API changes aren't allowed in
the stable branch, we have reverted it.
### Miscellaneous and bug fixes
* Fixed an occasional crash at the loading screen related to multi-thread
access of the image cache.
* [kill] animate=yes no longer scrolls to units through fog or shroud, thus
matching 1.12's behavior again.
* [message] displays the unit type name when a nameless unit speaks and no
custom caption= is specified (issue #3211).
* do_not_list=yes units are no longer excluded from the debug mode-only
Create Unit dialog.
* Fixed a rare issue where disabled attacks could cause the wrong attack to
be initially selected in the Unit Attack dialog. This bug also had the
potential to cause units to the wrong attack when engaging or viewing
damage calculations.
* Fixed [scenario] map_file= being unusable in most circumstances.
## Version 1.14.2
### Campaigns
* Northern Rebirth:
* S02.1 Infested Caves: keep side 8 AI leader from wandering off too far
and ending up on a keep with only one hex for recruiting.
* S02.1 Infested Caves: AIs are less likely to kill each other in early
game, which would make it harder for the player otherwise.
* S02.1 Infested Caves: Dwarvish allies are also less likely to die.
* S02.1 Infested Caves: minor map tweaks and improvements.
* S05 The Pursuit: removed a bottleneck and tweaked Rod of Justice.
* Sceptre of Fire:
* In 'Caverns of Flame', fixed various issues with the volcano eruption.
* Under the Burning Suns:
* Various Quenoth unit graphics updates.
* Descent into Darkness:
* In 'A small Favor', disabled a not intended way to win the scenario.
* Secrets of the Ancients:
* Bats are transformed to normal ones already after S5
### Graphics
* Fixed a minor team coloring mistake in the north-facing Revenant standing
animation.
### Language and i18n
* Updated translations: British English, Chinese (Simplified), Czech, French,
Galician, German, Italian, Japanese, Scottish Gaelic, Spanish, Ukrainian
### User interface
* List boxes (MP lobby game list in particular) now keep the scroll position
when they change, instead of keeping the selected item visible (issue #3016).
* Fixed MP lobby player list scrolling to top when it changes
* Fixed the first unit sometimes not being selected when opening the Recall
dialog.
* Fixed a crash when using very large portraits in [message] (issue #2912)
* Added a button to access the version info dialog to Preferences.
* Removed player list sorting options in the MP lobby. The list is now
automatically sorted alphabetically, friends first.
* Rearranged campaign difficulty menu layout
### Terrains
* Removed hidden terrains that were not supposed to make it to 1.14: ^Prg,
^Prgo, ^Pwd, ^Pwdo
### Miscellaneous and bug fixes
* Fixed memory leak in terrain filter code. In a huge map with Silver Mages,
it could leak several gigabytes of memory in a long session.
* Fixed: unit halo remained after undoing a recall (issue #3065)
* Fixed: unit halo intensity doubled during AMLA animation
* [change_theme] no longer causes a Lua error when theme= is not specified
instead of explicitly set to an empty string.
* [change_theme] no longer requires running a separate action to update the
UI afterwards (e.g. [redraw]) and the status panels are updated immediately.
as well.
* Lua random map generator: fixed error when flipping map; specifically this
also fixes an assert at the start of HttT S7 (Sceptre of Fire) that had a
50% chance of being triggered
* Experimental AI: fixed recruiting not working on maps without enemies, such
as the first two turns of Dark Forecast
* Experimental AI: fixed recruiting evaluations sometimes not being updated
* Replaced deprecated Lua code and all remaining uses of FOREACH and MESSAGE
macros
* Fixed [color_adjust] interacting poorly with time of day color shifts and
values outside the [-255, 255] range (issue #3144).
* Fixed a regression from 1.13.10 where modification option values couldn't
be properly saved in arrays.
* Added stricter validation to ensure units cannot have negative hitpoints,
except during specific attack-related events.
* Added deprecation notices for several macros that had them missing before.
* [message] no longer scrolls to units through fog or shroud so it matches
1.12's behavior.
* Fixed animation-wide text_color and blend_color keys being overwritten. This
fixes level-in and level-out animations sometimes fading to black instead of
white.
* Fixed [animate_unit] freezing the game when observing MP games (#2970).
* Fixed carryover behaving differently when loading a start-of-scenario save
(issue #3152).
* Fixed turn replay function in MP.
* Fixed savegames being created even when not needed (issue #3150).
* Fixed handling of extra_recruit in planning mode (issue #3100).
* Fixed handling of skirmisher in planning mode.
* Fixed handling of filter_recall in planning mode.
* Fixed possible segfault at game end.
* Fixed require_resource in [resource].
* Fixed require_scenario=yes not working with map_generation (issue #3105).
## Version 1.14.1
### Campaigns
* Eastern Invasion:
* In 'Captured', fixed units incorrectly costing upkeep after leveling up.
* Secrets of the Ancients
* Fixed minor unit naming inconsistencies (issues #2844 and #2846).
* Under the Burning Suns
* Added custom graphics for the broken tree in S1.
* Various sprite and image updates.
* Fixed a bug in the formation ability causing defense bonuses not being
received in some cases.
### Language and i18n
* Updated translations: British English, Chinese (Simplified), Czech, French,
Galician, German, Italian, Japanese, Scottish Gaelic, Slovak, Spanish
* Fixed Logging Options tooltips not being translatable (issue #2837).
* Add command-line argument to disable the filtering of incomplete translations
in the language selection list.
### Multiplayer server
* Added support for matching user, IP, and email bans from a forums board
when the forum_user_handler is enabled and active. (IP and email bans with
wildcards are not supported yet.)
* Fixed various instances of the server crashing under certain conditions.
### Performance
* Added an option to disable the FPS limiter for a slight performance boost.
### Units
* Changed the plural name for the merfolk race from Mermen to Merfolk (issue #2940)
and replaced a few instances in core unit or terrain descriptions accordingly.
### User interface
* Removed individual Join/Observe buttons for each game in the MP Lobby.
* Highlight the titles of MP games with vacant slots.
* Improved MP Lobby layout on low resolutions.
* Improved reporting of network errors in the MP lobby (issue #3005).
* Ensure the chat widget remains the correct size even after a window resize.
* Custom MP game names are now capped at 50 characters.
* Restored Era info to main MP game display.
* Improved the resolution selection criteria for the MP Lobby.
* Fixed inactive weapon specials being displayed in the Unit Attack dialog
unlike in 1.12 (issue #3033).
### Miscellaneous and bug fixes
* Removed misleading tooltip text stating registered nicknames are optional for
the official MP server.
* Attempting to save a screenshot with an unsupported format now shows an error
message, instead of saving the screenshot as BMP with the requested extension.
* It is now possible to disable logdomains in the Logging Options dialog.
* Fixed the wesnoth(6) manpage claiming the default log level is 'error' when it
has been 'warning' since version 1.9.0.
* Document --log-none in the wesnoth(6) manpage.
* Avoid trying to load invalid base64-encoded data URIs.
* wesnoth_addon_manager and the addons.wesnoth.org web index can now use data URIs.
* Fixed a crash when using certain invalid color= values.
* Implemented a workaround for an unhandled std::bad_cast from string comparison
functions that caused a crash-to-desktop when opening Preferences among others
(issue #3050).
* Fixed many crashes and out-of-sync errors when using the planning mode.
## Version 1.14.0
### Campaigns
* Under the Burning Suns
* New set of Quenoth faction and character portraits by LordBob.
* Updated sprites for several Quenoth units.
* Fixed "Invalid WML found" error that can be caused by the Quenoth Youth
support ability.
### Help browser
* Temporarily hidden Editor section as it is mostly incomplete and of little
use right now (issue #2963).
### Language and i18n
* Fixed Version label on the title screen not being translatable (issue #2914).
* Updated translations: Czech, French, Galician, German, Japanese, Polish,
Scottish Gaelic, Slovak, Spanish
### Multiplayer
* Fixed regression causing a crash-to-desktop when trying to log into the
server using a registered and active account without specifying a
password.
* Fixed an infinite loading screen if the server shut down or restarted
mid-login.
* Fixed an infinite loading screen when attempting to login with an
unregistered nickname followed by a registered one.
* Dark Forecast: Fixed possible Lua error when the weather changes.
### User Interface
* Implemented MP chat message history saving (issue #1194, issue #2802).
* Fixed context menus not dismissing on right click.
### Miscellaneous and bug fixes
* Fixed an AI assertion when a unit with one disabled attack attacked a unit
with no attacks or a single disabled attack.
## Version 1.13.14
### Security fixes
* Fixed an issue allowing MP lobby and whisper message origins to be spoofed
by clients.
### Campaigns
* The Hammer of Thursagan
* S12 Fixed enemies from ai6 (south-east lich) going to the book (spider)
room
* S12 Fixed north treasure chest disappearing
* The Rise of Wesnoth
* New set of story art.
### Help browser
* Unit descriptions use the new multiplication sign format for attack lists
now (issue #2873).
### Language and i18n
* Updated translations: Chinese (Simplified), Czech, French, Galician,
Italian, Polish
### Lua API
* Fix wesnoth.show_popup_dialog and wesnoth.show_message_box not accepting
translatable strings
### Multiplayer
* Added team color to a few background units missing in Aethermaw.
### User Interface
* Swapped the position and formatting of game names and titles in the MP
lobby.
* Made Faction Select button's purpose more clear in MP Staging.
* Added a convenient button in Load Game to open your saves folder.
### Miscellaneous and bug fixes
* Removed the Font Scaling preference. It was too buggy (issues #2792 and
#1624).
* Fixed some hotkeys triggering multiple commands on GNU/Linux (bug #1736).
* Fixed [modify_side] share_vision=yes not doing anything (bug #2850).
* Fixed regression where unit filters in [disable] weapon specials would not
match the attacking unit.
* Fixed images with no alpha channel rendering incorrectly.
* Fixed unit selection not persisting between uses of Create Unit.
* Fixed assertion when undoing actions in a synced context.
* [filter_wml] no longer accepts [and] and [or] in addition to [not] since
the implementation was non-functional.
* Fixed some MP passwords being saved incorrectly (issue #2745)
* Fixed AI not recruiting in some circumstances when there are only cheap
units on the recall list.
* Fixed sometimes being unable to join MP games with non-required eras.
* Fixed locations not being added to the palette when loading a map (#1023)
## Version 1.13.13
### Campaigns
* Eastern Invasion
* Fixed some Lua errors in S05.
* The Hammer of Thursagan
* Fixed a misplaced door image in S12.
* Under the Burning Suns
* Changed Sun Singer movetype from float to foot.
* Added some Quenoth elf unit animations.
* Hide technical terrains in the Help browser (Human Ship, Lava overlay).
### Language and i18n
* Fixed many cases of interpolated strings in the engine possibly having
their translations retrieved from the wrong textdomain and falling back
to the English original if that failed (PR #2711, bug #2709, bug #2732).
* Fixed parts of the MP game setup UI having their translations ignored by
the game (bug #2709).
* Fixed certain parts of the UI displaying unit stats and trait effects
having incomplete translations (bug #2732).
* Fixed "Level" label in unit descriptions in the help being untranslatable
(bug #2732)
* Fixed "Search" placeholder text in dialog item filters not being
translatable (bug #2709, bug #2732).
* Fixed "Time of Day Schedule" heading for the index for the ToD Schedule
top-level help section, "Lawful Bonus", "Schedule" (back link to index)
and an error message not being translatable.
* Updated translations: British English, Chinese (Simplified), Czech, French,
Scottish Gaelic, Spanish, Ukrainian
### Multiplayer
* A New Land: Fixed the scenario being broken.
* Dark Forecast: Fixed possible Lua error when attempting to spawn units.
### Miscellaneous and bug fixes
* Fixed minimap buttons not doing anything (bug #2681)
* Fixed events with an id but no name being rejected
* Fixed assertion when using [inspect]
* Fixed inability to deselect modifications in single-player
* Fixed infinite loading screen when logging in with an invalid name
* Improved UX in multiplayer when synced debug commands are used during a
game.
* Updated bundled Oldania font to version 1.007 (from 1.006).
* Added bold and italic Oldania font variants.
* Updated bundled DejaVu Sans fonts to version 2.37 (from 2.35).
* Fixed [chat] not working during [delay] or animations.
* Removed the Password Reminder option from the Login screen.
* Removed (optional) requirement of libpng from SCons and CMake and the
associated options as Wesnoth now uses SDL_image to write PNG files.
* Fixed assertion when saving game events mid-event.
## Version 1.13.12
### Security fixes
* Disallowed access to blacklisted file paths such as hidden files and
@ -3265,7 +3786,7 @@
2 different guardians and a coward, healer support, lurkers,
messenger escort, patrol, protect and move a unit, and 2 alternative
recruiting strategies.
* Documentation at http://wiki.wesnoth.org/Micro_AIs
* Documentation at https://wiki.wesnoth.org/Micro_AIs
* New leader_ignores_keep AI aspect that lets AI leader take part in the same
AI moves as the non-leader units.
* Rename passive_leader_shares_keep candidate action to leader_shares_keep.
@ -5737,7 +6258,7 @@
* Event "turn refresh" is now fired at turn 1 too
### Miscellaneous and bugfixes
* Using a hotkey to reload during an attack no longer disables the mouse
(http://www.wesnoth.org/forum/viewtopic.php?f=4&t=27616)
(https://www.wesnoth.org/forum/viewtopic.php?f=4&t=27616)
* Removed some unused Drake macros from animation_utils
* Add recruitment anims for the Sky and Hurricane Drakes
* Removed the old stats code (Debian bug #555276, CVE-2007-2383,
@ -5998,7 +6519,7 @@
pre-srng or with srng disabled as well can work without OOS. This is a
testing feature that will likely be removed prior to 1.8.
* Room support via /join and /room commands, better support in the
experimental new lobby. See http://www.wesnoth.org/wiki/MultiplayerRooms
experimental new lobby. See https://www.wesnoth.org/wiki/MultiplayerRooms
for details.
### Multiplayer server
* Added server-side RNG support. Old clients can still play as normal.
@ -7189,7 +7710,7 @@
improvements.
* Built by default in scons, cmake and autotools, if building manually
see RELEASE_NOTES.
* See http://www.wesnoth.org/wiki/Editor2 for details and known issues.
* See https://www.wesnoth.org/wiki/Editor2 for details and known issues.
### Language and i18n
* updated fonts: DejaVuSans 2.26
* updated translations: Chinese (Traditional), Danish, Finnish, Galician,
@ -7608,7 +8129,7 @@
* Fix graphic artifact bug #11438
### Formula AI
* added support for Formula AI language, more info available at:
http://www.wesnoth.org/wiki/FormulaAI
https://www.wesnoth.org/wiki/FormulaAI
### graphics
* Fixed broken TC on transport-galleon and drake walking corpse graphics
* New portraits: Elvish Sorceress
@ -9520,7 +10041,7 @@
### terrain system
* The entire underlaying system has been converted to a new system,
this might render some UMC broken, read this forum thread for more details
http://www.wesnoth.org/forum/viewtopic.php?t=14910
https://www.wesnoth.org/forum/viewtopic.php?t=14910
* Terrain of the starting position can be changed in the map,
the automatic conversion to a keep is no longer done
* New definition for the maps in terrain-graphics
@ -10858,7 +11379,7 @@
* increased the holy resistance of the scuttlefoot movetype from 0% to 20%
* made Fireball, Gate, Galeons & Watch Tower unpoisonable and unplaguable
* recosting and minor stats changes for many level 2+ units:
http://www.wesnoth.org/forum/viewtopic.php?p=121154#121154
https://www.wesnoth.org/forum/viewtopic.php?p=121154#121154
* user interface:
* added font colors to theme
* reorganized side-bar information
@ -10918,7 +11439,7 @@
* various other changes:
* --with-preferences-dir configure option for coexistence of multiple versions
* experimental Python API for AI.
See http://www.wesnoth.org/wiki/ReferencePythonAPI for more information.
See https://www.wesnoth.org/wiki/ReferencePythonAPI for more information.
* various bug fixes and code cleanups
* better support for MacOSX filesystems
@ -13834,7 +14355,7 @@
* added some explanatory tooltips for some unit attributes on sidebar
* added in flag to show whose turn it currently is
* added end turn confirmation when units can still move (requires
editing preferences-file - see WesnothPreferences on http://wiki.wesnoth.org for more information)
editing preferences-file - see WesnothPreferences on https://wiki.wesnoth.org for more information)
* added 'unit list' to context menu
* restored 'save game' in the context menu (#7172)
* multiplayer improvements:

View file

@ -6,6 +6,6 @@ find_library(CRYPTO_LIBRARY crypto)
# handle the QUIETLY and REQUIRED arguments and set XXX_FOUND to TRUE if all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CRYPTO DEFAULT_MSG CRYPTO_LIBRARY CRYPTO_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Crypto DEFAULT_MSG CRYPTO_LIBRARY CRYPTO_INCLUDE_DIR)
mark_as_advanced(CRYPTO_INCLUDE_DIR CRYPTO_LIBRARY)

69
cmake/FindGLEW.cmake Normal file
View file

@ -0,0 +1,69 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindGLEW
# --------
#
# Find the OpenGL Extension Wrangler Library (GLEW)
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines the :prop_tgt:`IMPORTED` target ``GLEW::GLEW``,
# if GLEW has been found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
# GLEW_INCLUDE_DIRS - include directories for GLEW
# GLEW_LIBRARIES - libraries to link against GLEW
# GLEW_FOUND - true if GLEW has been found and can be used
find_path(GLEW_INCLUDE_DIR GL/glew.h)
if(NOT GLEW_LIBRARY)
find_library(GLEW_LIBRARY_RELEASE NAMES GLEW glew32 glew glew32s PATH_SUFFIXES lib64 libx32)
find_library(GLEW_LIBRARY_DEBUG NAMES GLEWd glew32d glewd PATH_SUFFIXES lib64)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(GLEW)
endif ()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(GLEW
REQUIRED_VARS GLEW_INCLUDE_DIR GLEW_LIBRARY)
if(GLEW_FOUND)
set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
if(NOT GLEW_LIBRARIES)
set(GLEW_LIBRARIES ${GLEW_LIBRARY})
endif()
if (NOT TARGET GLEW::GLEW)
add_library(GLEW::GLEW UNKNOWN IMPORTED)
set_target_properties(GLEW::GLEW PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GLEW_INCLUDE_DIRS}")
if(GLEW_LIBRARY_RELEASE)
set_property(TARGET GLEW::GLEW APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(GLEW::GLEW PROPERTIES IMPORTED_LOCATION_RELEASE "${GLEW_LIBRARY_RELEASE}")
endif()
if(GLEW_LIBRARY_DEBUG)
set_property(TARGET GLEW::GLEW APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(GLEW::GLEW PROPERTIES IMPORTED_LOCATION_DEBUG "${GLEW_LIBRARY_DEBUG}")
endif()
if(NOT GLEW_LIBRARY_RELEASE AND NOT GLEW_LIBRARY_DEBUG)
set_property(TARGET GLEW::GLEW APPEND PROPERTY IMPORTED_LOCATION "${GLEW_LIBRARY}")
endif()
endif()
endif()
mark_as_advanced(GLEW_INCLUDE_DIR)

69
cmake/FindGLEW.make Normal file
View file

@ -0,0 +1,69 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindGLEW
# --------
#
# Find the OpenGL Extension Wrangler Library (GLEW)
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines the :prop_tgt:`IMPORTED` target ``GLEW::GLEW``,
# if GLEW has been found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
# GLEW_INCLUDE_DIRS - include directories for GLEW
# GLEW_LIBRARIES - libraries to link against GLEW
# GLEW_FOUND - true if GLEW has been found and can be used
find_path(GLEW_INCLUDE_DIR GL/glew.h)
if(NOT GLEW_LIBRARY)
find_library(GLEW_LIBRARY_RELEASE NAMES GLEW glew32 glew glew32s PATH_SUFFIXES lib64 libx32)
find_library(GLEW_LIBRARY_DEBUG NAMES GLEWd glew32d glewd PATH_SUFFIXES lib64)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(GLEW)
endif ()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(GLEW
REQUIRED_VARS GLEW_INCLUDE_DIR GLEW_LIBRARY)
if(GLEW_FOUND)
set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
if(NOT GLEW_LIBRARIES)
set(GLEW_LIBRARIES ${GLEW_LIBRARY})
endif()
if (NOT TARGET GLEW::GLEW)
add_library(GLEW::GLEW UNKNOWN IMPORTED)
set_target_properties(GLEW::GLEW PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GLEW_INCLUDE_DIRS}")
if(GLEW_LIBRARY_RELEASE)
set_property(TARGET GLEW::GLEW APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(GLEW::GLEW PROPERTIES IMPORTED_LOCATION_RELEASE "${GLEW_LIBRARY_RELEASE}")
endif()
if(GLEW_LIBRARY_DEBUG)
set_property(TARGET GLEW::GLEW APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(GLEW::GLEW PROPERTIES IMPORTED_LOCATION_DEBUG "${GLEW_LIBRARY_DEBUG}")
endif()
if(NOT GLEW_LIBRARY_RELEASE AND NOT GLEW_LIBRARY_DEBUG)
set_property(TARGET GLEW::GLEW APPEND PROPERTY IMPORTED_LOCATION "${GLEW_LIBRARY}")
endif()
endif()
endif()
mark_as_advanced(GLEW_INCLUDE_DIR)

View file

@ -6,6 +6,6 @@ find_library(HISTORY_LIBRARY history)
# handle the QUIETLY and REQUIRED arguments and set XXX_FOUND to TRUE if all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HISTORY DEFAULT_MSG HISTORY_LIBRARY HISTORY_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(History DEFAULT_MSG HISTORY_LIBRARY HISTORY_INCLUDE_DIR)
mark_as_advanced(HISTORY_INCLUDE_DIR HISTORY_LIBRARY)

517
cmake/FindOpenGL.cmake Normal file
View file

@ -0,0 +1,517 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindOpenGL
# ----------
#
# FindModule for OpenGL and GLU.
#
# Optional COMPONENTS
# ^^^^^^^^^^^^^^^^^^^
#
# This module respects several optional COMPONENTS: ``EGL``, ``GLX``, and
# ``OpenGL``. There are corresponding import targets for each of these flags.
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines the :prop_tgt:`IMPORTED` targets:
#
# ``OpenGL::GL``
# Defined to the platform-specific OpenGL libraries if the system has OpenGL.
# ``OpenGL::OpenGL``
# Defined to libOpenGL if the system is GLVND-based.
# ``OpenGL::GL``
# ``OpenGL::GLU``
# Defined if the system has GLU.
# ``OpenGL::GLX``
# Defined if the system has GLX.
# ``OpenGL::EGL``
# Defined if the system has EGL.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module sets the following variables:
#
# ``OPENGL_FOUND``
# True, if the system has OpenGL and all components are found.
# ``OPENGL_XMESA_FOUND``
# True, if the system has XMESA.
# ``OPENGL_GLU_FOUND``
# True, if the system has GLU.
# ``OpenGL_OpenGL_FOUND``
# True, if the system has an OpenGL library.
# ``OpenGL_GLX_FOUND``
# True, if the system has GLX.
# ``OpenGL_EGL_FOUND``
# True, if the system has EGL.
# ``OPENGL_INCLUDE_DIR``
# Path to the OpenGL include directory.
# ``OPENGL_EGL_INCLUDE_DIRS``
# Path to the EGL include directory.
# ``OPENGL_LIBRARIES``
# Paths to the OpenGL library, windowing system libraries, and GLU libraries.
# On Linux, this assumes GLX and is never correct for EGL-based targets.
# Clients are encouraged to use the ``OpenGL::*`` import targets instead.
#
# Cache variables
# ^^^^^^^^^^^^^^^
#
# The following cache variables may also be set:
#
# ``OPENGL_egl_LIBRARY``
# Path to the EGL library.
# ``OPENGL_glu_LIBRARY``
# Path to the GLU library.
# ``OPENGL_glx_LIBRARY``
# Path to the GLVND 'GLX' library.
# ``OPENGL_opengl_LIBRARY``
# Path to the GLVND 'OpenGL' library
# ``OPENGL_gl_LIBRARY``
# Path to the OpenGL library. New code should prefer the ``OpenGL::*`` import
# targets.
#
# Linux-specific
# ^^^^^^^^^^^^^^
#
# Some Linux systems utilize GLVND as a new ABI for OpenGL. GLVND separates
# context libraries from OpenGL itself; OpenGL lives in "libOpenGL", and
# contexts are defined in "libGLX" or "libEGL". GLVND is currently the only way
# to get OpenGL 3+ functionality via EGL in a manner portable across vendors.
# Projects may use GLVND explicitly with target ``OpenGL::OpenGL`` and either
# ``OpenGL::GLX`` or ``OpenGL::EGL``.
#
# Projects may use the ``OpenGL::GL`` target (or ``OPENGL_LIBRARIES`` variable)
# to use legacy GL interfaces. These will use the legacy GL library located
# by ``OPENGL_gl_LIBRARY``, if available. If ``OPENGL_gl_LIBRARY`` is empty or
# not found and GLVND is available, the ``OpenGL::GL`` target will use GLVND
# ``OpenGL::OpenGL`` and ``OpenGL::GLX`` (and the ``OPENGL_LIBRARIES``
# variable will use the corresponding libraries). Thus, for non-EGL-based
# Linux targets, the ``OpenGL::GL`` target is most portable.
#
# A ``OpenGL_GL_PREFERENCE`` variable may be set to specify the preferred way
# to provide legacy GL interfaces in case multiple choices are available.
# The value may be one of:
#
# ``GLVND``
# If the GLVND OpenGL and GLX libraries are available, prefer them.
# This forces ``OPENGL_gl_LIBRARY`` to be empty.
# This is the default if components were requested (since components
# correspond to GLVND libraries).
#
# ``LEGACY``
# Prefer to use the legacy libGL library, if available.
# This is the default if no components were requested.
#
# For EGL targets the client must rely on GLVND support on the user's system.
# Linking should use the ``OpenGL::OpenGL OpenGL::EGL`` targets. Using GLES*
# libraries is theoretically possible in place of ``OpenGL::OpenGL``, but this
# module does not currently support that; contributions welcome.
#
# ``OPENGL_egl_LIBRARY`` and ``OPENGL_EGL_INCLUDE_DIRS`` are defined in the case of
# GLVND. For non-GLVND Linux and other systems these are left undefined.
#
# macOS-Specific
# ^^^^^^^^^^^^^^
#
# On OSX FindOpenGL defaults to using the framework version of OpenGL. People
# will have to change the cache values of OPENGL_glu_LIBRARY and
# OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX.
set(_OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
# Provide OPENGL_USE_<C> variables for each component.
foreach(component ${OpenGL_FIND_COMPONENTS})
string(TOUPPER ${component} _COMPONENT)
set(OPENGL_USE_${_COMPONENT} 1)
endforeach()
if (CYGWIN)
find_path(OPENGL_INCLUDE_DIR GL/gl.h )
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
find_library(OPENGL_gl_LIBRARY opengl32 )
find_library(OPENGL_glu_LIBRARY glu32 )
elseif (WIN32)
if(BORLAND)
set (OPENGL_gl_LIBRARY import32 CACHE STRING "OpenGL library for win32")
set (OPENGL_glu_LIBRARY import32 CACHE STRING "GLU library for win32")
else()
set (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
set (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32")
endif()
elseif (APPLE)
# The OpenGL.framework provides both gl and glu
find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL library for OS X")
find_library(OPENGL_glu_LIBRARY OpenGL DOC
"GLU library for OS X (usually same as OpenGL library)")
find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OS X")
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
else()
if (CMAKE_SYSTEM_NAME MATCHES "HP-UX")
# Handle HP-UX cases where we only want to find OpenGL in either hpux64
# or hpux32 depending on if we're doing a 64 bit build.
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(_OPENGL_LIB_PATH
/opt/graphics/OpenGL/lib/hpux32/)
else()
set(_OPENGL_LIB_PATH
/opt/graphics/OpenGL/lib/hpux64/
/opt/graphics/OpenGL/lib/pa20_64)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL Haiku)
set(_OPENGL_LIB_PATH
/boot/develop/lib/x86)
set(_OPENGL_INCLUDE_PATH
/boot/develop/headers/os/opengl)
endif()
# The first line below is to make sure that the proper headers
# are used on a Linux machine with the NVidia drivers installed.
# They replace Mesa with NVidia's own library but normally do not
# install headers and that causes the linking to
# fail since the compiler finds the Mesa headers but NVidia's library.
# Make sure the NVIDIA directory comes BEFORE the others.
# - Atanas Georgiev <atanas@cs.columbia.edu>
find_path(OPENGL_INCLUDE_DIR GL/gl.h
/usr/share/doc/NVIDIA_GLX-1.0/include
/usr/openwin/share/include
/opt/graphics/OpenGL/include /usr/X11R6/include
${_OPENGL_INCLUDE_PATH}
)
find_path(OPENGL_GLX_INCLUDE_DIR GL/glx.h ${_OPENGL_INCLUDE_PATH})
find_path(OPENGL_EGL_INCLUDE_DIR EGL/egl.h ${_OPENGL_INCLUDE_PATH})
find_path(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h
/usr/share/doc/NVIDIA_GLX-1.0/include
/usr/openwin/share/include
/opt/graphics/OpenGL/include /usr/X11R6/include
)
# Search for the GLVND libraries. We do this regardless of COMPONENTS; we'll
# take into account the COMPONENTS logic later.
find_library(OPENGL_opengl_LIBRARY
NAMES OpenGL
PATHS /usr/X11R6/lib
${_OPENGL_LIB_PATH}
)
find_library(OPENGL_glx_LIBRARY
NAMES GLX
PATHS /usr/X11R6/lib
${_OPENGL_LIB_PATH}
)
find_library(OPENGL_egl_LIBRARY
NAMES EGL
PATHS ${_OPENGL_LIB_PATH}
)
find_library(OPENGL_glu_LIBRARY
NAMES GLU MesaGLU
PATHS ${OPENGL_gl_LIBRARY}
/opt/graphics/OpenGL/lib
/usr/openwin/lib
/usr/shlib /usr/X11R6/lib
)
if(NOT DEFINED OpenGL_GL_PREFERENCE)
set(OpenGL_GL_PREFERENCE "")
endif()
if(NOT OpenGL_GL_PREFERENCE STREQUAL "")
# A preference has been explicitly specified.
if(NOT OpenGL_GL_PREFERENCE MATCHES "^(GLVND|LEGACY)$")
message(FATAL_ERROR
"OpenGL_GL_PREFERENCE value '${OpenGL_GL_PREFERENCE}' not recognized. "
"Allowed values are 'GLVND' and 'LEGACY'."
)
endif()
elseif(OpenGL_FIND_COMPONENTS)
# No preference was explicitly specified, but the caller did request
# at least one GLVND component. Prefer GLVND for legacy GL.
set(OpenGL_GL_PREFERENCE "GLVND")
else()
# No preference was explicitly specified and no GLVND components were
# requested. Prefer libGL for legacy GL.
set(OpenGL_GL_PREFERENCE "LEGACY")
endif()
if("x${OpenGL_GL_PREFERENCE}x" STREQUAL "xGLVNDx" AND OPENGL_opengl_LIBRARY AND OPENGL_glx_LIBRARY)
# We can provide legacy GL using GLVND libraries.
# Do not use any legacy GL library.
set(OPENGL_gl_LIBRARY "")
else()
# We cannot provide legacy GL using GLVND libraries.
# Search for the legacy GL library.
find_library(OPENGL_gl_LIBRARY
NAMES GL MesaGL
PATHS /opt/graphics/OpenGL/lib
/usr/openwin/lib
/usr/shlib /usr/X11R6/lib
${_OPENGL_LIB_PATH}
)
endif()
# FPHSA cannot handle "this OR that is required", so we conditionally set what
# it must look for. First clear any previous config we might have done:
set(_OpenGL_REQUIRED_VARS)
# now we append the libraries as appropriate. The complicated logic
# basically comes down to "use libOpenGL when we can, and add in specific
# context mechanisms when requested, or we need them to preserve the previous
# default where glx is always available."
if((NOT OPENGL_USE_EGL AND
NOT OPENGL_opengl_LIBRARY AND
OPENGL_glx_LIBRARY AND
NOT OPENGL_gl_LIBRARY) OR
(NOT OPENGL_USE_EGL AND
NOT OPENGL_glx_LIBRARY AND
NOT OPENGL_gl_LIBRARY) OR
(NOT OPENGL_USE_EGL AND
OPENGL_opengl_LIBRARY AND
OPENGL_glx_LIBRARY) OR
( OPENGL_USE_EGL))
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_opengl_LIBRARY)
endif()
# GLVND GLX library. Preferred when available.
if((NOT OPENGL_USE_OPENGL AND
NOT OPENGL_USE_GLX AND
NOT OPENGL_USE_EGL AND
NOT OPENGL_glx_LIBRARY AND
NOT OPENGL_gl_LIBRARY) OR
( OPENGL_USE_GLX AND
NOT OPENGL_USE_EGL AND
NOT OPENGL_glx_LIBRARY AND
NOT OPENGL_gl_LIBRARY) OR
(NOT OPENGL_USE_EGL AND
OPENGL_opengl_LIBRARY AND
OPENGL_glx_LIBRARY) OR
(OPENGL_USE_GLX AND OPENGL_USE_EGL))
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_glx_LIBRARY)
endif()
# GLVND EGL library.
if(OPENGL_USE_EGL)
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_egl_LIBRARY)
endif()
# Old-style "libGL" library: used as a fallback when GLVND isn't available.
if((NOT OPENGL_USE_EGL AND
NOT OPENGL_opengl_LIBRARY AND
OPENGL_glx_LIBRARY AND
OPENGL_gl_LIBRARY) OR
(NOT OPENGL_USE_EGL AND
NOT OPENGL_glx_LIBRARY AND
OPENGL_gl_LIBRARY))
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
endif()
# We always need the 'gl.h' include dir.
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
unset(_OPENGL_INCLUDE_PATH)
unset(_OPENGL_LIB_PATH)
find_library(OPENGL_glu_LIBRARY
NAMES GLU MesaGLU
PATHS ${OPENGL_gl_LIBRARY}
/opt/graphics/OpenGL/lib
/usr/openwin/lib
/usr/shlib /usr/X11R6/lib
)
endif ()
if(OPENGL_xmesa_INCLUDE_DIR)
set( OPENGL_XMESA_FOUND "YES" )
else()
set( OPENGL_XMESA_FOUND "NO" )
endif()
if(OPENGL_glu_LIBRARY)
set( OPENGL_GLU_FOUND "YES" )
else()
set( OPENGL_GLU_FOUND "NO" )
endif()
# OpenGL_OpenGL_FOUND is a bit unique in that it is okay if /either/ libOpenGL
# or libGL is found.
# Using libGL with libEGL is never okay, though; we handle that case later.
if(NOT OPENGL_opengl_LIBRARY AND NOT OPENGL_gl_LIBRARY)
set(OpenGL_OpenGL_FOUND FALSE)
else()
set(OpenGL_OpenGL_FOUND TRUE)
endif()
if(OPENGL_glx_LIBRARY AND OPENGL_GLX_INCLUDE_DIR)
set(OpenGL_GLX_FOUND TRUE)
else()
set(OpenGL_GLX_FOUND FALSE)
endif()
if(OPENGL_egl_LIBRARY AND OPENGL_EGL_INCLUDE_DIR)
set(OpenGL_EGL_FOUND TRUE)
else()
set(OpenGL_EGL_FOUND FALSE)
endif()
# User-visible names should be plural.
if(OPENGL_EGL_INCLUDE_DIR)
set(OPENGL_EGL_INCLUDE_DIRS ${OPENGL_EGL_INCLUDE_DIR})
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL REQUIRED_VARS ${_OpenGL_REQUIRED_VARS}
HANDLE_COMPONENTS)
unset(_OpenGL_REQUIRED_VARS)
# OpenGL:: targets
if(OPENGL_FOUND)
# ::OpenGL is a GLVND library, and thus Linux-only: we don't bother checking
# for a framework version of this library.
if(OPENGL_opengl_LIBRARY AND NOT TARGET OpenGL::OpenGL)
if(IS_ABSOLUTE "${OPENGL_opengl_LIBRARY}")
add_library(OpenGL::OpenGL UNKNOWN IMPORTED)
set_target_properties(OpenGL::OpenGL PROPERTIES IMPORTED_LOCATION
"${OPENGL_opengl_LIBRARY}")
else()
add_library(OpenGL::OpenGL INTERFACE IMPORTED)
set_target_properties(OpenGL::OpenGL PROPERTIES IMPORTED_LIBNAME
"${OPENGL_opengl_LIBRARY}")
endif()
set_target_properties(OpenGL::OpenGL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${OPENGL_INCLUDE_DIR}")
endif()
# ::GLX is a GLVND library, and thus Linux-only: we don't bother checking
# for a framework version of this library.
if(OpenGL_GLX_FOUND AND NOT TARGET OpenGL::GLX)
if(IS_ABSOLUTE "${OPENGL_glx_LIBRARY}")
add_library(OpenGL::GLX UNKNOWN IMPORTED)
set_target_properties(OpenGL::GLX PROPERTIES IMPORTED_LOCATION
"${OPENGL_glx_LIBRARY}")
else()
add_library(OpenGL::GLX INTERFACE IMPORTED)
set_target_properties(OpenGL::GLX PROPERTIES IMPORTED_LIBNAME
"${OPENGL_glx_LIBRARY}")
endif()
set_target_properties(OpenGL::GLX PROPERTIES INTERFACE_LINK_LIBRARIES
OpenGL::OpenGL)
set_target_properties(OpenGL::GLX PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${OPENGL_GLX_INCLUDE_DIR}")
endif()
if(OPENGL_gl_LIBRARY AND NOT TARGET OpenGL::GL)
# A legacy GL library is available, so use it for the legacy GL target.
if(IS_ABSOLUTE "${OPENGL_gl_LIBRARY}")
add_library(OpenGL::GL UNKNOWN IMPORTED)
if(OPENGL_gl_LIBRARY MATCHES "/([^/]+)\\.framework$")
set(_gl_fw "${OPENGL_gl_LIBRARY}/${CMAKE_MATCH_1}")
if(EXISTS "${_gl_fw}.tbd")
string(APPEND _gl_fw ".tbd")
endif()
set_target_properties(OpenGL::GL PROPERTIES
IMPORTED_LOCATION "${_gl_fw}")
else()
set_target_properties(OpenGL::GL PROPERTIES
IMPORTED_LOCATION "${OPENGL_gl_LIBRARY}")
endif()
else()
add_library(OpenGL::GL INTERFACE IMPORTED)
set_target_properties(OpenGL::GL PROPERTIES
IMPORTED_LIBNAME "${OPENGL_gl_LIBRARY}")
endif()
set_target_properties(OpenGL::GL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}")
elseif(NOT TARGET OpenGL::GL AND TARGET OpenGL::OpenGL AND TARGET OpenGL::GLX)
# A legacy GL library is not available, but we can provide the legacy GL
# target using GLVND OpenGL+GLX.
add_library(OpenGL::GL INTERFACE IMPORTED)
set_target_properties(OpenGL::GL PROPERTIES INTERFACE_LINK_LIBRARIES
OpenGL::OpenGL)
set_property(TARGET OpenGL::GL APPEND PROPERTY INTERFACE_LINK_LIBRARIES
OpenGL::GLX)
set_target_properties(OpenGL::GL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${OPENGL_INCLUDE_DIR}")
endif()
# ::EGL is a GLVND library, and thus Linux-only: we don't bother checking
# for a framework version of this library.
# Note we test for OpenGL::OpenGL as a target. When this module is updated to
# support GLES, we would additionally want to check for the hypothetical GLES
# target and enable EGL if either ::GLES or ::OpenGL is created.
if(TARGET OpenGL::OpenGL AND OpenGL_EGL_FOUND AND NOT TARGET OpenGL::EGL)
if(IS_ABSOLUTE "${OPENGL_egl_LIBRARY}")
add_library(OpenGL::EGL UNKNOWN IMPORTED)
set_target_properties(OpenGL::EGL PROPERTIES IMPORTED_LOCATION
"${OPENGL_egl_LIBRARY}")
else()
add_library(OpenGL::EGL INTERFACE IMPORTED)
set_target_properties(OpenGL::EGL PROPERTIES IMPORTED_LIBNAME
"${OPENGL_egl_LIBRARY}")
endif()
set_target_properties(OpenGL::EGL PROPERTIES INTERFACE_LINK_LIBRARIES
OpenGL::OpenGL)
# Note that EGL's include directory is different from OpenGL/GLX's!
set_target_properties(OpenGL::EGL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${OPENGL_EGL_INCLUDE_DIR}")
endif()
if(OPENGL_GLU_FOUND AND NOT TARGET OpenGL::GLU)
if(IS_ABSOLUTE "${OPENGL_glu_LIBRARY}")
add_library(OpenGL::GLU UNKNOWN IMPORTED)
if(OPENGL_glu_LIBRARY MATCHES "/([^/]+)\\.framework$")
set(_glu_fw "${OPENGL_glu_LIBRARY}/${CMAKE_MATCH_1}")
if(EXISTS "${_glu_fw}.tbd")
string(APPEND _glu_fw ".tbd")
endif()
set_target_properties(OpenGL::GLU PROPERTIES
IMPORTED_LOCATION "${_glu_fw}")
else()
set_target_properties(OpenGL::GLU PROPERTIES
IMPORTED_LOCATION "${OPENGL_glu_LIBRARY}")
endif()
else()
add_library(OpenGL::GLU INTERFACE IMPORTED)
set_target_properties(OpenGL::GLU PROPERTIES
IMPORTED_LIBNAME "${OPENGL_glu_LIBRARY}")
endif()
set_target_properties(OpenGL::GLU PROPERTIES
INTERFACE_LINK_LIBRARIES OpenGL::GL)
endif()
# OPENGL_LIBRARIES mirrors OpenGL::GL's logic ...
if(OPENGL_gl_LIBRARY)
set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY})
elseif(TARGET OpenGL::OpenGL AND TARGET OpenGL::GLX)
set(OPENGL_LIBRARIES ${OPENGL_opengl_LIBRARY} ${OPENGL_glx_LIBRARY})
else()
set(OPENGL_LIBRARIES "")
endif()
# ... and also includes GLU, if available.
if(TARGET OpenGL::GLU)
list(APPEND OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY})
endif()
endif()
# This deprecated setting is for backward compatibility with CMake1.4
set(OPENGL_LIBRARY ${OPENGL_LIBRARIES})
# This deprecated setting is for backward compatibility with CMake1.4
set(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
mark_as_advanced(
OPENGL_INCLUDE_DIR
OPENGL_xmesa_INCLUDE_DIR
OPENGL_egl_LIBRARY
OPENGL_glu_LIBRARY
OPENGL_glx_LIBRARY
OPENGL_gl_LIBRARY
OPENGL_opengl_LIBRARY
OPENGL_EGL_INCLUDE_DIR
OPENGL_GLX_INCLUDE_DIR
)

View file

@ -0,0 +1,386 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindPackageHandleStandardArgs
-----------------------------
This module provides a function intended to be used in :ref:`Find Modules`
implementing :command:`find_package(<PackageName>)` calls. It handles the
``REQUIRED``, ``QUIET`` and version-related arguments of ``find_package``.
It also sets the ``<PackageName>_FOUND`` variable. The package is
considered found if all variables listed contain valid results, e.g.
valid filepaths.
.. command:: find_package_handle_standard_args
There are two signatures::
find_package_handle_standard_args(<PackageName>
(DEFAULT_MSG|<custom-failure-message>)
<required-var>...
)
find_package_handle_standard_args(<PackageName>
[FOUND_VAR <result-var>]
[REQUIRED_VARS <required-var>...]
[VERSION_VAR <version-var>]
[HANDLE_COMPONENTS]
[CONFIG_MODE]
[FAIL_MESSAGE <custom-failure-message>]
)
The ``<PackageName>_FOUND`` variable will be set to ``TRUE`` if all
the variables ``<required-var>...`` are valid and any optional
constraints are satisfied, and ``FALSE`` otherwise. A success or
failure message may be displayed based on the results and on
whether the ``REQUIRED`` and/or ``QUIET`` option was given to
the :command:`find_package` call.
The options are:
``(DEFAULT_MSG|<custom-failure-message>)``
In the simple signature this specifies the failure message.
Use ``DEFAULT_MSG`` to ask for a default message to be computed
(recommended). Not valid in the full signature.
``FOUND_VAR <result-var>``
Obsolete. Specifies either ``<PackageName>_FOUND`` or
``<PACKAGENAME>_FOUND`` as the result variable. This exists only
for compatibility with older versions of CMake and is now ignored.
Result variables of both names are always set for compatibility.
``REQUIRED_VARS <required-var>...``
Specify the variables which are required for this package.
These may be named in the generated failure message asking the
user to set the missing variable values. Therefore these should
typically be cache entries such as ``FOO_LIBRARY`` and not output
variables like ``FOO_LIBRARIES``.
``VERSION_VAR <version-var>``
Specify the name of a variable that holds the version of the package
that has been found. This version will be checked against the
(potentially) specified required version given to the
:command:`find_package` call, including its ``EXACT`` option.
The default messages include information about the required
version and the version which has been actually found, both
if the version is ok or not.
``HANDLE_COMPONENTS``
Enable handling of package components. In this case, the command
will report which components have been found and which are missing,
and the ``<PackageName>_FOUND`` variable will be set to ``FALSE``
if any of the required components (i.e. not the ones listed after
the ``OPTIONAL_COMPONENTS`` option of :command:`find_package`) are
missing.
``CONFIG_MODE``
Specify that the calling find module is a wrapper around a
call to ``find_package(<PackageName> NO_MODULE)``. This implies
a ``VERSION_VAR`` value of ``<PackageName>_VERSION``. The command
will automatically check whether the package configuration file
was found.
``FAIL_MESSAGE <custom-failure-message>``
Specify a custom failure message instead of using the default
generated message. Not recommended.
Example for the simple signature:
.. code-block:: cmake
find_package_handle_standard_args(LibXml2 DEFAULT_MSG
LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
The ``LibXml2`` package is considered to be found if both
``LIBXML2_LIBRARY`` and ``LIBXML2_INCLUDE_DIR`` are valid.
Then also ``LibXml2_FOUND`` is set to ``TRUE``. If it is not found
and ``REQUIRED`` was used, it fails with a
:command:`message(FATAL_ERROR)`, independent whether ``QUIET`` was
used or not. If it is found, success will be reported, including
the content of the first ``<required-var>``. On repeated CMake runs,
the same message will not be printed again.
Example for the full signature:
.. code-block:: cmake
find_package_handle_standard_args(LibArchive
REQUIRED_VARS LibArchive_LIBRARY LibArchive_INCLUDE_DIR
VERSION_VAR LibArchive_VERSION)
In this case, the ``LibArchive`` package is considered to be found if
both ``LibArchive_LIBRARY`` and ``LibArchive_INCLUDE_DIR`` are valid.
Also the version of ``LibArchive`` will be checked by using the version
contained in ``LibArchive_VERSION``. Since no ``FAIL_MESSAGE`` is given,
the default messages will be printed.
Another example for the full signature:
.. code-block:: cmake
find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
find_package_handle_standard_args(Automoc4 CONFIG_MODE)
In this case, a ``FindAutmoc4.cmake`` module wraps a call to
``find_package(Automoc4 NO_MODULE)`` and adds an additional search
directory for ``automoc4``. Then the call to
``find_package_handle_standard_args`` produces a proper success/failure
message.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake)
# internal helper macro
macro(_FPHSA_FAILURE_MESSAGE _msg)
if (${_NAME}_FIND_REQUIRED)
message(FATAL_ERROR "${_msg}")
else ()
if (NOT ${_NAME}_FIND_QUIETLY)
message(STATUS "${_msg}")
endif ()
endif ()
endmacro()
# internal helper macro to generate the failure message when used in CONFIG_MODE:
macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
# <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
if(${_NAME}_CONFIG)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing:${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
else()
# If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
# List them all in the error message:
if(${_NAME}_CONSIDERED_CONFIGS)
set(configsText "")
list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
math(EXPR configsCount "${configsCount} - 1")
foreach(currentConfigIndex RANGE ${configsCount})
list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
string(APPEND configsText " ${filename} (version ${version})\n")
endforeach()
if (${_NAME}_NOT_FOUND_MESSAGE)
string(APPEND configsText " Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
endif()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
else()
# Simple case: No Config-file was found at all:
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
endif()
endif()
endmacro()
function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# Set up the arguments for `cmake_parse_arguments`.
set(options CONFIG_MODE HANDLE_COMPONENTS)
set(oneValueArgs FAIL_MESSAGE VERSION_VAR FOUND_VAR)
set(multiValueArgs REQUIRED_VARS)
# Check whether we are in 'simple' or 'extended' mode:
set(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
if(${INDEX} EQUAL -1)
set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
set(FPHSA_REQUIRED_VARS ${ARGN})
set(FPHSA_VERSION_VAR)
else()
cmake_parse_arguments(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
if(FPHSA_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
endif()
if(NOT FPHSA_FAIL_MESSAGE)
set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
endif()
# In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
# when it successfully found the config-file, including version checking:
if(FPHSA_CONFIG_MODE)
list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
set(FPHSA_VERSION_VAR ${_NAME}_VERSION)
endif()
if(NOT FPHSA_REQUIRED_VARS)
message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
endif()
endif()
# now that we collected all arguments, process them
if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG")
set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
endif()
list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
string(TOUPPER ${_NAME} _NAME_UPPER)
string(TOLOWER ${_NAME} _NAME_LOWER)
if(FPHSA_FOUND_VAR)
if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$" OR FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$")
set(_FOUND_VAR ${FPHSA_FOUND_VAR})
else()
message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.")
endif()
else()
set(_FOUND_VAR ${_NAME_UPPER}_FOUND)
endif()
# collect all variables which were not found, so they can be printed, so the
# user knows better what went wrong (#6375)
set(MISSING_VARS "")
set(DETAILS "")
# check if all passed variables are valid
set(FPHSA_FOUND_${_NAME} TRUE)
foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
if(NOT ${_CURRENT_VAR})
set(FPHSA_FOUND_${_NAME} FALSE)
string(APPEND MISSING_VARS " ${_CURRENT_VAR}")
else()
string(APPEND DETAILS "[${${_CURRENT_VAR}}]")
endif()
endforeach()
if(FPHSA_FOUND_${_NAME})
set(${_NAME}_FOUND TRUE)
set(${_NAME_UPPER}_FOUND TRUE)
else()
set(${_NAME}_FOUND FALSE)
set(${_NAME_UPPER}_FOUND FALSE)
endif()
# component handling
unset(FOUND_COMPONENTS_MSG)
unset(MISSING_COMPONENTS_MSG)
if(FPHSA_HANDLE_COMPONENTS)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(${_NAME}_${comp}_FOUND)
if(NOT DEFINED FOUND_COMPONENTS_MSG)
set(FOUND_COMPONENTS_MSG "found components: ")
endif()
string(APPEND FOUND_COMPONENTS_MSG " ${comp}")
else()
if(NOT DEFINED MISSING_COMPONENTS_MSG)
set(MISSING_COMPONENTS_MSG "missing components: ")
endif()
string(APPEND MISSING_COMPONENTS_MSG " ${comp}")
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
string(APPEND MISSING_VARS " ${comp}")
endif()
endif()
endforeach()
set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
string(APPEND DETAILS "[c${COMPONENT_MSG}]")
endif()
# version handling:
set(VERSION_MSG "")
set(VERSION_OK TRUE)
# check with DEFINED here as the requested or found version may be "0"
if (DEFINED ${_NAME}_FIND_VERSION)
if(DEFINED ${FPHSA_VERSION_VAR})
set(_FOUND_VERSION ${${FPHSA_VERSION_VAR}})
if(${_NAME}_FIND_VERSION_EXACT) # exact version required
# count the dots in the version string
string(REGEX REPLACE "[^.]" "" _VERSION_DOTS "${_FOUND_VERSION}")
# add one dot because there is one dot more than there are components
string(LENGTH "${_VERSION_DOTS}." _VERSION_DOTS)
if (_VERSION_DOTS GREATER ${_NAME}_FIND_VERSION_COUNT)
# Because of the C++ implementation of find_package() ${_NAME}_FIND_VERSION_COUNT
# is at most 4 here. Therefore a simple lookup table is used.
if (${_NAME}_FIND_VERSION_COUNT EQUAL 1)
set(_VERSION_REGEX "[^.]*")
elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 2)
set(_VERSION_REGEX "[^.]*\\.[^.]*")
elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 3)
set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*")
else ()
set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*\\.[^.]*")
endif ()
string(REGEX REPLACE "^(${_VERSION_REGEX})\\..*" "\\1" _VERSION_HEAD "${_FOUND_VERSION}")
unset(_VERSION_REGEX)
if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _VERSION_HEAD)
set(VERSION_MSG "Found unsuitable version \"${_FOUND_VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable exact version \"${_FOUND_VERSION}\")")
endif ()
unset(_VERSION_HEAD)
else ()
if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _FOUND_VERSION)
set(VERSION_MSG "Found unsuitable version \"${_FOUND_VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable exact version \"${_FOUND_VERSION}\")")
endif ()
endif ()
unset(_VERSION_DOTS)
else() # minimum version specified:
if (${_NAME}_FIND_VERSION VERSION_GREATER _FOUND_VERSION)
set(VERSION_MSG "Found unsuitable version \"${_FOUND_VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable version \"${_FOUND_VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")")
endif ()
endif()
else()
# if the package was not found, but a version was given, add that to the output:
if(${_NAME}_FIND_VERSION_EXACT)
set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
else()
set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
endif()
endif()
else ()
# Check with DEFINED as the found version may be 0.
if(DEFINED ${FPHSA_VERSION_VAR})
set(VERSION_MSG "(found version \"${${FPHSA_VERSION_VAR}}\")")
endif()
endif ()
if(VERSION_OK)
string(APPEND DETAILS "[v${${FPHSA_VERSION_VAR}}(${${_NAME}_FIND_VERSION})]")
else()
set(${_NAME}_FOUND FALSE)
endif()
# print the result:
if (${_NAME}_FOUND)
FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
else ()
if(FPHSA_CONFIG_MODE)
_FPHSA_HANDLE_FAILURE_CONFIG_MODE()
else()
if(NOT VERSION_OK)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
else()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing:${MISSING_VARS}) ${VERSION_MSG}")
endif()
endif()
endif ()
set(${_NAME}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE)
set(${_NAME_UPPER}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE)
endfunction()

View file

@ -0,0 +1,47 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindPackageMessage
# ------------------
#
#
#
# FIND_PACKAGE_MESSAGE(<name> "message for user" "find result details")
#
# This macro is intended to be used in FindXXX.cmake modules files. It
# will print a message once for each unique find result. This is useful
# for telling the user where a package was found. The first argument
# specifies the name (XXX) of the package. The second argument
# specifies the message to display. The third argument lists details
# about the find result so that if they change the message will be
# displayed again. The macro also obeys the QUIET argument to the
# find_package command.
#
# Example:
#
# ::
#
# if(X11_FOUND)
# FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
# "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
# else()
# ...
# endif()
function(FIND_PACKAGE_MESSAGE pkg msg details)
# Avoid printing a message repeatedly for the same find result.
if(NOT ${pkg}_FIND_QUIETLY)
string(REPLACE "\n" "" details "${details}")
set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
# The message has not yet been printed.
message(STATUS "${msg}")
# Save the find details in the cache to avoid printing the same
# message again.
set("${DETAILS_VAR}" "${details}"
CACHE INTERNAL "Details about finding ${pkg}")
endif()
endif()
endfunction()

View file

@ -1,130 +0,0 @@
#.rst:
# FindSDL2_ttf
# -----------
#
# Locate SDL2_ttf library
#
# This module defines:
#
# ::
#
# SDL2_TTF_LIBRARIES, the name of the library to link against
# SDL2_TTF_INCLUDE_DIRS, where to find the headers
# SDL2_TTF_FOUND, if false, do not try to link against
# SDL2_TTF_VERSION_STRING - human-readable string containing the version of SDL2_ttf
#
#
#
# For backward compatiblity the following variables are also set:
#
# ::
#
# SDL2TTF_LIBRARY (same value as SDL2_TTF_LIBRARIES)
# SDL2TTF_INCLUDE_DIR (same value as SDL2_TTF_INCLUDE_DIRS)
# SDL2TTF_FOUND (same value as SDL2_TTF_FOUND)
#
#
#
# $SDL2DIR is an environment variable that would correspond to the
# ./configure --prefix=$SDL2DIR used in building SDL2.
#
# Created by Andreas Löf. This was influenced by the FindSDL_ttf.cmake
# module, but with modifications to use SDL2.
#
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
# Copyright 2012 Benjamin Eikel
# Copyright 2015 Andreas Löf
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#=============================================================================
if(NOT SDL2_TTF_INCLUDE_DIR AND SDL2TTF_INCLUDE_DIR)
set(SDL2_TTF_INCLUDE_DIR ${SDL2TTF_INCLUDE_DIR} CACHE PATH "directory cache
entry initialized from old variable name")
endif()
find_path(SDL2_TTF_INCLUDE_DIR SDL_ttf.h
HINTS
ENV SDL2TTFDIR
ENV SDL2DIR
PATH_SUFFIXES SDL2
# path suffixes to search inside ENV{SDL2DIR}
include/SDL2 include/SDL12 include/SDL11 include
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(VC_LIB_PATH_SUFFIX lib/x64)
else()
set(VC_LIB_PATH_SUFFIX lib/x86)
endif()
if(NOT SDL2_TTF_LIBRARY AND SDL2TTF_LIBRARY)
set(SDL2_TTF_LIBRARY ${SDL2TTF_LIBRARY} CACHE FILEPATH "file cache entry
initialized from old variable name")
endif()
find_library(SDL2_TTF_LIBRARY
NAMES SDL2_ttf
HINTS
ENV SDL2TTFDIR
ENV SDL2DIR
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
if(SDL2_TTF_INCLUDE_DIR AND EXISTS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h")
file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+[0-9]+$")
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_MAJOR "${SDL_TTF_VERSION_MAJOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_MINOR "${SDL_TTF_VERSION_MINOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_PATCH "${SDL_TTF_VERSION_PATCH_LINE}")
set(SDL2_TTF_VERSION_STRING ${SDL_TTF_VERSION_MAJOR}.${SDL_TTF_VERSION_MINOR}.${SDL_TTF_VERSION_PATCH})
unset(SDL_TTF_VERSION_MAJOR_LINE)
unset(SDL_TTF_VERSION_MINOR_LINE)
unset(SDL_TTF_VERSION_PATCH_LINE)
unset(SDL_TTF_VERSION_MAJOR)
unset(SDL_TTF_VERSION_MINOR)
unset(SDL_TTF_VERSION_PATCH)
endif()
set(SDL2_TTF_LIBRARIES ${SDL2_TTF_LIBRARY})
set(SDL2_TTF_INCLUDE_DIRS ${SDL2_TTF_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_ttf
REQUIRED_VARS SDL2_TTF_LIBRARIES SDL2_TTF_INCLUDE_DIRS
VERSION_VAR SDL2_TTF_VERSION_STRING)
# for backward compatiblity
set(SDL2TTF_LIBRARY ${SDL2_TTF_LIBRARIES})
set(SDL2TTF_INCLUDE_DIR ${SDL2_TTF_INCLUDE_DIRS})
set(SDL2TTF_FOUND ${SDL2_TTF_FOUND})
mark_as_advanced(SDL2_TTF_LIBRARY SDL2_TTF_INCLUDE_DIR)

View file

@ -17,7 +17,7 @@ set(GETTEXT_XGETTEXT_OPTIONS
--force-po
--add-comments=TRANSLATORS
--copyright-holder=\"Wesnoth development team\"
--msgid-bugs-address=\"http://bugs.wesnoth.org/\"
--msgid-bugs-address=\"https://bugs.wesnoth.org/\"
--from-code=UTF-8
--sort-by-file
--keyword=_

View file

@ -91,6 +91,6 @@ ENDIF()
# handle the QUIETLY and REQUIRED arguments and set XXX_FOUND to TRUE if all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(VORBISFILE DEFAULT_MSG VORBISFILE_LIBRARIES VORBISFILE_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(VorbisFile DEFAULT_MSG VORBISFILE_LIBRARIES VORBISFILE_INCLUDE_DIR)
mark_as_advanced(VORBISFILE_INCLUDE_DIR VORBISFILE_LIBRARIES VORBISFILE_LIBRARY VORBISFILE_LIBRARY_DEBUG)

View file

@ -0,0 +1,72 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# SelectLibraryConfigurations
# ---------------------------
#
#
#
# select_library_configurations( basename )
#
# This macro takes a library base name as an argument, and will choose
# good values for basename_LIBRARY, basename_LIBRARIES,
# basename_LIBRARY_DEBUG, and basename_LIBRARY_RELEASE depending on what
# has been found and set. If only basename_LIBRARY_RELEASE is defined,
# basename_LIBRARY will be set to the release value, and
# basename_LIBRARY_DEBUG will be set to basename_LIBRARY_DEBUG-NOTFOUND.
# If only basename_LIBRARY_DEBUG is defined, then basename_LIBRARY will
# take the debug value, and basename_LIBRARY_RELEASE will be set to
# basename_LIBRARY_RELEASE-NOTFOUND.
#
# If the generator supports configuration types, then basename_LIBRARY
# and basename_LIBRARIES will be set with debug and optimized flags
# specifying the library to be used for the given configuration. If no
# build type has been set or the generator in use does not support
# configuration types, then basename_LIBRARY and basename_LIBRARIES will
# take only the release value, or the debug value if the release one is
# not set.
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
# Dicharry <wdicharry@stellarscience.com>.
macro( select_library_configurations basename )
if(NOT ${basename}_LIBRARY_RELEASE)
set(${basename}_LIBRARY_RELEASE "${basename}_LIBRARY_RELEASE-NOTFOUND" CACHE FILEPATH "Path to a library.")
endif()
if(NOT ${basename}_LIBRARY_DEBUG)
set(${basename}_LIBRARY_DEBUG "${basename}_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "Path to a library.")
endif()
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE AND
( _isMultiConfig OR CMAKE_BUILD_TYPE ) )
# if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
# single-config generators, set optimized and debug libraries
set( ${basename}_LIBRARY "" )
foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE )
list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
endforeach()
foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG )
list( APPEND ${basename}_LIBRARY debug "${_libname}" )
endforeach()
elseif( ${basename}_LIBRARY_RELEASE )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
elseif( ${basename}_LIBRARY_DEBUG )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG} )
else()
set( ${basename}_LIBRARY "${basename}_LIBRARY-NOTFOUND")
endif()
set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
if( ${basename}_LIBRARY )
set( ${basename}_FOUND TRUE )
endif()
mark_as_advanced( ${basename}_LIBRARY_RELEASE
${basename}_LIBRARY_DEBUG
)
endmacro()

View file

@ -1,6 +1,6 @@
/*
Copyright (C) 2003 - 2018 by David White <dave@whitevine.net>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2

View file

@ -56,17 +56,6 @@
default=yes
[/advanced_preference]
[advanced_preference]
field=ping_timeout
name= _ "Ping timeout"
description= _ "Number of seconds to wait for a ping reply before timing out. Set to 0 to disable"
type=int
default=0
min=0
max=60
step=5
[/advanced_preference]
[advanced_preference]
field=lobby_auto_open_whisper_windows
name= _ "Auto-open whisper windows in lobby"
@ -150,12 +139,6 @@
default=yes
[/advanced_preference]
[advanced_preference]
field=advanced_graphic_options
name= _ "Graphics scaling options"
type=custom
[/advanced_preference]
[advanced_preference]
field=orb_color
name= _ "Customize orb colors"
@ -177,207 +160,22 @@
[/advanced_preference]
[advanced_preference]
field=show_halos
name= _ "Show haloing effects"
description= _ "Show special unit graphical effects"
field=show_deprecation
name= _ "Show deprecation messages in-game"
description= _ "Show warnings about deprecated API in the in-game chat area. These messages will still be shown in the log, even if this is disabled. In addition, the deprecation log-domain controls how many messages are printed."
type=boolean
default=yes
default=no
[/advanced_preference]
[advanced_preference]
field=use_prng
name= _ "Use experimental PRNG combat"
description= _ "Enables more determinstic chance-to-hit calculations. This is an experimental feature designed to bring the observed hit/miss rate more in line with the displayed percentages.
Note: this option only affects singleplayer, and the Save random seed option must also be enabled when creating a game for this to work."
type=boolean
default=no
[/advanced_preference]
#ifdef __UNUSED__
[advanced_preference]
field=show_deprecation
# TODO: Add translation marks and enable this after 1.14
name="Show deprecation messages in-game"
description="Show warnings about deprecated API in the in-game chat area. These messages will still be shown in the log, even if this is disabled. In addition, the deprecation log-domain controls how many messages are printed."
type=boolean
default=no
[/advanced_preference]
[advanced_preference]
field=joystick_support_enabled
name= _ "Joystick support"
type=boolean
default=no
[/advanced_preference]
[advanced_preference]
field=joystick_num_scroll_xaxis
name= _ "Joystick: number of the scroll X-axis joystick"
type=int
default=0
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_scroll_xaxis_num
name= _ "Joystick: number of the scroll X-axis"
type=int
default=0
min=0
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_num_scroll_yaxis
name= _ "Joystick: number of the scroll Y-axis joystick"
type=int
default=0
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_scroll_yaxis_num
name= _ "Joystick: number of the scroll Y-axis"
type=int
default=1
min=0
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_scroll_deadzone
name= _ "Joystick: deadzone of the scrolling stick"
type=int
default=1500
min=0
max=16000
step=500
[/advanced_preference]
[advanced_preference]
field=joystick_num_cursor_xaxis
name= _ "Joystick: number of the cursor X-axis joystick"
type=int
default=0
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_cursor_xaxis_num
name= _ "Joystick: number of the cursor X-axis"
type=int
default=3
min=0
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_num_cursor_yaxis
name= _ "Joystick: number of the cursor Y-axis joystick"
type=int
default=0
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_cursor_yaxis_num
name= _ "Joystick: number of the cursor Y-axis"
type=int
default=4
min=-1
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_cursor_deadzone
name= _ "Joystick: deadzone of the cursor stick"
type=int
default=1500
min=0
max=16000
step=500
[/advanced_preference]
[advanced_preference]
field=joystick_num_mouse_xaxis
name= _ "Joystick: number of the mouse X-axis joystick"
type=int
default=-1
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_mouse_xaxis_num
name= _ "Joystick: number of the mouse X-axis"
type=int
default=0
min=0
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_num_mouse_yaxis
name= _ "Joystick: number of the mouse Y-axis joystick"
type=int
default=-1
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_mouse_yaxis_num
name= _ "Joystick: number of the mouse Y-axis"
type=int
default=1
min=0
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_mouse_deadzone
name= _ "Joystick: deadzone of the mouse stick"
type=int
default=1500
min=0
max=16000
step=500
[/advanced_preference]
[advanced_preference]
field=joystick_num_thrusta_axis
name= _ "Joystick: number of the thrust axis joystick"
type=int
default=0
min=-1
max=3
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_thrusta_axis_num
name= _ "Joystick: number of the thrust axis"
type=int
default=2
min=0
max=7
step=1
[/advanced_preference]
[advanced_preference]
field=joystick_thrusta_deadzone
name= _ "Joystick: deadzone of the thruster"
type=int
default=1500
min=0
max=16000
step=500
[/advanced_preference]
#endif

View file

@ -1,2 +1,2 @@
# wmllint: no translatables
{ai/ais/ai_generic_rush.cfg}
{ai/ais/ai_experimental.cfg}

View file

@ -125,7 +125,7 @@ function ai_helper.print_ts(...)
local arg = { ... }
arg[#arg+1] = string.format('[ t = %.3f ]', ts)
print(table.unpack(arg))
std_print(table.unpack(arg))
return ts
end
@ -143,7 +143,7 @@ function ai_helper.print_ts_delta(start_time, ...)
local arg = { ... }
arg[#arg+1] = string.format('[ t = %.3f, dt = %.3f ]', ts, delta)
print(table.unpack(arg))
std_print(table.unpack(arg))
return ts, delta
end
@ -639,6 +639,21 @@ function ai_helper.is_opposite_adjacent(hex1, hex2, center_hex)
return false
end
function ai_helper.get_locations_no_borders(location_filter)
-- Returns the same locations array as wesnoth.get_locations(location_filter),
-- but excluding hexes on the map border.
--
-- This is faster than alternative methods, at least with the current
-- implementation of standard location filter evaluation by the engine.
-- Note that this might not work if @location_filter is a vconfig object.
local old_include_borders = location_filter.include_borders
location_filter.include_borders = false
local locs = wesnoth.get_locations(location_filter)
location_filter.include_borders = old_include_borders
return locs
end
function ai_helper.get_closest_location(hex, location_filter, unit)
-- Get the location closest to @hex (in format { x, y })
-- that matches @location_filter (in WML table format)
@ -678,7 +693,7 @@ function ai_helper.get_closest_location(hex, location_filter, unit)
if unit then
for _,loc in ipairs(locs) do
local movecost = wesnoth.unit_movement_cost(unit, wesnoth.get_terrain(loc[1], loc[2]))
local movecost = unit:movement(wesnoth.get_terrain(loc[1], loc[2]))
if (movecost <= unit.max_moves) then return loc end
end
else
@ -698,18 +713,13 @@ function ai_helper.get_passable_locations(location_filter, unit)
-- excluding border hexes are returned
-- All hexes that are not on the map border
local width, height = wesnoth.get_map_size()
local all_locs = wesnoth.get_locations{
x = '1-' .. width,
y = '1-' .. height,
{ "and", location_filter }
}
local all_locs = ai_helper.get_locations_no_borders(location_filter)
-- If @unit is provided, exclude terrain that's impassable for the unit
if unit then
local locs = {}
for _,loc in ipairs(all_locs) do
local movecost = wesnoth.unit_movement_cost(unit, wesnoth.get_terrain(loc[1], loc[2]))
local movecost = unit:movement(wesnoth.get_terrain(loc[1], loc[2]))
if (movecost <= unit.max_moves) then table.insert(locs, loc) end
end
return locs
@ -895,43 +905,26 @@ end
--------- Unit related helper functions ----------
function ai_helper.get_live_units(filter)
-- Same as wesnoth.get_units(), except that it only returns non-petrified units
local all_units = wesnoth.get_units(filter)
local units = {}
for _,unit in ipairs(all_units) do
if (not unit.status.petrified) then table.insert(units, unit) end
end
return units
-- Note: the order of the filters and the [and] tags are important for speed reasons
return wesnoth.get_units { { "not", { status = "petrified" } }, { "and", filter } }
end
function ai_helper.get_units_with_moves(filter)
-- Using formula = '$this_unit.moves > 0' is slow, this method is much faster
local all_units = wesnoth.get_units(filter)
local units = {}
for _,unit in ipairs(all_units) do
if (unit.moves > 0) then table.insert(units, unit) end
end
return units
-- Note: the order of the filters and the [and] tags are important for speed reasons
return wesnoth.get_units {
{ "and", { formula = "moves > 0" } },
{ "not", { status = "petrified" } },
{ "and", filter }
}
end
function ai_helper.get_units_with_attacks(filter)
-- Using formula = '$this_unit.attacks_left > 0' is slow, this method is much faster
-- Also need to check that units actually have attacks (as attacks_left > 0 with no attacks is possible)
local all_units = wesnoth.get_units(filter)
local units = {}
for _,unit in ipairs(all_units) do
if (unit.attacks_left > 0) and (#unit.attacks > 0) then
table.insert(units, unit)
end
end
return units
-- Note: the order of the filters and the [and] tags are important for speed reasons
return wesnoth.get_units {
{ "and", { formula = "attacks_left > 0 and size(attacks) > 0" } },
{ "not", { status = "petrified" } },
{ "and", filter }
}
end
function ai_helper.get_visible_units(viewing_side, filter)
@ -1077,7 +1070,7 @@ function ai_helper.get_closest_enemy(loc, side, cfg)
x, y = loc[1], loc[2]
end
local closest_distance, location = 9e99
local closest_distance, location = math.huge
for _,enemy in ipairs(enemies) do
enemy_distance = M.distance_between(x, y, enemy.x, enemy.y)
if (enemy_distance < closest_distance) then
@ -1092,9 +1085,9 @@ end
function ai_helper.has_ability(unit, ability)
-- Returns true/false depending on whether unit has the given ability
local has_ability = false
local abilities = H.get_child(unit.__cfg, "abilities")
local abilities = wml.get_child(unit.__cfg, "abilities")
if abilities then
if H.get_child(abilities, ability) then has_ability = true end
if wml.get_child(abilities, ability) then has_ability = true end
end
return has_ability
end
@ -1113,7 +1106,7 @@ function ai_helper.has_weapon_special(unit, special)
end
function ai_helper.get_cheapest_recruit_cost()
local cheapest_unit_cost = 9e99
local cheapest_unit_cost = math.huge
for _,recruit_id in ipairs(wesnoth.sides[wesnoth.current.side].recruit) do
if wesnoth.unit_types[recruit_id].cost < cheapest_unit_cost then
cheapest_unit_cost = wesnoth.unit_types[recruit_id].cost
@ -1389,7 +1382,7 @@ function ai_helper.find_path_with_shroud(unit, x, y, cfg)
if (u.side ~= viewing_side)
and (not ai_helper.is_visible_unit(viewing_side, u))
then
wesnoth.extract_unit(u)
u:extract()
table.insert(extracted_units, u)
end
end
@ -1401,7 +1394,7 @@ function ai_helper.find_path_with_shroud(unit, x, y, cfg)
path, cost = wesnoth.find_path(unit, x, y, cfg_copy)
for _,extracted_unit in ipairs(extracted_units) do
wesnoth.put_unit(extracted_unit)
extracted_unit:to_map()
end
else
path, cost = wesnoth.find_path(unit, x, y, cfg)
@ -1433,7 +1426,7 @@ function ai_helper.find_best_move(units, rating_function, cfg)
-- If this is an individual unit, turn it into an array
if units.hitpoints then units = { units } end
local max_rating, best_hex, best_unit = -9e99, {}, {}
local max_rating, best_hex, best_unit = - math.huge, {}, {}
for _,unit in ipairs(units) do
-- Hexes each unit can reach
local reach_map = ai_helper.get_reachable_unocc(unit, cfg)
@ -1477,7 +1470,7 @@ function ai_helper.move_unit_out_of_way(ai, unit, cfg)
local reach = wesnoth.find_reach(unit, cfg)
local reach_map = LS.create()
local max_rating, best_hex = -9e99
local max_rating, best_hex = - math.huge
for _,loc in ipairs(reach) do
local unit_in_way = wesnoth.get_unit(loc[1], loc[2])
if (not unit_in_way) -- also excludes current hex
@ -1548,7 +1541,6 @@ function ai_helper.movefull_outofway_stopunit(ai, unit, x, y, cfg)
if unit_in_way and (unit_in_way ~= unit)
and ai_helper.is_visible_unit(viewing_side, unit_in_way)
then
--W.message { speaker = 'narrator', message = 'Moving out of way' }
ai_helper.move_unit_out_of_way(ai, unit_in_way, cfg)
end
end
@ -1690,7 +1682,7 @@ function ai_helper.get_attacks(units, cfg)
for _,target in ipairs(attack_hex_map:get(loc[1], loc[2])) do
local att_stats, def_stats
if cfg.simulate_combat then
local unit_dst = wesnoth.copy_unit(unit)
local unit_dst = unit:clone()
unit_dst.x, unit_dst.y = loc[1], loc[2]
local enemy = all_units[target.i]

View file

@ -38,45 +38,42 @@ function battle_calcs.unit_attack_info(unit, cache)
resist_mod = {},
alignment = unit_cfg.alignment
}
for attack in H.child_range(unit_cfg, 'attack') do
local attacks = unit.attacks
for i_a = 1,#attacks do
local attack = attacks[i_a]
-- Extract information for specials; we do this first because some
-- custom special might have the same name as one of the default scalar fields
local a = {}
for special in H.child_range(attack, 'specials') do
for _,sp in ipairs(special) do
if (sp[1] == 'damage') then -- this is 'backstab'
if (sp[2].id == 'backstab') then
a.backstab = true
else
if (sp[2].id == 'charge') then a.charge = true end
end
for _,sp in ipairs(attack.specials) do
if (sp[1] == 'damage') then -- this is 'backstab'
if (sp[2].id == 'backstab') then
a.backstab = true
else
-- magical, marksman
if (sp[1] == 'chance_to_hit') then
a[sp[2].id] = true
else
a[sp[1]] = true
end
if (sp[2].id == 'charge') then a.charge = true end
end
else
-- magical, marksman
if (sp[1] == 'chance_to_hit') then
a[sp[2].id or 'no_id'] = true
else
a[sp[1]] = true
end
end
end
-- Now extract the scalar (string and number) values from attack
for k,v in pairs(attack) do
if (type(v) == 'number') or (type(v) == 'string') then
a[k] = v
end
end
-- [attack]number= defaults to zero; must be defined for battle_calcs.best_weapons()
a.number = a.number or 0
a.damage = attack.damage
a.type = attack.type
a.range = attack.range
-- number must be defined for battle_calcs.best_weapons()
a.number = attack.number or 0
table.insert(unit_info.attacks, a)
end
local attack_types = { "arcane", "blade", "cold", "fire", "impact", "pierce" }
for _,attack_type in ipairs(attack_types) do
unit_info.resist_mod[attack_type] = wesnoth.unit_resistance(unit, attack_type) / 100.
unit_info.resist_mod[attack_type] = unit:resistance(attack_type) / 100.
end
if cache then cache[cind] = unit_info end
@ -202,10 +199,10 @@ function battle_calcs.best_weapons(attacker, defender, dst, cache)
local defender_info = battle_calcs.unit_attack_info(defender, cache)
-- Best attacker weapon
local max_rating, best_att_weapon, best_def_weapon = -9e99, 0, 0
local max_rating, best_att_weapon, best_def_weapon = - math.huge, 0, 0
for att_weapon_number,att_weapon in ipairs(attacker_info.attacks) do
local att_damage = battle_calcs.strike_damage(attacker, defender, att_weapon_number, 0, { dst[1], dst[2] }, cache)
local max_def_rating, tmp_best_def_weapon = -9e99, 0
local max_def_rating, tmp_best_def_weapon = - math.huge, 0
for def_weapon_number,def_weapon in ipairs(defender_info.attacks) do
if (def_weapon.range == att_weapon.range) then
local def_damage = battle_calcs.strike_damage(defender, attacker, def_weapon_number, 0, { defender.x, defender.y }, cache)
@ -217,7 +214,7 @@ function battle_calcs.best_weapons(attacker, defender, dst, cache)
end
local rating = att_damage * att_weapon.number
if (max_def_rating > -9e99) then rating = rating - max_def_rating / 2. end
if (max_def_rating > - math.huge) then rating = rating - max_def_rating / 2. end
if (rating > max_rating) then
max_rating, best_att_weapon, best_def_weapon = rating, att_weapon_number, tmp_best_def_weapon
@ -532,10 +529,10 @@ function battle_calcs.print_coefficients()
dummy, coeffs = battle_calcs.battle_outcome_coefficients(cfg)
end
print()
print('Attacker: ' .. cfg.att.strikes .. ' strikes, can survive ' .. cfg.att.max_hits .. ' hits')
print('Defender: ' .. cfg.def.strikes .. ' strikes, can survive ' .. cfg.def.max_hits .. ' hits')
print('Chance of hits on defender: ')
std_print()
std_print('Attacker: ' .. cfg.att.strikes .. ' strikes, can survive ' .. cfg.att.max_hits .. ' hits')
std_print('Defender: ' .. cfg.def.strikes .. ' strikes, can survive ' .. cfg.def.max_hits .. ' hits')
std_print('Chance of hits on defender: ')
-- The first indices of coeffs are the possible number of hits the attacker can land on the defender
for hits = 0,#coeffs do
@ -570,8 +567,8 @@ function battle_calcs.print_coefficients()
local skip_str = ''
if combs.skip then skip_str = ' (skip)' end
print(hits .. skip_str .. ': ' .. str)
print(' = ' .. hit_prob)
std_print(hits .. skip_str .. ': ' .. str)
std_print(' = ' .. hit_prob)
end
end
end
@ -680,8 +677,8 @@ function battle_calcs.battle_outcome(attacker, defender, cfg, cache)
if (def_max_hits > att_strikes) then def_max_hits = att_strikes end
-- Probability of landing a hit
local att_hit_prob = wesnoth.unit_defense(defender, wesnoth.get_terrain(defender.x, defender.y)) / 100.
local def_hit_prob = wesnoth.unit_defense(attacker, wesnoth.get_terrain(dst[1], dst[2])) / 100.
local att_hit_prob = defender:defense(wesnoth.get_terrain(defender.x, defender.y)) / 100.
local def_hit_prob = attacker:defense(wesnoth.get_terrain(dst[1], dst[2])) / 100.
-- Magical: attack and defense, and under all circumstances
if att_attack.magical then att_hit_prob = 0.7 end
@ -731,7 +728,7 @@ function battle_calcs.simulate_combat_loc(attacker, dst, defender, weapon)
-- when on terrain of same type as that at @dst, which is of form { x, y }
-- If @weapon is set, use that weapon (Lua index starting at 1), otherwise use best weapon
local attacker_dst = wesnoth.copy_unit(attacker)
local attacker_dst = attacker:clone()
attacker_dst.x, attacker_dst.y = dst[1], dst[2]
if weapon then
@ -837,7 +834,7 @@ function battle_calcs.attack_rating(attacker, defender, dst, cfg, cache)
-- In addition, potentially leveling up in this attack is a huge bonus,
-- proportional to the chance of it happening and the chance of not dying itself
local level_bonus = 0.
local defender_level = wesnoth.unit_types[defender.type].level
local defender_level = defender.level
if (attacker.max_experience - attacker.experience <= defender_level) then
level_bonus = 1. - att_stats.hp_chance[0]
else
@ -849,7 +846,7 @@ function battle_calcs.attack_rating(attacker, defender, dst, cfg, cache)
-- Now convert this into gold-equivalent value
local attacker_value = wesnoth.unit_types[attacker.type].cost
local attacker_value = attacker.cost
-- Being closer to leveling is good (this makes AI prefer units with lots of XP)
local xp_bonus = attacker.experience / attacker.max_experience
@ -886,7 +883,7 @@ function battle_calcs.attack_rating(attacker, defender, dst, cfg, cache)
-- In addition, the defender potentially leveling up in this attack is a huge penalty,
-- proportional to the chance of it happening and the chance of not dying itself
local defender_level_penalty = 0.
local attacker_level = wesnoth.unit_types[attacker.type].level
local attacker_level = attacker.level
if (defender.max_experience - defender.experience <= attacker_level) then
defender_level_penalty = 1. - def_stats.hp_chance[0]
else
@ -897,7 +894,7 @@ function battle_calcs.attack_rating(attacker, defender, dst, cfg, cache)
value_fraction = value_fraction - defender_level_penalty * defender_level_weight
-- Now convert this into gold-equivalent value
local defender_value = wesnoth.unit_types[defender.type].cost
local defender_value = defender.cost
-- If this is the enemy leader, make damage to it much more important
if defender.canrecruit then
@ -932,7 +929,7 @@ function battle_calcs.attack_rating(attacker, defender, dst, cfg, cache)
-- We don't need a bonus for good terrain for the attacker, as that is covered in the damage calculation
-- However, we add a small bonus for good terrain defense of the _defender_ on the _attack_ hex
-- This is in order to take good terrain away from defender on next move, all else being equal
local defender_defense = - wesnoth.unit_defense(defender, wesnoth.get_terrain(dst[1], dst[2])) / 100.
local defender_defense = - defender:defense(wesnoth.get_terrain(dst[1], dst[2])) / 100.
defender_value = defender_value + defender_defense * defense_weight
-- Get a very small bonus for hexes in between defender and AI leader
@ -1011,15 +1008,13 @@ function battle_calcs.attack_combo_stats(tmp_attackers, tmp_dsts, defender, cach
--for hp,p in pairs(tmp_def_stats[i].hp_chance) do
-- if (p > 0) then
-- local dhp_norm = (hp - av) / defender.max_hitpoints * wesnoth.unit_types[defender.type].cost
-- local dhp_norm = (hp - av) / defender.max_hitpoints * defender.cost
-- local dvar = p * dhp_norm^2
--print(hp,p,av, dvar)
-- outcome_variance = outcome_variance + dvar
-- n_outcomes = n_outcomes + 1
-- end
--end
--outcome_variance = outcome_variance / n_outcomes
--print('outcome_variance', outcome_variance)
-- Note that this is a variance, not a standard deviations (as in, it's squared),
-- so it does not matter much for low-variance attacks, but takes on large values for
@ -1030,7 +1025,7 @@ function battle_calcs.attack_combo_stats(tmp_attackers, tmp_dsts, defender, cach
-- Almost, bonus should not be quite as high as a really high CTK
-- This isn't quite true in reality, but can be refined later
if AH.has_weapon_special(attacker, "slow") then
rating = rating + wesnoth.unit_types[defender.type].cost / 2.
rating = rating + defender.cost / 2.
end
ratings[i] = { i, rating, base_rating, def_rating, att_rating }
@ -1173,7 +1168,7 @@ function battle_calcs.get_attack_map_unit(unit, cfg)
for _,unit in ipairs(all_units) do
if (unit.moves > 0) then
table.insert(units_MP, unit)
wesnoth.extract_unit(unit)
unit:extract()
end
end
end
@ -1183,7 +1178,7 @@ function battle_calcs.get_attack_map_unit(unit, cfg)
-- Put the units back out there
if (unit.side ~= wesnoth.current.side) then
for _,uMP in ipairs(units_MP) do wesnoth.put_unit(uMP) end
for _,uMP in ipairs(units_MP) do uMP:to_map() end
end
for _,loc in ipairs(initial_reach) do
@ -1250,7 +1245,7 @@ function battle_calcs.relative_damage_map(units, enemies, cache)
-- against any of the enemy units
local unit_ratings = {}
for i,unit in ipairs(units) do
local max_rating, best_enemy = -9e99, {}
local max_rating, best_enemy = - math.huge, {}
for _,enemy in ipairs(enemies) do
local rating, defender_rating, attacker_rating =
battle_calcs.attack_rating(unit, enemy, { unit.x, unit.y }, { enemy_leader_weight = 1 }, cache)
@ -1267,7 +1262,7 @@ function battle_calcs.relative_damage_map(units, enemies, cache)
-- Then we want the same thing for all of the enemy units (for the counter attack on enemy turn)
local enemy_ratings = {}
for i,enemy in ipairs(enemies) do
local max_rating, best_unit = -9e99, {}
local max_rating, best_unit = - math.huge, {}
for _,unit in ipairs(units) do
local rating, defender_rating, attacker_rating =
battle_calcs.attack_rating(enemy, unit, { enemy.x, enemy.y }, { enemy_leader_weight = 1 }, cache)
@ -1312,7 +1307,7 @@ function battle_calcs.best_defense_map(units, cfg)
local defense_map = LS.create()
if cfg.ignore_these_units then
for _,unit in ipairs(cfg.ignore_these_units) do wesnoth.extract_unit(unit) end
for _,unit in ipairs(cfg.ignore_these_units) do unit:extract() end
end
for _,unit in ipairs(units) do
@ -1326,16 +1321,16 @@ function battle_calcs.best_defense_map(units, cfg)
if max_moves then unit.moves = old_moves end
for _,loc in ipairs(reach) do
local defense = 100 - wesnoth.unit_defense(unit, wesnoth.get_terrain(loc[1], loc[2]))
local defense = 100 - unit:defense(wesnoth.get_terrain(loc[1], loc[2]))
if (defense > (defense_map:get(loc[1], loc[2]) or -9e99)) then
if (defense > (defense_map:get(loc[1], loc[2]) or - math.huge)) then
defense_map:insert(loc[1], loc[2], defense)
end
end
end
if cfg.ignore_these_units then
for _,unit in ipairs(cfg.ignore_these_units) do wesnoth.put_unit(unit) end
for _,unit in ipairs(cfg.ignore_these_units) do unit:to_map() end
end
return defense_map
@ -1378,7 +1373,7 @@ function battle_calcs.get_attack_combos_subset(units, enemy, cfg)
cfg = cfg or {}
cfg.order_matters = cfg.order_matters or false
cfg.max_combos = cfg.max_combos or 9e99
cfg.max_combos = cfg.max_combos or math.huge
cfg.max_time = cfg.max_time or false
cfg.skip_presort = cfg.skip_presort or 5
@ -1534,7 +1529,7 @@ function battle_calcs.get_attack_combos_subset(units, enemy, cfg)
-- Store information about it in 'loc' and add this to 'locs'
-- Want coordinates (dst) and terrain defense (for sorting)
loc.dst = xa * 1000 + ya
loc.hit_prob = wesnoth.unit_defense(unit, wesnoth.get_terrain(xa, ya))
loc.hit_prob = unit:defense(wesnoth.get_terrain(xa, ya))
table.insert(locs, loc)
-- Also mark this hex as usable

View file

@ -0,0 +1,202 @@
-------- Castle Switch CA --------------
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local M = wesnoth.map
local CS_leader_score
-- Note that leader_target is also needed by the recruiting CA, so it must be stored in 'data'
local function get_reachable_enemy_leaders(unit)
-- We're cheating a little here and also find hidden enemy leaders. That's
-- because a human player could make a pretty good educated guess as to where
-- the enemy leaders are likely to be while the AI does not know how to do that.
local potential_enemy_leaders = AH.get_live_units { canrecruit = 'yes',
{ "filter_side", { { "enemy_of", {side = wesnoth.current.side} } } }
}
local enemy_leaders = {}
for j,e in ipairs(potential_enemy_leaders) do
local path, cost = wesnoth.find_path(unit, e.x, e.y, { ignore_units = true, viewing_side = 0 })
if cost < AH.no_path then
table.insert(enemy_leaders, e)
end
end
return enemy_leaders
end
local ca_castle_switch = {}
function ca_castle_switch:evaluation(cfg, data)
local start_time, ca_name = wesnoth.get_time_stamp() / 1000., 'castle_switch'
if AH.print_eval() then AH.print_ts(' - Evaluating castle_switch CA:') end
if ai.aspects.passive_leader then
-- Turn off this CA if the leader is passive
return 0
end
local leader = wesnoth.get_units {
side = wesnoth.current.side,
canrecruit = 'yes',
formula = '(movement_left = total_movement) and (hitpoints = max_hitpoints)'
}[1]
if not leader then
-- CA is irrelevant if no leader or the leader may have moved from another CA
data.leader_target = nil
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
local cheapest_unit_cost = AH.get_cheapest_recruit_cost()
if data.leader_target and wesnoth.sides[wesnoth.current.side].gold >= cheapest_unit_cost then
-- make sure move is still valid
local next_hop = AH.next_hop(leader, data.leader_target[1], data.leader_target[2])
if next_hop and next_hop[1] == data.leader_target[1]
and next_hop[2] == data.leader_target[2] then
return CS_leader_score
end
end
local keeps = AH.get_locations_no_borders {
terrain = 'K*,K*^*,*^K*', -- Keeps
{ "not", { {"filter", {}} }}, -- That have no unit
{ "not", { radius = 6, {"filter", { canrecruit = 'yes',
{ "filter_side", { { "enemy_of", {side = wesnoth.current.side} } } }
}} }}, -- That are not too close to an enemy leader
{ "not", {
x = leader.x, y = leader.y, terrain = 'K*,K*^*,*^K*',
radius = 3,
{ "filter_radius", { terrain = 'C*,K*,C*^*,K*^*,*^K*,*^C*' } }
}}, -- That are not close and connected to a keep the leader is on
{ "filter_adjacent_location", {
terrain = 'C*,K*,C*^*,K*^*,*^K*,*^C*'
}} -- That are not one-hex keeps
}
if #keeps < 1 then
-- Skip if there aren't extra keeps to evaluate
-- In this situation we'd only switch keeps if we were running away
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
local enemy_leaders = get_reachable_enemy_leaders(leader)
-- Look for the best keep
local best_score, best_loc, best_turns = 0, {}, 3
for i,loc in ipairs(keeps) do
-- Only consider keeps within 2 turns movement
local path, cost = wesnoth.find_path(leader, loc[1], loc[2])
local score = 0
-- Prefer closer keeps to enemy
local turns = math.ceil(cost/leader.max_moves)
if turns <= 2 then
score = 1/turns
for j,e in ipairs(enemy_leaders) do
score = score + 1 / M.distance_between(loc[1], loc[2], e.x, e.y)
end
if score > best_score then
best_score = score
best_loc = loc
best_turns = turns
end
end
end
-- If we're on a keep,
-- don't move to another keep unless it's much better when uncaptured villages are present
if best_score > 0 and wesnoth.get_terrain_info(wesnoth.get_terrain(leader.x, leader.y)).keep then
local close_unowned_village = (wesnoth.get_villages {
{ "and", {
x = leader.x,
y = leader.y,
radius = leader.max_moves
}},
owner_side = 0
})[1]
if close_unowned_village then
local score = 1/best_turns
for j,e in ipairs(enemy_leaders) do
-- count all distances as three less than they actually are
score = score + 1 / (M.distance_between(leader.x, leader.y, e.x, e.y) - 3)
end
if score > best_score then
best_score = 0
end
end
end
if best_score > 0 then
local next_hop = AH.next_hop(leader, best_loc[1], best_loc[2])
if next_hop and ((next_hop[1] ~= leader.x) or (next_hop[2] ~= leader.y)) then
-- See if there is a nearby village that can be captured without delaying progress
local close_villages = wesnoth.get_villages( {
{ "and", { x = next_hop[1], y = next_hop[2], radius = leader.max_moves }},
owner_side = 0 })
for i,loc in ipairs(close_villages) do
local path_village, cost_village = wesnoth.find_path(leader, loc[1], loc[2])
if cost_village <= leader.moves then
local dummy_leader = leader:clone()
dummy_leader.x = loc[1]
dummy_leader.y = loc[2]
local path_keep, cost_keep = wesnoth.find_path(dummy_leader, best_loc[1], best_loc[2])
local turns_from_keep = math.ceil(cost_keep/leader.max_moves)
if turns_from_keep < best_turns
or (turns_from_keep == 1 and wesnoth.sides[wesnoth.current.side].gold < cheapest_unit_cost)
then
-- There is, go there instead
next_hop = loc
break
end
end
end
end
data.leader_target = next_hop
-- if we're on a keep, wait until there are no movable units on the castle before moving off
CS_leader_score = 195000
if wesnoth.get_terrain_info(wesnoth.get_terrain(leader.x, leader.y)).keep then
local castle = AH.get_locations_no_borders {
{ "and", {
x = leader.x, y = leader.y, radius = 200,
{ "filter_radius", { terrain = 'C*,K*,C*^*,K*^*,*^K*,*^C*' } }
}}
}
local should_wait = false
for i,loc in ipairs(castle) do
local unit = wesnoth.get_unit(loc[1], loc[2])
if (not AH.is_visible_unit(wesnoth.current.side, unit)) then
should_wait = false
break
elseif unit.moves > 0 then
should_wait = true
end
end
if should_wait then
CS_leader_score = 15000
end
end
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return CS_leader_score
end
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
function ca_castle_switch:execution(cfg, data)
local leader = wesnoth.get_units { side = wesnoth.current.side, canrecruit = 'yes' }[1]
if AH.print_exec() then AH.print_ts(' Executing castle_switch CA') end
if AH.show_messages() then wesnoth.wml_actions.message { speaker = leader.id, message = 'Switching castles' } end
AH.checked_move(ai, leader, data.leader_target[1], data.leader_target[2])
data.leader_target = nil
end
return ca_castle_switch

View file

@ -0,0 +1,140 @@
------- Grab Villages CA --------------
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local M = wesnoth.map
local GV_unit, GV_village
local ca_grab_villages = {}
function ca_grab_villages:evaluation(cfg, data)
local start_time, ca_name = wesnoth.get_time_stamp() / 1000., 'grab_villages'
if AH.print_eval() then AH.print_ts(' - Evaluating grab_villages CA:') end
-- Check if there are units with moves left
local units = AH.get_units_with_moves { side = wesnoth.current.side, canrecruit = 'no' }
if (not units[1]) then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
local enemies = AH.get_attackable_enemies()
local villages = wesnoth.get_villages()
-- Just in case:
if (not villages[1]) then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
-- First check if attacks are possible for any unit
local return_value = 191000
-- If one with > 50% chance of kill is possible, set return_value to lower than combat CA
local attacks = ai.get_attacks()
for i,a in ipairs(attacks) do
if (#a.movements == 1) and (a.chance_to_kill > 0.5) then
return_value = 90000
break
end
end
-- Also find which locations can be attacked by enemies
local enemy_attack_map = BC.get_attack_map(enemies).units
-- Now we go through the villages and units
local max_rating, best_village, best_unit = - math.huge
local village_ratings = {}
for j,v in ipairs(villages) do
-- First collect all information that only depends on the village
local village_rating = 0 -- This is the unit independent rating
local unit_in_way = wesnoth.get_unit(v[1], v[2])
-- If an enemy can get within one move of the village, we want to hold it
if enemy_attack_map:get(v[1], v[2]) then
village_rating = village_rating + 100
end
-- Unowned and enemy-owned villages get a large bonus
local owner = wesnoth.get_village_owner(v[1], v[2])
if (not owner) then
village_rating = village_rating + 10000
else
if wesnoth.is_enemy(owner, wesnoth.current.side) then village_rating = village_rating + 20000 end
end
local enemy_distance_from_village = AH.get_closest_enemy(v)
-- Now we go on to the unit-dependent rating
local best_unit_rating = - math.huge
local reachable = false
for i,u in ipairs(units) do
-- Skip villages that have units other than 'u' itself on them
local village_occupied = false
if AH.is_visible_unit(wesnoth.current.side, unit_in_way) and ((unit_in_way ~= u)) then
village_occupied = true
end
-- Rate all villages that can be reached and are unoccupied by other units
if (not village_occupied) then
-- Path finding is expensive, so we do a first cut simply by distance
-- There is no way a unit can get to the village if the distance is greater than its moves
local dist = M.distance_between(u.x, u.y, v[1], v[2])
if (dist <= u.moves) then
local path, cost = wesnoth.find_path(u, v[1], v[2])
if (cost <= u.moves) then
village_rating = village_rating - 1
reachable = true
local rating = 0
-- Prefer strong units if enemies can reach the village, injured units otherwise
if enemy_attack_map:get(v[1], v[2]) then
rating = rating + u.hitpoints
else
rating = rating + u.max_hitpoints - u.hitpoints
end
-- Prefer not backtracking and moving more distant units to capture villages
local enemy_distance_from_unit = AH.get_closest_enemy({u.x, u.y})
rating = rating - (enemy_distance_from_village + enemy_distance_from_unit)/5
if (rating > best_unit_rating) then
best_unit_rating, best_unit = rating, u
end
end
end
end
end
village_ratings[v] = {village_rating, best_unit, reachable}
end
for j,v in ipairs(villages) do
local rating = village_ratings[v][1]
if village_ratings[v][3] and rating > max_rating then
max_rating, best_village, best_unit = rating, v, village_ratings[v][2]
end
end
if best_village then
GV_unit, GV_village = best_unit, best_village
if (max_rating >= 1000) then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return return_value
else
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
end
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
function ca_grab_villages:execution(cfg, data)
if AH.print_exec() then AH.print_ts(' Executing grab_villages CA') end
if AH.show_messages() then wesnoth.wml_actions.message { speaker = GV_unit.id, message = 'Grab villages' } end
AH.movefull_stopunit(ai, GV_unit, GV_village)
GV_unit, GV_village = nil, nil
end
return ca_grab_villages

View file

@ -26,6 +26,8 @@ local M = wesnoth.map
-- so that we can follow up with stronger units. In addition, use of poison or
-- slow attacks is strongly discouraged. See code for exact equations.
local XP_attack
local ca_attack_highxp = {}
function ca_attack_highxp:evaluation(cfg, data)
@ -82,7 +84,7 @@ function ca_attack_highxp:evaluation(cfg, data)
if (not target_infos[1]) then return 0 end
-- The following location sets are used so that we at most need to call
-- find_reach() and wesnoth.copy_unit() once per unit
-- find_reach() and unit:clone() once per unit
local reaches = LS.create()
local attacker_copies = LS.create()
@ -217,7 +219,7 @@ function ca_attack_highxp:evaluation(cfg, data)
if attacker_copies:get(attacker.x, attacker.y) then
attacker_copy = attacker_copies:get(attacker.x, attacker.y)
else
attacker_copy = wesnoth.copy_unit(attacker)
attacker_copy = attacker:clone()
attacker_copies:insert(attacker.x, attacker.y, attacker_copy)
end
@ -242,14 +244,14 @@ function ca_attack_highxp:evaluation(cfg, data)
rating = 1000
local enemy_value_loss = (target.hitpoints - def_stats.average_hp) / target.max_hitpoints
enemy_value_loss = enemy_value_loss * wesnoth.unit_types[target.type].cost
enemy_value_loss = enemy_value_loss * target.cost
-- We want the _least_ damage to the enemy, so the minus sign is no typo!
rating = rating - enemy_value_loss
local own_value_loss = (attacker_copy.hitpoints - att_stats.average_hp) / attacker_copy.max_hitpoints
own_value_loss = own_value_loss + att_stats.hp_chance[0]
own_value_loss = own_value_loss * wesnoth.unit_types[attacker_copy.type].cost
own_value_loss = own_value_loss * attacker_copy.cost
rating = rating - own_value_loss
@ -284,15 +286,15 @@ function ca_attack_highxp:evaluation(cfg, data)
end
if best_attack then
data.XP_attack = best_attack
XP_attack = best_attack
end
return max_ca_score
end
function ca_attack_highxp:execution(cfg, data)
AH.robust_move_and_attack(ai, data.XP_attack.src, data.XP_attack.dst, data.XP_attack.target, { weapon = data.XP_attack.attack_num })
data.XP_attack = nil
AH.robust_move_and_attack(ai, XP_attack.src, XP_attack.dst, XP_attack.target, { weapon = XP_attack.attack_num })
XP_attack = nil
end
return ca_attack_highxp

View file

@ -0,0 +1,62 @@
------- Move To Any Enemy CA --------------
-- Move AI units toward any enemy on the map. This has a very low CA score and
-- only kicks in when the AI would do nothing else. It prevents the AI from
-- being inactive on maps without enemy leaders and villages.
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local MTAE_unit, MTAE_destination
local ca_move_to_any_enemy = {}
function ca_move_to_any_enemy:evaluation(cfg, data)
local start_time, ca_name = wesnoth.get_time_stamp() / 1000., 'move_to_any_enemy'
if AH.print_eval() then AH.print_ts(' - Evaluating move_to_any_enemy CA:') end
local units = AH.get_units_with_moves {
side = wesnoth.current.side,
canrecruit = 'no'
}
if (not units[1]) then
-- No units with moves left
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
local unit, destination
-- Find a unit that has a path to an space close to an enemy
for i,u in ipairs(units) do
local distance, target = AH.get_closest_enemy({u.x, u.y})
if target then
unit = u
local x, y = wesnoth.find_vacant_tile(target.x, target.y)
destination = AH.next_hop(unit, x, y)
if destination then
break
end
end
end
if (not destination) then
-- No path was found
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
MTAE_destination = destination
MTAE_unit = unit
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 1000
end
function ca_move_to_any_enemy:execution(cfg, data)
if AH.print_exec() then AH.print_ts(' Executing move_to_any_enemy CA') end
AH.checked_move(ai, MTAE_unit, MTAE_destination[1], MTAE_destination[2])
MTAE_unit, MTAE_destination = nil,nil
end
return ca_move_to_any_enemy

View file

@ -0,0 +1,25 @@
------- Place Healers CA --------------
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local HS = wesnoth.require "ai/micro_ais/cas/ca_healer_move.lua"
local ca_place_healers = {}
function ca_place_healers:evaluation(cfg, data)
local start_time, ca_name = wesnoth.get_time_stamp() / 1000., 'place_healers'
if AH.print_eval() then AH.print_ts(' - Evaluating place_healers CA:') end
if HS:evaluation(cfg, data) > 0 then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 96000
end
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
function ca_place_healers:execution(cfg, data)
if AH.print_exec(cfg, data) then AH.print_ts(' Executing place_healers CA') end
HS:execution()
end
return ca_place_healers

View file

@ -0,0 +1,45 @@
-- Make the generic_recruit_engine functions work as external CAs
local ca_castle_switch
for ai_tag in wml.child_range(wesnoth.sides[wesnoth.current.side].__cfg, 'ai') do
for stage in wml.child_range(ai_tag, 'stage') do
for ca in wml.child_range(stage, 'candidate_action') do
if ca.location and string.find(ca.location, 'ca_castle_switch') then
ca_castle_switch = wesnoth.require("ai/lua/ca_castle_switch.lua")
break
end
end
end
end
local dummy_engine = { data = {} }
local params = { score_function = (function() return 196000 end) }
if ca_castle_switch then
params.min_turn_1_recruit = (function() return ca_castle_switch:evaluation({}, dummy_engine.data) > 0 end)
params.leader_takes_village = (function()
if ca_castle_switch:evaluation({}, dummy_engine.data) > 0 then
local take_village = #(wesnoth.get_villages {
x = dummy_engine.data.leader_target[1],
y = dummy_engine.data.leader_target[2]
}) > 0
return take_village
end
return not ai.aspects.passive_leader
end
)
end
wesnoth.require("ai/lua/generic_recruit_engine.lua").init(dummy_engine, params)
local ca_recruit_rushers = {}
function ca_recruit_rushers:evaluation(cfg, data)
return dummy_engine:recruit_rushers_eval()
end
function ca_recruit_rushers:execution(cfg, data)
return dummy_engine:recruit_rushers_exec()
end
return ca_recruit_rushers

View file

@ -0,0 +1,43 @@
------- Retreat CA --------------
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local R = wesnoth.require "ai/lua/retreat.lua"
local retreat_unit, retreat_loc
local ca_retreat_injured = {}
function ca_retreat_injured:evaluation(cfg, data)
local start_time, ca_name = wesnoth.get_time_stamp() / 1000., 'retreat_injured'
if AH.print_eval() then AH.print_ts(' - Evaluating retreat_injured CA:') end
local units = AH.get_units_with_moves { side = wesnoth.current.side }
local unit, loc = R.retreat_injured_units(units)
if unit then
retreat_unit = unit
retreat_loc = loc
-- First check if attacks are possible for any unit
-- If one with > 50% chance of kill is possible, set return_value to lower than combat CA
local attacks = ai.get_attacks()
for i,a in ipairs(attacks) do
if (#a.movements == 1) and (a.chance_to_kill > 0.5) then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 95000
end
end
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 192000
end
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
function ca_retreat_injured:execution(cfg, data)
if AH.print_exec() then AH.print_ts(' Executing retreat_injured CA') end
AH.robust_move_and_attack(ai, retreat_unit, retreat_loc)
retreat_unit = nil
retreat_loc = nil
end
return ca_retreat_injured

View file

@ -0,0 +1,103 @@
------- Spread Poison CA --------------
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local SP_attack
local ca_spread_poison = {}
function ca_spread_poison:evaluation(cfg, data)
local start_time, ca_name = wesnoth.get_time_stamp() / 1000., 'spread_poison'
if AH.print_eval() then AH.print_ts(' - Evaluating spread_poison CA:') end
-- If a unit with a poisoned weapon can make an attack, we'll do that preferentially
-- (with some exceptions)
local poisoners = AH.get_units_with_attacks { side = wesnoth.current.side,
{ "filter_wml", {
{ "attack", {
{ "specials", {
{ "poison", { } }
} }
} }
} },
canrecruit = 'no'
}
if (not poisoners[1]) then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
local attacks = AH.get_attacks(poisoners)
if (not attacks[1]) then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
-- Go through all possible attacks with poisoners
local max_rating, best_attack = - math.huge
for i,a in ipairs(attacks) do
local attacker = wesnoth.get_unit(a.src.x, a.src.y)
local defender = wesnoth.get_unit(a.target.x, a.target.y)
-- Don't try to poison a unit that cannot be poisoned
local cant_poison = defender.status.poisoned or defender.status.unpoisonable
-- For now, we also simply don't poison units on villages (unless standard combat CA does it)
local defender_terrain = wesnoth.get_terrain(defender.x, defender.y)
local on_village = wesnoth.get_terrain_info(defender_terrain).village
-- Also, poisoning units that would level up through the attack or could level on their turn as a result is very bad
local about_to_level = defender.max_experience - defender.experience <= (attacker.level * 2)
if (not cant_poison) and (not on_village) and (not about_to_level) then
-- Strongest enemy gets poisoned first
local rating = defender.hitpoints
-- Always attack enemy leader, if possible
if defender.canrecruit then rating = rating + 1000 end
-- Enemies that can regenerate are not good targets
if defender:ability('regenerate') then rating = rating - 1000 end
-- More priority to enemies on strong terrain
local defender_defense = 100 - defender:defense(defender_terrain)
rating = rating + defender_defense / 4.
-- For the same attacker/defender pair, go to strongest terrain
local attacker_terrain = wesnoth.get_terrain(a.dst.x, a.dst.y)
local attacker_defense = 100 - attacker:defense(attacker_terrain)
rating = rating + attacker_defense / 2.
-- And from village everything else being equal
local is_village = wesnoth.get_terrain_info(attacker_terrain).village
if is_village then rating = rating + 0.5 end
if rating > max_rating then
max_rating, best_attack = rating, a
end
end
end
if best_attack then
SP_attack = best_attack
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 190000
end
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
function ca_spread_poison:execution(cfg, data)
local attacker = wesnoth.get_unit(SP_attack.src.x, SP_attack.src.y)
-- If several attacks have poison, this will always find the last one
local is_poisoner, poison_weapon = AH.has_weapon_special(attacker, "poison")
if AH.print_exec() then AH.print_ts(' Executing spread_poison CA') end
if AH.show_messages() then wesnoth.wml_actions.message { speaker = attacker.id, message = 'Poison attack' } end
AH.robust_move_and_attack(ai, attacker, SP_attack.dst, SP_attack.target, { weapon = poison_weapon })
SP_attack = nil
end
return ca_spread_poison

View file

@ -0,0 +1,74 @@
------- Village Hunt CA --------------
-- Give extra priority to seeking villages if we have less than our share
-- our share is defined as being slightly more than the total/the number of sides
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local ca_village_hunt = {}
function ca_village_hunt:evaluation(cfg, data)
local start_time, ca_name = wesnoth.get_time_stamp() / 1000., 'village_hunt'
if AH.print_eval() then AH.print_ts(' - Evaluating village_hunt CA:') end
local villages = wesnoth.get_villages()
if not villages[1] then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
local my_villages = wesnoth.get_villages { owner_side = wesnoth.current.side }
if #my_villages > #villages / #wesnoth.sides then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
local allied_villages = wesnoth.get_villages { {"filter_owner", { {"ally_of", { side = wesnoth.current.side }} }} }
if #allied_villages == #villages then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
local units = AH.get_units_with_moves {
side = wesnoth.current.side,
canrecruit = false
}
if not units[1] then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 30000
end
function ca_village_hunt:execution(cfg, data)
local unit = AH.get_units_with_moves({
side = wesnoth.current.side,
canrecruit = false
})[1]
if AH.print_exec() then AH.print_ts(' Executing village_hunt CA') end
local villages = wesnoth.get_villages()
local best_cost, target = AH.no_path
for i,v in ipairs(villages) do
if not wesnoth.match_location(v[1], v[2], { {"filter_owner", { {"ally_of", { side = wesnoth.current.side }} }} }) then
local path, cost = wesnoth.find_path(unit, v[1], v[2], { ignore_units = true, max_cost = best_cost })
if cost < best_cost then
target = v
best_cost = cost
end
end
end
if target then
local x, y = wesnoth.find_vacant_tile(target[1], target[2], unit)
local dest = AH.next_hop(unit, x, y)
AH.checked_move(ai, unit, dest[1], dest[2])
end
end
return ca_village_hunt

View file

@ -13,7 +13,7 @@ return {
-- min_turn_1_recruit: function that returns true if only enough units to grab nearby villages should be recruited turn 1, false otherwise
-- (default always returns false)
-- leader_takes_village: function that returns true if and only if the leader is going to move to capture a village this turn
-- (default always returns true)
-- (default returns 'not ai.aspects.passive_leader')
-- Note: the recruiting code assumes full knowledge of units on the map and the recruit lists of other sides for the purpose of
-- finding the best unit types to recruit. It does not work otherwise. It assumes normal vision of the AI side (that is, it disregards
-- hidden enemy units) for determining from which keep hex the leader should recruit and on which castle hexes to recruit new units
@ -23,20 +23,9 @@ return {
end
math.randomseed(os.time())
local H = wesnoth.require "helper"
local W = H.set_wml_action_metatable {}
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local M = wesnoth.map
local function print_time(...)
if turn_start_time then
AH.print_ts_delta(turn_start_time, ...)
else
AH.print_ts(...)
end
end
local recruit_data = {}
local no_village_cost = function(recruit_id)
@ -60,10 +49,10 @@ return {
random_gender = false
}
-- Find the best regeneration ability and use it to estimate hp regained by regeneration
local abilities = H.get_child(unit.__cfg, "abilities")
local abilities = wml.get_child(unit.__cfg, "abilities")
local regen_amount = 0
if abilities then
for regen in H.child_range(abilities, "regenerate") do
for regen in wml.child_range(abilities, "regenerate") do
if regen.value > regen_amount then
regen_amount = regen.value
end
@ -93,7 +82,7 @@ return {
local best_defense = 100
for i, terrain in ipairs(terrain_archetypes) do
local defense = wesnoth.unit_defense(unit, terrain)
local defense = unit:defense(terrain)
if defense < best_defense then
best_defense = defense
end
@ -114,28 +103,28 @@ return {
-- In several cases this function only approximates the correct value (eg Thunderguard vs Goblin Spearman has damage capped by target health)
-- In some cases (like poison), this approximation is preferred to the actual value.
local best_damage = 0
local best_attack = nil
local best_attack
local best_poison_damage = 0
-- Steadfast is currently disabled because it biases the AI too much in favour of Guardsmen
-- Basically it sees the defender stats for damage and wrongfully concludes that the unit is amazing
-- This may be rectifiable by looking at retaliation damage as well.
local steadfast = false
for attack in H.child_range(wesnoth.unit_types[attacker.type].__cfg, "attack") do
for attack in wml.child_range(wesnoth.unit_types[attacker.type].__cfg, "attack") do
local defense = defender_defense
local poison = false
local damage_multiplier = 1
local damage_bonus = 0
local weapon_damage = attack.damage
for special in H.child_range(attack, 'specials') do
for special in wml.child_range(attack, 'specials') do
local mod
if H.get_child(special, 'poison') and can_poison then
if wml.get_child(special, 'poison') and can_poison then
poison = true
end
-- Handle marksman and magical
mod = H.get_child(special, 'chance_to_hit')
mod = wml.get_child(special, 'chance_to_hit')
if mod then
if mod.value then
if mod.cumulative then
@ -157,7 +146,7 @@ return {
end
-- Handle most damage specials (assumes all are cumulative)
mod = H.get_child(special, 'damage')
mod = wml.get_child(special, 'damage')
if mod and mod.active_on ~= "defense" then
local special_multiplier = 1
local special_bonus = 0
@ -180,13 +169,13 @@ return {
-- TODO: find out what actual probability of getting to backstab is
damage_multiplier = damage_multiplier*(special_multiplier*0.5 + 0.5)
damage_bonus = damage_bonus+(special_bonus*0.5)
if mod.value ~= nil then
if mod.value then
weapon_damage = (weapon_damage+mod.value)/2
end
else
damage_multiplier = damage_multiplier*special_multiplier
damage_bonus = damage_bonus+special_bonus
if mod.value ~= nil then
if mod.value then
weapon_damage = mod.value
end
end
@ -195,13 +184,15 @@ return {
-- Handle drain for defender
local drain_recovery = 0
for defender_attack in H.child_range(defender.__cfg, 'attack') do
local defender_attacks = defender.attacks
for i_d = 1,#defender_attacks do
local defender_attack = defender_attacks[i_d]
if (defender_attack.range == attack.range) then
for special in H.child_range(defender_attack, 'specials') do
if H.get_child(special, 'drains') and drainable(attacker) then
for _,sp in ipairs(defender_attack.specials) do
if (sp[1] == 'drains') and drainable(attacker) then
-- TODO: calculate chance to hit
-- currently assumes 50% chance to hit using supplied constant
local attacker_resistance = wesnoth.unit_resistance(attacker, defender_attack.type)
local attacker_resistance = attacker:resistance(defender_attack.type)
drain_recovery = (defender_attack.damage*defender_attack.number*attacker_resistance*attacker_defense/2)/10000
end
end
@ -209,7 +200,7 @@ return {
end
defense = defense/100.0
local resistance = wesnoth.unit_resistance(defender, attack.type)
local resistance = defender:resistance(attack.type)
if steadfast and (resistance < 100) then
resistance = 100 - ((100 - resistance) * 2)
if (resistance < 50) then
@ -262,8 +253,8 @@ return {
name = "X",
random_gender = false
}
local can_poison = poisonable(unit) and (not wesnoth.unit_ability(unit, 'regenerate'))
local flat_defense = wesnoth.unit_defense(unit, "Gt")
local can_poison = poisonable(unit) and (not unit:ability('regenerate'))
local flat_defense = unit:defense("Gt")
local best_defense = get_best_defense(unit)
local recruit = wesnoth.create_unit {
@ -272,10 +263,10 @@ return {
name = "X",
random_gender = false
}
local recruit_flat_defense = wesnoth.unit_defense(recruit, "Gt")
local recruit_flat_defense = recruit:defense("Gt")
local recruit_best_defense = get_best_defense(recruit)
local can_poison_retaliation = poisonable(recruit) and (not wesnoth.unit_ability(recruit, 'regenerate'))
local can_poison_retaliation = poisonable(recruit) and (not recruit:ability('regenerate'))
best_flat_attack, best_flat_damage, flat_poison = get_best_attack(recruit, unit, flat_defense, recruit_best_defense, can_poison)
best_high_defense_attack, best_high_defense_damage, high_defense_poison = get_best_attack(recruit, unit, best_defense, recruit_flat_defense, can_poison)
best_retaliation, best_retaliation_damage, retaliation_poison = get_best_attack(unit, recruit, recruit_flat_defense, best_defense, can_poison_retaliation)
@ -293,9 +284,10 @@ return {
end
function can_slow(unit)
for defender_attack in H.child_range(unit.__cfg, 'attack') do
for special in H.child_range(defender_attack, 'specials') do
if H.get_child(special, 'slow') then
local attacks = unit.attacks
for i_a = 1,#attacks do
for _,sp in ipairs(attacks[i_a].specials) do
if (sp[1] == 'slow') then
return true
end
end
@ -374,12 +366,12 @@ return {
end
end
if data.recruit == nil then
if not data.recruit then
data.recruit = init_data(leader)
end
data.recruit.cheapest_unit_cost = cheapest_unit_cost
local score = 180000 -- default score if one not provided. Same as RCA AI
local score = 180010 -- default score if one not provided, just above RCA AI recruiting
if params.score_function then
score = params.score_function()
end
@ -398,7 +390,7 @@ return {
local possible_enemy_recruit_count = 0
local function add_unit_type(unit_type)
if enemy_counts[unit_type] == nil then
if not enemy_counts[unit_type] then
table.insert(enemy_types, unit_type)
enemy_counts[unit_type] = 1
else
@ -420,9 +412,20 @@ return {
add_unit_type(unit_type)
end
end
-- If no enemies were found, add a small number of "representative" unit types
if #enemy_types == 0 then
add_unit_type('Orcish Grunt')
add_unit_type('Orcish Archer')
add_unit_type('Wolf Rider')
add_unit_type('Spearman')
add_unit_type('Bowman')
add_unit_type('Cavalryman')
end
data.enemy_counts = enemy_counts
data.enemy_types = enemy_types
data.num_enemies = #enemies
data.num_enemies = math.max(#enemies, 1)
data.possible_enemy_recruit_count = possible_enemy_recruit_count
return data
@ -430,7 +433,7 @@ return {
function ai_cas:recruit_rushers_eval()
local start_time, ca_name = wesnoth.get_time_stamp() / 1000., 'recruit_rushers'
if AH.print_eval() then print_time(' - Evaluating recruit_rushers CA:') end
if AH.print_eval() then AH.print_ts(' - Evaluating recruit_rushers CA:') end
local score = do_recruit_eval(recruit_data)
if score == 0 then
@ -443,7 +446,8 @@ return {
end
function ai_cas:recruit_rushers_exec()
if AH.show_messages() then W.message { speaker = 'narrator', message = 'Recruiting' } end
if AH.print_exec() then AH.print_ts(' Executing recruit_rushers CA') end
if AH.show_messages() then wesnoth.wml_actions.message { speaker = 'narrator', message = 'Recruiting' } end
local enemy_counts = recruit_data.recruit.enemy_counts
local enemy_types = recruit_data.recruit.enemy_types
@ -471,7 +475,7 @@ return {
for i, recruit_id in ipairs(wesnoth.sides[wesnoth.current.side].recruit) do
local analysis = analyze_enemy_unit(unit_type, recruit_id)
if recruit_effectiveness[recruit_id] == nil then
if not recruit_effectiveness[recruit_id] then
recruit_effectiveness[recruit_id] = {damage = 0, poison_damage = 0}
recruit_vulnerability[recruit_id] = 0
end
@ -485,23 +489,23 @@ return {
recruit_vulnerability[recruit_id] = recruit_vulnerability[recruit_id] + (analysis.retaliation.damage * enemy_counts[unit_type])^3
local attack_type = analysis.defense.attack.type
if attack_type_count[attack_type] == nil then
if not attack_type_count[attack_type] then
attack_type_count[attack_type] = 0
end
attack_type_count[attack_type] = attack_type_count[attack_type] + recruit_count[recruit_id]
local attack_range = analysis.defense.attack.range
if attack_range_count[attack_range] == nil then
if not attack_range_count[attack_range] then
attack_range_count[attack_range] = 0
end
attack_range_count[attack_range] = attack_range_count[attack_range] + recruit_count[recruit_id]
if unit_attack_type_count[recruit_id] == nil then
if not unit_attack_type_count[recruit_id] then
unit_attack_type_count[recruit_id] = {}
end
unit_attack_type_count[recruit_id][attack_type] = true
if unit_attack_range_count[recruit_id] == nil then
if not unit_attack_range_count[recruit_id] then
unit_attack_range_count[recruit_id] = {}
end
unit_attack_range_count[recruit_id][attack_range] = true
@ -537,7 +541,7 @@ return {
end
end
-- Correct count of units for each range
local most_common_range = nil
local most_common_range
local most_common_range_count = 0
for range, count in pairs(attack_range_count) do
attack_range_count[range] = count/enemy_type_count
@ -551,18 +555,18 @@ return {
attack_type_count[attack_type] = count/enemy_type_count
end
local recruit_type = nil
local recruit_type
local leader = wesnoth.get_units { side = wesnoth.current.side, canrecruit = 'yes' }[1]
repeat
recruit_data.recruit.best_hex, recruit_data.recruit.target_hex = ai_cas:find_best_recruit_hex(leader, recruit_data)
recruit_type = ai_cas:find_best_recruit(attack_type_count, unit_attack_type_count, recruit_effectiveness, recruit_vulnerability, attack_range_count, unit_attack_range_count, most_common_range_count)
until recruit_type ~= nil
until recruit_type
if wesnoth.unit_types[recruit_type].cost <= wesnoth.sides[wesnoth.current.side].gold then
AH.checked_recruit(ai, recruit_type, recruit_data.recruit.best_hex[1], recruit_data.recruit.best_hex[2])
-- If the recruited unit cannot reach the target hex, return it to the pool of targets
if recruit_data.recruit.target_hex ~= nil and recruit_data.recruit.target_hex[1] ~= nil then
if recruit_data.recruit.target_hex and recruit_data.recruit.target_hex[1] then
local unit = wesnoth.get_unit(recruit_data.recruit.best_hex[1], recruit_data.recruit.best_hex[2])
local path, cost = wesnoth.find_path(unit, recruit_data.recruit.target_hex[1], recruit_data.recruit.target_hex[2], {viewing_side=0, max_cost=unit.max_moves+1})
if cost > unit.max_moves then
@ -577,18 +581,17 @@ return {
return true
else
-- This results in the CA being blacklisted -> clear cache
recruit_data.recruit = nil
return false
end
end
function get_current_castle(leader, data)
if (not data.castle) or (data.castle.x ~= leader.x) or (data.castle.y ~= leader.y) then
data.castle = {}
local width,height,border = wesnoth.get_map_size()
data.castle = {
locs = wesnoth.get_locations {
x = "1-"..width, y = "1-"..height,
locs = AH.get_locations_no_borders {
{ "filter_vision", { side = wesnoth.current.side, visible = 'yes' } },
{ "and", {
x = leader.x, y = leader.y, radius = 200,
@ -638,9 +641,9 @@ return {
if AH.print_eval() then
if village[1] then
print("Recruit at: " .. best_hex[1] .. "," .. best_hex[2] .. " -> " .. village[1] .. "," .. village[2])
std_print("Recruit at: " .. best_hex[1] .. "," .. best_hex[2] .. " -> " .. village[1] .. "," .. village[2])
else
print("Recruit at: " .. best_hex[1] .. "," .. best_hex[2])
std_print("Recruit at: " .. best_hex[1] .. "," .. best_hex[2])
end
end
return best_hex, village
@ -652,18 +655,35 @@ return {
local best_scores = {offense = 0, defense = 0, move = 0}
local best_hex = recruit_data.recruit.best_hex
local target_hex = recruit_data.recruit.target_hex
local distance_to_enemy, enemy_location
if target_hex[1] then
distance_to_enemy, enemy_location = AH.get_closest_enemy(target_hex, wesnoth.current.side, { viewing_side = 0 })
else
distance_to_enemy, enemy_location = AH.get_closest_enemy(best_hex, wesnoth.current.side, { viewing_side = 0 })
local reference_hex = target_hex[1] and target_hex or best_hex
local distance_to_enemy, enemy_location = AH.get_closest_enemy(reference_hex, wesnoth.current.side, { viewing_side = 0 })
-- If no enemy is on the map, then we first use closest enemy start hex,
-- and if that does not exist either, a location mirrored w.r.t the center of the map
if not enemy_location then
local enemy_sides = wesnoth.get_sides({ { "enemy_of", {side = wesnoth.current.side} } })
local min_dist = math.huge
for _, side in ipairs(enemy_sides) do
local enemy_start_hex = wesnoth.special_locations[side.side]
if enemy_start_hex then
local dist = wesnoth.map.distance_between(reference_hex[1], reference_hex[2], enemy_start_hex[1], enemy_start_hex[2])
if dist < min_dist then
min_dist = dist
enemy_location = { x = enemy_start_hex[1], y = enemy_start_hex[2] }
end
end
end
if not enemy_location then
local width, height = wesnoth.get_map_size()
enemy_location = { x = width + 1 - reference_hex[1], y = height + 1 - reference_hex[2] }
end
distance_to_enemy = wesnoth.map.distance_between(reference_hex[1], reference_hex[2], enemy_location.x, enemy_location.y)
end
local gold_limit = 9e99
local gold_limit = math.huge
if recruit_data.castle.loose_gold_limit >= recruit_data.recruit.cheapest_unit_cost then
gold_limit = recruit_data.castle.loose_gold_limit
end
--print (recruit_data.castle.loose_gold_limit .. " " .. recruit_data.recruit.cheapest_unit_cost .. " " .. gold_limit)
local recruitable_units = {}
@ -737,17 +757,17 @@ return {
if can_slow(recruit_unit) then
unit_score["slows"] = true
end
if wesnoth.match_unit(recruit_unit, { ability = "healing" }) then
if recruit_unit:matches { ability = "healing" } then
unit_score["heals"] = true
end
if wesnoth.match_unit(recruit_unit, { ability = "skirmisher" }) then
if recruit_unit:matches { ability = "skirmisher" } then
unit_score["skirmisher"] = true
end
recruitable_units[recruit_id] = recruit_unit
end
local healer_count, healable_count = get_unit_counts_for_healing()
local best_score = 0
local recruit_type = nil
local recruit_type
local offense_weight = 2.5
local defense_weight = 1/hp_ratio^0.5
local move_weight = math.max((distance_to_enemy/20)^2, 0.25)
@ -785,7 +805,7 @@ return {
local score = offense_score*offense_weight + defense_score*defense_weight + move_score*move_weight + bonus
if AH.print_eval() then
print(recruit_id .. " score: " .. offense_score*offense_weight .. " + " .. defense_score*defense_weight .. " + " .. move_score*move_weight .. " + " .. bonus .. " = " .. score)
std_print(recruit_id .. " score: " .. offense_score*offense_weight .. " + " .. defense_score*defense_weight .. " + " .. move_score*move_weight .. " + " .. bonus .. " = " .. score)
end
if score > best_score and wesnoth.unit_types[recruit_id].cost <= gold_limit then
best_score = score
@ -824,7 +844,7 @@ return {
-- TODO get list of villages not owned by allies instead
-- this may have false positives (villages that can't be reached due to difficult/impassible terrain)
local exclude_x, exclude_y = "0", "0"
if data.castle.assigned_villages_x ~= nil and data.castle.assigned_villages_x[1] then
if data.castle.assigned_villages_x and data.castle.assigned_villages_x[1] then
exclude_x = table.concat(data.castle.assigned_villages_x, ",")
exclude_y = table.concat(data.castle.assigned_villages_y, ",")
end
@ -846,7 +866,7 @@ return {
data.castle.assigned_villages_x = {}
data.castle.assigned_villages_y = {}
if not params.leader_takes_village or params.leader_takes_village() then
if not ai.aspects.passive_leader and (not params.leader_takes_village or params.leader_takes_village()) then
-- skip one village for the leader
for i,v in ipairs(villages) do
local path, cost = wesnoth.find_path(leader, v[1], v[2], {max_cost = leader.max_moves+1})
@ -936,7 +956,7 @@ return {
local test_units, num_recruits = {}, 0
local movetypes = {}
for x,id in ipairs(wesnoth.sides[wesnoth.current.side].recruit) do
local custom_movement = H.get_child(wesnoth.unit_types[id].__cfg, "movement_costs")
local custom_movement = wml.get_child(wesnoth.unit_types[id].__cfg, "movement_costs")
local movetype = wesnoth.unit_types[id].__cfg.movement_type
if custom_movement
or (not movetypes[movetype])

View file

@ -1,609 +0,0 @@
return {
init = function(ai)
-- Grab a useful separate CA as a starting point
local generic_rush = wesnoth.require("ai/lua/move_to_any_target.lua").init(ai)
-- More generic grunt rush (and can, in fact, be used with other unit types as well)
local H = wesnoth.require "helper"
local W = H.set_wml_action_metatable {}
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local LS = wesnoth.require "location_set"
local HS = wesnoth.require "ai/micro_ais/cas/ca_healer_move.lua"
local R = wesnoth.require "ai/lua/retreat.lua"
local M = wesnoth.map
local function print_time(...)
if generic_rush.data.turn_start_time then
AH.print_ts_delta(generic_rush.data.turn_start_time, ...)
else
AH.print_ts(...)
end
end
------ Stats at beginning of turn -----------
-- This will be blacklisted after first execution each turn
function generic_rush:stats_eval()
local score = 999999
return score
end
function generic_rush:stats_exec()
local tod = wesnoth.get_time_of_day()
AH.print_ts(' Beginning of Turn ' .. wesnoth.current.turn .. ' (' .. tod.name ..') stats')
generic_rush.data.turn_start_time = wesnoth.get_time_stamp() / 1000.
for i,s in ipairs(wesnoth.sides) do
local total_hp = 0
local units = AH.get_live_units { side = s.side }
for i,u in ipairs(units) do total_hp = total_hp + u.hitpoints end
local leader = wesnoth.get_units { side = s.side, canrecruit = 'yes' }[1]
if leader then
print(' Player ' .. s.side .. ' (' .. leader.type .. '): ' .. #units .. ' Units with total HP: ' .. total_hp)
end
end
end
------- Recruit CA --------------
local params = {
score_function = (function() return 300000 end),
min_turn_1_recruit = (function() return generic_rush:castle_switch_eval() > 0 end),
leader_takes_village = (function()
if generic_rush:castle_switch_eval() > 0 then
local take_village = #(wesnoth.get_villages {
x = generic_rush.data.leader_target[1],
y = generic_rush.data.leader_target[2]
}) > 0
return take_village
end
return true
end
)
}
wesnoth.require("ai/lua/generic_recruit_engine.lua").init(generic_rush, params)
-------- Castle Switch CA --------------
local function get_reachable_enemy_leaders(unit)
-- We're cheating a little here and also find hidden enemy leaders. That's
-- because a human player could make a pretty good educated guess as to where
-- the enemy leaders are likely to be while the AI does not know how to do that.
local potential_enemy_leaders = AH.get_live_units { canrecruit = 'yes',
{ "filter_side", { { "enemy_of", {side = wesnoth.current.side} } } }
}
local enemy_leaders = {}
for j,e in ipairs(potential_enemy_leaders) do
local path, cost = wesnoth.find_path(unit, e.x, e.y, { ignore_units = true, viewing_side = 0 })
if cost < AH.no_path then
table.insert(enemy_leaders, e)
end
end
return enemy_leaders
end
function generic_rush:castle_switch_eval()
local start_time, ca_name = wesnoth.get_time_stamp() / 1000., 'castle_switch'
if AH.print_eval() then print_time(' - Evaluating castle_switch CA:') end
if ai.aspects.passive_leader then
-- Turn off this CA if the leader is passive
return 0
end
local leader = wesnoth.get_units {
side = wesnoth.current.side,
canrecruit = 'yes',
formula = '(movement_left = total_movement) and (hitpoints = max_hitpoints)'
}[1]
if not leader then
-- CA is irrelevant if no leader or the leader may have moved from another CA
self.data.leader_target = nil
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
local cheapest_unit_cost = AH.get_cheapest_recruit_cost()
if self.data.leader_target and wesnoth.sides[wesnoth.current.side].gold >= cheapest_unit_cost then
-- make sure move is still valid
local next_hop = AH.next_hop(leader, self.data.leader_target[1], self.data.leader_target[2])
if next_hop and next_hop[1] == self.data.leader_target[1]
and next_hop[2] == self.data.leader_target[2] then
return self.data.leader_score
end
end
local width,height,border = wesnoth.get_map_size()
local keeps = wesnoth.get_locations {
terrain = 'K*,K*^*,*^K*', -- Keeps
x = '1-'..width,
y = '1-'..height,
{ "not", { {"filter", {}} }}, -- That have no unit
{ "not", { radius = 6, {"filter", { canrecruit = 'yes',
{ "filter_side", { { "enemy_of", {side = wesnoth.current.side} } } }
}} }}, -- That are not too close to an enemy leader
{ "not", {
x = leader.x, y = leader.y, terrain = 'K*,K*^*,*^K*',
radius = 3,
{ "filter_radius", { terrain = 'C*,K*,C*^*,K*^*,*^K*,*^C*' } }
}}, -- That are not close and connected to a keep the leader is on
{ "filter_adjacent_location", {
terrain = 'C*,K*,C*^*,K*^*,*^K*,*^C*'
}} -- That are not one-hex keeps
}
if #keeps < 1 then
-- Skip if there aren't extra keeps to evaluate
-- In this situation we'd only switch keeps if we were running away
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
local enemy_leaders = get_reachable_enemy_leaders(leader)
-- Look for the best keep
local best_score, best_loc, best_turns = 0, {}, 3
for i,loc in ipairs(keeps) do
-- Only consider keeps within 2 turns movement
local path, cost = wesnoth.find_path(leader, loc[1], loc[2])
local score = 0
-- Prefer closer keeps to enemy
local turns = math.ceil(cost/leader.max_moves)
if turns <= 2 then
score = 1/turns
for j,e in ipairs(enemy_leaders) do
score = score + 1 / M.distance_between(loc[1], loc[2], e.x, e.y)
end
if score > best_score then
best_score = score
best_loc = loc
best_turns = turns
end
end
end
-- If we're on a keep,
-- don't move to another keep unless it's much better when uncaptured villages are present
if best_score > 0 and wesnoth.get_terrain_info(wesnoth.get_terrain(leader.x, leader.y)).keep then
local close_unowned_village = (wesnoth.get_villages {
{ "and", {
x = leader.x,
y = leader.y,
radius = leader.max_moves
}},
owner_side = 0
})[1]
if close_unowned_village then
local score = 1/best_turns
for j,e in ipairs(enemy_leaders) do
-- count all distances as three less than they actually are
score = score + 1 / (M.distance_between(leader.x, leader.y, e.x, e.y) - 3)
end
if score > best_score then
best_score = 0
end
end
end
if best_score > 0 then
local next_hop = AH.next_hop(leader, best_loc[1], best_loc[2])
if next_hop and ((next_hop[1] ~= leader.x) or (next_hop[2] ~= leader.y)) then
-- See if there is a nearby village that can be captured without delaying progress
local close_villages = wesnoth.get_villages( {
{ "and", { x = next_hop[1], y = next_hop[2], radius = leader.max_moves }},
owner_side = 0 })
for i,loc in ipairs(close_villages) do
local path_village, cost_village = wesnoth.find_path(leader, loc[1], loc[2])
if cost_village <= leader.moves then
local dummy_leader = wesnoth.copy_unit(leader)
dummy_leader.x = loc[1]
dummy_leader.y = loc[2]
local path_keep, cost_keep = wesnoth.find_path(dummy_leader, best_loc[1], best_loc[2])
local turns_from_keep = math.ceil(cost_keep/leader.max_moves)
if turns_from_keep < best_turns
or (turns_from_keep == 1 and wesnoth.sides[wesnoth.current.side].gold < cheapest_unit_cost)
then
-- There is, go there instead
next_hop = loc
break
end
end
end
end
self.data.leader_target = next_hop
-- if we're on a keep, wait until there are no movable units on the castle before moving off
self.data.leader_score = 290000
if wesnoth.get_terrain_info(wesnoth.get_terrain(leader.x, leader.y)).keep then
local castle = wesnoth.get_locations {
x = "1-"..width, y = "1-"..height,
{ "and", {
x = leader.x, y = leader.y, radius = 200,
{ "filter_radius", { terrain = 'C*,K*,C*^*,K*^*,*^K*,*^C*' } }
}}
}
local should_wait = false
for i,loc in ipairs(castle) do
local unit = wesnoth.get_unit(loc[1], loc[2])
if (not AH.is_visible_unit(wesnoth.current.side, unit)) then
should_wait = false
break
elseif unit.moves > 0 then
should_wait = true
end
end
if should_wait then
self.data.leader_score = 15000
end
end
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return self.data.leader_score
end
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
function generic_rush:castle_switch_exec()
local leader = wesnoth.get_units { side = wesnoth.current.side, canrecruit = 'yes' }[1]
if AH.print_exec() then print_time(' Executing castle_switch CA') end
if AH.show_messages() then W.message { speaker = leader.id, message = 'Switching castles' } end
AH.checked_move(ai, leader, self.data.leader_target[1], self.data.leader_target[2])
self.data.leader_target = nil
end
------- Grab Villages CA --------------
function generic_rush:grab_villages_eval()
local start_time, ca_name = wesnoth.get_time_stamp() / 1000., 'grab_villages'
if AH.print_eval() then print_time(' - Evaluating grab_villages CA:') end
-- Check if there are units with moves left
local units = wesnoth.get_units { side = wesnoth.current.side, canrecruit = 'no',
formula = 'movement_left > 0'
}
if (not units[1]) then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
local enemies = AH.get_attackable_enemies()
local villages = wesnoth.get_villages()
-- Just in case:
if (not villages[1]) then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
--print('#units, #enemies', #units, #enemies)
-- First check if attacks are possible for any unit
local return_value = 200000
-- If one with > 50% chance of kill is possible, set return_value to lower than combat CA
local attacks = ai.get_attacks()
--print(#attacks)
for i,a in ipairs(attacks) do
if (#a.movements == 1) and (a.chance_to_kill > 0.5) then
return_value = 90000
break
end
end
-- Also find which locations can be attacked by enemies
local enemy_attack_map = BC.get_attack_map(enemies).units
-- Now we go through the villages and units
local max_rating, best_village, best_unit = -9e99, {}, {}
local village_ratings = {}
for j,v in ipairs(villages) do
-- First collect all information that only depends on the village
local village_rating = 0 -- This is the unit independent rating
local unit_in_way = wesnoth.get_unit(v[1], v[2])
-- If an enemy can get within one move of the village, we want to hold it
if enemy_attack_map:get(v[1], v[2]) then
--print(' within enemy reach', v[1], v[2])
village_rating = village_rating + 100
end
-- Unowned and enemy-owned villages get a large bonus
local owner = wesnoth.get_village_owner(v[1], v[2])
if (not owner) then
village_rating = village_rating + 10000
else
if wesnoth.is_enemy(owner, wesnoth.current.side) then village_rating = village_rating + 20000 end
end
local enemy_distance_from_village = AH.get_closest_enemy(v)
-- Now we go on to the unit-dependent rating
local best_unit_rating = -9e99
local reachable = false
for i,u in ipairs(units) do
-- Skip villages that have units other than 'u' itself on them
local village_occupied = false
if AH.is_visible_unit(wesnoth.current.side, unit_in_way) and ((unit_in_way ~= u)) then
village_occupied = true
end
-- Rate all villages that can be reached and are unoccupied by other units
if (not village_occupied) then
-- Path finding is expensive, so we do a first cut simply by distance
-- There is no way a unit can get to the village if the distance is greater than its moves
local dist = M.distance_between(u.x, u.y, v[1], v[2])
if (dist <= u.moves) then
local path, cost = wesnoth.find_path(u, v[1], v[2])
if (cost <= u.moves) then
village_rating = village_rating - 1
reachable = true
--print('Can reach:', u.id, v[1], v[2], cost)
local rating = 0
-- Prefer strong units if enemies can reach the village, injured units otherwise
if enemy_attack_map:get(v[1], v[2]) then
rating = rating + u.hitpoints
else
rating = rating + u.max_hitpoints - u.hitpoints
end
-- Prefer not backtracking and moving more distant units to capture villages
local enemy_distance_from_unit = AH.get_closest_enemy({u.x, u.y})
rating = rating - (enemy_distance_from_village + enemy_distance_from_unit)/5
if (rating > best_unit_rating) then
best_unit_rating, best_unit = rating, u
end
--print(' rating:', rating)
end
end
end
end
village_ratings[v] = {village_rating, best_unit, reachable}
end
for j,v in ipairs(villages) do
local rating = village_ratings[v][1]
if village_ratings[v][3] and rating > max_rating then
max_rating, best_village, best_unit = rating, v, village_ratings[v][2]
end
end
--print('max_rating', max_rating)
if (max_rating > -9e99) then
self.data.unit, self.data.village = best_unit, best_village
if (max_rating >= 1000) then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return return_value
else
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
end
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
function generic_rush:grab_villages_exec()
if AH.print_exec() then print_time(' Executing grab_villages CA') end
if AH.show_messages() then W.message { speaker = self.data.unit.id, message = 'Grab villages' } end
AH.movefull_stopunit(ai, self.data.unit, self.data.village)
self.data.unit, self.data.village = nil, nil
end
------- Spread Poison CA --------------
function generic_rush:spread_poison_eval()
local start_time, ca_name = wesnoth.get_time_stamp() / 1000., 'spread_poison'
if AH.print_eval() then print_time(' - Evaluating spread_poison CA:') end
-- If a unit with a poisoned weapon can make an attack, we'll do that preferentially
-- (with some exceptions)
local poisoners = AH.get_live_units { side = wesnoth.current.side,
formula = 'attacks_left > 0',
{ "filter_wml", {
{ "attack", {
{ "specials", {
{ "poison", { } }
} }
} }
} },
canrecruit = 'no'
}
--print('#poisoners', #poisoners)
if (not poisoners[1]) then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
local attacks = AH.get_attacks(poisoners)
--print('#attacks', #attacks)
if (not attacks[1]) then
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
-- Go through all possible attacks with poisoners
local max_rating, best_attack = -9e99, {}
for i,a in ipairs(attacks) do
local attacker = wesnoth.get_unit(a.src.x, a.src.y)
local defender = wesnoth.get_unit(a.target.x, a.target.y)
-- Don't try to poison a unit that cannot be poisoned
local cant_poison = defender.status.poisoned or defender.status.unpoisonable
-- For now, we also simply don't poison units on villages (unless standard combat CA does it)
local on_village = wesnoth.get_terrain_info(wesnoth.get_terrain(defender.x, defender.y)).village
-- Also, poisoning units that would level up through the attack or could level on their turn as a result is very bad
local about_to_level = defender.max_experience - defender.experience <= (wesnoth.unit_types[attacker.type].level * 2)
if (not cant_poison) and (not on_village) and (not about_to_level) then
-- Strongest enemy gets poisoned first
local rating = defender.hitpoints
-- Always attack enemy leader, if possible
if defender.canrecruit then rating = rating + 1000 end
-- Enemies that can regenerate are not good targets
if wesnoth.unit_ability(defender, 'regenerate') then rating = rating - 1000 end
-- More priority to enemies on strong terrain
local defender_defense = 100 - wesnoth.unit_defense(defender, wesnoth.get_terrain(defender.x, defender.y))
rating = rating + defender_defense / 4.
-- For the same attacker/defender pair, go to strongest terrain
local attack_defense = 100 - wesnoth.unit_defense(attacker, wesnoth.get_terrain(a.dst.x, a.dst.y))
rating = rating + attack_defense / 2.
--print('rating', rating)
-- And from village everything else being equal
local is_village = wesnoth.get_terrain_info(wesnoth.get_terrain(a.dst.x, a.dst.y)).village
if is_village then rating = rating + 0.5 end
if rating > max_rating then
max_rating, best_attack = rating, a
end
end
end
if (max_rating > -9e99) then
self.data.attack = best_attack
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 190000
end
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
return 0
end
function generic_rush:spread_poison_exec()
local attacker = wesnoth.get_unit(self.data.attack.src.x, self.data.attack.src.y)
-- If several attacks have poison, this will always find the last one
local is_poisoner, poison_weapon = AH.has_weapon_special(attacker, "poison")
if AH.print_exec() then print_time(' Executing spread_poison CA') end
if AH.show_messages() then W.message { speaker = attacker.id, message = 'Poison attack' } end
AH.robust_move_and_attack(ai, attacker, self.data.attack.dst, self.data.attack.target, { weapon = poison_weapon })
self.data.attack = nil
end
------- Place Healers CA --------------
function generic_rush:place_healers_eval()
if HS:evaluation(ai, {}, self) > 0 then
return 95000
end
return 0
end
function generic_rush:place_healers_exec()
HS:execution(ai, nil, self)
end
------- Retreat CA --------------
function generic_rush:retreat_injured_units_eval()
local units = wesnoth.get_units {
side = wesnoth.current.side,
formula = 'movement_left > 0'
}
local unit, loc = R.retreat_injured_units(units)
if unit then
self.data.retreat_unit = unit
self.data.retreat_loc = loc
-- First check if attacks are possible for any unit
-- If one with > 50% chance of kill is possible, set return_value to lower than combat CA
local attacks = ai.get_attacks()
for i,a in ipairs(attacks) do
if (#a.movements == 1) and (a.chance_to_kill > 0.5) then
return 95000
end
end
return 205000
end
return 0
end
function generic_rush:retreat_injured_units_exec()
AH.robust_move_and_attack(ai, self.data.retreat_unit, self.data.retreat_loc)
self.data.retreat_unit = nil
self.data.retreat_loc = nil
end
------- Village Hunt CA --------------
-- Give extra priority to seeking villages if we have less than our share
-- our share is defined as being slightly more than the total/the number of sides
function generic_rush:village_hunt_eval()
local villages = wesnoth.get_villages()
if not villages[1] then
return 0
end
local my_villages = wesnoth.get_villages { owner_side = wesnoth.current.side }
if #my_villages > #villages / #wesnoth.sides then
return 0
end
local allied_villages = wesnoth.get_villages { {"filter_owner", { {"ally_of", { side = wesnoth.current.side }} }} }
if #allied_villages == #villages then
return 0
end
local units = wesnoth.get_units {
side = wesnoth.current.side,
canrecruit = false,
formula = 'movement_left > 0'
}
if not units[1] then
return 0
end
return 30000
end
function generic_rush:village_hunt_exec()
local unit = wesnoth.get_units({
side = wesnoth.current.side,
canrecruit = false,
formula = 'movement_left > 0'
})[1]
local villages = wesnoth.get_villages()
local target, best_cost = nil, AH.no_path
for i,v in ipairs(villages) do
if not wesnoth.match_location(v[1], v[2], { {"filter_owner", { {"ally_of", { side = wesnoth.current.side }} }} }) then
local path, cost = wesnoth.find_path(unit, v[1], v[2], { ignore_units = true, max_cost = best_cost })
if cost < best_cost then
target = v
best_cost = cost
end
end
end
if target then
local x, y = wesnoth.find_vacant_tile(target[1], target[2], unit)
local dest = AH.next_hop(unit, x, y)
AH.checked_move(ai, unit, dest[1], dest[2])
end
end
return generic_rush
end
}

View file

@ -1,52 +0,0 @@
return {
init = function(ai)
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local move_to_any_target = {}
function move_to_any_target:move_to_enemy_eval()
local units = wesnoth.get_units {
side = wesnoth.current.side,
canrecruit = 'no',
formula = 'movement_left > 0'
}
if (not units[1]) then
-- No units with moves left
return 0
end
local unit, destination
-- Find a unit that has a path to an space close to an enemy
for i,u in ipairs(units) do
local distance, target = AH.get_closest_enemy({u.x, u.y})
if target then
unit = u
local x, y = wesnoth.find_vacant_tile(target.x, target.y)
destination = AH.next_hop(unit, x, y)
if destination then
break
end
end
end
if (not destination) then
-- No path was found
return 0
end
self.data.destination = destination
self.data.unit = unit
return 1
end
function move_to_any_target:move_to_enemy_exec()
AH.checked_move(ai, self.data.unit, self.data.destination[1], self.data.destination[2])
end
return move_to_any_target
end
}

View file

@ -12,7 +12,7 @@ local retreat_functions = {}
function retreat_functions.min_hp(unit)
-- The minimum hp to retreat is a function of level and terrain defense
-- We want to stay longer on good terrain and leave early on very bad terrain
local hp_per_level = wesnoth.unit_defense(unit, wesnoth.get_terrain(unit.x, unit.y))/15
local hp_per_level = unit:defense(wesnoth.get_terrain(unit.x, unit.y))/15
local level = unit.level
-- Leaders are considered to be higher level because of their value
@ -38,7 +38,7 @@ function retreat_functions.retreat_injured_units(units)
local regen, non_regen = {}, {}
for i,u in ipairs(units) do
if u.hitpoints < retreat_functions.min_hp(u) then
if wesnoth.unit_ability(u, 'regenerate') then
if u:ability('regenerate') then
table.insert(regen, u)
else
table.insert(non_regen, u)
@ -84,8 +84,8 @@ function retreat_functions.get_healing_locations()
if u.moves == 0 or u.side ~= wesnoth.current.side then
local heal_amount = 0
local cure = 0
local abilities = H.get_child(u.__cfg, "abilities") or {}
for ability in H.child_range(abilities, "heals") do
local abilities = wml.get_child(u.__cfg, "abilities") or {}
for ability in wml.child_range(abilities, "heals") do
heal_amount = ability.value
if ability.poison == "slowed" then
cure = 1
@ -114,7 +114,7 @@ function retreat_functions.get_retreat_injured_units(healees, regenerates)
local healing_locs = retreat_functions.get_healing_locations()
local max_rating, best_loc, best_unit = -9e99, nil, nil
local max_rating, best_loc, best_unit = - math.huge
for i,u in ipairs(healees) do
local possible_locations = wesnoth.find_reach(u)
-- TODO: avoid ally's villages (may be preferable to lower rating so they will
@ -176,7 +176,7 @@ function retreat_functions.get_retreat_injured_units(healees, regenerates)
rating = rating - enemy_count * 100000
-- Penalty based on terrain defense for unit
rating = rating - wesnoth.unit_defense(u, wesnoth.get_terrain(loc[1], loc[2]))/10
rating = rating - u:defense(wesnoth.get_terrain(loc[1], loc[2]))/10
if (loc[1] == u.x) and (loc[2] == u.y) and (not u.status.poisoned) then
if enemy_count == 0 then

View file

@ -5,12 +5,12 @@ local LS = wesnoth.require "location_set"
local function get_units_target(cfg)
local units = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
local target = wesnoth.get_units {
{ "filter_side", { { "enemy_of", { side = wesnoth.current.side } } } },
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}[1]
return units, target
@ -25,7 +25,7 @@ local function custom_cost(x, y, unit, enemy_rating_map, prefer_map)
-- must return values >=1 for the a* search to work.
local terrain = wesnoth.get_terrain(x, y)
local move_cost = wesnoth.unit_movement_cost(unit, terrain)
local move_cost = unit:movement(terrain)
move_cost = move_cost + (enemy_rating_map:get(x, y) or 0)
@ -55,7 +55,7 @@ function ca_assassin_move:execution(cfg)
local enemies = AH.get_visible_units(wesnoth.current.side, {
{ "filter_side", { { "enemy_of", { side = wesnoth.current.side } } } },
{ "not", H.get_child(cfg, "filter_second") }
{ "not", wml.get_child(cfg, "filter_second") }
})
-- Maximum damage the enemies can theoretically do for all hexes they can attack
@ -66,7 +66,7 @@ function ca_assassin_move:execution(cfg)
if (not enemy.status.petrified) then
-- Need to "move" enemy next to unit for attack calculation
-- Do this with a unit copy, so that no actual unit has to be moved
local enemy_copy = wesnoth.copy_unit(enemy)
local enemy_copy = enemy:clone()
-- First get the reach of the enemy with full moves though
enemy_copy.moves = enemy_copy.max_moves
@ -95,7 +95,7 @@ function ca_assassin_move:execution(cfg)
-- Penalties for damage by enemies
local enemy_rating_map = LS.create()
enemy_damage_map:iter(function(x, y, enemy_damage)
local hit_chance = (wesnoth.unit_defense(unit, wesnoth.get_terrain(x, y))) / 100.
local hit_chance = (unit:defense(wesnoth.get_terrain(x, y))) / 100.
local rating = hit_chance * enemy_damage
rating = rating / unit.max_hitpoints
@ -105,7 +105,7 @@ function ca_assassin_move:execution(cfg)
end)
-- Penalties for blocked hexes and ZOC
local is_skirmisher = wesnoth.unit_ability(unit, "skirmisher")
local is_skirmisher = unit:ability("skirmisher")
for _,enemy in ipairs(enemies) do
-- Hexes an enemy is on get a very large penalty
enemy_rating_map:insert(enemy.x, enemy.y, (enemy_rating_map:get(enemy.x, enemy.y) or 0) + 100)
@ -128,7 +128,7 @@ function ca_assassin_move:execution(cfg)
-- Preferred hexes (do this here once for all hexes, so that it does not need
-- to get done for every step of the a* search.
-- We only need to know whether a hex is preferred or not, there's no additional rating.
local prefer_slf = H.get_child(cfg, "prefer")
local prefer_slf = wml.get_child(cfg, "prefer")
local prefer_map -- want this to be nil, not empty LS if [prefer] tag not given
if prefer_slf then
local preferred_hexes = wesnoth.get_locations(prefer_slf)

View file

@ -6,7 +6,7 @@ local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua"
local function get_big_animals(cfg)
local big_animals = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and" , H.get_child(cfg, "filter") }
{ "and" , wml.get_child(cfg, "filter") }
}
return big_animals
end
@ -24,7 +24,7 @@ function ca_big_animals:execution(cfg)
local unit = get_big_animals(cfg)[1]
local avoid_tag = H.get_child(cfg, "avoid_unit")
local avoid_tag = wml.get_child(cfg, "avoid_unit")
local avoid_map = LS.create()
if avoid_tag then
local enemies_to_be_avoided = AH.get_attackable_enemies(avoid_tag)
@ -41,7 +41,7 @@ function ca_big_animals:execution(cfg)
-- Unit gets a new goal if none is set or on any move with a 10% random chance
local r = math.random(10)
if (not goal.goal_x) or (r == 1) then
local locs = AH.get_passable_locations(H.get_child(cfg, "filter_location") or {})
local locs = AH.get_passable_locations(wml.get_child(cfg, "filter_location") or {})
local rand = math.random(#locs)
goal.goal_x, goal.goal_y = locs[rand][1], locs[rand][2]
@ -49,7 +49,7 @@ function ca_big_animals:execution(cfg)
end
local reach_map = AH.get_reachable_unocc(unit)
local wander_terrain = H.get_child(cfg, "filter_location_wander") or {}
local wander_terrain = wml.get_child(cfg, "filter_location_wander") or {}
reach_map:iter( function(x, y, v)
-- Remove tiles that do not comform to the wander terrain filter
if (not wesnoth.match_location(x, y, wander_terrain)) then
@ -58,7 +58,7 @@ function ca_big_animals:execution(cfg)
end)
-- Now find the one of these hexes that is closest to the goal
local max_rating, best_hex = -9e99
local max_rating, best_hex = - math.huge
reach_map:iter( function(x, y, v)
local rating = -wesnoth.map.distance_between(x, y, goal.goal_x, goal.goal_y)
@ -95,7 +95,7 @@ function ca_big_animals:execution(cfg)
end
-- Finally, if the unit ended up next to enemies, attack the weakest of those
local min_hp, target = 9e99
local min_hp, target = math.huge
for xa,ya in H.adjacent_tiles(unit.x, unit.y) do
local enemy = wesnoth.get_unit(xa, ya)
if AH.is_attackable_enemy(enemy) then

View file

@ -1,5 +1,7 @@
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BD_attacker, BD_target, BD_weapon, BD_bottleneck_attacks_done
local ca_bottleneck_attack = {}
function ca_bottleneck_attack:evaluation(cfg, data)
@ -11,7 +13,7 @@ function ca_bottleneck_attack:evaluation(cfg, data)
}
if (not attackers[1]) then return 0 end
local max_rating, best_attacker, best_target, best_weapon = -9e99
local max_rating, best_attacker, best_target, best_weapon = - math.huge
for _,attacker in ipairs(attackers) do
local targets = AH.get_attackable_enemies { { "filter_adjacent", { id = attacker.id } } }
@ -48,29 +50,29 @@ function ca_bottleneck_attack:evaluation(cfg, data)
if (not best_attacker) then
-- In this case we take attacks away from all units
data.BD_bottleneck_attacks_done = true
BD_bottleneck_attacks_done = true
else
data.BD_bottleneck_attacks_done = false
data.BD_attacker = best_attacker
data.BD_target = best_target
data.BD_weapon = best_weapon
BD_bottleneck_attacks_done = false
BD_attacker = best_attacker
BD_target = best_target
BD_weapon = best_weapon
end
return cfg.ca_score
end
function ca_bottleneck_attack:execution(cfg, data)
if data.BD_bottleneck_attacks_done then
if BD_bottleneck_attacks_done then
local units = AH.get_units_with_attacks { side = wesnoth.current.side }
for _,unit in ipairs(units) do
AH.checked_stopunit_attacks(ai, unit)
end
else
AH.checked_attack(ai, data.BD_attacker, data.BD_target, data.BD_weapon)
AH.checked_attack(ai, BD_attacker, BD_target, BD_weapon)
end
data.BD_attacker, data.BD_target, data.BD_weapon = nil, nil, nil
data.BD_bottleneck_attacks_done = nil
BD_attacker, BD_target, BD_weapon = nil, nil, nil
BD_bottleneck_attacks_done = nil
end
return ca_bottleneck_attack

View file

@ -5,6 +5,10 @@ local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local MAISD = wesnoth.require "ai/micro_ais/micro_ai_self_data.lua"
local M = wesnoth.map
local BD_unit, BD_hex
local BD_level_up_defender, BD_level_up_weapon, BD_bottleneck_moves_done
local BD_is_my_territory, BD_def_map, BD_healer_map, BD_leadership_map, BD_healing_map
local function bottleneck_is_my_territory(map, enemy_map)
-- Create map that contains 'true' for all hexes that are
-- on the AI's side of the map
@ -14,7 +18,7 @@ local function bottleneck_is_my_territory(map, enemy_map)
-- If there is no leader, use first unit found
local unit = wesnoth.get_units { side = wesnoth.current.side, canrecruit = 'yes' }[1]
if (not unit) then unit = wesnoth.get_units { side = wesnoth.current.side }[1] end
local dummy_unit = wesnoth.copy_unit(unit)
local dummy_unit = unit:clone()
local territory_map = LS.create()
local width, height = wesnoth.get_map_size()
@ -25,7 +29,7 @@ local function bottleneck_is_my_territory(map, enemy_map)
dummy_unit.x, dummy_unit.y = x, y
-- Find lowest movement cost to own front-line hexes
local min_cost, best_path = 9e99
local min_cost, best_path = math.huge
map:iter(function(xm, ym, v)
local path, cost = AH.find_path_with_shroud(dummy_unit, xm, ym, { ignore_units = true })
if (cost < min_cost) then
@ -34,7 +38,7 @@ local function bottleneck_is_my_territory(map, enemy_map)
end)
-- And the same to the enemy front line
local min_cost_enemy, best_path_enemy = 9e99
local min_cost_enemy, best_path_enemy = math.huge
enemy_map:iter(function(xm, ym, v)
local path, cost = AH.find_path_with_shroud(dummy_unit, xm, ym, { ignore_units = true })
if (cost < min_cost_enemy) then
@ -85,16 +89,16 @@ end
local function bottleneck_create_positioning_map(max_value, data)
-- Create the positioning maps for the healers and leaders, if not given by WML keys
-- @max_value: the rating value for the first hex in the set
-- data.BD_def_map must have been created when this function is called.
-- BD_def_map must have been created when this function is called.
-- Find all locations adjacent to def_map.
-- This might include hexes on the line itself.
-- Only store those that are not in enemy territory.
local map = LS.create()
data.BD_def_map:iter(function(x, y, v)
BD_def_map:iter(function(x, y, v)
for xa,ya in H.adjacent_tiles(x, y) do
if data.BD_is_my_territory:get(xa, ya) then
local rating = data.BD_def_map:get(x, y) or 0
if BD_is_my_territory:get(xa, ya) then
local rating = BD_def_map:get(x, y) or 0
rating = rating + (map:get(xa, ya) or 0)
map:insert(xa, ya, rating)
end
@ -109,7 +113,7 @@ local function bottleneck_create_positioning_map(max_value, data)
-- We merge the defense map into this, as healers/leaders (by default)
-- can take position on the front line
map:union_merge(data.BD_def_map,
map:union_merge(BD_def_map,
function(x, y, v1, v2) return v1 or v2 end
)
@ -126,18 +130,18 @@ local function bottleneck_get_rating(unit, x, y, has_leadership, is_healer, data
-- Defense positioning rating
-- We exclude healers/leaders here, as we don't necessarily want them on the front line
if (not is_healer) and (not has_leadership) then
rating = data.BD_def_map:get(x, y) or 0
rating = BD_def_map:get(x, y) or 0
end
-- Healer positioning rating
if is_healer then
local healer_rating = data.BD_healer_map:get(x, y) or 0
local healer_rating = BD_healer_map:get(x, y) or 0
if (healer_rating > rating) then rating = healer_rating end
end
-- Leadership unit positioning rating
if has_leadership then
local leadership_rating = data.BD_leadership_map:get(x, y) or 0
local leadership_rating = BD_leadership_map:get(x, y) or 0
-- If leadership unit is injured -> prefer hexes next to healers
if (unit.hitpoints < unit.max_hitpoints) then
@ -155,18 +159,18 @@ local function bottleneck_get_rating(unit, x, y, has_leadership, is_healer, data
-- Injured unit positioning
if (unit.hitpoints < unit.max_hitpoints) then
local healing_rating = data.BD_healing_map:get(x, y) or 0
local healing_rating = BD_healing_map:get(x, y) or 0
if (healing_rating > rating) then rating = healing_rating end
end
-- If this did not produce a positive rating, we add a
-- distance-based rating, to get units to the bottleneck in the first place
if (rating <= 0) and data.BD_is_my_territory:get(x, y) then
if (rating <= 0) and BD_is_my_territory:get(x, y) then
local combined_dist = 0
data.BD_def_map:iter(function(x_def, y_def, v)
BD_def_map:iter(function(x_def, y_def, v)
combined_dist = combined_dist + M.distance_between(x, y, x_def, y_def)
end)
combined_dist = combined_dist / data.BD_def_map:size()
combined_dist = combined_dist / BD_def_map:size()
rating = 1000 - combined_dist * 10.
end
@ -192,9 +196,9 @@ local function bottleneck_move_out_of_way(unit_in_way, data)
occ_hexes:insert(unit.x, unit.y)
end
local best_reach, best_hex = -9e99
local best_reach, best_hex = - math.huge
for _,loc in ipairs(reach) do
if data.BD_is_my_territory:get(loc[1], loc[2]) and (not occ_hexes:get(loc[1], loc[2])) then
if BD_is_my_territory:get(loc[1], loc[2]) and (not occ_hexes:get(loc[1], loc[2])) then
-- Criterion: MP left after the move has been done
if (loc[3] > best_reach) then
best_reach, best_hex = loc[3], { loc[1], loc[2] }
@ -232,54 +236,54 @@ function ca_bottleneck_move:evaluation(cfg, data)
if (not units[1]) then return 0 end
-- Set up the array that tells the AI where to defend the bottleneck
data.BD_def_map = bottleneck_triple_from_keys(cfg.x, cfg.y, 10000)
BD_def_map = bottleneck_triple_from_keys(cfg.x, cfg.y, 10000)
-- Territory map, describing which hex is on AI's side of the bottleneck
-- This one is a bit expensive, esp. on large maps -> don't delete every move and reuse
-- However, after a reload, data.BD_is_my_territory is an empty string
-- -> need to recalculate in that case also (the reason is that is_my_territory is not a WML table)
if (not data.BD_is_my_territory) or (type(data.BD_is_my_territory) == 'string') then
-- However, after a reload, BD_is_my_territory is empty
-- -> need to recalculate in that case also
if (not BD_is_my_territory) or (type(BD_is_my_territory) == 'string') then
local enemy_map = bottleneck_triple_from_keys(cfg.enemy_x, cfg.enemy_y, 10000)
data.BD_is_my_territory = bottleneck_is_my_territory(data.BD_def_map, enemy_map)
BD_is_my_territory = bottleneck_is_my_territory(BD_def_map, enemy_map)
end
-- Healer positioning map
if cfg.healer_x and cfg.healer_y then
data.BD_healer_map = bottleneck_triple_from_keys(cfg.healer_x, cfg.healer_y, 5000)
BD_healer_map = bottleneck_triple_from_keys(cfg.healer_x, cfg.healer_y, 5000)
else
data.BD_healer_map = bottleneck_create_positioning_map(5000, data)
BD_healer_map = bottleneck_create_positioning_map(5000, data)
end
-- Use def_map values for any healer hexes that are defined in def_map as well
data.BD_healer_map:inter_merge(data.BD_def_map,
BD_healer_map:inter_merge(BD_def_map,
function(x, y, v1, v2) return v2 or v1 end
)
-- Leadership position map
if cfg.leadership_x and cfg.leadership_y then
data.BD_leadership_map = bottleneck_triple_from_keys(cfg.leadership_x, cfg.leadership_y, 4000)
BD_leadership_map = bottleneck_triple_from_keys(cfg.leadership_x, cfg.leadership_y, 4000)
else
data.BD_leadership_map = bottleneck_create_positioning_map(4000, data)
BD_leadership_map = bottleneck_create_positioning_map(4000, data)
end
-- Use def_map values for any leadership hexes that are defined in def_map as well
data.BD_leadership_map:inter_merge(data.BD_def_map,
BD_leadership_map:inter_merge(BD_def_map,
function(x, y, v1, v2) return v2 or v1 end
)
-- Healing map: positions next to healers
-- Healers get moved with higher priority, so don't need to check their MP
local healers = wesnoth.get_units { side = wesnoth.current.side, ability = "healing" }
data.BD_healing_map = LS.create()
BD_healing_map = LS.create()
for _,healer in ipairs(healers) do
for xa,ya in H.adjacent_tiles(healer.x, healer.y) do
-- Cannot be on the line, and needs to be in own territory
if data.BD_is_my_territory:get(xa, ya) then
local min_dist = 9e99
data.BD_def_map:iter( function(xd, yd, vd)
if BD_is_my_territory:get(xa, ya) then
local min_dist = math.huge
BD_def_map:iter( function(xd, yd, vd)
local dist_line = M.distance_between(xa, ya, xd, yd)
if (dist_line < min_dist) then min_dist = dist_line end
end)
if (min_dist > 0) then
data.BD_healing_map:insert(xa, ya, 3000 + min_dist) -- Farther away from enemy is good
BD_healing_map:insert(xa, ya, 3000 + min_dist) -- Farther away from enemy is good
end
end
end
@ -314,7 +318,7 @@ function ca_bottleneck_move:evaluation(cfg, data)
local attacks = {}
for _,enemy in ipairs(enemies) do
for xa,ya in H.adjacent_tiles(enemy.x, enemy.y) do
if data.BD_is_my_territory:get(xa, ya) then
if BD_is_my_territory:get(xa, ya) then
local unit_in_way = wesnoth.get_unit(xa, ya)
if (not AH.is_visible_unit(wesnoth.current.side, unit_in_way)) then
unit_in_way = nil
@ -417,8 +421,8 @@ function ca_bottleneck_move:evaluation(cfg, data)
if (level_up_rating > max_rating) then
max_rating, best_unit, best_hex = level_up_rating, unit, { loc[1], loc[2] }
data.BD_level_up_defender = attack.defender
data.BD_level_up_weapon = n_weapon
BD_level_up_defender = attack.defender
BD_level_up_weapon = n_weapon
end
end
end
@ -428,7 +432,7 @@ function ca_bottleneck_move:evaluation(cfg, data)
-- Set the variables for the exec() function
if (not best_hex) then
data.BD_bottleneck_moves_done = true
BD_bottleneck_moves_done = true
else
-- If there's another unit in the best location, moving it out of the way becomes the best move
local unit_in_way = wesnoth.get_units { x = best_hex[1], y = best_hex[2],
@ -441,19 +445,19 @@ function ca_bottleneck_move:evaluation(cfg, data)
if unit_in_way then
best_hex = bottleneck_move_out_of_way(unit_in_way, data)
best_unit = unit_in_way
data.BD_level_up_defender = nil
data.BD_level_up_weapon = nil
BD_level_up_defender = nil
BD_level_up_weapon = nil
end
data.BD_bottleneck_moves_done = false
data.BD_unit, data.BD_hex = best_unit, best_hex
BD_bottleneck_moves_done = false
BD_unit, BD_hex = best_unit, best_hex
end
return cfg.ca_score
end
function ca_bottleneck_move:execution(cfg, data)
if data.BD_bottleneck_moves_done then
if BD_bottleneck_moves_done then
local units = {}
if MAISD.get_mai_self_data(data, cfg.ai_id, "side_leader_activated") then
units = AH.get_units_with_moves { side = wesnoth.current.side }
@ -466,16 +470,16 @@ function ca_bottleneck_move:execution(cfg, data)
end
else
-- Don't want full move, as this might be stepping out of the way
local cfg = { partial_move = true, weapon = data.BD_level_up_weapon }
AH.robust_move_and_attack(ai, data.BD_unit, data.BD_hex, data.BD_level_up_defender, cfg)
local cfg = { partial_move = true, weapon = BD_level_up_weapon }
AH.robust_move_and_attack(ai, BD_unit, BD_hex, BD_level_up_defender, cfg)
end
-- Now delete almost everything
-- Keep only data.BD_is_my_territory because it is very expensive
data.BD_unit, data.BD_hex = nil, nil
data.BD_level_up_defender, data.BD_level_up_weapon = nil, nil
data.BD_bottleneck_moves_done = nil
data.BD_def_map, data.BD_healer_map, data.BD_leadership_map, data.BD_healing_map = nil, nil, nil, nil
-- Keep only BD_is_my_territory because it is very expensive
BD_unit, BD_hex = nil, nil
BD_level_up_defender, BD_level_up_weapon = nil, nil
BD_bottleneck_moves_done = nil
BD_def_map, BD_healer_map, BD_leadership_map, BD_healing_map = nil, nil, nil, nil
end
return ca_bottleneck_move

View file

@ -2,7 +2,7 @@ local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local function get_coward(cfg)
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local coward = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", filter }
@ -23,7 +23,7 @@ function ca_coward:execution(cfg)
local reach = wesnoth.find_reach(coward)
local filter_second =
H.get_child(cfg, "filter_second")
wml.get_child(cfg, "filter_second")
or { { "filter_side", { { "enemy_of", { side = wesnoth.current.side } } } } }
local enemies = AH.get_live_units {
{ "and", filter_second },
@ -52,7 +52,7 @@ function ca_coward:execution(cfg)
-- Store this weighting in the third field of each 'reach' element
reach[i][3] = rating
else
reach[i][3] = -9e99
reach[i][3] = - math.huge
end
end
@ -76,7 +76,7 @@ function ca_coward:execution(cfg)
-- As final step, if there are more than one remaining locations,
-- we take the one with the minimum score in the distance-from-enemy criterion
local max_rating, best_hex = -9e99
local max_rating, best_hex = - math.huge
for _,pos in ipairs(best_overall) do
if (pos[3] > max_rating) then
max_rating, best_hex = pos[3], pos
@ -88,7 +88,7 @@ function ca_coward:execution(cfg)
-- If 'attack_if_trapped' is set, the coward attacks the weakest unit it ends up next to
if cfg.attack_if_trapped then
local max_rating, best_target = -9e99
local max_rating, best_target = - math.huge
for xa,ya in H.adjacent_tiles(coward.x, coward.y) do
local target = wesnoth.get_unit(xa, ya)
if target and wesnoth.is_enemy(coward.side, target.side) then

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local T = wml.tag
@ -22,7 +21,7 @@ function ca_fast_attack_utils.get_avoid_map(cfg)
-- Use [micro_ai][avoid] tag with priority over [ai][avoid].
-- If neither is given, return an empty location set.
local avoid_tag = H.get_child(cfg, "avoid")
local avoid_tag = wml.get_child(cfg, "avoid")
if not avoid_tag then
return LS.of_pairs(ai.aspects.avoid)
@ -88,15 +87,12 @@ function ca_fast_attack_utils.single_unit_info(unit_proxy)
-- Collects unit information from proxy unit table @unit_proxy into a Lua table
-- so that it is accessible faster.
-- Note: Even accessing the directly readable fields of a unit proxy table
-- is slower than reading from a Lua table; not even talking about unit_proxy.__cfg.
-- is slower than reading from a smaller Lua table.
--
-- Important: this is slow, so it should only be called as needed,
-- but it does need to be redone after each move, as it contains
-- information like HP and XP (or the unit might have level up or been changed
-- information like HP and XP (or the unit might have leveled up or been changed
-- in an event).
-- Difference from the grunt rush version: also include x and y
local unit_cfg = unit_proxy.__cfg
local single_unit_info = {
id = unit_proxy.id,
@ -111,63 +107,18 @@ function ca_fast_attack_utils.single_unit_info(unit_proxy)
experience = unit_proxy.experience,
max_experience = unit_proxy.max_experience,
alignment = unit_cfg.alignment,
tod_bonus = AH.get_unit_time_of_day_bonus(unit_cfg.alignment, wesnoth.get_time_of_day().lawful_bonus),
cost = unit_cfg.cost,
level = unit_cfg.level
cost = unit_proxy.cost,
level = unit_proxy.level
}
-- Include the ability type, such as: hides, heals, regenerate, skirmisher (set up as 'hides = true')
local abilities = H.get_child(unit_proxy.__cfg, "abilities")
local abilities = wml.get_child(unit_proxy.__cfg, "abilities")
if abilities then
for _,ability in ipairs(abilities) do
single_unit_info[ability[1]] = true
end
end
-- Information about the attacks indexed by weapon number,
-- including specials (e.g. 'poison = true')
single_unit_info.attacks = {}
for attack in H.child_range(unit_cfg, 'attack') do
-- Extract information for specials; we do this first because some
-- custom special might have the same name as one of the default scalar fields
local a = {}
for special in H.child_range(attack, 'specials') do
for _,sp in ipairs(special) do
if (sp[1] == 'damage') then -- this is 'backstab'
if (sp[2].id == 'backstab') then
a.backstab = true
else
if (sp[2].id == 'charge') then a.charge = true end
end
else
-- magical, marksman
if (sp[1] == 'chance_to_hit') then
a[sp[2].id] = true
else
a[sp[1]] = true
end
end
end
end
-- Now extract the scalar (string and number) values from attack
for k,v in pairs(attack) do
if (type(v) == 'number') or (type(v) == 'string') then
a[k] = v
end
end
table.insert(single_unit_info.attacks, a)
end
-- Resistances to the 6 default attack types
local attack_types = { "arcane", "blade", "cold", "fire", "impact", "pierce" }
single_unit_info.resistances = {}
for _,attack_type in ipairs(attack_types) do
single_unit_info.resistances[attack_type] = wesnoth.unit_resistance(unit_proxy, attack_type) / 100.
end
return single_unit_info
end
@ -188,7 +139,7 @@ function ca_fast_attack_utils.get_unit_copy(id, gamedata)
if (not gamedata.unit_copies[id]) then
local unit_proxy = wesnoth.get_units { id = id }[1]
gamedata.unit_copies[id] = wesnoth.copy_unit(unit_proxy)
gamedata.unit_copies[id] = unit_proxy:clone()
end
return gamedata.unit_copies[id]
@ -210,34 +161,32 @@ function ca_fast_attack_utils.get_unit_defense(unit_copy, x, y, defense_maps)
if (not defense_maps[unit_copy.id][x]) then defense_maps[unit_copy.id][x] = {} end
if (not defense_maps[unit_copy.id][x][y]) then
local defense = (100. - wesnoth.unit_defense(unit_copy, wesnoth.get_terrain(x, y))) / 100.
local defense = (100. - unit_copy:defense(wesnoth.get_terrain(x, y))) / 100.
defense_maps[unit_copy.id][x][y] = { defense = defense }
end
return defense_maps[unit_copy.id][x][y].defense
end
function ca_fast_attack_utils.is_acceptable_attack(damage_taken, damage_done, own_value_weight)
function ca_fast_attack_utils.is_acceptable_attack(damage_taken, damage_done, aggression)
-- Evaluate whether an attack is acceptable, based on the damage taken/done ratio
--
-- Inputs:
-- @damage_taken, @damage_done: should be in gold units as returned by ca_fast_attack_utils.attack_rating
-- This could be either the attacker (for taken) and defender (for done) rating of a single attack (combo)
-- or the overall attack (for done) and counter attack rating (for taken)
-- @own_value_weight (optional): value for the minimum ratio of done/taken that is acceptable
own_value_weight = own_value_weight or 0.6 -- equivalent to aggression = 0.4 (default mainline value)
-- @aggression: value determining which ratio of damage done/taken that is acceptable
-- Otherwise it depends on whether the numbers are positive or negative
-- Negative damage means that one or several of the units are likely to level up
if (damage_taken < 0) and (damage_done < 0) then
return (damage_done / damage_taken) >= own_value_weight
return (damage_done / damage_taken) >= (1 - aggression)
end
if (damage_taken <= 0) then damage_taken = 0.001 end
if (damage_done <= 0) then damage_done = 0.001 end
return (damage_done / damage_taken) >= own_value_weight
return (damage_done / damage_taken) >= (1 - aggression)
end
function ca_fast_attack_utils.damage_rating_unit(attacker_info, defender_info, att_stat, def_stat, is_village, cfg)
@ -248,18 +197,15 @@ function ca_fast_attack_utils.damage_rating_unit(attacker_info, defender_info, a
-- Note: damage is damage TO the attacker, not damage done BY the attacker
--
-- Input parameters:
-- @attacker_info, @defender_info: unit_info tables produced by ca_fast_gamestate_utils.single_unit_info()
-- @attacker_info, @defender_info: unit_info tables produced by ca_fast_attack_utils.get_unit_info()
-- @att_stat, @def_stat: attack statistics for the two units
-- @is_village: whether the hex from which the attacker attacks is a village
-- Set to nil or false if not, to anything if it is a village (does not have to be a boolean)
--
-- Optional parameters:
-- @cfg: the optional different weights listed right below
-- Note: this is currently not used in the Fast MAI, but kept in as a hook for potential upgrades
-- @cfg: the optional weights listed right below (currently only leader_weight)
local leader_weight = (cfg and cfg.leader_weight) or 2.
local xp_weight = (cfg and cfg.xp_weight) or 1.
local level_weight = (cfg and cfg.level_weight) or 1.
local damage = attacker_info.hitpoints - att_stat.average_hp
@ -302,7 +248,7 @@ function ca_fast_attack_utils.damage_rating_unit(attacker_info, defender_info, a
level_bonus = (1. - att_stat.hp_chance[0]) * def_stat.hp_chance[0]
end
fractional_damage = fractional_damage - level_bonus * level_weight
fractional_damage = fractional_damage - level_bonus
-- Now convert this into gold-equivalent value
local value = attacker_info.cost
@ -313,9 +259,8 @@ function ca_fast_attack_utils.damage_rating_unit(attacker_info, defender_info, a
end
-- Being closer to leveling makes the attacker more valuable
-- TODO: consider using a more precise measure here
local xp_bonus = attacker_info.experience / attacker_info.max_experience
value = value * (1. + xp_bonus * xp_weight)
value = value * (1. + xp_bonus)
local rating = fractional_damage * value
@ -332,11 +277,12 @@ function ca_fast_attack_utils.attack_rating(attacker_infos, defender_info, dsts,
-- @att_stats: array of the attack stats of the attack combination(!) of the attackers
-- (must be an array even for single unit attacks)
-- @def_stat: the combat stats of the defender after facing the combination of the attackers
-- @gamedata: table with the game state as produced by ca_fast_gamestate_utils.gamedata()
-- @gamedata: table with the game state as produced by ca_fast_attack_utils.gamedata()
--
-- Optional inputs:
-- @cfg: the different weights listed right below
-- Note: this is currently not used in the Fast MAI, but kept in as a hook for potential upgrades
-- @cfg: table with optional configuration parameters:
-- - aggression: the default aggression aspect, determining how to balance own vs. enemy damage
-- - leader_weight: to be passed on to damage_rating_unit()
--
-- Returns:
-- - Overall rating for the attack or attack combo
@ -345,14 +291,10 @@ function ca_fast_attack_utils.attack_rating(attacker_infos, defender_info, dsts,
-- - Extra rating: additional ratings that do not directly describe damage
-- This should be used to help decide which attack to pick,
-- but not for, e.g., evaluating counter attacks (which should be entirely damage based)
-- Note: rating = defender_rating - attacker_rating * own_value_weight + extra_rating
-- Note: rating = defender_rating - attacker_rating * (1 - aggression) + extra_rating
-- Set up the config parameters for the rating
local defender_starting_damage_weight = (cfg and cfg.defender_starting_damage_weight) or 0.33
local defense_weight = (cfg and cfg.defense_weight) or 0.1
local distance_leader_weight = (cfg and cfg.distance_leader_weight) or 0.002
local occupied_hex_penalty = (cfg and cfg.occupied_hex_penalty) or 0.001
local own_value_weight = (cfg and cfg.own_value_weight) or 1.0
local aggression = (cfg and cfg.aggression) or 0.4
local attacker_rating = 0
for i,attacker_info in ipairs(attacker_infos) do
@ -378,7 +320,7 @@ function ca_fast_attack_utils.attack_rating(attacker_infos, defender_info, dsts,
-- Prefer to attack already damaged enemies
local defender_starting_damage_fraction = defender_info.max_hitpoints - defender_info.hitpoints
extra_rating = extra_rating + defender_starting_damage_fraction * defender_starting_damage_weight
extra_rating = extra_rating + defender_starting_damage_fraction * 0.33
-- If defender is on a village, add a bonus rating (we want to get rid of those preferentially)
-- This is in addition to the damage bonus already included above (but as an extra rating)
@ -400,7 +342,7 @@ function ca_fast_attack_utils.attack_rating(attacker_infos, defender_info, dsts,
gamedata.defense_maps
)
end
defense_rating = defense_rating / #dsts * defense_weight
defense_rating = defense_rating / #dsts * 0.1
extra_rating = extra_rating + defense_rating
@ -416,14 +358,14 @@ function ca_fast_attack_utils.attack_rating(attacker_infos, defender_info, dsts,
- M.distance_between(dst[1], dst[2], leader_x, leader_y)
rel_dist_rating = rel_dist_rating + relative_distance
end
rel_dist_rating = rel_dist_rating / #dsts * distance_leader_weight
rel_dist_rating = rel_dist_rating / #dsts * 0.002
extra_rating = extra_rating + rel_dist_rating
end
-- Finally add up and apply factor of own unit weight to defender unit weight
-- This is a number equivalent to 'aggression' in the default AI (but not numerically equal)
local rating = defender_rating - attacker_rating * own_value_weight + extra_rating
local rating = defender_rating - attacker_rating * (1 - aggression) + extra_rating
return rating, attacker_rating, defender_rating, extra_rating
end
@ -437,7 +379,7 @@ function ca_fast_attack_utils.battle_outcome(attacker_copy, defender_proxy, dst,
-- @dst: location from which the attacker will attack in form { x, y }
-- @attacker_info, @defender_info: unit info for the two units (needed in addition to the units
-- themselves in order to speed things up)
-- @gamedata: table with the game state as produced by ca_fast_gamestate_utils.gamedata()
-- @gamedata: table with the game state as produced by ca_fast_attack_utils.gamedata()
-- @move_cache: for caching data *for this move only*, needs to be cleared after a gamestate change
local defender_defense = ca_fast_attack_utils.get_unit_defense(defender_proxy, defender_proxy.x, defender_proxy.y, gamedata.defense_maps)

View file

@ -1,39 +1,41 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local FAU = wesnoth.require "ai/micro_ais/cas/ca_fast_attack_utils.lua"
local LS = wesnoth.require "location_set"
local fast_combat_units, fast_combat_unit_i,fast_target, fast_dst
local gamedata, move_cache
local ca_fast_combat = {}
function ca_fast_combat:evaluation(cfg, data)
data.move_cache = { turn = wesnoth.current.turn }
data.gamedata = FAU.gamedata_setup()
move_cache = { turn = wesnoth.current.turn }
gamedata = FAU.gamedata_setup()
local filter_own = H.get_child(cfg, "filter")
local filter_enemy = H.get_child(cfg, "filter_second")
local filter_own = wml.get_child(cfg, "filter")
local filter_enemy = wml.get_child(cfg, "filter_second")
local enemies
local units_sorted = true
if (not filter_own) and (not filter_enemy) then
local attacks_aspect = ai.aspects.attacks
if (not data.fast_combat_units) or (not data.fast_combat_units[1]) then
if (not fast_combat_units) or (not fast_combat_units[1]) then
-- Leader is dealt with in a separate CA
data.fast_combat_units = {}
fast_combat_units = {}
for _,unit in ipairs(attacks_aspect.own) do
if (not unit.canrecruit) then
table.insert(data.fast_combat_units, unit)
table.insert(fast_combat_units, unit)
end
end
if (not data.fast_combat_units[1]) then return 0 end
if (not fast_combat_units[1]) then return 0 end
units_sorted = false
end
enemies = attacks_aspect.enemy
else
if (not data.fast_combat_units) or (not data.fast_combat_units[1]) then
data.fast_combat_units = AH.get_live_units(
if (not fast_combat_units) or (not fast_combat_units[1]) then
fast_combat_units = AH.get_live_units(
FAU.build_attack_filter("own", filter_own)
)
if (not data.fast_combat_units[1]) then return 0 end
if (not fast_combat_units[1]) then return 0 end
units_sorted = false
end
enemies = AH.get_live_units(
@ -44,9 +46,9 @@ function ca_fast_combat:evaluation(cfg, data)
if not units_sorted then
-- For speed reasons, we'll go through the arrays from the end, so they are sorted backwards
if cfg.weak_units_first then
table.sort(data.fast_combat_units, function(a,b) return a.hitpoints > b.hitpoints end)
table.sort(fast_combat_units, function(a,b) return a.hitpoints > b.hitpoints end)
else
table.sort(data.fast_combat_units, function(a,b) return a.hitpoints < b.hitpoints end)
table.sort(fast_combat_units, function(a,b) return a.hitpoints < b.hitpoints end)
end
end
@ -72,43 +74,42 @@ function ca_fast_combat:evaluation(cfg, data)
local aggression = ai.aspects.aggression
if (aggression > 1) then aggression = 1 end
local own_value_weight = 1. - aggression
-- Get the locations to be avoided
local avoid_map = FAU.get_avoid_map(cfg)
for i = #data.fast_combat_units,1,-1 do
local unit = data.fast_combat_units[i]
for i = #fast_combat_units,1,-1 do
local unit = fast_combat_units[i]
if unit and unit.valid and (unit.attacks_left > 0) and (#unit.attacks > 0) then
local unit_info = FAU.get_unit_info(unit, data.gamedata)
local unit_copy = FAU.get_unit_copy(unit.id, data.gamedata)
local unit_info = FAU.get_unit_info(unit, gamedata)
local unit_copy = FAU.get_unit_copy(unit.id, gamedata)
local attacks = AH.get_attacks({ unit }, { include_occupied = cfg.include_occupied_attack_hexes, viewing_side = viewing_side })
if (#attacks > 0) then
local max_rating, best_target, best_dst = -9e99
local max_rating, best_target, best_dst = - math.huge
for _,attack in ipairs(attacks) do
if enemy_map:get(attack.target.x, attack.target.y)
and (not avoid_map:get(attack.dst.x, attack.dst.y))
then
local target = wesnoth.get_unit(attack.target.x, attack.target.y)
local target_info = FAU.get_unit_info(target, data.gamedata)
local target_info = FAU.get_unit_info(target, gamedata)
local att_stat, def_stat = FAU.battle_outcome(
unit_copy, target, { attack.dst.x, attack.dst.y },
unit_info, target_info, data.gamedata, data.move_cache
unit_info, target_info, gamedata, move_cache
)
local rating, attacker_rating, defender_rating, extra_rating = FAU.attack_rating(
{ unit_info }, target_info, { { attack.dst.x, attack.dst.y } },
{ att_stat }, def_stat, data.gamedata,
{ att_stat }, def_stat, gamedata,
{
own_value_weight = own_value_weight,
aggression = aggression,
leader_weight = cfg.leader_weight
}
)
local acceptable_attack = FAU.is_acceptable_attack(attacker_rating, defender_rating, own_value_weight)
local acceptable_attack = FAU.is_acceptable_attack(attacker_rating, defender_rating, aggression)
if acceptable_attack and (rating > max_rating) then
max_rating, best_target, best_dst = rating, target, attack.dst
@ -117,22 +118,23 @@ function ca_fast_combat:evaluation(cfg, data)
end
if best_target then
data.fast_combat_unit_i = i
data.fast_target, data.fast_dst = best_target, best_dst
fast_combat_unit_i = i
fast_target, fast_dst = best_target, best_dst
return cfg.ca_score
end
end
end
data.fast_combat_units[i] = nil
fast_combat_units[i] = nil
end
return 0
end
function ca_fast_combat:execution(cfg, data)
AH.robust_move_and_attack(ai, data.fast_combat_units[data.fast_combat_unit_i], data.fast_dst, data.fast_target)
data.fast_combat_units[data.fast_combat_unit_i] = nil
AH.robust_move_and_attack(ai, fast_combat_units[fast_combat_unit_i], fast_dst, fast_target)
fast_combat_units[fast_combat_unit_i] = nil
fast_combat_unit_i,fast_target, fast_dst = nil, nil, nil
end
return ca_fast_combat

View file

@ -3,6 +3,9 @@ local AH = wesnoth.require "ai/lua/ai_helper.lua"
local FAU = wesnoth.require "ai/micro_ais/cas/ca_fast_attack_utils.lua"
local LS = wesnoth.require "location_set"
local leader, fast_target, fast_dst
local gamedata, move_cache
local ca_fast_combat_leader = {}
function ca_fast_combat_leader:evaluation(cfg, data)
@ -15,11 +18,11 @@ function ca_fast_combat_leader:evaluation(cfg, data)
leader_attack_max_units = (cfg and cfg.leader_attack_max_units) or 3
leader_additional_threat = (cfg and cfg.leader_additional_threat) or 1
data.move_cache = { turn = wesnoth.current.turn }
data.gamedata = FAU.gamedata_setup()
move_cache = { turn = wesnoth.current.turn }
gamedata = FAU.gamedata_setup()
local filter_own = H.get_child(cfg, "filter")
local filter_enemy = H.get_child(cfg, "filter_second")
local filter_own = wml.get_child(cfg, "filter")
local filter_enemy = wml.get_child(cfg, "filter_second")
local enemies, leader
if (not filter_own) and (not filter_enemy) then
@ -64,7 +67,6 @@ function ca_fast_combat_leader:evaluation(cfg, data)
local aggression = ai.aspects.aggression
if (aggression > 1) then aggression = 1 end
local own_value_weight = 1. - aggression
-- Get the locations to be avoided
local avoid_map = FAU.get_avoid_map(cfg)
@ -102,8 +104,8 @@ function ca_fast_combat_leader:evaluation(cfg, data)
end
end
local leader_info = FAU.get_unit_info(leader, data.gamedata)
local leader_copy = FAU.get_unit_copy(leader.id, data.gamedata)
local leader_info = FAU.get_unit_info(leader, gamedata)
local leader_copy = FAU.get_unit_copy(leader.id, gamedata)
-- If threatened_leader_fights=yes, check out the current threat (power only,
-- not units) on the AI leader
@ -120,7 +122,7 @@ function ca_fast_combat_leader:evaluation(cfg, data)
local attacks = AH.get_attacks({ leader }, { include_occupied = cfg.include_occupied_attack_hexes, viewing_side = viewing_side })
if (#attacks > 0) then
local max_rating, best_target, best_dst = -9e99
local max_rating, best_target, best_dst = - math.huge
for _,attack in ipairs(attacks) do
if enemy_map:get(attack.target.x, attack.target.y)
and (not avoid_map:get(attack.dst.x, attack.dst.y))
@ -150,23 +152,23 @@ function ca_fast_combat_leader:evaluation(cfg, data)
if acceptable_attack then
local target = wesnoth.get_unit(attack.target.x, attack.target.y)
local target_info = FAU.get_unit_info(target, data.gamedata)
local target_info = FAU.get_unit_info(target, gamedata)
local att_stat, def_stat = FAU.battle_outcome(
leader_copy, target, { attack.dst.x, attack.dst.y },
leader_info, target_info, data.gamedata, data.move_cache
leader_info, target_info, gamedata, move_cache
)
local rating, attacker_rating, defender_rating, extra_rating = FAU.attack_rating(
{ leader_info }, target_info, { { attack.dst.x, attack.dst.y } },
{ att_stat }, def_stat, data.gamedata,
{ att_stat }, def_stat, gamedata,
{
own_value_weight = own_value_weight,
leader_weight = cfg.leader_weight
aggression = aggression,
leader_weight = leader_weight
}
)
acceptable_attack = FAU.is_acceptable_attack(attacker_rating, defender_rating, own_value_weight)
acceptable_attack = FAU.is_acceptable_attack(attacker_rating, defender_rating, aggression)
if acceptable_attack and (rating > max_rating) then
max_rating, best_target, best_dst = rating, target, attack.dst
@ -176,8 +178,8 @@ function ca_fast_combat_leader:evaluation(cfg, data)
end
if best_target then
data.leader = leader
data.fast_target, data.fast_dst = best_target, best_dst
leader = leader
fast_target, fast_dst = best_target, best_dst
return cfg.ca_score
end
end
@ -186,8 +188,8 @@ function ca_fast_combat_leader:evaluation(cfg, data)
end
function ca_fast_combat_leader:execution(cfg, data)
AH.robust_move_and_attack(ai, data.leader, data.fast_dst, data.fast_target)
data.leader, data.fast_target, data.fast_dst = nil, nil, nil
AH.robust_move_and_attack(ai, leader, fast_dst, fast_target)
leader, fast_target, fast_dst = nil, nil, nil
end
return ca_fast_combat_leader

View file

@ -143,7 +143,7 @@ function ca_fast_move:execution(cfg)
if (next_goal > #goals) then next_goal = 1 end
local goal = goals[next_goal]
local max_rating, best_unit_info = -9e99
local max_rating, best_unit_info = - math.huge
for _,unit_info in ipairs(goal) do
if (not unit_info.cost) then
local _,cost =
@ -198,7 +198,7 @@ function ca_fast_move:execution(cfg)
local reach = wesnoth.find_reach(unit)
local pre_ratings = {}
local max_rating, best_hex = -9e99
local max_rating, best_hex = - math.huge
for _,loc in ipairs(reach) do
if (not avoid_map:get(loc[1], loc[2])) then
local rating = -M.distance_between(loc[1], loc[2], short_goal[1], short_goal[2])
@ -243,10 +243,10 @@ function ca_fast_move:execution(cfg)
if cfg.dungeon_mode then
table.sort(pre_ratings, function(a,b) return (a.rating > b.rating) end)
wesnoth.extract_unit(unit)
unit:extract()
local old_x, old_y = unit.x, unit.y
local max_rating = -9e99
local max_rating = - math.huge
for _,pre_rating in ipairs(pre_ratings) do
-- If pre_rating is worse than the full rating, we are done because the
-- move cost can never be less than the distance, so we cannot possibly do
@ -263,8 +263,7 @@ function ca_fast_move:execution(cfg)
end
end
unit.x, unit.y = old_x, old_y
wesnoth.put_unit(unit)
unit:to_map(old_x, old_y)
end
if best_hex then

View file

@ -1,9 +1,6 @@
local H = wesnoth.require "helper"
local W = H.set_wml_action_metatable {}
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local M = wesnoth.map
local T = wml.tag
local function get_forest_animals(cfg)
-- We want the deer/rabbits to move first, tuskers afterward
@ -45,9 +42,9 @@ function ca_forest_animals_move:execution(cfg)
local enemies = AH.get_attackable_enemies()
-- Get the locations of all the rabbit holes
W.store_items { variable = 'holes_wml' }
local all_items = H.get_variable_array('holes_wml')
W.clear_variable { name = 'holes_wml' }
wesnoth.wml_actions.store_items { variable = 'holes_wml' }
local all_items = wml.array_access.get('holes_wml')
wesnoth.wml_actions.clear_variable { name = 'holes_wml' }
-- If cfg.rabbit_hole_img is set, only items with that image or halo count as holes
local holes
@ -73,15 +70,10 @@ function ca_forest_animals_move:execution(cfg)
end
-- If no close enemies, do a random move
local wander_terrain = H.get_child(cfg, "filter_location") or {}
local wander_terrain = wml.get_child(cfg, "filter_location") or {}
if (not close_enemies[1]) then
local reach = AH.get_reachable_unocc(unit)
local width, height = wesnoth.get_map_size()
local wander_locs = wesnoth.get_locations {
x = '1-' .. width,
y = '1-' .. height,
{ "and", wander_terrain }
}
local wander_locs = AH.get_locations_no_borders(wander_terrain)
local locs_map = LS.of_pairs(wander_locs)
local reachable_wander_terrain = {}
@ -99,7 +91,7 @@ function ca_forest_animals_move:execution(cfg)
AH.checked_move(ai, unit, reachable_wander_terrain[rand][1], reachable_wander_terrain[rand][2])
end
else -- Or if no close reachable terrain was found, move toward the closest
local min_dist, best_hex = 9e99
local min_dist, best_hex = math.huge
for _,loc in ipairs(wander_locs) do
local dist = M.distance_between(loc[1], loc[2], unit.x, unit.y)
if dist < min_dist then
@ -158,7 +150,7 @@ function ca_forest_animals_move:execution(cfg)
-- If this is a rabbit ending on a hole -> disappears
if (unit.type == rabbit_type) and hole_map:get(farthest_hex[1], farthest_hex[2]) then
wesnoth.invoke_synced_command("rabbit_despawn", { x = farthest_hex[1], y = farthest_hex[2]})
wesnoth.invoke_synced_command("rabbit_despawn", { x = farthest_hex[1], y = farthest_hex[2]})
end
end

View file

@ -1,7 +1,4 @@
local H = wesnoth.require "helper"
local W = H.set_wml_action_metatable {}
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local T = wml.tag
local ca_forest_animals_new_rabbit = {}
@ -18,9 +15,9 @@ function ca_forest_animals_new_rabbit:execution(cfg)
local rabbit_enemy_distance = cfg.rabbit_enemy_distance or 3
-- Get the locations of all items on that map (which could be rabbit holes)
W.store_items { variable = 'holes_wml' }
local all_items = H.get_variable_array('holes_wml')
W.clear_variable { name = 'holes_wml' }
wesnoth.wml_actions.store_items { variable = 'holes_wml' }
local all_items = wml.array_access.get('holes_wml')
wesnoth.wml_actions.clear_variable { name = 'holes_wml' }
-- Eliminate all holes that have an enemy within 'rabbit_enemy_distance' hexes
-- We also add a random number to the ones we keep, for selection of the holes later
@ -59,7 +56,7 @@ function ca_forest_animals_new_rabbit:execution(cfg)
x, y = wesnoth.find_vacant_tile(holes[i].x, holes[i].y)
end
wesnoth.invoke_synced_command("rabbit_spawn", { rabbit_type = cfg.rabbit_type, x = x, y = y})
wesnoth.invoke_synced_command("rabbit_spawn", { rabbit_type = cfg.rabbit_type, x = x, y = y})
end
if wesnoth.sides[wesnoth.current.side].shroud then

View file

@ -32,7 +32,7 @@ function ca_forest_animals_tusker_attack:execution(cfg)
local adjacent_enemies = get_adjacent_enemies(cfg)
-- Find the closest enemy to any tusker
local min_dist, attacker, target = 9e99
local min_dist, attacker, target = math.huge
for _,tusker in ipairs(tuskers) do
for _,enemy in ipairs(adjacent_enemies) do
local dist = M.distance_between(tusker.x, tusker.y, enemy.x, enemy.y)

View file

@ -33,7 +33,7 @@ function ca_forest_animals_tusklet_move:execution(cfg)
local tusklet = get_tusklets(cfg)[1]
local tuskers = get_tuskers(cfg)
local goto_tusker, min_dist = {}, 9e99
local min_dist, goto_tusker = math.huge
for _,tusker in ipairs(tuskers) do
local dist = M.distance_between(tusker.x, tusker.y, tusklet.x, tusklet.y)
if (dist < min_dist) then

View file

@ -8,7 +8,7 @@ local M = wesnoth.map
local function custom_cost(x, y, unit, enemy_map, enemy_attack_map, multiplier)
local terrain = wesnoth.get_terrain(x, y)
local move_cost = wesnoth.unit_movement_cost(unit, terrain)
local move_cost = unit:movement(terrain)
move_cost = move_cost + (enemy_map:get(x,y) or 0)
move_cost = move_cost + (enemy_attack_map.units:get(x,y) or 0) * multiplier
@ -25,14 +25,27 @@ function ca_goto:evaluation(cfg, data)
return 0
end
local all_units = AH.get_units_with_moves {
{ "and", { side = wesnoth.current.side } },
{ "and", wml.get_child(cfg, "filter") }
}
local units = {}
if cfg.release_unit_at_goal then
for _,unit in ipairs(all_units) do
if (not MAIUV.get_mai_unit_variables(unit, cfg.ai_id, "release")) then
table.insert(units, unit)
end
end
else
units = all_units
end
if (not units[1]) then return 0 end
-- For convenience, we check for locations here, and just pass that to the exec function
-- This is mostly to make the unique_goals option easier
local width, height = wesnoth.get_map_size()
local all_locs = wesnoth.get_locations {
x = '1-' .. width,
y = '1-' .. height,
{ "and", H.get_child(cfg, "filter_location") }
}
local all_locs = AH.get_locations_no_borders(wml.get_child(cfg, "filter_location"))
if (#all_locs == 0) then return 0 end
-- If 'unique_goals' is set, check whether there are locations left to go to.
@ -60,23 +73,6 @@ function ca_goto:evaluation(cfg, data)
end
if (not locs[1]) then return 0 end
local all_units = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
}
local units = {}
if cfg.release_unit_at_goal then
for _,unit in ipairs(all_units) do
if (not MAIUV.get_mai_unit_variables(unit, cfg.ai_id, "release")) then
table.insert(units, unit)
end
end
else
units = all_units
end
if (not units[1]) then return 0 end
-- Now store units and locs, so that we don't need to duplicate this in the exec function
GO_units, GO_locs = units, locs
@ -117,7 +113,7 @@ function ca_goto:execution(cfg, data)
enemy_attack_map = BC.get_attack_map(live_enemies)
end
local max_rating, closest_hex, best_path, best_unit = -9e99
local max_rating, closest_hex, best_path, best_unit = - math.huge
for _,unit in ipairs(units) do
for _,loc in ipairs(locs) do
-- If cfg.use_straight_line is set, we simply find the closest
@ -148,14 +144,14 @@ function ca_goto:execution(cfg, data)
if cfg.ignore_enemy_at_goal then
enemy_at_goal = wesnoth.get_unit(loc[1], loc[2])
if enemy_at_goal and wesnoth.is_enemy(wesnoth.current.side, enemy_at_goal.side) then
wesnoth.extract_unit(enemy_at_goal)
enemy_at_goal:extract()
else
enemy_at_goal = nil
end
end
path, cost = AH.find_path_with_shroud(unit, loc[1], loc[2], { ignore_units = cfg.ignore_units })
if enemy_at_goal then
wesnoth.put_unit(enemy_at_goal)
enemy_at_goal:to_map()
--- Give massive penalty for this goal hex
cost = cost + 100
end

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua"
@ -8,7 +7,7 @@ local M = wesnoth.map
local function get_hang_out_units(cfg)
local units = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
return units
end
@ -22,14 +21,14 @@ function ca_hang_out:evaluation(cfg, data)
end
-- Otherwise check if any of the mobilize conditions are now met
local mobilize_condition = H.get_child(cfg, "mobilize_condition")
local mobilize_condition = wml.get_child(cfg, "mobilize_condition")
if (mobilize_condition and wesnoth.eval_conditional(mobilize_condition))
or (cfg.mobilize_on_gold_less_than and (wesnoth.sides[wesnoth.current.side].gold < cfg.mobilize_on_gold_less_than))
then
MAISD.insert_mai_self_data(data, cfg.ai_id, { mobilize_units = true })
-- Need to unmark all units also (all units, with and without moves)
local units = wesnoth.get_units { side = wesnoth.current.side, { "and", H.get_child(cfg, "filter") } }
local units = wesnoth.get_units { side = wesnoth.current.side, { "and", wml.get_child(cfg, "filter") } }
for _,unit in ipairs(units) do
MAIUV.delete_mai_unit_variables(unit, cfg.ai_id)
end
@ -46,29 +45,24 @@ function ca_hang_out:execution(cfg)
-- Get the locations close to which the units should hang out
-- cfg.filter_location defaults to the location of the side leader(s)
local filter_location = H.get_child(cfg, "filter_location") or {
local filter_location = wml.get_child(cfg, "filter_location") or {
{ "filter", { side = wesnoth.current.side, canrecruit = "yes" } }
}
local width, height = wesnoth.get_map_size()
local locs = wesnoth.get_locations {
x = '1-' .. width,
y = '1-' .. height,
{ "and", filter_location }
}
local locs = AH.get_locations_no_borders(filter_location)
-- Get map of locations to be avoided.
-- Use [micro_ai][avoid] tag with priority over [ai][avoid].
-- If neither is given, default to all castle terrain.
local avoid_tag = H.get_child(cfg, "avoid")
local avoid_tag = wml.get_child(cfg, "avoid")
local avoid_map
if avoid_tag then
avoid_map = LS.of_pairs(wesnoth.get_locations(avoid_tag))
else
local ai_tag = H.get_child(wesnoth.sides[wesnoth.current.side].__cfg, 'ai')
for aspect in H.child_range(ai_tag, 'aspect') do
local ai_tag = wml.get_child(wesnoth.sides[wesnoth.current.side].__cfg, 'ai')
for aspect in wml.child_range(ai_tag, 'aspect') do
if (aspect.id == 'avoid') then
local facet = H.get_child(aspect, 'facet')
local facet = wml.get_child(aspect, 'facet')
if facet or aspect.name ~= "composite_aspect" then
-- If there's a [facet] child, it's set as a composite aspect,
-- with at least one facet.
@ -80,15 +74,15 @@ function ca_hang_out:execution(cfg)
end
end
end
if avoid_map == nil then
if not avoid_map then
avoid_map = LS.of_pairs(wesnoth.get_locations { terrain = 'C*,C*^*,*^C*' })
end
local max_rating, best_hex, best_unit = -9e99
local max_rating, best_hex, best_unit = - math.huge
for _,unit in ipairs(units) do
-- Only consider units that have not been marked yet
if (not MAIUV.get_mai_unit_variables(unit, cfg.ai_id, "moved")) then
local max_rating_unit, best_hex_unit = -9e99
local max_rating_unit, best_hex_unit = - math.huge
-- Check out all unoccupied hexes the unit can reach
local reach_map = AH.get_reachable_unocc(unit)

View file

@ -1,5 +1,3 @@
local H = wesnoth.require "helper"
local ca_healer_initialize = {}
function ca_healer_initialize:evaluation()
@ -19,7 +17,7 @@ function ca_healer_initialize:execution(cfg, data)
id = "no_healers_attack",
invalidate_on_gamestate_change = "yes",
{ "filter_own", {
{ "not", { ability = "healing", { "and", H.get_child(cfg, "filter") } } }
{ "not", { ability = "healing", { "and", wml.get_child(cfg, "filter") } } }
} }
}
)

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local LS = wesnoth.require "location_set"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
@ -16,7 +15,7 @@ function ca_healer_move:evaluation(cfg, data)
local all_healers = wesnoth.get_units {
side = wesnoth.current.side,
ability = "healing",
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
local healers, healers_noMP = {}, {}
@ -31,7 +30,7 @@ function ca_healer_move:evaluation(cfg, data)
local all_healees = wesnoth.get_units {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}
local healees, healees_MP = {}, {}
@ -39,7 +38,7 @@ function ca_healer_move:evaluation(cfg, data)
-- Potential healees are units without MP that don't already have a healer (also without MP) next to them
-- Also, they cannot be on a village or regenerate
if (healee.moves == 0) then
if (not wesnoth.match_unit(healee, { ability = "regenerates" })) then
if (not healee:matches { ability = "regenerates" }) then
local is_village = wesnoth.get_terrain_info(wesnoth.get_terrain(healee.x, healee.y)).village
if (not is_village) then
local is_healee = true
@ -58,13 +57,13 @@ function ca_healer_move:evaluation(cfg, data)
end
local enemies = AH.get_attackable_enemies()
for _,healee in ipairs(healees_MP) do wesnoth.extract_unit(healee) end
for _,healee in ipairs(healees_MP) do healee:extract() end
local enemy_attack_map = BC.get_attack_map(enemies)
for _,healee in ipairs(healees_MP) do wesnoth.put_unit(healee) end
for _,healee in ipairs(healees_MP) do healee:to_map() end
local avoid_map = LS.of_pairs(ai.aspects.avoid)
local max_rating = -9e99
local max_rating = - math.huge
for _,healer in ipairs(healers) do
local reach = wesnoth.find_reach(healer)
@ -104,10 +103,11 @@ function ca_healer_move:evaluation(cfg, data)
rating = rating - enemies_in_reach * 1000
-- All else being more or less equal, prefer villages and strong terrain
local is_village = wesnoth.get_terrain_info(wesnoth.get_terrain(loc[1], loc[2])).village
local terrain = wesnoth.get_terrain(loc[1], loc[2])
local is_village = wesnoth.get_terrain_info(terrain).village
if is_village then rating = rating + 2 end
local defense = 100 - wesnoth.unit_defense(healer, wesnoth.get_terrain(loc[1], loc[2]))
local defense = 100 - healer:defense(terrain)
rating = rating + defense / 10.
end

View file

@ -1,11 +1,10 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local M = wesnoth.map
local function get_sheep(cfg)
local sheep = wesnoth.get_units {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}
return sheep
end
@ -13,7 +12,7 @@ end
local function get_dogs(cfg)
local dogs = AH.get_units_with_attacks {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
return dogs
end
@ -22,7 +21,7 @@ local function get_enemies(cfg, radius)
local enemies = AH.get_attackable_enemies {
{ "filter_location",
{ radius = radius,
{ "filter", { side = wesnoth.current.side, { "and", H.get_child(cfg, "filter_second") } } } }
{ "filter", { side = wesnoth.current.side, { "and", wml.get_child(cfg, "filter_second") } } } }
}
}
return enemies
@ -49,7 +48,7 @@ function ca_herding_attack_close_enemy:execution(cfg)
local radius = cfg.attack_distance or 4
local enemies = get_enemies(cfg, radius)
max_rating, best_dog, best_enemy, best_hex = -9e99
local max_rating, best_dog, best_enemy, best_hex = - math.huge
for _,enemy in ipairs(enemies) do
for _,dog in ipairs(dogs) do
local reach_map = AH.get_reachable_unocc(dog)
@ -91,7 +90,7 @@ function ca_herding_attack_close_enemy:execution(cfg)
if (not dogs[1]) then return end
-- Find closest sheep/enemy pair first
local min_dist, closest_sheep, closest_enemy = 9e99
local min_dist, closest_sheep, closest_enemy = math.huge
for _,enemy in ipairs(enemies) do
for _,single_sheep in ipairs(sheep) do
local dist = M.distance_between(enemy.x, enemy.y, single_sheep.x, single_sheep.y)
@ -103,7 +102,7 @@ function ca_herding_attack_close_enemy:execution(cfg)
end
-- Move dogs in between enemies and sheep
max_rating, best_dog, best_hex = -9e99
local max_rating, best_dog, best_hex = - math.huge
for _,dog in ipairs(dogs) do
local reach_map = AH.get_reachable_unocc(dog)
reach_map:iter( function(x, y, v)

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local M = wesnoth.map
@ -6,8 +5,8 @@ local M = wesnoth.map
local function get_dog(cfg)
local dogs = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") },
{ "not", { { "filter_adjacent", { side = wesnoth.current.side, { "and", H.get_child(cfg, "filter_second") } } } } }
{ "and", wml.get_child(cfg, "filter") },
{ "not", { { "filter_adjacent", { side = wesnoth.current.side, { "and", wml.get_child(cfg, "filter_second") } } } } }
}
return dogs[1]
end
@ -23,7 +22,7 @@ end
function ca_herding_dog_move:execution(cfg)
-- We simply move the first dog first, order does not matter
local dog = get_dog(cfg)
local herding_perimeter = LS.of_pairs(wesnoth.get_locations(H.get_child(cfg, "filter_location")))
local herding_perimeter = LS.of_pairs(wesnoth.get_locations(wml.get_child(cfg, "filter_location")))
-- Find average distance of herding_perimeter from center
local av_dist = 0

View file

@ -1,10 +1,9 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local function get_dog(cfg)
local dogs = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") },
{ "and", wml.get_child(cfg, "filter") },
}
return dogs[1]
end

View file

@ -4,7 +4,7 @@ local LS = wesnoth.require "location_set"
return function(cfg)
-- Find the area that the sheep can occupy
-- First, find all contiguous hexes around center hex that are inside herding_perimeter
local location_filter = H.get_child(cfg, "filter_location")
local location_filter = wml.get_child(cfg, "filter_location")
local herding_area = LS.of_pairs(wesnoth.get_locations {
x = cfg.herd_x,
y = cfg.herd_y,

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local M = wesnoth.map
@ -7,7 +6,7 @@ local herding_area = wesnoth.require "ai/micro_ais/cas/ca_herding_f_herding_area
local function get_dogs(cfg)
local dogs = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
return dogs
end
@ -15,8 +14,8 @@ end
local function get_sheep_to_herd(cfg)
local all_sheep = wesnoth.get_units {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") },
{ "not", { { "filter_adjacent", { side = wesnoth.current.side, { "and", H.get_child(cfg, "filter") } } } } }
{ "and", wml.get_child(cfg, "filter_second") },
{ "not", { { "filter_adjacent", { side = wesnoth.current.side, { "and", wml.get_child(cfg, "filter") } } } } }
}
local sheep_to_herd = {}
@ -43,7 +42,7 @@ function ca_herding_herd_sheep:execution(cfg)
local dogs = get_dogs(cfg)
local sheep_to_herd = get_sheep_to_herd(cfg)
local max_rating, best_dog, best_hex = -9e99
local max_rating, best_dog, best_hex = - math.huge
local c_x, c_y = cfg.herd_x, cfg.herd_y
for _,single_sheep in ipairs(sheep_to_herd) do
-- Farthest sheep goes first
@ -63,7 +62,7 @@ function ca_herding_herd_sheep:execution(cfg)
-- And the closer dog goes first (so that it might be able to chase another sheep afterward)
rating = rating - M.distance_between(x, y, dog.x, dog.y) / 100.
-- Finally, prefer to stay on path, if possible
if (wesnoth.match_location(x, y, H.get_child(cfg, "filter_location")) ) then rating = rating + 0.001 end
if (wesnoth.match_location(x, y, wml.get_child(cfg, "filter_location")) ) then rating = rating + 0.001 end
reach_map:insert(x, y, rating)
@ -74,11 +73,7 @@ function ca_herding_herd_sheep:execution(cfg)
end
end
if (best_hex[1] == best_dog.x) and (best_hex[2] == best_dog.y) then
AH.checked_stopunit_moves(ai, best_dog)
else
AH.checked_move(ai, best_dog, best_hex[1], best_hex[2]) -- partial move only!
end
AH.robust_move_and_attack(ai, best_dog, best_hex, nil, { partial_move = true })
end
return ca_herding_herd_sheep

View file

@ -6,7 +6,7 @@ local herding_area = wesnoth.require "ai/micro_ais/cas/ca_herding_f_herding_area
local function get_next_sheep(cfg)
local sheep = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}
return sheep[1]
end
@ -24,12 +24,12 @@ function ca_herding_sheep_move:execution(cfg)
local sheep = get_next_sheep(cfg)
local reach_map = AH.get_reachable_unocc(sheep)
local dogs_filter = H.get_child(cfg, "filter")
local dogs_filter = wml.get_child(cfg, "filter")
-- Exclude those that are next to a dog
reach_map:iter( function(x, y, v)
for xa, ya in H.adjacent_tiles(x, y) do
local dog = wesnoth.get_unit(xa, ya)
if dog and (wesnoth.match_unit(dog, dogs_filter)) then
if dog and dog:matches(dogs_filter) then
reach_map:remove(x, y)
end
end

View file

@ -1,12 +1,11 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local M = wesnoth.map
local function get_next_sheep(cfg)
local sheep = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") },
{ "filter_adjacent", { side = wesnoth.current.side, { "and", H.get_child(cfg, "filter") } } }
{ "and", wml.get_child(cfg, "filter_second") },
{ "filter_adjacent", { side = wesnoth.current.side, { "and", wml.get_child(cfg, "filter") } } }
}
return sheep[1]
end
@ -24,7 +23,7 @@ function ca_herding_sheep_runs_dog:execution(cfg)
local sheep = get_next_sheep(cfg)
-- Get the first dog that the sheep is adjacent to
local dog = wesnoth.get_units { side = wesnoth.current.side, { "and", H.get_child(cfg, "filter") },
local dog = wesnoth.get_units { side = wesnoth.current.side, { "and", wml.get_child(cfg, "filter") },
{ "filter_adjacent", { x = sheep.x, y = sheep.y } }
}[1]

View file

@ -1,11 +1,10 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local M = wesnoth.map
local function get_next_sheep_enemies(cfg)
local sheep = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}
if (not sheep[1]) then return end

View file

@ -1,5 +1,4 @@
local H = wesnoth.require "helper"
local W = H.set_wml_action_metatable {}
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua"
local M = wesnoth.map
@ -13,7 +12,7 @@ local function hunter_attack_weakest_adj_enemy(ai, hunter)
if (hunter.attacks_left == 0) then return 'no_attack' end
local min_hp, target = 9e99
local min_hp, target = math.huge
for xa,ya in H.adjacent_tiles(hunter.x, hunter.y) do
local enemy = wesnoth.get_unit(xa, ya)
if AH.is_attackable_enemy(enemy) then
@ -36,7 +35,7 @@ local function hunter_attack_weakest_adj_enemy(ai, hunter)
end
local function get_hunter(cfg)
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local hunter = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", filter }
@ -65,7 +64,7 @@ function ca_hunter:execution(cfg)
local rand = math.random(10)
if (not hunter_vars.goal_x) or (rand == 1) then
-- 'locs' includes border hexes, but that does not matter here
locs = AH.get_passable_locations((H.get_child(cfg, "filter_location") or {}), hunter)
locs = AH.get_passable_locations((wml.get_child(cfg, "filter_location") or {}), hunter)
local rand = math.random(#locs)
hunter_vars.goal_x, hunter_vars.goal_y = locs[rand][1], locs[rand][2]
@ -75,7 +74,7 @@ function ca_hunter:execution(cfg)
local reach_map = AH.get_reachable_unocc(hunter)
-- Now find the one of these hexes that is closest to the goal
local max_rating, best_hex = -9e99
local max_rating, best_hex = - math.huge
reach_map:iter( function(x, y, v)
-- Distance from goal is first rating
local rating = -M.distance_between(x, y, hunter_vars.goal_x, hunter_vars.goal_y)
@ -121,7 +120,7 @@ function ca_hunter:execution(cfg)
MAIUV.set_mai_unit_variables(hunter, cfg.ai_id, hunter_vars)
if cfg.show_messages then
W.message { speaker = hunter.id, message = 'Now that I have eaten, I will go back home.' }
wesnoth.wml_actions.message { speaker = hunter.id, message = 'Now that I have eaten, I will go back home.' }
end
end
@ -142,7 +141,7 @@ function ca_hunter:execution(cfg)
local enemy = wesnoth.get_unit(cfg.home_x, cfg.home_y)
if AH.is_attackable_enemy(enemy) then
if cfg.show_messages then
W.message { speaker = hunter.id, message = 'Get out of my home!' }
wesnoth.wml_actions.message { speaker = hunter.id, message = 'Get out of my home!' }
end
AH.checked_attack(ai, hunter, enemy)
@ -162,7 +161,7 @@ function ca_hunter:execution(cfg)
MAIUV.set_mai_unit_variables(hunter, cfg.ai_id, hunter_vars)
if cfg.show_messages then
W.message { speaker = hunter.id, message = 'I made it home - resting now until the end of Turn ' .. hunter_vars.resting_until .. ' or until fully healed.' }
wesnoth.wml_actions.message { speaker = hunter.id, message = 'I made it home - resting now until the end of Turn ' .. hunter_vars.resting_until .. ' or until fully healed.' }
end
end
@ -185,7 +184,7 @@ function ca_hunter:execution(cfg)
MAIUV.set_mai_unit_variables(hunter, cfg.ai_id, hunter_vars)
if cfg.show_messages then
W.message { speaker = hunter.id, message = 'I am done resting. It is time to go hunting again next turn.' }
wesnoth.wml_actions.message { speaker = hunter.id, message = 'I am done resting. It is time to go hunting again next turn.' }
end
end
return

View file

@ -1,12 +1,11 @@
local LS = wesnoth.require "location_set"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local H = wesnoth.require "helper"
local function get_lurker(cfg)
-- We simply pick the first of the lurkers, they have no strategy
local lurker = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}[1]
return lurker
end
@ -26,7 +25,7 @@ function ca_lurkers:execution(cfg)
table.sort(targets, function(a, b) return (a.hitpoints < b.hitpoints) end)
local reach = LS.of_pairs(wesnoth.find_reach(lurker.x, lurker.y))
local lurk_area = H.get_child(cfg, "filter_location")
local lurk_area = wml.get_child(cfg, "filter_location")
local reachable_attack_terrain =
LS.of_pairs(wesnoth.get_locations {
{ "and", { x = lurker.x, y = lurker.y, radius = lurker.moves } },
@ -66,7 +65,7 @@ function ca_lurkers:execution(cfg)
local reachable_wander_terrain =
LS.of_pairs( wesnoth.get_locations {
{ "and", { x = lurker.x, y = lurker.y, radius = lurker.moves } },
{ "and", H.get_child(cfg, "filter_location_wander") or lurk_area }
{ "and", wml.get_child(cfg, "filter_location_wander") or lurk_area }
})
reachable_wander_terrain:inter(reach)

View file

@ -45,17 +45,17 @@ local function messenger_find_clearing_attack(messenger, goal_x, goal_y, cfg)
local enemy_in_way = messenger_find_enemies_in_way(messenger, goal_x, goal_y)
if (not enemy_in_way) then return end
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local units = AH.get_units_with_attacks {
side = wesnoth.current.side,
{ "not", filter },
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}
if (not units[1]) then return end
local attacks = AH.get_attacks(units, { simulate_combat = true })
local max_rating = -9e99
local max_rating = - math.huge
for _,attack in ipairs(attacks) do
if (attack.target.x == enemy_in_way.x) and (attack.target.y == enemy_in_way.y) then

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua"
@ -9,7 +8,7 @@ local messenger_next_waypoint = wesnoth.require "ai/micro_ais/cas/ca_messenger_f
local function get_escorts(cfg)
local escorts = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
}
return escorts
end
@ -36,7 +35,7 @@ function ca_messenger_escort_move:execution(cfg)
local enemies = AH.get_attackable_enemies()
local base_rating_map = LS.create()
local max_rating, best_unit, best_hex = -9e99
local max_rating, best_unit, best_hex = - math.huge
for _,unit in ipairs(escorts) do
-- Only considering hexes unoccupied by other units is good enough for this
local reach_map = AH.get_reachable_unocc(unit)
@ -52,7 +51,7 @@ function ca_messenger_escort_move:execution(cfg)
-- Distance from messenger is most important; only closest messenger counts for this
-- Give somewhat of a bonus for the messenger that has moved the farthest through the waypoints
local max_messenger_rating = -9e99
local max_messenger_rating = - math.huge
for _,m in ipairs(messengers) do
local messenger_rating = 1. / (M.distance_between(x, y, m.x, m.y) + 2.)
local wp_rating = MAIUV.get_mai_unit_variables(m, cfg.ai_id, "wp_rating")

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua"
@ -10,7 +9,7 @@ return function(cfg)
-- Returns nil for first 3 arguments if no messenger has moves left
-- Returns nil for all arguments if there are no messengers on the map
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local messengers = wesnoth.get_units { side = wesnoth.current.side, { "and", filter } }
if (not messengers[1]) then return end
@ -23,7 +22,7 @@ return function(cfg)
-- Set the next waypoint for all messengers
-- Also find those with MP left and return the one to next move, together with the WP to move toward
local max_rating, best_messenger, x, y = -9e99
local max_rating, best_messenger, x, y = - math.huge
for _,messenger in ipairs(messengers) do
-- To avoid code duplication and ensure consistency, we store some pieces of
-- information in the messenger units, even though it could be calculated each time it is needed

View file

@ -57,21 +57,21 @@ function ca_messenger_move:execution(cfg)
local unit_in_way = wesnoth.get_unit(next_hop[1], next_hop[2])
if (unit_in_way == messenger) then unit_in_way = nil end
if unit_in_way then wesnoth.extract_unit(unit_in_way) end
if unit_in_way then unit_in_way:extract() end
wesnoth.put_unit(messenger, next_hop[1], next_hop[2])
messenger.loc = { next_hop[1], next_hop[2] }
local _, cost1 = AH.find_path_with_shroud(messenger, x, y, { ignore_units = 'yes' })
local unit_in_way2 = wesnoth.get_unit(optimum_hop[1], optimum_hop[2])
if (unit_in_way2 == messenger) then unit_in_way2 = nil end
if unit_in_way2 then wesnoth.extract_unit(unit_in_way2) end
if unit_in_way2 then unit_in_way2:extract() end
wesnoth.put_unit(messenger, optimum_hop[1], optimum_hop[2])
messenger.loc = { optimum_hop[1], optimum_hop[2] }
local _, cost2 = AH.find_path_with_shroud(messenger, x, y, { ignore_units = 'yes' })
wesnoth.put_unit(messenger, x_current, y_current)
if unit_in_way then wesnoth.put_unit(unit_in_way) end
if unit_in_way2 then wesnoth.put_unit(unit_in_way2) end
messenger.loc = { x_current, y_current }
if unit_in_way then unit_in_way:to_map() end
if unit_in_way2 then unit_in_way2:to_map() end
-- If cost2 is significantly less, that means that the optimum path might
-- overall be faster even though it is currently blocked
@ -90,12 +90,12 @@ function ca_messenger_move:execution(cfg)
local targets = AH.get_attackable_enemies { { "filter_adjacent", { id = messenger.id } } }
local max_rating, best_target, best_weapon = -9e99
local max_rating, best_target, best_weapon = - math.huge
for _,target in ipairs(targets) do
for n_weapon,weapon in ipairs(messenger.attacks) do
local att_stats, def_stats = wesnoth.simulate_combat(messenger, n_weapon, target)
local rating = -9e99
local rating = - math.huge
-- This is an acceptable attack if:
-- 1. There is no counter attack
-- 2. Probability of death is >=67% for enemy, 0% for attacker (default values)

View file

@ -1,9 +1,8 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua"
local function get_patrol(cfg)
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local patrol = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", filter }

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
@ -10,7 +9,7 @@ function ca_protect_unit_attack:evaluation(cfg)
-- or the counter attack on the enemy turn, it does not attack, even if that's really unlikely
local units = {}
for u in H.child_range(cfg, "unit") do
for u in wml.child_range(cfg, "unit") do
table.insert(units, AH.get_units_with_attacks { id = u.id }[1])
end
if (not units[1]) then return 0 end
@ -30,7 +29,7 @@ function ca_protect_unit_attack:evaluation(cfg)
-- Set up a counter attack damage table, as many pairs of attacks will be the same
local counter_damage_table = {}
local max_rating = -9e99
local max_rating = - math.huge
for _,attack in pairs(attacks) do
-- Only consider attack if there is no chance to die or to be poisoned or slowed
if (attack.att_stats.hp_chance[0] == 0)
@ -71,7 +70,7 @@ function ca_protect_unit_attack:evaluation(cfg)
end
-- Add this to damage possible on this attack
local min_hp = 1000
local min_hp = math.huge
for hp,chance in pairs(attack.att_stats.hp_chance) do
if (chance > 0) and (hp < min_hp) then
min_hp = hp

View file

@ -1,11 +1,10 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local ca_protect_unit_finish, PU_unit, PU_goal = {}
function ca_protect_unit_finish:evaluation(cfg)
-- If a unit can make it to the goal, this is the first thing that happens
for u in H.child_range(cfg, "unit") do
for u in wml.child_range(cfg, "unit") do
local unit = AH.get_units_with_moves { id = u.id }[1]
if unit then
local path, cost = AH.find_path_with_shroud(unit, u.goal_x, u.goal_y)

View file

@ -1,11 +1,10 @@
local H = wesnoth.require "helper"
local LS = wesnoth.require "location_set"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local function get_protected_units(cfg)
local units = {}
for u in H.child_range(cfg, "unit") do
for u in wml.child_range(cfg, "unit") do
table.insert(units, AH.get_units_with_moves { id = u.id }[1])
end
return units
@ -24,7 +23,7 @@ function ca_protect_unit_move:execution(cfg, data)
-- Need to take the protected units off the map, as they don't count into the map scores
-- as long as they can still move
for _,unit in ipairs(protected_units) do wesnoth.extract_unit(unit) end
for _,unit in ipairs(protected_units) do unit:extract() end
local units = wesnoth.get_units { side = wesnoth.current.side }
local enemy_units = AH.get_attackable_enemies()
@ -33,12 +32,12 @@ function ca_protect_unit_move:execution(cfg, data)
local enemy_attack_map = BC.get_attack_map(enemy_units).units -- enemy attack map
-- Now put the protected units back out there
for _,unit in ipairs(protected_units) do wesnoth.put_unit(unit) end
for _,unit in ipairs(protected_units) do unit:to_map() end
-- We move the weakest (fewest HP unit) first
local unit = AH.choose(protected_units, function(u) return - u.hitpoints end)
local goal = {}
for u in H.child_range(cfg, "unit") do
for u in wml.child_range(cfg, "unit") do
if (unit.id == u.id) then goal = { u.goal_x, u.goal_y } end
end
@ -47,7 +46,7 @@ function ca_protect_unit_move:execution(cfg, data)
local terrain_defense_map = LS.create()
reach_map:iter(function(x, y, data)
terrain_defense_map:insert(x, y, 100 - wesnoth.unit_defense(unit, wesnoth.get_terrain(x, y)))
terrain_defense_map:insert(x, y, 100 - unit:defense(wesnoth.get_terrain(x, y)))
end)
local goal_distance_map = LS.create()
@ -56,10 +55,10 @@ function ca_protect_unit_move:execution(cfg, data)
end)
-- Configuration parameters (no option to change these enabled at the moment)
local enemy_weight = data.PU_enemy_weight or 100.
local my_unit_weight = data.PU_my_unit_weight or 1.
local distance_weight = data.PU_distance_weight or 3.
local terrain_weight = data.PU_terrain_weight or 0.1
local enemy_weight = 100.
local my_unit_weight = 1.
local distance_weight = 3.
local terrain_weight = 0.1
-- If there are no enemies left, only distance to goal matters
-- This is to avoid rare situations where moving toward goal rating is canceled by rating for moving away from own units
@ -70,7 +69,7 @@ function ca_protect_unit_move:execution(cfg, data)
terrain_weight = 0
end
local max_rating, best_hex = -9e99
local max_rating, best_hex = - math.huge
for ind,_ in pairs(reach_map.values) do
local rating =
(attack_map.values[ind] or 0) * my_unit_weight

View file

@ -59,7 +59,7 @@ function ca_recruit_random:evaluation(cfg)
local probabilities, probability_sum = {}, 0
-- Go through all the types listed in [probability] tags (which can be comma-separated lists)
for prob in H.child_range(cfg, "probability") do
for prob in wml.child_range(cfg, "probability") do
types = AH.split(prob.type, ",")
for _,typ in ipairs(types) do -- 'type' is a reserved keyword in Lua
-- If this type is in the recruit list, add it

View file

@ -1,8 +1,7 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local function get_guardian(cfg)
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local guardian = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", filter }

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local LS = wesnoth.require "location_set"
@ -8,13 +7,13 @@ local ca_simple_attack, best_attack = {}
function ca_simple_attack:evaluation(cfg)
local units = AH.get_units_with_attacks {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
if (not units[1]) then return 0 end
-- If cfg.filter_second is set, set up a map (location set)
-- of enemies that it is okay to attack
local enemy_filter = H.get_child(cfg, "filter_second")
local enemy_filter = wml.get_child(cfg, "filter_second")
local enemy_map
if enemy_filter then
local enemies = AH.get_attackable_enemies(enemy_filter)
@ -28,7 +27,7 @@ function ca_simple_attack:evaluation(cfg)
local attacks = AH.get_attacks(units, { include_occupied = true })
if (not attacks[1]) then return 0 end
local max_rating = -9e99
local max_rating = - math.huge
for _, att in ipairs(attacks) do
local valid_target = true
if enemy_filter and (not enemy_map:get(att.target.x, att.target.y)) then

View file

@ -3,7 +3,7 @@ local AH = wesnoth.require "ai/lua/ai_helper.lua"
local M = wesnoth.map
local function get_guardian(cfg)
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local guardian = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", filter }
@ -37,7 +37,7 @@ function ca_stationed_guardian:execution(cfg)
-- Otherwise, guardian will either attack or move toward station
-- Enemies must be within cfg.distance of guardian, (s_x, s_y) *and* (g_x, g_y)
-- simultaneously for guardian to attack
local min_dist, target = 9e99
local min_dist, target = math.huge
for _,enemy in ipairs(enemies) do
local dist_s = M.distance_between(cfg.station_x, cfg.station_y, enemy.x, enemy.y)
local dist_g = M.distance_between(cfg.guard_x or cfg.station_x, cfg.guard_y or cfg.station_y, enemy.x, enemy.y)
@ -52,14 +52,14 @@ function ca_stationed_guardian:execution(cfg)
if target then
-- Find tiles adjacent to the target
-- Save the one with the highest defense rating that guardian can reach
local best_defense, attack_loc = -9e99
local best_defense, attack_loc = - math.huge
for xa,ya in H.adjacent_tiles(target.x, target.y) do
-- Only consider unoccupied hexes
local unit_in_way = wesnoth.get_unit(xa, ya)
if (not AH.is_visible_unit(wesnoth.current.side, unit_in_way))
or (unit_in_way == guardian)
then
local defense = 100 - wesnoth.unit_defense(guardian, wesnoth.get_terrain(xa, ya))
local defense = 100 - guardian:defense(wesnoth.get_terrain(xa, ya))
local nh = AH.next_hop(guardian, xa, ya)
if nh then
if (nh[1] == xa) and (nh[2] == ya) and (defense > best_defense) then
@ -77,7 +77,7 @@ function ca_stationed_guardian:execution(cfg)
-- Go through all hexes the guardian can reach, find closest to target
-- Cannot use next_hop here since target hex is occupied by enemy
local min_dist, nh = 9e99
local min_dist, nh = math.huge
for _,hex in ipairs(reach) do
-- Only consider unoccupied hexes
local unit_in_way = wesnoth.get_unit(hex[1], hex[2])

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local M = wesnoth.map
@ -6,15 +5,15 @@ local M = wesnoth.map
local function get_wolves(cfg)
local wolves = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
return wolves
end
local function get_prey(cfg)
-- Note: we cannot pass H.get_child() directly to AH.get_attackable_enemies()
-- Note: we cannot pass wml.get_child() directly to AH.get_attackable_enemies()
-- as the former returns two values and the latter takes optional arguments
local filter_second = H.get_child(cfg, "filter_second")
local filter_second = wml.get_child(cfg, "filter_second")
local prey = AH.get_attackable_enemies(filter_second)
return prey
end
@ -35,7 +34,7 @@ function ca_wolves_move:execution(cfg)
local avoid_map = BC.get_attack_map(avoid_units).units
-- Find prey that is closest to the wolves
local min_dist, target = 9e99
local min_dist, target = math.huge
for _,prey_unit in ipairs(prey) do
local dist = 0
for _,wolf in ipairs(wolves) do

View file

@ -76,7 +76,7 @@ function ca_wolves_multipacks_attack:execution(cfg)
end
-- Find which target can be attacked by the most units, from the most hexes; and rate by fewest HP if equal
local max_rating, best_target = -9e99
local max_rating, best_target = - math.huge
for attack_ind,attack in pairs(attack_map_wolves) do
local number_wolves, number_hexes = 0, 0
for _,w in pairs(attack) do number_wolves = number_wolves + 1 end
@ -110,7 +110,7 @@ function ca_wolves_multipacks_attack:execution(cfg)
-- Now we know the best target and need to attack
-- This is done on a wolf-by-wolf basis, the outside while loop taking care of
-- the next wolf in the pack on subsequent iterations
local max_rating, best_attack = -9e99
local max_rating, best_attack = - math.huge
for _,attack in ipairs(attacks) do
if (attack.target.x == best_target.x) and (attack.target.y == best_target.y) then
local rating = attack.att_stats.average_hp / 2. - attack.def_stats.average_hp

View file

@ -58,7 +58,7 @@ function wolves_multipacks_functions.assign_packs(cfg)
-- First, go through packs that have less than pack_size members
for pack_number,pack in pairs(packs) do
if (#pack < pack_size) then
local min_dist, best_wolf, best_ind = 9e99
local min_dist, best_wolf, best_ind = math.huge
for ind,wolf in ipairs(nopack_wolves) do
-- Criterion is distance from the first two wolves of the pack
local dist1 = M.distance_between(wolf.x, wolf.y, pack[1].x, pack[1].y)
@ -97,7 +97,7 @@ function wolves_multipacks_functions.assign_packs(cfg)
-- They form the next pack
local new_pack_wolves = {}
while (#new_pack_wolves < pack_size) do
local min_dist, best_wolf, best_wolf_ind = 9e99
local min_dist, best_wolf, best_wolf_ind = math.huge
for ind,nopack_wolf in ipairs(nopack_wolves) do
local dist = 0
for _,pack_wolf in ipairs(new_pack_wolves) do

View file

@ -43,8 +43,7 @@ function ca_wolves_multipacks_wander:execution(cfg)
-- Pack gets a new goal if none exist or on any move with 10% random chance
local rand = math.random(10)
if (not goal[1]) or (rand == 1) then
local width, height = wesnoth.get_map_size()
local locs = wesnoth.get_locations { x = '1-'..width, y = '1-'..height }
local locs = AH.get_locations_no_borders {}
-- Need to find reachable terrain for this to be a viable goal
-- We only check whether the first wolf can get there
@ -81,7 +80,7 @@ function ca_wolves_multipacks_wander:execution(cfg)
-- Keep only those hexes that can be reached by all wolves in the pack
-- and add distance from goal for those
local max_rating, goto_hex = -9e99
local max_rating, goto_hex = - math.huge
reach_map:iter( function(x, y, v)
local rating = reach_map:get(x, y)
if (rating == #pack * 100) then

View file

@ -1,4 +1,3 @@
local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local LS = wesnoth.require "location_set"
@ -6,7 +5,7 @@ local LS = wesnoth.require "location_set"
local function get_wolves(cfg)
local wolves = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", H.get_child(cfg, "filter") }
{ "and", wml.get_child(cfg, "filter") }
}
return wolves
end
@ -32,7 +31,7 @@ function ca_wolves_wander:execution(cfg)
local avoid_units = AH.get_attackable_enemies({ type = cfg.avoid_type })
local avoid_map = BC.get_attack_map(avoid_units).units
local max_rating, goal_hex = -9e99
local max_rating, goal_hex = - math.huge
reach_map:iter( function (x, y, v)
local rating = v + math.random(99)/100.
if avoid_map:get(x, y) then rating = rating - 1000 end

View file

@ -4,7 +4,7 @@ local LS = wesnoth.require "location_set"
local M = wesnoth.map
local function get_guardian(cfg)
local filter = H.get_child(cfg, "filter") or { id = cfg.id }
local filter = wml.get_child(cfg, "filter") or { id = cfg.id }
local guardian = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", filter }
@ -23,11 +23,11 @@ function ca_zone_guardian:execution(cfg)
local guardian = get_guardian(cfg)
local reach = wesnoth.find_reach(guardian)
local zone = H.get_child(cfg, "filter_location")
local zone_enemy = H.get_child(cfg, "filter_location_enemy") or zone
local zone = wml.get_child(cfg, "filter_location")
local zone_enemy = wml.get_child(cfg, "filter_location_enemy") or zone
local enemies = AH.get_attackable_enemies { { "filter_location", zone_enemy } }
if enemies[1] then
local min_dist, target = 9e99
local min_dist, target = math.huge
for _,enemy in ipairs(enemies) do
local dist = M.distance_between(guardian.x, guardian.y, enemy.x, enemy.y)
if (dist < min_dist) then
@ -39,14 +39,14 @@ function ca_zone_guardian:execution(cfg)
if target then
-- Find tiles adjacent to the target
-- Save the one with the highest defense rating that guardian can reach
local best_defense, attack_loc = -9e99
local best_defense, attack_loc = - math.huge
for xa,ya in H.adjacent_tiles(target.x, target.y) do
-- Only consider unoccupied hexes
local unit_in_way = wesnoth.get_unit(xa, ya)
if (not AH.is_visible_unit(wesnoth.current.side, unit_in_way))
or (unit_in_way == guardian)
then
local defense = 100 - wesnoth.unit_defense(guardian, wesnoth.get_terrain(xa, ya))
local defense = 100 - guardian:defense(wesnoth.get_terrain(xa, ya))
local nh = AH.next_hop(guardian, xa, ya)
if nh then
if (nh[1] == xa) and (nh[2] == ya) and (defense > best_defense) then
@ -64,7 +64,7 @@ function ca_zone_guardian:execution(cfg)
-- Go through all hexes the guardian can reach, find closest to target
-- Cannot use next_hop here since target hex is occupied by enemy
local min_dist, nh = 9e99
local min_dist, nh = math.huge
for _,hex in ipairs(reach) do
-- Only consider unoccupied hexes
local unit_in_way = wesnoth.get_unit(hex[1], hex[2])
@ -90,12 +90,7 @@ function ca_zone_guardian:execution(cfg)
newpos = { cfg.station_x, cfg.station_y }
-- Otherwise choose one randomly from those given in filter_location
else
local width, height = wesnoth.get_map_size()
local locs_map = LS.of_pairs(wesnoth.get_locations {
x = '1-' .. width,
y = '1-' .. height,
{ "and", zone }
})
local locs_map = LS.of_pairs(AH.get_locations_no_borders(zone))
-- Check out which of those hexes the guardian can reach
local reach_map = LS.of_pairs(wesnoth.find_reach(guardian))

View file

@ -33,7 +33,7 @@ return {
moves = "current",
variable = "tmp_locs"
}
attack_locs = H.get_variable_array("tmp_locs")
attack_locs = wml.array_access.get("tmp_locs")
W.clear_variable { name = "tmp_locs" }
if (#attack_locs > 0) then break end
end

View file

@ -30,7 +30,7 @@ function wesnoth.micro_ais.wolves(cfg)
id = "mai_wolves_" .. (cfg.ca_id or "default") .. "_dont_attack",
invalidate_on_gamestate_change = "yes",
{ "filter_enemy", {
{ "and", H.get_child(cfg, "filter_second") }
{ "and", wml.get_child(cfg, "filter_second") }
} }
}
}
@ -165,7 +165,7 @@ function wesnoth.micro_ais.wolves_multipacks(cfg)
end
function wesnoth.micro_ais.hunter(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Hunter [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "home_x", "home_y" }

View file

@ -1,7 +1,7 @@
local H = wesnoth.require "helper"
function wesnoth.micro_ais.messenger_escort(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Messenger [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "waypoint_x", "waypoint_y" }

View file

@ -1,5 +1,3 @@
local H = wesnoth.require "helper"
function wesnoth.micro_ais.fast_ai(cfg)
local optional_keys = {
"attack_hidden_enemies", "[avoid]", "dungeon_mode",

View file

@ -1,7 +1,7 @@
local H = wesnoth.require "helper"
function wesnoth.micro_ais.stationed_guardian(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Stationed Guardian [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "distance", "station_x", "station_y" }
@ -14,7 +14,7 @@ function wesnoth.micro_ais.stationed_guardian(cfg)
end
function wesnoth.micro_ais.zone_guardian(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Zone Guardian [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "[filter_location]" }
@ -27,7 +27,7 @@ function wesnoth.micro_ais.zone_guardian(cfg)
end
function wesnoth.micro_ais.return_guardian(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Return Guardian [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "return_x", "return_y" }
@ -40,7 +40,7 @@ function wesnoth.micro_ais.return_guardian(cfg)
end
function wesnoth.micro_ais.coward(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Coward [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "distance" }

View file

@ -1,7 +1,7 @@
local H = wesnoth.require "helper"
function wesnoth.micro_ais.patrol(cfg)
if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then
if (cfg.action ~= 'delete') and (not cfg.id) and (not wml.get_child(cfg, "filter")) then
H.wml_error("Patrol [micro_ai] tag requires either id= key or [filter] tag")
end
local required_keys = { "waypoint_x", "waypoint_y" }

View file

@ -11,7 +11,7 @@ function wesnoth.micro_ais.protect_unit(cfg)
}
local unit_ids = {}
for u in H.child_range(cfg, "unit") do
for u in wml.child_range(cfg, "unit") do
if not u.id then
H.wml_error("Protect Unit Micro AI missing id key in [unit] tag")
end

View file

@ -1,5 +1,3 @@
local H = wesnoth.require "helper"
local function handle_default_recruitment(cfg)
-- Also need to delete/add the default recruitment CA
if cfg.action == 'add' then

View file

@ -1,35 +1,35 @@
Gg , Gg , Gll^Fp , Gll , Gll , Gg , Gs , Gs , Hh^Fp , Gg , Mm , Ms , Ms^Xm , Wo , Wo , Ms , Ms , Ms , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Hh , Hh , Hh , Hh , Gs , Gs , Gs , Gd , Gs , Gd , Hhd , Hhd , Hhd , Rd , Rd , Hhd , Hhd , Rd , Rd , Hd , Hhd , Rd , Dd , Hd , Dd , Dd , Hhd , Dd^Edp , Dd , Hd , Dd , Hd , Dd , Dd
Gg , Gll^Fp , Gs , Gll^Fp , Gs , Gs^Fms , Gll , Gg , Gll^Fp , Hh^Fp , Hh , Mm , Ms , Ha , Wo , Ms , Ha , Ms , Ms , Mm , Mm , Mm , Mm , Hh , Gg , Hh , Gs , Hh , Gs , Gs , Gs , Gs , Gs , Rd , Gd , Rd , Gd , Rd , Hhd , Hhd , Hhd , Hhd , Rd , Rd , Rd^Esd , Hhd , Dd^Edpp , Rd , Hd , Rd , Dd^Vdt , Rd^Dr , Dd , Dd , Hd , Hd , Dd , Hd , Hd
Gg , Gll , Gll^Fp , Gll , Gs^Fms , Gs , Gs , Gll , Gs , Gs , Gg , Mm , Mm , Ms , Ms , Ha , Ha , Ha , Ms , Mm , Mm , Mm , Mm , Gg , Mm , Gs , Hh , Hh , Hh , Gs^Es , Gs , Gs , Gs , Gd , Hhd , Hhd , Hhd^Vhhr , Gd , Gd , Rd , Gd , Hhd , Dd , Rd^Dr , Rd , Dd , Dd , Rd , Rd , Dd , Rd , Hd , Hd , Dd , Hd , Dd , Dd , Dd , Dd^Dc
Gg , Gll^Fp , Gll^Fp , Gll^Fp , Gs , Gll^Fp , Gs , Gs^Fms , Gs , Hh^Fp , Gg , Hh , Hh^Fp , Mm , Ha , Ms , Ms , Ms , Ms , Mm , Mm , Hh , Gg^Efm , Mm , Mm , Mm , Hh , Hh , Gg , Gg , Gs , Gs , Gd , Rd , Hhd , Hhd , Gd , Rd , Hhd , Rd , Rd , Rd , Rd , Dd , Hd , Hhd , Rd , Dd , Dd , Dd , Rd^Esd , Hd , Rd , Hd , Dd , Hd , Dd , Dd , Hd
Gg , Gll^Fp , Gll^Fp , Gs^Fms , Gll , Gs , Gll^Fp , Gg , Gs , Gs , Gg , Gll^Fp , Gs^Fms , Hh , Hh , Hh , Hh , Ms , Ms , Mm , Mm , Mm , Mm , Mm , Hh , Hh , Hh , Hh , Gs , Gs , Gs , Gs , Gs , Gd , Gd , Hhd , Hhd , Rd , Gd , Gd , Hhd , Hhd , Rd , Hhd , Hhd , Rd , Hd , Dd , Rd , Rd , Dd , Hd , Dd^Edpp , Dd , Rd , Dd , Rd , Dd^Edp , Hhd
Gs , Gs^Fms , Gs , Gg , Gg , Gs^Vl , Gll^Fp , Gs , Gs^Fms , Gg , Gg , Gll^Fp , Gg , Hh^Fp , Gg , Hh , Hh , Mm , Mm , Ms , Mm , Hh , Mm , Hh , Mm , Hh , Gg , Gg , Gg , Gs , Gg , Gs , Gs , Gd , Gs , Rd , Hhd , Gd , Hhd , Hhd , Gd , Gd , Hhd , Gd , Rd , Rd , Dd , Rd , Hhd , Hhd , Hd , Rd , Hhd , Rd , Hd , Hd , Dd , Hd , Hd
Gll^Fp , Gs , Gs , Gs^Fms , Gll^Fp , Gll , Gs^Fms , Gg , Gs , Gll^Fp , Gs^Fms , Gg , Hh^Fp , Gs , Gg , Hh^Fp , Gg^Efm , Hh^Fp , Hh , Mm , Mm , Mm , Mm , Mm , Mm , Gg , Hh , Hh , Hh , Gs , Gs , Gs , Gs , Gs , Gd , Gd , Hhd , Hhd , Hhd , Gd , Rd , Gd , Rd , Rd , Dd , Rd , Hhd , Rd , Rd , Rd^Esd , Dd , Hhd , Rd , Dd , Rd^Esd , Hd , Hhd , Hhd , Hhd
Gg , Gs , Gg , Gll^Fp , Gs , Gs , Gs , Gs , Gs , Gs^Fms , Gg , Gs , Gg , Gg , Gs^Fms , Gg , Gg , Hh^Fp , Hh^Fds , Hh , Hh , Mm , Mm , Mm , Hh , Hh , Gg , Hh , Hh , Gs , Gs , Gs , Gs , Gd , Gd , Gd , Gd , Gd , Rd , Rd , Rd , Rd , Hhd , Gd , Gd , Rd , Dd , Rd , Rd^Esd , Dd , Rd , Rd , Dd , Rd^Esd , Rd , Hhd , Dd , Rd , Hhd
Gg , Gs , Gs , Gs^Fms , Gll^Fp , Gg , Gs^Fms , Gs , Gs , Gs^Fds , Gs , Gs , Gs , Gg , Gs , Gg , Gs , Hh^Fp , Gg , Gg , Hh , Mm , Mm , Mm , Mm , Hh , Hh , Gg , Gs , Gg , Gs , Gs , Gg , Gs , Gd , Hhd , Hhd , Hhd , Hhd , Rd , Gd , Rd , Gd , Hhd , Gd , Rd , Rd , Hd , Rd , Rd , Dd , Rd , Hhd , Hhd , Hhd , Dd , Dd , Rd , Hhd
Gg , Gll^Fp , Gll , Gg , Gll^Fp , Gs , Gg , Gll^Fp , Gs^Fms , Gg , Gll^Fp , Gg , Gs^Fms , Gs^Fms , Gs , Gs , Gs^Fms , Gg , Gg , Gg , Hh^Fp , Hh , Hh^Vhh , Mm , Hh , Hh , Hh , Gs , Gg , Gg , Hh , Gg , Hh , Hh , Hh , Gd , Gd , Gd , Gd , Hhd , Hhd , Gd , Rd , Hhd , Rd , Rd , Dd , Rd , Rd , Hhd , Rd , Rd , Md , Md , Hhd , Hhd , Hhd , Hhd , Hh
Gs^Fms , Gll , Gs , Gs , Gll^Fp , Gll , Gs , Gs , Gs , Gll^Fp , Gg , Gs^Fms , Gg , Gs^Fms , Gg , Gs , Gs^Fms , Gg , Gg , Gll^Fp , Gg^Efm , Hh , Hh , Mm , Mm , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Gd , Hh , Gd , Gd , Hhd , Gd , Hhd , Gd , Gd , Rd , Rd , Rd , Rd^Dr , Gd , Hhd , Hhd , Md , Md , Hhd , Hh , Md , Md , Md
Gll^Fp , Gg , Gs^Fms , Gs , Gs , Gs^Fms , Gll^Fp , Gs^Fms , Gs^Fms , Gs , Gs , Gs^Fms , Gg , Gs^Fms , Gll^Fp , Gg , Gll^Fp , Gs^Fms , Gg , Gg , Gs , Hh^Fds , Gs , Hh , Mm , Mm , Mm , Hh , Mm , Mm , Mm , Mm , Mm , Hh , Hh , Gs , Gs , Hh , Hhd , Gd , Hhd , Gd , Gd , Rd , Hhd , Rd , Rd , Gd , Rd , Rd , Hhd , Md , Md , Md , Md , Md , Mm , Md , Mm
Gg , Gs^Fms , Gll^Fp , Gs , Gs , Gg , Gg , Gs^Fds , Gs , Gs , Gg , Gs , Gs , Gs^Fds , Gs , Gs , Gg , Gs^Fds , Gs^Fms , Gg , Gll^Fp , Gg , Hh , Hh , Hh , Mm , Mm , Mm , Mm , Mm , Hh , Mm , Hh , Mm , Gs , Gs , Gs , Hh , Hh , Hh , Hhd , Hhd , Hhd , Rd , Hhd , Gd , Gd , Hhd , Gd^Es , Gd , Gd , Hhd^Vhhr , Md , Md , Md , Mm , Mm , Mm , Hh
Gg , Gll , Gg , Gg , Gg , Gs , Gs , Gs^Fms , Gs^Fms , Gs^Fms , Gll^Fp , Gg , Gg , Gs , Gs^Fms , Gg , Gs , Gg , Gg , Gg , Gg , Gs^Fms , Gg , Gg , Hh , Hh^Fp , Hh , Mm , Hh , Gg , Mm , Hh , Hh , Hh , Gg , Hh , Gs , Hh , Gs , Gd , Hh , Hhd , Hhd , Gd , Gd , Rd , Gd , Hhd , Hh , Hhd , Hh , Hhd , Md , Md , Md , Mm , Hh , Hh , Gg
Gs^Fms , Gs^Fms , Gg , Gs^Fms , Gs^Fms , Gs^Fms , Gg , Gll^Fp , Gs^Fms , Gg^Efm , Gs^Fms , Gs^Fms , Gs^Fms , Gs , Gs , Gg , Gll^Fp , Gs , Gg , Gs^Fms , Gs^Fms , Gs^Fms , Gg , Gg , Gg , Gg , Gg , Hh , Gg , Hh , Gs , Gs , Gs , Gs , Gs , Hh , Hh , Hh , Gs , Hh , Gs , Gd , Hhd , Hhd , Hh , Gd , Hh , Hhd , Md , Md , Md , Md , Md , Md , Md , Mm , Hh , Hh , Gg
Gg , Gg , Gs , Gs^Fms , Gs , Gs , Gs , Gs , Gs^Fms , Gll^Fp , Gg , Gg , Gs , Gs , Gll^Fp , Gg , Gs^Fms , Gs^Fms , Gs^Fms , Gs , Gs , Gs^Fms , Gg , Gs^Fms , Gg , Gs^Fms , Gg , Gg , Gs , Gs , Gg , Hh , Md , Hh^Vhh , Mm , Mm , Mm , Hh , Hh , Hh , Md , Hh , Hh , Hhd , Hh , Md , Md , Md , Md , Md , Md , Md , Md , Md , Mm , Hh , Hh , Hh , Gg
Gll , Gs , Gs , Gg , Gs^Fms , Gs , Gs , Gs^Fms , Gg , Gs^Fms , Gs^Fms , Gs^Fms , Gs^Fms , Gs^Fms , Gg , Gs^Fms , Gg , Gll^Fp , Gs^Fms , Gg , Gg , Gs , Gs , Gg , Gs^Fms , Gs , Gs , Gs , Gg , Gg , Hh , Hh , Hh , Md , Md , Mm , Md , Hh , Hh , Gg , Md , Hh , Md , Hh , Md , Md , Ms , Md , Md , Md , Hh , Md , Hh , Mm , Hh , Mm , Hh , Hh , Gg
Gll^Fp , Gs , Gs , Gs , Gg , Gg , Gs , Gg , Gs^Fms , Gs , Gs , Gg , Gll^Fp , Gll , Gs , Gs^Fms , Gs^Fms , Gs^Fms , Gs^Fds , Gs^Fms , Gg , Gg , Gg , Gs^Fms , Gs^Fms , Gs^Fms , Gg , Gs , Gg , Gs^Fms , Gg , Hh , Hh , Hh , Hh , Md , Md , Hh , Md , Md , Md , Md , Md , Md , Md , Ms , Ha , Ms , Mm , Md , Hh , Mm , Hh , Mm , Mm , Mm , Mm , Gs , Gg
Gll , Gll , Gg , Gs , Gs^Fms , Gs^Fms , Gs^Fms , Gs , Gg , Gg , Gs^Fms , Gs , Gs , Gs , Gg , Gg , Gs , Gll^Fp , Gs^Fms , Gs^Fms , Gs^Fms , Gs , Gs , Gs^Fms , Gs , Gg , Gs^Fms , Gg , Gs^Fms , Gg , Gs^Fms , Gg , Gs , Gs , Gg , Hh , Hh , Md , Mm , Mm , Mm , Mm , Mm , Md , Mm , Mm , Wo , Ms , Mm , Mm , Hh^Vhh , Hh , Hh , Gg , Hh , Mm , Hh , Hh , Gs
Gll^Fp , Gs , Gs^Fms , Gs^Fms , Gs^Vh , Gs^Fms , Gg , Gs , Gll^Fp , Gs^Fds , Gs^Fds , Gg , Gs^Fms , Gs^Fms , Gg , Gs^Fms , Gll^Fp , Gs^Fms , Gs , Gs^Vc , Gs^Fms , Gg , Gs^Fds , Gg , Gg , Gg , Gg , Gs^Fms , Gs^Fms , Gs^Fms , Gg , Gg , Gs^Fds , Gll^Fp , Gg , Hh , Gg , Gg , Hh , Hh , Hh , Mm , Hh , Mm , Hh , Hh , Ww , Hh , Hh , Hh , Gg , Hh , Gs , Gg , Hh , Mm , Mm , Gs , Hh
Gll^Fp , Gg , Gs , Gs^Fms , Gs , Gs^Fms , Gs , Gs^Fms , Gg , Gg^Efm , Gg , Gg , Gs^Fms , Gg , Gg , Gll^Fp , Gs^Fms , Gg^Efm , Gll^Fp , Gs^Fds , Gs^Fms , Gs^Fms , Gg , Gs^Fms , Gs^Fds , Gg , Gs^Fds , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg^Efm , Hh , Hh , Hh , Hh , Wo , Ww , Gg^Efm , Hh , Gg , Gs , Gg , Hh , Hh , Gs , Gs , Hh , Hh , Chr , Rp
Gs^Fms , Gg , Gs , Gs , Gg , Gs , Gs , Gs^Fms , Gs^Fms , Gs^Fds , Gs , Gs , Gg , Gs^Fms , Gs^Fms , Gs^Fds , Gs^Fms , Gs^Fms , Gg , Gs , Gg , Gg , Gg , Gg , Gs^Fds , Gg , Gg , Gg , Gs^Fds , Gs^Fms , Gg , Gg , Gs^Fds , Gg , Gg , Gg , Ww , Gg , Wwf , Ww , Ww , Ww , Wo , Ww , Gg , Hh , Gg , Hh , Gg , Gs , Gg , Gg , Gs , Hh , Gs , Gs , Re , Rp , Chr
Gll^Fp , Gll , Gs , Gs^Fms , Gll^Fp , Gs , Gs , Gg , Gs , Gg , Gs , Gg , Gs^Fms , Gg , Gs^Fds , Gs , Gs , Gg , Gs^Fms , Gs^Fms , Gs^Fds , Gg , Gs^Fds , Gs^Fds , Gg , Gg , Gg , Gg , Gg , Gs^Fds , Gg , Gg , Ww , Gg , Ww , Ww , Gg , Ww , Gg , Gg , Gg , Hh , Hh , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gs , Gs , Gg , Gg , Rp , Rp , Hh , Hh , Hh
Gs^Fms , Gll^Fp , Gs^Fms , Gs^Fms , Gll , Gg , Gg , Gg , Gg , Gs^Fms , Gg , Gg , Gs^Fds , Gg , Gg , Gg , Gs^Fms , Gg , Gg , Gs^Fms , Gg , Gs^Fds , Wo , Wo , Ww , Gs^Fms , Ww , Ww , Ww , Gg , Ww , Ww , Gs^Fds , Ww , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gs , Gs , Gs , Gg , Rr , Gs , Hh , Hh , Hh , Hh
Gg , Gg , Gs , Gs , Gs^Fms , Gs^Fms , Gll^Fp , Gs^Fms , Gg , Gs^Fds , Gg , Gs^Fds , Gg , Gg , Gs^Fds , Gg , Gs^Fms , Gg , Gs^Fms , Gg , Wo , Wo , Gg , Gg , Gg , Ww , Gs^Fds , Gg , Gg , Ww , Gg , Gg , Rb , Gg , Rb , Gg , Gg , Gg , Gs , Gg , Gg , Gg , Gg , Gg , Gg , Gs , Gg , Gg , Gs , Gg , Gs , Gg , Re , Rp , Gg , Hh , Hh , Hh , Gg
Gg , Gs^Fds , Gll^Fp , Gs , Gs^Fms , Gg , Gs^Fms , Gll^Fp , Gs^Fms , Gs , Gs^Fms , Gs^Fms , Gg , Gs^Fms , Gs^Fms , Gs^Fds , Gg , Gs^Fms , Gs^Fms , Gg , Wo , Gg^Efm , Gg , Gs^Fms , Gg , Gg , Gg , Gg , Gg , Gg , Rb , Rb , Gg , Rb , Gg , Rb , Rb , Gg , Gg , Gg , Gg , Gs , Gg , Gg , Gg , Gs , Gs , Gs , Gg , Gg , Gg , Gg , Rp , Gs , Hh , Gg , Gg , Hh , Hh
Gg , Gs , Gs , Gg , Gg , Gs , Gs^Fms , Gll^Fp , Gg , Gs , Gs , Gs^Fms , Gs^Fds , Gs^Fms , Gs , Gg , Gg , Gs^Fms , Gg , Gg , Wo , Gs^Fms , Gg , Gg , Gg , Gs^Fds , Gs^Fds , Gg , Rb , Rb , Gs , Gg , Gg , Gg , Gg , Gg , Gg , Rb , Rb , Gs , Gg , Gg , Gs , Gg , Gg , Gs , Gs , Gs , Gs , Gs , Gs , Gg , Rp , Hh , Hh , Gs , Hh , Hh , Gg
Gs^Fms , Gs , Gs , Gs^Fms , Gs , Gs , Gs^Fms , Gs^Fms , Gg , Gs^Fms , Gg , Gs^Fms , Gs , Gs^Fms , Gs , Gg , Gs^Fms , Gs^Fms , Gg , Gs^Fds , Ss , Wo , Wo , Gg , Gg , Gg , Rb , Rb , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Rb , Gg , Gg , Gs , Gg , Gs , Gg , Gg , Gs , Gs , Gg , Gs , Gs , Rp , Gg , Gs , Hh , Gg , Gs , Gg
Gg , Gs , Gs^Fds , Gs^Fds , Gs , Gs^Fms , Gg , Gs , Gs^Fds , Gs^Fms , Gg , Gs^Fds , Gs^Fds , Gg , Gg , Gg , Gg , Gg , Gs^Fms , Gs^Fds , Gg , Gg , Gs^Fms , Ww , Gs^Fds , Rb , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gs , Gs , Gg , Rb , Gg , Gg , Gg , Gs , Gg , Gs , Gs , Gs , Gs , Gg , Gs , Rp , Gs , Gs , Gg , Gs , Gs , Hh , Gs
Gs , Gs^Fds , Gs^Fms , Gg , Gs , Gs , Gs^Fms , Gs , Gg , Gs , Gs , Gs^Fms , Gg , Gs^Fms , Gg , Gs^Fms , Gs , Gg , Gs^Fds , Gs^Fms , Gg , Gg , Gs^Fds , Wo , Gg , Rb , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gs , Gg , Rb , Gg , Gs , Gs , Gs , Gs , Gs , Gs , Gs , Gs , Gs , Gg , Rp , Gg , Gg , 1 Gs , Gs , Gg , Gg , Gg
Gs , Gs , Gs , Gg , Gs^Fms , Gg , Gs^Fms , Gll^Fp , Gs^Fms , Gs^Vl , Gs^Fms , Gs^Fms , Gs^Fms , Gg , Gg , Gs^Fms , Gs^Fds , Gg , Gg , Gg , Gg , Gg , Wo , Ww , Gg , Rb , Gg , Gg , Gg , Gg , Gs , Gg , Gs , Gg , Gg , Gs , Gg , Gs , Gg , Rb , Gg , Gg , Gs , Gs , Gg , Gs , Gg , Gs , Gs , Gg , Gg , Re , Gg , Gs , Gs , Gs , Gs , Gs , Gg
Gs , Gs^Fms , Gs^Fds , Gg , Gs , Gg , Gs^Fms , Gs^Fms , Gs , Gs^Fms , Gg , Gs , Gs , Gs , Gg , Gs^Fds , Gg , Gg , Gg , Gs^Fds , Gg , Gg , Wo , Gg , Gg , Rb , Gg , Gg , Gg , Gg , Gg , Gs , Gg , Gg , Rb , Gg , Rb , Gg , Rb , Rb , Gg , Gg , Gs , Gg , Gg , Gs , Gs , Gs , Gs , Gs , Rp , Rp , Gg , Gg , Gg , Gg , Gg , Gs , Rb^Eff
Gg , Gs^Fds , Gs^Fds , Gs , Gg , Gg , Gg , Gs , Gs , Gs^Fms , Gg , Gs^Fms , Gg , Gg , Gg , Gs^Fms , Gg , Gg , Gg , Gs^Fms , Wo , Wo , Gg^Efm , Gg , Gg , Rb , Rb , Gg , Rb , Gg , Rb , Gg , Rb , Rb , Gg , Rb , Gg , Rb , Gg , Gg , Gg , Gs , Gg , Gs , Gs , Gs , Gs , Gs , Gg , Gs , Re , Gs , Gg , Gg , Ww , Gg , Rb^Eff , Rb^Eff , Rb^Gvs
Gll , Gs^Fms , Gs , Gs , Gll^Fp , Gg , Gs^Fds , Gs^Fms , Gg , Gs , Gs^Fds , Gg , Gg , Gs^Fms , Gs^Fms , Gs^Fds , Gs^Fds , Gg , Gs^Fds , Gs^Fds , Wo , Gs^Fds , Gs^Fms , Gs^Fds , Gg , Gg , Gs^Fds , Rb , Gg , Rb , Gs , Rb , Gs , Gs , Gg , Gs , Gs , Gs , Gs , Gg , Gs , Gs^Vh , Re , Gs , Gg , Gg , Gs , Gg , Re , Re , Gs , Gs^Vc , Gg , Ww , Rb^Eff , Rb^Eff , Rb^Gvs , Rb^Gvs , Rb^Gvs
Gg , Gll , Gg , Gll^Fp , Gs^Fms , Gs^Fms , Gg , Gg , Gs^Fms , Gs^Fms , Gs^Fms , Gg , Gs^Fms , Gs^Fds , Gg , Gg , Gs^Fms , Gs^Fds , Gg , Gs^Fds , Wo , Ss , Gg , Gg , Gg , Gg , Gs^Fds , Gg , Gg , Gs , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Re , Re , Gs , Gg , Gg , Re , Gg , Gg , Gg , Rb^Eff , Rb^Eff , Rb^Gvs , Rb^Gvs , Rb^Gvs , Rb^Gvs , Rb^Gvs
Gg, Gg, Gll^Fp, Gll, Gll, Gg, Gs, Gs, Hh^Fp, Gg, Mm, Ms, Ms^Xm, Wo, Wo, Ms, Ms, Ms, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Hh, Hh, Hh, Hh, Gs, Gs, Gs, Gd, Gs, Gd, Hhd, Hhd, Hhd, Rd, Rd, Hhd, Hhd, Rd, Rd, Hd, Hhd, Rd, Dd, Hd, Dd, Dd, Hhd, Dd^Edp, Dd, Hd, Dd, Hd, Dd, Dd
Gg, Gll^Fp, Gs, Gll^Fp, Gs, Gs^Fms, Gll, Gg, Gll^Fp, Hh^Fp, Hh, Mm, Ms, Ha, Wo, Ms, Ha, Ms, Ms, Mm, Mm, Mm, Mm, Hh, Gg, Hh, Gs, Hh, Gs, Gs, Gs, Gs, Gs, Rd, Gd, Rd, Gd, Rd, Hhd, Hhd, Hhd, Hhd, Rd, Rd, Rd^Esd, Hhd, Dd^Edpp, Rd, Hd, Rd, Dd^Vdt, Rd^Dr, Dd, Dd, Hd, Hd, Dd, Hd, Hd
Gg, Gll, Gll^Fp, Gll, Gs^Fms, Gs, Gs, Gll, Gs, Gs, Gg, Mm, Mm, Ms, Ms, Ha, Ha, Ha, Ms, Mm, Mm, Mm, Mm, Gg, Mm, Gs, Hh, Hh, Hh, Gs^Es, Gs, Gs, Gs, Gd, Hhd, Hhd, Hhd^Vhhr, Gd, Gd, Rd, Gd, Hhd, Dd, Rd^Dr, Rd, Dd, Dd, Rd, Rd, Dd, Rd, Hd, Hd, Dd, Hd, Dd, Dd, Dd, Dd^Dc
Gg, Gll^Fp, Gll^Fp, Gll^Fp, Gs, Gll^Fp, Gs, Gs^Fms, Gs, Hh^Fp, Gg, Hh, Hh^Fp, Mm, Ha, Ms, Ms, Ms, Ms, Mm, Mm, Hh, Gg^Efm, Mm, Mm, Mm, Hh, Hh, Gg, Gg, Gs, Gs, Gd, Rd, Hhd, Hhd, Gd, Rd, Hhd, Rd, Rd, Rd, Rd, Dd, Hd, Hhd, Rd, Dd, Dd, Dd, Rd^Esd, Hd, Rd, Hd, Dd, Hd, Dd, Dd, Hd
Gg, Gll^Fp, Gll^Fp, Gs^Fms, Gll, Gs, Gll^Fp, Gg, Gs, Gs, Gg, Gll^Fp, Gs^Fms, Hh, Hh, Hh, Hh, Ms, Ms, Mm, Mm, Mm, Mm, Mm, Hh, Hh, Hh, Hh, Gs, Gs, Gs, Gs, Gs, Gd, Gd, Hhd, Hhd, Rd, Gd, Gd, Hhd, Hhd, Rd, Hhd, Hhd, Rd, Hd, Dd, Rd, Rd, Dd, Hd, Dd^Edpp, Dd, Rd, Dd, Rd, Dd^Edp, Hhd
Gs, Gs^Fms, Gs, Gg, Gg, Gs^Vl, Gll^Fp, Gs, Gs^Fms, Gg, Gg, Gll^Fp, Gg, Hh^Fp, Gg, Hh, Hh, Mm, Mm, Ms, Mm, Hh, Mm, Hh, Mm, Hh, Gg, Gg, Gg, Gs, Gg, Gs, Gs, Gd, Gs, Rd, Hhd, Gd, Hhd, Hhd, Gd, Gd, Hhd, Gd, Rd, Rd, Dd, Rd, Hhd, Hhd, Hd, Rd, Hhd, Rd, Hd, Hd, Dd, Hd, Hd
Gll^Fp, Gs, Gs, Gs^Fms, Gll^Fp, Gll, Gs^Fms, Gg, Gs, Gll^Fp, Gs^Fms, Gg, Hh^Fp, Gs, Gg, Hh^Fp, Gg^Efm, Hh^Fp, Hh, Mm, Mm, Mm, Mm, Mm, Mm, Gg, Hh, Hh, Hh, Gs, Gs, Gs, Gs, Gs, Gd, Gd, Hhd, Hhd, Hhd, Gd, Rd, Gd, Rd, Rd, Dd, Rd, Hhd, Rd, Rd, Rd^Esd, Dd, Hhd, Rd, Dd, Rd^Esd, Hd, Hhd, Hhd, Hhd
Gg, Gs, Gg, Gll^Fp, Gs, Gs, Gs, Gs, Gs, Gs^Fms, Gg, Gs, Gg, Gg, Gs^Fms, Gg, Gg, Hh^Fp, Hh^Fds, Hh, Hh, Mm, Mm, Mm, Hh, Hh, Gg, Hh, Hh, Gs, Gs, Gs, Gs, Gd, Gd, Gd, Gd, Gd, Rd, Rd, Rd, Rd, Hhd, Gd, Gd, Rd, Dd, Rd, Rd^Esd, Dd, Rd, Rd, Dd, Rd^Esd, Rd, Hhd, Dd, Rd, Hhd
Gg, Gs, Gs, Gs^Fms, Gll^Fp, Gg, Gs^Fms, Gs, Gs, Gs^Fds, Gs, Gs, Gs, Gg, Gs, Gg, Gs, Hh^Fp, Gg, Gg, Hh, Mm, Mm, Mm, Mm, Hh, Hh, Gg, Gs, Gg, Gs, Gs, Gg, Gs, Gd, Hhd, Hhd, Hhd, Hhd, Rd, Gd, Rd, Gd, Hhd, Gd, Rd, Rd, Hd, Rd, Rd, Dd, Rd, Hhd, Hhd, Hhd, Dd, Dd, Rd, Hhd
Gg, Gll^Fp, Gll, Gg, Gll^Fp, Gs, Gg, Gll^Fp, Gs^Fms, Gg, Gll^Fp, Gg, Gs^Fms, Gs^Fms, Gs, Gs, Gs^Fms, Gg, Gg, Gg, Hh^Fp, Hh, Hh^Vhh, Mm, Hh, Hh, Hh, Gs, Gg, Gg, Hh, Gg, Hh, Hh, Hh, Gd, Gd, Gd, Gd, Hhd, Hhd, Gd, Rd, Hhd, Rd, Rd, Dd, Rd, Rd, Hhd, Rd, Rd, Md, Md, Hhd, Hhd, Hhd, Hhd, Hh
Gs^Fms, Gll, Gs, Gs, Gll^Fp, Gll, Gs, Gs, Gs, Gll^Fp, Gg, Gs^Fms, Gg, Gs^Fms, Gg, Gs, Gs^Fms, Gg, Gg, Gll^Fp, Gg^Efm, Hh, Hh, Mm, Mm, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Gd, Hh, Gd, Gd, Hhd, Gd, Hhd, Gd, Gd, Rd, Rd, Rd, Rd^Dr, Gd, Hhd, Hhd, Md, Md, Hhd, Hh, Md, Md, Md
Gll^Fp, Gg, Gs^Fms, Gs, Gs, Gs^Fms, Gll^Fp, Gs^Fms, Gs^Fms, Gs, Gs, Gs^Fms, Gg, Gs^Fms, Gll^Fp, Gg, Gll^Fp, Gs^Fms, Gg, Gg, Gs, Hh^Fds, Gs, Hh, Mm, Mm, Mm, Hh, Mm, Mm, Mm, Mm, Mm, Hh, Hh, Gs, Gs, Hh, Hhd, Gd, Hhd, Gd, Gd, Rd, Hhd, Rd, Rd, Gd, Rd, Rd, Hhd, Md, Md, Md, Md, Md, Mm, Md, Mm
Gg, Gs^Fms, Gll^Fp, Gs, Gs, Gg, Gg, Gs^Fds, Gs, Gs, Gg, Gs, Gs, Gs^Fds, Gs, Gs, Gg, Gs^Fds, Gs^Fms, Gg, Gll^Fp, Gg, Hh, Hh, Hh, Mm, Mm, Mm, Mm, Mm, Hh, Mm, Hh, Mm, Gs, Gs, Gs, Hh, Hh, Hh, Hhd, Hhd, Hhd, Rd, Hhd, Gd, Gd, Hhd, Gd^Es, Gd, Gd, Hhd^Vhhr, Md, Md, Md, Mm, Mm, Mm, Hh
Gg, Gll, Gg, Gg, Gg, Gs, Gs, Gs^Fms, Gs^Fms, Gs^Fms, Gll^Fp, Gg, Gg, Gs, Gs^Fms, Gg, Gs, Gg, Gg, Gg, Gg, Gs^Fms, Gg, Gg, Hh, Hh^Fp, Hh, Mm, Hh, Gg, Mm, Hh, Hh, Hh, Gg, Hh, Gs, Hh, Gs, Gd, Hh, Hhd, Hhd, Gd, Gd, Rd, Gd, Hhd, Hh, Hhd, Hh, Hhd, Md, Md, Md, Mm, Hh, Hh, Gg
Gs^Fms, Gs^Fms, Gg, Gs^Fms, Gs^Fms, Gs^Fms, Gg, Gll^Fp, Gs^Fms, Gg^Efm, Gs^Fms, Gs^Fms, Gs^Fms, Gs, Gs, Gg, Gll^Fp, Gs, Gg, Gs^Fms, Gs^Fms, Gs^Fms, Gg, Gg, Gg, Gg, Gg, Hh, Gg, Hh, Gs, Gs, Gs, Gs, Gs, Hh, Hh, Hh, Gs, Hh, Gs, Gd, Hhd, Hhd, Hh, Gd, Hh, Hhd, Md, Md, Md, Md, Md, Md, Md, Mm, Hh, Hh, Gg
Gg, Gg, Gs, Gs^Fms, Gs, Gs, Gs, Gs, Gs^Fms, Gll^Fp, Gg, Gg, Gs, Gs, Gll^Fp, Gg, Gs^Fms, Gs^Fms, Gs^Fms, Gs, Gs, Gs^Fms, Gg, Gs^Fms, Gg, Gs^Fms, Gg, Gg, Gs, Gs, Gg, Hh, Md, Hh^Vhh, Mm, Mm, Mm, Hh, Hh, Hh, Md, Hh, Hh, Hhd, Hh, Md, Md, Md, Md, Md, Md, Md, Md, Md, Mm, Hh, Hh, Hh, Gg
Gll, Gs, Gs, Gg, Gs^Fms, Gs, Gs, Gs^Fms, Gg, Gs^Fms, Gs^Fms, Gs^Fms, Gs^Fms, Gs^Fms, Gg, Gs^Fms, Gg, Gll^Fp, Gs^Fms, Gg, Gg, Gs, Gs, Gg, Gs^Fms, Gs, Gs, Gs, Gg, Gg, Hh, Hh, Hh, Md, Md, Mm, Md, Hh, Hh, Gg, Md, Hh, Md, Hh, Md, Md, Ms, Md, Md, Md, Hh, Md, Hh, Mm, Hh, Mm, Hh, Hh, Gg
Gll^Fp, Gs, Gs, Gs, Gg, Gg, Gs, Gg, Gs^Fms, Gs, Gs, Gg, Gll^Fp, Gll, Gs, Gs^Fms, Gs^Fms, Gs^Fms, Gs^Fds, Gs^Fms, Gg, Gg, Gg, Gs^Fms, Gs^Fms, Gs^Fms, Gg, Gs, Gg, Gs^Fms, Gg, Hh, Hh, Hh, Hh, Md, Md, Hh, Md, Md, Md, Md, Md, Md, Md, Ms, Ha, Ms, Mm, Md, Hh, Mm, Hh, Mm, Mm, Mm, Mm, Gs, Gg
Gll, Gll, Gg, Gs, Gs^Fms, Gs^Fms, Gs^Fms, Gs, Gg, Gg, Gs^Fms, Gs, Gs, Gs, Gg, Gg, Gs, Gll^Fp, Gs^Fms, Gs^Fms, Gs^Fms, Gs, Gs, Gs^Fms, Gs, Gg, Gs^Fms, Gg, Gs^Fms, Gg, Gs^Fms, Gg, Gs, Gs, Gg, Hh, Hh, Md, Mm, Mm, Mm, Mm, Mm, Md, Mm, Mm, Wo, Ms, Mm, Mm, Hh^Vhh, Hh, Hh, Gg, Hh, Mm, Hh, Hh, Gs
Gll^Fp, Gs, Gs^Fms, Gs^Fms, Gs^Vh, Gs^Fms, Gg, Gs, Gll^Fp, Gs^Fds, Gs^Fds, Gg, Gs^Fms, Gs^Fms, Gg, Gs^Fms, Gll^Fp, Gs^Fms, Gs, Gs^Vc, Gs^Fms, Gg, Gs^Fds, Gg, Gg, Gg, Gg, Gs^Fms, Gs^Fms, Gs^Fms, Gg, Gg, Gs^Fds, Gll^Fp, Gg, Hh, Gg, Gg, Hh, Hh, Hh, Mm, Hh, Mm, Hh, Hh, Ww, Hh, Hh, Hh, Gg, Hh, Gs, Gg, Hh, Mm, Mm, Gs, Hh
Gll^Fp, Gg, Gs, Gs^Fms, Gs, Gs^Fms, Gs, Gs^Fms, Gg, Gg^Efm, Gg, Gg, Gs^Fms, Gg, Gg, Gll^Fp, Gs^Fms, Gg^Efm, Gll^Fp, Gs^Fds, Gs^Fms, Gs^Fms, Gg, Gs^Fms, Gs^Fds, Gg, Gs^Fds, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg^Efm, Hh, Hh, Hh, Hh, Wo, Ww, Gg^Efm, Hh, Gg, Gs, Gg, Hh, Hh, Gs, Gs, Hh, Hh, Chr, Rp
Gs^Fms, Gg, Gs, Gs, Gg, Gs, Gs, Gs^Fms, Gs^Fms, Gs^Fds, Gs, Gs, Gg, Gs^Fms, Gs^Fms, Gs^Fds, Gs^Fms, Gs^Fms, Gg, Gs, Gg, Gg, Gg, Gg, Gs^Fds, Gg, Gg, Gg, Gs^Fds, Gs^Fms, Gg, Gg, Gs^Fds, Gg, Gg, Gg, Ww, Gg, Wwf, Ww, Ww, Ww, Wo, Ww, Gg, Hh, Gg, Hh, Gg, Gs, Gg, Gg, Gs, Hh, Gs, Gs, Re, Rp, Chr
Gll^Fp, Gll, Gs, Gs^Fms, Gll^Fp, Gs, Gs, Gg, Gs, Gg, Gs, Gg, Gs^Fms, Gg, Gs^Fds, Gs, Gs, Gg, Gs^Fms, Gs^Fms, Gs^Fds, Gg, Gs^Fds, Gs^Fds, Gg, Gg, Gg, Gg, Gg, Gs^Fds, Gg, Gg, Ww, Gg, Ww, Ww, Gg, Ww, Gg, Gg, Gg, Hh, Hh, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gs, Gs, Gg, Gg, Rp, Rp, Hh, Hh, Hh
Gs^Fms, Gll^Fp, Gs^Fms, Gs^Fms, Gll, Gg, Gg, Gg, Gg, Gs^Fms, Gg, Gg, Gs^Fds, Gg, Gg, Gg, Gs^Fms, Gg, Gg, Gs^Fms, Gg, Gs^Fds, Wo, Wo, Ww, Gs^Fms, Ww, Ww, Ww, Gg, Ww, Ww, Gs^Fds, Ww, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gs, Gs, Gs, Gg, Rr, Gs, Hh, Hh, Hh, Hh
Gg, Gg, Gs, Gs, Gs^Fms, Gs^Fms, Gll^Fp, Gs^Fms, Gg, Gs^Fds, Gg, Gs^Fds, Gg, Gg, Gs^Fds, Gg, Gs^Fms, Gg, Gs^Fms, Gg, Wo, Wo, Gg, Gg, Gg, Ww, Gs^Fds, Gg, Gg, Ww, Gg, Gg, Rb, Gg, Rb, Gg, Gg, Gg, Gs, Gg, Gg, Gg, Gg, Gg, Gg, Gs, Gg, Gg, Gs, Gg, Gs, Gg, Re, Rp, Gg, Hh, Hh, Hh, Gg
Gg, Gs^Fds, Gll^Fp, Gs, Gs^Fms, Gg, Gs^Fms, Gll^Fp, Gs^Fms, Gs, Gs^Fms, Gs^Fms, Gg, Gs^Fms, Gs^Fms, Gs^Fds, Gg, Gs^Fms, Gs^Fms, Gg, Wo, Gg^Efm, Gg, Gs^Fms, Gg, Gg, Gg, Gg, Gg, Gg, Rb, Rb, Gg, Rb, Gg, Rb, Rb, Gg, Gg, Gg, Gg, Gs, Gg, Gg, Gg, Gs, Gs, Gs, Gg, Gg, Gg, Gg, Rp, Gs, Hh, Gg, Gg, Hh, Hh
Gg, Gs, Gs, Gg, Gg, Gs, Gs^Fms, Gll^Fp, Gg, Gs, Gs, Gs^Fms, Gs^Fds, Gs^Fms, Gs, Gg, Gg, Gs^Fms, Gg, Gg, Wo, Gs^Fms, Gg, Gg, Gg, Gs^Fds, Gs^Fds, Gg, Rb, Rb, Gs, Gg, Gg, Gg, Gg, Gg, Gg, Rb, Rb, Gs, Gg, Gg, Gs, Gg, Gg, Gs, Gs, Gs, Gs, Gs, Gs, Gg, Rp, Hh, Hh, Gs, Hh, Hh, Gg
Gs^Fms, Gs, Gs, Gs^Fms, Gs, Gs, Gs^Fms, Gs^Fms, Gg, Gs^Fms, Gg, Gs^Fms, Gs, Gs^Fms, Gs, Gg, Gs^Fms, Gs^Fms, Gg, Gs^Fds, Ss, Wo, Wo, Gg, Gg, Gg, Rb, Rb, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Rb, Gg, Gg, Gs, Gg, Gs, Gg, Gg, Gs, Gs, Gg, Gs, Gs, Rp, Gg, Gs, Hh, Gg, Gs, Gg
Gg, Gs, Gs^Fds, Gs^Fds, Gs, Gs^Fms, Gg, Gs, Gs^Fds, Gs^Fms, Gg, Gs^Fds, Gs^Fds, Gg, Gg, Gg, Gg, Gg, Gs^Fms, Gs^Fds, Gg, Gg, Gs^Fms, Ww, Gs^Fds, Rb, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gs, Gs, Gg, Rb, Gg, Gg, Gg, Gs, Gg, Gs, Gs, Gs, Gs, Gg, Gs, Rp, Gs, Gs, Gg, Gs, Gs, Hh, Gs
Gs, Gs^Fds, Gs^Fms, Gg, Gs, Gs, Gs^Fms, Gs, Gg, Gs, Gs, Gs^Fms, Gg, Gs^Fms, Gg, Gs^Fms, Gs, Gg, Gs^Fds, Gs^Fms, Gg, Gg, Gs^Fds, Wo, Gg, Rb, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gs, Gg, Rb, Gg, Gs, Gs, Gs, Gs, Gs, Gs, Gs, Gs, Gs, Gg, Rp, Gg, Gg, 1 Gs, Gs, Gg, Gg, Gg
Gs, Gs, Gs, Gg, Gs^Fms, Gg, Gs^Fms, Gll^Fp, Gs^Fms, Gs^Vl, Gs^Fms, Gs^Fms, Gs^Fms, Gg, Gg, Gs^Fms, Gs^Fds, Gg, Gg, Gg, Gg, Gg, Wo, Ww, Gg, Rb, Gg, Gg, Gg, Gg, Gs, Gg, Gs, Gg, Gg, Gs, Gg, Gs, Gg, Rb, Gg, Gg, Gs, Gs, Gg, Gs, Gg, Gs, Gs, Gg, Gg, Re, Gg, Gs, Gs, Gs, Gs, Gs, Gg
Gs, Gs^Fms, Gs^Fds, Gg, Gs, Gg, Gs^Fms, Gs^Fms, Gs, Gs^Fms, Gg, Gs, Gs, Gs, Gg, Gs^Fds, Gg, Gg, Gg, Gs^Fds, Gg, Gg, Wo, Gg, Gg, Rb, Gg, Gg, Gg, Gg, Gg, Gs, Gg, Gg, Rb, Gg, Rb, Gg, Rb, Rb, Gg, Gg, Gs, Gg, Gg, Gs, Gs, Gs, Gs, Gs, Rp, Rp, Gg, Gg, Gg, Gg, Gg, Gs, Rb^Eff
Gg, Gs^Fds, Gs^Fds, Gs, Gg, Gg, Gg, Gs, Gs, Gs^Fms, Gg, Gs^Fms, Gg, Gg, Gg, Gs^Fms, Gg, Gg, Gg, Gs^Fms, Wo, Wo, Gg^Efm, Gg, Gg, Rb, Rb, Gg, Rb, Gg, Rb, Gg, Rb, Rb, Gg, Rb, Gg, Rb, Gg, Gg, Gg, Gs, Gg, Gs, Gs, Gs, Gs, Gs, Gg, Gs, Re, Gs, Gg, Gg, Ww, Gg, Rb^Eff, Rb^Eff, Rb^Gvs
Gll, Gs^Fms, Gs, Gs, Gll^Fp, Gg, Gs^Fds, Gs^Fms, Gg, Gs, Gs^Fds, Gg, Gg, Gs^Fms, Gs^Fms, Gs^Fds, Gs^Fds, Gg, Gs^Fds, Gs^Fds, Wo, Gs^Fds, Gs^Fms, Gs^Fds, Gg, Gg, Gs^Fds, Rb, Gg, Rb, Gs, Rb, Gs, Gs, Gg, Gs, Gs, Gs, Gs, Gg, Gs, Gs^Vh, Re, Gs, Gg, Gg, Gs, Gg, Re, Re, Gs, Gs^Vc, Gg, Ww, Rb^Eff, Rb^Eff, Rb^Gvs, Rb^Gvs, Rb^Gvs
Gg, Gll, Gg, Gll^Fp, Gs^Fms, Gs^Fms, Gg, Gg, Gs^Fms, Gs^Fms, Gs^Fms, Gg, Gs^Fms, Gs^Fds, Gg, Gg, Gs^Fms, Gs^Fds, Gg, Gs^Fds, Wo, Ss, Gg, Gg, Gg, Gg, Gs^Fds, Gg, Gg, Gs, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Re, Re, Gs, Gg, Gg, Re, Gg, Gg, Gg, Rb^Eff, Rb^Eff, Rb^Gvs, Rb^Gvs, Rb^Gvs, Rb^Gvs, Rb^Gvs

View file

@ -1,14 +1,14 @@
Hhd , Gd , Hhd , Gd , Gd^Edp , Gg , Hhd , Gg , Gd , Gg , Gs , Hhd , Gs , Gs , Hhd , Hh , Mm^Xm , Mm^Xm , Hh , Gg , Gg^Eff , Gg^Eff , Rb^Gvs , Rb^Gvs , Rb^Gvs
Gd^Edpp , Hhd , Gs , Gd , Gd , Hhd , Gd , Gs , Hhd , Gd , Hhd , Gd , Hhd , Hhd , Hh , Hh , Mm^Xm , Hh , Gg , Gg^Eff , Gg^Eff , Re , Rb , Rb^Gvs , Rb
Hhd , Gd , Gs , Hhd , Gs , Gd^Es , Hhd , Gd , Hhd , Gd , Gd , Gs , Hh , Hhd , Mm^Xm , Mm^Xm , Hh , Hh , Gg , Gs , Hh , Gg^Eff , Gg^Eff , Rb^Gvs , Rb^Gvs
Gd^Es , Hhd , Gd , Gd , Gd , Hhd , Gd , Gs , Gd , Gd , Hhd , Gs , Hhd , Mm^Xm , Hh , Hh , Gs , Gg , Gs , Gs , Gg , Gg , Gs , Gg^Eff , Gg^Eff
Gd , Gd^Edpp , Gd , Hhd , Gd , Gs , Gs , Gd , Gd , Gs , Gs , Gs , Hh , Mm^Xm , Hh , Gg , Gg , Hh , Gs , Gg , Hh , Gg , Gg , Gg , Gg
Gd , Gd , Gd , Gd , Gd , Gd , Gd , Gs^Es , Gs , Gs , Hh , Gs , Hh , Mm^Xm , Hh , Gg , Gs , Gg , Gs , Gg , Gg , Gg , Gg , Gg , Rb
Gd , Gd , Ce , Gd , Rd , Gd , Rd , Gd , Re , Gd , Gs , Gs , Hhd , Mm^Xm , Hh , Gs , Gg , Gg , Gg , Gg , Gg , Gg , Ce , Rb , Gg
Rd , 2 Ke , Ce , Ce , Gd , Re , Gd , Re , Gs , Rd , Rb , Gs , Hh , Mm^Xm , Hh , Gg , Rb , Rb , Rb , Rb , Rb , Ce , Ce , 1 Ke , Ww
Gd , Gd , Gd , Gd , Gd , Gd , Gd , Gs , Gs , Gs , Gs , Re , Re , Hh , Rb , Rb , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Wo , Wo
Gd , Gs , Gd^Edpp , Gd , Gd , Hhd , Gd , Gd , Gs , Hhd , Hh , Gs , Hh , Rb , Hh , Gs , Gg , Gg , Gg , Gg , Gg , Gg , Ww , Ww , Wo
Gs , Gd , Gs , Gs , Hhd , Gs , Gd , Gs , Gs , Gs , Gs , Hh , Mm^Xm , Mm^Xm , Hh , Gg , Gg , Gs , Ww , Ww , Wo , Ww , Gg , Ww , Wo
Gd , Gs , Gd^Es , Gd , Gd , Gd , Gd , Gd , Gs , Gs , Hh , Hh , Mm^Xm , Hh , Gg , Gg , Gg , Ww , Gg , Gg , Gg , Sm , Ss , Ww , Ww
Gd^Edp , Gd , Gd , Gd , Gs , Gs , Hhd , Gs , Gs , Gs , Hh , Mm^Xm , Ms^Xm , Hh , Gg^Efm , Ss , Ww , Ww , Gg^Em , Ss , Ss , Gg , Ss , Gg , Ss
Gg , Gd , Gg , Gs , Gs , Gd , Gs , Gs , Gg , Gg , Hh , Mm^Xm , Ww , Hh , Wo , Wo , Gg , Ss , Gg , Ss , Gg^Efm , Gg , Gg , Gg , Gg
Hhd, Gd, Hhd, Gd, Gd^Edp, Gg, Hhd, Gg, Gd, Gg, Gs, Hhd, Gs, Gs, Hhd, Hh, Mm^Xm, Mm^Xm, Hh, Gg, Gg^Eff, Gg^Eff, Rb^Gvs, Rb^Gvs, Rb^Gvs
Gd^Edpp, Hhd, Gs, Gd, Gd, Hhd, Gd, Gs, Hhd, Gd, Hhd, Gd, Hhd, Hhd, Hh, Hh, Mm^Xm, Hh, Gg, Gg^Eff, Gg^Eff, Re, Rb, Rb^Gvs, Rb
Hhd, Gd, Gs, Hhd, Gs, Gd^Es, Hhd, Gd, Hhd, Gd, Gd, Gs, Hh, Hhd, Mm^Xm, Mm^Xm, Hh, Hh, Gg, Gs, Hh, Gg^Eff, Gg^Eff, Rb^Gvs, Rb^Gvs
Gd^Es, Hhd, Gd, Gd, Gd, Hhd, Gd, Gs, Gd, Gd, Hhd, Gs, Hhd, Mm^Xm, Hh, Hh, Gs, Gg, Gs, Gs, Gg, Gg, Gs, Gg^Eff, Gg^Eff
Gd, Gd^Edpp, Gd, Hhd, Gd, Gs, Gs, Gd, Gd, Gs, Gs, Gs, Hh, Mm^Xm, Hh, Gg, Gg, Hh, Gs, Gg, Hh, Gg, Gg, Gg, Gg
Gd, Gd, Gd, Gd, Gd, Gd, Gd, Gs^Es, Gs, Gs, Hh, Gs, Hh, Mm^Xm, Hh, Gg, Gs, Gg, Gs, Gg, Gg, Gg, Gg, Gg, Rb
Gd, Gd, Ce, Gd, Rd, Gd, Rd, Gd, Re, Gd, Gs, Gs, Hhd, Mm^Xm, Hh, Gs, Gg, Gg, Gg, Gg, Gg, Gg, Ce, Rb, Gg
Rd, 2 Ke, Ce, Ce, Gd, Re, Gd, Re, Gs, Rd, Rb, Gs, Hh, Mm^Xm, Hh, Gg, Rb, Rb, Rb, Rb, Rb, Ce, Ce, 1 Ke, Ww
Gd, Gd, Gd, Gd, Gd, Gd, Gd, Gs, Gs, Gs, Gs, Re, Re, Hh, Rb, Rb, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Wo, Wo
Gd, Gs, Gd^Edpp, Gd, Gd, Hhd, Gd, Gd, Gs, Hhd, Hh, Gs, Hh, Rb, Hh, Gs, Gg, Gg, Gg, Gg, Gg, Gg, Ww, Ww, Wo
Gs, Gd, Gs, Gs, Hhd, Gs, Gd, Gs, Gs, Gs, Gs, Hh, Mm^Xm, Mm^Xm, Hh, Gg, Gg, Gs, Ww, Ww, Wo, Ww, Gg, Ww, Wo
Gd, Gs, Gd^Es, Gd, Gd, Gd, Gd, Gd, Gs, Gs, Hh, Hh, Mm^Xm, Hh, Gg, Gg, Gg, Ww, Gg, Gg, Gg, Sm, Ss, Ww, Ww
Gd^Edp, Gd, Gd, Gd, Gs, Gs, Hhd, Gs, Gs, Gs, Hh, Mm^Xm, Ms^Xm, Hh, Gg^Efm, Ss, Ww, Ww, Gg^Em, Ss, Ss, Gg, Ss, Gg, Ss
Gg, Gd, Gg, Gs, Gs, Gd, Gs, Gs, Gg, Gg, Hh, Mm^Xm, Ww, Hh, Wo, Wo, Gg, Ss, Gg, Ss, Gg^Efm, Gg, Gg, Gg, Gg

View file

@ -1,20 +1,20 @@
Gs , Gg , Gg , Gg , Gs , Gs , Gs , Gs , Gg , Gg , Gg , Gg , Gg , Rb , Gg , Gg , Gs , Gs , Gg , Gg , Ss , Gg , Ss , Gg , Gg , Ss , Gg , Ss , Ww , Ds , Ww , Ww , Ds , Gg , Gg , Gg , Gg , Gg , Gg , Ss , Gg , Gg , Ss , Ss , Gg , Ss
Gs , Gs , Gs , Gs , Gg , Gg , Gs , Gs , Gg , Gg , Gg , Gg , Gg , Rb , Gg , Gg , Gg , Gg , Ss , Gg , Gg , Gg , Gg , Ss , Sm , Ss , Ww , Ww , Ss , Ww , Ww , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Ss , Ss , Gg , Ss , Ss , Gg , Ss , Gg
Gg , Gs , Gg , Gg , Ss , Gs , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Rb , Gg , Gg , Gg , Ss , Ww , Ww , Ww , Wo , Wo , Wo , Wo , Ww , Ss , Ss , Ss^Vm , Wwf , Ww , Gg , Ss , Ss , Ss , Ss , Gg , Ss , Gg , Gg , Ss , Gg^Efm , Gg , Ss , Ss , Gg
Ss , Gg , Gg , Gg , Gg , Ss , Ss , Gg , Ss , Ss , Gs , Gg , Ww , Rb , Ww , Ww , Wwf , Ww , Ss , Gg , Gg , Gg , Gg , Ss , Wo , Gg , Ss , Gg , Gg , Wo , Ss , Sm , Gg , Gg , Ss , Gg^Efm , Gg , Ss , Ss , Gg , Gg , Gg , Gg , Gg , Ss , Ss
Ss , Ss , Gg , Ss , Ss , Gg , Ss , Gg , Gg , Ss , Wwf , Ww , Ww , Wwf , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Ww , Wo , Gg , Ss , Gg , Gg , Ss , Ww , Ss , Ss , Ss , Ss , Gg , Ss , Gg , Gg , Gg , Ss , Ss , Ww , Gs^Vc , Ss , Gg , Ss
Gg , Ss , Gg , Gg , Ss , Ss , Gg , Gg , Ww , Wo , Gg , Gg , Gg , Rb , Gg , Ss , Gg , Ss , Ss , Ss , Gg , Ww , Ww , Gg , Ss , Gg , Ds , Gg , Ww , Ww , Gg , Gg , Ss , Gg , Gg , Gg , Ss , Gg , Gg , Ss , Gg , Gg , Wo , Ww , Ww , Ww
Gg , Gg , Ww , Ww , Ww , Wwg , Ww , Ww , Gg , Gg , Ss , Gg , Gg , Re , Gg , Ss , Ss , Gg , Gg , Ss , Gg , Ww , Gg , Gg , Chs , 1 Khs , Chs , Ss , Ww , Ss , Ss , Ss , Ss , Gg , Gg , Ss , Ss , Sm , Ss , Ss , Ww , Ww , Gg , Wo , Ss , Ss
Wwf , Ww , Ss , Ww , Gg^Efm , Sm , Ww , Ww , Gs , Ss , Gg , Ss , Ss , Rb , Gg , Ss , Gg , Ss , Ss , Ds , Ww , Wwf , Gg , Ss , Gg , Chs , Gg , Ww , Ww , Ww , Ww , Ss , Sm , Ss , Gg , Ss , Wo , Wo , Ww , Ww , Ss , Ss , Ss , Sm , Ss , Gg
Ds , Ss , Gg , Gg , Ss , Ss , Ww , Gg , Gg , Ss , Ss , Ss , Gg , Rb , Ss , Ss , Ss , Sm , Ss , Ss , Ww , Wo , Gg , Ss , Ss , Gg , Gg^Efm , Gg , Ww , Ww , Ww , Ss , Ss , Ss , Ww , Wo , Ss , Ss , Ss , Gg , Gg , Gg , Gg , Gg , Gg , Gg
Ww , Ds , Ss , Gg , Gg , Ss , Ww , Gg , Gg , Ss , Ss , Gg^Efm , Gg , Rb , Gg , Ss , Ss , Ss^Vm , Sm , Gg , Wo , Ww , Gg , Ss , Ss , Ss , Ss , Ss , Ww , Ww , Wo , Ww , Ww , Ww , Ss , Gg , Gg , Ss , Ss , Gg , Gg , Gg , Gs , Gs , Gg , Gg
Ww , Ww , 5 Khw , Ww , Ww , Ww , Gg , Gg , Ss , Ss , Ss^Vm , Ss , Ss , Rb , Gg , Gg , Ss , Ss , Ss , Wwf , Ww , Gg , Ss , Gg , Gg , Ss , Ss , Gg , Ss , Ww , Wo , Ww , Ww , Ss , Ss , Gg , Ss , Ss , Gg , Gg , Gs , Gs , Gg , Gg , Gg , Hh
Ww , Chw , Chw , Chw , Ww , Wwf , Gg , Ss , Ss , Ss , Ss , Ss , Gg , Rb , Rb , Ss , Ss , Gg , Gg , Gg , Ww , Ss , Ss , Ss , Ss , Ss , Ss , Wwf , Ss , Wo , Ww , Wo , Ww , Ww , Ww , Gg , Gg , Gg , Gg , Gg , Gs , Gg , Gs , Gg , Hh , Gs
Ww , Ww , Ww , Ww , Ww , Ds , Gg , Ss , Gg , Ss , Ss , Gg , Ss , Ss , Rb , Gg , Ss , Ss , Gg , Wo , Gg , Ss , Gg , Gg , Ss , Gg , Ss , Ss , Ss , Gg , Wo , Wo , Ww , Ww , Ww , Ww , Gg , Gg , Gs , Gg , Gg , Gs , Gs^Es , Gs , Hh , Hh
Wwr , Wwr , Wwr , Ww , Ww , Ds , Ds , Gg , Gg , Gg , Ss , Ss , Ss , Gg , Rb , Ss , Ss , Ss , Ds , Wo , Gg , Gg , Gg , Gg , Ds , Ss , Ss , Gg , Gg , Gg , Ww , Ww , Ww , Wo , Ww , Ww , Ds , Dd , Gg , Gs , Gg , Hh , Hh , Gs , Ds , Ds
Ww , Ww , Wwr , Ww , Ww , Ww , Ww , Ds , Ss , Ss , Gg , Ss , Ss , Gg , Rb , Gg , Gg , Ww , Ww , Wo , Gg , Gg , Ww , Ds , Ww^Vm , Ww , Ds , Ss , Gg , Ss , Wwf , Ww , Ww , Wo , Ww , Ww , Ww , Dd , Gs , Gs , Gs , Hh , Ds , Ds , Ww , Ww
Ww , Ww , Ww , Wwr , Ww , Ww , Ww , Ww , Ww , Ss , Ss , Gg , Ss , Ss , Rb , Gg , Ds , Ss , Ww , Wwf , Wo , Ww , Gg , Ww , Ww , Ww , Ww , Ww , Ds , Ww , Wo , Ww , Ww , Wo , Ww , Ww , Ww , Gg , Gs , Dd , Ds , Ds , Ww , Ww , Ww , Ww
Wwr , Wwr , Ww , Ww , Wwr , Ww , Wwf , Ww , Ds , Gg , Gg , Gg , Gg , Gg , Rb , Ds , Ww , Ww , Gg , Ss , Wo , Ww , Ww , Ww , Ww , Ww , Wwr , Ww , Ww , Wwf , Wo , Ww , Wo , Wo , Wo , Ww , Gs , Gs , Gs , Dd , Ds , Ww , Ww , Ww , Ww , Ww
Wo , Wo , Wo , Ww , Wwr , Ww , Ww , Wwf , Ds , Gg , Gg , Gs , Gs , Re , Gg , Gg , Ww , Ww , Ww , Ww , Ww , Wwf , Ww , Ww , Wwr , Ww , Ww , Wwr , Ww , Wwf , Wo , Ww , Wo , Wo , Ww , Ww , Ds , Gg , Gg , Ds , Ww , Ww , Ww , Ww , Ww , Ww
Wo , Wo , Ww , Wo , Ww^Vm , Ww , Ww , Ww , Ww , Gg , Gg , Gs , Gg , Rb , Gg , Wwf , Wwf , Ww , Gg , Ww , Ww , Ww , Ww , Ww , Ww , Wwr , Ww , Ww , Ww , Ww , Wo , Ww , Ww , Wo , Wo , Ww , Ww , Gs^Vc , Hh , Ww , Ww , Ww , Ww , Ww , Hh , Hh
Wo , Wo , Wo , Wwr , Wo , Ww , Wo , Ww , Wwf , Ds , Ww , Wwf , Rb , Re , Gg , Wwf , Gs^Vc , Ww , Gg , Gs , Ww , Gg , Ww , Ww , Ww , Ww , Ww , Wwr , Ww , Ww , Ww , Ww , Ww , Ww , Ww , Ww , Ww , Ww , Ww , Ww , Ww , Ww , Ww , Ww , Hh , Ww
Gs, Gg, Gg, Gg, Gs, Gs, Gs, Gs, Gg, Gg, Gg, Gg, Gg, Rb, Gg, Gg, Gs, Gs, Gg, Gg, Ss, Gg, Ss, Gg, Gg, Ss, Gg, Ss, Ww, Ds, Ww, Ww, Ds, Gg, Gg, Gg, Gg, Gg, Gg, Ss, Gg, Gg, Ss, Ss, Gg, Ss
Gs, Gs, Gs, Gs, Gg, Gg, Gs, Gs, Gg, Gg, Gg, Gg, Gg, Rb, Gg, Gg, Gg, Gg, Ss, Gg, Gg, Gg, Gg, Ss, Sm, Ss, Ww, Ww, Ss, Ww, Ww, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Ss, Ss, Gg, Ss, Ss, Gg, Ss, Gg
Gg, Gs, Gg, Gg, Ss, Gs, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Rb, Gg, Gg, Gg, Ss, Ww, Ww, Ww, Wo, Wo, Wo, Wo, Ww, Ss, Ss, Ss^Vm, Wwf, Ww, Gg, Ss, Ss, Ss, Ss, Gg, Ss, Gg, Gg, Ss, Gg^Efm, Gg, Ss, Ss, Gg
Ss, Gg, Gg, Gg, Gg, Ss, Ss, Gg, Ss, Ss, Gs, Gg, Ww, Rb, Ww, Ww, Wwf, Ww, Ss, Gg, Gg, Gg, Gg, Ss, Wo, Gg, Ss, Gg, Gg, Wo, Ss, Sm, Gg, Gg, Ss, Gg^Efm, Gg, Ss, Ss, Gg, Gg, Gg, Gg, Gg, Ss, Ss
Ss, Ss, Gg, Ss, Ss, Gg, Ss, Gg, Gg, Ss, Wwf, Ww, Ww, Wwf, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Ww, Wo, Gg, Ss, Gg, Gg, Ss, Ww, Ss, Ss, Ss, Ss, Gg, Ss, Gg, Gg, Gg, Ss, Ss, Ww, Gs^Vc, Ss, Gg, Ss
Gg, Ss, Gg, Gg, Ss, Ss, Gg, Gg, Ww, Wo, Gg, Gg, Gg, Rb, Gg, Ss, Gg, Ss, Ss, Ss, Gg, Ww, Ww, Gg, Ss, Gg, Ds, Gg, Ww, Ww, Gg, Gg, Ss, Gg, Gg, Gg, Ss, Gg, Gg, Ss, Gg, Gg, Wo, Ww, Ww, Ww
Gg, Gg, Ww, Ww, Ww, Wwg, Ww, Ww, Gg, Gg, Ss, Gg, Gg, Re, Gg, Ss, Ss, Gg, Gg, Ss, Gg, Ww, Gg, Gg, Chs, 1 Khs, Chs, Ss, Ww, Ss, Ss, Ss, Ss, Gg, Gg, Ss, Ss, Sm, Ss, Ss, Ww, Ww, Gg, Wo, Ss, Ss
Wwf, Ww, Ss, Ww, Gg^Efm, Sm, Ww, Ww, Gs, Ss, Gg, Ss, Ss, Rb, Gg, Ss, Gg, Ss, Ss, Ds, Ww, Wwf, Gg, Ss, Gg, Chs, Gg, Ww, Ww, Ww, Ww, Ss, Sm, Ss, Gg, Ss, Wo, Wo, Ww, Ww, Ss, Ss, Ss, Sm, Ss, Gg
Ds, Ss, Gg, Gg, Ss, Ss, Ww, Gg, Gg, Ss, Ss, Ss, Gg, Rb, Ss, Ss, Ss, Sm, Ss, Ss, Ww, Wo, Gg, Ss, Ss, Gg, Gg^Efm, Gg, Ww, Ww, Ww, Ss, Ss, Ss, Ww, Wo, Ss, Ss, Ss, Gg, Gg, Gg, Gg, Gg, Gg, Gg
Ww, Ds, Ss, Gg, Gg, Ss, Ww, Gg, Gg, Ss, Ss, Gg^Efm, Gg, Rb, Gg, Ss, Ss, Ss^Vm, Sm, Gg, Wo, Ww, Gg, Ss, Ss, Ss, Ss, Ss, Ww, Ww, Wo, Ww, Ww, Ww, Ss, Gg, Gg, Ss, Ss, Gg, Gg, Gg, Gs, Gs, Gg, Gg
Ww, Ww, 5 Kme, Ww, Ww, Ww, Gg, Gg, Ss, Ss, Ss^Vm, Ss, Ss, Rb, Gg, Gg, Ss, Ss, Ss, Wwf, Ww, Gg, Ss, Gg, Gg, Ss, Ss, Gg, Ss, Ww, Wo, Ww, Ww, Ss, Ss, Gg, Ss, Ss, Gg, Gg, Gs, Gs, Gg, Gg, Gg, Hh
Ww, Cme, Cme, Cme, Ww, Wwf, Gg, Ss, Ss, Ss, Ss, Ss, Gg, Rb, Rb, Ss, Ss, Gg, Gg, Gg, Ww, Ss, Ss, Ss, Ss, Ss, Ss, Wwf, Ss, Wo, Ww, Wo, Ww, Ww, Ww, Gg, Gg, Gg, Gg, Gg, Gs, Gg, Gs, Gg, Hh, Gs
Ww, Ww, Ww, Ww, Ww, Ds, Gg, Ss, Gg, Ss, Ss, Gg, Ss, Ss, Rb, Gg, Ss, Ss, Gg, Wo, Gg, Ss, Gg, Gg, Ss, Gg, Ss, Ss, Ss, Gg, Wo, Wo, Ww, Ww, Ww, Ww, Gg, Gg, Gs, Gg, Gg, Gs, Gs^Es, Gs, Hh, Hh
Wwr, Wwr, Wwr, Ww, Ww, Ds, Ds, Gg, Gg, Gg, Ss, Ss, Ss, Gg, Rb, Ss, Ss, Ss, Ds, Wo, Gg, Gg, Gg, Gg, Ds, Ss, Ss, Gg, Gg, Gg, Ww, Ww, Ww, Wo, Ww, Ww, Ds, Dd, Gg, Gs, Gg, Hh, Hh, Gs, Ds, Ds
Ww, Ww, Wwr, Ww, Ww, Ww, Ww, Ds, Ss, Ss, Gg, Ss, Ss, Gg, Rb, Gg, Gg, Ww, Ww, Wo, Gg, Gg, Ww, Ds, Ww^Vm, Ww, Ds, Ss, Gg, Ss, Wwf, Ww, Ww, Wo, Ww, Ww, Ww, Dd, Gs, Gs, Gs, Hh, Ds, Ds, Ww, Ww
Ww, Ww, Ww, Wwr, Ww, Ww, Ww, Ww, Ww, Ss, Ss, Gg, Ss, Ss, Rb, Gg, Ds, Ss, Ww, Wwf, Wo, Ww, Gg, Ww, Ww, Ww, Ww, Ww, Ds, Ww, Wo, Ww, Ww, Wo, Ww, Ww, Ww, Gg, Gs, Dd, Ds, Ds, Ww, Ww, Ww, Ww
Wwr, Wwr, Ww, Ww, Wwr, Ww, Wwf, Ww, Ds, Gg, Gg, Gg, Gg, Gg, Rb, Ds, Ww, Ww, Gg, Ss, Wo, Ww, Ww, Ww, Ww, Ww, Wwr, Ww, Ww, Wwf, Wo, Ww, Wo, Wo, Wo, Ww, Gs, Gs, Gs, Dd, Ds, Ww, Ww, Ww, Ww, Ww
Wo, Wo, Wo, Ww, Wwr, Ww, Ww, Wwf, Ds, Gg, Gg, Gs, Gs, Re, Gg, Gg, Ww, Ww, Ww, Ww, Ww, Wwf, Ww, Ww, Wwr, Ww, Ww, Wwr, Ww, Wwf, Wo, Ww, Wo, Wo, Ww, Ww, Ds, Gg, Gg, Ds, Ww, Ww, Ww, Ww, Ww, Ww
Wo, Wo, Ww, Wo, Ww^Vm, Ww, Ww, Ww, Ww, Gg, Gg, Gs, Gg, Rb, Gg, Wwf, Wwf, Ww, Gg, Ww, Ww, Ww, Ww, Ww, Ww, Wwr, Ww, Ww, Ww, Ww, Wo, Ww, Ww, Wo, Wo, Ww, Ww, Gs^Vc, Hh, Ww, Ww, Ww, Ww, Ww, Hh, Hh
Wo, Wo, Wo, Wwr, Wo, Ww, Wo, Ww, Wwf, Ds, Ww, Wwf, Rb, Re, Gg, Wwf, Gs^Vc, Ww, Gg, Gs, Ww, Gg, Ww, Ww, Ww, Ww, Ww, Wwr, Ww, Ww, Ww, Ww, Ww, Ww, Ww, Ww, Ww, Ww, Ww, Ww, Ww, Ww, Ww, Ww, Hh, Ww

View file

@ -1,32 +1,32 @@
Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Rb , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh
Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Rb , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh
Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh^Fp , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Hh , Hh , Hh , Hh , Rb , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh^Fp , Hh^Fp , Hh^Fp
Mm , Hh^Fp , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Hh , Hh , Hh , Rb , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh^Fp , Mm , Mm , Mm
Mm , Mm , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Hh , Hh , Rb , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Hh^Fp , Hh^Fp , Mm , Mm , Mm
Xu , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Hh^Fp , Hh^Fp , Rb , Hh , Hh , Hh , Hh , Hh^Fp , Hh , Hh^Fp , Hh^Fp , Mm , Mm , Mm^Xm , Mm , Mm
Xu , Xu , Xu , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Hh , Hh^Fp , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm^Xm , Mm^Xm , Mm
Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Rb , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm
Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Rb , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm
Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Hh^Fp , Hh , Hh , Hh , Hh^Fp , Hh , Hh , Rb , Rb , Hh , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm
Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Mm , Mm , Hh^Fp , Hh^Fp , Hh , Hh , Hh , Hh , Hh^Fp , Hh , Rb , Hh , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm
Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Hh , Hh^Fp , Hh , Rb , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm
Mm^Xm , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Rb , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm
Mm^Xm , Xu , Xu , Xu , Xu , Xu , Uu , Xu , Uu , Xu , Xu , Xu , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Hh , Hh^Fp , Hh^Fp , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm
Xu , Mm^Xm , Mm^Xm , Uu , Uu , Uu , Xu , Uu , Xu , Uu , Xu , Xu , Xu , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Rb , Hh , Hh , Hh , Hh , Hh , Hh^Fp , Mm , Mm , Mm , Mm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm
Uu , Uu , Mm^Xm , Xu , Xu , Xu , Xu , Xu , Xu , Uu , Uu , Xu , Xu , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Hh , Hh^Fp , Hh , Rb , Hh , Hh^Fp , Hh , Hh , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm
Xu , Xu , Xu , Xu , Uu^Vud , Xu , Uu , Xu , Xu , Xu , Xu , Uu , Xu , Xu , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Hh^Fp , Hh^Fp , Hh , Rb , Rb , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm , Mm^Xm
Uu , Uu , Uu , Uu , Uu , Uu , Re , Xu , Xu , Xu , Xu , Uu , Uu , Xu , Mm , Mm , Hh , Hh^Fp , Hh , Hh , Hh , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Rb , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm^Xm , Mm , Mm , Mm
Xu , Re , Re , Uu , Ch , Uu , Uu , Re , Re , Xu , Xu , Xu , Xu , Mm , Mm , Hh , Mm , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Rb , Rb , Hh , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm , Mm , Mm , Mm
Xu , Xu , Xu , Xu , 1 Kh , Ch , Uu , Uu , Uu , Uu^Vud , Xu , Xu , Mm , Mm , Hh , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Vhh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Rb , Rb , Gs^Vh , Rb , Rb , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm
Xu , Xu , Xu , Xu , Xu , Ch , Re , Uu , Uu , Uu , Re , Xu , Mm , Mm , Mm , Hh , Hh , Hh , Hh , Hh^Fp , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh , Rb , Gs , Ww , Gs , Gs , Rb , Rb , Gs^Vh , Rb , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm
Xu , Xu , Xu , Uu , Uu , Uu , Uu^Vud , Re , Uu , Uu , Mm , Mm , Mm , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh , Hh , Hh , Hh , Hh , Hh , Hh , Rb , Gs , Gs , Ww , Ww , Gs , Rb , Hh^Fp , Rb , Hh^Fp , Rb , Rb , Hh^Fp , Hh^Fp , Mm , Mm
Xu , Xu , Xu , Xu , Xu , Xu , Uu , Re , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Gs^Vh , Hh^Fp , Hh^Fp , Hh^Fp , Hh , Hh^Fp , Hh , Hh , Hh , Hh , Hh , Rb , Rb , Gs^Vh , Gs , Ww , Gs , Rb , Hh^Fp , Hh^Fp , Hh^Fp , Gs^Vh , Rb , Hh^Fp , Hh^Fp , Mm , Mm
Xu , Xu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Rb , Rb , Rb , Rb , Hh , Rb , Rb , Rb , Hh , Hh , Hh , Hh , Rb , Rb , Gs^Vh , Rb , Rb , Hh^Fp , Hh^Fp , Rb , Rb , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm
Xu , Xu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Gs^Vh , Hh^Fp , Hh^Fp , Rb , Gs , Gs , Gs , Rb , Rb , Hh , Rb , Rb , Hh , Rb , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Rb , Gs^Vh , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm
Xu , Xu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Dd^Vdt , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Rb , Gs^Vh , Ww , Ww , Gs^Vh , Rb , Rb , Rb , Rb , Hh , Hh , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Rb , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm
Xu , Xu , Xu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Mm , Hh^Fp , Mm , Hh^Fp , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Ww , Gs^Vh , Gs , Rb , Hh , Hh , Rb , Rb , Hh^Fp , Ch , Hh^Fp , Rb , Rb , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm , Xu
Xu , Xu , Xu , Xu , Uu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Rb , Hh^Fp , Hh , Hh , Hh , Hh^Fp , Ch , 2 Kh , Ch , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm , Mm , Xu
Xu , Xu , Uu , Uu , Uu , Uu , Uu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Mm , Mm , Mm , Hh^Fp , Mm , Hh^Fp , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Ch , Ch , Ch , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm , Xu , Xu , Xu
Xu , Xu , Uu , Uu , Uu , Uu , Uu , Xu , Xu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm , Mm , Xu , Xu , Xu , Xu
Xu , Xu , Uu , Uu , Uu , Uu , Uu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Hh^Fp , Hh^Fp , Hh^Fp , Mm , Mm , Mm , Mm , Mm , Mm , Xu , Xu , Xu , Xu , Xu
Xu , Xu , Xu , Uu , Uu , Uu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Xu , Mm , Mm , Mm , Xu , Xu , Xu , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Mm , Xu , Xu , Xu , Xu , Xu , Xu , Xu
Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Rb, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh
Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Rb, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh
Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh^Fp, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Hh, Hh, Hh, Hh, Rb, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh^Fp, Hh^Fp, Hh^Fp
Mm, Hh^Fp, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Hh, Hh, Hh, Rb, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh^Fp, Mm, Mm, Mm
Mm, Mm, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Hh, Hh, Rb, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Hh^Fp, Hh^Fp, Mm, Mm, Mm
Xu, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Hh^Fp, Hh^Fp, Rb, Hh, Hh, Hh, Hh, Hh^Fp, Hh, Hh^Fp, Hh^Fp, Mm, Mm, Mm^Xm, Mm, Mm
Xu, Xu, Xu, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Hh, Hh^Fp, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm^Xm, Mm^Xm, Mm
Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Rb, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm
Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Rb, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm
Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Hh^Fp, Hh, Hh, Hh, Hh^Fp, Hh, Hh, Rb, Rb, Hh, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm
Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Mm, Mm, Hh^Fp, Hh^Fp, Hh, Hh, Hh, Hh, Hh^Fp, Hh, Rb, Hh, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm
Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Hh, Hh^Fp, Hh, Rb, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm
Mm^Xm, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Rb, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm
Mm^Xm, Xu, Xu, Xu, Xu, Xu, Uu, Xu, Uu, Xu, Xu, Xu, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Hh, Hh^Fp, Hh^Fp, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm
Xu, Mm^Xm, Mm^Xm, Uu, Uu, Uu, Xu, Uu, Xu, Uu, Xu, Xu, Xu, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Rb, Hh, Hh, Hh, Hh, Hh, Hh^Fp, Mm, Mm, Mm, Mm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm
Uu, Uu, Mm^Xm, Xu, Xu, Xu, Xu, Xu, Xu, Uu, Uu, Xu, Xu, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Hh, Hh^Fp, Hh, Rb, Hh, Hh^Fp, Hh, Hh, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm
Xu, Xu, Xu, Xu, Uu^Vud, Xu, Uu, Xu, Xu, Xu, Xu, Uu, Xu, Xu, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Hh^Fp, Hh^Fp, Hh, Rb, Rb, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm, Mm^Xm
Uu, Uu, Uu, Uu, Uu, Uu, Re, Xu, Xu, Xu, Xu, Uu, Uu, Xu, Mm, Mm, Hh, Hh^Fp, Hh, Hh, Hh, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Rb, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm^Xm, Mm, Mm, Mm
Xu, Re, Re, Uu, Ch, Uu, Uu, Re, Re, Xu, Xu, Xu, Xu, Mm, Mm, Hh, Mm, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Rb, Rb, Hh, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm, Mm, Mm, Mm
Xu, Xu, Xu, Xu, 1 Kh, Ch, Uu, Uu, Uu, Uu^Vud, Xu, Xu, Mm, Mm, Hh, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Vhh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Rb, Rb, Gs^Vh, Rb, Rb, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm
Xu, Xu, Xu, Xu, Xu, Ch, Re, Uu, Uu, Uu, Re, Xu, Mm, Mm, Mm, Hh, Hh, Hh, Hh, Hh^Fp, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh, Rb, Gs, Ww, Gs, Gs, Rb, Rb, Gs^Vh, Rb, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm
Xu, Xu, Xu, Uu, Uu, Uu, Uu^Vud, Re, Uu, Uu, Mm, Mm, Mm, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh, Hh, Hh, Hh, Hh, Hh, Hh, Rb, Gs, Gs, Ww, Ww, Gs, Rb, Hh^Fp, Rb, Hh^Fp, Rb, Rb, Hh^Fp, Hh^Fp, Mm, Mm
Xu, Xu, Xu, Xu, Xu, Xu, Uu, Re, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Gs^Vh, Hh^Fp, Hh^Fp, Hh^Fp, Hh, Hh^Fp, Hh, Hh, Hh, Hh, Hh, Rb, Rb, Gs^Vh, Gs, Ww, Gs, Rb, Hh^Fp, Hh^Fp, Hh^Fp, Gs^Vh, Rb, Hh^Fp, Hh^Fp, Mm, Mm
Xu, Xu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Rb, Rb, Rb, Rb, Hh, Rb, Rb, Rb, Hh, Hh, Hh, Hh, Rb, Rb, Gs^Vh, Rb, Rb, Hh^Fp, Hh^Fp, Rb, Rb, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm
Xu, Xu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Gs^Vh, Hh^Fp, Hh^Fp, Rb, Gs, Gs, Gs, Rb, Rb, Hh, Rb, Rb, Hh, Rb, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Rb, Gs^Vh, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm
Xu, Xu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Dd^Vdt, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Rb, Gs^Vh, Ww, Ww, Gs^Vh, Rb, Rb, Rb, Rb, Hh, Hh, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Rb, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm
Xu, Xu, Xu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Mm, Hh^Fp, Mm, Hh^Fp, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Ww, Gs^Vh, Gs, Rb, Hh, Hh, Rb, Rb, Hh^Fp, Ch, Hh^Fp, Rb, Rb, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm, Xu
Xu, Xu, Xu, Xu, Uu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Rb, Hh^Fp, Hh, Hh, Hh, Hh^Fp, Ch, 2 Kh, Ch, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm, Mm, Xu
Xu, Xu, Uu, Uu, Uu, Uu, Uu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Mm, Mm, Mm, Hh^Fp, Mm, Hh^Fp, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Ch, Ch, Ch, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm, Xu, Xu, Xu
Xu, Xu, Uu, Uu, Uu, Uu, Uu, Xu, Xu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm, Mm, Xu, Xu, Xu, Xu
Xu, Xu, Uu, Uu, Uu, Uu, Uu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Hh^Fp, Hh^Fp, Hh^Fp, Mm, Mm, Mm, Mm, Mm, Mm, Xu, Xu, Xu, Xu, Xu
Xu, Xu, Xu, Uu, Uu, Uu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Xu, Mm, Mm, Mm, Xu, Xu, Xu, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Mm, Xu, Xu, Xu, Xu, Xu, Xu, Xu

Some files were not shown because too many files have changed in this diff Show more