1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-05-31 22:59:54 +02:00

762 Commits

Author SHA1 Message Date
Ivan Savenko
7b3d690998
Merge pull request #5731 from IvanSavenko/gamehandler_reduce
Refactoring - simplify classes derived from CGameInfoCallback
2025-05-23 16:04:27 +03:00
Ivan Savenko
ff0f5290f7 CClient no longer inherits from CGameInfoCallback 2025-05-23 14:17:43 +03:00
Ivan Savenko
af20b39fe6 Reduce non-const access to gamestate on server 2025-05-23 14:17:25 +03:00
Ivan Savenko
62316a6420 Per-instance bonuses for artifacts
It is now possible to give artifacts per-instance bonuses, if needed.

Unlike shared bonuses, per-instance bonuses stack if multiple instances
of same artifacts are equipped on hero.

This to implement resource-producing artifacts in line with H3 -
equipping multiple such artifacts on a single hero will give bonus from
each instance of such artifact.

Also, both existing bonuses and new instanceBonuses fields now use json
object instead of json lists. This allows easier modification of
individual bonuses of artifacts and potentially - custom icons /
descriptions for artifact bonuses.
2025-05-21 19:24:19 +03:00
SoundSSGood
f614a8a7f5 Discharging conditions 2025-05-16 23:26:42 +02:00
SoundSSGood
9bbebd62e9 GrowUpArtifact pack 2025-05-16 23:20:09 +02:00
Ivan Savenko
630f911cc9
Merge pull request #5713 from IvanSavenko/gamecallback_remove
Game callback rework (part 1?)
2025-05-16 17:19:37 +03:00
Ivan Savenko
6dd25d6a67
Merge pull request #5716 from kdmcser/zip_maps
fix crash when map is packaged in a zip mod
2025-05-16 17:19:24 +03:00
kdmcser
5e4912d056 fix crash when map is packaged in a zip mod 2025-05-16 01:14:12 +08: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
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
35644da2b7 Reogranize callback-related classes on 1 file = 1 class basis 2025-05-12 22:07:09 +03:00
Ivan Savenko
4b30336d03 Fix issues detected by Sonar 2025-05-11 19:50:57 +03:00
Ivan Savenko
0e2ea99283 Implemented option to emulate H3 seer hut full-army quest bug 2025-05-07 19:16:58 +03:00
Ivan Savenko
69de14a42f Fix crash on loading map with heroes that have combined art equipped 2025-05-07 18:05:30 +03:00
Ivan Savenko
92c4bcbf68 Unify checks for creature limiter 2025-05-07 16:35:15 +03:00
Ivan Savenko
f1d9d8479f Extend rewards & limiters functionality 2025-05-06 17:28:12 +03:00
Ivan Savenko
5dec3efa2f Spell scrolls as a reward 2025-05-06 17:28:12 +03:00
Ivan Savenko
62e774c91e Add new rewards for configurable objects 2025-05-06 17:28:11 +03:00
kdmcser
7cb922dd8a fix old vcmi format map loading crash 2025-05-06 01:53:25 +08:00
kdmcser
26f3d95b47
pass compile 2025-05-06 01:22:29 +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
kdmcser
82870e82c9 initialize uidCounter when loading game 2025-05-05 01:19:29 +08: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
f3a57f754c Fix loading of SoD & later maps 2025-04-27 14:57:31 +03:00
Ivan Savenko
829739da24 Reduce usage of implicit conversions to int 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
a89cf280e3 Fix campaigns progression 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
f025a3a932 Review & cleanup hiding / displaying map objects 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
f5f8ed192b Fix random map generation 2025-04-27 14:57:31 +03:00
Ivan Savenko
912c2eae94 Fix regressions 2025-04-27 14:57:31 +03:00
Ivan Savenko
e6a8e5d4bd Correctly restore bonus system on deserialization 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
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
6d65641a43 Gamestate is now passed as shared pointer 2025-04-27 14:57:30 +03:00
Ivan Savenko
cd7732456a Remove pointer to objects from TerrainTile 2025-04-27 14:57:30 +03:00
Ivan Savenko
63d00b080e Removed pointer to army from StackInstance 2025-04-27 14:57:30 +03:00
Ivan Savenko
16a06179cf Use ArtifactInstanceID in CGArtifact 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
71bc1054d0 BattleStart pack now uses unique_ptr 2025-04-27 14:57:30 +03:00
Ivan Savenko
c02a8a84fd Stacks of armed instance are now unique_ptr 2025-04-27 14:57:30 +03:00
Ivan Savenko
bdae7285ae Objects list is now private member of CMap 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