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

Magiclysm - spells go through pain resist #36237

Merged
merged 1 commit into from
Dec 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions data/json/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,12 @@
"context": [ "SPELL" ],
"//": "Chooses a spell at random to cast from extra_effects. See MAGIC.md for details"
},
{
"id": "PAIN_NORESIST",
"type": "json_flag",
"context": [ "SPELL" ],
"//": "pain altering spells can't be resisted (like with the deadened trait)"
},
{
"id": "NON_THRESH",
"type": "json_flag",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Magiclysm/Spells/animist.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"base_casting_time": 50000,
"base_energy_cost": 5000,
"energy_increment": 500,
"flags": [ "SOMATIC", "VERBAL" ],
"flags": [ "SOMATIC", "VERBAL", "PAIN_NORESIST" ],
"final_energy_cost": 10000
},
{
Expand Down
1 change: 1 addition & 0 deletions src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ std::string enum_to_string<spell_flag>( spell_flag data )
case spell_flag::RANDOM_DURATION: return "RANDOM_DURATION";
case spell_flag::RANDOM_TARGET: return "RANDOM_TARGET";
case spell_flag::MUTATE_TRAIT: return "MUTATE_TRAIT";
case spell_flag::PAIN_NORESIST: return "PAIN_NORESIST";
case spell_flag::WONDER: return "WONDER";
case spell_flag::LAST: break;
}
Expand Down
1 change: 1 addition & 0 deletions src/magic.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ enum spell_flag {
RANDOM_TARGET, // picks a random valid target within your range instead of normal behavior.
MUTATE_TRAIT, // overrides the mutate spell_effect to use a specific trait_id instead of a category
WONDER, // instead of casting each of the extra_spells, it picks N of them and casts them (where N is std::min( damage(), number_of_spells ))
PAIN_NORESIST, // pain altering spells can't be resisted (like with the deadened trait)
LAST
};

Expand Down
6 changes: 5 additions & 1 deletion src/magic_spell_effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,11 @@ void spell_effect::recover_energy( const spell &sp, Creature &caster, const trip
}
} else if( energy_source == "PAIN" ) {
// pain is backwards
p->mod_pain_noresist( -healing );
if( sp.has_flag( PAIN_NORESIST ) ) {
p->mod_pain_noresist( -healing );
} else {
p->mod_pain( -healing );
}
} else if( energy_source == "HEALTH" ) {
p->mod_healthy( healing );
} else {
Expand Down