Ivan Savenko
2cd29c1893
Rework campaign bonuses storage in type-safe form
...
Replaced campaign bonuses from using 3 integers to store anything with
type-safe version that uses std::variant that ensures that all bonuses
are in correct state.
Also removed "interesting" solutions like storing primary skills using
bit shifts.
Prerequirement for HotA campaign support
2025-06-15 17:01:14 +03:00
Ivan Savenko
8255a4b9ae
CGameHandler no longer inherits CGameInfoCallback, reduce direct access
...
to gamestate
2025-05-23 14:17:25 +03:00
Ivan Savenko
456525109e
Replaced undescriptive bool true/false with more clear enum for
...
absolute/relative change via netpacks
2025-05-16 17:21:39 +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
279d89f971
Merge pull request #5659 from IvanSavenko/artifact_split
...
Reorganized artifact-related classes
2025-04-30 13:23:41 +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
9fbfbc7506
Fix build
2025-04-29 12:37:29 +03:00
Ivan Savenko
71d742ab19
Fix handling of campaign bonus where player can select color to play
2025-04-29 12:14:14 +03:00
Ivan Savenko
4e8e85e3e4
Fix issues reported by Sonar, review fixes
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
a89cf280e3
Fix campaigns progression
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
331debaa3f
Removed pointers from PlayerState
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
1f502c0548
CMap towns and heroes on map fields are now private
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
Laserlicht
47cfe01141
seperate identifier
2025-04-11 00:49:26 +02:00
Laserlicht
5b74f7f19e
code review (first batch)
2025-04-10 21:04:24 +02:00
Ivan Savenko
62cb5412ff
CGameState::map is now a private, unique_ptr with accessors
2025-03-08 14:05:14 +00:00
Ivan Savenko
b6026084ea
StartInfo in gamestate now use unique_ptr
2025-03-08 14:04:51 +00:00
Ivan Savenko
a061ed04de
Remove usage of ConstTransitivePtr from CTown
2025-03-08 14:04:51 +00:00
Ivan Savenko
645b95ba02
Renamed LibClasses * VLC to GameLibrary * LIBRARY
2025-02-21 16:54:56 +00:00
Ivan Savenko
e035cf9e63
Optimized getHeroStrength method
...
- replaced 4x access to bonus system with single access
- fixed formula for Diplomacy
- fxied formula for hero transfer in campaigns
- removed pointless sqrt(pow()) construct
2024-12-22 14:49:35 +00:00
Ivan Savenko
c98ac01e7a
Replaced public artType member of ArtifactInstance with getter
2024-10-30 16:47:01 +00:00
Ivan Savenko
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
Ivan Savenko
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
Ivan Savenko
ad7f0416a7
Added overloaded version of getObjectHandler to CGHeroInstance
2024-10-13 13:06:31 +00:00
Ivan Savenko
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
Ivan Savenko
a8f8c3f4b1
Replaced most of accesses to CGObjectInstance::pos with anchorPoint()
2024-10-09 15:43:46 +00:00
SoundSSGood
b9ae7f1138
CMap put move and remove artifact method
2024-09-23 23:30:38 +03:00
Ivan Savenko
0058c9ba2e
Fix crash on transfer of multiple artifacts in a backpack to another
...
hero on starting next campaign scenario without hero that held these
artifacts before
2024-09-22 20:31:52 +00:00
Ivan Savenko
a481f07daf
PlayerState now stores all objects owned by player
2024-08-28 12:51:27 +00:00
SoundSSGood
58bb2b58e3
IMarket suggestions
...
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com >
2024-08-20 18:49:48 +03:00
SoundSSGood
39bb6d5f39
IMarket now able to store artifacts
2024-08-20 18:49:47 +03:00
Ivan Savenko
b7391f49f6
Merge branch 'vcmi/master' into 'vcmi/develop'
2024-08-05 10:36:10 +00:00
Ivan Savenko
13108849ca
Try to fix crash on transferring component of a composite artifact
2024-08-02 16:00:17 +00:00
Ivan Savenko
4aa73b40c9
Split CTownHandler into smaller chunks
2024-07-21 18:21:48 +00:00
Ivan Savenko
2020d96070
Merge pull request #4071 from IvanSavenko/fix_rng_syncronization
...
[1.6] Fix potential desync if client uses different stdlib with different random number generators
2024-07-19 13:08:09 +03:00
Ivan Savenko
662254155a
Merge branch 'vcmi/master' into 'vcmi/develop'
2024-07-17 13:57:36 +00:00
Ivan Savenko
63bcf7d83c
Replaced most of usages of CRandomGenerator with vstd::RNG in library
2024-07-16 13:13:07 +00:00
Ivan Savenko
30569a112c
Fix crash on attempt to transfer component of a combined artifact
2024-07-16 13:08:15 +00:00
Alexander Wilms
02e429e973
Fix typos using https://github.com/crate-ci/typos
...
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
Ivan Savenko
520f690d35
Fix transfer of non-first artifacts in backpack if hero does not
...
transfers as well
2024-05-28 14:21:29 +00:00
Ivan Savenko
f963b827e9
Add more descriptive error messages
2024-05-16 08:03:06 +00:00
Ivan Savenko
80fc2bb695
Merge remote-tracking branch 'vcmi/develop' into lobby
2024-02-03 21:11:34 +02:00
Ivan Savenko
290cc1510b
Added text container with map translations to campaign state
...
Fixes missing translations for heroes names customized on maps after
their transfer to next scenario
2024-01-31 20:01:24 +02:00