diff --git a/code/game/objects/items/devices/geiger_counter.dm b/code/game/objects/items/devices/geiger_counter.dm index 31a3580e0d093..3751e54295a09 100644 --- a/code/game/objects/items/devices/geiger_counter.dm +++ b/code/game/objects/items/devices/geiger_counter.dm @@ -107,34 +107,6 @@ update_icon() return TRUE -/obj/item/geiger_counter/cyborg - var/mob/listeningTo - -/obj/item/geiger_counter/cyborg/cyborg_unequip(mob/user) - if(!scanning) - return - scanning = FALSE - update_icon() - -/obj/item/geiger_counter/cyborg/equipped(mob/user) - . = ..() - if(listeningTo == user) - return - if(listeningTo) - UnregisterSignal(listeningTo, COMSIG_ATOM_RAD_ACT) - RegisterSignal(user, COMSIG_ATOM_RAD_ACT, PROC_REF(redirect_rad_act)) - listeningTo = user - -/obj/item/geiger_counter/cyborg/proc/redirect_rad_act(datum/source, amount) - SIGNAL_HANDLER - - rad_act(amount) - -/obj/item/geiger_counter/cyborg/dropped() - ..() - if(listeningTo) - UnregisterSignal(listeningTo, COMSIG_ATOM_RAD_ACT) - #undef RAD_LEVEL_NORMAL #undef RAD_LEVEL_MODERATE #undef RAD_LEVEL_HIGH diff --git a/code/modules/antagonists/revenant/revenant.dm b/code/modules/antagonists/revenant/revenant.dm index b6e68b0a9167e..3939d23832130 100644 --- a/code/modules/antagonists/revenant/revenant.dm +++ b/code/modules/antagonists/revenant/revenant.dm @@ -227,9 +227,6 @@ return BULLET_ACT_FORCE_PIERCE return ..() -/mob/living/simple_animal/revenant/rad_act(amount) - return - //damage, gibbing, and dying /mob/living/simple_animal/revenant/attackby(obj/item/W, mob/living/user, params) . = ..() diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 923ccb3a61634..bc3b30905b78c 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1490,31 +1490,32 @@ GLOBAL_LIST_EMPTY(features_by_species) /datum/species/proc/update_health_hud(mob/living/carbon/human/H) return 0 -/datum/species/proc/handle_mutations_and_radiation(mob/living/carbon/human/H) - . = FALSE - var/radiation = H.radiation - - if(HAS_TRAIT(H, TRAIT_RADIMMUNE)) - radiation = 0 - return TRUE - - if(radiation > RAD_MOB_KNOCKDOWN && prob(RAD_MOB_KNOCKDOWN_PROB)) +/** + * Species based handling for irradiation + * + * Arguments: + * - [source][/mob/living/carbon/human]: The mob requesting handling + * - time_since_irradiated: The amount of time since the mob was first irradiated + * - delta_time: The amount of time that has passed since the last tick + */ +/datum/species/proc/handle_radiation(mob/living/carbon/human/source, time_since_irradiated, delta_time) + if(time_since_irradiated > RAD_MOB_KNOCKDOWN && DT_PROB(RAD_MOB_KNOCKDOWN_PROB, delta_time)) if(!H.IsParalyzed()) H.emote("collapse") H.Paralyze(RAD_MOB_KNOCKDOWN_AMOUNT) to_chat(H, "You feel weak.") - if(radiation > RAD_MOB_VOMIT && prob(RAD_MOB_VOMIT_PROB)) + if(time_since_irradiated > RAD_MOB_VOMIT && prob(RAD_MOB_VOMIT_PROB)) H.vomit(10, TRUE) - if(radiation > RAD_MOB_MUTATE) + if(time_since_irradiated > RAD_MOB_MUTATE) if(prob(1)) to_chat(H, "You mutate!") H.easy_randmut(NEGATIVE+MINOR_NEGATIVE) H.emote("gasp") H.domutcheck() - if(radiation > RAD_MOB_HAIRLOSS) + if(time_since_irradiated > RAD_MOB_HAIRLOSS) if(prob(15) && !(H.hair_style == "Bald") && (HAIR in species_traits) && !HAS_TRAIT(H, TRAIT_NOHAIRLOSS)) to_chat(H, "Your hair starts to fall out in clumps.") addtimer(CALLBACK(src, PROC_REF(go_bald), H), 50) diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm index 21bcb156c3068..da26f5a5a6b18 100644 --- a/code/modules/mob/living/carbon/human/species_types/golems.dm +++ b/code/modules/mob/living/carbon/human/species_types/golems.dm @@ -373,7 +373,7 @@ if(!active) if(world.time > last_event+30) active = 1 - radiation_pulse(H, 50) + radiation_pulse(H, max_range = 1, threshold = RAD_VERY_LIGHT_INSULATION, chance = 3) last_event = world.time active = null ..() diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 7ad738ff2a83a..2d0eb59211d37 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -257,11 +257,6 @@ else if(bz_partialpressure > 0.01) hallucination += 5 - //TRITIUM - if(breath.get_moles(GAS_TRITIUM)) - var/tritium_partialpressure = (breath.get_moles(GAS_TRITIUM)/breath.total_moles())*breath_pressure - radiation += tritium_partialpressure/10 - //NITRYL if(breath.get_moles(GAS_NITRYL)) var/nitryl_partialpressure = (breath.get_moles(GAS_NITRYL)/breath.total_moles())*breath_pressure @@ -333,38 +328,42 @@ if(stat != DEAD || D.process_dead) D.stage_act() -/mob/living/carbon/handle_mutations_and_radiation() - if(dna && dna.temporary_mutations.len) - for(var/mut in dna.temporary_mutations) - if(dna.temporary_mutations[mut] < world.time) - if(mut == UI_CHANGED) - if(dna.previous["UI"]) - dna.uni_identity = merge_text(dna.uni_identity,dna.previous["UI"]) - updateappearance(mutations_overlay_update=1) - dna.previous.Remove("UI") - dna.temporary_mutations.Remove(mut) - continue - if(mut == UE_CHANGED) - if(dna.previous["name"]) - real_name = dna.previous["name"] - name = real_name - dna.previous.Remove("name") - if(dna.previous["UE"]) - dna.unique_enzymes = dna.previous["UE"] - dna.previous.Remove("UE") - if(dna.previous["blood_type"]) - dna.blood_type = dna.previous["blood_type"] - dna.previous.Remove("blood_type") - dna.temporary_mutations.Remove(mut) - continue - for(var/datum/mutation/HM as() in dna.mutations) - if(HM?.timed) - dna.remove_mutation(HM.type) - - radiation -= min(radiation, RAD_LOSS_PER_TICK) - if(radiation > RAD_MOB_SAFE) - adjustToxLoss(log(radiation-RAD_MOB_SAFE)*RAD_TOX_COEFFICIENT) +/mob/living/carbon/handle_mutations(time_since_irradiated, delta_time, times_fired) + if(!dna?.temporary_mutations.len) + return + for(var/mut in dna.temporary_mutations) + if(dna.temporary_mutations[mut] < world.time) + if(mut == UI_CHANGED) + if(dna.previous["UI"]) + dna.unique_identity = merge_text(dna.unique_identity,dna.previous["UI"]) + updateappearance(mutations_overlay_update=1) + dna.previous.Remove("UI") + dna.temporary_mutations.Remove(mut) + continue + if(mut == UF_CHANGED) + if(dna.previous["UF"]) + dna.unique_features = merge_text(dna.unique_features,dna.previous["UF"]) + updateappearance(mutcolor_update=1, mutations_overlay_update=1) + dna.previous.Remove("UF") + dna.temporary_mutations.Remove(mut) + continue + if(mut == UE_CHANGED) + if(dna.previous["name"]) + real_name = dna.previous["name"] + name = real_name + dna.previous.Remove("name") + if(dna.previous["UE"]) + dna.unique_enzymes = dna.previous["UE"] + dna.previous.Remove("UE") + if(dna.previous["blood_type"]) + dna.blood_type = dna.previous["blood_type"] + dna.previous.Remove("blood_type") + dna.temporary_mutations.Remove(mut) + continue + for(var/datum/mutation/human/HM in dna.mutations) + if(HM?.timed) + dna.remove_mutation(HM.type) /* Alcohol Poisoning Chart diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 752f12d8cfb1c..999662a592c71 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -1,36 +1,5 @@ /mob/living/carbon/monkey -/mob/living/carbon/monkey/handle_mutations_and_radiation() - if(radiation) - if(radiation > RAD_MOB_KNOCKDOWN && prob(RAD_MOB_KNOCKDOWN_PROB)) - if(!IsParalyzed()) - emote("collapse") - Paralyze(RAD_MOB_KNOCKDOWN_AMOUNT) - to_chat(src, "You feel weak.") - if(radiation > RAD_MOB_MUTATE) - if(prob(2)) - to_chat(src, "You mutate!") - easy_randmut(NEGATIVE+MINOR_NEGATIVE) - emote("gasp") - domutcheck() - - if(radiation > RAD_MOB_MUTATE * 1.5) - switch(rand(1, 3)) - if(1) - gorillize() - if(2) - humanize(TR_KEEPITEMS | TR_KEEPVIRUS | TR_DEFAULTMSG | TR_KEEPDAMAGE | TR_KEEPORGANS) - if(3) - var/obj/item/bodypart/BP = pick(bodyparts) - if(BP.body_part != HEAD && BP.body_part != CHEST) - if(BP.dismemberable) - BP.dismember() - take_bodypart_damage(100, 0, 0) - return - if(radiation > RAD_MOB_VOMIT && prob(RAD_MOB_VOMIT_PROB)) - vomit(10, TRUE) - return ..() - /mob/living/carbon/monkey/handle_breath_temperature(datum/gas_mixture/breath) if(abs(get_body_temp_normal() - breath.return_temperature()) > 50) switch(breath.return_temperature()) diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 33b6207fb00a7..9f412fe11f272 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -96,8 +96,6 @@ Immobilize(effect * hit_percent) if(EFFECT_UNCONSCIOUS) Unconscious(effect * hit_percent) - if(EFFECT_IRRADIATE) - radiation += max(effect * hit_percent, 0) if(EFFECT_SLUR) slurring = max(slurring,(effect * hit_percent)) if(EFFECT_STUTTER) @@ -113,7 +111,7 @@ return 1 -/mob/living/proc/apply_effects(stun = 0, knockdown = 0, unconscious = 0, irradiate = 0, slur = 0, stutter = 0, eyeblur = 0, drowsy = 0, blocked = FALSE, stamina = 0, jitter = 0, paralyze = 0, immobilize = 0) +/mob/living/proc/apply_effects(stun = 0, knockdown = 0, unconscious = 0, slur = 0, stutter = 0, eyeblur = 0, drowsy = 0, blocked = FALSE, stamina = 0, jitter = 0, paralyze = 0, immobilize = 0) if(blocked >= 100) return BULLET_ACT_BLOCK if(stun) @@ -126,8 +124,6 @@ apply_effect(paralyze, EFFECT_PARALYZE, blocked) if(immobilize) apply_effect(immobilize, EFFECT_IMMOBILIZE, blocked) - if(irradiate) - apply_effect(irradiate, EFFECT_IRRADIATE, blocked) if(slur) apply_effect(slur, EFFECT_SLUR, blocked) if(stutter) diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index b98d460e29a1f..aef47ba35afac 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -16,7 +16,7 @@ if(stat != DEAD) //Mutations and radiation - handle_mutations_and_radiation() + handle_mutations(delta_time, times_fired) if(stat != DEAD) //Breathing, if applicable @@ -62,8 +62,7 @@ SEND_SIGNAL(src, COMSIG_LIVING_HANDLE_BREATHING, SSMOBS_DT, times_fired) //Bee edit: Holy shit I do not want to port delta time Life() refactor just for my mothroach behavior to be better return -/mob/living/proc/handle_mutations_and_radiation() - radiation = 0 //so radiation don't accumulate in simple animals +/mob/living/proc/handle_mutations(delta_time, times_fired) return /mob/living/proc/handle_diseases() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index cf15ae9ef633e..fc110f00be59e 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -706,7 +706,6 @@ SetImmobilized(0, FALSE) SetParalyzed(0, FALSE) SetSleeping(0, FALSE) - radiation = 0 set_nutrition(NUTRITION_LEVEL_FED + 50) bodytemperature = get_body_temp_normal(apply_change=FALSE) set_blindness(0) @@ -1150,21 +1149,6 @@ for(var/holopara in holoparasites()) to_chat(holopara, "Your summoner has changed form!") -/mob/living/rad_act(amount) - . = ..() - - if(!amount || (amount < RAD_MOB_SKIN_PROTECTION) || HAS_TRAIT(src, TRAIT_RADIMMUNE)) - return - - amount -= RAD_BACKGROUND_RADIATION // This will always be at least 1 because of how skin protection is calculated - - var/blocked = getarmor(null, RAD) - - if(amount > RAD_BURN_THRESHOLD) - apply_damage((amount-RAD_BURN_THRESHOLD)/RAD_BURN_THRESHOLD, BURN, null, blocked) - - apply_effect((amount*RAD_MOB_COEFFICIENT)/max(1, (radiation**2)*RAD_OVERDOSE_REDUCTION), EFFECT_IRRADIATE, blocked) - /mob/living/anti_magic_check(magic = TRUE, holy = FALSE, major = TRUE, self = FALSE) . = ..() if(.) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 3e02d5a4e4875..995738327d0e3 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -349,8 +349,6 @@ return ..() -//Looking for irradiate()? It's been moved to radiation.dm under the rad_act() for mobs. - /mob/living/acid_act(acidpwr, acid_volume) take_bodypart_damage(acidpwr * min(1, acid_volume * 0.1)) return 1 diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index b8c67e9328cfe..aed77dca1ced9 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -134,7 +134,6 @@ var/can_be_held = FALSE //whether this can be picked up and held. var/worn_slot_flags = NONE //if it can be held, can it be equipped to any slots? (think pAI's on head) - var/radiation = 0 //If the mob is irradiated. var/ventcrawl_layer = PIPING_LAYER_DEFAULT var/losebreath = 0 diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 7030ffef05079..c3c9c014f0bf6 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -316,7 +316,6 @@ /obj/item/multitool/cyborg, /obj/item/t_scanner, /obj/item/analyzer, - /obj/item/geiger_counter/cyborg, /obj/item/assembly/signaler/cyborg, /obj/item/areaeditor/blueprints/cyborg, /obj/item/electroadaptive_pseudocircuit, diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index 3efa5dc72c48b..d24467970232d 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -26,6 +26,9 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne move_resist = INFINITY use_power = NO_POWER_USE resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF + + var/datum/proximity_monitor/advanced/gravity/gravity_field + var/sprite_number = 0 var/ztrait //Set to a valid ZTRAIT define to have the gravgen provide gravity to all of the zlevels with said trait. Ex: ZTRAIT_STATION @@ -139,6 +142,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne O.main_part = null if(!QDESTROYING(O)) qdel(O) + QDEL_NULL(gravity_field) return ..() /obj/machinery/gravity_generator/main/proc/setup_parts() @@ -173,7 +177,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne charge_count = 0 breaker = 0 set_power() - set_state(0) + disable() investigate_log("has broken down.", INVESTIGATE_GRAVITY) /obj/machinery/gravity_generator/main/set_fix() @@ -290,30 +294,44 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne investigate_log("is now [charging_state == POWER_UP ? "charging" : "discharging"].", INVESTIGATE_GRAVITY) update_appearance() -// Set the state of the gravity. -/obj/machinery/gravity_generator/main/proc/set_state(new_state) +/obj/machinery/gravity_generator/main/proc/enable() charging_state = POWER_IDLE - on = new_state - use_power = on ? ACTIVE_POWER_USE : IDLE_POWER_USE - // Sound the alert if gravity was just enabled or disabled. - var/alert = FALSE - if(SSticker.IsRoundInProgress()) - if(on) // If we turned on and the game is live. - if(gravity_in_level() == 0) - alert = 1 - investigate_log("was brought online and is now producing gravity for this level.", INVESTIGATE_GRAVITY) - message_admins("The gravity generator was brought online [ADMIN_VERBOSEJMP(src)]") - else - if(gravity_in_level() == 1) - alert = 1 - investigate_log("was brought offline and there is now no gravity for this level.", INVESTIGATE_GRAVITY) - message_admins("The gravity generator was brought offline with no backup generator. [ADMIN_VERBOSEJMP(src)]") + on = TRUE + update_use_power(ACTIVE_POWER_USE) + + if (!SSticker.IsRoundInProgress()) + return + + soundloop.start() + if (!gravity_in_level()) + investigate_log("was brought online and is now producing gravity for this level.", INVESTIGATE_GRAVITY) + message_admins("The gravity generator was brought online [ADMIN_VERBOSEJMP(src)]") + shake_everyone() + gravity_field = make_field(/datum/proximity_monitor/advanced/gravity, list("current_range" = 2, "host" = src, "gravity_value" = 6)) + + complete_state_update() + +/obj/machinery/gravity_generator/main/proc/disable() + charging_state = POWER_IDLE + on = FALSE + update_use_power(IDLE_POWER_USE) + + if (!SSticker.IsRoundInProgress()) + return + + soundloop.stop() + if (gravity_in_level()) + investigate_log("was brought offline and there is now no gravity for this level.", INVESTIGATE_GRAVITY) + message_admins("The gravity generator was brought offline with no backup generator. [ADMIN_VERBOSEJMP(src)]") + shake_everyone() + QDEL_NULL(gravity_field) + complete_state_update() + +/obj/machinery/gravity_generator/main/proc/complete_state_update() update_appearance() update_list() - ui_update() - if(alert) - shake_everyone() + updateUsrDialog() // Charge/Discharge and turn on/off gravity when you reach 0/100 percent. // Also emit radiation and handle the overlays. @@ -322,9 +340,9 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne return if(charging_state != POWER_IDLE) if(charging_state == POWER_UP && charge_count >= 100) - set_state(1) + enable() else if(charging_state == POWER_DOWN && charge_count <= 0) - set_state(0) + disable() else if(charging_state == POWER_UP) charge_count += 2 @@ -334,9 +352,6 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne if(charge_count % 4 == 0 && prob(75)) // Let them know it is charging/discharging. playsound(src.loc, 'sound/effects/empulse.ogg', 100, 1) - if(prob(25)) // To help stop "Your clothes feel warm." spam. - pulse_radiation() - var/overlay_state = null switch(charge_count) if(0 to 20) @@ -357,10 +372,6 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne middle.add_overlay(overlay_state) current_overlay = overlay_state - -/obj/machinery/gravity_generator/main/proc/pulse_radiation() - radiation_pulse(src, 200) - // Shake everyone on the z level to let them know that gravity was enagaged/disenagaged. /obj/machinery/gravity_generator/main/proc/shake_everyone() var/turf/T = get_turf(src) @@ -411,8 +422,8 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne name = "paper- 'Generate your own gravity!'" default_raw_text = {"

Gravity Generator Instructions For Dummies

Surprisingly, gravity isn't that hard to make! All you have to do is inject deadly radioactive minerals into a ball of - energy and you have yourself gravity! You can turn the machine on or off when required but you must remember that the generator - will EMIT RADIATION when charging or discharging, you can tell it is charging or discharging by the noise it makes, so please WEAR PROTECTIVE CLOTHING.

+ energy and you have yourself gravity! You can turn the machine on or off when required. + The generator produces a very harmful amount of gravity when enabled, so don't stay close for too long.


It blew up!

Don't panic! The gravity generator was designed to be easily repaired. If, somehow, the sturdy framework did not survive then diff --git a/code/modules/power/rtg.dm b/code/modules/power/rtg.dm index efae8a5f0f977..4f27887fd4bdb 100644 --- a/code/modules/power/rtg.dm +++ b/code/modules/power/rtg.dm @@ -17,8 +17,6 @@ var/power_gen = 1000 // Enough to power a single APC. 4000 output with T4 capacitor. - var/irradiate = TRUE // RTGs irradiate surroundings, but only when panel is open. - /obj/machinery/power/rtg/Initialize(mapload) . = ..() connect_to_network() @@ -26,8 +24,6 @@ /obj/machinery/power/rtg/process() ..() add_avail(power_gen) - if(panel_open && irradiate) - radiation_pulse(src, 60) /obj/machinery/power/rtg/RefreshParts() var/part_level = 0 @@ -63,7 +59,6 @@ desc = "An alien power source that produces energy seemingly out of nowhere." circuit = /obj/item/circuitboard/machine/abductor/core power_gen = 20000 // 280 000 at T1, 400 000 at T4. Starts at T4. - irradiate = FALSE // Green energy! can_buckle = FALSE pixel_y = 7 var/going_kaboom = FALSE // Is it about to explode? diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 42b7bc6dfc2b9..f1ee75c92e7c0 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -288,7 +288,7 @@ else L.log_message("has been shot by [firer] with [src]", LOG_ATTACK, color="orange") - return L.apply_effects(stun, knockdown, unconscious, irradiate, slur, stutter, eyeblur, drowsy, blocked, stamina, jitter, paralyze, immobilize) + return L.apply_effects(stun, knockdown, unconscious, slur, stutter, eyeblur, drowsy, blocked, stamina, jitter, paralyze, immobilize) /obj/projectile/proc/vol_by_damage() if(src.damage)