Merge pull request #3364 from Citadel-Station-13/upstream-merge-30909

[MIRROR] Radiation rework and subsystem
This commit is contained in:
LetterJay
2017-10-13 23:58:04 -04:00
committed by GitHub
72 changed files with 831 additions and 336 deletions
@@ -24,6 +24,9 @@
loc = pick(GLOB.newplayer_start)
else
loc = locate(1,1,1)
ComponentInitialize()
. = ..()
/mob/dead/new_player/prepare_huds()
+22 -27
View File
@@ -1135,36 +1135,31 @@
return 0
/datum/species/proc/handle_mutations_and_radiation(mob/living/carbon/human/H)
. = FALSE
var/radiation = H.radiation
if(!(RADIMMUNE in species_traits))
if(H.radiation)
if (H.radiation > 100)
if(!H.IsKnockdown())
H.emote("collapse")
H.Knockdown(200)
to_chat(H, "<span class='danger'>You feel weak.</span>")
switch(H.radiation)
if(50 to 75)
if(prob(5))
if(!H.IsKnockdown())
H.emote("collapse")
H.Knockdown(60)
to_chat(H, "<span class='danger'>You feel weak.</span>")
if(RADIMMUNE in species_traits)
radiation = 0
return TRUE
if(prob(15))
if(!( H.hair_style == "Shaved") || !(H.hair_style == "Bald") || (HAIR in species_traits))
to_chat(H, "<span class='danger'>Your hair starts to fall out in clumps...</span>")
addtimer(CALLBACK(src, .proc/go_bald, H), 50)
if(radiation > RAD_MOB_KNOCKDOWN)
if(!H.IsKnockdown())
H.emote("collapse")
H.Knockdown(RAD_KNOCKDOWN_TIME)
to_chat(H, "<span class='danger'>You feel weak.</span>")
if(radiation > RAD_MOB_MUTATE)
if(prob(1))
to_chat(H, "<span class='danger'>You mutate!</span>")
H.randmutb()
H.emote("gasp")
H.domutcheck()
if(75 to 100)
if(prob(1))
to_chat(H, "<span class='danger'>You mutate!</span>")
H.randmutb()
H.emote("gasp")
H.domutcheck()
return 0
H.radiation = 0
return 1
if(radiation > RAD_MOB_HAIRLOSS)
if(prob(15))
if(!( H.hair_style == "Shaved") || !(H.hair_style == "Bald") || (HAIR in species_traits))
to_chat(H, "<span class='danger'>Your hair starts to fall out in clumps...</span>")
addtimer(CALLBACK(src, .proc/go_bald, H), 50)
/datum/species/proc/go_bald(mob/living/carbon/human/H)
if(QDELETED(H)) //may be called from a timer
@@ -295,7 +295,7 @@
if(!active)
if(world.time > last_event+30)
active = 1
radiation_pulse(get_turf(H), 3, 3, 5, 0)
radiation_pulse(get_turf(H), 50)
last_event = world.time
active = null
..()
+3 -18
View File
@@ -280,24 +280,9 @@
HM.force_lose(src)
dna.temporary_mutations.Remove(mut)
if(radiation)
radiation = Clamp(radiation, 0, 100)
switch(radiation)
if(0 to 50)
radiation = max(radiation-1,0)
if(prob(25))
adjustToxLoss(1)
if(50 to 75)
radiation = max(radiation-2,0)
adjustToxLoss(1)
if(prob(5))
radiation = max(radiation-5,0)
if(75 to 100)
radiation = max(radiation-3,0)
adjustToxLoss(3)
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_stomach()
set waitfor = 0
+12 -21
View File
@@ -23,32 +23,23 @@
walk_to(src,0)
/mob/living/carbon/monkey/handle_mutations_and_radiation()
if (radiation)
if (radiation > 100)
if(radiation)
if(radiation > RAD_MOB_KNOCKDOWN)
if(!IsKnockdown())
emote("collapse")
Knockdown(200)
to_chat(src, "<span class='danger'>You feel weak.</span>")
if(radiation > 30 && prob((radiation - 30) * (radiation - 30) * 0.0002))
gorillize()
return
switch(radiation)
if(radiation > RAD_MOB_MUTATE)
if(prob(1))
to_chat(src, "<span class='danger'>You mutate!</span>")
randmutb()
emote("gasp")
domutcheck()
if(50 to 75)
if(prob(5))
if(!IsKnockdown())
emote("collapse")
Knockdown(60)
to_chat(src, "<span class='danger'>You feel weak.</span>")
if(75 to 100)
if(prob(1))
to_chat(src, "<span class='danger'>You mutate!</span>")
randmutb()
emote("gasp")
domutcheck()
..()
if(radiation > RAD_MOB_MUTATE * 2 && prob(50))
gorillize()
return
return ..()
/mob/living/carbon/monkey/handle_breath_temperature(datum/gas_mixture/breath)
if(abs(310.15 - breath.temperature) > 50)
+10
View File
@@ -885,6 +885,16 @@
G.Recall()
to_chat(G, "<span class='holoparasite'>Your summoner has changed form!</span>")
/mob/living/rad_act(amount)
amount = max(amount-RAD_BACKGROUND_RADIATION, 0)
if(amount)
var/blocked = getarmor(null, "rad")
apply_effect(amount * RAD_MOB_COEFFICIENT, IRRADIATE, blocked)
if(amount > RAD_AMOUNT_EXTREME)
apply_damage((amount-RAD_AMOUNT_EXTREME)/RAD_AMOUNT_EXTREME, BURN, null, blocked)
/mob/living/proc/fakefireextinguish()
return