1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-14 10:12:59 +02:00
Commit Graph

123 Commits

Author SHA1 Message Date
Alexander Shishkin
b00e935e4d
Warnings fixes (#538)
Warnings fixes
* Suppress `missing-braces` for Clang
* Fixed many C4275 warnings
* Fixed almost all Clang/GCC warnings
* Silence most frequent MSVC warning.
* Fixed some pessimizing-move warnings
* Fixed some unused capture warnings
2019-01-19 13:52:02 +03:00
Michał Janiszewski
7be9aa4868 Prevent shadowing of function arguments by local vars 2018-10-29 16:56:14 +01:00
AlexVinS
f126a34a5e Fixed https://bugs.vcmi.eu/view.php?id=2904 2018-03-04 11:15:24 +03:00
Alexander Shishkin
8b002ad774
Issue2888 (#421)
Fixed issue 2888
* Merged AFTER_ATTACK & BEFORE_ATTACK cast modes.
* Introduced new caster class for creature ability usage
* Added few tests
2018-03-02 13:22:51 +03:00
AlexVinS
0b70baa95e Spells configuration version 2 (effect-based)
* Indirect spell effects loading
* Json serializer improvements
* spell->canBeCastAt do not allow useless cast for any spell
* Added proxy caster class for spell-created obstacles
* Handle damage from spell-created obstacles inside mechanics
* Experimental GameState integration/regression tests
* Ignore mod settings and load only "vcmi" mod when running tests
* fixed https://bugs.vcmi.eu/view.php?id=2765 (with tests)
* Huge improvements of BattleAI regarding spell casts
* AI can cast almost any combat spell except TELEPORT, SACRIFICE and obstacle placement spells.
* Possible fix for https://bugs.vcmi.eu/view.php?id=1811
* CStack factored out to several classes
* [Battle] Allowed RETURN_AFTER_STRIKE effect on server side to be optional
* [Battle] Allowed BattleAction have multiple destinations
* [Spells] Converted limit|immunity to target condition
* [Spells] Use partial configuration reload for backward compatibility handling
* [Tests] Started tests for CUnitState
* Partial fixes of fire shield effect
* [Battle] Do HP calculations in 64 bits
* [BattleAI] Use threading for spell cast evaluation
* [BattleAI] Made AI be able to evaluate modified turn order (on hypothetical battle state)
* Implemented https://bugs.vcmi.eu/view.php?id=2811
* plug rare freeze when hypnotized unit shots vertically
* Correctly apply ONLY_MELEE_FIGHT / ONLY_DISTANCE_FIGHT for unit damage, attack & defense
* [BattleAI] Try to not waste a cast if battle is actually won already
* Extended JsonSerializeFormat API
* fixed https://bugs.vcmi.eu/view.php?id=2847
* Any unit effect can be now chained (not only damage like Chain Lightning)
** only damage effect for now actually uses "chainFactor"
* Possible quick fix for https://bugs.vcmi.eu/view.php?id=2860
2018-02-08 11:37:21 +03:00
AlexVinS
f1a4831813 [Spells] Get rid of SpellTargetingContext. 2017-07-16 01:43:50 +03:00
ArseniyShestakov
ea0ceb1805 Merge pull request #323 from vcmi/CStackTweaks
CStack tweaks
2017-07-15 00:42:08 +03:00
Arseniy Shestakov
dbcd79c48a Code cleanup: remove double and unneded semicolons 2017-07-12 22:01:10 +03:00
AlexVinS
ea3502ed60 Removed CStack::totalHealth() 2017-07-09 20:23:51 +03:00
AlexVinS
44fc0cb57b Broken CHealth dependency on CStack 2017-07-09 19:49:52 +03:00
AlexVinS
f0713c1d36 Better handling of HYPNOTISED stacks in case of spellcasting 2017-07-09 16:55:10 +03:00
AlexVinS
4f14f22d3a Unified CStack ammo, casts and counterattacks
* it is possible now to add casts and shoots OTF (f.e. with spell bonus)

Centralized stack 'ammo' loading from bonus system.
* introduced small proxy class for local bonus cache
(no need to use global cache if particular selector used on node only in one place)
* handle killing resurrected creatures
* use IBonusBearer::MaxHealth() where possible
* Fixed https://bugs.vcmi.eu/view.php?id=2486
* Possible fix for 0 HP after resurrection.
* Hack-fixed https://bugs.vcmi.eu/view.php?id=2584
* Unified CStack health API
* Use CHealth for CStack count and health points
* increased SERIALIZATION_VERSION
2017-07-08 20:29:59 +03:00
ArseniyShestakov
b670bcb46f Merge pull request #313 from vcmi/spellCastQuery
Spell cast query
2017-07-04 02:43:22 +03:00
FeniksFire
8577445b10 Simple fix: http://bugs.vcmi.eu/view.php?id=2366 2017-07-03 22:41:16 +03:00
AlexVinS
3d1a84875e Queries refactoring
* Moved SUMMON_BOAT special case to mechanics
* Partially moved Town portal logic to mechanics class
* Added generic query reply to CCallback
* Redesigned Queries so that base API do not depends on CGameHandler
* Got rid of CGameHandler::castSpellRequest
* Removed CGameHandler::castSpell
* Added new Query type for town portal dialog (not used yet)
2017-07-03 21:43:04 +03:00
AlexVinS
4f8c7bd4bb CStack refactoring
* removed all occurrences of attackerOwned
* Use BattleSide enum
* more tweaks
2017-07-01 19:17:08 +03:00
FeniksFire
4113bdab01 Moving some files from lib to the battle subdirectory. 2017-06-26 15:26:08 +02:00
FeniksFire
039e3842fc Aesthetic changes in BattleHex (#303) 2017-05-29 10:33:34 +03:00
FeniksFire
3de891b4b4 Moving/dividing classes from BattleState to separate files. 2017-03-17 16:48:44 +01:00
AlexVinS
60bd54c9b3 Changed playerToSide return type to signed 2016-11-28 03:33:39 +03:00
AlexVinS
931656f24a possible fix for http://bugs.vcmi.eu/view.php?id=2612 2016-11-18 14:27:20 +03:00
AlexVinS
dad0569bc7 Relaxed cast requirements for Quicksand 2016-10-31 15:38:53 +03:00
AlexVinS
cd5c0b3297 Style tweaks. 2016-10-02 15:22:55 +03:00
AlexVinS
f124db9f61 Get rid of Bonus::sourceSpell()
* now bonus API looks more or less clean
2016-10-01 14:47:21 +03:00
AlexVinS
f6bfba0ced Unified Dispell-related bonus selectors 2016-10-01 10:31:59 +03:00
AlexVinS
2f7e10a06f Use range limit selector when modifying bonus lists and checking for spell bonuses
* fixes http://bugs.vcmi.eu/view.php?id=2532
2016-09-30 17:12:28 +03:00
AlexVinS
8aa31f4073 Fixed http://bugs.vcmi.eu/view.php?id=2529 2016-09-30 01:54:40 +03:00
AlexVinS
688dc4c189 tweaks 2016-09-29 19:37:59 +03:00
AlexVinS
d195bfb62d Possibly fixed http://bugs.vcmi.eu/view.php?id=2291 2016-09-29 18:55:07 +03:00
AlexVinS
fed26e1ac9 Merge remote-tracking branch 'remotes/vmarkovtsev/BonusList-shared_ptr' into develop
# Conflicts:
#	lib/spells/CDefaultSpellMechanics.cpp
2016-09-29 17:12:05 +03:00
AlexVinS
7ce33bc07a Dispell fixes 2016-09-29 16:50:33 +03:00
Vadim Markovtsev
2c1dddde33 Fix memory problems with BonusList
Bonus * -> std::shared_ptr<Bonus>

This cures the following problems:

1) Memory corruption at exit. Some Bonus-es were deleted twice (mods?).
2) Memory leaks. Some Bonuses were not deleted.
3) Reduce the number of "Orphaned child" messages.

Valgrind reports 0 leaked memory now and no invalid reads/writes.
2016-09-29 15:08:00 +02:00
AlexVinS
e91a6d45e8 Probably fixed http://bugs.vcmi.eu/view.php?id=2523 2016-09-29 10:45:22 +03:00
AlexVinS
a03419e7d9 Fixed http://bugs.vcmi.eu/view.php?id=2269 2016-09-24 11:25:29 +03:00
AlexVinS
7874dffa7d fixed http://bugs.vcmi.eu/view.php?id=2282 2016-09-24 10:06:24 +03:00
AlexVinS
849e3fc04e Fixed http://bugs.vcmi.eu/view.php?id=2506 2016-09-24 09:27:58 +03:00
AlexVinS
7618e294c2 More fixes to not place obstacles on wall parts 2016-09-24 04:55:48 +03:00
AlexVinS
cffc4b2ab5 fixed patch obstacle placement inside walls 2016-09-23 20:27:55 +03:00
AlexVinS
bac0b026e5 Do not place obstacles on wall parts 2016-09-23 13:14:12 +03:00
AlexVinS
374e30c972 Added a few safety checks 2016-09-18 16:30:03 +03:00
AlexVinS
73c7b49eb7 Hide effectValue calculation inside BattleSpellCastParameters 2016-09-18 15:27:22 +03:00
AlexVinS
505e53c17d Merge remote-tracking branch 'remotes/origin/develop' into SpellsRefactoring8
# Conflicts:
#	client/battle/CBattleInterface.cpp
#	lib/spells/BattleSpellMechanics.cpp
2016-09-12 10:13:40 +03:00
AlexVinS
3fa62beb6d Do not allow to cast Cure if there is nothing to cure. 2016-09-11 13:48:14 +03:00
Arseniy Shestakov
fe6c0cf89b Use RandomGeneratorUtil::randomShuffle for reproducible gameplay 2016-09-11 00:10:52 +03:00
AlexVinS
5e0a9d7966 hackfix for commander spells 2016-09-10 22:41:50 +03:00
AlexVinS
686cd00c68 Cleanup. 2016-09-06 12:26:01 +03:00
AlexVinS
f1d0bede11 Moved all affected stacks calculations to mechanics 2016-09-06 07:05:55 +03:00
AlexVinS
18fc94d709 WIP on SpellCastContext 2016-09-06 06:40:23 +03:00
AlexVinS
1d840a33a5 Started SpellCastContext rework 2016-09-06 04:11:30 +03:00
AlexVinS
82ac035340 OO design for obstacle spells. 2016-09-05 13:34:48 +03:00