Skip to content

Commit

Permalink
Rad Mutate Event
Browse files Browse the repository at this point in the history
  • Loading branch information
Maleclypse committed Jun 16, 2024
1 parent a9d18c8 commit c23796e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ std::string enum_to_string<event_type>( event_type data )
case event_type::player_fails_conduct: return "player_fails_conduct";
case event_type::player_gets_achievement: return "player_gets_achievement";
case event_type::player_levels_spell: return "player_levels_spell";
case event_type::rad_mutate: return "rad_mutate";
case event_type::reads_book: return "reads_book";
case event_type::releases_subspace_specimens: return "releases_subspace_specimens";
case event_type::removes_cbm: return "removes_cbm";
Expand Down Expand Up @@ -206,6 +207,7 @@ DEFINE_EVENT_FIELDS( opens_spellbook )
DEFINE_EVENT_FIELDS( player_fails_conduct )
DEFINE_EVENT_FIELDS( player_gets_achievement )
DEFINE_EVENT_FIELDS( player_levels_spell )
DEFINE_EVENT_FIELDS( rad_mutate )
DEFINE_EVENT_FIELDS( removes_cbm )
DEFINE_EVENT_FIELDS( spellcasting_finish )
DEFINE_EVENT_FIELDS( telefrags_creature )
Expand Down
1 change: 1 addition & 0 deletions src/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ enum class event_type : int {
player_levels_spell,
reads_book,
releases_subspace_specimens,
rad_mutate,
removes_cbm,
seals_hazardous_material_sarcophagus,
spellcasting_finish,
Expand Down
2 changes: 1 addition & 1 deletion src/suffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ void suffer::from_radiation( Character &you )
// 1000 rads = 900 / 10000 = 9 / 100 = 10% !!!
// 2000 rads = 2000 / 10000 = 1 / 5 = 20% !!!
if( get_option<bool>( "RAD_MUTATION" ) && rng( 100, 10000 ) < you.get_rad() ) {
you.mutate();
get_event_bus().send<event_type::rad_mutate>( getID(), bp );
}
if( you.get_rad() > 50 && rng( 1, 3000 ) < you.get_rad() &&
( you.stomach.contains() > 0_ml || radiation_increasing || !you.in_sleep_state() ) ) {
Expand Down

0 comments on commit c23796e

Please sign in to comment.