Files
Batrachophreno 4ecb0bc21c Repath obj/machinery to obj/structure/machinery [MDB Ignore] (#22500)
Repaths obj/machinery to obj/structure/machinery. **Note for
reviewers:** the only meaningful changed code exists within
**code/game/objects/structures.dm** and
**code/game/objects/structures/_machinery.dm**, largely concerning
damage procs. With the exception of moving airlock defines to their own
file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES.

Objects, _categorically_, are largely divided between those you can hold
in your hand/inventory and those you can't. Machinery objects are
already subtypes of Structures behaviorally, this PR just makes their
pathing reflect that, and allows for future work (tool actions, more
health/destruction functionality) to be developed without unnecessary
code duplication.

I have tested this PR by loading up the Horizon and dismantling various
machines and structures with tools, shooting guns of various types
throughout the ship, and detonating a bunch of explosions throughout the
ship.
2026-05-26 19:35:48 +00:00

73 lines
2.3 KiB
Plaintext

/obj/structure/machinery/orderterminal
name = "Idris Ordering Terminal"
desc = "An ordering terminal designed by Idris for quicker expedition."
icon = 'icons/obj/machinery/wall/terminals.dmi'
icon_state = "kitchenterminal"
anchored = 1
idle_power_usage = 10
var/machine_id = ""
var/list/items = list()
var/list/items_to_price = list()
var/list/buying = list()
var/new_item = ""
var/new_price = 0
var/sum = 0
var/editmode = FALSE // Permits the menu to be changed
var/confirmorder = FALSE // Waits for an id to confirm an order
var/receipt = ""
var/ticket = ""
var/destinationact = "Service"
var/ticket_number = 1
req_one_access = list(ACCESS_BAR, ACCESS_GALLEY, ACCESS_CARGO) // Access to change the menu
/obj/structure/machinery/orderterminal/mechanics_hints(mob/user, distance, is_adjacent)
. += ..()
. += "Items can be paid for with id cards or charge cards, and a receipt will be printed."
. += "The terminal can print a paper which can be used to quickly fill it out in the future by using it on the register."
/obj/structure/machinery/orderterminal/Initialize()
. = ..()
src.LoadComponent(/datum/component/quikpay_shop/orderterminal/food, req_one_access, destinationact)
update_icon()
/obj/structure/machinery/orderterminal/power_change()
..()
update_icon()
/obj/structure/machinery/orderterminal/update_icon()
ClearOverlays()
if(stat & NOPOWER)
set_light(FALSE)
return
var/mutable_appearance/screen_overlay = mutable_appearance(icon, "kitchenterminal-active", plane = ABOVE_LIGHTING_PLANE)
AddOverlays(screen_overlay)
set_light(1.4, 1, COLOR_CYAN)
/obj/structure/machinery/orderterminal/process()
if(stat & NOPOWER)
ClearOverlays()
set_light(FALSE)
return
/obj/structure/machinery/orderterminal/attack_hand(var/mob/user)
if(stat & NOPOWER)
balloon_alert(user, "no power")
return
var/datum/component/quikpay_shop/orderterminal/food/qp_shop = src.GetComponent(/datum/component/quikpay_shop/orderterminal/food)
if(!qp_shop)
return
qp_shop.ui_interact(user)
/obj/structure/machinery/orderterminal/attackby(obj/item/attacking_item, mob/user)
if(stat & NOPOWER)
balloon_alert(user, "no power")
return
var/datum/component/quikpay_shop/orderterminal/food/qp_shop = src.GetComponent(/datum/component/quikpay_shop/orderterminal/food)
if(!qp_shop)
return
qp_shop.interact_object(attacking_item, user)