Commit graph

29603 commits

Author SHA1 Message Date
pentarctagon
f1e54eec76 add preference to not get addon icons 2024-12-19 22:36:11 -06:00
gfgtdf
78c2f2e954 DM: S20: Fix waittime at scenario start
Don't animate unit advancements during a prestart event.

It woudl be better it u:advance() would automaticialyl not waste time animating advancements that can't be seen (during prestart events) but for this scenario this is already an improvement

(cherry picked from commit e549b03412)
2024-12-12 10:53:22 +11:00
Thewodoros
9f1bea517c Fix the attack_end event in Liberty S5
The event has to use side 3 because side 2 is idle. Also remove the dollar sign because IF_VAR doesn't work with it.

(cherry picked from commit ae5b2f0da6)
2024-10-31 10:27:22 +11:00
pentarctagon
f320b7be11 1.18.3+dev 2024-10-28 12:48:04 -05:00
pentarctagon
c7ea504892 1.18.3 2024-10-28 12:46:29 -05:00
pentarctagon
5cd8b3b6c9 pot-update and regenerate doc files 2024-10-28 12:40:25 -05:00
Subhraman Sarkar
ff81419ccf Update the help page entry for the Item tool
reflects the change that it is now possible to remove items.

(cherry-picked from commit 47642719bf)
2024-09-13 07:01:20 +05:30
Steve Cotton
a42030eae2 Test calculations of abilities with add and sub
Fix a typo in the add_sub_separated test, because it was testing
exactly the same code as add_sub_cumulative.

Add two new tests and clarify documentation, because in these tests
the order of the abilities determines whether the add or sub value is
used, it isn't that sub always overrides add.

(cherry picked from commit 547de5fd93)
2024-09-08 16:28:39 +02:00
newfrenchy83
617bd92c31
Fix recursion in abilities (counting version)
I use the same method what in master for weapon special recursion.

(cherry picked from commit c5351fb998)
2024-09-08 13:13:31 +02:00
newfrenchy83
1977fef81b fix tag_name check deficiencies(1.18 backport)
The tag_name check is deficient for two reasons:
1.when apply_to=both is used, in the case of [damage_type] [filter_opponent][filter_weapon]type= will check the modified type for application to the owner and the original type for application to the opponent, hence a risk of infinite recursion, especially if [filter_self][filter_weapon]type= is used in the same weapon.

2. in the case of apply_to=attacker/defender, the check for [filter_attacker/defender] must take into account both the value of the variable is_attacker but also the application AFFECT_SELF/OTHER, otherwise in the case apply_to=defender with [filter_defender][filter_weapon]type=, and[filter_attacker][filter_weapon]type= otherwise we end up in the same configuration as for apply_to=both

Finally tag_name is renamed check_if_recursion to mean that this variable is used to ensure that a recursion cannot be set up even if 743b146efc prevents it from causing a crash but with an error log
2024-09-07 10:23:28 +02:00
Steve Cotton
10976c3f45 Fix weapon special filters can lead to infinite recursion(1.18 backport)
this is a bachport of https://github.com/wesnoth/wesnoth/commits?author=stevecotton 4afdc92f13 comit because one change of behavior is to prevent crashes of game

This adds a recursion counter which runs on a per-weapon basis; if the
recursion limit is reached then the last level of recursion is assumed
to have returned false. A warning is printed (with error severity).

At the user-visible layer, that gives the following logic:

* Abilities that depend on another ability being active will be
  inactive.
* Pairs of abilities, where X depends on Y being inactive and Y
  depends on X being inactive, will end up with them both inactive.

The limit is defined by ATTACK_RECURSION_LIMIT in attack_type.cpp.
The minimum for passing all the unit tests is 2, but I've left some
headroom by setting it to 4.

With the recursion limit set to 1, the following tests fail, which
seems reasonable because they're checking that the special is on
a particular type of weapon.
* event_test_filter_attack_specials
* event_test_filter_attack_opponent_weapon_condition
* event_test_filter_attack_student_weapon_condition

Output from the four_cycle_recursion_branching test:
```
error unit: Recursion limit reached for weapon 'melee_attack' while checking filter 'special_type_active = parry'
error unit: Recursion limit reached for weapon 'melee_attack' while checking filter 'special_type_active = poison'
error unit: Recursion limit reached for weapon 'melee_attack' while checking filter 'special_type_active = damage'
```

There's deduplication to prevent the logfiles getting spammed during
AI turns. As implemented, the two tests mentioned below print 3
messages each; these tests are added in separate commits because the
tests are shared between PRs while we discuss the right mechanism for
guarding against recursion.

With no rate limit:
* four_cycle_recursion_branching prints 1280 logs
* event_test_filter_attack_student_weapon_condition prints 320

With a rate limit via a flag that's reset in recursion_guard's destructor:
* four_cycle_recursion_branching prints 80 logs
* event_test_filter_attack_student_weapon_condition prints 160

Resetting the flag in specials_context_t's destructor gets better numbers,
but splits the logic across .cpp files. I think the trade-off isn't worth it:
* four_cycle_recursion_branching prints 40 logs
* event_test_filter_attack_student_weapon_condition prints 132

Co-authored-by: newfrenchy83
2024-09-04 08:11:37 +10:00
Tahsin Jahin Khalid
f8034fc4fe names: remove inappropriate saurian name 2024-09-03 20:04:32 +05:30
Subhraman Sarkar
f00dbb066b remove inproper and inconsistent names
1. remove obviously English and English sounding female names from Dunefolk female names list
2. remove 'bakri' from male name list (means 'goat', could be offensive)
3. remove one potentially offensive name from saurian name list
4. remove 'Dalal' from dunefolk female names (can be used as slang)
2024-09-03 20:04:32 +05:30
Elvish_Hunter
abaaefc6bd Fix wmlindent warnings 2024-09-01 01:10:18 +02:00
Elvish_Hunter
98d0af2ca2 Silence several wmllint warnings 2024-08-31 23:11:47 +02:00
Gunter Labes
f524731153 Update generator calls since the method was removed in 2413e2f
(cherry picked from commit 6d6bb8dc0c)
2024-08-28 15:25:55 +10:00
Nils Kneuper
4285a9ca09 updated Turkish translation 2024-08-23 14:48:21 +02:00
Toom
ad8fd351c1 add tooltip to [unit_vision] 2024-08-19 15:57:32 -04:00
Eric Gallager
7837deeec5 wmlscope: fix format of magic comment in documentation
It's not just `prune`, but rather `wmlscope: prune`
2024-08-18 11:42:46 +02:00
Iris Morelle
0c3b1d31b1
Merge pull request #9180 2024-08-17 12:48:09 -04:00
Elvish_Hunter
0e693b8077 Add sprite for the Cold Dagger item to UtBS (#9189)
* Add sprite for cold dagger item

* UtBS 04: use cold dagger sprite

* Update copyrights.csv for the cold dagger sprite
2024-08-13 22:54:02 +02:00
Gunter Labes
fa1b943bac
Fix filter attribute name 2024-08-11 15:24:21 +02:00
Steve Cotton
0b34ff94c5 Add a unit test for the [terrain] tag in HttT S17
Using a terrain SLF in the [terrain] tag has a quirky syntax,
so let's add a test for it.
2024-08-10 18:10:56 +02:00
Steve Cotton
9984f63f92 HttT S17 Don't erase castles from other leaders
The random map generator can generate starting locations so close that
ERASE_CASTLE removed not just the intended castle, but also the keep
of the nearby leader. To avoid that, create the castles after deciding
which leaders to remove.

The ERASE_CASTLE macro is obsolete; even for logic that erases
castles,  using location_id makes the code simple enough that a macro
isn't useful. However, as this change is being applied to 1.18, I'm
only adding a comment about it.
2024-08-10 18:10:56 +02:00
pentarctagon
b6c6fabd21 damage_type tests 2024-08-07 21:33:26 -05:00
Iris Morelle
e6a4bbf2f3
editor: Implement a Show Tool Information toggle option
This allows permanently hiding the obnoxious help text tooltip that
constantly dances between the top and bottom of the screen depending
on what you're doing in the editor.

Icons provided by babaissarkar.
2024-08-07 10:19:34 -04:00
Wedge009
e6dd32b8e8 SotA S2: Avoid destroying unit potentially already occupying target hex. (Closes #9150)
(cherry picked from commit 12606e2fc5)
2024-08-07 09:01:36 +10:00
Severin Glöckner
1f5d45a9f3 Schema: support other mp_ keys too
In addition to the mp_village_gold used in mainline,
there exist as well:
- mp_fog
- mp_shroud
- mp_village_support
2024-08-03 11:02:05 -05:00
pentarctagon
e82c5c433e damage max_value only works with 1.19+ 2024-07-30 22:17:18 -05:00
Pentarctagon
36fac11ad2 damage ability tests (#9137) 2024-07-30 19:08:21 -05:00
Oleksii
85324ae26c DM: S18 recall fix (#9118)
* DM S18 recall fix

* Update 18_The_Portal_of_Doom.cfg

* Update sides.cfg

(cherry picked from commit b372f9e9ae)
2024-07-23 15:41:28 +10:00
pentarctagon
1b47cea9c5 max_value works in 1.19+ 2024-07-22 00:19:50 -05:00
Pentarctagon
63e8b69236 chance_to_hit tests (#9093) 2024-07-21 17:32:14 -05:00
Dalas121
20e1989615 EI S12: fix Dra-Nak having inconsistent traits and portrait (#9113)
In EI S11, the player encounters an orcish warlord named Dra-Nak. If not killed in S11, he continues pursuing the player in S12, but the current S12 gives him different traits and a different portrait. This PR fixes the issue.
2024-07-19 20:32:18 -05:00
Dalas121
e8493cd807 EI S17b: fix buggy dynamic recruit list macro (#9105)
EI's S17b has a gold refund mechanic, allowing enemies to build up large gold reserves in certain situations.

When gold gets high, enemies are supposed to start recruiting higher-level units so they can spend it faster. The former implementation had some inconsistent issues; this should restore the intended behavior.
2024-07-19 20:32:18 -05:00
Dalas121
e940d62ba9 EI S04c: only award achievement if all prisoners escape (#9108)
EI's S04c has an achievement for rescuing all 6 prisoners. This achievement currently triggers even if prisoners die before escaping the scenario.
2024-07-19 20:32:18 -05:00
Dalas121
62df15b6c8 EI S99: prevent prisoner income if prisons are captured (#9112)
In EI's S99, you gain gold from defeating and capturing hostile drakes.  The drakes are physically moved to prison cells in the middle of the map.

Previously, the player could continue capturing drakes even if the prison cells were captured by enemies. This made it a strong strategy to abandon the center and turtle up in a corner of the map. Additionally, the prison cells stayed locked with prisoners inside.

This PR fixes this issue. This also adds 2 new strings; I'm planning to backport to 1.18.2, as this is arguably a bugfix.
2024-07-19 20:32:17 -05:00
Dalas121
2e2db9b4d1 EI S11, S99: prevent backdoor entrance into prison cells (#9114)
EI's S11 and S99 have prison cells, one of which has an unintended backdoor entrance via an unwalkable deep water river. Flying units are involved in these scenarios, and can possibly fly into the cells through this unintended backdoor.

This PR changes the map hexes from unwalkable to impassable.
2024-07-19 20:32:17 -05:00
Wedge009
cf7ceb6f24 SoF: Align masked dwarf portrait to the right, consistent with S9. Resolves #9008.
(cherry picked from commit c67d130507)
2024-07-06 11:45:18 +10:00
Steve Cotton
b4d6878169 wmltools3: fix regexp compatibility with Python 3.12
(cherry picked from commit 91f59a794b)
2024-07-05 12:18:23 +02:00
Gunter Labes
17d9d2ecd6 Fix "span" regex
This disallows matching "0-11-2" and "1," for example. It also avoids an exponential backtracking issue which could make this regex very slow.

(cherry picked from commit 28a8959854)
2024-07-05 12:18:23 +02:00
Steve Cotton
06c0caf910 HttT S17 Don't create lava near the Sceptre
The lava is supposed to stay away from the Sceptre itself.
However, 60d114b changed from using sceptre_x,sceptre_y to using
a location_id, and missed updating these macros.
2024-07-05 12:18:23 +02:00
pentarctagon
57ceb7ac66 1.18.2+dev 2024-06-28 22:49:42 -05:00
pentarctagon
32b82e1c47 1.18.2 2024-06-28 22:42:43 -05:00
pentarctagon
f6c3a31e0e pot-update and regenerate doc files 2024-06-28 22:38:58 -05:00
Nils Kneuper
44cd0bf496 updated Ukrainian translation 2024-06-22 23:05:59 +02:00
Pentarctagon
0d27d59901 Add berserk weapon special abilities tests (#8973)
Changes:
* CHECK_STRIKES macro now takes a comma-delimited list of strike counts for when units have a different number of strikes for different weapons, and updates the existing usage in the attacks tests
* Fixed a typo in the attacks_zero test
* Adds tests for berserk as a weapon special ability.

Berserk's handling differs from attacks as a weapon special ability:
* A value less than 1 is treated as effectively infinite rounds of combat (undocumented)
* The cumulative attribute is handled differently - in some cases it sums the values instead of using the highest single value whereas for attacks it always uses the highest single value

Also now exclude data/tests/ from scons pot-update since it was hitting the argument limit for number of arguments to a script.
2024-06-15 20:21:47 -05:00
Dalas121
a37aadcbc5 Merge branch '1.18' of https://github.com/wesnoth/wesnoth into 1.18 2024-06-10 19:17:32 -05:00
Dalas121
2a54d4aaf1 Revert "EI S06b: revert string change for 1.18.1 freeze"
This reverts commit 6408559b02.
2024-06-10 19:17:22 -05:00
Dalas121
d1dd992d08 EI S10: add message about Owaec being able to recruit (#8987)
Owaec has a crown but little other indicator that he's a leader, and this scenario requires him to be used to recruit. Make it more obvious to the player.
2024-06-10 19:15:41 -05:00