mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
EFTPOS scanners now work with IDs in PDAs and wallets
Vending machine code revised slightly "\the" added to visible messages where applicable
This commit is contained in:
@@ -210,7 +210,7 @@
|
|||||||
return
|
return
|
||||||
else if (istype(W, /obj/item/weapon/card/emag))
|
else if (istype(W, /obj/item/weapon/card/emag))
|
||||||
src.emagged = 1
|
src.emagged = 1
|
||||||
user << "You short out the product lock on [src]"
|
user << "You short out the product lock on \the [src]"
|
||||||
return
|
return
|
||||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||||
src.panel_open = !src.panel_open
|
src.panel_open = !src.panel_open
|
||||||
@@ -230,7 +230,7 @@
|
|||||||
W.loc = src
|
W.loc = src
|
||||||
coin = W
|
coin = W
|
||||||
categories |= CAT_COIN
|
categories |= CAT_COIN
|
||||||
user << "\blue You insert the [W] into the [src]"
|
user << "\blue You insert \the [W] into \the [src]"
|
||||||
nanomanager.update_uis(src)
|
nanomanager.update_uis(src)
|
||||||
return
|
return
|
||||||
else if(istype(W, /obj/item/weapon/wrench))
|
else if(istype(W, /obj/item/weapon/wrench))
|
||||||
@@ -240,9 +240,9 @@
|
|||||||
switch (anchored)
|
switch (anchored)
|
||||||
if (0)
|
if (0)
|
||||||
anchored = 1
|
anchored = 1
|
||||||
user.visible_message("[user] tightens the bolts securing \the [src] to the floor.", "You tighten the bolts securing \the [src] to the floor.")
|
user.visible_message("\The [user] tightens the bolts securing \the [src] to the floor.", "You tighten the bolts securing \the [src] to the floor.")
|
||||||
if (1)
|
if (1)
|
||||||
user.visible_message("[user] unfastens the bolts securing \the [src] to the floor.", "You unfasten the bolts securing \the [src] to the floor.")
|
user.visible_message("\The [user] unfastens the bolts securing \the [src] to the floor.", "You unfasten the bolts securing \the [src] to the floor.")
|
||||||
anchored = 0
|
anchored = 0
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@
|
|||||||
if(istype(cashmoney, /obj/item/weapon/spacecash/bundle))
|
if(istype(cashmoney, /obj/item/weapon/spacecash/bundle))
|
||||||
// Bundles can just have money subtracted, and will work
|
// Bundles can just have money subtracted, and will work
|
||||||
|
|
||||||
visible_message("<span class='info'>[usr] inserts some cash into [src].</span>")
|
visible_message("<span class='info'>\The [usr] inserts some cash into \the [src].</span>")
|
||||||
var/obj/item/weapon/spacecash/bundle/cashmoney_bundle = cashmoney
|
var/obj/item/weapon/spacecash/bundle/cashmoney_bundle = cashmoney
|
||||||
cashmoney_bundle.worth -= currently_vending.price
|
cashmoney_bundle.worth -= currently_vending.price
|
||||||
|
|
||||||
@@ -287,7 +287,7 @@
|
|||||||
// This is really dirty, but there's no superclass for all bills, so we
|
// This is really dirty, but there's no superclass for all bills, so we
|
||||||
// just assume that all spacecash that's not something else is a bill
|
// just assume that all spacecash that's not something else is a bill
|
||||||
|
|
||||||
visible_message("<span class='info'>[usr] inserts a bill into [src].</span>")
|
visible_message("<span class='info'>\The [usr] inserts a bill into \the [src].</span>")
|
||||||
var/left = cashmoney.worth - currently_vending.price
|
var/left = cashmoney.worth - currently_vending.price
|
||||||
usr.drop_from_inventory(cashmoney)
|
usr.drop_from_inventory(cashmoney)
|
||||||
del(cashmoney)
|
del(cashmoney)
|
||||||
@@ -306,7 +306,7 @@
|
|||||||
* successful, 0 if failed.
|
* successful, 0 if failed.
|
||||||
*/
|
*/
|
||||||
/obj/machinery/vending/proc/pay_with_ewallet(var/obj/item/weapon/spacecash/ewallet/wallet)
|
/obj/machinery/vending/proc/pay_with_ewallet(var/obj/item/weapon/spacecash/ewallet/wallet)
|
||||||
visible_message("<span class='info'>[usr] swipes [wallet] through [src].</span>")
|
visible_message("<span class='info'>\The [usr] swipes \the [wallet] through \the [src].</span>")
|
||||||
if(currently_vending.price > wallet.worth)
|
if(currently_vending.price > wallet.worth)
|
||||||
src.status_message = "Insufficient funds on chargecard."
|
src.status_message = "Insufficient funds on chargecard."
|
||||||
src.status_error = 1
|
src.status_error = 1
|
||||||
@@ -323,10 +323,10 @@
|
|||||||
* successful, 0 if failed
|
* successful, 0 if failed
|
||||||
*/
|
*/
|
||||||
/obj/machinery/vending/proc/pay_with_card(var/obj/item/weapon/card/id/I, var/obj/item/ID_container)
|
/obj/machinery/vending/proc/pay_with_card(var/obj/item/weapon/card/id/I, var/obj/item/ID_container)
|
||||||
if(ID_container)
|
if(I==ID_container || ID_container == null)
|
||||||
visible_message("<span class='info'>[usr] swipes [ID_container] through [src].</span>")
|
visible_message("<span class='info'>\The [usr] swipes \the [I] through \the [src].</span>")
|
||||||
else
|
else
|
||||||
visible_message("<span class='info'>[usr] swipes [I] through [src].</span>")
|
visible_message("<span class='info'>\The [usr] swipes \the [ID_container] through \the [src].</span>")
|
||||||
var/datum/money_account/customer_account = get_account(I.associated_account_number)
|
var/datum/money_account/customer_account = get_account(I.associated_account_number)
|
||||||
if (!customer_account)
|
if (!customer_account)
|
||||||
src.status_message = "Error: Unable to access account. Please contact technical support if problem persists."
|
src.status_message = "Error: Unable to access account. Please contact technical support if problem persists."
|
||||||
@@ -538,7 +538,7 @@
|
|||||||
return
|
return
|
||||||
if(coin.string_attached)
|
if(coin.string_attached)
|
||||||
if(prob(50))
|
if(prob(50))
|
||||||
user << "\blue You successfully pull the coin out before the [src] could swallow it."
|
user << "\blue You successfully pull the coin out before \the [src] could swallow it."
|
||||||
else
|
else
|
||||||
user << "\blue You weren't able to pull the coin out fast enough, the machine ate it, string and all."
|
user << "\blue You weren't able to pull the coin out fast enough, the machine ate it, string and all."
|
||||||
del(coin)
|
del(coin)
|
||||||
@@ -567,7 +567,7 @@
|
|||||||
|
|
||||||
/obj/machinery/vending/proc/stock(var/datum/data/vending_product/R, var/mob/user)
|
/obj/machinery/vending/proc/stock(var/datum/data/vending_product/R, var/mob/user)
|
||||||
if(src.panel_open)
|
if(src.panel_open)
|
||||||
user << "\blue You stock the [src] with \a [R.product_name]"
|
user << "\blue You stock \the [src] with \a [R.product_name]"
|
||||||
R.amount++
|
R.amount++
|
||||||
|
|
||||||
nanomanager.update_uis(src)
|
nanomanager.update_uis(src)
|
||||||
@@ -601,7 +601,7 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
for(var/mob/O in hearers(src, null))
|
for(var/mob/O in hearers(src, null))
|
||||||
O.show_message("<span class='game say'><span class='name'>[src]</span> beeps, \"[message]\"",2)
|
O.show_message("<span class='game say'><span class='name'>\The [src]</span> beeps, \"[message]\"",2)
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/machinery/vending/power_change()
|
/obj/machinery/vending/power_change()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/obj/item/device/eftpos
|
/obj/item/device/eftpos
|
||||||
name = "EFTPOS scanner"
|
name = "\improper EFTPOS scanner"
|
||||||
desc = "Swipe your ID card to make purchases electronically."
|
desc = "Swipe your ID card to make purchases electronically."
|
||||||
icon = 'icons/obj/device.dmi'
|
icon = 'icons/obj/device.dmi'
|
||||||
icon_state = "eftpos"
|
icon_state = "eftpos"
|
||||||
@@ -110,11 +110,13 @@
|
|||||||
else
|
else
|
||||||
user << browse(null,"window=eftpos")
|
user << browse(null,"window=eftpos")
|
||||||
|
|
||||||
/obj/item/device/eftpos/attackby(O as obj, user as mob)
|
/obj/item/device/eftpos/attackby(obj/item/O as obj, user as mob)
|
||||||
if(istype(O, /obj/item/weapon/card))
|
|
||||||
|
var/obj/item/weapon/card/id/I = O.GetID()
|
||||||
|
|
||||||
|
if(I)
|
||||||
if(linked_account)
|
if(linked_account)
|
||||||
var/obj/item/weapon/card/I = O
|
scan_card(I, O)
|
||||||
scan_card(I)
|
|
||||||
else
|
else
|
||||||
usr << "\icon[src]<span class='warning'>Unable to connect to linked account.</span>"
|
usr << "\icon[src]<span class='warning'>Unable to connect to linked account.</span>"
|
||||||
else if (istype(O, /obj/item/weapon/spacecash/ewallet))
|
else if (istype(O, /obj/item/weapon/spacecash/ewallet))
|
||||||
@@ -124,7 +126,7 @@
|
|||||||
if(transaction_locked && !transaction_paid)
|
if(transaction_locked && !transaction_paid)
|
||||||
if(transaction_amount <= E.worth)
|
if(transaction_amount <= E.worth)
|
||||||
playsound(src, 'sound/machines/chime.ogg', 50, 1)
|
playsound(src, 'sound/machines/chime.ogg', 50, 1)
|
||||||
src.visible_message("\icon[src] The [src] chimes.")
|
src.visible_message("\icon[src] \The [src] chimes.")
|
||||||
transaction_paid = 1
|
transaction_paid = 1
|
||||||
|
|
||||||
//transfer the money
|
//transfer the money
|
||||||
@@ -141,7 +143,7 @@
|
|||||||
T.time = worldtime2text()
|
T.time = worldtime2text()
|
||||||
linked_account.transaction_log.Add(T)
|
linked_account.transaction_log.Add(T)
|
||||||
else
|
else
|
||||||
usr << "\icon[src]<span class='warning'>The charge card doesn't have that much money!</span>"
|
usr << "\icon[src]<span class='warning'>\The [O] doesn't have that much money!</span>"
|
||||||
else
|
else
|
||||||
usr << "\icon[src]<span class='warning'>Connected account has been suspended.</span>"
|
usr << "\icon[src]<span class='warning'>Connected account has been suspended.</span>"
|
||||||
else
|
else
|
||||||
@@ -225,10 +227,13 @@
|
|||||||
|
|
||||||
src.attack_self(usr)
|
src.attack_self(usr)
|
||||||
|
|
||||||
/obj/item/device/eftpos/proc/scan_card(var/obj/item/weapon/card/I)
|
/obj/item/device/eftpos/proc/scan_card(var/obj/item/weapon/card/I, var/obj/item/ID_container)
|
||||||
if (istype(I, /obj/item/weapon/card/id))
|
if (istype(I, /obj/item/weapon/card/id))
|
||||||
var/obj/item/weapon/card/id/C = I
|
var/obj/item/weapon/card/id/C = I
|
||||||
visible_message("<span class='info'>[usr] swipes a card through [src].</span>")
|
if(I==ID_container || ID_container == null)
|
||||||
|
usr.visible_message("<span class='info'>\The [usr] swipes a card through \the [src].</span>")
|
||||||
|
else
|
||||||
|
usr.visible_message("<span class='info'>\The [usr] swipes \the [ID_container] through \the [src].</span>")
|
||||||
if(transaction_locked && !transaction_paid)
|
if(transaction_locked && !transaction_paid)
|
||||||
if(linked_account)
|
if(linked_account)
|
||||||
if(!linked_account.suspended)
|
if(!linked_account.suspended)
|
||||||
@@ -242,7 +247,7 @@
|
|||||||
if(!D.suspended)
|
if(!D.suspended)
|
||||||
if(transaction_amount <= D.money)
|
if(transaction_amount <= D.money)
|
||||||
playsound(src, 'sound/machines/chime.ogg', 50, 1)
|
playsound(src, 'sound/machines/chime.ogg', 50, 1)
|
||||||
src.visible_message("\icon[src] The [src] chimes.")
|
src.visible_message("\icon[src] \The [src] chimes.")
|
||||||
transaction_paid = 1
|
transaction_paid = 1
|
||||||
|
|
||||||
//transfer the money
|
//transfer the money
|
||||||
@@ -283,13 +288,13 @@
|
|||||||
else if (istype(I, /obj/item/weapon/card/emag))
|
else if (istype(I, /obj/item/weapon/card/emag))
|
||||||
if(transaction_locked)
|
if(transaction_locked)
|
||||||
if(transaction_paid)
|
if(transaction_paid)
|
||||||
usr << "\icon[src]<span class='info'>You stealthily swipe [I] through [src].</span>"
|
usr << "\icon[src]<span class='info'>You stealthily swipe \the [I] through \the [src].</span>"
|
||||||
transaction_locked = 0
|
transaction_locked = 0
|
||||||
transaction_paid = 0
|
transaction_paid = 0
|
||||||
else
|
else
|
||||||
visible_message("<span class='info'>[usr] swipes a card through [src].</span>")
|
usr.visible_message("<span class='info'>\The [usr] swipes a card through \the [src].</span>")
|
||||||
playsound(src, 'sound/machines/chime.ogg', 50, 1)
|
playsound(src, 'sound/machines/chime.ogg', 50, 1)
|
||||||
src.visible_message("\icon[src] The [src] chimes.")
|
src.visible_message("\icon[src] \The [src] chimes.")
|
||||||
transaction_paid = 1
|
transaction_paid = 1
|
||||||
else
|
else
|
||||||
..()
|
..()
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ should be listed in the changelog upon commit though. Thanks. -->
|
|||||||
<h2 class='date'>7 April 2015</h2>
|
<h2 class='date'>7 April 2015</h2>
|
||||||
<h3 class='author'>RavingManiac updated:</h3>
|
<h3 class='author'>RavingManiac updated:</h3>
|
||||||
<ul class='changes bgimages16'>
|
<ul class='changes bgimages16'>
|
||||||
<li class='tweak'>You can now pay vending machines without removing your ID from your PDA or wallet. Clicking on the vending machine with your ID/PDA/wallet/cash also brings up the menu now instead of attacking the vending machine.</li>
|
<li class='tweak'>You can now pay vending machines and EFTPOS scanners without removing your ID from your PDA or wallet. Clicking on the vending machine with your ID/PDA/wallet/cash also brings up the menu now instead of attacking the vending machine.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user