mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-23 21:26:30 +01:00
Allow 'offmap spawn' jobs to be isolated from station employees
This commit is contained in:
@@ -12,6 +12,7 @@ var/list/spawntypes = list()
|
||||
var/display_name //Name used in preference setup.
|
||||
var/list/restrict_job = null
|
||||
var/list/disallow_job = null
|
||||
var/announce_channel = "Common"
|
||||
|
||||
proc/check_job_spawning(job)
|
||||
if(restrict_job && !(job in restrict_job))
|
||||
@@ -20,6 +21,10 @@ var/list/spawntypes = list()
|
||||
if(disallow_job && (job in disallow_job))
|
||||
return 0
|
||||
|
||||
var/datum/job/J = SSjob.get_job(job)
|
||||
if(J?.offmap_spawn && !(job in restrict_job))
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
/datum/spawnpoint/proc/get_spawn_position()
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
var/security_level = 0 //0 - auto-identify from worn ID, require only account number
|
||||
//1 - require manual login / account number and pin
|
||||
//2 - require card and manual login
|
||||
var/offmap = FALSE //Should this account be hidden from station consoles?
|
||||
|
||||
/datum/transaction
|
||||
var/target_name = ""
|
||||
@@ -18,10 +19,11 @@
|
||||
var/time = ""
|
||||
var/source_terminal = ""
|
||||
|
||||
/proc/create_account(var/new_owner_name = "Default user", var/starting_funds = 0, var/obj/machinery/account_database/source_db)
|
||||
/proc/create_account(var/new_owner_name = "Default user", var/starting_funds = 0, var/obj/machinery/account_database/source_db, var/offmap = FALSE)
|
||||
|
||||
//create a new account
|
||||
var/datum/money_account/M = new()
|
||||
M.offmap = offmap
|
||||
M.owner_name = new_owner_name
|
||||
M.remote_access_pin = rand(1111, 111111)
|
||||
M.money = starting_funds
|
||||
|
||||
@@ -14,31 +14,31 @@
|
||||
var/creating_new_account = 0
|
||||
var/const/fund_cap = 1000000
|
||||
|
||||
proc/get_access_level()
|
||||
if (!held_card)
|
||||
return 0
|
||||
if(access_cent_captain in held_card.access)
|
||||
return 2
|
||||
else if(access_hop in held_card.access || access_captain in held_card.access)
|
||||
return 1
|
||||
/obj/machinery/account_database/proc/get_access_level()
|
||||
if (!held_card)
|
||||
return 0
|
||||
if(access_cent_captain in held_card.access)
|
||||
return 2
|
||||
else if(access_hop in held_card.access || access_captain in held_card.access)
|
||||
return 1
|
||||
|
||||
proc/create_transation(target, reason, amount)
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = target
|
||||
T.purpose = reason
|
||||
T.amount = amount
|
||||
T.date = current_date_string
|
||||
T.time = stationtime2text()
|
||||
T.source_terminal = machine_id
|
||||
return T
|
||||
/obj/machinery/account_database/proc/create_transation(target, reason, amount)
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = target
|
||||
T.purpose = reason
|
||||
T.amount = amount
|
||||
T.date = current_date_string
|
||||
T.time = stationtime2text()
|
||||
T.source_terminal = machine_id
|
||||
return T
|
||||
|
||||
proc/accounting_letterhead(report_name)
|
||||
return {"
|
||||
<center><h1><b>[report_name]</b></h1></center>
|
||||
<center><small><i>[station_name()] Accounting Report</i></small></center>
|
||||
<hr>
|
||||
<u>Generated By:</u> [held_card.registered_name], [held_card.assignment]<br>
|
||||
"}
|
||||
/obj/machinery/account_database/proc/accounting_letterhead(report_name)
|
||||
return {"
|
||||
<center><h1><b>[report_name]</b></h1></center>
|
||||
<center><small><i>[station_name()] Accounting Report</i></small></center>
|
||||
<hr>
|
||||
<u>Generated By:</u> [held_card.registered_name], [held_card.assignment]<br>
|
||||
"}
|
||||
|
||||
/obj/machinery/account_database/New()
|
||||
machine_id = "[station_name()] Acc. DB #[num_financial_terminals++]"
|
||||
@@ -98,6 +98,8 @@
|
||||
var/list/accounts[0]
|
||||
for(var/i=1, i<=all_money_accounts.len, i++)
|
||||
var/datum/money_account/D = all_money_accounts[i]
|
||||
if(D.offmap)
|
||||
continue
|
||||
accounts.Add(list(list(\
|
||||
"account_number"=D.account_number,\
|
||||
"owner_name"=D.owner_name,\
|
||||
|
||||
@@ -355,8 +355,13 @@
|
||||
|
||||
//Find our spawning point.
|
||||
var/list/join_props = job_master.LateSpawn(client, rank)
|
||||
|
||||
if(!join_props)
|
||||
return
|
||||
|
||||
var/turf/T = join_props["turf"]
|
||||
var/join_message = join_props["msg"]
|
||||
var/announce_channel = join_props["channel"] || "Common"
|
||||
|
||||
if(!T || !join_message)
|
||||
return 0
|
||||
@@ -437,6 +442,8 @@
|
||||
|
||||
dat += "Choose from the following open/valid positions:<br>"
|
||||
dat += "<a href='byond://?src=\ref[src];hidden_jobs=1'>[show_hidden_jobs ? "Hide":"Show"] Hidden Jobs.</a><br>"
|
||||
|
||||
var/deferred = ""
|
||||
for(var/datum/job/job in job_master.occupations)
|
||||
if(job && IsJobAvailable(job.title))
|
||||
// Checks for jobs with minimum age requirements
|
||||
@@ -450,9 +457,17 @@
|
||||
continue
|
||||
var/active = 0
|
||||
// Only players with the job assigned and AFK for less than 10 minutes count as active
|
||||
for(var/mob/M in player_list) if(M.mind && M.client && M.mind.assigned_role == job.title && M.client.inactivity <= 10 * 60 * 10)
|
||||
for(var/mob/M in player_list) if(M.mind && M.client && M.mind.assigned_role == job.title && M.client.inactivity <= 10 MINUTES)
|
||||
active++
|
||||
dat += "<a href='byond://?src=\ref[src];SelectedJob=[job.title]'>[job.title] ([job.current_positions]) (Active: [active])</a><br>"
|
||||
|
||||
var/string = "<a href='byond://?src=\ref[src];SelectedJob=[job.title]'>[job.title] ([job.current_positions]) (Active: [active])</a><br>"
|
||||
|
||||
if(job.offmap_spawn) //At the bottom
|
||||
deferred += string
|
||||
else
|
||||
dat += string
|
||||
|
||||
dat += deferred
|
||||
|
||||
dat += "</center>"
|
||||
src << browse(dat, "window=latechoices;size=300x640;can_close=1")
|
||||
|
||||
Reference in New Issue
Block a user