Adds the cash register (#20138)

* You asked

* Tweaks

* Update eftpos.dm

* Adding registers

* good luck meta you'll need it

* Update eftpos.dm

* More sounds

* More sounds, you can pay as long as you're close to the register.

* Tone down the edits, chefs will figure it out

* tim allen grunt

* Update eftpos.dm

* Update eftpos.dm

* Update code/modules/economy/economy_machinery/eftpos.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* Ceres is a thing now

* Fix merge

* Update eftpos.dm

---------

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
Vi3trice
2023-02-14 05:14:10 -05:00
committed by GitHub
parent 93f26cf5aa
commit f428cee612
10 changed files with 124 additions and 21 deletions
+12 -1
View File
@@ -10276,6 +10276,14 @@
/obj/effect/decal/warning_stripes/yellow/hollow,
/turf/simulated/floor/plasteel,
/area/quartermaster/storage)
"aIg" = (
/obj/structure/table/reinforced,
/obj/item/eftpos/register{
dir = 1;
pixel_y = 9
},
/turf/simulated/floor/plasteel/dark,
/area/crew_quarters/bar)
"aIh" = (
/obj/machinery/conveyor/southeast{
id = "cargodelivery"
@@ -22791,6 +22799,9 @@
/obj/item/clipboard,
/obj/item/toy/figure/crew/chef,
/obj/effect/decal/warning_stripes/yellow/hollow,
/obj/item/eftpos/register{
dir = 1
},
/turf/simulated/floor/plasteel,
/area/crew_quarters/kitchen)
"blq" = (
@@ -135594,7 +135605,7 @@ aFA
aGB
aMi
aJa
aKs
aIg
bsq
aOG
aOG
+11 -1
View File
@@ -30013,6 +30013,9 @@
dir = 4
},
/obj/effect/turf_decal/tile/bar,
/obj/item/eftpos/register{
dir = 8
},
/turf/simulated/floor/plasteel{
dir = 1;
icon_state = "whitecorner"
@@ -84982,6 +84985,13 @@
},
/turf/simulated/floor/plasteel,
/area/toxins/xenobiology)
"udl" = (
/obj/structure/table/reinforced,
/obj/item/eftpos/register,
/turf/simulated/floor/plasteel{
icon_state = "bar"
},
/area/crew_quarters/bar)
"udB" = (
/obj/machinery/atmospherics/unary/vent_scrubber/on,
/turf/simulated/floor/plasteel,
@@ -126318,7 +126328,7 @@ mZL
bCv
bEv
bHO
bGd
udl
bJH
bLx
lUc
+4 -1
View File
@@ -11816,6 +11816,7 @@
/obj/structure/table,
/obj/item/reagent_containers/glass/beaker,
/obj/item/reagent_containers/food/condiment/enzyme,
/obj/item/eftpos/register,
/turf/simulated/floor/plasteel{
icon_state = "cafeteria"
},
@@ -53916,7 +53917,9 @@
/area/hallway/secondary/exit)
"iWD" = (
/obj/structure/table/glass/reinforced,
/obj/item/phone/pos,
/obj/item/eftpos/register{
dir = 8
},
/turf/simulated/floor/wood,
/area/crew_quarters/bar)
"iWF" = (
+10 -4
View File
@@ -24748,6 +24748,10 @@
"bkP" = (
/obj/structure/table/reinforced,
/obj/item/reagent_containers/glass/rag,
/obj/item/eftpos/register{
dir = 1;
pixel_y = 11
},
/turf/simulated/floor/plasteel{
icon_state = "grimy"
},
@@ -28145,6 +28149,7 @@
},
/obj/structure/table,
/obj/item/book/manual/wiki/sop_service,
/obj/item/eftpos/register,
/turf/simulated/floor/plasteel{
icon_state = "cafeteria"
},
@@ -41520,7 +41525,7 @@
pixel_y = 7;
pixel_x = -8
},
/obj/item/phone/pos,
/obj/item/eftpos/register,
/turf/simulated/floor/plating,
/area/maintenance/apmaint)
"caq" = (
@@ -52687,7 +52692,9 @@
/area/maintenance/apmaint2)
"cFL" = (
/obj/structure/table/reinforced,
/obj/item/phone/pos,
/obj/item/eftpos/register{
dir = 8
},
/turf/simulated/floor/wood,
/area/maintenance/apmaint2)
"cFM" = (
@@ -62955,7 +62962,6 @@
dir = 4
},
/obj/structure/table/reinforced,
/obj/item/phone/pos,
/turf/simulated/floor/plasteel{
icon_state = "grimy"
},
@@ -67152,7 +67158,7 @@
"eIN" = (
/obj/structure/table/reinforced,
/obj/effect/spawner/lootdrop/maintenance,
/obj/item/phone/pos,
/obj/item/eftpos/register,
/turf/simulated/floor/plating,
/area/maintenance/aft)
"eJo" = (
+2
View File
@@ -64,6 +64,8 @@ GLOBAL_LIST_INIT(surgery_tool_behaviors, list(
//Wrench messages
#define WRENCH_ANCHOR_MESSAGE user.visible_message("<span class='notice'>[user] tightens the bolts on [src]!</span>", "<span class='notice'>You tighten the bolts on [src]!</span>", "<span class='warning'>You hear ratcheting.</span>")
#define WRENCH_UNANCHOR_MESSAGE user.visible_message("<span class='notice'>[user] loosens the bolts on [src]!</span>", "<span class='notice'>You loosen the bolts on [src]!</span>", "<span class='warning'>You hear ratcheting.</span>")
#define WRENCH_ATTEMPT_ANCHOR_MESSAGE user.visible_message("<span class='notice'>[user] begins tightening the bolts on [src]...</span>", "<span class='notice'>You begin tightening the bolts on [src]...</span>", "<span class='warning'>You hear ratcheting.</span>")
#define WRENCH_ATTEMPT_UNANCHOR_MESSAGE user.visible_message("<span class='notice'>[user] begins loosening the bolts on [src]...</span>", "<span class='notice'>You begin loosening the bolts on [src]...</span>", "<span class='warning'>You hear ratcheting.</span>")
#define WRENCH_UNANCHOR_WALL_MESSAGE user.visible_message("<span class='notice'>[user] unwrenches [src] from the wall!</span>", "<span class='notice'>You unwrench [src] from the wall!</span>", "<span class='warning'>You hear ratcheting.</span>")
#define WRENCH_ANCHOR_TO_WALL_MESSAGE user.visible_message("<span class='notice'>[user] affixes [src] to the wall!</span>", "<span class='notice'>You affix [src] to the wall!</span>", "<span class='warning'>You hear ratcheting.</span>")
@@ -145,10 +145,3 @@
if(cooldown < world.time - 20)
playsound(user.loc, 'sound/weapons/ring.ogg', 50, 1)
cooldown = world.time
/obj/item/phone/pos
name = "point of sale"
desc = "Also known as a cash register, or, more commonly, \"robbery magnet\". It's old and rusty, clearly non-functional and decorative only."
icon = 'icons/obj/machines/pos.dmi'
icon_state = "pos"
attack_verb = list("bounced a check off", "checked-out", "tipped")
@@ -12,6 +12,7 @@
var/transaction_amount = 0
var/transaction_purpose = "Default charge"
var/access_code
var/transaction_sound = 'sound/machines/chime.ogg'
///linked money account database to this EFTPOS
var/datum/money_account_database/account_database
@@ -94,7 +95,7 @@
if(account_database)
var/attempt_account_num = input("Enter account number to pay EFTPOS charges into", "New account number") as num
var/attempt_pin = input("Enter pin code", "Account pin") as num
if(!Adjacent(user))
if(!check_user_position(user))
return
var/datum/money_account/target_account = GLOB.station_money_database.find_user_account(attempt_account_num, include_departments = TRUE)
if(!target_account)
@@ -110,13 +111,13 @@
to_chat(user, "[bicon(src)]<span class='warning'>Unable to connect to accounts database.</span>")
if("trans_purpose")
var/purpose = clean_input("Enter reason for EFTPOS transaction", "Transaction purpose", transaction_purpose)
if(!Adjacent(user))
if(!check_user_position(user))
return
if(purpose)
transaction_purpose = purpose
if("trans_value")
var/try_num = input("Enter amount for EFTPOS transaction", "Transaction amount", transaction_amount) as num
if(!Adjacent(user))
if(!check_user_position(user))
return
if(try_num < 0)
alert("That is not a valid amount!")
@@ -128,7 +129,7 @@
if("toggle_lock")
if(transaction_locked)
var/attempt_code = input("Enter EFTPOS access code", "Reset Transaction") as num
if(!Adjacent(user))
if(!check_user_position(user))
return
if(attempt_code == access_code)
transaction_locked = FALSE
@@ -160,10 +161,10 @@
to_chat(user, "[bicon(src)]<span class='info'>Access code reset to 0.</span>")
/obj/item/eftpos/proc/scan_card(obj/item/card/id/C, mob/user)
/obj/item/eftpos/proc/scan_card(obj/item/card/id/C, mob/user, secured = TRUE)
visible_message("<span class='info'>[user] swipes a card through [src].</span>")
if(!transaction_locked || transaction_paid)
if(!transaction_locked || transaction_paid || !secured)
return
if(!linked_account)
@@ -190,7 +191,7 @@
to_chat(user, "[bicon(src)]<span class='warning'>Insufficient credits in your account!</span>")
return
GLOB.station_money_database.credit_account(linked_account, transaction_amount, transaction_purpose, machine_name, FALSE)
playsound(src, 'sound/machines/chime.ogg', 50, 1)
playsound(src, transaction_sound, 50, TRUE)
visible_message("<span class='notice'>[src] chimes!</span>")
transaction_paid = TRUE
@@ -218,3 +219,80 @@
R.forceMove(D)
D.wrapped = R
D.name = "small parcel - 'EFTPOS access code'"
/obj/item/eftpos/proc/check_user_position(mob/user)
return Adjacent(user)
/obj/item/eftpos/register
name = "point of sale"
desc = "Also known as a cash register, or, more commonly, \"robbery magnet\". It's old and rusty, and had an EFTPOS module fitted in it."
icon = 'icons/obj/machines/pos.dmi'
icon_state = "pos"
force = 10
throwforce = 10
throw_speed = 1.5
throw_range = 7
anchored = TRUE
w_class = WEIGHT_CLASS_BULKY
hitsound = 'sound/weapons/ringslam.ogg'
drop_sound = 'sound/items/handling/register_drop.ogg'
pickup_sound = 'sound/items/handling/toolbox_pickup.ogg'
transaction_sound = 'sound/machines/checkout.ogg'
attack_verb = list("bounced a check off", "checked-out", "tipped")
/obj/item/eftpos/register/examine(mob/user)
. = ..()
if(!anchored)
. += "<span class='notice'>Alt-click to rotate it.</span>"
else
. += "<span class='notice'>It is secured in place.</span>"
/obj/item/eftpos/register/AltClick(mob/user)
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(!Adjacent(user))
return
if(anchored)
to_chat(user, "<span class='warning'>[src] is secured in place!</span>")
return
setDir(turn(dir, 90))
/obj/item/eftpos/register/attack_hand(mob/user)
if(anchored)
if(!check_user_position(user))
to_chat(user, "<span class='warning'>You need to be behind [src] to use it!</span>")
return
add_fingerprint(user)
ui_interact(user, state = GLOB.human_adjacent_state)
return TRUE
return ..()
/obj/item/eftpos/register/attack_self(mob/user)
to_chat(user, "<span class='notice'>[src] has to be set down and secured to be used.</span>")
/obj/item/eftpos/register/check_user_position(mob/user)
if(!..())
return FALSE
var/user_loc = get_dir(src, user)
if(!user_loc || user_loc & dir)
return TRUE
return FALSE
/obj/item/eftpos/register/scan_card(obj/item/card/id/C, mob/user)
..(C, user, anchored)
/obj/item/eftpos/register/wrench_act(mob/user, obj/item/I)
. = TRUE
if(anchored)
WRENCH_ATTEMPT_UNANCHOR_MESSAGE
else
WRENCH_ATTEMPT_ANCHOR_MESSAGE
if(!I.use_tool(src, user, 5 SECONDS, volume = I.tool_volume))
return
anchored = !anchored
if(anchored)
WRENCH_ANCHOR_MESSAGE
else
WRENCH_UNANCHOR_MESSAGE
SStgui.close_uis(src)
Binary file not shown.
Binary file not shown.
Binary file not shown.