Merge pull request #937 from quotefox/economy

Hyper Economy part 1 - Money Movement.
This commit is contained in:
QuoteFox
2021-01-29 01:18:58 +00:00
committed by GitHub
15 changed files with 280 additions and 15 deletions
+1
View File
@@ -64,6 +64,7 @@
#define INIT_ORDER_TICKER 9
#define INIT_ORDER_MAPPING 8
#define INIT_ORDER_NETWORKS 7
#define INIT_ORDER_ECONOMY 21
#define INIT_ORDER_ATOMS 6
#define INIT_ORDER_LANGUAGE 5
#define INIT_ORDER_MACHINES 4
+6
View File
@@ -442,6 +442,12 @@ SUBSYSTEM_DEF(job)
if(CONFIG_GET(number/minimal_access_threshold))
to_chat(M, "<span class='notice'><B>As this station was initially staffed with a [CONFIG_GET(flag/jobs_have_minimal_access) ? "full crew, only your job's necessities" : "skeleton crew, additional access may"] have been added to your ID card.</B></span>")
if(ishuman(H))
var/mob/living/carbon/human/wageslave = H
to_chat(M, "<b><span class = 'big'>Your account ID is [wageslave.account_id]</span></b>")
to_chat(M, "<b><span class = 'notice'>You do not have a pin, can set your pin at a ATM.</b>")
H.add_memory("Your account ID is [wageslave.account_id].")
if(job && H)
if(job.dresscodecompliant)// CIT CHANGE - dress code compliance
equip_loadout(N, H) // CIT CHANGE - allows players to spawn with loadout items
+23
View File
@@ -19,6 +19,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
var/mode = 0
var/printing = null
var/target_dept = 0 //Which department this computer has access to. 0=all departments
var/datum/bank_account/account/selectedbank
//Cooldown for closing positions in seconds
//if set to -1: No cooldown... probably a bad idea
@@ -250,6 +251,16 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
dat += "</td></tr>"
dat += "</table>"
// Bank management
else if(mode == 4)
dat += {"<a href='?src=[REF(src)];choice=return'>Return</a>
<table><tr><td style='width:25%'><b>Bank Accounts</b></td><td style='width:25%'></td></tr>"}
for(var/datum/bank_account/account in SSeconomy.bank_accounts)
dat += {"<td>[account.account_holder] - [account.account_id]"}
dat += "<a href='?src=[REF(src)];choice=bankassign;assign_bank=[REF(account)]'>Assign to ID</a></td>"
dat += "</td><tr>"
dat += "</table>"
else
var/list/header = list()
var/scan_name = inserted_scan_id ? html_encode(inserted_scan_id.name) : "--------"
@@ -266,6 +277,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
Target: <a href='?src=[REF(src)];choice=inserted_modify_id'>Remove [target_name]</a> ||
Confirm Identity: <a href='?src=[REF(src)];choice=inserted_scan_id'>Remove [scan_name]</a><br>
<a href='?src=[REF(src)];choice=mode;mode_target=1'>Access Crew Manifest</a><br>
<a href='?src=[REF(src)];choice=mode;mode_target=4'>Access Bank Accounts</a><br>
[!target_dept ? "<a href='?src=[REF(src)];choice=mode;mode_target=2'>Job Management</a><br>" : ""]
<a href='?src=[REF(src)];choice=logout'>Log Out</a></div>"}
@@ -443,6 +455,17 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
if(access_allowed == 1)
inserted_modify_id.access += access_type
playsound(src, "terminal_type", 50, FALSE)
if ("bankassign")
if (authenticated == 2)
var/datum/bank_account/account = locate(href_list["assign_bank"])
if (inserted_modify_id && account)
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
to_chat(usr, "<span class='alert'>Bank account: [account.account_id], has been assigned to the ID.</span>")
inserted_modify_id.registered_account = account
else
to_chat(usr, "<span class='alert'>There is no id inserted to modify.</span>")
if ("assign")
if (authenticated == 2)
var/t1 = href_list["assign_target"]
+1 -1
View File
@@ -170,7 +170,7 @@
var/registered_name = null // The name registered_name on the card
var/assignment = null
var/access_txt // mapping aid
var/datum/bank_account/registered_account
/obj/item/card/id/Initialize(mapload)
+1 -1
View File
@@ -19,7 +19,7 @@
/obj/item/stack/spacecash/proc/update_desc()
var/total_worth = amount*value
desc = "It's worth [total_worth] credit[( total_worth > 1 ) ? "s" : ""]"
desc = "A outdated form of currency, It's worth [total_worth] credit[( total_worth > 1 ) ? "s" : ""]"
/obj/item/stack/spacecash/merge(obj/item/stack/S)
+17 -1
View File
@@ -58,7 +58,7 @@
var/list/mind_traits // Traits added to the mind of the mob assigned this job
var/list/blacklisted_quirks //list of quirk typepaths blacklisted.
var/list/alt_titles = list()
//Only override this proc
@@ -90,6 +90,15 @@
if(!H)
return FALSE
if(!visualsOnly)
var/datum/bank_account/bank_account = new(H.real_name, src)
bank_account.account_holder = H.real_name
bank_account.account_job = src
bank_account.account_id = rand(111111,999999) //give account ID!
//bank_account.account_pin = rand(1000,9999) //give random pin!
bank_account.account_balance = 50
H.account_id = bank_account.account_id
if(CONFIG_GET(flag/enforce_human_authority) && (title in GLOB.command_positions))
if(H.dna.species.id != "human")
H.set_species(/datum/species/human)
@@ -230,6 +239,13 @@
C.update_label(C.registered_name, preference_source.prefs.alt_titles_preferences[J.title])
else
C.update_label()
for(var/A in SSeconomy.bank_accounts)
var/datum/bank_account/B = A
if(B.account_id == H.account_id)
C.registered_account = B
B.bank_cards += C
break
H.sec_hud_set_ID()
var/obj/item/pda/PDA = H.get_item_by_slot(pda_slot)
@@ -68,5 +68,5 @@
var/static/list/can_ride_typecache = typecacheof(list(/mob/living/carbon/human, /mob/living/simple_animal/slime, /mob/living/simple_animal/parrot))
var/lastpuke = 0
var/last_fire_update
var/account_id
can_be_held = "micro"
@@ -132,6 +132,7 @@
to_chat(src, "<span class='warning'>Use of ranged weaponry would bring dishonor to the clan.</span>")
return FALSE
/mob/living/carbon/human/can_see_reagents()
. = ..()
if(.) //No need to run through all of this if it's already true.