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

174 Commits

Author SHA1 Message Date
Henning Koehler
67330efa4a added basics for Bonus updater 2018-02-18 16:34:15 +13:00
Arseniy Shestakov
324717acbe Spelling fixes: privilaged -> privileged, retreive -> retrieve 2018-02-10 21:52:23 +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
Henning Koehler
a7104377d6 fixed CREATURE_TYPE_LIMITER for creatures without a stack instance (#374) 2017-09-06 15:27:26 +03:00
Henning Koehler
abdca71828 skill names and descriptions are fully managed by CSkillHandler 2017-08-30 22:35:23 +12:00
Henning Koehler
9bbfb57b93 cleaned up secondary skill bonus merging 2017-08-27 15:35:04 +12:00
AlexVinS
8c0fab1dcf fixes 2017-08-12 14:36:37 +03:00
AlexVinS
15138c23de Finished conversion to new logging API
* removed logger streams
* (float3|int3)::operator() -> (float3|int3)::toString(), it was too ugly and confusing.
2017-08-11 23:06:27 +03:00
AlexVinS
61e241308d Logging cleanup 2017-08-10 19:52:05 +03:00
ArseniyShestakov
a4c0ad94b1 Code style: remove default value hints in definitions (#342)
Some are outdated and this is something IDE are useful for.
2017-07-15 14:08:20 +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
7bf8c9bd69 fixed and cleanup 2017-07-08 21:20:38 +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
FeniksFire
3de891b4b4 Moving/dividing classes from BattleState to separate files. 2017-03-17 16:48:44 +01:00
AlexVinS
7126bd61a4 Fixed CID 1197343 2016-12-05 03:12:11 +03:00
AlexVinS
c4ab962cc0 Fixed a few CWE-457 2016-11-27 17:48:18 +03:00
Vadim Markovtsev
baa7a84db3 Fix memory corruption during loading artifacts from mods 2016-10-22 10:00:55 +02: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
c2a6c268c0 Cleanup terrain overlay bonuses, fixed CURSED_GROUND 2016-10-01 14:10:09 +03:00
AlexVinS
b6368e23ab cleanup 2016-10-01 11:05:58 +03:00
AlexVinS
f6bfba0ced Unified Dispell-related bonus selectors 2016-10-01 10:31:59 +03:00
AlexVinS
96c17505ae get rid of IBonusBearer::getSpellBonuses & Selector::anyRange 2016-10-01 09:07:18 +03:00
AlexVinS
c243ae6f3e Get rid of IBonusBearer::getEffect 2016-10-01 08:28:33 +03:00
AlexVinS
a1ff409080 Tweak
* handle BIND_EFFECT by bonus type
2016-10-01 08:04:39 +03:00
AlexVinS
04f7b4f951 Cleanup 2016-10-01 07:47:39 +03:00
AlexVinS
730e3b6d0f Explicit use of limit selector in CBattleInfoCallback::getRandomBeneficialSpell
* reverted changes in IBonusBearer::hasBonusFrom just in case
2016-10-01 07:28:03 +03:00
AlexVinS
902117d812 Get rid of IBonusBearer::getBonusesCount it had only one usage 2016-10-01 06:51:12 +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
245d17a9e9 Fixed typo bonus duration enum. Mod compatibility retained. 2016-09-30 01:57: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
ArseniyShestakov
f4f170bf92 Merge pull request #202 from vcmi/noncopyableBonusSystemNode2
Didn't manage to find any crashes in newly created games. Merging.

Keep in mind that even if most of old saves will load properly some of them still corrupted beyond repair and after some turns they might eventually crash.
2016-09-04 11:06:05 +03:00
Arseniy Shestakov
452e28d183 Remove some useless includes found by cppclean
This of course was tested and shouldn't break anything
2016-08-26 04:42:16 +03:00
AlexVinS
69395d4c78 Fix bonus tree on node move 2016-08-18 15:04:07 +03:00
AlexVinS
d42947f109 Added move constructor for BonusList 2016-08-18 15:04:05 +03:00
AlexVinS
55e27a6334 Important fix 2016-08-18 15:04:03 +03:00
AlexVinS
681b3c7078 reduced code duplication 2016-08-18 15:04:01 +03:00
AlexVinS
629922f43e Added move constructors for minimum required Bonus system`s classes 2016-08-18 15:03:59 +03:00
AlexVinS
89ce1a4509 Fixed uninitialized field 2016-08-18 15:03:20 +03:00
Arseniy Shestakov
10dbbead2d Fix indentation of logging code and around it
That wouldn't be as big issue if problem affected few files, but it everywhere in codebase.
Fixed it everywhere since in most files that is the only code with wrong indentation.
2016-03-12 04:46:21 +03:00
Arseniy Shestakov
9fd1cff090 Refactoring: always use std prefix for shared_ptr, unique_ptr and make_shared
Long time ago it's was used without prefix to make future switch from boost to std version easier.
I discusses this with Ivan and decide to drop these using from Global.h now.

This change wouldn't break anything because there was already code with prefix for each of three cases.
2015-12-29 05:43:33 +03:00
ArseniyShestakov
8fb5dacba2 CBonusSystemNode: get rid of non-const getBonusList 2015-12-11 15:02:36 +03:00
ArseniyShestakov
b48d65ad57 addNewBonus: add turnsRemain check for N_TURNS, N_DAYS and ONE_WEEK 2015-11-20 14:37:57 +03:00
ArseniyShestakov
7f0b0bd1b5 Bonus system: use updateBonuses in battleTurnPasseed 2015-11-09 15:48:07 +03:00
ArseniyShestakov
ee1c5e452f Bonus system: add CWillLastDays selector 2015-11-09 15:01:58 +03:00
ArseniyShestakov
5bfbd8526b Bonus system: fix N_DAYS bonus duration 2015-11-09 14:18:36 +03:00
Vadim Markovtsev
b701835de0 Fix wrong comparison 2015-10-13 21:05:46 +03:00
AlexVinS
395070b584 Fix 1974 2015-09-15 08:51:05 +03:00
AlexVinS
8f2da66a18 fix mantiss 1967 + some refactoring
* remove TModDescr and realted APIs - they were only used in one place
2015-09-04 22:29:20 +03:00
AlexVinS
2cb6cb7baa Remove useless durationType selector
* duration is a mask, equality comparison is not enough
2015-06-02 07:12:02 +03:00