1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00
Commit Graph

80 Commits

Author SHA1 Message Date
Ivan Savenko
0c07384293 Refactoring of serialization versioning handling
- Removed 'version' field from serialize() method
- Handler classes - Binary(De)Serializer now have 'version' field
- Serialization versioning now uses named enum

Save compatibility with 1.4.X saves should be intact
2024-01-20 20:34:51 +02:00
Ivan Savenko
1194419884 Added option to allow self-casting 2024-01-16 15:13:00 +02:00
Ivan Savenko
0842f5afee Removed remaining usages of std::vector<bool> 2023-11-15 15:55:18 +02:00
Ivan Savenko
54103813dd Remove no longer used serialization methods 2023-11-08 21:27:05 +02:00
Ivan Savenko
8dfdfffd87 Use ResourcePath for audio files 2023-09-04 18:22:34 +03:00
Ivan Savenko
823ffa7a07 Always use ResourcePath for referencing images and animations 2023-09-04 18:22:34 +03:00
Konstantin
d746a96d55 vcmi: use SpellSchool identifier instead of enum
Use identifier instead of enum inside callbacks. It is better and more
expandable solution.
2023-08-23 17:53:09 +03:00
Konstantin
344593e891 vcmi: made some CSpell properties private
There are getters for it.
2023-08-23 17:53:08 +03:00
Konstantin
8724181a0f vcmi: spell resistance rework
Now instead of XXX_IMMUNITY bonuses we have 2 bonuses with spellSchool
subtype: SPELL_SCHOOL_IMMUNITY and NEGATIVE_EFFECT_IMMUNITY.
All previous bonuses of subtype 0 is covered by SPELL_SCHOOL_IMMUNITY,
and all previous bonuses of subtype 1 is covered by
NEGATIVE_EFFECT_IMMUNITY. Unit tests are updated accordingly.
2023-08-23 17:52:16 +03:00
Tomasz Zieliński
9b649b0b79 Build fix 2023-07-18 10:55:26 +02:00
Tomasz Zieliński
025b0814c8 + Handled banning spells and artifacts
+ Rename allowedSpell => allowedSpells
2023-07-17 17:21:28 +02:00
Ivan Savenko
fc190b14bb Spell shrines can now be configured in json 2023-06-16 17:59:10 +03:00
Konstantin P
057a33c508 SpellSchool: use identifier instead of int
Needs redifinition of MAGIC_SCHOOL_SKILL in all mods
2023-05-07 20:37:32 +03:00
Konstantin P
9e1cdc410f vcmi: replace school bonuses to unified ones
Except immunity now
2023-05-05 21:30:45 +03:00
Konstantin
05eccbc2bb vcmi: split bonus to enumerator and HeroBonus.h 2023-05-03 18:01:06 +03:00
Konstantin
a6de9097be vcmi: rename HeroBonus.h to Bonus.h 2023-05-02 11:20:58 +03:00
Konstantin
6fa1b2b19f vcmi: move bonuses to its own folder 2023-05-02 00:53:50 +03:00
Konstantin
86f5d6de69 vcmi: modernize headers 2023-04-30 13:35:54 +03:00
Konstantin
7a5775a9f9 vcmi: use std::optional 2023-04-17 00:43:13 +03:00
Ivan Savenko
dfa2e2a349 Merge beta into develop 2023-04-11 19:37:35 +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
Ivan Savenko
c5225aab70 Fix serialization 2023-04-04 22:22:58 +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
Ivan Savenko
383387ef29 Integrated defaultMods into mod system 2023-03-16 17:55:09 +02:00
Konstantin
97fc424e98 vcmi: modernize lib/spells (except adventure one, needs major rework) 2023-02-12 21:23:00 +03:00
Ivan Savenko
47c1803c42 Finalization of refactoring:
- Entity interface now has getNameTranslated & getNameTextID methods
- Entity interface no longer has getName method
- removed (most) usages of normalizeIndentifier workaround method
- all moddable objects have identifier in form of mod:name
- all moddable object register strings in form of mod.type.name
2023-01-20 15:18:36 +02:00
Ivan Savenko
5da407e822 All spell texts are now passed through translator 2023-01-20 15:18:36 +02:00
Ivan Savenko
b8b1e07621 Fix serialization 2022-12-30 00:36:10 +02:00
Ivan Savenko
063b8732ff Save compatibility with main branch 2022-12-25 18:07:08 +02:00
Ivan Savenko
bab5922951 Spells can now define color muxer effect (e.g. Bloodlust & Petrify) 2022-12-22 00:25:35 +02:00
Andrey Filipenkov
ff635edc0b wrap all library code into namespace if VCMI_LIB_NAMESPACE is defined
preparation for having client and server in a single process
2022-09-24 15:55:21 +03:00
Nordsoft91
aaa07e4d2e New terrain support - part 1 (#755)
Initial support of new terrains
2022-09-11 11:31:26 +03:00
AlexVinS
ecaa9f5d0b Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2021-02-14 19:05:43 +03: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
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
10dd7e8a43 Cleanup 2018-02-10 04:03:17 +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
ArseniyShestakov
9d9c026c85 Code style: serialize everything on own lines for easier debugging (#357) 2017-07-31 16:35:42 +03:00
AlexVinS
7374689301 Fixed https://bugs.vcmi.eu/view.php?id=2715 2017-07-16 00:02:55 +03:00
AlexVinS
a65befaa08 Moved town portal logic to mechanics class 2017-07-03 21:43:04 +03:00
FeniksFire
4113bdab01 Moving some files from lib to the battle subdirectory. 2017-06-26 15:26:08 +02:00
AlexVinS
0f5202689e Cumulative spell effects
* Added experimental support for cumulative effects for ENCHANTED bonus
* Updated and fixed SPECIAL_PECULIAR_ENCHANT processing
* Initial implementation of cumulative spell effects.
* Scheme for new spell feature - cumulative bonus.
2017-06-13 21:50:50 +03:00
AlexVinS
0b3c1c7185 Fixed http://bugs.vcmi.eu/view.php?id=2639 2017-01-26 10:44:30 +03:00
AlexVinS
c5440a1c6c Fixed http://bugs.vcmi.eu/view.php?id=2541 2016-10-02 01:32:28 +03:00
AlexVinS
72461c5c2e Fixed http://bugs.vcmi.eu/view.php?id=2268 2016-09-29 23:14:22 +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
62abde6c46 Prepare battle log for spell-cast on server side. 2016-09-10 18:23:55 +03:00
AlexVinS
18fc94d709 WIP on SpellCastContext 2016-09-06 06:40:23 +03:00
AlexVinS
f3b7fe947c Reworked spell target existence check.
* related to 2269
2016-09-05 11:36:25 +03:00
AlexVinS
a23144b361 Extracted adventure spell mechanics to distinct class hierarchy. 2016-09-04 08:19:28 +03:00