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

341 Commits

Author SHA1 Message Date
f70ad2c15b Reorganized artifact-related classes
- files now generally contain only 1 class (except for tightly coupled
classes)
- files are now located in lib/entities/artifact directory
- removed excessive includes

No changes to functionality
2025-04-29 13:29:08 +03:00
4e8e85e3e4 Fix issues reported by Sonar, review fixes 2025-04-27 14:57:31 +03:00
4d57a8ed36 Prefer to pass CGameState as reference instead of pointer 2025-04-27 14:57:31 +03:00
a43c3fcb31 Restore save compatibility with 1.6 2025-04-27 14:57:31 +03:00
966468f3fa Fix and simplify game saving / loading 2025-04-27 14:57:31 +03:00
f9989d9152 Cleanup serializer/deserializer code 2025-04-27 14:57:31 +03:00
93b18ee94b Fix some issues detected by Sonar & code review, fix build 2025-04-27 14:57:31 +03:00
586620a290 Basic code review, remove unused code from serializers 2025-04-27 14:57:31 +03:00
d1d2cf4189 Fix crashes on game start, gamestate now derives from GameCallbackHolder 2025-04-27 14:57:31 +03:00
d34b47bb20 Remove pointers from artifacts 2025-04-27 14:57:31 +03:00
4ed13409c2 Remove serialization of raw pointers from serialization 2025-04-27 14:57:31 +03:00
8ec3e5210a Remove no longer needed support for gamestate vectors serialization 2025-04-27 14:57:31 +03:00
63d00b080e Removed pointer to army from StackInstance 2025-04-27 14:57:30 +03:00
ab11d2b075 Remove quests from CMap, now solely owned by quest objects 2025-04-27 14:57:30 +03:00
745040def3 Access to heroes storage in CMap is now done via public methods 2025-04-27 14:57:30 +03:00
0ada2a5ebd Map objects now use shared_ptr (game) 2025-04-27 14:57:30 +03:00
2ca1748e96 Artifact instances are now owned solely by CMap 2025-04-27 14:57:30 +03:00
797646cc05 Quests in map now use shared_ptr instead of const ptr 2025-04-27 14:57:30 +03:00
417ea6451a Remove ConstTransitivePtr from hero and town instances 2025-04-27 14:57:30 +03:00
896a7ec88e Better support for Adela specialty (+new modding functionality for it)
Fixes Adela specialty that was apparently broken back in #1518 and
replaced with logic that was clearly not tested - it was neither
functional, nor it was following H3 behavior.

- `HAS_ANOTHER_BONUS_LIMITER` now accepts `null` in place of bonus type,
for cases when limiting is needed by bonus source or bonus subtype. This
allows Adela Bless specialty to always work, irregardless of which
bonuses are provided by Bless.
- Implemented `DIVIDE_STACK_LEVEL` updater that functions same as
`TIMES_STACK_LEVEL`, but it divides bonus value, instead of multiplying
it (to make Adela specialty weaker for high-tier units, as in H3)
- Implemented `TIMES_HERO_LEVEL_DIVIDE_STACK_LEVEL` updater that
combines two existing updaters, to implement `val * heroLevel /
unitLevel` formula needed for Adela specialty
- Removed deprecated `ARMY_MOVEMENT` updater. Its functionality has
already been removed in 1.6.X releases, and it was remaining only as a
placeholder
- Updated modding documentation to account for these changes & to remove
some TODO's

Fixed regression from #777 that could led to either duplicated bonuses
or to multiple application of updaters. It introduced double-recursion -
node parents were gathered recursively, and then bonuses were also
collected recursively within each parent. This created situation where
updater could be applied different number of times. For example, hero
bonus that is propagated to unit in combat could be selected directly,
or via hero->combat unit chain, or via hero->garrison unit->combat unit
chains, leading to different calls to updaters if updater handles
garrison unit node type
2025-04-13 16:24:51 +03:00
2b286378e8 Remove logic for banks in 1.5 format 2025-03-19 08:02:39 +00:00
eb3b51a6cf Remove save compatibility with 1.5.X 2025-03-18 11:35:15 +00:00
62cb5412ff CGameState::map is now a private, unique_ptr with accessors 2025-03-08 14:05:14 +00:00
7dfb499edf replace boost locks with std 2025-02-28 15:25:58 +01:00
645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00
0548f325e4 Merge branch 'master' into 'develop' 2025-02-21 13:59:34 +00:00
4b824d05e2 Do not allow heroes banned for player as starting heroes
- `disposedHeroes` is now in map header, for use in map selection
- heroes that are marked as unavailable for player will now be hidden
from starting hero selection
2025-02-14 10:43:55 +00:00
0efa39ec79 Fix pack name in logs 2025-02-06 14:21:32 +00:00
09db3e4bef Reworked resource piles loading to fix wog maps with mithril 2025-01-25 11:40:21 +00:00
232e70c03a Try to fix unclear, rare crash on saving the game 2025-01-18 19:51:31 +00:00
ab45c58e26 Use small_vector for bonus list to reduce allocations 2024-12-21 14:43:08 +00:00
e9be46af98 Merge branch 'develop' into timed_events_objects_removal 2024-12-03 17:27:24 +01:00
ccb42deba4 Fix deserialization of int64 values 2024-11-29 16:55:30 +00:00
f59834afe1 Fixes for configurable markets support
- string "speech" can now be translated
- removed "title" string, VCMI will now use object name instead
- moved configuration of all "markets" into a separate json file
- added schema for validation of market objects
- removed serialization of translated strings from University
2024-11-20 15:45:13 +00:00
4ae81cbac0 Add missing field to serialization 2024-11-16 16:23:02 +00:00
0f94f35dcf code review 2024-11-14 00:34:39 +01:00
0e5711f8bf Merge branch 'develop' into delete 2024-11-06 23:28:57 +01:00
e9690c8c54 Merge branch 'develop' into autosave_name 2024-11-06 22:06:12 +02:00
164aac4db2 refresh list 2024-11-01 00:52:19 +01:00
1f0847660b possibility to delete unsupported saves 2024-10-31 21:57:20 +01:00
452762cd78 change datetime format 2024-10-30 23:23:56 +01:00
a39469d165 Add save compatibility 2024-10-30 16:57:03 +00:00
c4481f3797 Remove logic for serialization of VLC entities 2024-10-30 16:48:19 +00:00
8a5ac73438 Basic support for configurable flaggable objects
Converted CGLighthouse class into FlaggableMapObject

Bonus provided by Lighthouse/Flaggable is now defined in config and is
accessible to mods.
2024-10-25 16:48:10 +00:00
604e3b5c67 Merge pull request #4763 from IvanSavenko/herohandler_split
Split CHeroHandler.cpp/.h into 1 file per class
2024-10-14 19:05:48 +03:00
10ad0fc760 Split CHeroHandler.cpp/.h into 1 file per class
All parts of CHeroHandler.cpp are now in lib/entities/hero
Adjusted includes to use new paths
No functionality changes
2024-10-13 14:01:09 +00:00
31095248ab Removed typeName and subtypeName properties from CGObjectInstance 2024-10-13 13:05:50 +00:00
3dd4fa2528 Reduce usage of pointers to VLC entities
Final goal (of multiple PR's) is to remove all remaining pointers from
serializeable game state, and replace them with either identifiers or
with shared/unique pointers.

CGTownInstance::town and CGHeroInstance::type members have been removed.
Now this data is computed dynamically using subID member.

VLC entity of a town can now be accessed via following methods:
- getFactionID() returns ID of a faction
- getFaction() returns pointer to a faction
- getTown() returns pointer to a town

VLC entity of a hero can now be accessed via following methods:
- getHeroTypeID() returns ID of a hero
- getHeroClassID() returns ID of a hero class
- getHeroType() returns pointer to a hero
- getHeroClass() returns pointer to a hero class
2024-10-10 12:28:08 +00:00
679181c103 Implemented serialization of local player state in json form 2024-10-08 20:04:32 +00:00
c1c552d394 Replaced some of pointers to CPack's with references 2024-10-07 14:59:14 +00:00