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

469 Commits

Author SHA1 Message Date
139f41c9b2 Implement STACK_EXPERIENCE_GAIN_PERCENT bonus
Suggested on Discord

- implements STACK_EXPERIENCE_GAIN_PERCENT that modifies stack
experience received by units after combat
- removed "EXPERIENCE" primary skill. Changes to experience are now
applied through separate netpack
2025-06-02 21:21:20 +03:00
bad46571c0 Fix handling of upgrades of upgrades for necromancy
Game will now recognize upgrades of upgrades for Necromancy purposes -
if hero has such units in his army, Necromancy can target them with same
2/3 efficiency like direct upgrades
2025-05-27 18:46:11 +03:00
cc274c4d34 GameRandomizer is now in lib, add implementation 2025-05-19 18:51:42 +03:00
54a46b77a9 Extract library entity randomization logic to separate class 2025-05-19 18:51:42 +03:00
e79c8b9fe1 Remove unnecessary access to gamestate 2025-05-19 17:53:15 +03:00
cb82c6a4f6 Fix calculation of new secondary skill level. Fixes bug with removal 2025-05-16 17:21:39 +03:00
456525109e Replaced undescriptive bool true/false with more clear enum for
absolute/relative change via netpacks
2025-05-16 17:21:39 +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
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