Files
VOREStation/code/modules/economy/ATM.dm
Spades 7e84419866 September Polaris Sync (#545)
* Removes Captain as a title, sets default to Station Administrator, and adds a new title, Site Manager

* Fix atmo_control interface temperature reading

* Adds Multiple Alternative Titles

* Removed Supply Assistant

* Removed Sergeant

* Removed Computer Scientist

* Revert "Revert "Frame Cleanup""

This reverts commit 82722ba42f.

* Changed Supply Officer to Requisitions Officer

* Changed Requisitions Officer to Supply Chief and Removed Courier

* Removed Life Support Technician

* Removed Brig Officer

* Tweaks the lowest level of heat damage to be less insane

* Corrects damage amount for heat_damage_level_1

* Maybe Perhaps Last Major Technomancer PR
Adds ability to sort the spells section of the catalog into categories.  The categories available are 'All', 'Offensive', 'Defensive', 'Utility', and 'Support'.
Removes preset section on catalog as it was unused.
Projectile spells now have a sound when fired.
Haste lasts five seconds instead of three.
Repel Missiles lasts for five minutes instead of two.
All healing spells work five times as fast, healing in five seconds instead of twenty five seconds.  The amount of instability and healing done has been multiplied to remain consistent.
Passwall can now be used on more than just walls, if there's something dense on the same tile.
Force Missile is now 25% cheaper to cast, and has a cooldown of .5 seconds instead of one second, and does 5 more damage.
Beam's damage is increased by 10, and energy cost decreased by 25%.
Lightning's warm-up time is now one second instead of two.
Overload now costs 10% of total energy instead of 15%, and damage scaled with 4% of their current energy reserves, and 5% with the Scepter, instead of 3%/4%.  Additionally, instability per shot is lowered to 12 from 15.
Track now costs 25 points instead of 30 in the catalog, because roundness.
Fire Aura should look more impressive without a Scepter.
Fixes bug where shooting Lightning made you motionless for twenty seconds.

* Adds Multiple New Clothing Items

* Makes Loincloths only Availiable to Taj and Unathi

* Tweaks the contents of the captain's closet

* Smokables now give an approximation of how much longer they'll burn once lit

* make teshari not bad to play

* Tea Tweaks

- Minor changes to the color of some of the drinks such as tea and iced tea. Still not happy with the colors, but they seem better than before.
- Modification to the British cup sprite.
- Addition of a tea sprite for the coffee cups.

* fixes exception handling runtiming

* Adds missing error handler that made it difficult to debug runtimes.

* Corrects error handling proc

* Adds missing runtime viewer Topic calls.

Relocates them to the datum itself rather than it being an admin topic for maximum self-containment.
Also adds 'adminplayerobservefollow', making it possible for admins to not only jump to mobs but also follow them with a single click.
Misc tweaks from Paradise.

* gib population

* Adds the ash() mob proc, preps ninja suit

* Fixes #2352

* Changelog

* alt title

* Rigs now have suit coolers

* Map edit

- Fixes lighting in Security. Again.
- Fixes lighting in Library.
- Adds a new maint tunnel between engineering solars and atmos, now
outside the blast radius of SME explosions.

* Almost forgot emergency shutters.

* Examine Cigarette Lore

* Fixes Capitalization

* Eliminates colon

* Should clear up the usr issue

* Fixes cryopods of all types not setting occupant correctly.

* updates changelog

* Fixes runtime that occured if someone touched a blast door with an empty hand.

* Fixes check_rights() runtime.

* Adds magboots to ling spacesuits

* Adds Changelog

* Turret Fix
Turrets can now deploy properly and not be stuck in a state of deploying forever if a target is in range.

* Revert "Adds hub passwordu"

* Makes changeling recursive enhancement a passive power

* Corrects a description

* Adss changelog

* Add files via upload

* Changeling/Wizard/Future Stuff Hud Button Fix
Hopefully this stops the roundstop changeling hud wonkiness.

* Changes Mining Hardsuit slowdown to 1, from 3

* Widened hallway

* Speeds up arm_guard and leg_guard wearers slightly

* Forgot to use map cleanup tool.

* Adds changelog

* Adds changelog

* Minor Emitter Tweaks
Emitters no longer die by shooting a taser or laser tag gun at it.
Emitters don't explode if they are not on a powered wire with sufficient electricity in it.  They will just crumple away instead if integrity is reduced to zero.
Taking any damage to the emitter no longer results in instant death due to me being an idiot awhile ago.
Emitters can be examined to see if they are damaged, and can be repaired by applying metal sheets to it.

* Github, stop being stupid!

* Tweaks Sec Voidsuit values

* Fixes external airlocks

* Elevator-MMI fix

* Shoveling Snow

* Laptop ID Computer Fix
The manifest should now be updated correctly when using laptops.

* do_after is more immersive

* Fixes second bug involving inability to change title to station admin.

* Adds more unathi hair and facial options

* Adds the changelog

* Retweaks secret player requirements

* Updates changelog

* Fixes sprite not updating to not be floating when leaving non-gravity

* Adds changelog

* Fixes changeling revive not working when you're missing a limb

* Fixes #860

* Adds changelog

* Makes flash confused duration the same length as the flash blurry eyes

* Increases the change of lung rupturing

* Adds vomit as an emote

* Adds changelog

* Removes revolution shuttle delay

* Adds changelog

* Projectile flash rounds will now do the same as a flash when hitting a target

* Adds changelog

* Fixes dna-lockable gun explosion security level

* Drink Container Lore

* Decapitalizes 'Sleeper'  Because Why

* Fixes Grammatical/Flow/Sarcasm Errors

* Completes dna lockable guns implementation by adding a dna chip that can be added to guns

* Fixes + forgotten file

* Moves DNA locking stuff down to the item level rather than gun, also adds the ability to emag to remove the lock

* Adds changelog

* Adds the ability to wear ponchos as an accessory, also adds the ability to have ponchos as a suit accessory

* Adds changelog

* Closes 2 missing spans

* Adds secure briefcase to custom loadout

* Adds changelog

* Headgear Additions, and an Undershirt

* Medical splint buff and new ghetto splints.
Adds hands and feet to splint-splintable organs.
Also adds ghetto splints that can't do hands and feet.

* Fixed Sleeper... Again

* Renames "poncho" slot to "over"

* Speeds Hyperzine metabolism

* 1.5.8 Map bug fixes
-Fixed brit cup sprite.
- Replaced a maintenance door leading into atmospherics with one with the proper access.
- Fixed Missing Disposals pipe next to atmos.
- Tweaked some light placement in the main hallways.
- AI core redesign.
- Turned off medbay lobby intercom.
- Cyborg charging station added to prison wing.
- Cyborg charging station added to the research outpost.
- Medical rig suit added to medical.
- EVA rig suit for engineering added to EVA.
- Second  residential elevator installed. Due to budget cuts the size of the elevators has been reduced.

* Updates changelog

* Sombrero Code

* Fixes #2365

* Adds changelog

* Sleeper is evil.

* no message

* Changelog

* Stops observers from leaving prints on the ground.

No more spooking the mortals, ghosts.

* Allows autotraitor in secret to start with 0 players

* Adds changelog

* Makes diona slightly less slow

* Adds changelog

* Bowling Shirts

* Updates changelog

* Adds a missing description

* Flat Cap Changes and Hair Bow

* Fixed Error

* Adds an in-hand

* Lower Torso cannot be amputated

* Smoke works, adds changelog

* Updates changelog

* Makes Unathi Voidsuits Less Fat

* Medical related fixes

* Fuzzy Cuffs

* Tube Top

* Made Icons for Security Suit Less Gaunt

* Revert "Medical related fixes"

This reverts commit d7c59520e6.

* Just the fix to random med item now

* Fixes Evening Glove Coloring

* HAZMAT Suits

* Changes Unathi sprite slightly

* Tweaks skirt pathing

* Corrects changelog

* Adds changelog

* Construction Voidsuits

* makes people bleed real good

* adderino changeling

* Revert "Revert "Adds hub passwordu""

* Explosive implants should no longer gib on limbs.

* I still have no idea what I am doing.

* Resolves #331
2016-09-11 19:52:40 -04:00

496 lines
20 KiB
Plaintext

/*
TODO:
give money an actual use (QM stuff, vending machines)
send money to people (might be worth attaching money to custom database thing for this, instead of being in the ID)
log transactions
*/
#define NO_SCREEN 0
#define CHANGE_SECURITY_LEVEL 1
#define TRANSFER_FUNDS 2
#define VIEW_TRANSACTION_LOGS 3
/obj/item/weapon/card/id/var/money = 2000
/obj/machinery/atm
name = "Automatic Teller Machine"
desc = "For all your monetary needs!"
icon = 'icons/obj/terminals.dmi'
icon_state = "atm"
anchored = 1
use_power = 1
idle_power_usage = 10
circuit = /obj/item/weapon/circuitboard/atm
var/datum/money_account/authenticated_account
var/number_incorrect_tries = 0
var/previous_account_number = 0
var/max_pin_attempts = 3
var/ticks_left_locked_down = 0
var/ticks_left_timeout = 0
var/machine_id = ""
var/obj/item/weapon/card/held_card
var/editing_security_level = 0
var/view_screen = NO_SCREEN
var/datum/effect/effect/system/spark_spread/spark_system
/obj/machinery/atm/New()
..()
machine_id = "[station_name()] RT #[num_financial_terminals++]"
spark_system = new /datum/effect/effect/system/spark_spread
spark_system.set_up(5, 0, src)
spark_system.attach(src)
/obj/machinery/atm/process()
if(stat & NOPOWER)
return
if(ticks_left_timeout > 0)
ticks_left_timeout--
if(ticks_left_timeout <= 0)
authenticated_account = null
if(ticks_left_locked_down > 0)
ticks_left_locked_down--
if(ticks_left_locked_down <= 0)
number_incorrect_tries = 0
for(var/obj/item/weapon/spacecash/S in src)
S.loc = src.loc
if(prob(50))
playsound(loc, 'sound/items/polaroid1.ogg', 50, 1)
else
playsound(loc, 'sound/items/polaroid2.ogg', 50, 1)
break
/obj/machinery/atm/emag_act(var/remaining_charges, var/mob/user)
if(!emagged)
return
//short out the machine, shoot sparks, spew money!
emagged = 1
spark_system.start()
spawn_money(rand(100,500),src.loc)
//we don't want to grief people by locking their id in an emagged ATM
release_held_id(user)
//display a message to the user
var/response = pick("Initiating withdraw. Have a nice day!", "CRITICAL ERROR: Activating cash chamber panic siphon.","PIN Code accepted! Emptying account balance.", "Jackpot!")
user << "<span class='warning'>\icon[src] The [src] beeps: \"[response]\"</span>"
return 1
/obj/machinery/atm/attackby(obj/item/I as obj, mob/user as mob)
if(computer_deconstruction_screwdriver(user, I))
return
if(istype(I, /obj/item/weapon/card))
if(emagged > 0)
//prevent inserting id into an emagged ATM
user << "\red \icon[src] CARD READER ERROR. This system has been compromised!"
return
else if(istype(I,/obj/item/weapon/card/emag))
I.resolve_attackby(src, user)
return
var/obj/item/weapon/card/id/idcard = I
if(!held_card)
usr.drop_item()
idcard.loc = src
held_card = idcard
if(authenticated_account && held_card.associated_account_number != authenticated_account.account_number)
authenticated_account = null
else if(authenticated_account)
if(istype(I,/obj/item/weapon/spacecash))
//consume the money
authenticated_account.money += I:worth
if(prob(50))
playsound(loc, 'sound/items/polaroid1.ogg', 50, 1)
else
playsound(loc, 'sound/items/polaroid2.ogg', 50, 1)
//create a transaction log entry
var/datum/transaction/T = new()
T.target_name = authenticated_account.owner_name
T.purpose = "Credit deposit"
T.amount = I:worth
T.source_terminal = machine_id
T.date = current_date_string
T.time = stationtime2text()
authenticated_account.transaction_log.Add(T)
user << "<span class='info'>You insert [I] into [src].</span>"
src.attack_hand(user)
qdel(I)
else
..()
/obj/machinery/atm/attack_hand(mob/user as mob)
if(istype(user, /mob/living/silicon))
user << "\red \icon[src] Artificial unit recognized. Artificial units do not currently receive monetary compensation, as per system banking regulation #1005."
return
if(get_dist(src,user) <= 1)
//js replicated from obj/machinery/computer/card
var/dat = "<h1>Automatic Teller Machine</h1>"
dat += "For all your monetary needs!<br>"
dat += "<i>This terminal is</i> [machine_id]. <i>Report this code when contacting IT Support</i><br/>"
if(emagged > 0)
dat += "Card: <span style='color: red;'>LOCKED</span><br><br><span style='color: red;'>Unauthorized terminal access detected! This ATM has been locked. Please contact IT Support.</span>"
else
dat += "Card: <a href='?src=\ref[src];choice=insert_card'>[held_card ? held_card.name : "------"]</a><br><br>"
if(ticks_left_locked_down > 0)
dat += "<span class='alert'>Maximum number of pin attempts exceeded! Access to this ATM has been temporarily disabled.</span>"
else if(authenticated_account)
if(authenticated_account.suspended)
dat += "\red<b>Access to this account has been suspended, and the funds within frozen.</b>"
else
switch(view_screen)
if(CHANGE_SECURITY_LEVEL)
dat += "Select a new security level for this account:<br><hr>"
var/text = "Zero - Either the account number or card is required to access this account. EFTPOS transactions will require a card and ask for a pin, but not verify the pin is correct."
if(authenticated_account.security_level != 0)
text = "<A href='?src=\ref[src];choice=change_security_level;new_security_level=0'>[text]</a>"
dat += "[text]<hr>"
text = "One - An account number and pin must be manually entered to access this account and process transactions."
if(authenticated_account.security_level != 1)
text = "<A href='?src=\ref[src];choice=change_security_level;new_security_level=1'>[text]</a>"
dat += "[text]<hr>"
text = "Two - In addition to account number and pin, a card is required to access this account and process transactions."
if(authenticated_account.security_level != 2)
text = "<A href='?src=\ref[src];choice=change_security_level;new_security_level=2'>[text]</a>"
dat += "[text]<hr><br>"
dat += "<A href='?src=\ref[src];choice=view_screen;view_screen=0'>Back</a>"
if(VIEW_TRANSACTION_LOGS)
dat += "<b>Transaction logs</b><br>"
dat += "<A href='?src=\ref[src];choice=view_screen;view_screen=0'>Back</a>"
dat += "<table border=1 style='width:100%'>"
dat += "<tr>"
dat += "<td><b>Date</b></td>"
dat += "<td><b>Time</b></td>"
dat += "<td><b>Target</b></td>"
dat += "<td><b>Purpose</b></td>"
dat += "<td><b>Value</b></td>"
dat += "<td><b>Source terminal ID</b></td>"
dat += "</tr>"
for(var/datum/transaction/T in authenticated_account.transaction_log)
dat += "<tr>"
dat += "<td>[T.date]</td>"
dat += "<td>[T.time]</td>"
dat += "<td>[T.target_name]</td>"
dat += "<td>[T.purpose]</td>"
dat += "<td>$[T.amount]</td>"
dat += "<td>[T.source_terminal]</td>"
dat += "</tr>"
dat += "</table>"
dat += "<A href='?src=\ref[src];choice=print_transaction'>Print</a><br>"
if(TRANSFER_FUNDS)
dat += "<b>Account balance:</b> $[authenticated_account.money]<br>"
dat += "<A href='?src=\ref[src];choice=view_screen;view_screen=0'>Back</a><br><br>"
dat += "<form name='transfer' action='?src=\ref[src]' method='get'>"
dat += "<input type='hidden' name='src' value='\ref[src]'>"
dat += "<input type='hidden' name='choice' value='transfer'>"
dat += "Target account number: <input type='text' name='target_acc_number' value='' style='width:200px; background-color:white;'><br>"
dat += "Funds to transfer: <input type='text' name='funds_amount' value='' style='width:200px; background-color:white;'><br>"
dat += "Transaction purpose: <input type='text' name='purpose' value='Funds transfer' style='width:200px; background-color:white;'><br>"
dat += "<input type='submit' value='Transfer funds'><br>"
dat += "</form>"
else
dat += "Welcome, <b>[authenticated_account.owner_name].</b><br/>"
dat += "<b>Account balance:</b> $[authenticated_account.money]"
dat += "<form name='withdrawal' action='?src=\ref[src]' method='get'>"
dat += "<input type='hidden' name='src' value='\ref[src]'>"
dat += "<input type='radio' name='choice' value='withdrawal' checked> Cash <input type='radio' name='choice' value='e_withdrawal'> Chargecard<br>"
dat += "<input type='text' name='funds_amount' value='' style='width:200px; background-color:white;'><input type='submit' value='Withdraw'>"
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>"
dat += "<A href='?src=\ref[src];choice=view_screen;view_screen=3'>View transaction log</a><br>"
dat += "<A href='?src=\ref[src];choice=balance_statement'>Print balance statement</a><br>"
dat += "<A href='?src=\ref[src];choice=logout'>Logout</a><br>"
else
dat += "<form name='atm_auth' action='?src=\ref[src]' method='get'>"
dat += "<input type='hidden' name='src' value='\ref[src]'>"
dat += "<input type='hidden' name='choice' value='attempt_auth'>"
dat += "<b>Account:</b> <input type='text' id='account_num' name='account_num' style='width:250px; background-color:white;'><br>"
dat += "<b>PIN:</b> <input type='text' id='account_pin' name='account_pin' style='width:250px; background-color:white;'><br>"
dat += "<input type='submit' value='Submit'><br>"
dat += "</form>"
user << browse(dat,"window=atm;size=550x650")
else
user << browse(null,"window=atm")
/obj/machinery/atm/Topic(var/href, var/href_list)
if(href_list["choice"])
switch(href_list["choice"])
if("transfer")
if(authenticated_account)
var/transfer_amount = text2num(href_list["funds_amount"])
transfer_amount = round(transfer_amount, 0.01)
if(transfer_amount <= 0)
alert("That is not a valid amount.")
else if(transfer_amount <= authenticated_account.money)
var/target_account_number = text2num(href_list["target_acc_number"])
var/transfer_purpose = href_list["purpose"]
if(charge_to_account(target_account_number, authenticated_account.owner_name, transfer_purpose, machine_id, transfer_amount))
usr << "\icon[src]<span class='info'>Funds transfer successful.</span>"
authenticated_account.money -= transfer_amount
//create an entry in the account transaction log
var/datum/transaction/T = new()
T.target_name = "Account #[target_account_number]"
T.purpose = transfer_purpose
T.source_terminal = machine_id
T.date = current_date_string
T.time = stationtime2text()
T.amount = "([transfer_amount])"
authenticated_account.transaction_log.Add(T)
else
usr << "\icon[src]<span class='warning'>Funds transfer failed.</span>"
else
usr << "\icon[src]<span class='warning'>You don't have enough funds to do that!</span>"
if("view_screen")
view_screen = text2num(href_list["view_screen"])
if("change_security_level")
if(authenticated_account)
var/new_sec_level = max( min(text2num(href_list["new_security_level"]), 2), 0)
authenticated_account.security_level = new_sec_level
if("attempt_auth")
// check if they have low security enabled
scan_user(usr)
if(!ticks_left_locked_down && held_card)
var/tried_account_num = text2num(href_list["account_num"])
if(!tried_account_num)
tried_account_num = held_card.associated_account_number
var/tried_pin = text2num(href_list["account_pin"])
authenticated_account = attempt_account_access(tried_account_num, tried_pin, held_card && held_card.associated_account_number == tried_account_num ? 2 : 1)
if(!authenticated_account)
number_incorrect_tries++
if(previous_account_number == tried_account_num)
if(number_incorrect_tries > max_pin_attempts)
//lock down the atm
ticks_left_locked_down = 30
playsound(src, 'sound/machines/buzz-two.ogg', 50, 1)
//create an entry in the account transaction log
var/datum/money_account/failed_account = get_account(tried_account_num)
if(failed_account)
var/datum/transaction/T = new()
T.target_name = failed_account.owner_name
T.purpose = "Unauthorised login attempt"
T.source_terminal = machine_id
T.date = current_date_string
T.time = stationtime2text()
failed_account.transaction_log.Add(T)
else
usr << "\red \icon[src] Incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining."
previous_account_number = tried_account_num
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 1)
else
usr << "\red \icon[src] incorrect pin/account combination entered."
number_incorrect_tries = 0
else
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
ticks_left_timeout = 120
view_screen = NO_SCREEN
//create a transaction log entry
var/datum/transaction/T = new()
T.target_name = authenticated_account.owner_name
T.purpose = "Remote terminal access"
T.source_terminal = machine_id
T.date = current_date_string
T.time = stationtime2text()
authenticated_account.transaction_log.Add(T)
usr << "\blue \icon[src] Access granted. Welcome user '[authenticated_account.owner_name].'"
previous_account_number = tried_account_num
if("e_withdrawal")
var/amount = max(text2num(href_list["funds_amount"]),0)
amount = round(amount, 0.01)
if(amount <= 0)
alert("That is not a valid amount.")
else if(authenticated_account && amount > 0)
if(amount <= authenticated_account.money)
playsound(src, 'sound/machines/chime.ogg', 50, 1)
//remove the money
authenticated_account.money -= amount
// spawn_money(amount,src.loc)
spawn_ewallet(amount,src.loc,usr)
//create an entry in the account transaction log
var/datum/transaction/T = new()
T.target_name = authenticated_account.owner_name
T.purpose = "Credit withdrawal"
T.amount = "([amount])"
T.source_terminal = machine_id
T.date = current_date_string
T.time = stationtime2text()
authenticated_account.transaction_log.Add(T)
else
usr << "\icon[src]<span class='warning'>You don't have enough funds to do that!</span>"
if("withdrawal")
var/amount = max(text2num(href_list["funds_amount"]),0)
amount = round(amount, 0.01)
if(amount <= 0)
alert("That is not a valid amount.")
else if(authenticated_account && amount > 0)
if(amount <= authenticated_account.money)
playsound(src, 'sound/machines/chime.ogg', 50, 1)
//remove the money
authenticated_account.money -= amount
spawn_money(amount,src.loc,usr)
//create an entry in the account transaction log
var/datum/transaction/T = new()
T.target_name = authenticated_account.owner_name
T.purpose = "Credit withdrawal"
T.amount = "([amount])"
T.source_terminal = machine_id
T.date = current_date_string
T.time = stationtime2text()
authenticated_account.transaction_log.Add(T)
else
usr << "\icon[src]<span class='warning'>You don't have enough funds to do that!</span>"
if("balance_statement")
if(authenticated_account)
var/obj/item/weapon/paper/R = new(src.loc)
R.name = "Account balance: [authenticated_account.owner_name]"
R.info = "<b>NT Automated Teller Account Statement</b><br><br>"
R.info += "<i>Account holder:</i> [authenticated_account.owner_name]<br>"
R.info += "<i>Account number:</i> [authenticated_account.account_number]<br>"
R.info += "<i>Balance:</i> $[authenticated_account.money]<br>"
R.info += "<i>Date and time:</i> [stationtime2text()], [current_date_string]<br><br>"
R.info += "<i>Service terminal ID:</i> [machine_id]<br>"
//stamp the paper
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
stampoverlay.icon_state = "paper_stamp-cent"
if(!R.stamped)
R.stamped = new
R.stamped += /obj/item/weapon/stamp
R.overlays += stampoverlay
R.stamps += "<HR><i>This paper has been stamped by the Automatic Teller Machine.</i>"
if(prob(50))
playsound(loc, 'sound/items/polaroid1.ogg', 50, 1)
else
playsound(loc, 'sound/items/polaroid2.ogg', 50, 1)
if ("print_transaction")
if(authenticated_account)
var/obj/item/weapon/paper/R = new(src.loc)
R.name = "Transaction logs: [authenticated_account.owner_name]"
R.info = "<b>Transaction logs</b><br>"
R.info += "<i>Account holder:</i> [authenticated_account.owner_name]<br>"
R.info += "<i>Account number:</i> [authenticated_account.account_number]<br>"
R.info += "<i>Date and time:</i> [stationtime2text()], [current_date_string]<br><br>"
R.info += "<i>Service terminal ID:</i> [machine_id]<br>"
R.info += "<table border=1 style='width:100%'>"
R.info += "<tr>"
R.info += "<td><b>Date</b></td>"
R.info += "<td><b>Time</b></td>"
R.info += "<td><b>Target</b></td>"
R.info += "<td><b>Purpose</b></td>"
R.info += "<td><b>Value</b></td>"
R.info += "<td><b>Source terminal ID</b></td>"
R.info += "</tr>"
for(var/datum/transaction/T in authenticated_account.transaction_log)
R.info += "<tr>"
R.info += "<td>[T.date]</td>"
R.info += "<td>[T.time]</td>"
R.info += "<td>[T.target_name]</td>"
R.info += "<td>[T.purpose]</td>"
R.info += "<td>$[T.amount]</td>"
R.info += "<td>[T.source_terminal]</td>"
R.info += "</tr>"
R.info += "</table>"
//stamp the paper
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
stampoverlay.icon_state = "paper_stamp-cent"
if(!R.stamped)
R.stamped = new
R.stamped += /obj/item/weapon/stamp
R.overlays += stampoverlay
R.stamps += "<HR><i>This paper has been stamped by the Automatic Teller Machine.</i>"
if(prob(50))
playsound(loc, 'sound/items/polaroid1.ogg', 50, 1)
else
playsound(loc, 'sound/items/polaroid2.ogg', 50, 1)
if("insert_card")
if(!held_card)
//this might happen if the user had the browser window open when somebody emagged it
if(emagged > 0)
usr << "\red \icon[src] The ATM card reader rejected your ID because this machine has been sabotaged!"
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id))
usr.drop_item()
I.loc = src
held_card = I
else
release_held_id(usr)
if("logout")
authenticated_account = null
//usr << browse(null,"window=atm")
src.attack_hand(usr)
//stolen wholesale and then edited a bit from newscasters, which are awesome and by Agouri
/obj/machinery/atm/proc/scan_user(mob/living/carbon/human/human_user as mob)
if(!authenticated_account)
if(human_user.wear_id)
var/obj/item/weapon/card/id/I
if(istype(human_user.wear_id, /obj/item/weapon/card/id) )
I = human_user.wear_id
else if(istype(human_user.wear_id, /obj/item/device/pda) )
var/obj/item/device/pda/P = human_user.wear_id
I = P.id
if(I)
authenticated_account = attempt_account_access(I.associated_account_number)
if(authenticated_account)
human_user << "\blue \icon[src] Access granted. Welcome user '[authenticated_account.owner_name].'"
//create a transaction log entry
var/datum/transaction/T = new()
T.target_name = authenticated_account.owner_name
T.purpose = "Remote terminal access"
T.source_terminal = machine_id
T.date = current_date_string
T.time = stationtime2text()
authenticated_account.transaction_log.Add(T)
view_screen = NO_SCREEN
// put the currently held id on the ground or in the hand of the user
/obj/machinery/atm/proc/release_held_id(mob/living/carbon/human/human_user as mob)
if(!held_card)
return
held_card.loc = src.loc
authenticated_account = null
if(ishuman(human_user) && !human_user.get_active_hand())
human_user.put_in_hands(held_card)
held_card = null
/obj/machinery/atm/proc/spawn_ewallet(var/sum, loc, mob/living/carbon/human/human_user as mob)
var/obj/item/weapon/spacecash/ewallet/E = new /obj/item/weapon/spacecash/ewallet(loc)
if(ishuman(human_user) && !human_user.get_active_hand())
human_user.put_in_hands(E)
E.worth = sum
E.owner_name = authenticated_account.owner_name