mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
First commit for review:
-ATMs no longer spawn spacecash when you Withdraw funds from them. Instead they spawn a charge card with the funds asked. -You can swipe a charge card at an EFTPOS instead of your ID. The funds will be substracted from the charge card and won't ask for any PIN. (ID card swiping is still available, of course) -You can insert a change card in a vending machine. You can retrieve multiple products from the machine as long as the change card has enough funds to pay for them. -Also, the EFTPOS instructions are rewritten into a simpler text. The text is not final. Needed: -A better name than "change card"? Also, until a name is set, variables are keeping the name "ewallet". -An icon for the change card. For now it's using the 1000$ cash icon as placeholder.
This commit is contained in:
@@ -53,6 +53,8 @@
|
||||
var/const/WIRE_SHOOTINV = 4
|
||||
|
||||
var/check_accounts = 0 // 1 = requires PIN and checks accounts. 0 = You slide an ID, it vends, SPACE COMMUNISM!
|
||||
var/obj/item/weapon/spacecash/ewallet/ewallet
|
||||
|
||||
|
||||
/obj/machinery/vending/New()
|
||||
..()
|
||||
@@ -150,6 +152,11 @@
|
||||
else if(istype(W, /obj/item/weapon/card) && currently_vending)
|
||||
var/obj/item/weapon/card/I = W
|
||||
scan_card(I)
|
||||
else if (istype(W, /obj/item/weapon/spacecash/ewallet))
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
ewallet = W
|
||||
user << "\blue You insert the [W] into the [src]"
|
||||
|
||||
else if(src.panel_open)
|
||||
|
||||
@@ -243,7 +250,10 @@
|
||||
dat += "<b>Select an item: </b><br><br>" //the rest is just general spacing and bolding
|
||||
|
||||
if (premium.len > 0)
|
||||
dat += "<b>Coin slot:</b> [coin ? coin : "No coin inserted"] (<a href='byond://?src=\ref[src];remove_coin=1'>Remove</A>)<br><br>"
|
||||
dat += "<b>Coin slot:</b> [coin ? coin : "No coin inserted"] (<a href='byond://?src=\ref[src];remove_coin=1'>Remove</A>)<br>"
|
||||
|
||||
if (ewallet)
|
||||
dat += "<b>Charge card's credits:</b> [ewallet ? ewallet.worth : "No charge card inserted"] (<a href='byond://?src=\ref[src];remove_ewallet=1'>Remove</A>)<br><br>"
|
||||
|
||||
if (src.product_records.len == 0)
|
||||
dat += "<font color = 'red'>No product loaded!</font>"
|
||||
@@ -317,6 +327,15 @@
|
||||
usr << "\blue You remove the [coin] from the [src]"
|
||||
coin = null
|
||||
|
||||
if(href_list["remove_ewallet"] && !istype(usr,/mob/living/silicon))
|
||||
if (!ewallet)
|
||||
usr << "There is no charge card in this machine."
|
||||
return
|
||||
ewallet.loc = src.loc
|
||||
if(!usr.get_active_hand())
|
||||
usr.put_in_hands(ewallet)
|
||||
usr << "\blue You remove the [ewallet] from the [src]"
|
||||
ewallet = null
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
|
||||
usr.set_machine(src)
|
||||
@@ -343,10 +362,18 @@
|
||||
|
||||
if(R.price == null)
|
||||
src.vend(R, usr)
|
||||
else
|
||||
if (ewallet)
|
||||
if (R.price <= ewallet.worth)
|
||||
ewallet.worth -= R.price
|
||||
src.vend(R, usr)
|
||||
else
|
||||
usr << "\red The ewallet doesn't have enough money to pay for that."
|
||||
src.currently_vending = R
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
src.currently_vending = R
|
||||
src.updateUsrDialog()
|
||||
|
||||
return
|
||||
|
||||
else if (href_list["cancel_buying"])
|
||||
|
||||
@@ -190,7 +190,7 @@ log transactions
|
||||
dat += "<form name='withdrawal' action='?src=\ref[src]' method='get'>"
|
||||
dat += "<input type='hidden' name='src' value='\ref[src]'>"
|
||||
dat += "<input type='hidden' name='choice' value='withdrawal'>"
|
||||
dat += "<input type='text' name='funds_amount' value='' style='width:200px; background-color:white;'><input type='submit' value='Withdraw e-wallet'>" //fae change: fuck it, ewallet
|
||||
dat += "<input type='text' name='funds_amount' value='' style='width:200px; background-color:white;'><input type='submit' value='Withdraw charge card'>"
|
||||
dat += "</form>"
|
||||
dat += "<A href='?src=\ref[src];choice=view_screen;view_screen=1'>Change account security level</a><br>"
|
||||
dat += "<A href='?src=\ref[src];choice=view_screen;view_screen=2'>Make transfer</a><br>"
|
||||
@@ -310,10 +310,8 @@ log transactions
|
||||
//remove the money
|
||||
authenticated_account.money -= amount
|
||||
|
||||
//fae change {
|
||||
// spawn_money(amount,src.loc)
|
||||
spawn_ewallet(amount,src.loc)
|
||||
//}
|
||||
|
||||
//create an entry in the account transaction log
|
||||
var/datum/transaction/T = new()
|
||||
@@ -407,9 +405,8 @@ log transactions
|
||||
human_user.put_in_hands(held_card)
|
||||
held_card = null
|
||||
|
||||
//fae change {
|
||||
|
||||
/obj/machinery/atm/proc/spawn_ewallet(var/sum, loc)
|
||||
var/obj/item/weapon/spacecash/ewallet/E = new /obj/item/weapon/spacecash/ewallet(loc)
|
||||
E.worth = sum
|
||||
E.owner_name = authenticated_account.owner_name
|
||||
//}
|
||||
@@ -22,6 +22,7 @@
|
||||
//create a short manual as well
|
||||
var/obj/item/weapon/paper/R = new(src.loc)
|
||||
R.name = "Steps to success: Correct EFTPOS Usage"
|
||||
/*
|
||||
R.info += "<b>When first setting up your EFTPOS device:</b>"
|
||||
R.info += "1. Memorise your EFTPOS command code (provided with all EFTPOS devices).<br>"
|
||||
R.info += "2. Confirm that your EFTPOS device is connected to your local accounts database. For additional assistance with this step, contact NanoTrasen IT Support<br>"
|
||||
@@ -33,6 +34,17 @@
|
||||
R.info += "4. If at this stage you wish to modify or cancel your transaction, you may simply reset (unlock) your EFTPOS device.<br>"
|
||||
R.info += "5. Give your EFTPOS device to the customer, they must authenticate the transaction by swiping their ID card and entering their PIN number.<br>"
|
||||
R.info += "6. If done correctly, the transaction will be logged to both accounts with the reference you have entered, the terminal ID of your EFTPOS device and the money transferred across accounts.<br>"
|
||||
*/
|
||||
//Temptative new manual:
|
||||
R.info += "<b>First EFTPOS setup:</b><br>"
|
||||
R.info += "1. Memorise your EFTPOS command code (provided with all EFTPOS devices).<br>"
|
||||
R.info += "2. Connect the EFTPOS to the account in which you want to receive the funds.<br><br>"
|
||||
R.info += "<b>When starting a new transaction:</b><br>"
|
||||
R.info += "1. Enter the amount of money you want to charge and a purpose message for the new transaction.<br>"
|
||||
R.info += "2. Lock the new transaction. If you want to modify or cancel the transaction, you simply have to reset your EFTPOS device.<br>"
|
||||
R.info += "3. Give the EFTPOS device to your customer, he/she must finish the transaction by swiping their ID card or a charge card with enough funds.<br>"
|
||||
R.info += "4. If everything is done correctly, the money will be transferred. To unlock the device you will have to reset the EFTPOS device.<br>"
|
||||
|
||||
|
||||
//stamp the paper
|
||||
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
|
||||
@@ -102,7 +114,6 @@
|
||||
scan_card(I)
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to connect to linked account.</span>"
|
||||
//fae changes {
|
||||
else if (istype(O, /obj/item/weapon/spacecash/ewallet))
|
||||
var/obj/item/weapon/spacecash/ewallet/E = O
|
||||
if (linked_account)
|
||||
@@ -119,21 +130,20 @@
|
||||
|
||||
//create entry in the EFTPOS linked account transaction log
|
||||
var/datum/transaction/T = new()
|
||||
T = new()
|
||||
T.target_name = E.owner_name //D.owner_name
|
||||
T.purpose = transaction_purpose
|
||||
T.amount = "[transaction_amount]"
|
||||
T.amount = transaction_amount
|
||||
T.source_terminal = machine_id
|
||||
T.date = current_date_string
|
||||
T.time = worldtime2text()
|
||||
linked_account.transaction_log.Add(T)
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>The e-wallet doesn't have that much money!</span>"
|
||||
usr << "\icon[src]<span class='warning'>The charge card doesn't have that much money!</span>"
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Connected account has been suspended.</span>"
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>EFTPOS is not connected to an account.</span>"
|
||||
//}
|
||||
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
@@ -73,9 +73,14 @@ proc/spawn_money(var/sum, spawnloc)
|
||||
new cash_type(spawnloc)
|
||||
return
|
||||
|
||||
//Fae changes
|
||||
/obj/item/weapon/spacecash/ewallet
|
||||
name = "E-Wallet"
|
||||
name = "Charge card"
|
||||
icon_state = "spacecash1000"
|
||||
desc = "Worth: Some credits."
|
||||
var/owner_name = ""
|
||||
desc = "A card that holds an amount of money."
|
||||
var/owner_name = "" //So the ATM can set it so the EFTPOS can put a valid name on transactions.
|
||||
|
||||
/obj/item/weapon/spacecash/ewallet/examine()
|
||||
set src in view()
|
||||
..()
|
||||
if (!(usr in view(2)) && usr!=src.loc) return
|
||||
usr << "\blue Charge card's owner: [src.owner_name]. Credits remaining: [src.worth]."
|
||||
Reference in New Issue
Block a user