1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-19 00:17:56 +02:00
Commit Graph

130 Commits

Author SHA1 Message Date
54a46b77a9 Extract library entity randomization logic to separate class 2025-05-19 18:51:42 +03:00
4d4da0454f map objects hierarchy now uses IGameInfoCallback 2025-05-14 18:33:20 +03:00
6f20235d07 Merge CPrivilegedInfoCallback into CGameInfoCallback 2025-05-14 13:42:20 +03:00
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
a43c3fcb31 Restore save compatibility with 1.6 2025-04-27 14:57:31 +03:00
e6a8e5d4bd Correctly restore bonus system on deserialization 2025-04-27 14:57:31 +03:00
4ed13409c2 Remove serialization of raw pointers from serialization 2025-04-27 14:57:31 +03:00
417ea6451a Remove ConstTransitivePtr from hero and town instances 2025-04-27 14:57:30 +03:00
eb3b51a6cf Remove save compatibility with 1.5.X 2025-03-18 11:35:15 +00:00
a061ed04de Remove usage of ConstTransitivePtr from CTown 2025-03-08 14:04:51 +00:00
01d787fb5a Removed remaining cases of serialization of VLC entities 2024-10-30 16:48:18 +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
a8f8c3f4b1 Replaced most of accesses to CGObjectInstance::pos with anchorPoint() 2024-10-09 15:43:46 +00:00
9c6bd20159 code review 2024-10-01 16:32:28 +02:00
713fcd6543 research per day & seperate config 2024-09-30 02:40:28 +02:00
d929bfb9d1 rename; introduce factor 2024-09-28 15:05:13 +02:00
2052a26031 code review 2024-09-28 14:25:11 +02:00
7707adc44f checks on server 2024-09-28 01:18:10 +02:00
b09d9d501b Pass pointer to actual caller in showBlockingDialog callWith
Fixes activation of all rewardable buildings in town on blocking dialog
answer
2024-09-04 15:14:56 +00:00
39e5ba32f6 Merge pull request #4530 from IvanSavenko/town_fortifications
Support for configurable town fortifications
2024-08-31 13:59:40 +03:00
73459876bf Initial garrison of a town should now match H3 logic 2024-08-29 15:46:22 +00:00
36c1ed670f Support for configurable town fortifications
Removed most of hardcoded checks for fort level or for presence of fort/
citadel/castle buildings.

It is now possible to define which parts of town fortifications are
provided by town buildings

Configuration for H3-like fortifications is provided in
buildingsLibrary.json and will be used automatically by mods as long as
mods have buidings named "fort", "citadel" and "castle".

Alternatively, mods can separately define:
- hitpoints of walls (shared value for all sections)
- hitpoints of central, upper and lower towers (separate values)
- presence of moat
- shooters for each tower (separate values)
2024-08-28 19:42:14 +00:00
8ef8ffa5c4 Implemented configurable blacksmith. Deprecated ballistaYard type 2024-08-28 13:49:42 +00:00
d49a61645c All objects that can be owned by player now implement IOwnableObject 2024-08-28 12:51:28 +00:00
a481f07daf PlayerState now stores all objects owned by player 2024-08-28 12:51:27 +00:00
0fd9dbf240 Unified income handling, added IOwnableObject interface 2024-08-28 12:40:44 +00:00
20d5b33ea6 Remove marketModes as member
marketModes are now generated in runtime and are not a member of
IMarket. Was not a bad change, but towns load buildings before town type
is randomized, leading to case where market modes are not actually known
when building is added to town (like random towns with market built)

Since altar requires CArtifactSet for work, IMarket will now always
contain it, but it will only be accessible if market supports altar
mode.
2024-08-27 14:07:00 +00:00
f765f212bb Restore save compatibility 2024-08-26 20:52:37 +00:00
0c5022cae8 Loading market modes from json 2024-08-24 11:51:57 +03:00
2e3e6b1553 market->getObjInstanceID() 2024-08-21 01:01:23 +03:00
58bb2b58e3 IMarket suggestions
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2024-08-20 18:49:48 +03:00
39bb6d5f39 IMarket now able to store artifacts 2024-08-20 18:49:47 +03:00
fd45b5144d IMarket serializeable 2024-08-20 18:49:47 +03:00
2f3f3c21df Rename town building types to more clear names 2024-08-19 11:47:13 +00:00
01a9509ccb Remove unused code, reduce includes 2024-08-19 11:47:13 +00:00
f1e63792f0 Greatly simplify town buildings logic 2024-08-19 11:47:13 +00:00
b4c25a148a Merge branch 'develop' into bank_support 2024-08-09 23:36:59 +02:00
85cf33e5a8 Merge pull request #4422 from MichalZr6/fix_unsigned_to_signed
blockingDialog functions: the `answer` parameter can be negative
2024-08-09 15:31:45 +03:00
ffb8efc415 Merge pull request #4225 from godric3/map-editor-town-configuration-improvements
Map editor town configuration improvements (buildings, spells, events)
2024-08-09 15:26:33 +03:00
ffaaa7da15 blockingDialog functions: the answer parameter can be negative 2024-08-09 00:28:28 +02:00
47327e1642 backend 2024-08-04 17:52:40 +02:00
3e5df61946 code review 2024-07-29 22:54:42 +02:00
fa3fef8a0f change town events to vector + use getDefaultAllowed for spells 2024-07-28 16:28:21 +02:00
ec005593d3 growth handicap 2024-07-25 23:04:59 +02:00
4aa73b40c9 Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
63bcf7d83c Replaced most of usages of CRandomGenerator with vstd::RNG in library 2024-07-16 13:13:07 +00:00
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
0c07384293 Refactoring of serialization versioning handling
- Removed 'version' field from serialize() method
- Handler classes - Binary(De)Serializer now have 'version' field
- Serialization versioning now uses named enum

Save compatibility with 1.4.X saves should be intact
2024-01-20 20:34:51 +02:00
e67e4430ba Removed most of non-const static fields in lib. Reduced header includes. 2024-01-19 13:55:22 +02:00
a15366f5a5 Make IObjectInterface::cb non-static 2024-01-19 13:55:21 +02:00