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

207 Commits

Author SHA1 Message Date
AlexVinS
4b5910c2f4 VCAI performance improvements
* Node graph initialization optimized.
* Fixed "Unathorized obstacle access".
* Pathfinding tracing disabled with ifdef.
* Misc bonus calculation optimizations.
* Removed timestamp from log lines. Date formatting eats too much CPU.
* Paths for all heroes in Client are now cached
2019-01-17 10:50:56 +03:00
godric3
f9ac46576b Add description for bonuses from hero specialty 2018-10-29 21:33:13 +01:00
godric3
d9d01f0b68 Exposed more of existing limiters for modders (#449)
* Exposed alignment, faction and terrain limiters
* Limiters toString() use now boost:format
2018-04-17 19:59:30 +07:00
Henning Koehler
82f334b503 Enable Limiter nesting with AllOf, AnyOf, NoneOf (#439)
* Renamed LimiterList to AllOfLimiter and added AnyOfLimiter, NoneOfLimiter
* Updated bonus schema to new limiter format
2018-04-01 18:17:34 +07:00
Henning Koehler
6ddcb079a4 Enabled new secondary skills to be created (#438)
* Universities, Scholars and Witch Huts may offer new skills
* Moved encode/decodeSkill to CSkillHandler
* Refactored CSkill interface and CSkill::LevelInfo image storage
* Legacy game constants renamed to ORIGINAL_XXX_QUANTITY
2018-03-31 12:56:40 +07:00
Henning Koehler
02b5a5e830 Make bonus stacking configurable + fix duplicate propagation/inheritance (#433)
Addresses several related problems:
* Propagation / unpropagation of duplicate bonuses is inconsistent, causing bugs
* Duplicate bonuses never stack, which is not always intended behaviour (e.g. multiple copies of resource generating artifacts)
* Different bonuses always stack, which is not always intended behaviour (e.g. Angel + Archangel morale bonuses)

This is addressed as follows:
* Duplicate bonuses are never eliminated during propagation/inheritance.
* Unpropagation eliminates only a single copy of duplicated bonus
* Bonus receives a new field stacking that determines stacking behaviour:
* * empty string = no stacking with duplicates (default)
* * "ALWAYS" = stacks with duplicates & everything else
* * some other value = no stacking with bonuses with same stacking value
Also Morale/Luck window now hides non-stacking bonuses.
2018-03-27 14:54:58 +07:00
Henning Koehler
591928fc4b fixed bug introduced in last CAddInfo fix 2018-03-20 12:58:02 +13:00
Henning Koehler
8e7aa910cb spacing fix 2018-03-17 11:32:30 +13:00
Henning Koehler
68b757eb53 fixed CAddInfo::operator[] (mutable version) 2018-03-17 11:03:02 +13:00
Henning Koehler
7f76648a7c Extend Bonus.addInfo to integer vector (#427)
* changed Bonus::additionalInfo to integer vector

* fixed deserialization for old savegames

* removed newline from JsonNode::toJson()

* updated bonus schema; SPELL_AFTER_ATTACK and SPELL_BEFORE_ATTACK use new addInfo format

* removed unnecessary init in Bonus constructor
2018-03-12 08:20:18 +03:00
Henning Koehler
e455d97fc7 cleanup of CBonusSystemNode::removeBonusesRecursive 2018-03-05 22:13:23 +08:00
Henning Koehler
d3e4fc6e7a renamed CBonusSystemNode::popBonuses to removeBonusesRecursive 2018-03-05 22:13:23 +08:00
Henning Koehler
4c0a67041b secondary skill bonuses get updated via replacement (issue 2796) 2018-03-05 22:13:23 +08:00
Henning Koehler
89cb7b2780 formatting fix and code simplification in HeroBonus 2018-02-20 23:36:00 +13:00
Henning Koehler
95e2b44319 added TimesStackLevelUpdater 2018-02-18 20:36:24 +13:00
Henning Koehler
552bad08b3 added TimesHeroLevelUpdater; renamed ScalingUpdater to GrowsWithLevelUpdater 2018-02-18 20:36:24 +13:00
Henning Koehler
2b8f111a81 converted special.json; fixed bugs in specialty json construction 2018-02-18 20:22:23 +13:00
Henning Koehler
dc7132d8b7 converted castle.json; fixed bugs in Bonus::toJsonNode() 2018-02-18 20:22:23 +13:00
Henning Koehler
00f51e0f98 Updaters replace bonuses during inheritance 2018-02-18 20:22:23 +13:00
Henning Koehler
ab7ce6625e moved nameForBonus into Bonus class 2018-02-18 19:47:37 +13:00
Henning Koehler
16f59fb213 fixed base merging and limiter creation 2018-02-18 19:27:24 +13:00
Henning Koehler
038cb4bf19 remove base json from specialty bonuses 2018-02-18 19:27:24 +13:00
Henning Koehler
eb02ce0f31 changed specialty json format to struct with base (WIP) 2018-02-18 19:27:24 +13:00
Henning Koehler
c31950612c convert spec format in afterLoadFinalization 2018-02-18 18:53:01 +13:00
Henning Koehler
26862b4c51 improved/fixed specialty json encoding 2018-02-18 18:25:49 +13:00
Henning Koehler
05838b3827 Bonuse::toJsonNode uses string constants for type/subtype 2018-02-18 17:33:23 +13:00
Henning Koehler
c79b776f3c Limiters (at least creature type limiters) are printed as well 2018-02-18 17:33:23 +13:00
Henning Koehler
89b1ba7538 added basics for specialty format updating 2018-02-18 17:33:23 +13:00
Henning Koehler
2703b035a6 added updater to Bonus json format 2018-02-18 17:33:23 +13:00
Henning Koehler
d594845c32 fixed serialization issues 2018-02-18 17:33:23 +13:00
Henning Koehler
3e0022be27 added support for new specialty json format; old format is converted to bonuses with updaters 2018-02-18 17:33:23 +13:00
Henning Koehler
f867b1a37e invalidate bonus caching on update 2018-02-18 16:55:15 +13:00
Henning Koehler
f1fd00f005 renamed & reused CBonusSystemNode::updateBonuses; tweaked updater signature 2018-02-18 16:55:15 +13:00
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