From e6085f4aa126ecc756d24d037794e3a404cab8fc Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Fri, 11 May 2018 14:10:28 -0400 Subject: [PATCH] Allow throwing items into smartfridges (sometimes) Allows anyone to throw items at smartfridges, and have a small chance of it getting stored, UNLESS you're the 'expert job' for that smartfridge (e.g. Chemist for the Chemistry one), at which point there's a 98% chance because you and the machine have an understanding. --- code/game/machinery/kitchen/smartfridge_vr.dm | 32 +++++++++++++++++++ vorestation.dme | 1 + 2 files changed, 33 insertions(+) create mode 100644 code/game/machinery/kitchen/smartfridge_vr.dm diff --git a/code/game/machinery/kitchen/smartfridge_vr.dm b/code/game/machinery/kitchen/smartfridge_vr.dm new file mode 100644 index 0000000000..8b77e2f81d --- /dev/null +++ b/code/game/machinery/kitchen/smartfridge_vr.dm @@ -0,0 +1,32 @@ +/obj/machinery/smartfridge + var/expert_job = "Chef" +/obj/machinery/smartfridge/seeds + expert_job = "Botanist" +/obj/machinery/smartfridge/secure/extract + expert_job = "Xenobiologist" +/obj/machinery/smartfridge/secure/medbay + expert_job = "Chemist" +/obj/machinery/smartfridge/secure/virology + expert_job = "Medical Doctor" //Virologist is an alt-title unfortunately +/obj/machinery/smartfridge/chemistry + expert_job = "Chemist" //Unsure what this one is used for, actually +/obj/machinery/smartfridge/drinks + expert_job = "Bartender" + +// Allow thrown items into smartfridges +/obj/machinery/smartfridge/throw_impact(var/atom/movable/A) + . = ..() + if(accept_check(A) && A.thrower) + //Try to find what job they are via ID + var/obj/item/weapon/card/id/thrower_id + if(ismob(A.thrower)) + var/mob/T = A.thrower + thrower_id = T.GetIdCard() + + //98% chance the expert makes it + if(expert_job && thrower_id && thrower_id.rank == expert_job && prob(98)) + stock(A) + + //20% chance a non-expert makes it + else if(prob(20)) + stock(A) diff --git a/vorestation.dme b/vorestation.dme index 1b92618ced..30f6aa7e4d 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -819,6 +819,7 @@ #include "code\game\machinery\kitchen\icecream.dm" #include "code\game\machinery\kitchen\microwave.dm" #include "code\game\machinery\kitchen\smartfridge.dm" +#include "code\game\machinery\kitchen\smartfridge_vr.dm" #include "code\game\machinery\kitchen\cooking_machines\_cooker.dm" #include "code\game\machinery\kitchen\cooking_machines\_cooker_output.dm" #include "code\game\machinery\kitchen\cooking_machines\candy.dm"