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

31 Commits

Author SHA1 Message Date
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
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
c0f5c7c0ea Replace pointer with reference in pack apply functions 2024-10-07 14:59:46 +00:00
8225eb454e Added GameSettings to gamestate, potentially allowing to define game
settings per map (or in random map template)
2024-09-05 15:16:27 +00:00
67132b3e7f Fixed visitation of configurable town buildings by newly recruited heroes
and on building construction
2024-08-14 17:03:25 +00:00
b07408e984 New objects are now created and initialized on server and sent to client 2024-07-16 13:13:39 +00:00
63bcf7d83c Replaced most of usages of CRandomGenerator with vstd::RNG in library 2024-07-16 13:13:07 +00:00
19f2fbce1e Reveal terrain around newly recruited hero to account for Scouting 2024-05-10 16:48:20 +00:00
a99d5e6fa1 Simplify code 2024-04-26 12:44:57 +03:00
4d0c0f10a9 Merge pull request #3530 from Laserlicht/tavern
Invite hero
2024-01-26 13:12:55 +02:00
7857673ca9 missing bracket 2024-01-22 20:22:15 +01:00
9b2908d464 Apply suggestions from code review
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2024-01-22 20:19:49 +01:00
0a4b5dbe10 code review 2024-01-21 18:12:46 +01:00
883ea23495 moved to gameconfig 2024-01-20 17:54:15 +01:00
4813179abb Invite hero setting 2024-01-20 01:24:34 +01:00
346beea49c invite hero backend 2024-01-20 01:09:55 +01:00
d04241b10a Code cleanup 2024-01-19 23:02:00 +02:00
d5c4478816 Remove most of non-const access to VLC entities 2024-01-19 13:54:49 +02:00
c21913f661 Fixed initialization of move points and mana for dismissed heroes 2024-01-15 23:16:48 +02:00
e9ac8c67c1 Reworked and fixed selection of secondary skills:
- Fixed off-by-one error when checking for obligatory skills
- If both wisdom and magic school must be offered in the same slot, magic
school will be correctly offered on next levelup
- Obligatory skill can now be proposed for upgrade
- Obligatory skills are now offered using hero class weight instead of
simple random
- If hero has multiple skills not available to his class game will
select random skill instead of first one
- Moved storage of random seed to server instead of mutable member
2023-11-20 18:46:24 +02:00
8346d71c98 Remove more subID access 2023-11-01 14:44:05 +02:00
b88a8da4e8 Split off some netpack structures into separate files 2023-10-23 13:59:15 +03:00
037efdf5fc Improvements to type safety of Identifier class
- Constructor of Identifier from integer is now explicit
- Lobby hero/town selection now uses Identifiers instead of int's
- Removed serialization workaround for hero portraits
- Added dummy objects for custom heroes portraits for ID resolver to use
- HeroInstance now stores portrait ID only in case of custom portrait
- Fixed loading of campaign heroes portraits on RoE maps
2023-10-04 18:05:23 +03:00
0a0c01d639 Replaced 'isVisitActiveFor' methods with single 'getVisitingHero' 2023-09-26 15:55:07 +03:00
b807c3855b Add proper visitation checks for netpacks 2023-09-26 13:42:20 +03:00
8c0d78f1d9 Added initiator-player to packs that add/remove/move objects 2023-09-19 19:24:34 +03:00
86a7f5f5cd Removed getStr(bool), replaced with similar toString() 2023-09-04 22:21:02 +03:00
ce20d913e0 Fix checking PlayerColor's for validness 2023-08-27 01:35:38 +03:00
ee8adbe85f Update tavern on end of 7th turn of player in question
Allows removal of "retreat after 7th day" workaround and as result -
more straightforward code
2023-08-24 23:34:33 +03:00
c4bc6840ea Moved management of turn order into a new class 2023-08-24 23:34:33 +03:00
629ca3f13e Created directory structure for server files 2023-08-21 17:55:07 +03:00