Skip to content

Commit

Permalink
hhhhh
Browse files Browse the repository at this point in the history
  • Loading branch information
XeonMations committed Sep 6, 2024
1 parent 85ae885 commit 4a79a65
Show file tree
Hide file tree
Showing 15 changed files with 96 additions and 177 deletions.
28 changes: 0 additions & 28 deletions code/game/objects/items/devices/geiger_counter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions code/modules/antagonists/revenant/revenant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand Down
25 changes: 13 additions & 12 deletions code/modules/mob/living/carbon/human/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<span class='danger'>You feel weak.</span>")

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, "<span class='danger'>You mutate!</span>")
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, "<span class='danger'>Your hair starts to fall out in clumps.</span>")
addtimer(CALLBACK(src, PROC_REF(go_bald), H), 50)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
..()
Expand Down
71 changes: 35 additions & 36 deletions code/modules/mob/living/carbon/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
31 changes: 0 additions & 31 deletions code/modules/mob/living/carbon/monkey/life.dm
Original file line number Diff line number Diff line change
@@ -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, "<span class='danger'>You feel weak.</span>")
if(radiation > RAD_MOB_MUTATE)
if(prob(2))
to_chat(src, "<span class='danger'>You mutate!</span>")
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())
Expand Down
6 changes: 1 addition & 5 deletions code/modules/mob/living/damage_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions code/modules/mob/living/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
16 changes: 0 additions & 16 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1150,21 +1149,6 @@
for(var/holopara in holoparasites())
to_chat(holopara, "<span class='holoparasite'>Your summoner has changed form!</span>")

/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(.)
Expand Down
2 changes: 0 additions & 2 deletions code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/silicon/robot/robot_modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit 4a79a65

Please sign in to comment.