1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-05-21 22:33:43 +02:00

356 Commits

Author SHA1 Message Date
Ivan Savenko
07662a070f
Merge pull request #5724 from IvanSavenko/randomization
Better randomization logic
2025-05-21 13:50:28 +03:00
Ivan Savenko
cc274c4d34 GameRandomizer is now in lib, add implementation 2025-05-19 18:51:42 +03:00
SoundSSGood
fcc9b8ecfa Artifacts discharging 2025-05-16 23:24:36 +02:00
SoundSSGood
9bbebd62e9 GrowUpArtifact pack 2025-05-16 23:20:09 +02:00
Ivan Savenko
4d4da0454f map objects hierarchy now uses IGameInfoCallback 2025-05-14 18:33:20 +03:00
Ivan Savenko
6f20235d07 Merge CPrivilegedInfoCallback into CGameInfoCallback 2025-05-14 13:42:20 +03:00
Ivan Savenko
b37a3dc63c Lighthouse / flaggable objects now has dedicated bonus system node
this alows to remove multiple hacks from lighthouse logic
2025-05-14 13:42:19 +03:00
Ivan Savenko
716da918f8 Completely remove IGameCallback class
- CClient now inherits directly from CPrivilegedInfoCallback, like
IGameCallback did before. However CClient no longer needs dummy
implementation of IGameEventCallback
- CGObjectInstance hierarchy now uses CPrivilegedInfoCallback for
callback. Actual events can only be emitted in calls that receive
IGameEventCallback pointer, e.g. heroVisit
- CGameHandler now inherits directly from both CPrivilegedInfoCallback
and IGameEventCallback as it did before via IGameCallback
2025-05-14 13:39:41 +03:00
Ivan Savenko
86b832be67 Remove CPack::applyGs method in favor of GameStatePackVisitor class 2025-05-10 17:51:35 +03:00
Ivan Savenko
62e774c91e Add new rewards for configurable objects 2025-05-06 17:28:11 +03:00
kdmcser
b8f222e7dd
Update ESerializationVersion.h 2025-05-06 01:25:33 +08:00
kdmcser
5645806035
Merge branch 'develop' into crash_fix4 2025-05-06 01:20:19 +08:00
kdmcser
69b58f1846 serialize uidCounter in CMap 2025-05-05 23:16:14 +08:00
Ivan Savenko
1690913ba4 Stack instance now stores non-serialized pointer to army 2025-05-05 16:09:21 +03:00
Ivan Savenko
283adc37d7 Unit stack rebalancing rework
- CStackInstance::count is now private with accessor methods
- CStackInstance::experience renamed to totalExperience and now stores
total stack experience (multiplied by stack size) to reduce rounding
errors
- CStackInstance::totalExperience is now private with accessors methods
- stack experience is now automatically reallocated on stack management
- Removed buggy BulkSmartRebalanceStacks pack, that mostly duplicates
BulkRebalanceStacks
- Renamed BulkSmartSplitStack to BulkSplitAndRebalanceStack to drop
unclear "smart" in name
- Reworked split-and-rebalance logic to correctly reallocate stack
experience
2025-05-01 18:18:30 +03:00
Ivan Savenko
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
Ivan Savenko
4e8e85e3e4 Fix issues reported by Sonar, review fixes 2025-04-27 14:57:31 +03:00
Ivan Savenko
4d57a8ed36 Prefer to pass CGameState as reference instead of pointer 2025-04-27 14:57:31 +03:00
Ivan Savenko
a43c3fcb31 Restore save compatibility with 1.6 2025-04-27 14:57:31 +03:00
Ivan Savenko
966468f3fa Fix and simplify game saving / loading 2025-04-27 14:57:31 +03:00
Ivan Savenko
f9989d9152 Cleanup serializer/deserializer code 2025-04-27 14:57:31 +03:00
Ivan Savenko
93b18ee94b Fix some issues detected by Sonar & code review, fix build 2025-04-27 14:57:31 +03:00
Ivan Savenko
586620a290 Basic code review, remove unused code from serializers 2025-04-27 14:57:31 +03:00
Ivan Savenko
d1d2cf4189 Fix crashes on game start, gamestate now derives from GameCallbackHolder 2025-04-27 14:57:31 +03:00
Ivan Savenko
d34b47bb20 Remove pointers from artifacts 2025-04-27 14:57:31 +03:00
Ivan Savenko
4ed13409c2 Remove serialization of raw pointers from serialization 2025-04-27 14:57:31 +03:00
Ivan Savenko
8ec3e5210a Remove no longer needed support for gamestate vectors serialization 2025-04-27 14:57:31 +03:00
Ivan Savenko
63d00b080e Removed pointer to army from StackInstance 2025-04-27 14:57:30 +03:00
Ivan Savenko
ab11d2b075 Remove quests from CMap, now solely owned by quest objects 2025-04-27 14:57:30 +03:00
Ivan Savenko
745040def3 Access to heroes storage in CMap is now done via public methods 2025-04-27 14:57:30 +03:00
Ivan Savenko
0ada2a5ebd Map objects now use shared_ptr (game) 2025-04-27 14:57:30 +03:00
Ivan Savenko
2ca1748e96 Artifact instances are now owned solely by CMap 2025-04-27 14:57:30 +03:00
Ivan Savenko
797646cc05 Quests in map now use shared_ptr instead of const ptr 2025-04-27 14:57:30 +03:00
Ivan Savenko
417ea6451a Remove ConstTransitivePtr from hero and town instances 2025-04-27 14:57:30 +03:00
Ivan Savenko
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
Ivan Savenko
2b286378e8 Remove logic for banks in 1.5 format 2025-03-19 08:02:39 +00:00
Ivan Savenko
eb3b51a6cf Remove save compatibility with 1.5.X 2025-03-18 11:35:15 +00:00
Ivan Savenko
62cb5412ff CGameState::map is now a private, unique_ptr with accessors 2025-03-08 14:05:14 +00:00
Laserlicht
7dfb499edf replace boost locks with std 2025-02-28 15:25:58 +01:00
Ivan Savenko
645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00
Ivan Savenko
0548f325e4 Merge branch 'master' into 'develop' 2025-02-21 13:59:34 +00:00
Ivan Savenko
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
Ivan Savenko
0efa39ec79 Fix pack name in logs 2025-02-06 14:21:32 +00:00
Ivan Savenko
09db3e4bef Reworked resource piles loading to fix wog maps with mithril 2025-01-25 11:40:21 +00:00
Ivan Savenko
232e70c03a Try to fix unclear, rare crash on saving the game 2025-01-18 19:51:31 +00:00
Ivan Savenko
ab45c58e26 Use small_vector for bonus list to reduce allocations 2024-12-21 14:43:08 +00:00
Dydzio
e9be46af98 Merge branch 'develop' into timed_events_objects_removal 2024-12-03 17:27:24 +01:00
Ivan Savenko
ccb42deba4 Fix deserialization of int64 values 2024-11-29 16:55:30 +00:00
Ivan Savenko
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
Ivan Savenko
4ae81cbac0 Add missing field to serialization 2024-11-16 16:23:02 +00:00