Commit Graph
100 Commits
Author SHA1 Message Date
Konstantin a1e8d95028 vcmi: rework CArtHandler 2023-04-17 12:32:47 +03:00
Konstantin 54eb550eb9 vcmi: remove unused functions now 2023-04-17 00:43:13 +03:00
Konstantin 7a5775a9f9 vcmi: use std::optional 2023-04-17 00:43:13 +03:00
Konstantin 0d35606a44 vcmi: use std::variant 2023-04-17 00:43:13 +03:00
Konstantin 8dcb041917 vcmi: use std::any 2023-04-17 00:43:13 +03:00
Konstantin 25783066e8 vcmi: use std::any_cast 2023-04-17 00:43:13 +03:00
Konstantin P f11fa8f0c8 Teleport: can trigger obstacles now 2023-04-13 11:24:19 +03:00
Konstantin P 384ee99834 vcmi: configurable teleport v2
1. Redesign wall and teleport penalty using shortest path
This will avoid OH3 exploits with teleport inside walls

2. Teleport is now configurable
2023-04-13 11:24:19 +03:00
Konstantin bc1aad3b26 vcmi: remove deprecated CStack::getCreature()
Function battle::Unit::unitType() does the same.
2023-04-13 11:24:19 +03:00
Konstantin d99d1509f6 Spell: remove unneeded virtual functions
We should not try to override pure virtual with pure virtual
2023-04-13 11:24:19 +03:00
Konstantin 03eb997137 CBattleInfoEssentials: add battleIsGatePassable()
This is a helper to check if gate is passable now or not.
2023-04-13 11:24:19 +03:00
Konstantin 8397bd91fb BattleActionsController: do not pass unused caster
This is unused, so, remove this parameter to prepare for teleport action
2023-04-13 11:24:19 +03:00
Konstantin 198df21ae3 vcmi: remove old landmine property 2023-04-13 11:24:19 +03:00
Konstantin 15031d2e16 vcmi: do not block interface on setup spells 2023-04-13 01:06:36 +03:00
Konstantin cb83a9371d vcmi: 1.2 compatibility to FACTION_LIMITER 2023-04-12 23:14:38 +03:00
Konstantin 9db2e2068e vcmi: fixup crash 2023-04-11 21:17:31 +04:00
Konstantin b82374c4a9 config: Orb of Vulnerability should block all resistances
Just set MAGIC_RESISTANCE and SPELL_RESISTANCE_AURA to 0
by INDEPENDENT_MIN, will work.
2023-04-10 22:07:22 +03:00
Konstantin 4da97682be vcmi: remove code duplication for native terrain 2023-04-10 19:28:17 +03:00
Konstantin 7b9e281f7d vcmi: bump serialization version 2023-04-10 19:28:16 +03:00
Konstantin fedf7d377c vcmi: remove TFaction
This is a huge change and will break save compatibility
2023-04-10 19:28:16 +03:00
Konstantin 452cebfdfd CPropagatorNodeType: replace default constructor
Parameter constructor did the same
2023-04-10 19:28:16 +03:00
Konstantin 09cbec7c75 HeroBonus: remove StackOwnerLimiter
It seems not to be used anywhere
2023-04-10 19:28:16 +03:00
Konstantin dd196f2aa8 vcmi: slightly rework limiters
1. Add vector to aggregates
2. Rework CreatureFactionLimiter to FactionLimiter
2023-04-10 19:28:16 +03:00
Konstantin 7326980bd4 vcmi: rename WithXXX to IXXXProvider 2023-04-10 19:28:16 +03:00
Konstantin bb1a5d9521 vcmi: remove configurable limiters from map
This limiters should be always initialized with parameters.
Add CREATURES_ONLY limiter to limit bonuses only to creatures
(no heroes).
2023-04-10 19:28:16 +03:00
Konstantin f8eba58003 vcmi: remove ALL_CREATURES propagator
Now unneded, because it handled by GLOBAL_EFFECT with
CREATURE_LEVEL_LIMITER (when range set to UINT_MIN and UINT_MAX).
2023-04-10 19:28:16 +03:00
Konstantin 9f8dcfc736 CCreatureHandler: load old stack exp as global effects
It is more robust and more logical.
2023-04-10 19:28:16 +03:00
Konstantin 0f5f4c69ec vcmi: specialize native terrain entity
Specialize native terrain entity for all object that have
native terrain. Allow creatures to take global bonuses into
account when checking for native terrain.
2023-04-10 19:28:16 +03:00
Konstantin 6d9859932b vcmi: add native terrain entity
Add interface which should be used on any object with native terrain

So far, it is faction, hero, creature and battle stack
2023-04-10 19:28:16 +03:00
Konstantin 1760d2295c HeroBonus: add CreatureLevelLimiter 2023-04-10 19:28:16 +03:00
Konstantin 01f5571342 CGHeroInstance: remove old struct
Saves where struct is used is incompatible anyway
2023-04-10 19:28:16 +03:00
Konstantin 2eaecfd1ae ObstacleCasterProxy: beta branch 2023-04-10 15:41:58 +03:00
Konstantin 4f3c826196 vcmi: manaLimit should be spellcaster property 2023-04-10 15:35:21 +03:00
Konstantin 40bea35a26 CHeroWindow: fix picked art mana limit display 2023-04-10 15:35:21 +03:00
Konstantin 235fddaf4b vcmi: constexpr IDs 2023-04-09 19:54:41 +03:00
Konstantin 75a52953f2 vcmi: change gcc variant to build lua and no pch 2023-04-09 00:15:09 +03:00
Konstantin 50c9a57133 InfoBar: fix tiny selection with data 2023-04-08 01:44:08 +03:00
Konstantin f8c15f3a4b InfoBar: disable scrollbar 2023-04-07 20:50:47 +03:00
Konstantin a04d8b34f3 vcmi: fix rmg header levels
It was printed as char, not as int.
2023-04-06 12:48:53 +03:00
Konstantin dc7d0297a7 CGameHandler: fixup healing destination
If it contains hex, not unit, server complains.
Add actual unit there.
2023-04-06 00:21:21 +03:00
Konstantin 11b237a23c vcmi: massive refactoring v1 2023-04-05 22:33:12 +03:00
Konstantin ee489f18d2 vcmi: PlayerState is now an Entity
This will reduce code duplication a little bit.
2023-04-05 01:22:04 +03:00
Konstantin 8968f0ef0e vcmi: change EAlignment to enum class 2023-04-05 01:22:04 +03:00
Konstantin 0c7dbea990 HeroBonus: remove unused function 2023-04-04 23:02:55 +03:00
Konstantin b7d6270272 vcmi: add getNativeTerrain method to factions 2023-04-04 23:02:55 +03:00
Konstantin e0715a76c8 vcmi: reduce CStack usage a little bit 2023-04-04 23:02:54 +03:00
Konstantin e946ddcfeb CGameHandler: obstacle trigger does not use CStack 2023-04-04 23:02:54 +03:00
Konstantin 22dd97ad18 vcmi: use entilites when possible part 1 2023-04-04 23:02:54 +03:00
Konstantin 4259d116e1 vcmi: move ServerSpellCastEnvironment in separate file
In theory, it should not know about CGameHandler
2023-04-04 23:02:54 +03:00
Konstantin 76bddf97bd gameConfig.json: add missing comma 2023-04-02 23:53:47 +03:00
Konstantin f41b2475fe vcmi: fix stack smash 2023-04-02 23:27:15 +03:00
Konstantin 41fa2367e5 launcher: update russian translation 2023-04-02 22:05:47 +03:00
Konstantin cabe228ebc CCreatureHandler: fix native terrain for any 2023-04-02 02:32:40 +03:00
Konstantin ff3e761f3b CTownHandler: remove hardcoded Cove grail
We have now exactly same definition in Json
2023-04-02 00:27:29 +03:00
Konstantin 3df5964847 CTownHandler: remove hardcoded Cove grail
We have now exactly same definition in Json
2023-04-01 03:14:35 +03:00
Konstantin 05cc7fbf67 GGameHandler: fix spell-like attack targeting 2023-04-01 01:06:26 +03:00
Konstantin 766f599e41 config: CATAPULT_EXTRA_SHOTS should be hidden 2023-04-01 00:21:34 +03:00
Konstantin 6d17b9342d ResourceSet: resolve .at troubles 2023-03-31 14:12:38 +03:00
Konstantin c1fd7309ad ResourceSet: composition 2023-03-31 14:00:49 +03:00
Konstantin d8a237ba46 vcmi: add getTrigger method to obstacles
Fixes advanced remove obstacle spell
2023-03-31 01:01:26 +03:00
Konstantin 82a6d94fd0 moats: indentation 2023-03-31 01:01:26 +03:00
Konstantin d5e2933bee CGameHandler: slightly rework obstacle caster 2023-03-31 01:01:26 +03:00
Konstantin 25956e3f37 vcmi: bump serializer version 2023-03-31 01:01:25 +03:00
Konstantin ecae600563 effects: Moat now includes battlefield bonus
This is an implementation which works exactly like in H3
2023-03-31 01:01:25 +03:00
Konstantin 53a6fb2836 CGameHandler: do not open-code toInfo
There is an obstacle function which is doing exactly this.
2023-03-31 01:01:25 +03:00
Konstantin f704a17e1a vcmi: add a last hex setting
I consider this behaviour as H3 bug, but this is H3.
So, added a setting to disable this behaviour.
2023-03-31 01:01:25 +03:00
Konstantin 35e8ce2ead vcmi: update russian translation 2023-03-31 01:01:25 +03:00
Konstantin d83e58f948 vcmi: use new animation functions in client 2023-03-31 01:01:25 +03:00
Konstantin 179cee3e88 vcmi: add obstacle animation helper functions 2023-03-31 01:01:25 +03:00
Konstantin eff41f66ed vcmi: now obstacles can have disappearing anim
It is a reverse version of appearingAnimation.
2023-03-31 01:01:25 +03:00
Konstantin 7543fdf787 vcmi: add reverse effect animation type
To be used later with obstacle removal
2023-03-31 01:01:25 +03:00
Konstantin c4d5a7a2d6 vcmi:towns now can choose if moat render is needed
Using invalid points. Also removed unused variable.
2023-03-31 01:01:25 +03:00
Konstantin a8478a012b vcmi: check long bridge by moat
If moat is on GATE_BRIDGE hex, then it is a long bridge.
No need to check town type.
2023-03-31 01:01:25 +03:00
Konstantin 3bbff0588d CSpell: !isMagical() -> no sorcery and no generic spell dmg reduction
Other bonus are still applied.
2023-03-31 01:01:25 +03:00
Konstantin a639bd2606 spells: rework isMagical()
Now it is a flag of a spell, and not a target condition.
This fixes resistance to bind effect
2023-03-31 01:01:25 +03:00
Konstantin aab5b47038 vcmi: setup moats using MoatAbility
Setup moats using moat ability, need playtest for now.
-3 to defence not added for now.
2023-03-31 01:01:25 +03:00
Konstantin 6c5f5dba75 BattleAI: check negative obstacles instead of moat.
This will work for fire walls too (and if someone will summon elementals
after placing land mines). But will not work for Tower's landmines.
2023-03-31 01:01:25 +03:00
Konstantin 1100bc7a5b obstacle: remove trigger animation and sound
It was not working anyway. Now it is handled by trigger ability.
Trigger ability hit animation + trigger ability cast sound.
2023-03-31 01:01:25 +03:00
Konstantin 50dab1f049 vcmi: convert fireWall and landMine
convert fireWall and landMine to new
trigger system. Now landmines correctly removed
after exploding
2023-03-31 01:01:25 +03:00
Konstantin cd1730b1fb vcmi: remove obstacle caster logic
It is possible now to cast something via obstacle
Immune creatures should not trigger an obstacle trigger now
and should not reveal it.
2023-03-30 14:41:40 +03:00
Konstantin db428faeeb vcmi: allow obstacles to store another spells
It will be used as trigger spell, if set
If not set, it will be ignored
2023-03-30 14:41:40 +03:00
Konstantin 57c35f39ca WIP: Moat placer 2023-03-30 14:41:40 +03:00
Konstantin d90d00eeac vcmi: rework ProxyCaster
Now ProxyCaster can be used without hero and can even cast something
with default values.
2023-03-30 14:41:40 +03:00
Konstantin 847437bbfa BattleInfo: update bonus tree when unit is moved
This is a semi-dirty hack to force uncaching a bonuses with
UnitOnHexLimiter
2023-03-30 12:51:59 +03:00
Konstantin 4c08e6a0f9 vcmi: add UnitOnHex limiter
Bonus will be accepted, if unit stands in listed hexes
2023-03-30 12:51:59 +03:00
Konstantin ffe24627e7 HeroBonus: change limiters to enum class
Also remove unused functions.
2023-03-30 12:42:24 +03:00
Konstantin 777818b388 HeroBonus: use 64 bit for tree counter (to be more robust) 2023-03-30 12:41:17 +03:00
Konstantin 0e69aac96f HeroBonus: removed unused functions 2023-03-30 12:41:17 +03:00
Konstantin 89fd742c1a NetPacks: add BATTLE type to GiveBonus
Will work as battlefield effect of current battle.
2023-03-30 12:41:17 +03:00
Konstantin 5716925b47 NetPacks: change GiveBonus enum to enum class. 2023-03-30 12:41:17 +03:00
Konstantin 9a229d6e48 vcmi: really correct obstacle trigger
Now obstacle trigger really matches H3
2023-03-27 16:11:17 +03:00
Konstantin 8c1d6c8e13 CBattleInfoCallback: use obstacle only once
We should not affect creature by obstacle twice.
2023-03-27 15:45:41 +03:00
Konstantin 88a7b3141d vcmi: really correct BFS
AFAIK, all is working as H3.
2023-03-27 15:45:41 +03:00
Konstantin 5b50191af7 NetPacksLib: remove obstacle ACTIVATE* actions
Actually these actions was not working anyway.
2023-03-26 22:59:34 +03:00
Konstantin 26db14b7b4 vcmi: expert dispel now works mechanically correct 2023-03-26 21:25:26 +03:00
Konstantin 1b893fa525 client: do not show obstacles placed by another player 2023-03-26 21:23:54 +03:00
Konstantin edc9812559 obstacle: correct logic as in OH3
Obstacle spells should not be cast if they are affected by native
terrain and enemy have at least one stack with native terrain
2023-03-26 21:22:38 +03:00
Konstantin 705afbb898 UnitEffect: it should not always assume smart
It is normal than non-smart spell will be cast on our units.
2023-03-26 21:19:49 +03:00
Konstantin a75ff91a50 vcmi: remove old string from config 2023-03-26 21:17:58 +03:00
Konstantin 44a625aa6b vcmi: check spell obstacles by type 2023-03-26 21:17:39 +03:00