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

447 Commits

Author SHA1 Message Date
Ivan Savenko
e829d723b2 Replace global bonus tree change counter with per-node counter 2025-01-12 12:23:07 +00:00
Ivan Savenko
5bfc837a8f Fix regressions from battlehex PR (mostly related to towers) 2025-01-12 11:07:50 +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
3b35c679ce Optimize Unit::getHexes method 2025-01-10 15:07:59 +00:00
Ivan Savenko
5375d61d1b Optimize battleAdjacentUnits method 2025-01-10 14:27:12 +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
MichalZr6
4031006317 Drop battle elapsed time measurement, restore avHexes.
Github validation report fixes.
2025-01-06 23:28:47 +01:00
MichalZr6
dad6437661 Refactor BattleHex, remake the use of precomputed neighbouring tiles containers.
- Moved short, frequently used functions to the BattleHex header for inlining
- Made BattleHex a class with a private hex value
- Moved getClosestTile implementation back to BattleHex
- Enabled access to static precomputed data in BattleHexArray via BattleHex
(note: circular dependency prevented static precomputed containers being directly placed in BattleHex)
2025-01-06 23:28:46 +01:00
MichalZr6
ac8104d56d SonarCloud recomendations.
Code review follow-up:
- Replace std::vector with boost::small_vector
- Rename function merge to insert
2025-01-06 23:28:45 +01:00
MichalZr6
44a645b5e0 use bitset for presenceFlags and steady_clock for measurments 2025-01-06 23:28:45 +01:00
MichalZr6
794595184e use class scope static instead of function scope 2025-01-06 23:28:45 +01:00
MichalZr6
7a8edff419 minor fixes 2025-01-06 23:28:44 +01:00
MichalZr6
fb9a3da651 Unit.cpp refactor and some other minor changes 2025-01-06 23:28:44 +01:00
MichalZr6
e3516120d8 Refactor destructibleEnemyTurns 2025-01-06 23:18:20 +01:00
MichalZr6
8c3a417527 Cleanup 2025-01-06 23:18:20 +01:00
MichalZr6
78845706c9 GetClosestTile refactor 2025-01-06 23:18:19 +01:00
MichalZr6
5f799d41b3 Use cached neighbouring tiles where possible 2025-01-06 23:18:19 +01:00
MichalZr6
a99274d72e BattleHexArray - new container for BattleHexes 2025-01-06 23:18:18 +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
4f80ccd648 Small micro-optimizations for code that gets called A LOT 2024-12-21 14:43:09 +00:00
Laserlicht
3c4064e09d prism attack fix 2024-11-23 02:10:01 +01:00
Ivan Savenko
c98ac01e7a Replaced public artType member of ArtifactInstance with getter 2024-10-30 16:47:01 +00:00
Ivan Savenko
db913d95e0
Merge pull request #4808 from Laserlicht/prism_breath
Bonus: prism breath
2024-10-28 12:29:41 +02:00
DjWarmonger
59a15c5ff0
Merge pull request #4790 from kodobi/bugfix/fix-incorrect-battlefield-while-attacking-town-without-fort
Fix battle setup for sieges without forts
2024-10-28 08:38:14 +01:00
Ivan Savenko
ee59bc4e71 Add bonus description generation for map objects 2024-10-25 18:36:02 +00:00
Laserlicht
0991f02282 Bonus: prism breath 2024-10-20 22:02:56 +02:00
kodobi
c576438a95 Fix battle setup for sieges without forts
- Update the if statement in BattleProcessor::SetupBattle to allow
  obstacles in battlefields during sieges without forts.
- Ensure towns without forts use the native battlegrounds.
- Refactor variable name from curB to currentBattle for clarity.
2024-10-17 14:54:01 +02:00
Ivan Savenko
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
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
Ivan Savenko
c0f5c7c0ea Replace pointer with reference in pack apply functions 2024-10-07 14:59:46 +00:00
Ivan Savenko
19db016473
Merge pull request #4654 from dydzio0614/any-hex-shooting
Allow targeting empty hex by shooters with multi-tile SPELL_LIKE_ABILITY
2024-09-27 19:23:33 +03:00
Dydzio
5dda4aa0f0 Remove overly strict condition 2024-09-22 21:43:20 +02:00
Dydzio
bb69ab1a1a Fix assert and condition for counting spell hexes 2024-09-22 18:25:18 +02:00
Dydzio
bf9a9283a4 Make any hex shooting possibility configurable 2024-09-22 16:58:15 +02:00
Dydzio
1a2d349267 Initial unconditionally working version 2024-09-22 15:07:44 +02:00
Laserlicht
899d3a14a0 only blocking non positive spells; counterstrike 2024-09-21 23:50:35 +02:00
Ivan Savenko
cb96b9959e
Merge pull request #4623 from Laserlicht/invincible_bonus
INVINCIBLE bonus
2024-09-20 11:50:29 +03:00
Ivan Savenko
65355925e9
Merge pull request #4595 from Laserlicht/cast_without_skip
Bonus for spell: cast without skip the turn
2024-09-19 16:17:48 +03:00
Laserlicht
b36c05df1d INVINCIBLE bonus 2024-09-19 03:14:45 +02:00