1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-04 09:42:40 +02:00
Commit Graph

376 Commits

Author SHA1 Message Date
Andrii Danylchenko
8e79263b21
Merge pull request #4323 from vcmi/battle-ai-fixes
Battle ai fixes
2024-08-10 10:48:35 +03:00
Ivan Savenko
a4dd510735
Merge pull request #4358 from IvanSavenko/integer_divide
Add helper functions for integer division rounding
2024-08-06 18:10:03 +03:00
Ivan Savenko
b7391f49f6 Merge branch 'vcmi/master' into 'vcmi/develop' 2024-08-05 10:36:10 +00:00
Ivan Savenko
81e6207df0 Add helper functions for integer division rounding
Added set of functions that perform integer division with different
rounding modes:
- divideAndCeil - rounds up to next integer
- divideAndRound - rounds to nearest integer
- divideAndFloor - rounds to previous integer (equivalent to default
division)

Intended for use in library, where usage of floating point might lead to
desync in multiplayer games.

Replaced some cases that I knew of, including recent handicap PR
2024-08-03 13:52:14 +00:00
Andrii Danylchenko
3d856bfa9d Merge remote-tracking branch 'origin/develop' into battle-ai-fixes 2024-08-03 12:54:25 +03:00
Ivan Savenko
434a2fb0fb Explicitly specify to use ranged or melee attack for damage estimation 2024-07-29 17:13:31 +00:00
Andrii Danylchenko
9edb0afff8 BattleAI: fix dragonbreath retaliation 2024-07-28 14:41:32 +03:00
Ivan Savenko
6ac3752325
Merge pull request #4330 from Laserlicht/spellbook
check spellbook
2024-07-27 19:34:50 +03:00
Laserlicht
e46f5f705b
better approach 2024-07-26 20:34:47 +02:00
Ivan Savenko
ec63f3eeac
Merge pull request #4314 from IvanSavenko/tower_target_selection
Implemented simple target selection logic for arrow towers
2024-07-26 14:22:13 +03:00
Andrii Danylchenko
33e0eeaa8a BattleAI: fix dragon breath 2024-07-22 20:39:32 +03:00
Ivan Savenko
4aa73b40c9 Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
Ivan Savenko
5bd9a32d97 Implemented simple target selection logic for arrow towers 2024-07-21 13:16:33 +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
Ivan Savenko
2020d96070
Merge pull request #4071 from IvanSavenko/fix_rng_syncronization
[1.6] Fix potential desync if client uses different stdlib with different random number generators
2024-07-19 13:08:09 +03:00
Ivan Savenko
662254155a Merge branch 'vcmi/master' into 'vcmi/develop' 2024-07-17 13:57:36 +00:00
Ivan Savenko
63bcf7d83c Replaced most of usages of CRandomGenerator with vstd::RNG in library 2024-07-16 13:13:07 +00:00
Ivan Savenko
60a51e98de Remove usage of std::function from CRandomGenerator 2024-07-16 13:13:07 +00:00
Dydzio
3836f132d3 Fix alternative actions to support more than 2 actions + simplify logic 2024-07-15 00:41:05 +02:00
Andrii Danylchenko
a4b6fc75dd BattleAI: fix moving to unreachable in case of back-to-back 2-hex 2024-07-14 11:46:45 +03:00
Ivan Savenko
74723bf77e
Merge pull request #4254 from smanolloff/fix-battle-queue
Fix battle turn order for current turn
2024-07-12 14:45:15 +03:00
Simeon Manolov
941cd6768f
Fix battle turn order for current turn 2024-07-12 11:39:57 +03:00
Ivan Savenko
6b8f94e6e7 Merge remote-tracking branch 'vcmi/master' into develop 2024-07-11 17:43:44 +00:00
Tomasz Zieliński
bfa93be765 Limit predicted damage / loses to actual stack health 2024-07-09 06:39:41 +02: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
15f86c0284 Fixed issues from review 2024-06-11 16:47:23 +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
df83fa33a1 Merge branch 'vcmi/master' into 'vcmi/develop' 2024-05-31 09:34:21 +00:00
Ivan Savenko
5d6470e527
Merge pull request #4025 from IvanSavenko/shared_ptr_lib
[1.6] Use shared_ptr for library entities
2024-05-30 19:14:06 +03:00
Ivan Savenko
58b1e74342 Workaround - check also for valueType when updating bonuses
We should not assume that spells always have a single bonus with same
type/subtype
2024-05-28 17:01:30 +00:00
Ivan Savenko
0d427980bc Entities are now non-copyable 2024-05-17 14:47:09 +00:00
Ivan Savenko
7f9df2ef6f Tweaks to retaliation damage calculation:
- method now uses early returns to avoid deeply nested if's
- assume that retaliation damage is zero if target will die from attack
- account for BLOCKS_RETALIATION bonus when computing whether target
will retaliate
2024-05-17 12:23:51 +00:00
Ivan Savenko
84bc6c42db Added 'Serializeable' base class for classes serializeable by pointer 2024-05-16 18:40:59 +00:00
Ivan Savenko
ac4204f660 Fixed calculation of retaliation damage 2024-05-10 19:40:14 +00:00
kdmcser
c2d76ab95d
accept log text suggestion
Co-authored-by: Alexander Wilms <Alexander-Wilms@users.noreply.github.com>
2024-04-18 08:40:25 +08:00
kdmcser
b61011e8b4
accept get creature name suggestion
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2024-04-18 00:48:51 +08:00
kdmcser
1c6dfb5cc5 Fix creature min damage greater than max will cause game crash. #3780 2024-04-17 23:24:13 +08:00
Ivan Savenko
9e49587749 Replace bonus string description with metastring that can properly
handle translations
2024-04-09 16:13:30 +03:00
Ivan Savenko
907438c6f5 Fix crash on attempt to compute movement range for siege tower 2024-04-06 15:59:08 +03:00
Evgeny Malygin
ee42527ee1
Fixes 2024-03-29 12:28:14 +02:00
Evgeny Malygin
25125f96da
Fix: licenses, pragma guards, StdInc 2024-03-29 07:48:52 +02:00
Ivan Savenko
6e399eb21a Make some non-const static variables const or constexpr 2024-02-12 13:22:54 +02:00
Ivan Savenko
a9866bb5c6 Added RandomGeneratorUtil::nextItemWeighted convenience method 2024-01-31 00:17:40 +02:00
Ivan Savenko
2a193effcc Merge branch 'master' into 'develop' 2024-01-25 16:23:13 +02:00
Ivan Savenko
0c07384293 Refactoring of serialization versioning handling
- Removed 'version' field from serialize() method
- Handler classes - Binary(De)Serializer now have 'version' field
- Serialization versioning now uses named enum

Save compatibility with 1.4.X saves should be intact
2024-01-20 20:34:51 +02:00
Ivan Savenko
24d25730ad Changed checks for null with checks for hasValue 2024-01-20 16:41:10 +02:00
Ivan Savenko
ffd604c114 Removed unnecessary access to IHandler::objects 2024-01-19 13:56:06 +02:00
Ivan Savenko
9af7c63a26 Fix build 2024-01-19 13:56:05 +02:00
Ivan Savenko
e67e4430ba Removed most of non-const static fields in lib. Reduced header includes. 2024-01-19 13:55:22 +02:00