Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bonus refactoring, part3 (save-incompatible) #1822

Merged
merged 16 commits into from
May 9, 2023

Conversation

rilian-la-te
Copy link
Contributor

@rilian-la-te rilian-la-te commented Apr 1, 2023

Fixes #2125

Serialization version is bumped.

Changes:

  1. Replaced BonusDuration from enum class to std::bitset (because duration is really flags, and not an enum, so, we need to be able to enable any durations combined)
  2. 100% magic resistance and 100% spell damage reduction now should give a spell immunity to creature (to negative and damage spells respectively). Elemental damage 100% reduction should give immunity to any damage effects of this element, including non-magical. For now, works for any effect except maybe fire shield (need check). But fire shield and rebrith needs major rework, which is outside of scope of this PR.
  3. Replaced (SCHOOL)_SPELL_DMG_PREMY with SPELL_DAMAGE bonus (subtype now is school). ANY subtype is used for sorcery skill.
  4. Removed bonuses (SCHOOL)_SPELLS - replaced with SPELLS_OF_SCHOOL
  5. Removed DIRECT_DAMAGE_IMMUNITY bonus (replaced by 100% spell damage resist in one place when it is used).
  6. MAGIC_SCHOOL_SKILL changes subtype to be in line of other spell school bonuses. Now its subtype is school number directly, was be school number powered by two.
  7. Allow to use spellSchool string identifier as subtype, which was be a motivation to change of 6.
  8. Changed unit tests and added new unit tests according to this changes.

client/battle/BattleAnimationClasses.cpp Outdated Show resolved Hide resolved
lib/CTownHandler.h Outdated Show resolved Hide resolved
lib/HeroBonus.cpp Outdated Show resolved Hide resolved
@rilian-la-te rilian-la-te force-pushed the spell-mechanics-v3 branch 5 times, most recently from de3cd66 to b3ed638 Compare April 6, 2023 23:29
@Alucard648
Copy link

Will it be possible to limit teleporting for open field battles, if all paths to destination hex are blocked by obstacles and creatures?
Also hoping for placeable obstacle placing spells.

@rilian-la-te
Copy link
Contributor Author

@Alucard648 what you mean by placeable obstacle placing spells?

@Alucard648
Copy link

H5 obscacle creating spells, like Arcane Crystal, Blade Barrier, controllable quicksand/landmine spells etc. And idea for Summon elemental spell - ability to place summoned creature at chosen location.

@rilian-la-te
Copy link
Contributor Author

@Alucard648 this is not obstacles, this is an immobile creatures.

@rilian-la-te rilian-la-te force-pushed the spell-mechanics-v3 branch 3 times, most recently from fac45db to 3e34973 Compare April 8, 2023 12:30
@rilian-la-te rilian-la-te force-pushed the spell-mechanics-v3 branch 6 times, most recently from c3e492a to b3d147e Compare April 11, 2023 09:17
@rilian-la-te rilian-la-te force-pushed the spell-mechanics-v3 branch 2 times, most recently from 797a2a7 to 78a705a Compare April 19, 2023 09:36
@rilian-la-te rilian-la-te force-pushed the spell-mechanics-v3 branch 2 times, most recently from 12d772d to 5cf4b4b Compare April 26, 2023 20:21
It was almost unused, but this change is save-breaking
Replace by SPELL_DAMAGE_REDUCTION bonus with 100 value
This map should not be used, it does not have values anymore
Spells should not consider units with 100% MR as valid targets.
@rilian-la-te rilian-la-te marked this pull request as ready for review May 5, 2023 16:20
@rilian-la-te rilian-la-te changed the title Spell mechanics v3 Bonus refactoring, part3 (save-incompatible) May 5, 2023
config/artifacts.json Outdated Show resolved Hide resolved
lib/bonuses/BonusEnum.h Outdated Show resolved Hide resolved
lib/bonuses/IBonusBearer.cpp Outdated Show resolved Hide resolved
lib/bonuses/IBonusBearer.cpp Outdated Show resolved Hide resolved
lib/serializer/BinarySerializer.h Outdated Show resolved Hide resolved
lib/bonuses/BonusParams.cpp Outdated Show resolved Hide resolved
@rilian-la-te rilian-la-te force-pushed the spell-mechanics-v3 branch 2 times, most recently from ed0cd3b to d3dadce Compare May 5, 2023 18:23
lib/GameConstants.h Outdated Show resolved Hide resolved
config/battlefields.json Show resolved Hide resolved
lib/bonuses/BonusEnum.h Outdated Show resolved Hide resolved
lib/bonuses/BonusEnum.h Show resolved Hide resolved
@IvanSavenko IvanSavenko merged commit cb82018 into vcmi:develop May 9, 2023
11 checks passed
@rilian-la-te rilian-la-te deleted the spell-mechanics-v3 branch May 10, 2023 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Complex duration broken
3 participants