diff --git a/code/__DEFINES/dcs/signals/signals_global.dm b/code/__DEFINES/dcs/signals/signals_global.dm index 41c2b4b7459..5e9011f5f40 100644 --- a/code/__DEFINES/dcs/signals/signals_global.dm +++ b/code/__DEFINES/dcs/signals/signals_global.dm @@ -103,3 +103,6 @@ /// Global signal sent when narsie summon count is updated: (new count) #define COMSIG_NARSIE_SUMMON_UPDATE "!narsie_summon_update" + +/// Global signal sent when a mob is spawned from a ghost in a dynamic ruleset (mob/spawned_mob) +#define COMSIG_RULESET_BODY_GENERATED_FROM_GHOSTS "!ruleset_body_generated_from_ghosts" diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index e07e7cc64c6..474f5069227 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -118,8 +118,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_RESISTLOWPRESSURE "resist_low_pressure" /// This human is immune to the effects of being exploded. (ex_act) #define TRAIT_BOMBIMMUNE "bomb_immunity" -/// Immune to being irradiated -#define TRAIT_RADIMMUNE "rad_immunity" /// This mob won't get gibbed by nukes going off #define TRAIT_NUKEIMMUNE "nuke_immunity" /// Can't be given viruses @@ -1003,6 +1001,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// Marks that this object is irradiated #define TRAIT_IRRADIATED "iraddiated" +/// Immune to being irradiated +#define TRAIT_RADIMMUNE "rad_immunity" + /// Harmful radiation effects, the toxin damage and the burns, will not occur while this trait is active #define TRAIT_HALT_RADIATION_EFFECTS "halt_radiation_effects" diff --git a/code/controllers/subsystem/dynamic/dynamic_rulesets_midround.dm b/code/controllers/subsystem/dynamic/dynamic_rulesets_midround.dm index 387c66c6107..539e6d234c0 100644 --- a/code/controllers/subsystem/dynamic/dynamic_rulesets_midround.dm +++ b/code/controllers/subsystem/dynamic/dynamic_rulesets_midround.dm @@ -183,6 +183,7 @@ var/mob/new_character = applicant if(makeBody) new_character = generate_ruleset_body(applicant) + SEND_GLOBAL_SIGNAL(COMSIG_RULESET_BODY_GENERATED_FROM_GHOSTS, applicant) finish_setup(new_character, i) notify_ghosts( "[applicant.name] has been picked for the ruleset [name]!", diff --git a/code/datums/station_traits/negative_traits.dm b/code/datums/station_traits/negative_traits.dm index 2ce6543c112..c0950bfdd7b 100644 --- a/code/datums/station_traits/negative_traits.dm +++ b/code/datums/station_traits/negative_traits.dm @@ -570,6 +570,8 @@ /datum/station_trait/nebula/hostile/radiation/New() . = ..() + RegisterSignal(SSdcs, COMSIG_RULESET_BODY_GENERATED_FROM_GHOSTS, PROC_REF(on_spawned_mob)) + for(var/area/target as anything in get_areas(radioactive_areas)) RegisterSignal(target, COMSIG_AREA_ENTERED, PROC_REF(on_entered)) RegisterSignal(target, COMSIG_AREA_EXITED, PROC_REF(on_exited)) @@ -617,6 +619,19 @@ // The component handles its own removal +/// When a mob is spawned by dynamic, intercept and give it a little radiation shield. Only works for dynamic mobs! +/datum/station_trait/nebula/hostile/radiation/proc/on_spawned_mob(datum/source, mob/spawned_mob) + SIGNAL_HANDLER + + if(!istype(get_area(spawned_mob), radioactive_areas)) //only if you're spawned in the radioactive areas + return + + if(!isliving(spawned_mob)) // Dynamic shouldnt spawn non-living but uhhhhhhh why not + return + + var/mob/living/spawnee = spawned_mob + spawnee.apply_status_effect(/datum/status_effect/radiation_immunity/radnebula) + /datum/station_trait/nebula/hostile/radiation/apply_nebula_effect(effect_strength = 0) //big bombad now if(effect_strength > 0 && !SSmapping.is_planetary()) //admins can force this diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index 7404b1d1484..27824567a4d 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -601,3 +601,24 @@ /datum/status_effect/jump_jet/on_remove() owner.RemoveElement(/datum/element/forced_gravity, 0) + +/// Makes the mob immune to radiation for a short bit to help with safely spawning in hazardous areas +/datum/status_effect/radiation_immunity + id = "radiation_immunity" + duration = 1 MINUTES + show_duration = TRUE + +/datum/status_effect/radiation_immunity/on_apply() + ADD_TRAIT(owner, TRAIT_RADIMMUNE, type) + return TRUE + +/datum/status_effect/radiation_immunity/on_remove() + REMOVE_TRAIT(owner, TRAIT_RADIMMUNE, type) + +/datum/status_effect/radiation_immunity/radnebula + alert_type = /atom/movable/screen/alert/status_effect/radiation_immunity + +/atom/movable/screen/alert/status_effect/radiation_immunity + name = "Radiation shielding" + desc = "You're immune to radiation, get settled quick!" + icon_state = "radiation_shield" diff --git a/icons/hud/screen_alert.dmi b/icons/hud/screen_alert.dmi index d66bd0b995d..e56df056053 100644 Binary files a/icons/hud/screen_alert.dmi and b/icons/hud/screen_alert.dmi differ