diff --git a/src/event.cpp b/src/event.cpp index ae050638c1aa1..b39c216829033 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -103,6 +103,7 @@ std::string enum_to_string( 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"; @@ -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 ) diff --git a/src/event.h b/src/event.h index 6e2fb2990e07b..68399dc8e7398 100644 --- a/src/event.h +++ b/src/event.h @@ -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, diff --git a/src/suffer.cpp b/src/suffer.cpp index 05e2626e276df..1248061d3d12e 100644 --- a/src/suffer.cpp +++ b/src/suffer.cpp @@ -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( "RAD_MUTATION" ) && rng( 100, 10000 ) < you.get_rad() ) { - you.mutate(); + get_event_bus().send( getID(), bp ); } if( you.get_rad() > 50 && rng( 1, 3000 ) < you.get_rad() && ( you.stomach.contains() > 0_ml || radiation_increasing || !you.in_sleep_state() ) ) {