From 3a1ea41ff266447d73801d0439b295b1701d114e Mon Sep 17 00:00:00 2001 From: Spamcat Date: Fri, 5 Jul 2013 04:39:57 +0400 Subject: [PATCH] Moar machinery. --- code/game/machinery/Sleeper.dm | 3 +++ code/game/machinery/cryo.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 24 ++++++++++++++++++- code/modules/mob/living/carbon/human/human.dm | 22 +---------------- code/modules/mob/living/carbon/human/life.dm | 2 +- 5 files changed, 29 insertions(+), 24 deletions(-) diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 5c53d4ce8bb..9f9ff56f780 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -61,6 +61,9 @@ t1 = "*dead*" else dat += text("[]\tHealth %: [] ([])
", (occupant.health > 50 ? "" : ""), occupant.health, t1) + if(iscarbon(occupant)) + var/mob/living/carbon/C = occupant + dat += text("[]\t-Pulse, bpm: []
", (C.pulse == PULSE_NONE || C.pulse == PULSE_THREADY ? "" : ""), C.get_pulse(GETPULSE_TOOL)) dat += text("[]\t-Brute Damage %: []
", (occupant.getBruteLoss() < 60 ? "" : ""), occupant.getBruteLoss()) dat += text("[]\t-Respiratory Damage %: []
", (occupant.getOxyLoss() < 60 ? "" : ""), occupant.getOxyLoss()) dat += text("[]\t-Toxin Content %: []
", (occupant.getToxLoss() < 60 ? "" : ""), occupant.getToxLoss()) diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 4b095488f9d..abe63412304 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -87,7 +87,7 @@ Current cell temperature: [temp_text]K
Cryo status: [ on ? "Off On" : "Off On"]
[beaker_text]

- Current occupant: [occupant ? "
Name: [occupant]
Health: [health_text]
Oxygen deprivation: [round(occupant.getOxyLoss(),0.1)]
Brute damage: [round(occupant.getBruteLoss(),0.1)]
Fire damage: [round(occupant.getFireLoss(),0.1)]
Toxin damage: [round(occupant.getToxLoss(),0.1)]
Body temperature: [occupant.bodytemperature]" : "None"]
+ Current occupant: [occupant ? "
Name: [occupant]
Health: [health_text]
Oxygen deprivation: [round(occupant.getOxyLoss(),0.1)]
Brute damage: [round(occupant.getBruteLoss(),0.1)]
Fire damage: [round(occupant.getFireLoss(),0.1)]
Toxin damage: [round(occupant.getToxLoss(),0.1)]
Body temperature: [occupant.bodytemperature]
Heartbeat rate: [occupant.get_pulse(GETPULSE_TOOL)]" : "None"]
"} user.set_machine(src) user << browse(dat, "window=cryo") diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 8e92cf653d9..061f06fe7d8 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -455,4 +455,26 @@
"} user << browse(dat, text("window=mob[];size=325x500", name)) onclose(user, "mob[name]") - return \ No newline at end of file + return + +//generates realistic-ish pulse output based on preset levels +/mob/living/carbon/proc/get_pulse(var/method) //method 0 is for hands, 1 is for machines, more accurate + var/temp = 0 //see setup.dm:694 + switch(src.pulse) + if(PULSE_NONE) + return "0" + if(PULSE_SLOW) + temp = rand(40, 60) + return num2text(method ? temp : temp + rand(-10, 10)) + if(PULSE_NORM) + temp = rand(60, 90) + return num2text(method ? temp : temp + rand(-10, 10)) + if(PULSE_FAST) + temp = rand(90, 120) + return num2text(method ? temp : temp + rand(-10, 10)) + if(PULSE_2FAST) + temp = rand(120, 160) + return num2text(method ? temp : temp + rand(-10, 10)) + if(PULSE_THREADY) + return method ? ">250" : "extremely weak and fast, patient's artery feels like a thread" +// output for machines^ ^^^^^^^output for people^^^^^^^^^ \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index e841bb27184..58c0f09373c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1249,25 +1249,5 @@ mob/living/carbon/human/yank_out_object() if(usr.l_move_time >= time) //checks if our mob has moved during the sleep() usr << "You moved while counting. Try again." else - usr << "\blue [src]'s pulse is [src.get_pulse(GETPULSE_HAND)]." + usr << "\blue [self ? "My" : "[src]'s"] pulse is [src.get_pulse(GETPULSE_HAND)]." -/mob/living/carbon/human/proc/get_pulse(var/method) //method 0 is for hands, 1 is for machines, more accurate - var/temp = 0 - switch(src.pulse) - if(PULSE_NONE) - return "0" - if(PULSE_SLOW) - temp = rand(40, 60) - return num2text(method ? temp : temp + rand(-10, 10)) - if(PULSE_NORM) - temp = rand(60, 90) - return num2text(method ? temp : temp + rand(-10, 10)) - if(PULSE_FAST) - temp = rand(90, 120) - return num2text(method ? temp : temp + rand(-10, 10)) - if(PULSE_2FAST) - temp = rand(120, 160) - return num2text(method ? temp : temp + rand(-10, 10)) - if(PULSE_THREADY) - return method ? ">250" : "extremely weak and fast, patient's artery feels like a thread" -// output for machines^ ^^^^^^^output for people^^^^^^^^^ \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 566e5a24e27..a1d714ba17c 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1437,7 +1437,7 @@ if(temp <= PULSE_THREADY && temp >= PULSE_NORM) temp-- break //one reagent is enough - + //comment out the breaks to make med effects stack for(var/R in tachycardics) //handles different chems' influence on pulse if(reagents.get_reagent_amount(R)) if(temp <= PULSE_FAST && temp >= PULSE_NONE)