Skip to content

Commit

Permalink
Sugar kins are immune to radiations
Browse files Browse the repository at this point in the history
  • Loading branch information
Fris0uman committed Dec 30, 2019
1 parent 5d9879a commit 76f7f28
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion data/mods/My_Sweet_Cataclysm/sweet_mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"allowed_category": [ "SUGAR" ],
"no_cbm_on_bp": [ "TORSO", "HEAD", "EYES", "MOUTH", "ARM_L", "ARM_R", "HAND_L", "HAND_R", "LEG_L", "LEG_R", "FOOT_L", "FOOT_R" ],
"armor": [ { "parts": "ALL", "cut": 10, "bash": 5 } ],
"flags": [ "NO_THIRST", "NO_DISEASE" ]
"flags": [ "NO_THIRST", "NO_DISEASE", "NO_RADIATION" ]
}
]
3 changes: 2 additions & 1 deletion doc/JSON_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,9 @@ Also see `monster_attacks.json` for more special attacks, for example, impale an
- ```UNARMED_BONUS``` You get a bonus to unarmed bash and cut damage equal to unarmed_skill/2 up to 4.
- ```NEED_ACTIVE_TO_MELEE``` This mutation gives bonus to unarmed melee only if it's active.
- ```NO_DISEASE``` This mutation grants immunity to disease.
- ```NO_DISEASE``` This mutation grants immunity to diseases.
- ```NO_THIRST``` Your thirst is not modified by food or drinks.
- ```NO_RADIATION``` This mutation grants immunity to radiations.
### Categories
Expand Down
5 changes: 4 additions & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5312,7 +5312,10 @@ void Character::set_rad( int new_rad )

void Character::mod_rad( int mod )
{
radiation += mod;
if( has_trait_flag( "NO_RADIATION" ) ) {
return;
}
set_rad( std::max( 0, get_rad() + mod ) );
}

int Character::get_stamina() const
Expand Down
2 changes: 1 addition & 1 deletion src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2832,7 +2832,7 @@ void player::regen( int rate_multiplier )
}

if( get_rad() > 0 ) {
set_rad( std::max( 0, get_rad() - roll_remainder( rate_multiplier / 50.0f ) ) );
mod_rad( -roll_remainder( rate_multiplier / 50.0f ) );
}
}

Expand Down

0 comments on commit 76f7f28

Please sign in to comment.