mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-25 22:12:58 +01:00
Ghost Role Accounts (#18004)
* The majority of ghost roles now spawn with an Idris account and some funds.
This commit is contained in:
@@ -148,6 +148,25 @@ SUBSYSTEM_DEF(economy)
|
||||
|
||||
return M
|
||||
|
||||
/// Create and assign account for any arbitrary mob, returns the created account (/datum/money_account)
|
||||
/datum/controller/subsystem/economy/proc/create_and_assign_account(var/mob/mob, var/override_name, var/funds, var/is_public)
|
||||
var/datum/money_account/money_account = SSeconomy.create_account(override_name || mob.real_name, funds, null, is_public)
|
||||
|
||||
if(mob.mind)
|
||||
var/remembered_info = ""
|
||||
remembered_info += "<b>Your account number is:</b> #[money_account.account_number]<br>"
|
||||
remembered_info += "<b>Your account pin is:</b> [money_account.remote_access_pin]<br>"
|
||||
remembered_info += "<b>Your account funds are:</b> [money_account.money]电<br>"
|
||||
|
||||
if(money_account.transactions.len)
|
||||
var/datum/transaction/transaction = money_account.transactions[1]
|
||||
remembered_info += "<b>Your account was created:</b> [transaction.time], [transaction.date] at [transaction.source_terminal]<br>"
|
||||
|
||||
mob.mind.store_memory(remembered_info)
|
||||
mob.mind.initial_account = money_account
|
||||
|
||||
return money_account
|
||||
|
||||
/datum/controller/subsystem/economy/proc/get_public_accounts()
|
||||
var/list/public_accounts = list()
|
||||
for(var/account in all_money_accounts)
|
||||
|
||||
@@ -14,18 +14,7 @@
|
||||
player.species.before_equip(player)
|
||||
|
||||
if((flags & ANTAG_CLEAR_EQUIPMENT) && has_idris_account)
|
||||
var/datum/money_account/money_account = SSeconomy.create_account("John Doe", rand(idris_account_min, idris_account_max), null, FALSE)
|
||||
if(player.mind)
|
||||
var/remembered_info = ""
|
||||
remembered_info += "<b>Your account number is:</b> #[money_account.account_number]<br>"
|
||||
remembered_info += "<b>Your account pin is:</b> [money_account.remote_access_pin]<br>"
|
||||
remembered_info += "<b>Your account funds are:</b> [money_account.money]电<br>"
|
||||
|
||||
if(money_account.transactions.len)
|
||||
var/datum/transaction/transaction = money_account.transactions[1]
|
||||
remembered_info += "<b>Your account was created:</b> [transaction.time], [transaction.date] at [transaction.source_terminal]<br>"
|
||||
player.mind.store_memory(remembered_info)
|
||||
player.mind.initial_account = money_account
|
||||
SSeconomy.create_and_assign_account(player, "John Doe", rand(idris_account_min, idris_account_max), FALSE)
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -107,21 +107,8 @@
|
||||
species_modifier = human_species.economic_modifier
|
||||
|
||||
var/money_amount = initial_funds_override ? initial_funds_override : (rand(5,50) + rand(5, 50)) * econ_status * economic_modifier * species_modifier
|
||||
var/datum/money_account/M = SSeconomy.create_account(H.real_name, money_amount, null, public_account)
|
||||
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.transactions.len)
|
||||
var/datum/transaction/T = M.transactions[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
|
||||
|
||||
to_chat(H, "<span class='notice'><b>Your account number is: [M.account_number], your account pin is: [M.remote_access_pin]</b></span>")
|
||||
var/datum/money_account/account = SSeconomy.create_and_assign_account(H, null, money_amount, public_account)
|
||||
to_chat(H, SPAN_BOLD(SPAN_NOTICE("Your account number is: [account.account_number], your account pin is: [account.remote_access_pin]")))
|
||||
|
||||
// overrideable separately so AIs/borgs can have cardborg hats without unneccessary new()/del()
|
||||
/datum/job/proc/equip_preview(mob/living/carbon/human/H, var/alt_title, var/faction_override)
|
||||
|
||||
@@ -35,6 +35,18 @@
|
||||
|
||||
mob_name = null
|
||||
|
||||
/// Determines whether the mob will have an Idris banking account when they spawn in
|
||||
var/has_idris_account = TRUE
|
||||
|
||||
/// Determines whether the Idris banking account will be visible on the station's account terminal
|
||||
var/is_idris_account_public = FALSE
|
||||
|
||||
/// The minimum amount of money the account can spawn with
|
||||
var/idris_account_min = 100
|
||||
|
||||
/// The maximum amount of money the account can spawn with
|
||||
var/idris_account_max = 500
|
||||
|
||||
//Return a error message if the user CANT spawn. Otherwise FALSE
|
||||
/datum/ghostspawner/human/cant_spawn(mob/user)
|
||||
//If whitelist is required, check if user can spawn in ANY of the possible species
|
||||
@@ -144,6 +156,9 @@
|
||||
age = rand(35, 50)
|
||||
M.age = Clamp(age, 21, 65)
|
||||
|
||||
if(has_idris_account)
|
||||
SSeconomy.create_and_assign_account(M, null, rand(idris_account_min, idris_account_max), is_idris_account_public)
|
||||
|
||||
//Setup the Outfit
|
||||
if(picked_species in species_outfits)
|
||||
var/obj/outfit/species_outfit = species_outfits[picked_species]
|
||||
|
||||
Reference in New Issue
Block a user