mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Merge branch 'bleeding-edge-freeze' of github.com:caelaislinn/Baystation12 into bleeding-edge-freeze
Conflicts: code/WorkInProgress/Cael_Aislinn/Economy/EFTPOS.dm icons/obj/device.dmi maps/tgstation.2.1.0.0.1.dmm Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
@@ -2,6 +2,7 @@ var/global/current_date_string
|
||||
var/global/num_financial_terminals = 1
|
||||
var/global/datum/money_account/station_account
|
||||
var/global/next_account_number = 0
|
||||
var/global/obj/machinery/account_database/centcomm_account_db
|
||||
|
||||
/proc/create_station_account()
|
||||
if(!station_account)
|
||||
@@ -11,13 +12,13 @@ var/global/next_account_number = 0
|
||||
station_account.owner_name = "[station_name()] Station Account"
|
||||
station_account.account_number = rand(111111, 999999)
|
||||
station_account.remote_access_pin = rand(1111, 111111)
|
||||
station_account.money = 10000
|
||||
station_account.money = 75000
|
||||
|
||||
//create an entry in the account transaction log for when it was created
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = station_account.owner_name
|
||||
T.purpose = "Account creation"
|
||||
T.amount = 10000
|
||||
T.amount = 75000
|
||||
T.date = "2nd April, 2555"
|
||||
T.time = "11:24"
|
||||
T.source_terminal = "Biesel GalaxyNet Terminal #277"
|
||||
@@ -266,11 +267,12 @@ var/global/next_account_number = 0
|
||||
R.overlays += stampoverlay
|
||||
R.stamps += "<HR><i>This paper has been stamped by the Accounts Database.</i>"
|
||||
|
||||
|
||||
//add the account
|
||||
M.transaction_log.Add(T)
|
||||
accounts.Add(M)
|
||||
|
||||
return M
|
||||
|
||||
/obj/machinery/account_database/proc/charge_to_account(var/attempt_account_number, var/source_name, var/purpose, var/terminal_id, var/amount)
|
||||
for(var/datum/money_account/D in accounts)
|
||||
if(D.account_number == attempt_account_number)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/obj/item/device/eftpos
|
||||
name = "EFTPOS scanner"
|
||||
desc = "Swipe your ID card to pay electronically."
|
||||
icon_state = "eftpos"
|
||||
var/machine_id = ""
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "eftpos" var/machine_id = ""
|
||||
var/eftpos_name = "Default EFTPOS scanner"
|
||||
var/transaction_locked = 0
|
||||
var/transaction_paid = 0
|
||||
@@ -17,14 +17,15 @@
|
||||
machine_id = "[station_name()] EFTPOS #[num_financial_terminals++]"
|
||||
access_code = rand(1111,111111)
|
||||
reconnect_database()
|
||||
print_reference()
|
||||
spawn(0)
|
||||
print_reference()
|
||||
|
||||
//by default, connect to the station account
|
||||
//the user of the EFTPOS device can change the target account though, and no-one will be the wiser (except whoever's being charged)
|
||||
linked_account = station_account
|
||||
|
||||
/obj/item/device/eftpos/proc/print_reference()
|
||||
var/obj/item/weapon/paper/R = new(get_turf(src))
|
||||
var/obj/item/weapon/paper/R = new(src.loc)
|
||||
R.name = "Reference: [eftpos_name]"
|
||||
R.info = "<b>[eftpos_name] reference</b><br><br>"
|
||||
R.info += "Access code: [access_code]<br><br>"
|
||||
@@ -38,9 +39,12 @@
|
||||
R.stamped += /obj/item/weapon/stamp
|
||||
R.overlays += stampoverlay
|
||||
R.stamps += "<HR><i>This paper has been stamped by the EFTPOS device.</i>"
|
||||
var/obj/item/smallDelivery/D = new(R.loc)
|
||||
R.loc = D
|
||||
D.wrapped = R
|
||||
D.name = "small parcel - 'EFTPOS access code'"
|
||||
|
||||
/obj/item/device/eftpos/proc/reconnect_database()
|
||||
for(var/obj/machinery/account_database/DB in world)
|
||||
/obj/item/weapon/eftpos/proc/reconnect_database() for(var/obj/machinery/account_database/DB in world)
|
||||
if(DB.z == src.z)
|
||||
linked_db = DB
|
||||
break
|
||||
@@ -66,7 +70,9 @@
|
||||
dat += "Transaction purpose: <a href='?src=\ref[src];choice=trans_purpose'>[transaction_purpose]</a><br>"
|
||||
dat += "Value: <a href='?src=\ref[src];choice=trans_value'>$[transaction_amount]</a><br>"
|
||||
dat += "Linked account: <a href='?src=\ref[src];choice=link_account'>[linked_account ? linked_account.owner_name : "None"]</a><hr>"
|
||||
dat += "<a href='?src=\ref[src];choice=change_code'>Change access code</a>"
|
||||
dat += "<a href='?src=\ref[src];choice=change_code'>Change access code</a><br>"
|
||||
dat += "<a href='?src=\ref[src];choice=change_id'>Change EFTPOS ID</a><br>"
|
||||
dat += "Scan card to reset access code <a href='?src=\ref[src];choice=reset'>\[------\]</a>"
|
||||
user << browse(dat,"window=eftpos")
|
||||
else
|
||||
user << browse(null,"window=eftpos")
|
||||
@@ -76,9 +82,12 @@
|
||||
//attempt to connect to a new db, and if that doesn't work then fail
|
||||
if(!linked_db)
|
||||
reconnect_database()
|
||||
if(linked_db && linked_account)
|
||||
var/obj/item/weapon/card/I = O
|
||||
scan_card(I)
|
||||
if(linked_db)
|
||||
if(linked_account)
|
||||
var/obj/item/weapon/card/I = O
|
||||
scan_card(I)
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to connect to linked account.</span>"
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to connect to accounts database.</span>"
|
||||
else
|
||||
@@ -94,13 +103,22 @@
|
||||
print_reference()
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Incorrect code entered.</span>"
|
||||
if("change_id")
|
||||
var/attempt_code = text2num(input("Re-enter the current EFTPOS access code", "Confirm EFTPOS code"))
|
||||
if(attempt_code == access_code)
|
||||
eftpos_name = input("Enter a new terminal ID for this device", "Enter new EFTPOS ID") + " EFTPOS scanner"
|
||||
print_reference()
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Incorrect code entered.</span>"
|
||||
if("link_account")
|
||||
if(!linked_db)
|
||||
reconnect_database()
|
||||
if(linked_db)
|
||||
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
|
||||
linked_account = linked_db.attempt_account_access(attempt_account_num, attempt_pin, 1)
|
||||
else
|
||||
usr << "<span class='warning'>Unable to connect to accounts database.</span>"
|
||||
usr << "\icon[src]<span class='warning'>Unable to connect to accounts database.</span>"
|
||||
if("trans_purpose")
|
||||
transaction_purpose = input("Enter reason for EFTPOS transaction", "Transaction purpose")
|
||||
if("trans_value")
|
||||
@@ -125,6 +143,14 @@
|
||||
scan_card(I)
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to link accounts.</span>"
|
||||
if("reset")
|
||||
//reset the access code - requires HoP/captain access
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/weapon/card))
|
||||
var/obj/item/weapon/card/C = I
|
||||
if(access_cent_captain in C.access || access_hop in C.access || access_captain in C.access)
|
||||
access_code = 0
|
||||
usr << "\icon[src]<span class='info'>Access code reset to 0.</span>"
|
||||
|
||||
src.attack_self(usr)
|
||||
|
||||
@@ -148,7 +174,7 @@
|
||||
|
||||
//create entries in the two account transaction logs
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = "[linked_account.owner_name] ([eftpos_name])"
|
||||
T.target_name = "[linked_account.owner_name] (via [eftpos_name])"
|
||||
T.purpose = transaction_purpose
|
||||
if(transaction_amount > 0)
|
||||
T.amount = "([transaction_amount])"
|
||||
|
||||
@@ -114,11 +114,11 @@ log transactions
|
||||
switch(view_screen)
|
||||
if(CHANGE_SECURITY_LEVEL)
|
||||
dat += "Select a new security level for this account:<br><hr>"
|
||||
var/text = "Zero - Only 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."
|
||||
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 - Both an account number and pin is required to access this account and process transactions."
|
||||
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>"
|
||||
@@ -185,7 +185,7 @@ log transactions
|
||||
dat += "<span class='warning'>Unable to connect to accounts database, please retry and if the issue persists contact NanoTrasen IT support.</span>"
|
||||
reconnect_database()
|
||||
|
||||
user << browse(dat,"window=atm;size=500x650")
|
||||
user << browse(dat,"window=atm;size=550x650")
|
||||
else
|
||||
user << browse(null,"window=atm")
|
||||
|
||||
|
||||
@@ -61,6 +61,8 @@ datum/mind
|
||||
New(var/key)
|
||||
src.key = key
|
||||
|
||||
//put this here for easier tracking ingame
|
||||
var/datum/money_account/initial_account
|
||||
|
||||
proc/transfer_to(mob/living/new_character)
|
||||
if(!istype(new_character))
|
||||
|
||||
@@ -894,3 +894,11 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
containername = "Experimental shield capacitor"
|
||||
group = "Engineering"
|
||||
access = access_ce
|
||||
|
||||
/datum/supply_packs/eftpos
|
||||
contains = list(/obj/item/weapon/eftpos)
|
||||
name = "EFTPOS scanner"
|
||||
cost = 10
|
||||
containertype = /obj/structure/closet/crate
|
||||
containername = "EFTPOS crate"
|
||||
group = "Operations"
|
||||
|
||||
@@ -269,17 +269,17 @@
|
||||
if(prob(35))
|
||||
|
||||
if(istype(src, /area/chapel))
|
||||
sound = pick('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg')
|
||||
sound = pick('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg','sound/music/traitor.ogg')
|
||||
else if(istype(src, /area/medical/morgue))
|
||||
sound = pick('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/ambience/title2.ogg')
|
||||
sound = pick('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/music/main.ogg')
|
||||
else if(type == /area)
|
||||
sound = pick('sound/ambience/ambispace.ogg','sound/ambience/title2.ogg',)
|
||||
sound = pick('sound/ambience/ambispace.ogg','sound/music/title2.ogg','sound/music/space.ogg','sound/music/main.ogg','sound/music/traitor.ogg')
|
||||
else if(istype(src, /area/engine))
|
||||
sound = pick('sound/ambience/ambisin1.ogg','sound/ambience/ambisin2.ogg','sound/ambience/ambisin3.ogg','sound/ambience/ambisin4.ogg')
|
||||
else if(istype(src, /area/AIsattele) || istype(src, /area/turret_protected/ai) || istype(src, /area/turret_protected/ai_upload) || istype(src, /area/turret_protected/ai_upload_foyer))
|
||||
sound = pick('sound/ambience/ambimalf.ogg')
|
||||
else if(istype(src, /area/mine/explored) || istype(src, /area/mine/unexplored))
|
||||
sound = pick('sound/ambience/ambimine.ogg')
|
||||
sound = pick('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg')
|
||||
musVolume = 25
|
||||
else if(istype(src, /area/tcommsat) || istype(src, /area/turret_protected/tcomwest) || istype(src, /area/turret_protected/tcomeast) || istype(src, /area/turret_protected/tcomfoyer) || istype(src, /area/turret_protected/tcomsat))
|
||||
sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')
|
||||
|
||||
@@ -37,9 +37,9 @@ var/global/datum/controller/gameticker/ticker
|
||||
var/triai = 0//Global holder for Triumvirate
|
||||
|
||||
/datum/controller/gameticker/proc/pregame()
|
||||
login_music = pick('sound/ambience/title2.ogg','sound/ambience/title1.ogg','sound/ambience/b12_combined_start.ogg') // choose title music!
|
||||
for(var/mob/new_player/M in mob_list)
|
||||
if(M.client) M.client.playtitlemusic()
|
||||
login_music = pick(\
|
||||
'sound/music/title1.ogg',\
|
||||
'sound/music/b12_combined_start.ogg')
|
||||
do
|
||||
pregame_timeleft = 180
|
||||
world << "<B><FONT color='blue'>Welcome to the pre-game lobby!</FONT></B>"
|
||||
@@ -105,6 +105,13 @@ var/global/datum/controller/gameticker/ticker
|
||||
else
|
||||
src.mode.announce()
|
||||
|
||||
//setup the money accounts
|
||||
if(!centcomm_account_db)
|
||||
for(var/obj/machinery/account_database/check_db in world)
|
||||
if(check_db.z == 2)
|
||||
centcomm_account_db = check_db
|
||||
break
|
||||
|
||||
create_characters() //Create player characters and transfer them
|
||||
collect_minds()
|
||||
equip_characters()
|
||||
|
||||
@@ -324,6 +324,25 @@ var/global/datum/controller/occupations/job_master
|
||||
if(istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf))
|
||||
H.loc = S.loc
|
||||
|
||||
//give them an account in the station database
|
||||
if(centcomm_account_db)
|
||||
var/datum/money_account/M = centcomm_account_db.add_account(H.real_name, starting_funds = rand(50,500)*10, pre_existing = 1)
|
||||
if(H.mind)
|
||||
var/remembered_info = ""
|
||||
remembered_info += "<b>Your account number is:</b> #[M.account_number]<br>"
|
||||
remembered_info += "<b>Your account pin is:</b> [M.remote_access_pin]<br>"
|
||||
remembered_info += "<b>Your account funds are:</b> $[M.money]<br>"
|
||||
|
||||
if(M.transaction_log.len)
|
||||
var/datum/transaction/T = M.transaction_log[1]
|
||||
remembered_info += "<b>Your account was created:</b> [T.time], [T.date] at [T.source_terminal]<br>"
|
||||
H.mind.store_memory(remembered_info)
|
||||
|
||||
H.mind.initial_account = M
|
||||
|
||||
spawn(0)
|
||||
H << "\blue<b>Your account number is: [M.account_number], your account pin is: [M.remote_access_pin]</b>"
|
||||
|
||||
var/alt_title = null
|
||||
if(H.mind)
|
||||
H.mind.assigned_role = rank
|
||||
@@ -385,13 +404,20 @@ var/global/datum/controller/occupations/job_master
|
||||
C.rank = rank
|
||||
C.assignment = title ? title : rank
|
||||
C.name = "[C.registered_name]'s ID Card ([C.assignment])"
|
||||
|
||||
//put the player's account number onto the ID
|
||||
if(H.mind && H.mind.initial_account)
|
||||
C.associated_account_number = H.mind.initial_account.account_number
|
||||
|
||||
H.equip_to_slot_or_del(C, slot_wear_id)
|
||||
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda(H), slot_belt)
|
||||
if(locate(/obj/item/device/pda,H))
|
||||
var/obj/item/device/pda/pda = locate(/obj/item/device/pda,H)
|
||||
pda.owner = H.real_name
|
||||
pda.ownjob = C.assignment
|
||||
pda.name = "PDA-[H.real_name] ([pda.ownjob])"
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
@@ -124,6 +124,14 @@
|
||||
var nameField = document.getElementById('namefield');
|
||||
nameField.style.backgroundColor = "#DDFFDD";
|
||||
}
|
||||
function markAccountGreen(){
|
||||
var nameField = document.getElementById('accountfield');
|
||||
nameField.style.backgroundColor = "#DDFFDD";
|
||||
}
|
||||
function markAccountRed(){
|
||||
var nameField = document.getElementById('accountfield');
|
||||
nameField.style.backgroundColor = "#FFDDDD";
|
||||
}
|
||||
function showAll(){
|
||||
var allJobsSlot = document.getElementById('alljobsslot');
|
||||
allJobsSlot.innerHTML = "<a href='#' onclick='hideAll()'>hide</a><br>"+ "[jobs_all]";
|
||||
@@ -139,10 +147,16 @@
|
||||
carddesc += "<b>registered_name:</b> <input type='text' id='namefield' name='reg' value='[target_owner]' style='width:250px; background-color:white;' onchange='markRed()'>"
|
||||
carddesc += "<input type='submit' value='Rename' onclick='markGreen()'>"
|
||||
carddesc += "</form>"
|
||||
|
||||
carddesc += "<form name='accountnum' action='?src=\ref[src]' method='get'>"
|
||||
carddesc += "<input type='hidden' name='src' value='\ref[src]'>"
|
||||
carddesc += "<input type='hidden' name='choice' value='account'>"
|
||||
carddesc += "<b>Stored account number:</b> <input type='text' id='accountfield' name='account' value='[modify.associated_account_number]' style='width:250px; background-color:white;' onchange='markAccountRed()'>"
|
||||
carddesc += "<input type='submit' value='Rename' onclick='markAccountGreen()'>"
|
||||
carddesc += "</form>"
|
||||
|
||||
carddesc += "<b>Assignment:</b> "
|
||||
|
||||
var/jobs = "<span id='alljobsslot'><a href='#' onclick='showAll()'>[target_rank]</a></span>" //CHECK THIS
|
||||
|
||||
var/accesses = ""
|
||||
if(istype(src,/obj/machinery/computer/card/centcom))
|
||||
accesses += "<h5>Central Command:</h5>"
|
||||
@@ -270,6 +284,13 @@
|
||||
modify.registered_name = temp_name
|
||||
else
|
||||
src.visible_message("<span class='notice'>[src] buzzes rudely.</span>")
|
||||
if ("account")
|
||||
if (authenticated)
|
||||
var/t2 = modify
|
||||
//var/t1 = input(usr, "What name?", "ID computer", null) as text
|
||||
if ((authenticated && modify == t2 && (in_range(src, usr) || (istype(usr, /mob/living/silicon))) && istype(loc, /turf)))
|
||||
var/account_num = text2num(href_list["account"])
|
||||
modify.associated_account_number = account_num
|
||||
if ("mode")
|
||||
mode = text2num(href_list["mode_target"])
|
||||
if ("print")
|
||||
|
||||
@@ -190,6 +190,12 @@
|
||||
targeting_active = 1
|
||||
target()
|
||||
targeting_active = 0
|
||||
|
||||
if(prob(15))
|
||||
if(prob(50))
|
||||
playsound(src.loc, 'sound/effects/turret/move1.wav', 60, 1)
|
||||
else
|
||||
playsound(src.loc, 'sound/effects/turret/move2.wav', 60, 1)
|
||||
else if(!isPopping())//else, pop down
|
||||
if(!isDown())
|
||||
popDown()
|
||||
@@ -244,6 +250,7 @@
|
||||
if ((!isPopping()) || src.popping==-1)
|
||||
invisibility = 0
|
||||
popping = 1
|
||||
playsound(src.loc, 'sound/effects/turret/open.wav', 60, 1)
|
||||
if (src.cover!=null)
|
||||
flick("popup", src.cover)
|
||||
src.cover.icon_state = "openTurretCover"
|
||||
@@ -253,6 +260,7 @@
|
||||
/obj/machinery/turret/proc/popDown()
|
||||
if ((!isPopping()) || src.popping==1)
|
||||
popping = -1
|
||||
playsound(src.loc, 'sound/effects/turret/open.wav', 60, 1)
|
||||
if (src.cover!=null)
|
||||
flick("popdown", src.cover)
|
||||
src.cover.icon_state = "turretCover"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/obj/item/weapon/storage/wallet
|
||||
name = "wallet"
|
||||
desc = "It can hold a few small and personal things."
|
||||
storage_slots = 4
|
||||
storage_slots = 10
|
||||
icon_state = "wallet"
|
||||
w_class = 2
|
||||
can_hold = list(
|
||||
|
||||
@@ -58,6 +58,17 @@ Stuff which is in development and not yet visible to players or just code relate
|
||||
should be listed in the changelog upon commit though. Thanks. -->
|
||||
|
||||
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">February 23rd 2013</h2>
|
||||
<h3 class="author">Cael Aislinn updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="rscadd">Finances! Players spawn with an account, and money can be transferred between accounts, withdrawn/deposited at ATMs and charged to accounts via EFTPOS scanners.<br><br>
|
||||
All players start with 500-5000 credits, credits can no longer be merged and only credits can be deposited into ATMs - so shelter your illegitimately gotten gains in physical assets and remember that fraud is frowned upon!</li>
|
||||
<li class="rscadd">Turrets are no longer noiseless as the grave. Listen for the sound of machinery in their proximity.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">22/02/2013</h2>
|
||||
<h3 class="author">Chinsky updated:</h3>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user