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

460 Commits

Author SHA1 Message Date
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
35644da2b7 Reogranize callback-related classes on 1 file = 1 class basis 2025-05-12 22:07:09 +03:00
4b30336d03 Fix issues detected by Sonar 2025-05-11 19:50:57 +03:00
1b5d00cc99 Fix running game without wog active 2025-05-06 18:53:21 +03:00
fe276374ef Merge pull request #5687 from kdmcser/fix_commander_artifacts
fix commander artifacts inactive when loading game
2025-05-06 16:20:27 +03:00
aebe4932fb fix commander artifacts inactive when loading game 2025-05-05 23:01:43 +08:00
1690913ba4 Stack instance now stores non-serialized pointer to army 2025-05-05 16:09:21 +03:00
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
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
829739da24 Reduce usage of implicit conversions to int 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
912c2eae94 Fix regressions 2025-04-27 14:57:31 +03:00
e6a8e5d4bd Correctly restore bonus system on deserialization 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
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
9e6397d1f9 Remove pointer to boat from CGHeroInstance 2025-04-27 14:57:30 +03:00
63d00b080e Removed pointer to army from StackInstance 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
417ea6451a Remove ConstTransitivePtr from hero and town instances 2025-04-27 14:57:30 +03:00
63906c4446 Fix bug when no casualties but 1 skeleton is raised 2025-04-23 13:45:21 +02:00
60afbbe20f Necromancy & Eagle eye infowindows 2025-04-09 10:13:10 +02:00
603672ff51 revert some changes 2025-04-07 17:00:24 +02:00
474e044caf Update lib/mapObjects/CGHeroInstance.cpp
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2025-03-22 18:25:30 +01:00
cae84e0e77 Skill removal as reward 2025-03-22 17:16:46 +01:00
62cb5412ff CGameState::map is now a private, unique_ptr with accessors 2025-03-08 14:05:14 +00:00
645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00
2362c6da21 Fixes for multiple new issues from Sonar 2025-02-21 15:57:39 +00:00
ec970c7b22 Support for configuring minimal cost for moving between tiles
- Added `movementCostBase` parameter to game config that defines minimal
amount of movement points that will be spent when moving from one tile
on another while offroad (and cost of Fly / Town Portal spells)
- Added `BASE_TILE_MOVEMENT_COST` bonus type that allows modifying
`movementCostBase` on per-hero basis

Example usage for hota-like pathfinding skill
```json
"tileCostReduction" : {
	"type" : "BASE_TILE_MOVEMENT_COST",
	"val" : -15
}
```
2025-02-03 22:52:33 +00:00
e829d723b2 Replace global bonus tree change counter with per-node counter 2025-01-12 12:23:07 +00:00
40bff74195 Use small vector for unit list 2025-01-10 18:58:46 +00:00
73d1675ae3 Code cleanup, fixes to discovered regressions 2025-01-05 15:41:42 +00:00
dea1eba20b Rework and optimize turnInfo used by pathfinder 2025-01-04 15:09:50 +00:00
919588f7ff Added cache for common hero-based bonuses 2025-01-04 15:09:50 +00:00
16cfb51f3e Initial version of new bonus caching system 2025-01-04 15:09:50 +00:00
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
95a07ee5cb Use bonus system cache whenever possible 2024-12-21 18:47:11 +00:00
b8a04c6356 Avoid vector allocation when accessing game settings value 2024-12-21 14:43:09 +00:00
f893c80192 Move UpgradeInfo class to header and source files 2024-12-19 14:13:09 +01:00
af9445c16f Fixes following review 2024-12-17 22:34:06 +01:00
d8d3948ac3 Fix AI to use hillFort all available upgrades. UpgradeInfo refactor. 2024-12-17 22:34:06 +01:00
31e4937a8c Editing hero primary skill in map editor should not be influenced by artifacts 2024-12-08 17:49:41 +01:00
b750937588 Merge remote-tracking branch 'upstream/develop' into develop 2024-11-25 18:49:45 +01:00
1116c18af5 Fix Orrin as starting hero on some maps
Fixes a bug that led to Orrin being replaced with a different randomly
selected hero on maps where starting hero is not generated in town, but
pre-placed on map
2024-11-24 20:05:34 +00:00
65f2d0c44e Merge remote-tracking branch 'upstream/develop' into develop 2024-11-21 23:14:03 +01:00
0c4eb5156b Put imprisoned heroes back to prison 2024-11-17 18:07:28 +00:00
227e403e88 Fix crash on advancing to 3rd scenario of Birth of Barbarian campaign -
spellbook removal was not working correctly when hero does not keeps his
spells
2024-11-16 16:22:43 +00:00
e60a565942 Merge remote-tracking branch 'upstream/develop' into develop 2024-11-07 15:24:19 +01:00