Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anti-Assistant Food Carts (E.A.T.) #26021

Closed
Closed
2 changes: 1 addition & 1 deletion _maps/map_files/stations/boxstation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -22208,7 +22208,7 @@
},
/area/station/service/chapel)
"bpL" = (
/obj/machinery/smartfridge/foodcart,
/obj/machinery/smartfridge/secure/foodcart,
/turf/simulated/floor/plasteel{
icon_state = "cafeteria"
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/stations/cerestation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -82319,7 +82319,7 @@
/turf/simulated/floor/plating,
/area/station/maintenance/disposal/southwest)
"tgc" = (
/obj/machinery/smartfridge/foodcart{
/obj/machinery/smartfridge/secure/foodcart{
dir = 4
},
/turf/simulated/floor/plasteel{
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/stations/deltastation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -20767,13 +20767,13 @@
},
/area/station/security/permabrig)
"blf" = (
/obj/machinery/smartfridge/foodcart,
/obj/machinery/firealarm{
dir = 1;
name = "south bump";
pixel_y = -24
},
/obj/effect/turf_decal/delivery,
/obj/machinery/smartfridge/secure/foodcart,
/turf/simulated/floor/plasteel,
/area/station/service/kitchen)
"blh" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/stations/metastation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -80149,8 +80149,8 @@
},
/area/station/hallway/primary/aft/north)
"sgk" = (
/obj/machinery/smartfridge/foodcart,
/obj/machinery/alarm/directional/north,
/obj/machinery/smartfridge/secure/foodcart,
/turf/simulated/floor/plasteel{
icon_state = "showroomfloor"
},
Expand Down
89 changes: 88 additions & 1 deletion code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@
face_while_pulling = FALSE
silicon_controllable = FALSE


/obj/machinery/smartfridge/foodcart/Initialize(mapload)
. = ..()
accepted_items_typecache = typecacheof(list(
Expand All @@ -494,6 +493,94 @@
new /obj/item/stack/sheet/metal(loc, 4)
qdel(src)

/**
* # Food and Drink Cart
*
* Secure variant of the [Food Cart][/obj/machinery/smartfridge/foodcart].
*/
/obj/machinery/smartfridge/secure/foodcart
name = "E.A.T."
desc = "Short for the Entrée Armoured Transport, this technological marvel by Donk Co. allows Chefs to... for hawking your food and drink wares around the station, just with a bit more security."
SchrodingersWolf marked this conversation as resolved.
Show resolved Hide resolved
icon = 'icons/obj/kitchen.dmi'
icon_state = "foodcart"
anchored = FALSE
interact_offline = TRUE
power_state = NO_POWER_USE
visible_contents = FALSE
face_while_pulling = FALSE
silicon_controllable = FALSE

/obj/machinery/smartfridge/secure/foodcart/Initialize(mapload)
. = ..()
req_one_access_txt = "[ACCESS_KITCHEN], [ACCESS_BAR]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check that this works? req_one_access_txt seems to only split ;, and the accesses might have to have no spaces between

accepted_items_typecache = typecacheof(list(
/obj/item/food/snacks,
/obj/item/reagent_containers/drinks,
/obj/item/reagent_containers/condiment,
))

/obj/machinery/smartfridge/secure/foodcart/attackby(obj/item/O, mob/user, params) // Anti-theft technology, inspired by the station nuke
if(istype(O, /obj/item/card/id))
if(!allowed(user))
to_chat(user, "<span class='warning'>Access denied.</span>")
return
if(emagged)
to_chat(user, "<span class='warning'>The cart is silent as a brief puff of black smoke rises from the ID scanner.</span>")
return
if(anchored)
to_chat(user, "<span class='warning'>You release the locking mechanism, unanchoring the cart.</span>")
anchored = FALSE
playsound(loc, 'sound/machines/boltsup.ogg', 30, FALSE, 3)
return
to_chat(user, "<span class='warning'>You swipe your ID over the scanner, and with a steely snap, bolts slide out from underneath the cart securely anchoring the cart to the floor.</span>")
anchored = TRUE
playsound(loc, 'sound/machines/boltsdown.ogg', 30, FALSE, 3)
return TRUE
if(istype(O, /obj/item/airlock_electronics) && !istype(O, /obj/item/airlock_electronics/destroyed))
var/obj/item/airlock_electronics/new_electronics = O
if(!emagged)
to_chat(user, "<span class='warning'>The cart is working fine and doesn't needs repairs!</span>")
return
if(!user.drop_item())
to_chat(user, "<span class='warning'>\The [O] is stuck to you!</span>")
return FALSE
user.drop_item()
SchrodingersWolf marked this conversation as resolved.
Show resolved Hide resolved
SchrodingersWolf marked this conversation as resolved.
Show resolved Hide resolved
new_electronics.forceMove(src)
spawn_atom_to_turf(/obj/item/airlock_electronics/destroyed, user.loc, 1)
SchrodingersWolf marked this conversation as resolved.
Show resolved Hide resolved
emagged = FALSE
to_chat(user, "<span class='notice'>You swap out the burnt out electronics in the ID scanner.</span>")
return TRUE
return ..()

/obj/machinery/smartfridge/secure/foodcart/emag_act(mob/user)
. = ..()
if(anchored)
anchored = FALSE
playsound(loc, 'sound/machines/boltsup.ogg', 30, FALSE, 3)

/obj/machinery/smartfridge/secure/foodcart/emp_act(severity)
. = ..()
if(anchored)
anchored = FALSE
playsound(loc, 'sound/machines/boltsup.ogg', 30, FALSE, 3)

/obj/machinery/smartfridge/secure/foodcart/screwdriver_act(mob/living/user, obj/item/I)
return

/obj/machinery/smartfridge/secure/foodcart/wrench_act(mob/living/user, obj/item/I)
return

/obj/machinery/smartfridge/secure/foodcart/crowbar_act(mob/living/user, obj/item/I)
return

/obj/machinery/smartfridge/secure/foodcart/exchange_parts()
return

/obj/machinery/smartfridge/secure/foodcart/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
new /obj/item/stack/sheet/metal(loc, 4)
qdel(src)

/**
* # Circuit Boards Storage
*
Expand Down