Merge pull request #3465 from Yoshax/radiation

Ports radiation rework and stuff from Bay
This commit is contained in:
Anewbe
2017-05-31 18:37:58 -05:00
committed by GitHub
32 changed files with 372 additions and 61 deletions
+53
View File
@@ -0,0 +1,53 @@
#define RAD_LEVEL_LOW 5 //10 // Around the level at which radiation starts to become harmful
#define RAD_LEVEL_MODERATE 15 //15
#define RAD_LEVEL_HIGH 50 //50
#define RAD_LEVEL_VERY_HIGH 100 //100
//Geiger counter
//Rewritten version of TG's geiger counter
//I opted to show exact radiation levels
/obj/item/device/geiger
name = "geiger counter"
desc = "A handheld device used for detecting and measuring radiation in an area."
icon_state = "geiger_off"
item_state = "multitool"
w_class = ITEMSIZE_SMALL
var/scanning = 0
var/radiation_count = 0
/obj/item/device/geiger/New()
processing_objects |= src
/obj/item/device/geiger/process()
if(!scanning)
return
radiation_count = radiation_repository.get_rads_at_turf(get_turf(src))
update_icon()
/obj/item/device/geiger/examine(mob/user)
..(user)
to_chat(user, "<span class='warning'>[scanning ? "ambient" : "stored"] radiation level: [radiation_count ? radiation_count : "0"]Bq.</span>")
/obj/item/device/geiger/attack_self(var/mob/user)
scanning = !scanning
update_icon()
to_chat(user, "<span class='notice'>\icon[src] You switch [scanning ? "on" : "off"] [src].</span>")
/obj/item/device/geiger/update_icon()
if(!scanning)
icon_state = "geiger_off"
return 1
switch(radiation_count)
if(null) icon_state = "geiger_on_1"
if(-INFINITY to RAD_LEVEL_LOW) icon_state = "geiger_on_1"
if(RAD_LEVEL_LOW + 1 to RAD_LEVEL_MODERATE) icon_state = "geiger_on_2"
if(RAD_LEVEL_MODERATE + 1 to RAD_LEVEL_HIGH) icon_state = "geiger_on_3"
if(RAD_LEVEL_HIGH + 1 to RAD_LEVEL_VERY_HIGH) icon_state = "geiger_on_4"
if(RAD_LEVEL_VERY_HIGH + 1 to INFINITY) icon_state = "geiger_on_5"
#undef RAD_LEVEL_LOW
#undef RAD_LEVEL_MODERATE
#undef RAD_LEVEL_HIGH
#undef RAD_LEVEL_VERY_HIGH
@@ -99,6 +99,8 @@ REAGENT SCANNER
if(M.status_flags & FAKEDEATH)
OX = fake_oxy > 50 ? "<span class='warning'>Severe oxygen deprivation detected</span>" : "Subject bloodstream oxygen level normal"
user.show_message("[OX] | [TX] | [BU] | [BR]")
if(M.radiation)
user.show_message("<span class='warning'>Radiation detected.</span>")
if(istype(M, /mob/living/carbon))
var/mob/living/carbon/C = M
if(C.reagents.total_volume)
@@ -155,6 +155,8 @@
new /obj/item/clothing/head/radiation(src)
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
new /obj/item/device/geiger(src)
new /obj/item/device/geiger(src)
/*
* Bombsuit closet
+1 -2
View File
@@ -168,8 +168,7 @@
/obj/structure/simple_door/process()
if(!material.radioactivity)
return
for(var/mob/living/L in range(1,src))
L.apply_effect(round(material.radioactivity/3),IRRADIATE,0)
radiation_repository.radiate(src, round(material.radioactivity/3))
/obj/structure/simple_door/iron/New(var/newloc,var/material_name)
..(newloc, "iron")