From 4974e183c41a0713eea8f22c4aaf3bb669a6e030 Mon Sep 17 00:00:00 2001 From: skull132 Date: Fri, 15 Aug 2014 07:29:12 +0300 Subject: [PATCH 1/8] Chemistry Things Moveable Makes the chem dispensers (and assorted children), chemmaster and grinder moveable. --- code/modules/reagents/Chemistry-Machinery.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index cabb0b7c..3ba573f6 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -23,6 +23,7 @@ "copper","mercury","radium","water","ethanol","sugar","sacid","tungsten") var/list/broken_requirements = list() var/broken_on_spawn = 0 + moveable = 1 /obj/machinery/chem_dispenser/proc/recharge() if(stat & (BROKEN|NOPOWER)) return @@ -281,6 +282,7 @@ icon_state = "mixer0" use_power = 1 idle_power_usage = 20 + moveable = 1 var/beaker = null var/obj/item/weapon/storage/pill_bottle/loaded_pill_bottle = null var/mode = 0 @@ -860,6 +862,7 @@ use_power = 1 idle_power_usage = 5 active_power_usage = 100 + moveable = 1 var/inuse = 0 var/obj/item/weapon/reagent_containers/beaker = null var/limit = 10 From 788ffa7a989daa330546af624f1d1718bcb1fc1a Mon Sep 17 00:00:00 2001 From: skull132 Date: Fri, 15 Aug 2014 07:33:54 +0300 Subject: [PATCH 2/8] Vending machines moveable Should make all vending machines moveable, those that make sense and shouldn't be bolted down heavier than a nun's uniform, anyways. --- code/game/machinery/vending.dm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index e04f507a..3693fa0d 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -15,6 +15,7 @@ layer = 2.9 anchored = 1 density = 1 + moveable = 1 var/active = 1 //No sales pitches if off! var/vend_ready = 1 //Are we ready to vend?? Is it time?? var/vend_delay = 10 //How long does it take to vend? @@ -741,6 +742,7 @@ icon_deny = "med-deny" product_ads = "Go save some lives!;The best stuff for your medbay.;Only the finest tools.;Natural chemicals!;This stuff saves lives.;Don't you want some?;Ping!" req_access_txt = "5" + moveable = 0 products = list(/obj/item/weapon/reagent_containers/glass/bottle/antitoxin = 4,/obj/item/weapon/reagent_containers/glass/bottle/inaprovaline = 4, /obj/item/weapon/reagent_containers/glass/bottle/stoxin = 4,/obj/item/weapon/reagent_containers/glass/bottle/toxin = 4, /obj/item/weapon/reagent_containers/syringe/antiviral = 4,/obj/item/weapon/reagent_containers/syringe = 12, @@ -764,6 +766,7 @@ icon_state = "wallmed" icon_deny = "wallmed-deny" req_access_txt = "5" + moveable = 0 density = 0 //It is wall-mounted, and thus, not dense. --Superxpdude products = list(/obj/item/stack/medical/bruise_pack = 2,/obj/item/stack/medical/ointment = 2,/obj/item/weapon/reagent_containers/hypospray/autoinjector = 4,/obj/item/device/healthanalyzer = 1) contraband = list(/obj/item/weapon/reagent_containers/syringe/antitoxin = 4,/obj/item/weapon/reagent_containers/syringe/antiviral = 4,/obj/item/weapon/reagent_containers/pill/tox = 1) @@ -774,6 +777,7 @@ icon_state = "wallmed" icon_deny = "wallmed-deny" req_access_txt = "5" + moveable = 0 density = 0 //It is wall-mounted, and thus, not dense. --Superxpdude products = list(/obj/item/weapon/reagent_containers/hypospray/autoinjector = 5,/obj/item/weapon/reagent_containers/syringe/antitoxin = 3,/obj/item/stack/medical/bruise_pack = 3, /obj/item/stack/medical/ointment =3,/obj/item/device/healthanalyzer = 3) @@ -786,6 +790,7 @@ icon_state = "sec" icon_deny = "sec-deny" req_access_txt = "1" + moveable = 0 products = list(/obj/item/weapon/handcuffs = 8,/obj/item/weapon/grenade/flashbang = 4,/obj/item/device/flash = 5, /obj/item/weapon/reagent_containers/food/snacks/donut/normal = 12,/obj/item/weapon/storage/box/evidence = 6) contraband = list(/obj/item/clothing/glasses/sunglasses = 2,/obj/item/weapon/storage/fancy/donut_box = 2) @@ -825,6 +830,7 @@ product_slogans = "Sling spells the proper way with MagiVend!;Be your own Houdini! Use MagiVend!" vend_delay = 15 vend_reply = "Have an enchanted evening!" + moveable = 0 product_ads = "FJKLFJSD;AJKFLBJAKL;1234 LOONIES LOL!;>MFW;Kill them fuckers!;GET DAT FUKKEN DISK;HONK!;EI NATH;Destroy the station!;Admin conspiracies since forever!;Space-time bending hardware!" products = list(/obj/item/clothing/head/wizard = 1,/obj/item/clothing/suit/wizrobe = 1,/obj/item/clothing/head/wizard/red = 1,/obj/item/clothing/suit/wizrobe/red = 1,/obj/item/clothing/shoes/sandal = 1,/obj/item/weapon/staff = 2) contraband = list(/obj/item/weapon/reagent_containers/glass/bottle/wizarditis = 1) //No one can get to the machine to hack it anyways; for the lulz - Microwave @@ -850,6 +856,7 @@ desc = "Tools for tools." icon_state = "tool" icon_deny = "tool-deny" + moveable = 0 //req_access_txt = "12" //Maintenance access products = list(/obj/item/weapon/cable_coil/random = 10,/obj/item/weapon/crowbar = 5,/obj/item/weapon/weldingtool = 3,/obj/item/weapon/wirecutters = 5, /obj/item/weapon/wrench = 5,/obj/item/device/analyzer = 5,/obj/item/device/t_scanner = 5,/obj/item/weapon/screwdriver = 5) @@ -861,6 +868,7 @@ desc = "Spare tool vending. What? Did you expect some witty description?" icon_state = "engivend" icon_deny = "engivend-deny" + moveable = 0 req_access_txt = "11" //Engineering Equipment access products = list(/obj/item/clothing/glasses/meson = 2,/obj/item/device/multitool = 4,/obj/item/weapon/airlock_electronics = 10,/obj/item/weapon/module/power_control = 10,/obj/item/weapon/airalarm_electronics = 10,/obj/item/weapon/cell/high = 10) contraband = list(/obj/item/weapon/cell/potato = 3) @@ -873,6 +881,7 @@ icon_state = "engi" icon_deny = "engi-deny" req_access_txt = "11" + moveable = 0 products = list(/obj/item/clothing/under/rank/chief_engineer = 4,/obj/item/clothing/under/rank/engineer = 4,/obj/item/clothing/shoes/orange = 4,/obj/item/clothing/head/hardhat = 4, /obj/item/weapon/storage/belt/utility = 4,/obj/item/clothing/glasses/meson = 4,/obj/item/clothing/gloves/yellow = 4, /obj/item/weapon/screwdriver = 12, /obj/item/weapon/crowbar = 12,/obj/item/weapon/wirecutters = 12,/obj/item/device/multitool = 12,/obj/item/weapon/wrench = 12,/obj/item/device/t_scanner = 12, @@ -890,6 +899,7 @@ icon_state = "robotics" icon_deny = "robotics-deny" req_access_txt = "29" + moveable = 0 products = list(/obj/item/clothing/suit/storage/labcoat = 4,/obj/item/clothing/under/rank/roboticist = 4,/obj/item/weapon/cable_coil = 4,/obj/item/device/flash = 4, /obj/item/weapon/cell/high = 12, /obj/item/device/assembly/prox_sensor = 3,/obj/item/device/assembly/signaler = 3,/obj/item/device/healthanalyzer = 3, /obj/item/weapon/scalpel = 2,/obj/item/weapon/circular_saw = 2,/obj/item/weapon/tank/anesthetic = 2,/obj/item/clothing/mask/breath/medical = 5, From 3a76d81de3b1b9018c504b0f076efea416860d19 Mon Sep 17 00:00:00 2001 From: skull132 Date: Fri, 15 Aug 2014 07:34:33 +0300 Subject: [PATCH 3/8] Operating Table moveable Makes the operating table moveable. --- code/game/machinery/OpTable.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 8a1dfab0..3eafd335 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -8,6 +8,7 @@ use_power = 1 idle_power_usage = 1 active_power_usage = 5 + moveable = 1 var/mob/living/carbon/human/victim = null var/strapped = 0.0 @@ -141,4 +142,4 @@ user.drop_item() if(W && W.loc) W.loc = src.loc - return \ No newline at end of file + return From 2febab8574a5d1e5dcd2ae3d2acc842180863c4c Mon Sep 17 00:00:00 2001 From: skull132 Date: Fri, 15 Aug 2014 11:23:17 +0300 Subject: [PATCH 4/8] Orderable Atmospherics Equipment Part one, Adds the supply_packs to the orderable items list. They will arrive empty, but will otherwise work as of initial coding. --- code/datums/supplypacks.dm | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index 1c2a508a..e1736c8d 100644 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -1111,3 +1111,34 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee containername = "Beekeeping crate" access = access_hydroponics group = "Hydroponics" + +/* + *Skull's additions to satisfy the cravings of any atmospheric tech begin here. + */ + +/datum/supply_packs/atmos_freezer + name = "Gas Cooling Unit" + contains = list() //MAKE A FREEZER THAT IS, BY DEFAULT, UNANCHORED! + cost = 50 + containertype = /obj/structure/closet/crate/secure/large //Test if this works ((should)) + containername = "gas cooling unit crate" + access = access_atmospherics + group = "Engineering" + +/datum/supply_packs/atmos_heater + name = "Gas Heating Unit" + contains = list() //MAKE A COOLER THAT IS, BY DEFAULT, UNANCHORED! + cost = 50 + containertype = /obj/structure/closet/crate/secure/large //Test if this works ((should)) + containername = "gas heating unit crate" + access = access_atmospherics + group = "Engineering" + +/daumt/supply_packs/atmos_airtank + name = "Large Air Tank" + contains = list() //MAKE A LARGE RED AIRTANK THAT IS UNWRENCHED, AND CAN BE MANIPULATED AT SPAWN. This may cause issues, hueh. + cost = 65 + containertype = /obj/structure/closet/crate/secure/large //test if this works ((should)) + containername = "large air tank crate" + access = access_atmospherics + group = "Engineering" From 58e398716afe25883c6a8a4a05337c2a0b3c7541 Mon Sep 17 00:00:00 2001 From: skull132 Date: Tue, 19 Aug 2014 21:11:35 +0300 Subject: [PATCH 5/8] Supplies Commented out the airtank, because more work than worth right now. --- code/datums/supplypacks.dm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index e1736c8d..25cd881e 100644 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -1134,11 +1134,11 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee access = access_atmospherics group = "Engineering" -/daumt/supply_packs/atmos_airtank - name = "Large Air Tank" - contains = list() //MAKE A LARGE RED AIRTANK THAT IS UNWRENCHED, AND CAN BE MANIPULATED AT SPAWN. This may cause issues, hueh. - cost = 65 - containertype = /obj/structure/closet/crate/secure/large //test if this works ((should)) - containername = "large air tank crate" - access = access_atmospherics - group = "Engineering" +///datum/supply_packs/atmos_airtank +// name = "Large Air Tank" +// contains = list() //MAKE A LARGE RED AIRTANK THAT IS UNWRENCHED, AND CAN BE MANIPULATED AT SPAWN. This may cause issues, hueh. +// cost = 65 +// containertype = /obj/structure/closet/crate/secure/large //test if this works ((should)) +// containername = "large air tank crate" +// access = access_atmospherics +// group = "Engineering" From 723a35a0581ff2b67d62d5a728a0fe4e061d9080 Mon Sep 17 00:00:00 2001 From: skull132 Date: Tue, 19 Aug 2014 23:22:46 +0300 Subject: [PATCH 6/8] Things Moveable Final Creates moveable freezers and so on, fixes things and improves the mechanic slightly. --- .gitignore | 2 + code/datums/supplypacks.dm | 4 +- code/game/machinery/Freezer.dm | 86 +++++++++++++++++--- code/game/machinery/machinery.dm | 12 +-- code/modules/aurora/banner.dm | 8 +- code/modules/reagents/Chemistry-Machinery.dm | 34 +++++++- 6 files changed, 118 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index da85a131..77a08ead 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ maps/newmedical tgstation2.dmm *.bak2 maps/tgstation2_medbayrework_final.dmm Outpost.dmm +config/admins.txt +config/admin_ranks.txt diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index 25cd881e..87f36323 100644 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -1118,7 +1118,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/atmos_freezer name = "Gas Cooling Unit" - contains = list() //MAKE A FREEZER THAT IS, BY DEFAULT, UNANCHORED! + contains = list(/obj/machinery/atmospherics/unary/cold_sink/freezer/cargo) //MAKE A FREEZER THAT IS, BY DEFAULT, UNANCHORED! cost = 50 containertype = /obj/structure/closet/crate/secure/large //Test if this works ((should)) containername = "gas cooling unit crate" @@ -1127,7 +1127,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/atmos_heater name = "Gas Heating Unit" - contains = list() //MAKE A COOLER THAT IS, BY DEFAULT, UNANCHORED! + contains = list(/obj/machinery/atmospherics/unary/heat_reservoir/heater/cargo) //MAKE A COOLER THAT IS, BY DEFAULT, UNANCHORED! cost = 50 containertype = /obj/structure/closet/crate/secure/large //Test if this works ((should)) containername = "gas heating unit crate" diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm index dcfbcd7b..8d044d9d 100644 --- a/code/game/machinery/Freezer.dm +++ b/code/game/machinery/Freezer.dm @@ -36,13 +36,22 @@ return /obj/machinery/atmospherics/unary/cold_sink/freezer/attack_ai(mob/user as mob) - src.ui_interact(user) + if(anchored == 1) + src.ui_interact(user) + else + user << "The machine is not wrenched down, you cannot interface with it." /obj/machinery/atmospherics/unary/cold_sink/freezer/attack_paw(mob/user as mob) - src.ui_interact(user) + if(anchored == 1) + src.ui_interact(user) + else + user << "You should wrench the machine down before trying to switch it on." /obj/machinery/atmospherics/unary/cold_sink/freezer/attack_hand(mob/user as mob) - src.ui_interact(user) + if(anchored == 1) + src.ui_interact(user) + else + user << "You should wrench the machine down before trying to switch it on." /obj/machinery/atmospherics/unary/cold_sink/freezer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) // this is the data which will be sent to the ui @@ -53,7 +62,7 @@ data["minGasTemperature"] = round(T0C - 200) data["maxGasTemperature"] = round(T20C) data["targetGasTemperature"] = round(current_temperature) - + var/temp_class = "good" if (air_contents.temperature > (T0C - 20)) temp_class = "bad" @@ -74,7 +83,7 @@ // auto update every Master Controller tick ui.set_auto_update(1) -/obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list) +/obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list) if (href_list["toggleStatus"]) src.on = !src.on update_icon() @@ -91,6 +100,28 @@ /obj/machinery/atmospherics/unary/cold_sink/freezer/process() ..() +/obj/machinery/atmospherics/unary/cold_sink/freezer/attackby(var/obj/item/W as obj, var/mob/user as mob) + if(src.on) + user << "You need to turn the machine off before unwrenching it." + else + if(istype(W, /obj/item/weapon/wrench)) + switch(anchored) + if(0) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") + anchored = 1 + initialize_directions = dir + if(1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") + anchored = 0 + return + +/obj/machinery/atmospherics/unary/cold_sink/freezer/cargo + anchored = 0 + /obj/machinery/atmospherics/unary/heat_reservoir/heater name = "gas heating system" icon = 'icons/obj/Cryogenic2.dmi' @@ -129,14 +160,23 @@ return /obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_ai(mob/user as mob) - src.ui_interact(user) + if(anchored == 1) + src.ui_interact(user) + else + user << "The machine is not wrenched down, you cannot interface with it." /obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_paw(mob/user as mob) - src.ui_interact(user) + if(anchored == 1) + src.ui_interact(user) + else + user << "The machine is not wrenched down, you cannot interface with it." /obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_hand(mob/user as mob) - src.ui_interact(user) - + if(anchored == 1) + src.ui_interact(user) + else + user << "The machine is not wrenched down, you cannot interface with it." + /obj/machinery/atmospherics/unary/heat_reservoir/heater/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) // this is the data which will be sent to the ui var/data[0] @@ -146,7 +186,7 @@ data["minGasTemperature"] = round(T20C) data["maxGasTemperature"] = round(T20C+280) data["targetGasTemperature"] = round(current_temperature) - + var/temp_class = "normal" if (air_contents.temperature > (T20C+40)) temp_class = "bad" @@ -175,9 +215,31 @@ src.current_temperature = min((T20C+280), src.current_temperature+amount) else src.current_temperature = max(T20C, src.current_temperature+amount) - + src.add_fingerprint(usr) return 1 /obj/machinery/atmospherics/unary/heat_reservoir/heater/process() - ..() \ No newline at end of file + ..() + +/obj/machinery/atmospherics/unary/heat_reservoir/heater/attackby(var/obj/item/W as obj, var/mob/user as mob) + if(src.on) + user << "You need to turn the machine off before unwrenching it." + else + if(istype(W, /obj/item/weapon/wrench)) + switch(anchored) + if(0) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") + anchored = 1 + initialize_directions = dir + if(1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") + anchored = 0 + return + +/obj/machinery/atmospherics/unary/heat_reservoir/heater/cargo + anchored = 0 \ No newline at end of file diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 427e4256..46ca6d45 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -261,18 +261,20 @@ Class Procs: state(text, "blue") playsound(src.loc, 'sound/machines/ping.ogg', 50, 0) -/obj/machinery/attack_by(obj/item/W, mob/user) +/obj/machinery/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/weapon/wrench)) if(moveable == 1) switch(anchored) if(0) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") anchored = 1 - playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - user.visible_message("[user.name] secures [src.name] to the floor.", \"You secure [src.name] to the floor.", \"You hear a ratchet") if(1) - anchored = 0 playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \"You unsecure [src.name] from the floor.", \"You hear a ratchet") + spawn(10) + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") + anchored = 0 return else user << "The item is secured to the floor too firmly." diff --git a/code/modules/aurora/banner.dm b/code/modules/aurora/banner.dm index 6a457610..a3365b1a 100644 --- a/code/modules/aurora/banner.dm +++ b/code/modules/aurora/banner.dm @@ -36,13 +36,9 @@ if(0) anchored = 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - user.visible_message("[user.name] secures [src.name] to the floor.", \ - "You secure [src.name] to the floor.", \ - "You hear a ratchet") + user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") if(1) anchored = 0 playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \ - "You unsecure [src.name] from the floor.", \ - "You hear a ratchet") + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") return diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 3ba573f6..35337683 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -181,7 +181,7 @@ add_fingerprint(usr) return 1 // update UIs attached to this object -/obj/machinery/chem_dispenser/attackby(var/obj/item/weapon/reagent_containers/B as obj, var/mob/user as mob) +/obj/machinery/chem_dispenser/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob) if(isrobot(user)) return @@ -209,6 +209,20 @@ user << "You set [B] on the machine." nanomanager.update_uis(src) // update all UIs attached to src return + if(istype(B, /obj/item/weapon/wrench)) + if(moveable == 1) + switch(anchored) + if(0) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") + anchored = 1 + if(1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") + anchored = 0 + return /obj/machinery/chem_dispenser/attack_ai(mob/user as mob) return src.attack_hand(user) @@ -327,6 +341,21 @@ /obj/machinery/chem_master/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob) + if(istype(B, /obj/item/weapon/wrench)) + if(moveable == 1) + switch(anchored) + if(0) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") + anchored = 1 + if(1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") + anchored = 0 + return + if(istype(B, /obj/item/weapon/reagent_containers/glass)) if(src.beaker) @@ -338,8 +367,7 @@ user << "You add the beaker to the machine!" src.updateUsrDialog() icon_state = "mixer1" - - else if(istype(B, /obj/item/weapon/storage/pill_bottle)) + if(istype(B, /obj/item/weapon/storage/pill_bottle)) if(src.loaded_pill_bottle) user << "A pill bottle is already loaded into the machine." From 689c13cfcb5b462cd336f3775a3ee6e0f53c2ed8 Mon Sep 17 00:00:00 2001 From: skull132 Date: Tue, 19 Aug 2014 23:24:37 +0300 Subject: [PATCH 7/8] Revert "Things Moveable Final" This reverts commit 723a35a0581ff2b67d62d5a728a0fe4e061d9080. --- .gitignore | 2 - code/datums/supplypacks.dm | 4 +- code/game/machinery/Freezer.dm | 86 +++----------------- code/game/machinery/machinery.dm | 12 ++- code/modules/aurora/banner.dm | 8 +- code/modules/reagents/Chemistry-Machinery.dm | 34 +------- 6 files changed, 28 insertions(+), 118 deletions(-) diff --git a/.gitignore b/.gitignore index 77a08ead..da85a131 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,3 @@ maps/newmedical tgstation2.dmm *.bak2 maps/tgstation2_medbayrework_final.dmm Outpost.dmm -config/admins.txt -config/admin_ranks.txt diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index 87f36323..25cd881e 100644 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -1118,7 +1118,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/atmos_freezer name = "Gas Cooling Unit" - contains = list(/obj/machinery/atmospherics/unary/cold_sink/freezer/cargo) //MAKE A FREEZER THAT IS, BY DEFAULT, UNANCHORED! + contains = list() //MAKE A FREEZER THAT IS, BY DEFAULT, UNANCHORED! cost = 50 containertype = /obj/structure/closet/crate/secure/large //Test if this works ((should)) containername = "gas cooling unit crate" @@ -1127,7 +1127,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/atmos_heater name = "Gas Heating Unit" - contains = list(/obj/machinery/atmospherics/unary/heat_reservoir/heater/cargo) //MAKE A COOLER THAT IS, BY DEFAULT, UNANCHORED! + contains = list() //MAKE A COOLER THAT IS, BY DEFAULT, UNANCHORED! cost = 50 containertype = /obj/structure/closet/crate/secure/large //Test if this works ((should)) containername = "gas heating unit crate" diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm index 8d044d9d..dcfbcd7b 100644 --- a/code/game/machinery/Freezer.dm +++ b/code/game/machinery/Freezer.dm @@ -36,22 +36,13 @@ return /obj/machinery/atmospherics/unary/cold_sink/freezer/attack_ai(mob/user as mob) - if(anchored == 1) - src.ui_interact(user) - else - user << "The machine is not wrenched down, you cannot interface with it." + src.ui_interact(user) /obj/machinery/atmospherics/unary/cold_sink/freezer/attack_paw(mob/user as mob) - if(anchored == 1) - src.ui_interact(user) - else - user << "You should wrench the machine down before trying to switch it on." + src.ui_interact(user) /obj/machinery/atmospherics/unary/cold_sink/freezer/attack_hand(mob/user as mob) - if(anchored == 1) - src.ui_interact(user) - else - user << "You should wrench the machine down before trying to switch it on." + src.ui_interact(user) /obj/machinery/atmospherics/unary/cold_sink/freezer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) // this is the data which will be sent to the ui @@ -62,7 +53,7 @@ data["minGasTemperature"] = round(T0C - 200) data["maxGasTemperature"] = round(T20C) data["targetGasTemperature"] = round(current_temperature) - + var/temp_class = "good" if (air_contents.temperature > (T0C - 20)) temp_class = "bad" @@ -83,7 +74,7 @@ // auto update every Master Controller tick ui.set_auto_update(1) -/obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list) +/obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list) if (href_list["toggleStatus"]) src.on = !src.on update_icon() @@ -100,28 +91,6 @@ /obj/machinery/atmospherics/unary/cold_sink/freezer/process() ..() -/obj/machinery/atmospherics/unary/cold_sink/freezer/attackby(var/obj/item/W as obj, var/mob/user as mob) - if(src.on) - user << "You need to turn the machine off before unwrenching it." - else - if(istype(W, /obj/item/weapon/wrench)) - switch(anchored) - if(0) - playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - spawn(10) - user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") - anchored = 1 - initialize_directions = dir - if(1) - playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - spawn(10) - user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") - anchored = 0 - return - -/obj/machinery/atmospherics/unary/cold_sink/freezer/cargo - anchored = 0 - /obj/machinery/atmospherics/unary/heat_reservoir/heater name = "gas heating system" icon = 'icons/obj/Cryogenic2.dmi' @@ -160,23 +129,14 @@ return /obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_ai(mob/user as mob) - if(anchored == 1) - src.ui_interact(user) - else - user << "The machine is not wrenched down, you cannot interface with it." + src.ui_interact(user) /obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_paw(mob/user as mob) - if(anchored == 1) - src.ui_interact(user) - else - user << "The machine is not wrenched down, you cannot interface with it." + src.ui_interact(user) /obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_hand(mob/user as mob) - if(anchored == 1) - src.ui_interact(user) - else - user << "The machine is not wrenched down, you cannot interface with it." - + src.ui_interact(user) + /obj/machinery/atmospherics/unary/heat_reservoir/heater/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) // this is the data which will be sent to the ui var/data[0] @@ -186,7 +146,7 @@ data["minGasTemperature"] = round(T20C) data["maxGasTemperature"] = round(T20C+280) data["targetGasTemperature"] = round(current_temperature) - + var/temp_class = "normal" if (air_contents.temperature > (T20C+40)) temp_class = "bad" @@ -215,31 +175,9 @@ src.current_temperature = min((T20C+280), src.current_temperature+amount) else src.current_temperature = max(T20C, src.current_temperature+amount) - + src.add_fingerprint(usr) return 1 /obj/machinery/atmospherics/unary/heat_reservoir/heater/process() - ..() - -/obj/machinery/atmospherics/unary/heat_reservoir/heater/attackby(var/obj/item/W as obj, var/mob/user as mob) - if(src.on) - user << "You need to turn the machine off before unwrenching it." - else - if(istype(W, /obj/item/weapon/wrench)) - switch(anchored) - if(0) - playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - spawn(10) - user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") - anchored = 1 - initialize_directions = dir - if(1) - playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - spawn(10) - user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") - anchored = 0 - return - -/obj/machinery/atmospherics/unary/heat_reservoir/heater/cargo - anchored = 0 \ No newline at end of file + ..() \ No newline at end of file diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 46ca6d45..427e4256 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -261,20 +261,18 @@ Class Procs: state(text, "blue") playsound(src.loc, 'sound/machines/ping.ogg', 50, 0) -/obj/machinery/attackby(obj/item/W, mob/user) +/obj/machinery/attack_by(obj/item/W, mob/user) if(istype(W, /obj/item/weapon/wrench)) if(moveable == 1) switch(anchored) if(0) - playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - spawn(10) - user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") anchored = 1 - if(1) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - spawn(10) - user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") + user.visible_message("[user.name] secures [src.name] to the floor.", \"You secure [src.name] to the floor.", \"You hear a ratchet") + if(1) anchored = 0 + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \"You unsecure [src.name] from the floor.", \"You hear a ratchet") return else user << "The item is secured to the floor too firmly." diff --git a/code/modules/aurora/banner.dm b/code/modules/aurora/banner.dm index a3365b1a..6a457610 100644 --- a/code/modules/aurora/banner.dm +++ b/code/modules/aurora/banner.dm @@ -36,9 +36,13 @@ if(0) anchored = 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") + user.visible_message("[user.name] secures [src.name] to the floor.", \ + "You secure [src.name] to the floor.", \ + "You hear a ratchet") if(1) anchored = 0 playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \ + "You unsecure [src.name] from the floor.", \ + "You hear a ratchet") return diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 35337683..3ba573f6 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -181,7 +181,7 @@ add_fingerprint(usr) return 1 // update UIs attached to this object -/obj/machinery/chem_dispenser/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob) +/obj/machinery/chem_dispenser/attackby(var/obj/item/weapon/reagent_containers/B as obj, var/mob/user as mob) if(isrobot(user)) return @@ -209,20 +209,6 @@ user << "You set [B] on the machine." nanomanager.update_uis(src) // update all UIs attached to src return - if(istype(B, /obj/item/weapon/wrench)) - if(moveable == 1) - switch(anchored) - if(0) - playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - spawn(10) - user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") - anchored = 1 - if(1) - playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - spawn(10) - user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") - anchored = 0 - return /obj/machinery/chem_dispenser/attack_ai(mob/user as mob) return src.attack_hand(user) @@ -341,21 +327,6 @@ /obj/machinery/chem_master/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob) - if(istype(B, /obj/item/weapon/wrench)) - if(moveable == 1) - switch(anchored) - if(0) - playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - spawn(10) - user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") - anchored = 1 - if(1) - playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - spawn(10) - user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") - anchored = 0 - return - if(istype(B, /obj/item/weapon/reagent_containers/glass)) if(src.beaker) @@ -367,7 +338,8 @@ user << "You add the beaker to the machine!" src.updateUsrDialog() icon_state = "mixer1" - if(istype(B, /obj/item/weapon/storage/pill_bottle)) + + else if(istype(B, /obj/item/weapon/storage/pill_bottle)) if(src.loaded_pill_bottle) user << "A pill bottle is already loaded into the machine." From 2aebd69d579882e972986e73ac739f9d1e26888c Mon Sep 17 00:00:00 2001 From: skull132 Date: Tue, 19 Aug 2014 23:32:19 +0300 Subject: [PATCH 8/8] Moveable Machines Final II Second attempt, let's go. --- code/datums/supplypacks.dm | 4 +- code/game/machinery/Freezer.dm | 86 +++++++++++++++++--- code/game/machinery/machinery.dm | 12 +-- code/modules/aurora/banner.dm | 8 +- code/modules/reagents/Chemistry-Machinery.dm | 34 +++++++- 5 files changed, 117 insertions(+), 27 deletions(-) diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index 25cd881e..87f36323 100644 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -1118,7 +1118,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/atmos_freezer name = "Gas Cooling Unit" - contains = list() //MAKE A FREEZER THAT IS, BY DEFAULT, UNANCHORED! + contains = list(/obj/machinery/atmospherics/unary/cold_sink/freezer/cargo) //MAKE A FREEZER THAT IS, BY DEFAULT, UNANCHORED! cost = 50 containertype = /obj/structure/closet/crate/secure/large //Test if this works ((should)) containername = "gas cooling unit crate" @@ -1127,7 +1127,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/atmos_heater name = "Gas Heating Unit" - contains = list() //MAKE A COOLER THAT IS, BY DEFAULT, UNANCHORED! + contains = list(/obj/machinery/atmospherics/unary/heat_reservoir/heater/cargo) //MAKE A COOLER THAT IS, BY DEFAULT, UNANCHORED! cost = 50 containertype = /obj/structure/closet/crate/secure/large //Test if this works ((should)) containername = "gas heating unit crate" diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm index dcfbcd7b..dd31ed25 100644 --- a/code/game/machinery/Freezer.dm +++ b/code/game/machinery/Freezer.dm @@ -36,13 +36,22 @@ return /obj/machinery/atmospherics/unary/cold_sink/freezer/attack_ai(mob/user as mob) - src.ui_interact(user) + if(anchored == 1) + src.ui_interact(user) + else + user << "The machine is not wrenched down, you cannot interface with it." /obj/machinery/atmospherics/unary/cold_sink/freezer/attack_paw(mob/user as mob) - src.ui_interact(user) + if(anchored == 1) + src.ui_interact(user) + else + user << "The machine is not wrenched down, you cannot interface with it." /obj/machinery/atmospherics/unary/cold_sink/freezer/attack_hand(mob/user as mob) - src.ui_interact(user) + if(anchored == 1) + src.ui_interact(user) + else + user << "The machine is not wrenched down, you cannot interface with it." /obj/machinery/atmospherics/unary/cold_sink/freezer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) // this is the data which will be sent to the ui @@ -53,7 +62,7 @@ data["minGasTemperature"] = round(T0C - 200) data["maxGasTemperature"] = round(T20C) data["targetGasTemperature"] = round(current_temperature) - + var/temp_class = "good" if (air_contents.temperature > (T0C - 20)) temp_class = "bad" @@ -74,7 +83,7 @@ // auto update every Master Controller tick ui.set_auto_update(1) -/obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list) +/obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list) if (href_list["toggleStatus"]) src.on = !src.on update_icon() @@ -91,6 +100,28 @@ /obj/machinery/atmospherics/unary/cold_sink/freezer/process() ..() +/obj/machinery/atmospherics/unary/cold_sink/freezer/attackby(var/obj/item/W as obj, var/mob/user as mob) + if(src.on) + user << "You need to turn the machine off before unwrenching it." + else + if(istype(W, /obj/item/weapon/wrench)) + switch(anchored) + if(0) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") + anchored = 1 + initialize_directions = dir + if(1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") + anchored = 0 + return + +/obj/machinery/atmospherics/unary/cold_sink/freezer/cargo + anchored = 0 + /obj/machinery/atmospherics/unary/heat_reservoir/heater name = "gas heating system" icon = 'icons/obj/Cryogenic2.dmi' @@ -129,14 +160,23 @@ return /obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_ai(mob/user as mob) - src.ui_interact(user) + if(anchored == 1) + src.ui_interact(user) + else + user << "The machine is not wrenched down, you cannot interface with it." /obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_paw(mob/user as mob) - src.ui_interact(user) + if(anchored == 1) + src.ui_interact(user) + else + user << "The machine is not wrenched down, you cannot interface with it." /obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_hand(mob/user as mob) - src.ui_interact(user) - + if(anchored == 1) + src.ui_interact(user) + else + user << "The machine is not wrenched down, you cannot interface with it." + /obj/machinery/atmospherics/unary/heat_reservoir/heater/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) // this is the data which will be sent to the ui var/data[0] @@ -146,7 +186,7 @@ data["minGasTemperature"] = round(T20C) data["maxGasTemperature"] = round(T20C+280) data["targetGasTemperature"] = round(current_temperature) - + var/temp_class = "normal" if (air_contents.temperature > (T20C+40)) temp_class = "bad" @@ -175,9 +215,31 @@ src.current_temperature = min((T20C+280), src.current_temperature+amount) else src.current_temperature = max(T20C, src.current_temperature+amount) - + src.add_fingerprint(usr) return 1 /obj/machinery/atmospherics/unary/heat_reservoir/heater/process() - ..() \ No newline at end of file + ..() + +/obj/machinery/atmospherics/unary/heat_reservoir/heater/attackby(var/obj/item/W as obj, var/mob/user as mob) + if(src.on) + user << "You need to turn the machine off before unwrenching it." + else + if(istype(W, /obj/item/weapon/wrench)) + switch(anchored) + if(0) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") + anchored = 1 + initialize_directions = dir + if(1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") + anchored = 0 + return + +/obj/machinery/atmospherics/unary/heat_reservoir/heater/cargo + anchored = 0 \ No newline at end of file diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 427e4256..d8f05eb5 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -261,18 +261,20 @@ Class Procs: state(text, "blue") playsound(src.loc, 'sound/machines/ping.ogg', 50, 0) -/obj/machinery/attack_by(obj/item/W, mob/user) +/obj/machinery/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/weapon/wrench)) if(moveable == 1) switch(anchored) if(0) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") + spawn(10) anchored = 1 - playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - user.visible_message("[user.name] secures [src.name] to the floor.", \"You secure [src.name] to the floor.", \"You hear a ratchet") if(1) - anchored = 0 playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \"You unsecure [src.name] from the floor.", \"You hear a ratchet") + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") + spawn(10) + anchored = 0 return else user << "The item is secured to the floor too firmly." diff --git a/code/modules/aurora/banner.dm b/code/modules/aurora/banner.dm index 6a457610..a3365b1a 100644 --- a/code/modules/aurora/banner.dm +++ b/code/modules/aurora/banner.dm @@ -36,13 +36,9 @@ if(0) anchored = 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - user.visible_message("[user.name] secures [src.name] to the floor.", \ - "You secure [src.name] to the floor.", \ - "You hear a ratchet") + user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") if(1) anchored = 0 playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \ - "You unsecure [src.name] from the floor.", \ - "You hear a ratchet") + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") return diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 3ba573f6..3ef4165a 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -181,7 +181,7 @@ add_fingerprint(usr) return 1 // update UIs attached to this object -/obj/machinery/chem_dispenser/attackby(var/obj/item/weapon/reagent_containers/B as obj, var/mob/user as mob) +/obj/machinery/chem_dispenser/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob) if(isrobot(user)) return @@ -210,6 +210,21 @@ nanomanager.update_uis(src) // update all UIs attached to src return + if(istype(B, /obj/item/weapon/wrench)) + if(moveable == 1) + switch(anchored) + if(0) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") + anchored = 1 + if(1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") + anchored = 0 + return + /obj/machinery/chem_dispenser/attack_ai(mob/user as mob) return src.attack_hand(user) @@ -327,6 +342,21 @@ /obj/machinery/chem_master/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob) + if(istype(B, /obj/item/weapon/wrench)) + if(moveable == 1) + switch(anchored) + if(0) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] secures [src.name] to the floor.", "You secure [src.name] to the floor.", "You hear a ratchet") + anchored = 1 + if(1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + spawn(10) + user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", "You unsecure [src.name] from the floor.", "You hear a ratchet") + anchored = 0 + return + if(istype(B, /obj/item/weapon/reagent_containers/glass)) if(src.beaker) @@ -339,7 +369,7 @@ src.updateUsrDialog() icon_state = "mixer1" - else if(istype(B, /obj/item/weapon/storage/pill_bottle)) + if(istype(B, /obj/item/weapon/storage/pill_bottle)) if(src.loaded_pill_bottle) user << "A pill bottle is already loaded into the machine."