3 Commits

Author SHA1 Message Date
Miloš Rašić 3dc3e1f3bd fix mod item name inheritance (#84056)
* fix mod item name inheritance

* use make_plural() instead of conditional translation()

Co-authored-by: ehughsbaird <44244083+ehughsbaird@users.noreply.github.com>

---------

Co-authored-by: ehughsbaird <44244083+ehughsbaird@users.noreply.github.com>
2025-12-06 11:44:55 -06:00
ehughsbaird c3f0957aaa Make monster attack cooldowns mandatory
Monster attacks defined in the `special_attacks` section of an mtype
definition are meant to inherit from `"type": "monster_attack"` entries
with the same id.

This is working, however the cooldown loading was not respecting the
`was_loaded` value, and thus would overwrite each time, making all
`special_attacks` that inherited and did not set a specific cooldown
reset the cooldown to 0.

Make the cooldown value mandatory, meaning that the first definition of
any monster attack must define a cooldown, but anything that inherits
(and thus was_loaded is set to true) will keep that value unless it
specifies a new one.

Also adds a regression test.
2025-06-23 01:00:25 +00:00
ehughsbaird bd65f73638 Fix damage instance deserialize function (#81200)
* Fix damage instance deserialize

Ensure it resets the damage instance, instead of simply adding what was
read to it.

* Revert "Update archery.json"

This reverts commit 3c04373fde.

This was due to a bug in the loading code, which has now been fixed.

* Add regression test for "ranged_damage" loading

Ensures that "ranged_damage" overwrites on load, instead of extending.

* correct the test name

---------

Co-authored-by: Anton Simakov <67688115+GuardianDll@users.noreply.github.com>
2025-06-08 19:08:10 +02:00