From 9368dd27363a11b7b4bf9f89afb7e9926fd78c88 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Mon, 13 Apr 2020 11:05:27 -0400 Subject: [PATCH] Talon job pref saving --- code/game/jobs/jobs_vr.dm | 7 +++ .../preference_setup/occupation/occupation.dm | 49 ++++++++++++++++++- code/modules/client/preferences_vr.dm | 8 ++- maps/tether/tether_jobs.dm | 10 ++++ vorestation.dme | 1 + 5 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 code/game/jobs/jobs_vr.dm diff --git a/code/game/jobs/jobs_vr.dm b/code/game/jobs/jobs_vr.dm new file mode 100644 index 0000000000..69d84af369 --- /dev/null +++ b/code/game/jobs/jobs_vr.dm @@ -0,0 +1,7 @@ +var/const/TALON =(1<<3) + +var/const/TALCAP =(1<<0) +var/const/TALPIL =(1<<1) +var/const/TALDOC =(1<<2) +var/const/TALSEC =(1<<3) +var/const/TALENG =(1<<4) \ No newline at end of file diff --git a/code/modules/client/preference_setup/occupation/occupation.dm b/code/modules/client/preference_setup/occupation/occupation.dm index 2fc6f03a03..9ab76b9f4e 100644 --- a/code/modules/client/preference_setup/occupation/occupation.dm +++ b/code/modules/client/preference_setup/occupation/occupation.dm @@ -18,6 +18,11 @@ S["job_engsec_high"] >> pref.job_engsec_high S["job_engsec_med"] >> pref.job_engsec_med S["job_engsec_low"] >> pref.job_engsec_low + //VOREStation Add + S["job_talon_low"] >> pref.job_talon_low + S["job_talon_med"] >> pref.job_talon_med + S["job_talon_high"] >> pref.job_talon_high + //VOREStation Add End S["player_alt_titles"] >> pref.player_alt_titles /datum/category_item/player_setup_item/occupation/save_character(var/savefile/S) @@ -31,6 +36,11 @@ S["job_engsec_high"] << pref.job_engsec_high S["job_engsec_med"] << pref.job_engsec_med S["job_engsec_low"] << pref.job_engsec_low + //VOREStation Add + S["job_talon_low"] << pref.job_talon_low + S["job_talon_med"] << pref.job_talon_med + S["job_talon_high"] << pref.job_talon_high + //VOREStation Add End S["player_alt_titles"] << pref.player_alt_titles /datum/category_item/player_setup_item/occupation/sanitize_character() @@ -44,6 +54,11 @@ pref.job_engsec_high = sanitize_integer(pref.job_engsec_high, 0, 65535, initial(pref.job_engsec_high)) pref.job_engsec_med = sanitize_integer(pref.job_engsec_med, 0, 65535, initial(pref.job_engsec_med)) pref.job_engsec_low = sanitize_integer(pref.job_engsec_low, 0, 65535, initial(pref.job_engsec_low)) + //VOREStation Add + pref.job_talon_high = sanitize_integer(pref.job_talon_high, 0, 65535, initial(pref.job_talon_high)) + pref.job_talon_med = sanitize_integer(pref.job_talon_med, 0, 65535, initial(pref.job_talon_med)) + pref.job_talon_low = sanitize_integer(pref.job_talon_low, 0, 65535, initial(pref.job_talon_low)) + //VOREStation Add End if(!(pref.player_alt_titles)) pref.player_alt_titles = new() if(!job_master) @@ -54,7 +69,7 @@ if(alt_title && !(alt_title in job.alt_titles)) pref.player_alt_titles -= job.title -/datum/category_item/player_setup_item/occupation/content(mob/user, limit = 20, list/splitJobs = list()) +/datum/category_item/player_setup_item/occupation/content(mob/user, limit = 25, list/splitJobs = list()) if(!job_master) return @@ -281,14 +296,17 @@ pref.job_civilian_high = 0 pref.job_medsci_high = 0 pref.job_engsec_high = 0 + pref.job_talon_high = 0 //VOREStation Add return 1 if(2)//Set current highs to med, then reset them pref.job_civilian_med |= pref.job_civilian_high pref.job_medsci_med |= pref.job_medsci_high pref.job_engsec_med |= pref.job_engsec_high + pref.job_talon_med |= pref.job_talon_high //VOREStation Add pref.job_civilian_high = 0 pref.job_medsci_high = 0 pref.job_engsec_high = 0 + pref.job_talon_high = 0 //VOREStation Add switch(job.department_flag) if(CIVILIAN) @@ -321,6 +339,19 @@ pref.job_engsec_low &= ~job.flag else pref.job_engsec_low |= job.flag + //VOREStation Add + if(TALON) + switch(level) + if(2) + pref.job_talon_high = job.flag + pref.job_talon_med &= ~job.flag + if(3) + pref.job_talon_med |= job.flag + pref.job_talon_low &= ~job.flag + else + pref.job_talon_low |= job.flag + //VOREStation Add End + return 1 /datum/category_item/player_setup_item/occupation/proc/ResetJobs() @@ -336,6 +367,12 @@ pref.job_engsec_med = 0 pref.job_engsec_low = 0 + //VOREStation Add + pref.job_talon_high = 0 + pref.job_talon_med = 0 + pref.job_talon_low = 0 + //VOREStation Add End + pref.player_alt_titles.Cut() /datum/preferences/proc/GetPlayerAltTitle(datum/job/job) @@ -368,4 +405,14 @@ return job_engsec_med if(3) return job_engsec_low + //VOREStation Add + if(TALON) + switch(level) + if(1) + return job_talon_high + if(2) + return job_talon_med + if(3) + return job_talon_low + //VOREStation Add End return 0 diff --git a/code/modules/client/preferences_vr.dm b/code/modules/client/preferences_vr.dm index 97074d3298..ae7801b30c 100644 --- a/code/modules/client/preferences_vr.dm +++ b/code/modules/client/preferences_vr.dm @@ -1,7 +1,11 @@ //TFF 5/8/19 - minor refactoring of this thing from 09_misc.dm to call this for preferences. datum/preferences - var/show_in_directory = 1 //TFF 5/8/19 - show in Character Directory - var/sensorpref = 5 //TFF 5/8/19 - set character's suit sensor level + var/show_in_directory = 1 //Show in Character Directory + var/sensorpref = 5 //Set character's suit sensor level + + var/job_talon_high = 0 + var/job_talon_med = 0 + var/job_talon_low = 0 //Why weren't these in game toggles already? /client/verb/toggle_eating_noises() diff --git a/maps/tether/tether_jobs.dm b/maps/tether/tether_jobs.dm index b4535cd198..a09d05a247 100644 --- a/maps/tether/tether_jobs.dm +++ b/maps/tether/tether_jobs.dm @@ -10,6 +10,8 @@ /datum/job/talon/captain title = "Talon Captain" + flag = TALCAP + department_flag = TALON departments_managed = list(DEPARTMENT_TALON) job_description = "The captain's job is to generate profit through trade or other means such as salvage or even privateering." supervisors = "yourself" @@ -29,6 +31,8 @@ /datum/job/talon/doctor title = "Talon Doctor" + flag = TALDOC + department_flag = TALON job_description = "The doctor's job is to make sure the crew of the ITV Talon remain in good health and to monitor them when away from the ship." supervisors = "the ITV Talon's captain" outfit_type = /decl/hierarchy/outfit/job/talon_doctor @@ -47,6 +51,8 @@ /datum/job/talon/engineer title = "Talon Engineer" + flag = TALENG + department_flag = TALON job_description = "The engineer's job is to ensure the ITV Talon remains in tip-top shape and to repair any damage as well as manage the shields." supervisors = "the ITV Talon's captain" outfit_type = /decl/hierarchy/outfit/job/talon_engineer @@ -65,6 +71,8 @@ /datum/job/talon/pilot title = "Talon Pilot" + flag = TALPIL + department_flag = TALON job_description = "The pilot's job is to fly the ITV Talon in the most efficient and profitable way possible." supervisors = "the ITV Talon's captain" outfit_type = /decl/hierarchy/outfit/job/talon_pilot @@ -83,6 +91,8 @@ /datum/job/talon/guard title = "Talon Guard" + flag = TALSEC + department_flag = TALON job_description = "The guard's job is to keep the crew of the ITV Talon safe and ensure the captain's wishes are carried out." supervisors = "the ITV Talon's captain" outfit_type = /decl/hierarchy/outfit/job/talon_security diff --git a/vorestation.dme b/vorestation.dme index a67620c23b..2ca0b8fb0a 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -711,6 +711,7 @@ #include "code\game\jobs\access_datum_vr.dm" #include "code\game\jobs\job_controller.dm" #include "code\game\jobs\jobs.dm" +#include "code\game\jobs\jobs_vr.dm" #include "code\game\jobs\whitelist.dm" #include "code\game\jobs\whitelist_vr.dm" #include "code\game\jobs\job\_alt_title.dm"