Skip to content

Commit

Permalink
Merge pull request #36237 from KorGgenT/nopain
Browse files Browse the repository at this point in the history
Magiclysm - spells go through pain resist
  • Loading branch information
ZhilkinSerg authored Dec 19, 2019
2 parents 15dec8b + 89b2155 commit 09785f5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
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

0 comments on commit 09785f5

Please sign in to comment.