1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

75 Commits

Author SHA1 Message Date
Ivan Savenko
112de6324f Do not show full damage range limit for units without range penalty 2025-01-26 15:51:09 +00:00
Ivan Savenko
f858a6e04b
Merge pull request #5266 from MichalZr6/battlefield
Minor fixes to BattleHexArray. BattleHex'es as const reference where possible.
2025-01-25 17:44:14 +02:00
Ivan Savenko
2ee5f2df02
Merge pull request #5295 from IvanSavenko/bugfixing
[1.6.4] Bugfixing for recently reported issues
2025-01-21 15:50:02 +02:00
MichalZr6
ecdd394bb1 Use BattleHex as const ref wherever possible
Minor Fixes
Drop unused function from BattleHexArray
2025-01-21 13:23:17 +01:00
Ivan Savenko
2a16767cdc Fix FREE_SHOOTING bonus check (including war machines) 2025-01-18 19:49:30 +00:00
Ivan Savenko
e829d723b2 Replace global bonus tree change counter with per-node counter 2025-01-12 12:23:07 +00:00
Ivan Savenko
48473b18f6 move checks for invincible bonus to UnitState & cache 2025-01-10 21:15:37 +00:00
Ivan Savenko
40bff74195 Use small vector for unit list 2025-01-10 18:58:46 +00:00
Ivan Savenko
a44bbf4527
Merge pull request #5044 from MichalZr6/battle_hex_array
New container for BattleHexes. Refactors aiming for quick-battle better performance.
2025-01-10 15:32:05 +02:00
Ivan Savenko
e27ca391b1 Fix counter-attack counting 2025-01-08 16:06:31 +00:00
MichalZr6
dbe82b94f6 Changes following review:
- shared_ptr for destructibleEnemyTurns instead of raw pointer
- drop implicit int conversion for BattleHex class
  and implement toInt() instead
- implement necessary operators in BattleHex
- adjust code to work properly with JSON serializer
2025-01-08 07:24:43 +01:00
Ivan Savenko
73d1675ae3 Code cleanup, fixes to discovered regressions 2025-01-05 15:41:42 +00:00
Ivan Savenko
83b9a8d750 Fixes for regressions 2025-01-04 15:09:50 +00:00
Ivan Savenko
39d2f27589 Remove remaining usages of CCheckProxy class 2025-01-04 15:09:50 +00:00
Ivan Savenko
919588f7ff Added cache for common hero-based bonuses 2025-01-04 15:09:50 +00:00
Ivan Savenko
157d6d30c8 Move rest of commonly-accessed UnitState queries to bonus cache 2025-01-04 15:09:50 +00:00
Ivan Savenko
05397e2aaf Caching of bonuses that are requested with different durations 2025-01-04 15:09:50 +00:00
Ivan Savenko
16cfb51f3e Initial version of new bonus caching system 2025-01-04 15:09:50 +00:00
Ivan Savenko
5caf12f22f Few more fixes to bonus caching 2024-12-22 13:27:40 +00:00
Ivan Savenko
95a07ee5cb Use bonus system cache whenever possible 2024-12-21 18:47:11 +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
Laserlicht
735af83294 castSpellThisTurn to bool var 2024-09-18 21:24:27 +02:00
Laserlicht
0aaafc4c8a cast without skip 2024-09-14 15:10:24 +02:00
Ivan Savenko
8371232d29
Merge pull request #4504 from Laserlicht/hota_bonus
disintegrate bonus
2024-08-28 14:00:11 +03:00
K
462c79e190 remove never used code in CBonusSystemNode
Method CBonusSystemNode::getAllBonuses have 'root' parameter which is never
set to anythig else than nullptr. This patch removes the parameter and all
code that depends on it as preparatory work for further bonus system
optimization.
2024-08-25 14:15:21 +02:00
Laserlicht
9c4d4e89d6 disintegrate 2024-08-24 00:29:36 +02:00
Ivan Savenko
2a05fbdd50 Unified handling of battle sides ID's
- Replaced BattleSide namespace-enum with enum class
- Merged two different BattleSide enum's into one
- Merged BattlePerspective enum into BattleSide enum
- Changed all places that use integers to represent battle side to use
BattleSide enum
- Added BattleSideArray convenience wrapper for std::array that is
always 2-elements in size and allows access to its elements using
BattleSide enum
2024-08-11 20:54:44 +00:00
Ivan Savenko
1aa391fdf8 Split CGeneralTextHandler file into 1 file per class form
All text processing code is now located in lib/texts.
No changes other than code being moved around and adjustment of includes

Moved without changes:
Languages.h           -> texts/Languages.h
MetaString.*          -> texts/MetaString.*
TextOperations.*      -> texts/TextOperations.*

Split into parts:
CGeneralTextHandler.* -> texts/CGeneralTextHandler.*
                      -> texts/CLegacyConfigParser.*
                      -> texts/TextLocalizationContainer.*
                      -> texts/TextIdentifier.h
2024-07-20 12:55:17 +00:00
Alexander Wilms
31e1d39f92 Fix issues introduced by fixing typos 2024-06-27 08:38:04 +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
MichalZr6
65d22f17ae proper logging of drained life and resurrected count
new struct for keeping track of healed HP (also drained life) and resurrected count
2024-06-09 23:54:20 +02:00
Ivan Savenko
f5a64a0ac5 Call cheap to compute conditions before costly conditions 2023-11-18 19:42:45 +02:00
Ivan Savenko
abad4b01ce Remove explicit convesion to int in operators 2023-11-15 15:55:19 +02:00
Ivan Savenko
86a3806bec MetaString refactor to eliminate integer usage for identifiers
- entity names are now stored and serialized as text ID's
- added helper methods for convenience to get entities names to
metastring
2023-11-07 22:47:10 +02:00
Ivan Savenko
b88a8da4e8 Split off some netpack structures into separate files 2023-10-23 13:59:15 +03:00
Ivan Savenko
ac925bb786 Renamed new types for consistency with code style 2023-10-22 16:55:19 +03:00
Ivan Savenko
80e6485965 MetaIdentifier now uses std::variant internally 2023-10-22 16:55:19 +03:00
Ivan Savenko
b394158dc9 Bonus Source ID now uses metaidentifier 2023-10-22 16:55:18 +03:00
Ivan Savenko
77facf9387 Implement missing functions, fixes linking errors 2023-10-22 16:54:56 +03:00
Ivan Savenko
0a10fc30b8 (lib) Bonus subtype is now stored as metaidentifier that can store any
other identifier inside it
2023-10-22 16:54:43 +03:00
Ivan Savenko
62cd8b12d4 Converted several namespace enums to enum class 2023-08-25 13:38:02 +03:00
krs
27c488e62f Small changes after review. 2023-06-23 20:05:15 +03:00
krs
756dd398c2 Added constant for BATTLE_SHOOTING_RANGE_DISTANCE 2023-06-23 19:13:39 +03:00
krs
e938152c1d Fix for showing penalty limit in red for unlimited ranged archers 2023-06-23 19:13:39 +03:00
krs
33bbbefdeb First working prototype that mimics rangedFullDamageLimit code
Next step is to create more generic functions that can be shared between the 2.
2023-06-23 19:13:39 +03:00
Ivan Savenko
56d69e790b Renamed MetaString methods to more logical names 2023-06-20 19:37:27 +03:00
krs
b8ad5b41f3 UnitState has getRangedFullDamageDistance() 2023-06-11 18:40:47 +03:00
Konstantin
05eccbc2bb vcmi: split bonus to enumerator and HeroBonus.h 2023-05-03 18:01:06 +03:00
Konstantin
a6de9097be vcmi: rename HeroBonus.h to Bonus.h 2023-05-02 11:20:58 +03:00
Ivan Savenko
506c3d29bc Replaced vstd clamp with std version 2023-04-12 01:03:14 +03:00