1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00
Commit Graph

78 Commits

Author SHA1 Message Date
5550edeb9a Fix inability of unit to cast spell after receiving morale 2025-04-29 12:12:51 +03:00
1f70f27b2d Fix hypnotize spell
- Fix testing for Hypnotized status
- Fix handling of three-headed & all-around attack (Cerberi / Hydras)
while hypnotized
2025-04-11 18:01:49 +03:00
2362c6da21 Fixes for multiple new issues from Sonar 2025-02-21 15:57:39 +00:00
112de6324f Do not show full damage range limit for units without range penalty 2025-01-26 15:51:09 +00:00
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
2ee5f2df02 Merge pull request #5295 from IvanSavenko/bugfixing
[1.6.4] Bugfixing for recently reported issues
2025-01-21 15:50:02 +02:00
ecdd394bb1 Use BattleHex as const ref wherever possible
Minor Fixes
Drop unused function from BattleHexArray
2025-01-21 13:23:17 +01:00
2a16767cdc Fix FREE_SHOOTING bonus check (including war machines) 2025-01-18 19:49:30 +00:00
e829d723b2 Replace global bonus tree change counter with per-node counter 2025-01-12 12:23:07 +00:00
48473b18f6 move checks for invincible bonus to UnitState & cache 2025-01-10 21:15:37 +00:00
40bff74195 Use small vector for unit list 2025-01-10 18:58:46 +00:00
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
e27ca391b1 Fix counter-attack counting 2025-01-08 16:06:31 +00:00
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
73d1675ae3 Code cleanup, fixes to discovered regressions 2025-01-05 15:41:42 +00:00
83b9a8d750 Fixes for regressions 2025-01-04 15:09:50 +00:00
39d2f27589 Remove remaining usages of CCheckProxy class 2025-01-04 15:09:50 +00:00
919588f7ff Added cache for common hero-based bonuses 2025-01-04 15:09:50 +00:00
157d6d30c8 Move rest of commonly-accessed UnitState queries to bonus cache 2025-01-04 15:09:50 +00:00
05397e2aaf Caching of bonuses that are requested with different durations 2025-01-04 15:09:50 +00:00
16cfb51f3e Initial version of new bonus caching system 2025-01-04 15:09:50 +00:00
5caf12f22f Few more fixes to bonus caching 2024-12-22 13:27:40 +00:00
95a07ee5cb Use bonus system cache whenever possible 2024-12-21 18:47:11 +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
735af83294 castSpellThisTurn to bool var 2024-09-18 21:24:27 +02:00
0aaafc4c8a cast without skip 2024-09-14 15:10:24 +02:00
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
9c4d4e89d6 disintegrate 2024-08-24 00:29:36 +02:00
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
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
31e1d39f92 Fix issues introduced by fixing typos 2024-06-27 08:38:04 +00:00
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
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
f5a64a0ac5 Call cheap to compute conditions before costly conditions 2023-11-18 19:42:45 +02:00
abad4b01ce Remove explicit convesion to int in operators 2023-11-15 15:55:19 +02:00
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
b88a8da4e8 Split off some netpack structures into separate files 2023-10-23 13:59:15 +03:00
ac925bb786 Renamed new types for consistency with code style 2023-10-22 16:55:19 +03:00
80e6485965 MetaIdentifier now uses std::variant internally 2023-10-22 16:55:19 +03:00
b394158dc9 Bonus Source ID now uses metaidentifier 2023-10-22 16:55:18 +03:00
77facf9387 Implement missing functions, fixes linking errors 2023-10-22 16:54:56 +03:00
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
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
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