1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00
Commit Graph

64 Commits

Author SHA1 Message Date
e51ba74214 Fix loading of spell immunity icons for corresponding bonus 2025-04-10 22:24:22 +03:00
a3dbb5748c Fix build 2025-02-28 14:59:00 +00:00
07a46ed03b Configurable icons for bonuses
It is now possible for mods (e.g. vcmi extras) to provide custom icons
for bonuses subtypes or for custom bonuses values without requiring
hardcoded check in vcmi.

All existing hardcoded checks have been removed.

Bonuses config json from mods is now actually loaded.
2025-02-28 14:51:32 +00:00
645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00
8402602e35 Merge pull request #5145 from IvanSavenko/spell_school_descr
Better spell school translation in bonuses
2024-12-25 13:44:48 +02:00
8c4738c7b9 Better spell school translation in bonuses
Changed per-school bonus descriptions to be translateable for non-
English languages
2024-12-25 11:41:16 +00:00
cd67ced178 Merge pull request #5110 from IvanSavenko/ai_optimize
[1.6.1] AI optimization
2024-12-25 00:12:38 +02:00
e1b0a11c54 improve spell school translation 2024-12-24 14:05:21 +01:00
c68db70405 fix text for spell school bonus 2024-12-22 19:11:16 +01:00
95a07ee5cb Use bonus system cache whenever possible 2024-12-21 18:47:11 +00:00
6056d385ed Always load json configs from mod that references it
This should fix rather common problem with mods, where two unrelated mods
accidentally use same file name for a config file, leading to very unclear
conflict since this result in a file override.

Now all config files referenced in mod.json are loaded specifically from
filesystem of mod that referenced it. In other words, it is no longer
possible for one mod to override config from another mod.

As a side effect, this allows mods to use shorter directory layout, e.g.
`config/modName/xxx.json` can now be safely replaced with `config/
xxx.json` without fear of broken mod if there is another mod with same
path to config. Similarly, now all mods can use `config/translation/
language.json` scheme for translation files

Since this is no longer a problem, I've also simplified directory layout
of our built-in 'vcmi' mod, by moving all files from `config/vcmi`
directory directly to `config` directory.

- Overrides for miscellaneous configs like mainmenu.json should works as
before
- Images / animations (png's or def's) work as before (and may still
result in confict)
- Rebalance mods work as before and can modify another mod via standard
`modName:objectName` syntax
2024-10-31 14:49:11 +00:00
1488629628 Add simple support for translation of strings that were changed by
another mod
2024-10-06 19:42:15 +00:00
b85ccccb37 Minor refactoring of translations:
- removed unsuccessful and broken validation of translations
- pass JsonNode when registering strings to provide information on mod
source
2024-10-06 19:42:15 +00:00
1aa391fdf8 Split CGeneralTextHandler file into 1 file per class form
All text processing code is now located in lib/texts.
No changes other than code being moved around and adjustment of includes

Moved without changes:
Languages.h           -> texts/Languages.h
MetaString.*          -> texts/MetaString.*
TextOperations.*      -> texts/TextOperations.*

Split into parts:
CGeneralTextHandler.* -> texts/CGeneralTextHandler.*
                      -> texts/CLegacyConfigParser.*
                      -> texts/TextLocalizationContainer.*
                      -> texts/TextIdentifier.h
2024-07-20 12:55:17 +00:00
7461df161c lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
050157db9d Register vcmi-only strings as part of 'vcmi' mod instead of 'core' 2024-04-08 13:16:54 +03:00
c3957c2c2a Moved json files to new directory, split on per-class basis 2024-02-14 13:08:24 +02:00
702fc8077d Fix possible crash on invalid spell 2024-01-24 13:43:35 +02:00
c31d52bff6 Added new bonus icon 2024-01-18 17:18:13 +02:00
ceea341bb0 Fix crash on attempt to dereference invalid subtype in bonus 2024-01-04 23:54:35 +02:00
3880ea58b9 Merge branch 'josch/dos2unix' into develop 2023-10-22 18:39:03 +03:00
ac925bb786 Renamed new types for consistency with code style 2023-10-22 16:55:19 +03:00
80e6485965 MetaIdentifier now uses std::variant internally 2023-10-22 16:55:19 +03:00
77facf9387 Implement missing functions, fixes linking errors 2023-10-22 16:54:56 +03:00
0a10fc30b8 (lib) Bonus subtype is now stored as metaidentifier that can store any
other identifier inside it
2023-10-22 16:54:43 +03:00
a1a5bc28c2 convert line endings from CRLF (Windows) to LF (Linux/Unix)
Mixed line endings cause problems when exporting patches with
git-format-patch and then trying to "git am" a patch with mixed and
non-matching line endings. In such a situation git will fail to apply
the patch.

This commit runs the dos2unix tools on the remaining files with CRLF
(\r\n) line endings to convert them to line-feeds (\n) only.

Files that are Windows specific like *.vcxproj and *.props files were
not converted.

Closes: #3073
2023-10-19 16:23:21 +02:00
6f0108e462 Use ResourcePath for referencing texts and json's 2023-09-04 18:22:34 +03:00
823ffa7a07 Always use ResourcePath for referencing images and animations 2023-09-04 18:22:34 +03:00
b61c9a9e35 Fix build 2023-08-25 13:46:42 +03:00
75c39c6562 vcmi: handle icons for SPELL_DAMAGE_REDUCTION
For all schools and for ANY subtype
2023-08-23 17:53:09 +03:00
d20711bcd6 immunities: polishing 2023-08-23 17:53:09 +03:00
8724181a0f vcmi: spell resistance rework
Now instead of XXX_IMMUNITY bonuses we have 2 bonuses with spellSchool
subtype: SPELL_SCHOOL_IMMUNITY and NEGATIVE_EFFECT_IMMUNITY.
All previous bonuses of subtype 0 is covered by SPELL_SCHOOL_IMMUNITY,
and all previous bonuses of subtype 1 is covered by
NEGATIVE_EFFECT_IMMUNITY. Unit tests are updated accordingly.
2023-08-23 17:52:16 +03:00
05eccbc2bb vcmi: split bonus to enumerator and HeroBonus.h 2023-05-03 18:01:06 +03:00
1f54a1474c vcmi: remove SHval (replace by simple val) 2023-05-02 00:53:50 +03:00
4c4498b22a vcmi: modernize rest of lib 2023-03-16 17:55:20 +03:00
34a26580a7 vcmi: skill-agnostic resistance
Uses exiting bonus and new PERCENT_TO_TARGET_TYPE value type
2023-03-16 16:46:41 +03:00
496c1def12 vcmi: remove FULL_HP_REGENERATION bonus
Just set HP_REGENERATION to high number
(in OH3 doubled stack health is sufficient)
2023-03-16 16:46:41 +03:00
62e579f672 vcmi: replace KINGx bonuses to one KING bonus
val = level of slayer which require to affect.
Can break saves.
2023-03-16 16:46:41 +03:00
5366f9190e vcmi: reduce boost::lexical_cast usage 2023-03-09 16:36:46 +03:00
623cae7d47 All translatable strings now have language identifier 2023-03-05 17:30:38 +02:00
35775b90f8 Moved bonus names to translation 2023-01-25 12:36:02 +02:00
d2b837b116 All creature-related texts go through translator 2023-01-20 15:18:36 +02:00
5da407e822 All spell texts are now passed through translator 2023-01-20 15:18:36 +02:00
7fdad4e0f6 Code refactor following C++ standard and condition fixes 2022-11-15 03:20:55 +03:00
ff635edc0b wrap all library code into namespace if VCMI_LIB_NAMESPACE is defined
preparation for having client and server in a single process
2022-09-24 15:55:21 +03:00
15138c23de Finished conversion to new logging API
* removed logger streams
* (float3|int3)::operator() -> (float3|int3)::toString(), it was too ugly and confusing.
2017-08-11 23:06:27 +03:00
18b8e1c7ad Tweaked CBonusTypeHandler 2017-08-09 12:18:49 +03:00
2c1dddde33 Fix memory problems with BonusList
Bonus * -> std::shared_ptr<Bonus>

This cures the following problems:

1) Memory corruption at exit. Some Bonus-es were deleted twice (mods?).
2) Memory leaks. Some Bonuses were not deleted.
3) Reduce the number of "Orphaned child" messages.

Valgrind reports 0 leaked memory now and no invalid reads/writes.
2016-09-29 15:08:00 +02:00
10dbbead2d Fix indentation of logging code and around it
That wouldn't be as big issue if problem affected few files, but it everywhere in codebase.
Fixed it everywhere since in most files that is the only code with wrong indentation.
2016-03-12 04:46:21 +03:00
685deddac1 Start spell-relatet files reorganisation
* moved existing files to separate directory
-> todo: split mechanics
2015-02-26 08:39:48 +03:00