Ports in radials for reagent grinders, alt click to eject beaker and beaker swapping.
This commit is contained in:
@@ -114,8 +114,9 @@ Will print: "/mob/living/carbon/human/death" (you can optionally embed it in a s
|
||||
|
||||
#define TRANSITIONEDGE 7 //Distance from edge to move to another z-level
|
||||
|
||||
#define BE_CLOSE 1 //in the case of a silicon, to select if they need to be next to the atom
|
||||
#define NO_DEXTERY 1 //if other mobs (monkeys, aliens, etc) can use this
|
||||
#define BE_CLOSE TRUE //in the case of a silicon, to select if they need to be next to the atom
|
||||
#define NO_DEXTERY TRUE //if other mobs (monkeys, aliens, etc) can use this
|
||||
#define NO_TK TRUE
|
||||
//used by canUseTopic()
|
||||
|
||||
//singularity defines
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
visible_message("<span class='warning'>[src] easily breaks out of [p_their()] handcuffs!</span>", \
|
||||
"<span class='notice'>With just a thought your handcuffs fall off.</span>")
|
||||
|
||||
/mob/living/carbon/true_devil/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/carbon/true_devil/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(incapacitated())
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
desc = "A pair of snazzy goggles used to protect against chemical spills. Fitted with an analyzer for scanning items and reagents."
|
||||
icon_state = "purple"
|
||||
item_state = "glasses"
|
||||
scan_reagents = 1 //You can see reagents while wearing science goggles
|
||||
scan_reagents = TRUE //You can see reagents while wearing science goggles
|
||||
actions_types = list(/datum/action/item_action/toggle_research_scanner)
|
||||
glass_colour_type = /datum/client_colour/glass_colour/purple
|
||||
resistance_flags = ACID_PROOF
|
||||
@@ -202,7 +202,7 @@
|
||||
/obj/item/clothing/glasses/sunglasses/reagent
|
||||
name = "beer goggles"
|
||||
desc = "A pair of sunglasses outfitted with apparatus to scan reagents."
|
||||
scan_reagents = 1
|
||||
scan_reagents = TRUE
|
||||
|
||||
/obj/item/clothing/glasses/sunglasses/garb
|
||||
name = "black gar glasses"
|
||||
@@ -377,7 +377,7 @@
|
||||
item_state = "godeye"
|
||||
vision_flags = SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||
darkness_view = 8
|
||||
scan_reagents = 1
|
||||
scan_reagents = TRUE
|
||||
item_flags = NODROP
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
|
||||
resistance_flags = LAVA_PROOF | FIRE_PROOF
|
||||
|
||||
@@ -445,7 +445,7 @@
|
||||
flash_protect = 0
|
||||
armor = list("melee" = 30, "bullet" = 5, "laser" = 10, "energy" = 5, "bomb" = 10, "bio" = 100, "rad" = 60, "fire" = 60, "acid" = 75)
|
||||
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR
|
||||
scan_reagents = 1
|
||||
scan_reagents = TRUE
|
||||
|
||||
/obj/item/clothing/suit/space/hardsuit/medical
|
||||
icon_state = "hardsuit-medical"
|
||||
@@ -467,7 +467,7 @@
|
||||
max_heat_protection_temperature = FIRE_SUIT_MAX_TEMP_PROTECT
|
||||
armor = list("melee" = 30, "bullet" = 5, "laser" = 10, "energy" = 5, "bomb" = 100, "bio" = 100, "rad" = 60, "fire" = 60, "acid" = 80)
|
||||
var/obj/machinery/doppler_array/integrated/bomb_radar
|
||||
scan_reagents = 1
|
||||
scan_reagents = TRUE
|
||||
actions_types = list(/datum/action/item_action/toggle_helmet_light, /datum/action/item_action/toggle_research_scanner)
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/rd/Initialize()
|
||||
@@ -626,7 +626,7 @@
|
||||
item_state = "anc_hardsuit"
|
||||
armor = list("melee" = 10, "bullet" = 5, "laser" = 5, "energy" = 500, "bomb" = 500, "bio" = 500, "rad" = 500, "fire" = 500, "acid" = 500)
|
||||
slowdown = 6 //Slow
|
||||
allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/storage, /obj/item/construction/rcd, /obj/item/pipe_dispenser)
|
||||
allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/storage, /obj/item/construction/rcd, /obj/item/pipe_dispenser)
|
||||
helmettype = /obj/item/clothing/head/helmet/space/hardsuit/ancient/mason
|
||||
max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
||||
@@ -639,7 +639,7 @@
|
||||
armor = list("melee" = 10, "bullet" = 5, "laser" = 5, "energy" = 500, "bomb" = 500, "bio" = 500, "rad" = 500, "fire" = 500, "acid" = 500)
|
||||
item_color = "ancient"
|
||||
brightness_on = 16
|
||||
scan_reagents = 1
|
||||
scan_reagents = TRUE
|
||||
flash_protect = 5 //We will not be flash by bombs
|
||||
tint = 1
|
||||
var/obj/machinery/doppler_array/integrated/bomb_radar
|
||||
|
||||
@@ -753,7 +753,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
update_icon()
|
||||
|
||||
/mob/dead/observer/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/dead/observer/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
return IsAdminGhost(usr)
|
||||
|
||||
/mob/dead/observer/is_literate()
|
||||
|
||||
@@ -725,12 +725,12 @@
|
||||
remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, "#000000")
|
||||
cut_overlay(MA)
|
||||
|
||||
/mob/living/carbon/human/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/carbon/human/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(incapacitated() || lying )
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
if(!Adjacent(M) && (M.loc != src))
|
||||
if((be_close == 0) || (dna.check_mutation(TK) && tkMaxRangeCheck(src, M)))
|
||||
if((be_close == 0) || (!no_tk && (dna.check_mutation(TK) && tkMaxRangeCheck(src, M))))
|
||||
return TRUE
|
||||
to_chat(src, "<span class='warning'>You are too far away!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -814,7 +814,7 @@
|
||||
/mob/living/proc/harvest(mob/living/user) //used for extra objects etc. in butchering
|
||||
return
|
||||
|
||||
/mob/living/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(incapacitated())
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -779,7 +779,7 @@
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/ai/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/silicon/ai/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(control_disabled || incapacitated())
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
|
||||
// See software.dm for Topic()
|
||||
|
||||
/mob/living/silicon/pai/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/silicon/pai/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(be_close && !in_range(M, src))
|
||||
to_chat(src, "<span class='warning'>You are too far away!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -910,7 +910,7 @@
|
||||
if(DISCONNECT) //Tampering with the wires
|
||||
to_chat(connected_ai, "<br><br><span class='notice'>NOTICE - Remote telemetry lost with [name].</span><br>")
|
||||
|
||||
/mob/living/silicon/robot/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/silicon/robot/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(stat || lockcharge || low_power_mode)
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -392,7 +392,7 @@
|
||||
if(target)
|
||||
return new childspawn(target)
|
||||
|
||||
/mob/living/simple_animal/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/living/simple_animal/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
if(incapacitated())
|
||||
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -784,7 +784,7 @@
|
||||
return 0
|
||||
|
||||
//Can the mob use Topic to interact with machines
|
||||
/mob/proc/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
/mob/proc/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
return
|
||||
|
||||
/mob/proc/faction_check_mob(mob/target, exact_match)
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
return machinery_computer.update_icon()
|
||||
|
||||
// This thing is not meant to be used on it's own, get topic data from our machinery owner.
|
||||
//obj/item/modular_computer/processor/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
|
||||
//obj/item/modular_computer/processor/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
// if(!machinery_computer)
|
||||
// return 0
|
||||
|
||||
|
||||
@@ -248,13 +248,8 @@
|
||||
work_animation()
|
||||
. = TRUE
|
||||
if("eject")
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
if(Adjacent(usr) && !issilicon(usr))
|
||||
usr.put_in_hands(beaker)
|
||||
beaker = null
|
||||
update_icon()
|
||||
. = TRUE
|
||||
replace_beaker(usr)
|
||||
. = TRUE //no afterattack
|
||||
if("dispense_recipe")
|
||||
if(!is_operational() || QDELETED(cell))
|
||||
return
|
||||
@@ -320,14 +315,12 @@
|
||||
return
|
||||
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
|
||||
var/obj/item/reagent_containers/B = I
|
||||
. = 1 //no afterattack
|
||||
if(beaker)
|
||||
to_chat(user, "<span class='warning'>A container is already loaded into [src]!</span>")
|
||||
return
|
||||
. = TRUE //no afterattack
|
||||
if(!user.transferItemToLoc(B, src))
|
||||
return
|
||||
beaker = B
|
||||
replace_beaker(user, B)
|
||||
to_chat(user, "<span class='notice'>You add [B] to [src].</span>")
|
||||
updateUsrDialog()
|
||||
update_icon()
|
||||
else if(user.a_intent != INTENT_HARM && !istype(I, /obj/item/card/emag))
|
||||
to_chat(user, "<span class='warning'>You can't load [I] into [src]!</span>")
|
||||
@@ -379,7 +372,17 @@
|
||||
dispensable_reagents |= upgrade_reagents3
|
||||
powerefficiency = round(newpowereff, 0.01)
|
||||
|
||||
|
||||
/obj/machinery/chem_dispenser/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
if(user && Adjacent(user) && !issiliconoradminghost(user))
|
||||
user.put_in_hands(beaker)
|
||||
if(new_beaker)
|
||||
beaker = new_beaker
|
||||
else
|
||||
beaker = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/chem_dispenser/on_deconstruction()
|
||||
cell = null
|
||||
@@ -415,6 +418,12 @@
|
||||
final_list += list(avoid_assoc_duplicate_keys(fuck[1],key_list) = text2num(fuck[2]))
|
||||
return final_list
|
||||
|
||||
/obj/machinery/chem_dispenser/AltClick(mob/living/user)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
replace_beaker(user)
|
||||
return
|
||||
|
||||
/obj/machinery/chem_dispenser/drinks/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE)
|
||||
|
||||
@@ -28,13 +28,23 @@
|
||||
else
|
||||
icon_state = "mixer0b"
|
||||
|
||||
/obj/machinery/chem_heater/proc/eject_beaker(mob/user)
|
||||
/obj/machinery/chem_heater/AltClick(mob/living/user)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
replace_beaker(user)
|
||||
return
|
||||
|
||||
/obj/machinery/chem_heater/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
if(Adjacent(user) && !issilicon(user))
|
||||
if(user && Adjacent(user) && !issiliconoradminghost(user))
|
||||
user.put_in_hands(beaker)
|
||||
if(new_beaker)
|
||||
beaker = new_beaker
|
||||
else
|
||||
beaker = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/chem_heater/RefreshParts()
|
||||
heater_coefficient = 0.1
|
||||
@@ -58,21 +68,19 @@
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
|
||||
. = 1 //no afterattack
|
||||
if(beaker)
|
||||
to_chat(user, "<span class='warning'>A container is already loaded into [src]!</span>")
|
||||
. = TRUE //no afterattack
|
||||
var/obj/item/reagent_containers/B = I
|
||||
if(!user.transferItemToLoc(B, src))
|
||||
return
|
||||
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
beaker = I
|
||||
to_chat(user, "<span class='notice'>You add [I] to [src].</span>")
|
||||
replace_beaker(user, B)
|
||||
to_chat(user, "<span class='notice'>You add [B] to [src].</span>")
|
||||
updateUsrDialog()
|
||||
update_icon()
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/chem_heater/on_deconstruction()
|
||||
eject_beaker()
|
||||
replace_beaker()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/chem_heater/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
@@ -122,5 +130,5 @@
|
||||
target_temperature = CLAMP(target, 0, 1000)
|
||||
if("eject")
|
||||
on = FALSE
|
||||
eject_beaker(usr)
|
||||
replace_beaker(usr)
|
||||
. = TRUE
|
||||
|
||||
@@ -60,16 +60,6 @@
|
||||
else
|
||||
icon_state = "mixer0"
|
||||
|
||||
/obj/machinery/chem_master/proc/eject_beaker(mob/user)
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
if(Adjacent(user) && !issilicon(user))
|
||||
user.put_in_hands(beaker)
|
||||
else
|
||||
adjust_item_drop_location(beaker)
|
||||
beaker = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/chem_master/blob_act(obj/structure/blob/B)
|
||||
if (prob(50))
|
||||
qdel(src)
|
||||
@@ -85,36 +75,49 @@
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
|
||||
. = 1 // no afterattack
|
||||
. = TRUE // no afterattack
|
||||
if(panel_open)
|
||||
to_chat(user, "<span class='warning'>You can't use the [src.name] while its panel is opened!</span>")
|
||||
return
|
||||
if(beaker)
|
||||
to_chat(user, "<span class='warning'>A container is already loaded into [src]!</span>")
|
||||
var/obj/item/reagent_containers/B = I
|
||||
if(!user.transferItemToLoc(B, src))
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
|
||||
beaker = I
|
||||
to_chat(user, "<span class='notice'>You add [I] to [src].</span>")
|
||||
src.updateUsrDialog()
|
||||
replace_beaker(user, B)
|
||||
to_chat(user, "<span class='notice'>You add [B] to [src].</span>")
|
||||
updateUsrDialog()
|
||||
update_icon()
|
||||
|
||||
else if(!condi && istype(I, /obj/item/storage/pill_bottle))
|
||||
if(bottle)
|
||||
to_chat(user, "<span class='warning'>A pill bottle is already loaded into [src]!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
|
||||
bottle = I
|
||||
to_chat(user, "<span class='notice'>You add [I] into the dispenser slot.</span>")
|
||||
src.updateUsrDialog()
|
||||
updateUsrDialog()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/chem_master/AltClick(mob/living/user)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
replace_beaker(user)
|
||||
return
|
||||
|
||||
/obj/machinery/chem_master/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
if(user && Adjacent(user) && !issiliconoradminghost(user))
|
||||
user.put_in_hands(beaker)
|
||||
if(new_beaker)
|
||||
beaker = new_beaker
|
||||
else
|
||||
beaker = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/chem_master/on_deconstruction()
|
||||
eject_beaker()
|
||||
replace_beaker(usr)
|
||||
if(bottle)
|
||||
bottle.forceMove(drop_location())
|
||||
adjust_item_drop_location(bottle)
|
||||
@@ -164,7 +167,7 @@
|
||||
return
|
||||
switch(action)
|
||||
if("eject")
|
||||
eject_beaker(usr)
|
||||
replace_beaker(usr)
|
||||
. = TRUE
|
||||
|
||||
if("ejectp")
|
||||
|
||||
@@ -19,6 +19,12 @@
|
||||
var/speed = 1
|
||||
var/list/holdingitems
|
||||
|
||||
var/static/radial_examine = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_examine")
|
||||
var/static/radial_eject = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_eject")
|
||||
var/static/radial_grind = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_grind")
|
||||
var/static/radial_juice = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_juice")
|
||||
var/static/radial_mix = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_mix")
|
||||
|
||||
/obj/machinery/reagentgrinder/Initialize()
|
||||
. = ..()
|
||||
holdingitems = list()
|
||||
@@ -51,7 +57,6 @@
|
||||
if(A == beaker)
|
||||
beaker = null
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
if(holdingitems[A])
|
||||
holdingitems -= A
|
||||
|
||||
@@ -67,6 +72,18 @@
|
||||
else
|
||||
icon_state = "juicer0"
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
if(user && Adjacent(user) && !issiliconoradminghost(user))
|
||||
user.put_in_hands(beaker)
|
||||
if(new_beaker)
|
||||
beaker = new_beaker
|
||||
else
|
||||
beaker = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/reagentgrinder/attackby(obj/item/I, mob/user, params)
|
||||
//You can only screw open empty grinder
|
||||
if(!beaker && !length(holdingitems) && default_deconstruction_screwdriver(user, icon_state, icon_state, I))
|
||||
@@ -82,17 +99,14 @@
|
||||
return TRUE
|
||||
|
||||
if (istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
|
||||
if (!beaker)
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
|
||||
return TRUE
|
||||
to_chat(user, "<span class='notice'>You slide [I] into [src].</span>")
|
||||
beaker = I
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>There's already a container inside [src].</span>")
|
||||
return TRUE //no afterattack
|
||||
var/obj/item/reagent_containers/B = I
|
||||
. = TRUE
|
||||
if(!user.transferItemToLoc(B, src))
|
||||
return
|
||||
replace_beaker(user, B)
|
||||
to_chat(user, "<span class='notice'>You add [B] to [src].</span>")
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(holdingitems.len >= limit)
|
||||
to_chat(user, "<span class='warning'>[src] is filled to capacity!</span>")
|
||||
@@ -108,8 +122,6 @@
|
||||
to_chat(user, "<span class='notice'>You empty [I] into [src].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You fill [src] to the brim.</span>")
|
||||
|
||||
updateUsrDialog()
|
||||
return TRUE
|
||||
|
||||
if(!I.grind_results && !I.juice_results)
|
||||
@@ -125,104 +137,89 @@
|
||||
if(user.transferItemToLoc(I, src))
|
||||
to_chat(user, "<span class='notice'>You add [I] to [src].</span>")
|
||||
holdingitems[I] = TRUE
|
||||
updateUsrDialog()
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/reagentgrinder/ui_interact(mob/user) // The microwave Menu //I am reasonably certain that this is not a microwave
|
||||
. = ..()
|
||||
var/is_chamber_empty = FALSE
|
||||
var/is_beaker_ready = FALSE
|
||||
var/processing_chamber = ""
|
||||
var/beaker_contents = ""
|
||||
var/dat = ""
|
||||
|
||||
if(!operating)
|
||||
for (var/i in holdingitems)
|
||||
var/obj/item/O = i
|
||||
processing_chamber += "\A [O.name]<BR>"
|
||||
if(operating || !user.canUseTopic(src, !issilicon(user)))
|
||||
return
|
||||
|
||||
if (!processing_chamber)
|
||||
is_chamber_empty = TRUE
|
||||
processing_chamber = "Nothing."
|
||||
if (!beaker)
|
||||
beaker_contents = "<B>No beaker attached.</B><br>"
|
||||
else
|
||||
is_beaker_ready = TRUE
|
||||
beaker_contents = "<B>The beaker contains:</B><br>"
|
||||
var/anything = FALSE
|
||||
for(var/datum/reagent/R in beaker.reagents.reagent_list)
|
||||
anything = TRUE
|
||||
beaker_contents += "[R.volume] - [R.name]<br>"
|
||||
if(!anything)
|
||||
beaker_contents += "Nothing<br>"
|
||||
var/list/options = list()
|
||||
|
||||
dat = {"
|
||||
<b>Processing chamber contains:</b><br>
|
||||
[processing_chamber]<br>
|
||||
[beaker_contents]<hr>
|
||||
"}
|
||||
if (is_beaker_ready)
|
||||
if(!is_chamber_empty && !(stat & (NOPOWER|BROKEN)))
|
||||
dat += "<A href='?src=[REF(src)];action=grind'>Grind the reagents</a><BR>"
|
||||
dat += "<A href='?src=[REF(src)];action=juice'>Juice the reagents</a><BR><BR>"
|
||||
else if (beaker.reagents.total_volume)
|
||||
dat += "<A href='?src=[REF(src)];action=mix'>Mix the reagents</a><BR><BR>"
|
||||
if(length(holdingitems))
|
||||
dat += "<A href='?src=[REF(src)];action=eject'>Eject the reagents</a><BR>"
|
||||
if(beaker)
|
||||
dat += "<A href='?src=[REF(src)];action=detach'>Detach the beaker</a><BR>"
|
||||
if(beaker || length(holdingitems))
|
||||
options["eject"] = radial_eject
|
||||
|
||||
if(isAI(user))
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
options["examine"] = radial_examine
|
||||
|
||||
// if there is no power or it's broken, the procs will fail but the buttons will still show
|
||||
if(length(holdingitems))
|
||||
options["grind"] = radial_grind
|
||||
options["juice"] = radial_juice
|
||||
else if(beaker?.reagents.total_volume)
|
||||
options["mix"] = radial_mix
|
||||
|
||||
var/choice
|
||||
|
||||
if(length(options) < 1)
|
||||
return
|
||||
if(length(options) == 1)
|
||||
for(var/key in options)
|
||||
choice = key
|
||||
else
|
||||
dat += "Please wait..."
|
||||
choice = show_radial_menu(user, src, options, require_near = !issilicon(user))
|
||||
|
||||
var/datum/browser/popup = new(user, "reagentgrinder", "All-In-One Grinder")
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(icon, icon_state))
|
||||
popup.open(1)
|
||||
return
|
||||
// post choice verification
|
||||
if(operating || (isAI(user) && stat & NOPOWER) || !user.canUseTopic(src, !issilicon(user)))
|
||||
return
|
||||
|
||||
/obj/machinery/reagentgrinder/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
var/mob/user = usr
|
||||
if(!user.canUseTopic(src))
|
||||
return
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
user.set_machine(src)
|
||||
if(operating)
|
||||
updateUsrDialog()
|
||||
return
|
||||
switch(href_list["action"])
|
||||
if ("grind")
|
||||
switch(choice)
|
||||
if("eject")
|
||||
eject(user)
|
||||
if("grind")
|
||||
grind(user)
|
||||
if("juice")
|
||||
juice(user)
|
||||
if("mix")
|
||||
mix(user)
|
||||
if("eject")
|
||||
eject(user)
|
||||
if("detach")
|
||||
detach(user)
|
||||
updateUsrDialog()
|
||||
if("examine")
|
||||
examine(user)
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/detach(mob/user)
|
||||
if(!beaker)
|
||||
/obj/machinery/reagentgrinder/examine(mob/user)
|
||||
. = ..()
|
||||
if(!in_range(user, src) && !issilicon(user) && !isobserver(user))
|
||||
to_chat(user, "<span class='warning'>You're too far away to examine [src]'s contents and display!</span>")
|
||||
return
|
||||
beaker.forceMove(drop_location())
|
||||
if(Adjacent(user) && !issilicon(user))
|
||||
user.put_in_hands(beaker)
|
||||
beaker = null
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
|
||||
if(operating)
|
||||
to_chat(user, "<span class='warning'>\The [src] is operating.</span>")
|
||||
return
|
||||
|
||||
if(beaker || length(holdingitems))
|
||||
to_chat(user, "<span class='notice'>\The [src] contains:</span>")
|
||||
if(beaker)
|
||||
to_chat(user, "<span class='notice'>- \A [beaker].</span>")
|
||||
for(var/i in holdingitems)
|
||||
var/obj/item/O = i
|
||||
to_chat(user, "<span class='notice'>- \A [O.name].</span>")
|
||||
|
||||
if(!(stat & (NOPOWER|BROKEN)))
|
||||
to_chat(user, "<span class='notice'>The status display reads:</span>")
|
||||
to_chat(user, "<span class='notice'>- Grinding reagents at <b>[speed*100]%</b>.<span>")
|
||||
if(beaker)
|
||||
for(var/datum/reagent/R in beaker.reagents.reagent_list)
|
||||
to_chat(user, "<span class='notice'>- [R.volume] units of [R.name].</span>")
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/eject(mob/user)
|
||||
if(!length(holdingitems))
|
||||
return
|
||||
for(var/i in holdingitems)
|
||||
var/obj/item/O = i
|
||||
O.forceMove(drop_location())
|
||||
holdingitems -= O
|
||||
updateUsrDialog()
|
||||
if(beaker)
|
||||
replace_beaker(user)
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/remove_object(obj/item/O)
|
||||
holdingitems -= O
|
||||
@@ -240,7 +237,6 @@
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/operate_for(time, silent = FALSE, juicing = FALSE)
|
||||
shake_for(time / speed)
|
||||
updateUsrDialog()
|
||||
operating = TRUE
|
||||
if(!silent)
|
||||
if(!juicing)
|
||||
@@ -251,11 +247,10 @@
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/stop_operating()
|
||||
operating = FALSE
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/juice()
|
||||
power_change()
|
||||
if(!beaker || (beaker && (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)))
|
||||
if(!beaker || stat & (NOPOWER|BROKEN) || beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
return
|
||||
operate_for(50, juicing = TRUE)
|
||||
for(var/obj/item/i in holdingitems)
|
||||
@@ -274,7 +269,7 @@
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/grind()
|
||||
power_change()
|
||||
if(!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
|
||||
if(!beaker || stat & (NOPOWER|BROKEN) || beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
return
|
||||
operate_for(60)
|
||||
for(var/i in holdingitems)
|
||||
@@ -296,13 +291,13 @@
|
||||
/obj/machinery/reagentgrinder/proc/mix(mob/user)
|
||||
//For butter and other things that would change upon shaking or mixing
|
||||
power_change()
|
||||
if(!beaker)
|
||||
if(!beaker || stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
operate_for(50, juicing = TRUE)
|
||||
addtimer(CALLBACK(src, /obj/machinery/reagentgrinder/proc/mix_complete), 50)
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/mix_complete()
|
||||
if(beaker && beaker.reagents.total_volume)
|
||||
if(beaker?.reagents.total_volume)
|
||||
//Recipe to make Butter
|
||||
var/butter_amt = FLOOR(beaker.reagents.get_reagent_amount("milk") / MILK_TO_BUTTER_COEFF, 1)
|
||||
beaker.reagents.remove_reagent("milk", MILK_TO_BUTTER_COEFF * butter_amt)
|
||||
|
||||
Reference in New Issue
Block a user