diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 9e659261180..663e3f21761 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -913,7 +913,7 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C icon_state = "engivend" icon_deny = "engivend-deny" req_access_txt = "11" //Engineering Equipment access - products = list(/obj/item/clothing/glasses/meson/engine = 2,/obj/item/device/multitool = 4,/obj/item/weapon/electronics/airlock = 10,/obj/item/weapon/electronics/apc = 10,/obj/item/weapon/electronics/airalarm = 10,/obj/item/weapon/stock_parts/cell/high = 10, /obj/item/weapon/rcd/loaded = 3,) + products = list(/obj/item/clothing/glasses/meson/engine = 2,/obj/item/device/multitool = 4,/obj/item/weapon/electronics/airlock = 10,/obj/item/weapon/electronics/apc = 10,/obj/item/weapon/electronics/airalarm = 10,/obj/item/weapon/stock_parts/cell/high = 10, /obj/item/weapon/rcd/loaded = 3, /obj/item/device/geiger_counter = 5) contraband = list(/obj/item/weapon/stock_parts/cell/potato = 3) premium = list(/obj/item/weapon/storage/belt/utility = 3) diff --git a/code/game/objects/items/devices/geiger_counter.dm b/code/game/objects/items/devices/geiger_counter.dm new file mode 100644 index 00000000000..2c80c7f9fea --- /dev/null +++ b/code/game/objects/items/devices/geiger_counter.dm @@ -0,0 +1,150 @@ +#define RAD_LEVEL_NORMAL 10 +#define RAD_LEVEL_MODERATE 30 +#define RAD_LEVEL_HIGH 75 +#define RAD_LEVEL_VERY_HIGH 125 +#define RAD_LEVEL_CRITICAL 200 + +/obj/item/device/geiger_counter //DISCLAIMER: I know nothing about how real-life Geiger counters work. This will not be realistic. ~Xhuis + name = "geiger counter" + desc = "A handheld device used for detecting and measuring radiation pulses." + icon_state = "geiger_off" + item_state = "multitool" + w_class = 2 + slot_flags = SLOT_BELT + materials = list(MAT_METAL = 150, MAT_GLASS = 150) + var/scanning = 0 + var/radiation_count = 0 + var/emagged = 0 + +/obj/item/device/geiger_counter/New() + ..() + SSobj.processing |= src + +/obj/item/device/geiger_counter/Destroy() + SSobj.processing.Remove(src) + ..() + +/obj/item/device/geiger_counter/process() + if(emagged) + if(radiation_count < 20) + radiation_count++ + return 0 + if(radiation_count > 0) + radiation_count-- + update_icon() + +/obj/item/device/geiger_counter/examine(mob/user) + ..() + if(!scanning) + return 1 + user << "Alt-click it to clear stored radiation levels." + if(emagged) + user << "The display seems to be flickering at random radiation levels." + return 1 + switch(radiation_count) + if(-INFINITY to RAD_LEVEL_NORMAL) + user << "Ambient radiation level count reports that all is well." + if(RAD_LEVEL_NORMAL + 1 to RAD_LEVEL_MODERATE) + user << "Ambient radiation levels slightly above average." + if(RAD_LEVEL_MODERATE + 1 to RAD_LEVEL_HIGH) + user << "Ambient radiation levels above average." + if(RAD_LEVEL_HIGH + 1 to RAD_LEVEL_VERY_HIGH) + user << "Ambient radiation levels highly above average." + if(RAD_LEVEL_VERY_HIGH + 1 to RAD_LEVEL_CRITICAL) + user << "Ambient radiation levels nearing critical level." + if(RAD_LEVEL_CRITICAL + 1 to INFINITY) + user << "Ambient radiation levels above critical level!" + +/obj/item/device/geiger_counter/update_icon() + if(!scanning) + icon_state = "geiger_off" + return 1 + if(emagged) + icon_state = "geiger_on_emag" + return 1 + switch(radiation_count) + if(-INFINITY to RAD_LEVEL_NORMAL) + icon_state = "geiger_on_1" + if(RAD_LEVEL_NORMAL + 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 RAD_LEVEL_CRITICAL) + icon_state = "geiger_on_4" + if(RAD_LEVEL_CRITICAL + 1 to INFINITY) + icon_state = "geiger_on_5" + ..() + +/obj/item/device/geiger_counter/rad_act(amount) + if(!amount && scanning) + return 0 + radiation_count += amount + if(isliving(loc)) + var/mob/living/M = loc + M << "\icon[src] RADIATION PULSE DETECTED." + M << "\icon[src] Severity: [amount]" + update_icon() + +/obj/item/device/geiger_counter/attack_self(mob/user) + scanning = !scanning + update_icon() + user << "\icon[src] You switch [scanning ? "on" : "off"] [src]." + +/obj/item/device/geiger_counter/attack(mob/living/M, mob/user) + if(user.a_intent == "help") + if(!emagged) + user.visible_message("[user] scans [M] with [src].", "You scan [M]'s radiation levels with [src]...") + if(!M.radiation) + user << "\icon[src] Radiation levels within normal boundaries." + return 1 + else + user << "\icon[src] Subject is irradiated. Radiation levels: [M.radiation]." + return 1 + else + user.visible_message("[user] scans [M] with [src].", "You project [src]'s stored radiation into [M]'s body!") + M.rad_act(radiation_count) + radiation_count = 0 + return 1 + ..() + +/obj/item/device/geiger_counter/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/weapon/screwdriver) && emagged) + if(scanning) + user << "Turn off [src] before you perform this action!" + return 0 + user.visible_message("[user] unscrews [src]'s maintenance panel and begins fiddling with its innards...", "You begin resetting [src]...") + playsound(user, 'sound/items/Screwdriver.ogg', 50, 1) + if(!do_after(user, 40, target = user)) + return 0 + user.visible_message("[user] refastens [src]'s maintenance panel!", "You reset [src] to its factory settings!") + playsound(user, 'sound/items/Screwdriver2.ogg', 50, 1) + emagged = 0 + radiation_count = 0 + update_icon() + return 1 + ..() + +/obj/item/device/geiger_counter/AltClick() + ..() + if(!scanning) + usr << "[src] must be on to reset its radiation level!" + return 0 + radiation_count = 0 + usr << "You flush [src]'s radiation counts, resetting it to normal." + update_icon() + +/obj/item/device/geiger_counter/emag_act(mob/user) + if(!emagged) + if(scanning) + user << "Turn off [src] before you perform this action!" + return 0 + user << "You override [src]'s radiation storing protocols. It will now generate small doses of radiation, and stored rads are now projected into creatures you scan." + emagged = 1 + +#undef RAD_LEVEL_NORMAL +#undef RAD_LEVEL_MODERATE +#undef RAD_LEVEL_HIGH +#undef RAD_LEVEL_VERY_HIGH +#undef RAD_LEVEL_CRITICAL diff --git a/code/game/objects/radiation.dm b/code/game/objects/radiation.dm index 0016fdae514..566f6c84505 100644 --- a/code/game/objects/radiation.dm +++ b/code/game/objects/radiation.dm @@ -34,3 +34,5 @@ if(amount) var/blocked = run_armor_check(null, "rad", "Your clothes feel warm.", "Your clothes feel warm.") apply_effect(amount, IRRADIATE, blocked) + for(var/obj/I in src) //Radiation is also applied to items held by the mob + I.rad_act(amount) diff --git a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm index 3290d6cc83c..064256f8f10 100644 --- a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm @@ -133,6 +133,7 @@ /obj/structure/closet/radiation/New() ..() + new /obj/item/device/geiger_counter(src) new /obj/item/clothing/suit/radiation(src) new /obj/item/clothing/head/radiation(src) diff --git a/code/modules/research/designs/autolathe_designs.dm b/code/modules/research/designs/autolathe_designs.dm index 7cf5fff85f4..0ed1120d503 100644 --- a/code/modules/research/designs/autolathe_designs.dm +++ b/code/modules/research/designs/autolathe_designs.dm @@ -569,4 +569,12 @@ build_type = AUTOLATHE materials = list(MAT_METAL = 150, MAT_GLASS = 125) build_path = /obj/item/weapon/hand_labeler - category = list("initial", "Electronics") \ No newline at end of file + category = list("initial", "Electronics") + +/datum/design/geiger + name = "Geiger counter" + id = "geigercounter" + build_type = AUTOLATHE + materials = list(MAT_METAL = 150, MAT_GLASS = 150) + build_path = /obj/item/device/geiger_counter + category = list("initial", "Tools") diff --git a/html/changelogs/Xhuis-Read.yml b/html/changelogs/Xhuis-Read.yml new file mode 100644 index 00000000000..a09ccc4653d --- /dev/null +++ b/html/changelogs/Xhuis-Read.yml @@ -0,0 +1,6 @@ +author: Xhuis +delete-after: True + +changes: + - rscadd: "Geiger counters have been added and are obtainable from autolathes and EngiVends. They will measure the severity of radiation pulses while in your pockets, belt, or hands. One can scan a mob's radiation level by switching to Help intent and clicking on it. These counters never really discard the radiation they store, and rumor has it this can be used in nefarious ways..." + - tweak: "When a mob is impacted by radiation, the radiation is now relayed to all items on the mob." diff --git a/icons/obj/device.dmi b/icons/obj/device.dmi index 14fe16e3935..9cfc92e39c0 100644 Binary files a/icons/obj/device.dmi and b/icons/obj/device.dmi differ diff --git a/tgstation.dme b/tgstation.dme index f4272161a16..071c25cb6ac 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -605,6 +605,7 @@ #include "code\game\objects\items\devices\chameleonproj.dm" #include "code\game\objects\items\devices\doorCharge.dm" #include "code\game\objects\items\devices\flashlight.dm" +#include "code\game\objects\items\devices\geiger_counter.dm" #include "code\game\objects\items\devices\instruments.dm" #include "code\game\objects\items\devices\laserpointer.dm" #include "code\game\objects\items\devices\lightreplacer.dm"