1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-02 23:07:36 +02:00

200 Commits

Author SHA1 Message Date
Ivan Savenko
3f4ff58a5e Merged bonus names with bonus descriptions, since they are never used
separately
2025-05-25 11:56:54 +03:00
Ivan Savenko
25e57542be
Merge pull request #5725 from IvanSavenko/bonus_description
Custom descriptions and icons for creature abilities
2025-05-23 14:02:34 +03:00
Ivan Savenko
3f83ad1b40
Merge pull request #5726 from IvanSavenko/breath
Configurable multi-hex attacks
2025-05-21 17:10:59 +03:00
Ivan Savenko
25655184d3 Add support for custom icons & descriptions for bonuses 2025-05-21 14:57:10 +03:00
Ivan Savenko
e90d8c318d Configurable multi-hex attacks
- Added bonus type MULTIHEX_UNIT_ATTACK - configurable version of Dragon
Breath.
- Added bonus type MULTIHEX_ENEMY_ATTACK - configurable version of
Cerberi multi-headed attack that only hits enemies
- Added bonus type MULTIHEX_ANIMATION - optional bonus that does not
affects gameplay, but allows to define in which cases game should use
alternative attack animation.
- All existing multi-hex attack bonuses other than ATTACKS_ALL_ADJACENT
are presumable deprecated, but will be supported for now.
- It is now possible to precisely configure which hexes are targeted by
MULTIHEX_XXX bonuses. See docs for details.
- Unified logic of all multi-hex attacks, all existing bonuses are now
implemented as specific case of MULTIHEX_XXX bonus
- Added tests to cover Cerberi attack logic, and fixed incorrect edge
case of Dragon Breath
2025-05-20 15:08:59 +03:00
SoundSSGood
a750adf705 Bonus type ARTIFACT_CHARGE 2025-05-16 23:20:09 +02:00
SoundSSGood
9bbebd62e9 GrowUpArtifact pack 2025-05-16 23:20:09 +02:00
Ivan Savenko
1165dadfd4
Merge pull request #5701 from IvanSavenko/bonus_docs
Update documentation for bonuses and fix creature type limiter
2025-05-14 11:53:05 +03:00
Ivan Savenko
f26dca2026
Merge pull request #5708 from kdmcser/limit_fix
OppositeLimiter fix and boat creation fix when loading map
2025-05-14 11:52:15 +03:00
Ivan Savenko
35644da2b7 Reogranize callback-related classes on 1 file = 1 class basis 2025-05-12 22:07:09 +03:00
kdmcser
c464e953e2 Merge branch 'develop' into limit_fix 2025-05-13 00:59:25 +08:00
kdmcser
ab46a16322 fix OppositeSideLimiter treat UNFLAGGABLE as opposite of NEUTRAL 2025-05-13 00:58:10 +08:00
kdmcser
7543fee02c fix OppositeSideLimiter error 2025-05-12 00:46:06 +08:00
Ivan Savenko
3d170bb1f4 Fix creature type limiter not considering upgrades of upgrades 2025-05-10 19:09:08 +03:00
Ivan Savenko
700eeb6bd4 Implemented HERO_SPELL_CASTS_PER_COMBAT_TURN bonus 2025-05-08 00:25:07 +03:00
Ivan Savenko
668bc57210
Merge pull request #5661 from kdmcser/crash_fix2
fix crash when creature level is 0
2025-04-30 13:38:25 +03:00
kdmcser
9310ff3b7a fix crash when creature level is 0 2025-04-30 00:10:21 +08:00
Ivan Savenko
f70ad2c15b Reorganized artifact-related classes
- files now generally contain only 1 class (except for tightly coupled
classes)
- files are now located in lib/entities/artifact directory
- removed excessive includes

No changes to functionality
2025-04-29 13:29:08 +03:00
Ivan Savenko
04c9e27ccd Fix discovered bugs from develop branch 2025-04-27 15:53:03 +03:00
Ivan Savenko
829739da24 Reduce usage of implicit conversions to int 2025-04-27 14:57:31 +03:00
Ivan Savenko
e6a8e5d4bd Correctly restore bonus system on deserialization 2025-04-27 14:57:31 +03:00
Ivan Savenko
3921b9e214
Merge pull request #5650 from kdmcser/limiter
fix crash when bonus limiter is empty in OwnerUpdater
2025-04-27 13:38:18 +03:00
kdmcser
a17f59b704 fix crash when bonus limiter is empty in OwnerUpdater 2025-04-26 02:15:25 +08:00
Ivan Savenko
1cb5f36ccb Fix handling of creature-specific limiters in noneOf limiter on hero
For example, if hero has specialty that provides primary skill bonuses
with "noneOf" limiter that contains limiter that can only be evaluated
in creature context (such as creature level or native terrain), limiter
itself would evaluate to DISCARD, and then will be inverted to ACCEPT by
noneOf limiter. As result, this would give hero bonus to primary skill
even though it is clearly intended to only target creatures.

This introduces NOT_APPLICABLE limiter decision that is not inverted by
noneOf limiter
2025-04-13 23:31:37 +03:00
Ivan Savenko
2b812be9cd Correctly show results of CreatureTerrainLimiter outside of combat 2025-04-13 22:23:12 +03:00
Ivan Savenko
896a7ec88e Better support for Adela specialty (+new modding functionality for it)
Fixes Adela specialty that was apparently broken back in #1518 and
replaced with logic that was clearly not tested - it was neither
functional, nor it was following H3 behavior.

- `HAS_ANOTHER_BONUS_LIMITER` now accepts `null` in place of bonus type,
for cases when limiting is needed by bonus source or bonus subtype. This
allows Adela Bless specialty to always work, irregardless of which
bonuses are provided by Bless.
- Implemented `DIVIDE_STACK_LEVEL` updater that functions same as
`TIMES_STACK_LEVEL`, but it divides bonus value, instead of multiplying
it (to make Adela specialty weaker for high-tier units, as in H3)
- Implemented `TIMES_HERO_LEVEL_DIVIDE_STACK_LEVEL` updater that
combines two existing updaters, to implement `val * heroLevel /
unitLevel` formula needed for Adela specialty
- Removed deprecated `ARMY_MOVEMENT` updater. Its functionality has
already been removed in 1.6.X releases, and it was remaining only as a
placeholder
- Updated modding documentation to account for these changes & to remove
some TODO's

Fixed regression from #777 that could led to either duplicated bonuses
or to multiple application of updaters. It introduced double-recursion -
node parents were gathered recursively, and then bonuses were also
collected recursively within each parent. This created situation where
updater could be applied different number of times. For example, hero
bonus that is propagated to unit in combat could be selected directly,
or via hero->combat unit chain, or via hero->garrison unit->combat unit
chains, leading to different calls to updaters if updater handles
garrison unit node type
2025-04-13 16:24:51 +03:00
Ivan Savenko
f3ca06c3d0
Merge pull request #5593 from kdmcser/limiter
make OwnerUpdater not hardcode OppositeSideLimiter
2025-04-12 10:53:31 +03:00
kdmcser
75aa89ae6e not use mutex 2025-04-11 22:52:20 +08:00
kdmcser
afd64daf04 make OwnerUpdater not hardcode OppositeSideLimiter 2025-03-28 23:06:03 +08:00
Ivan Savenko
eb3b51a6cf Remove save compatibility with 1.5.X 2025-03-18 11:35:15 +00:00
Ivan Savenko
645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00
Ivan Savenko
0548f325e4 Merge branch 'master' into 'develop' 2025-02-21 13:59:34 +00:00
Laserlicht
989a437eef fixes #5346 2025-02-14 22:19:26 +01:00
Ivan Savenko
4e6560c4c9 Fixes for issues detected by valgrind 2025-02-06 19:22:04 +00:00
Ivan Savenko
ec970c7b22 Support for configuring minimal cost for moving between tiles
- Added `movementCostBase` parameter to game config that defines minimal
amount of movement points that will be spent when moving from one tile
on another while offroad (and cost of Fly / Town Portal spells)
- Added `BASE_TILE_MOVEMENT_COST` bonus type that allows modifying
`movementCostBase` on per-hero basis

Example usage for hota-like pathfinding skill
```json
"tileCostReduction" : {
	"type" : "BASE_TILE_MOVEMENT_COST",
	"val" : -15
}
```
2025-02-03 22:52:33 +00: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
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
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
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
7a8edff419 minor fixes 2025-01-06 23:28:44 +01:00
MichalZr6
8c3a417527 Cleanup 2025-01-06 23:18:20 +01:00
MichalZr6
a99274d72e BattleHexArray - new container for BattleHexes 2025-01-06 23:18:18 +01:00
Ivan Savenko
ef8408fa5a Fix tests
Regression from #5158
2025-01-06 21:18:28 +00: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
dea1eba20b Rework and optimize turnInfo used by pathfinder 2025-01-04 15:09:50 +00:00
Ivan Savenko
579b64cd39 Fix build 2025-01-04 15:09:50 +00:00