-
Notifications
You must be signed in to change notification settings - Fork 81
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
Spell Flags Refactor #3751
Merged
Merged
Spell Flags Refactor #3751
+2,501
−1,560
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The previous explanation was incorrect. While it's still not entirely accurate, 'CastAtThing' has become quite ambiguous, and its behavior depends on the configuration at the instance level. 'SelfCasted' is used for sound effects, and there's also a condition that checks the first argument when casting spells on creatures with a script command.
walt253
commented
Dec 11, 2024
Forgot to remove it from this struct.
walt253
commented
Dec 11, 2024
walt253
commented
Dec 11, 2024
walt253
commented
Dec 11, 2024
walt253
commented
Dec 11, 2024
walt253
commented
Dec 11, 2024
walt253
commented
Dec 11, 2024
walt253
commented
Dec 11, 2024
walt253
commented
Dec 11, 2024
Should now be working fine with partial config.
walt253
commented
Dec 12, 2024
walt253
commented
Dec 12, 2024
walt253
commented
Dec 12, 2024
walt253
commented
Dec 12, 2024
walt253
commented
Dec 12, 2024
walt253
commented
Dec 12, 2024
walt253
commented
Dec 12, 2024
walt253
commented
Dec 12, 2024
walt253
commented
Dec 12, 2024
walt253
commented
Dec 12, 2024
walt253
commented
Dec 12, 2024
walt253
commented
Dec 12, 2024
walt253
commented
Dec 12, 2024
(<= 0 or > LONG_MAX)
<= 0 was incorrect
I guess we only need to check < 0 + fix script error log to use correct %ld
Loobinex
reviewed
Jan 3, 2025
Loobinex
reviewed
Jan 3, 2025
Loobinex
reviewed
Jan 4, 2025
62a54db
to
bf2a08e
Compare
if it matches the default
bf2a08e
to
7666302
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors the spell flags logic and introduces a number of improvements:
Custom Spells: It now supports custom Freeze, Heal, and Teleport spells. You can also truly combine multiple spell flags.
Refactored AreaAffectType: No longer hardcoded to Slow or Disease. The introduced
SpellEffect
field allows Gas to inflict various statuses on enemies or allies that aren't immune.Spell Immunity: A new field in creature configuration files allows creatures to be immune to specific spell flags.
SpellFlags Accept Names:
SpellFlags
now accept names rather than numbers, making it easier to understand and configure.Freeze Prisoners: No longer hardcoded to a specific instance. The freezer will now look for an appropriate instance that can freeze and use it.
Disease Improvement: Disease now has a new feature where it can spread the last active spell that inflicted it. For example, combining Disease + Chicken will spread both statuses.
Refactored Magic Use Powers:
magic_use_power_heal
,magic_use_power_timebomb
,magic_use_power_chicken
, andmagic_use_power_disease
have been merged intomagic_use_power_apply_spell
, which checks for immunities.Deprecated:
IMMUNE_TO_GAS
,UNAFFECTED_BY_WIND
,IMMUNE_TO_DISEASE
, andNEVER_CHICKENS
are deprecated. However, they are still supported for backward compatibility in theNamedCommand
and will work with config or script commands, but their flags have been removed. All configs in the project have been updated accordingly.Moved Flags:
MagicFall
andGrounded
flags were removed from the spell flags.MagicFall
is specifically for creature creation via the hero gate or summons, whileGrounded
is only used by Freeze against flying creatures. These flags have been moved tomovement_flags
.This PR is large, so it will require thorough review and testing. I've tested the changes a bit, but the goal now is to identify any edge cases I might have missed or broken something else. I've left few comments on few parts of the code I've changed but I will add more to the PR itself to make it easier to review.