-
Notifications
You must be signed in to change notification settings - Fork 90
Cleanse (cont.) #4381
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
Open
AdamPlenty
wants to merge
49
commits into
dkfans:master
Choose a base branch
from
AdamPlenty:Cleanse
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Cleanse (cont.) #4381
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
42f8314
Cleanse (cont.)
AdamPlenty 62c4d3d
Update magic.cfg
AdamPlenty d6fdf20
Update creature.cfg
AdamPlenty 7e69b91
Update creature.cfg
AdamPlenty dc526e5
Update creature.cfg
AdamPlenty 63452bf
Update thing_creature.c
AdamPlenty a8f1f8b
Update magic.cfg
AdamPlenty bfb8e0b
Update magic.cfg
AdamPlenty f738daf
Not needed.
AdamPlenty 84a9213
Update magic.cfg
AdamPlenty b3a1e09
Does this help?
AdamPlenty e4b1ce8
Update creature.cfg
AdamPlenty 7f2d06e
Now it works!
AdamPlenty b5de5da
Set Spell Block flags.
AdamPlenty a066fc9
Not needed.
AdamPlenty 76e70e9
Update thing_creature.c
AdamPlenty e306d89
Fixed immediate termination
AdamPlenty 2f396b1
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty d5bb9a0
Block spells
AdamPlenty bcfc8fa
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty d214e82
Take spell from instance info
AdamPlenty c76fa1d
User param1 for validation spell id
AdamPlenty 4991e53
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty 2491866
cleanse_flags creature control field
AdamPlenty cab24e6
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty c555929
Don't cure or block MAD_KILLING or TIMEBOMB
AdamPlenty 1014206
Fixed icon positioning.
AdamPlenty 7b7de8b
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty 152c121
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty a18b676
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty 876dcda
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty 833a329
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty f378774
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty a389514
Merge branch 'master' into pr/4381
Loobinex 0684839
Creatures self-Cleanse for Freeze
AdamPlenty 3ef74aa
Make it configurable
AdamPlenty 09dae08
Update creature.cfg
AdamPlenty 6c25992
Update creature.cfg
AdamPlenty edbff96
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty 3be44c5
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty 2c4000d
Merge branch 'master' into pr/4381
Loobinex 038ee65
Configurable effect
AdamPlenty ad60ec1
Purple stars effect
AdamPlenty 0ebae48
Update effects.toml
AdamPlenty 803e7e4
Update magic.cfg
AdamPlenty 81ebe35
Update effects.toml
AdamPlenty b5b1d6c
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty 96c4989
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty 7d4fb35
Merge remote-tracking branch 'upstream/master' into Cleanse
AdamPlenty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,6 +126,7 @@ const struct NamedCommand creature_instances_validate_func_type[] = { | |
| {"validate_target_benefits_from_wind", 10}, | ||
| {"validate_target_non_idle", 11}, | ||
| {"validate_target_takes_gas_damage", 12}, | ||
| {"validate_target_requires_cleansing", 13}, | ||
| {NULL, 0}, | ||
| }; | ||
|
|
||
|
|
@@ -143,6 +144,7 @@ Creature_Validate_Func creature_instances_validate_func_list[] = { | |
| validate_target_benefits_from_wind, | ||
| validate_target_non_idle, | ||
| validate_target_takes_gas_damage, | ||
| validate_target_requires_cleansing, | ||
| NULL, | ||
| }; | ||
|
|
||
|
|
@@ -1146,14 +1148,18 @@ TbBool validate_source_basic | |
|
|
||
| if (!creature_instance_is_available(source, inst_idx) || | ||
| !creature_instance_has_reset(source, inst_idx) || | ||
| creature_under_spell_effect(source, CSAfF_Freeze) || | ||
| creature_is_fleeing_combat(source) || creature_under_spell_effect(source, CSAfF_Chicken) || | ||
| creature_is_being_unconscious(source) || creature_is_dying(source) || | ||
| thing_is_picked_up(source) || creature_is_being_dropped(source) || | ||
| creature_is_being_sacrificed(source) || creature_is_being_summoned(source)) | ||
| { | ||
| return false; | ||
| } | ||
| if (creature_under_spell_effect(source, CSAfF_Freeze)) | ||
| { | ||
| struct InstanceInfo* inst_inf = creature_instance_info_get(inst_idx); | ||
| return flag_is_set(inst_inf->instance_property_flags, InstPF_AllowWhileFrozen); | ||
| } | ||
|
|
||
| return true; | ||
| } | ||
|
|
@@ -1825,4 +1831,37 @@ void script_set_creature_instance(ThingModel crmodel, short slot, int instance, | |
| } | ||
| } | ||
|
|
||
| TbBool validate_target_requires_cleansing | ||
| ( | ||
| struct Thing *source, | ||
| struct Thing *target, | ||
| CrInstance inst_idx, | ||
| int32_t param1, | ||
| int32_t param2 | ||
| ) | ||
| { | ||
| if (!validate_target_basic(source, target, inst_idx, param1, param2) || creature_is_being_unconscious(target) || | ||
| !creature_requires_cleansing(target, param1)) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| if (source->index == target->index) | ||
| { | ||
| // Special case. The creature is always allowed to cleanse itself even if | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't think creatures being tortured should use this. |
||
| // it's being tortured or imprisoned. | ||
| return true; | ||
| } | ||
| else | ||
| { | ||
| if (creature_is_being_tortured(target) || creature_is_kept_in_prison(target) || | ||
| creature_is_being_tortured(source) || creature_is_kept_in_prison(source)) | ||
| { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| return true; | ||
| } | ||
|
|
||
| /******************************************************************************/ | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.