Job subsystem & Player Spawn Tweaks (#2403)

Converts the job controller into a subsystem, including absolute paths. Also cleans up some mob despawn code.

changes:

The job master is now a subsystem. Job init moved out of EMI.
Custom loadout now properly overrides job equipment on spawn.
Odin despawn timers are now deleted on arrival shuttle launch.
Cryogenic storage despawn is now handled by the job controller.
Backpack equipping has been fully moved to equip_backpack().
equip_backpack() will now equip departmental backpacks.
Job backpack selection is now set via. vars instead of overriding a proc.
Fixes #2180.
This commit is contained in:
Lohikar
2017-05-23 04:10:30 -05:00
committed by skull132
parent f0766fa72d
commit 4d6d382967
30 changed files with 1080 additions and 1128 deletions
+1 -1
View File
@@ -154,6 +154,7 @@
#include "code\controllers\subsystems\garbage.dm"
#include "code\controllers\subsystems\icon_smooth.dm"
#include "code\controllers\subsystems\icon_updates.dm"
#include "code\controllers\subsystems\job.dm"
#include "code\controllers\subsystems\law.dm"
#include "code\controllers\subsystems\lighting.dm"
#include "code\controllers\subsystems\machinery.dm"
@@ -430,7 +431,6 @@
#include "code\game\jobs\_access_defs.dm"
#include "code\game\jobs\access.dm"
#include "code\game\jobs\access_datum.dm"
#include "code\game\jobs\job_controller.dm"
#include "code\game\jobs\jobs.dm"
#include "code\game\jobs\whitelist.dm"
#include "code\game\jobs\job\assistant.dm"
+4
View File
@@ -186,3 +186,7 @@
// Maximum number of chickens allowed at once.
// If the number of chickens on the map exceeds this, laid eggs will not hatch.
#define MAX_CHICKENS 50
#define CREW_MINIMUM_NUTRITION 50 // The minimum amount of nutrition a crewmember will spawn with.
#define CREW_MAXIMUM_NUTRITION 100 // Same as above, but maximum.
+1
View File
@@ -1,3 +1,4 @@
#define SS_INIT_JOBS 20
#define SS_INIT_MISC_FIRST 19
#define SS_INIT_SEEDS 18 // Plant controller setup.
#define SS_INIT_ASTEROID 17 // Asteroid generation.
+19 -2
View File
@@ -2,13 +2,14 @@
/datum/controller/subsystem/arrivals
name = "Arrivals"
flags = SS_NO_INIT | SS_BACKGROUND
flags = SS_NO_INIT | SS_BACKGROUND | SS_NO_TICK_CHECK
priority = SS_PRIORITY_ARRIVALS
var/datum/shuttle/ferry/arrival/shuttle
var/launch_time //the time at which the shuttle will be launched
var/wait_for_launch = 0 //if the shuttle is waiting to launch
var/list/current_mobs = list()
/datum/controller/subsystem/arrivals/New()
NEW_SS_GLOBAL(SSarrivals)
@@ -20,20 +21,36 @@
if (world.time >= launch_time) //time to launch the shuttle
stop_launch_countdown()
shuttle.launch(src)
for (var/thing in current_mobs)
var/mob/living/carbon/human/M = locate(thing)
if (istype(M) && M.odin_despawn_timer)
deltimer(M.odin_despawn_timer)
M.odin_despawn_timer = null
current_mobs.Cut()
else
// Sleep, we ain't doin' shit. on_hotzone_enter() will wake us.
suspend()
// Called when a living mob enters the shuttle area.
/datum/controller/subsystem/arrivals/proc/on_hotzone_enter()
/datum/controller/subsystem/arrivals/proc/on_hotzone_enter(mob/living/M)
if (!shuttle.location)
return
log_debug("SSarrivals: [M] has entered arrival shuttle hotzone.")
if (istype(M))
current_mobs += "\ref[M]"
wake() // Wake the process.
if (!wait_for_launch && shuttle.location == 1 && shuttle.moving_status == SHUTTLE_IDLE)
set_launch_countdown(30)
/datum/controller/subsystem/arrivals/proc/on_hotzone_exit(mob/living/M)
current_mobs -= "\ref[M]"
log_debug("SSarrivals: [M] has exited arrival shuttle hotzone.")
//called when the shuttle has arrived.
/datum/controller/subsystem/arrivals/proc/shuttle_arrived()
@@ -35,11 +35,6 @@
if(config.ToRban)
ToRban_autoupdate()
// Setup the job controller.
job_master = new /datum/controller/occupations()
job_master.SetupOccupations()
job_master.LoadJobs("config/jobs.txt")
// Set up antags.
populate_antag_type_list()
+806
View File
@@ -0,0 +1,806 @@
/var/datum/controller/subsystem/jobs/SSjobs
#define GET_RANDOM_JOB 0
#define BE_ASSISTANT 1
#define RETURN_TO_LOBBY 2
/datum/controller/subsystem/jobs
// Subsystem stuff.
name = "Jobs"
flags = SS_NO_FIRE
init_order = SS_INIT_JOBS
// Vars.
var/list/occupations = list()
var/list/unassigned = list()
var/list/job_debug = list()
/datum/controller/subsystem/jobs/New()
NEW_SS_GLOBAL(SSjobs)
/datum/controller/subsystem/jobs/Initialize()
SetupOccupations()
LoadJobs("config/jobs.txt")
..()
/datum/controller/subsystem/jobs/Recover()
occupations = SSjobs.occupations
unassigned = SSjobs.unassigned
job_debug = SSjobs.job_debug
if (islist(job_debug))
job_debug += "NOTICE: Job system Recover() triggered."
/datum/controller/subsystem/jobs/proc/SetupOccupations(faction = "Station")
occupations = list()
var/list/all_jobs = typesof(/datum/job)
if(!all_jobs.len)
world << "<span class='warning'>Error setting up jobs, no job datums found!</span>"
return FALSE
for(var/J in all_jobs)
var/datum/job/job = new J()
if(!job) continue
if(job.faction != faction) continue
occupations += job
if (config && config.use_age_restriction_for_jobs)
job.fetch_age_restriction()
return TRUE
/datum/controller/subsystem/jobs/proc/Debug(text)
if (!Debug2)
return FALSE
job_debug += text
return TRUE
/datum/controller/subsystem/jobs/proc/GetJob(rank)
if (!rank)
return null
for (var/thing in occupations)
var/datum/job/J = thing
if (!J)
continue
if (J.title == rank)
return J
/datum/controller/subsystem/jobs/proc/GetPlayerAltTitle(mob/new_player/player, rank)
. = player.client.prefs.GetPlayerAltTitle(GetJob(rank))
/datum/controller/subsystem/jobs/proc/AssignRole(mob/new_player/player, rank, latejoin = FALSE)
Debug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
if(player && player.mind && rank)
var/datum/job/job = GetJob(rank)
if(!job)
return FALSE
if(jobban_isbanned(player, rank))
return FALSE
if(!job.player_old_enough(player.client))
return FALSE
var/position_limit = job.total_positions
if(!latejoin)
position_limit = job.spawn_positions
if((job.current_positions < position_limit) || position_limit == -1)
Debug("Player: [player] is now Rank: [rank], JCP:[job.current_positions], JPL:[position_limit]")
player.mind.assigned_role = rank
player.mind.role_alt_title = GetPlayerAltTitle(player, rank)
unassigned -= player
job.current_positions++
return TRUE
Debug("AR has failed, Player: [player], Rank: [rank]")
return FALSE
/datum/controller/subsystem/jobs/proc/FreeRole(rank)
var/datum/job/job = GetJob(rank)
if (job && job.current_positions >= job.total_positions && job.total_positions != -1)
job.total_positions++
return TRUE
return FALSE
/datum/controller/subsystem/jobs/proc/FindOccupationCandidates(datum/job/job, level, flag)
Debug("Running FOC, Job: [job], Level: [level], Flag: [flag]")
. = list()
for(var/mob/new_player/player in unassigned)
if(jobban_isbanned(player, job.title))
Debug("FOC isbanned failed, Player: [player]")
continue
if(!job.player_old_enough(player.client))
Debug("FOC player not old enough, Player: [player]")
continue
if(flag && !(flag in player.client.prefs.be_special_role))
Debug("FOC flag failed, Player: [player], Flag: [flag], ")
continue
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
Debug("FOC pass, Player: [player], Level:[level]")
. += player
/datum/controller/subsystem/jobs/proc/GiveRandomJob(mob/new_player/player)
Debug("GRJ Giving random job, Player: [player]")
for(var/thing in shuffle(occupations))
var/datum/job/job = thing
if(!job)
continue
if(istype(job, GetJob("Assistant"))) // We don't want to give him assistant, that's boring!
continue
if(job in command_positions) //If you want a command position, select it!
continue
if(jobban_isbanned(player, job.title))
Debug("GRJ isbanned failed, Player: [player], Job: [job.title]")
continue
if(!job.player_old_enough(player.client))
Debug("GRJ player not old enough, Player: [player]")
continue
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
Debug("GRJ Random job given, Player: [player], Job: [job]")
AssignRole(player, job.title)
unassigned -= player
break
/datum/controller/subsystem/jobs/proc/ResetOccupations()
for(var/mob/new_player/player in player_list)
if((player) && (player.mind))
player.mind.assigned_role = null
player.mind.special_role = null
SetupOccupations()
unassigned = list()
///This proc is called before the level loop of DivideOccupations() and will try to select a head, ignoring ALL non-head preferences for every level until it locates a head or runs out of levels to check
/datum/controller/subsystem/jobs/proc/FillHeadPosition()
for(var/level = 1 to 3)
for(var/command_position in command_positions)
var/datum/job/job = GetJob(command_position)
if(!job)
continue
var/list/candidates = FindOccupationCandidates(job, level)
if(!candidates.len)
continue
// Build a weighted list, weight by age.
var/list/weightedCandidates = list()
for(var/mob/V in candidates)
// Log-out during round-start? What a bad boy, no head position for you!
if(!V.client)
continue
var/age = V.client.prefs.age
switch(age)
if(job.minimum_character_age to (job.minimum_character_age+10))
weightedCandidates[V] = 3 // Still a bit young.
if((job.minimum_character_age+10) to (job.ideal_character_age-10))
weightedCandidates[V] = 6 // Better.
if((job.ideal_character_age-10) to (job.ideal_character_age+10))
weightedCandidates[V] = 10 // Great.
if((job.ideal_character_age+10) to (job.ideal_character_age+20))
weightedCandidates[V] = 6 // Still good.
if((job.ideal_character_age+20) to INFINITY)
weightedCandidates[V] = 3 // Geezer.
else
// If there's ABSOLUTELY NOBODY ELSE
if(candidates.len == 1) weightedCandidates[V] = 1
var/mob/new_player/candidate = pickweight(weightedCandidates)
if(AssignRole(candidate, command_position))
return TRUE
return FALSE
///This proc is called at the start of the level loop of DivideOccupations() and will cause head jobs to be checked before any other jobs of the same level
/datum/controller/subsystem/jobs/proc/CheckHeadPositions(level)
for(var/command_position in command_positions)
var/datum/job/job = GetJob(command_position)
if(!job) continue
var/list/candidates = FindOccupationCandidates(job, level)
if(!candidates.len) continue
var/mob/new_player/candidate = pick(candidates)
AssignRole(candidate, command_position)
/** Proc DivideOccupations
* fills var "assigned_role" for all ready players.
* This proc must not have any side effect besides of modifying "assigned_role".
**/
/datum/controller/subsystem/jobs/proc/DivideOccupations()
//Setup new player list and get the jobs list
Debug("Running DO")
SetupOccupations()
//Holder for Triumvirate is stored in the ticker, this just processes it
if(SSticker.triai)
for(var/datum/job/A in occupations)
if(A.title == "AI")
A.spawn_positions = 3
break
//Get the players who are ready
for(var/mob/new_player/player in player_list)
if(player.ready && player.mind && !player.mind.assigned_role)
unassigned += player
Debug("DO, Len: [unassigned.len]")
if(unassigned.len == 0)
return FALSE
//Shuffle players and jobs
unassigned = shuffle(unassigned)
HandleFeedbackGathering()
//People who wants to be assistants, sure, go on.
Debug("DO, Running Assistant Check 1")
var/datum/job/assist = new DEFAULT_JOB_TYPE ()
var/list/assistant_candidates = FindOccupationCandidates(assist, 3)
Debug("AC1, Candidates: [assistant_candidates.len]")
for(var/mob/new_player/player in assistant_candidates)
Debug("AC1 pass, Player: [player]")
AssignRole(player, "Assistant")
assistant_candidates -= player
Debug("DO, AC1 end")
//Select one head
Debug("DO, Running Head Check")
FillHeadPosition()
Debug("DO, Head Check end")
//Other jobs are now checked
Debug("DO, Running Standard Check")
// New job giving system by Donkie
// This will cause lots of more loops, but since it's only done once it shouldn't really matter much at all.
// Hopefully this will add more randomness and fairness to job giving.
// Loop through all levels from high to low
var/list/shuffledoccupations = shuffle(occupations)
// var/list/disabled_jobs = ticker.mode.disabled_jobs // So we can use .Find down below without a colon.
for(var/level = 1 to 3)
//Check the head jobs first each level
CheckHeadPositions(level)
// Loop through all unassigned players
for(var/mob/new_player/player in unassigned)
// Loop through all jobs
for(var/datum/job/job in shuffledoccupations) // SHUFFLE ME BABY
if(!job || (job.title in SSticker.mode.disabled_jobs) ) //11/2/16
continue
if(jobban_isbanned(player, job.title))
Debug("DO isbanned failed, Player: [player], Job:[job.title]")
continue
if(!job.player_old_enough(player.client))
Debug("DO player not old enough, Player: [player], Job:[job.title]")
continue
// If the player wants that job on this level, then try give it to him.
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
// If the job isn't filled
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
Debug("DO pass, Player: [player], Level:[level], Job:[job.title]")
AssignRole(player, job.title)
unassigned -= player
break
// Hand out random jobs to the people who didn't get any in the last check
// Also makes sure that they got their preference correct
for(var/mob/new_player/player in unassigned)
if(player.client.prefs.alternate_option == GET_RANDOM_JOB)
GiveRandomJob(player)
Debug("DO, Standard Check end")
Debug("DO, Running AC2")
// For those who wanted to be assistant if their preferences were filled, here you go.
for(var/mob/new_player/player in unassigned)
if(player.client.prefs.alternate_option == BE_ASSISTANT)
Debug("AC2 Assistant located, Player: [player]")
AssignRole(player, "Assistant")
//For ones returning to lobby
for(var/mob/new_player/player in unassigned)
if(player.client.prefs.alternate_option == RETURN_TO_LOBBY)
player.ready = 0
player.new_player_panel_proc()
unassigned -= player
return TRUE
/datum/controller/subsystem/jobs/proc/EquipRank(mob/living/carbon/human/H, rank, joined_late = FALSE, megavend = FALSE)
if(!H)
return null
var/datum/job/job = GetJob(rank)
var/list/spawn_in_storage = list()
if(job)
var/list/custom_equip_slots = list() //If more than one item takes the same slot, all after the first one spawn in storage.
var/list/custom_equip_leftovers = list()
//Equip job items.
if(!megavend) //Equip custom gear loadout.
job.equip_backpack(H)
job.setup_account(H)
if(H.client.prefs.gear && H.client.prefs.gear.len && job.title != "Cyborg" && job.title != "AI")
for(var/thing in H.client.prefs.gear)
var/datum/gear/G = gear_datums[thing]
if(G)
var/permitted
if(G.allowed_roles)
for(var/job_name in G.allowed_roles)
if(job.title == job_name)
permitted = TRUE
else
permitted = TRUE
if(G.whitelisted && !is_alien_whitelisted(H, all_species[G.whitelisted]))
permitted = FALSE
if(!permitted)
H << "<span class='warning'>Your current job or whitelist status does not permit you to spawn with [thing]!</span>"
continue
if(G.slot && !(G.slot in custom_equip_slots))
// This is a miserable way to fix the loadout overwrite bug, but the alternative requires
// adding an arg to a bunch of different procs. Will look into it after this merge. ~ Z
var/metadata = H.client.prefs.gear[G.display_name]
if(G.slot == slot_wear_mask || G.slot == slot_wear_suit || G.slot == slot_head)
custom_equip_leftovers += thing
else if(H.equip_to_slot_or_del(G.spawn_item(H, metadata), G.slot))
H << "<span class='notice'>Equipping you with \the [thing]!</span>"
custom_equip_slots.Add(G.slot)
else
custom_equip_leftovers.Add(thing)
else
spawn_in_storage += thing
// This goes after custom loadout it doesn't prevent custom loadout stuff from being equipped.
job.equip_survival(H)
job.equip(H)
job.apply_fingerprints(H)
// Randomize nutrition. Defines are in __defines/mobs.dm
H.nutrition = (rand(CREW_MINIMUM_NUTRITION, CREW_MAXIMUM_NUTRITION) * 0.01) * H.max_nutrition
//If some custom items could not be equipped before, try again now.
for(var/thing in custom_equip_leftovers)
var/datum/gear/G = gear_datums[thing]
if(G.slot in custom_equip_slots)
spawn_in_storage += thing
else
var/metadata = H.client.prefs.gear[G.display_name]
if(H.equip_to_slot_or_del(G.spawn_item(H, metadata), G.slot))
H << "<span class='notice'>Equipping you with \the [thing]!</span>"
custom_equip_slots.Add(G.slot)
else
spawn_in_storage += thing
else
H << "Your job is [rank] and the game just can't handle it! Please report this bug to an administrator."
H.job = rank
if(!joined_late)
var/obj/S = null
for(var/obj/effect/landmark/start/sloc in landmarks_list)
if(sloc.name != rank) continue
if(locate(/mob/living) in sloc.loc) continue
S = sloc
break
if(!S)
S = locate("start*[rank]") // use old stype
if(istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf))
H.loc = S.loc
else
LateSpawn(H, rank)
// Moving wheelchair if they have one
if(H.buckled && istype(H.buckled, /obj/structure/bed/chair/wheelchair))
H.buckled.loc = H.loc
H.buckled.set_dir(H.dir)
// If they're head, give them the account info for their department
if(H.mind && job.head_position)
var/remembered_info = ""
var/datum/money_account/department_account = department_accounts[job.department]
if(department_account)
remembered_info += "<b>Your department's account number is:</b> #[department_account.account_number]<br>"
remembered_info += "<b>Your department's account pin is:</b> [department_account.remote_access_pin]<br>"
remembered_info += "<b>Your department's account funds are:</b> $[department_account.money]<br>"
H.mind.store_memory(remembered_info)
var/alt_title = null
if(H.mind)
H.mind.assigned_role = rank
alt_title = H.mind.role_alt_title
switch(rank)
if("Cyborg")
return H.Robotize()
if("AI")
return H
if("Captain")
var/sound/announce_sound = (SSticker.current_state <= GAME_STATE_SETTING_UP)? null : sound('sound/misc/boatswain.ogg', volume=20)
captain_announcement.Announce("All hands, Captain [H.real_name] on deck!", new_sound=announce_sound)
//Deferred item spawning.
if(spawn_in_storage && spawn_in_storage.len)
var/obj/item/weapon/storage/B
for(var/obj/item/weapon/storage/S in H.contents)
B = S
break
if(B)
for(var/thing in spawn_in_storage)
H << "<span class='notice'>Placing \the [thing] in your [B.name]!</span>"
var/datum/gear/G = gear_datums[thing]
var/metadata = H.client.prefs.gear[G.display_name]
G.spawn_item(B, metadata)
else
H << "<span class='danger'>Failed to locate a storage object on your mob, either you spawned with no arms and no backpack or this is a bug.</span>"
if(istype(H) && !megavend) //give humans wheelchairs, if they need them.
var/obj/item/organ/external/l_foot = H.get_organ("l_foot")
var/obj/item/organ/external/r_foot = H.get_organ("r_foot")
if(!l_foot || !r_foot)
var/obj/structure/bed/chair/wheelchair/W = new /obj/structure/bed/chair/wheelchair(H.loc)
H.buckled = W
H.update_canmove()
W.set_dir(H.dir)
W.buckled_mob = H
W.add_fingerprint(H)
H << "<B>You are [job.total_positions == 1 ? "the" : "a"] [alt_title ? alt_title : rank].</B>"
if(job.supervisors)
H << "<b>As the [alt_title ? alt_title : rank] you answer directly to [job.supervisors]. Special circumstances may change this.</b>"
if(job.idtype)
spawnId(H, rank, alt_title)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset(H), slot_l_ear)
H << "<b>To speak on your department's radio channel use :h. For the use of other channels, examine your headset.</b>"
if(job.req_admin_notify)
H << "<b>You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via adminhelp.</b>"
//Gives glasses to the vision impaired
if(H.disabilities & NEARSIGHTED && !megavend)
var/equipped = H.equip_to_slot_or_del(new /obj/item/clothing/glasses/regular(H), slot_glasses)
if(equipped != 1)
var/obj/item/clothing/glasses/G = H.glasses
G.prescription = TRUE
BITSET(H.hud_updateflag, ID_HUD)
BITSET(H.hud_updateflag, IMPLOYAL_HUD)
BITSET(H.hud_updateflag, SPECIALROLE_HUD)
return H
/mob/living/carbon/human
var/tmp/odin_despawn_timer
/mob/living/carbon/human/proc/odin_timeout()
if (!istype(get_area(src), /area/centcom/spawning))
return
if (!client)
SSjobs.odin_despawn_mob(src)
else
var/datum/spawnpoint/spawnpos = spawntypes["Cryogenic Storage"]
if(spawnpos && istype(spawnpos))
src << "<span class='warning'>You come to the sudden realization that you never left the Aurora at all! You were in cryo the whole time!</span>"
src.forceMove(pick(spawnpos.turfs))
global_announcer.autosay("[real_name], [mind.role_alt_title], [spawnpos.msg].", "Cryogenic Oversight")
else
SSjobs.odin_despawn_mob(src) //somehow they can't spawn at cryo, so this is the only recourse of action.
// Convenience wrapper.
/datum/controller/subsystem/jobs/proc/odin_despawn_mob(mob/living/carbon/human/H)
global_announcer.autosay("[H.real_name], [H.mind.role_alt_title], has entered long-term storage.", "NTCC Odin Cryogenic Oversight")
H.visible_message("<span class='notice'>[H.name] makes their way to the Odin's cryostorage, and departs.</span>", 3)
DespawnMob(H)
/datum/controller/subsystem/jobs/proc/EquipPersonal(mob/living/carbon/human/H, rank, joined_late = FALSE, spawning_at)
if(!H)
return null
switch(rank)
if("Cyborg")
return EquipRank(H, rank, 1)
if("AI")
return EquipRank(H, rank, 1)
if(spawning_at != "Arrivals Shuttle")
return EquipRank(H, rank, 1)
var/datum/job/job = GetJob(rank)
var/list/spawn_in_storage = list()
H.odin_despawn_timer = addtimer(CALLBACK(H, /mob/living/carbon/human/.proc/odin_timeout), 15 MINUTES, TIMER_STOPPABLE)
if(job)
//Equip custom gear loadout.
var/list/custom_equip_slots = list() //If more than one item takes the same slot, all after the first one spawn in storage.
var/list/custom_equip_leftovers = list()
if(LAZYLEN(H.client.prefs.gear) && job.title != "Cyborg" && job.title != "AI")
for(var/thing in H.client.prefs.gear)
var/datum/gear/G = gear_datums[thing]
if(G)
var/permitted
if(G.allowed_roles)
for(var/job_name in G.allowed_roles)
if(job.title == job_name)
permitted = TRUE
break
else
permitted = TRUE
if(G.whitelisted && !is_alien_whitelisted(H, all_species[G.whitelisted]))
permitted = FALSE
if(!permitted)
H << "<span class='warning'>Your current job or whitelist status does not permit you to spawn with [thing]!</span>"
continue
if(G.slot && !(G.slot in custom_equip_slots))
// This is a miserable way to fix the loadout overwrite bug, but the alternative requires
// adding an arg to a bunch of different procs. Will look into it after this merge. ~ Z
var/metadata = H.client.prefs.gear[G.display_name]
var/obj/item/CI = G.spawn_item(H,metadata)
if (G.slot == slot_wear_mask || G.slot == slot_wear_suit || G.slot == slot_head)
custom_equip_leftovers += thing
else if (H.equip_to_slot_or_del(CI, G.slot))
CI.autodrobe_no_remove = TRUE
H << "<span class='notice'>Equipping you with \the [thing]!</span>"
custom_equip_slots += G.slot
else
custom_equip_leftovers += thing
else
spawn_in_storage += thing
//Equip job items.
job.late_equip(H)
job.equip_backpack(H)
job.equip_survival(H)
job.setup_account(H)
job.apply_fingerprints(H)
//If some custom items could not be equipped before, try again now.
for(var/thing in custom_equip_leftovers)
var/datum/gear/G = gear_datums[thing]
if(G.slot in custom_equip_slots)
spawn_in_storage += thing
else
var/metadata = H.client.prefs.gear[G.display_name]
var/obj/item/CI = G.spawn_item(H,metadata)
if(H.equip_to_slot_or_del(CI, G.slot))
H << "<span class='notice'>Equipping you with \the [thing]!</span>"
custom_equip_slots += G.slot
CI.autodrobe_no_remove = TRUE
else
spawn_in_storage += thing
else
H << "Your job is [rank] and the game just can't handle it! Please report this bug to an administrator."
H.job = rank
if(LAZYLEN(spawn_in_storage))
var/obj/item/weapon/storage/B
for(var/obj/item/weapon/storage/S in H.contents)
B = S
break
if(B)
for(var/thing in spawn_in_storage)
H << "<span class='notice'>Placing \the [thing] in your [B.name]!</span>"
var/datum/gear/G = gear_datums[thing]
var/metadata = H.client.prefs.gear[G.display_name]
G.spawn_item(B, metadata)
else
H << "<span class='danger'>Failed to locate a storage object on your mob, either you spawned with no arms and no backpack or this is a bug.</span>"
if(istype(H)) //give humans wheelchairs, if they need them.
var/obj/item/organ/external/l_foot = H.get_organ("l_foot")
var/obj/item/organ/external/r_foot = H.get_organ("r_foot")
if(!l_foot || !r_foot)
var/obj/structure/bed/chair/wheelchair/W = new /obj/structure/bed/chair/wheelchair(H.loc)
H.buckled = W
H.update_canmove()
W.set_dir(H.dir)
W.buckled_mob = H
W.add_fingerprint(H)
//Gives glasses to the vision impaired
if(H.disabilities & NEARSIGHTED)
var/equipped = H.equip_to_slot_or_del(new /obj/item/clothing/glasses/regular(H), slot_glasses)
if(equipped != 1)
var/obj/item/clothing/glasses/G = H.glasses
G.prescription = TRUE
G.autodrobe_no_remove = TRUE
// So shoes aren't silent if people never change 'em.
H.update_noise_level()
BITSET(H.hud_updateflag, ID_HUD)
BITSET(H.hud_updateflag, IMPLOYAL_HUD)
BITSET(H.hud_updateflag, SPECIALROLE_HUD)
H << "<b>Welcome to the Odin! Simply proceed down and to the right to board the shuttle to your workplace!</b>."
return H
/datum/controller/subsystem/jobs/proc/spawnId(mob/living/carbon/human/H, rank, title)
if (!H)
return FALSE
var/obj/item/weapon/card/id/C = null
var/datum/job/job = GetJob(rank)
if(job)
if(job.title == "Cyborg")
return
else
C = new job.idtype(H)
C.access = job.get_access()
else
C = new /obj/item/weapon/card/id(H)
if(C)
C.rank = rank
C.assignment = title ? title : rank
H.set_id_info(C)
//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.ownrank = C.rank
pda.name = "PDA-[H.real_name] ([pda.ownjob])"
return TRUE
/datum/controller/subsystem/jobs/proc/LoadJobs(jobsfile)
if (!config.load_jobs_from_txt)
return FALSE
var/list/jobEntries = file2list(jobsfile)
for(var/job in jobEntries)
if(!job)
continue
job = trim(job)
if (!length(job))
continue
var/pos = findtext(job, "=")
var/name = null
var/value = null
if(pos)
name = copytext(job, 1, pos)
value = copytext(job, pos + 1)
else
continue
if(name && value)
var/datum/job/J = GetJob(name)
if(!J) continue
J.total_positions = text2num(value)
J.spawn_positions = text2num(value)
if(name == "AI" || name == "Cyborg")//I dont like this here but it will do for now // 6 years later and it's still not changed. Hue.
J.total_positions = 0
return TRUE
/datum/controller/subsystem/jobs/proc/HandleFeedbackGathering()
for(var/thing in occupations)
var/datum/job/job = thing
var/tmp_str = "|[job.title]|"
var/level1 = 0 //high
var/level2 = 0 //medium
var/level3 = 0 //low
var/level4 = 0 //never
var/level5 = 0 //banned
var/level6 = 0 //account too young
for(var/mob/new_player/player in player_list)
if(!(player.ready && player.mind && !player.mind.assigned_role))
continue //This player is not ready
if(jobban_isbanned(player, job.title))
level5++
continue
if(!job.player_old_enough(player.client))
level6++
continue
if(player.client.prefs.GetJobDepartment(job, 1) & job.flag)
level1++
else if(player.client.prefs.GetJobDepartment(job, 2) & job.flag)
level2++
else if(player.client.prefs.GetJobDepartment(job, 3) & job.flag)
level3++
else level4++ //not selected
tmp_str += "HIGH=[level1]|MEDIUM=[level2]|LOW=[level3]|NEVER=[level4]|BANNED=[level5]|YOUNG=[level6]|-"
feedback_add_details("job_preferences",tmp_str)
/datum/controller/subsystem/jobs/proc/LateSpawn(mob/living/carbon/human/H, rank)
//spawn at one of the latespawn locations
var/datum/spawnpoint/spawnpos
if(H.client.prefs.spawnpoint)
spawnpos = spawntypes[H.client.prefs.spawnpoint]
if(spawnpos && istype(spawnpos))
if(spawnpos.check_job_spawning(rank))
H.loc = pick(spawnpos.turfs)
. = spawnpos.msg
else
H << "Your chosen spawnpoint ([spawnpos.display_name]) is unavailable for your chosen job. Spawning you at the Arrivals shuttle instead."
H.loc = pick(latejoin)
. = "is inbound from the NTCC Odin"
else
H.loc = pick(latejoin)
. = "is inbound from the NTCC Odin"
/datum/controller/subsystem/jobs/proc/DespawnMob(mob/living/carbon/human/H)
//Update any existing objectives involving this mob.
for(var/datum/objective/O in all_objectives)
// We don't want revs to get objectives that aren't for heads of staff. Letting
// them win or lose based on cryo is silly so we remove the objective.
if(O.target == H.mind)
if(O.owner && O.owner.current)
O.owner.current << "<span class='warning'>You get the feeling your target is no longer within your reach...</span>"
qdel(O)
//Handle job slot/tater cleanup.
if (H.mind)
var/job = H.mind.assigned_role
FreeRole(job)
if(H.mind.objectives.len)
qdel(H.mind.objectives)
H.mind.special_role = null
// Delete them from datacore.
if(PDA_Manifest.len)
PDA_Manifest.Cut()
for(var/datum/data/record/R in data_core.medical)
if ((R.fields["name"] == H.real_name))
qdel(R)
for(var/datum/data/record/T in data_core.security)
if ((T.fields["name"] == H.real_name))
qdel(T)
for(var/datum/data/record/G in data_core.general)
if ((G.fields["name"] == H.real_name))
qdel(G)
log_and_message_admins("[key_name(H)] ([H.mind.role_alt_title]) entered cryostorage.")
//This should guarantee that ghosts don't spawn.
H.ckey = null
// Delete the mob.
qdel(H)
+4 -4
View File
@@ -348,17 +348,17 @@ var/datum/controller/subsystem/ticker/SSticker
world << "<span class='danger'>Serious error in mode setup!</span> Reverting to pre-game lobby."
return 0
job_master.ResetOccupations()
SSjobs.ResetOccupations()
src.mode.create_antagonists()
src.mode.pre_setup()
job_master.DivideOccupations() // Apparently important for new antagonist system to register specific job antags properly.
SSjobs.DivideOccupations() // Apparently important for new antagonist system to register specific job antags properly.
if(!src.mode.can_start())
world << "<B>Unable to start [mode.name].</B> Not enough players, [mode.required_players] players needed. Reverting to pre-game lobby."
current_state = GAME_STATE_PREGAME
mode.fail_setup()
mode = null
job_master.ResetOccupations()
SSjobs.ResetOccupations()
return 0
if(hide_mode)
@@ -547,7 +547,7 @@ var/datum/controller/subsystem/ticker/SSticker
if(player.mind.assigned_role == "Captain")
captainless = FALSE
if(!player_is_antag(player.mind, only_offstation_roles = 1))
job_master.EquipRank(player, player.mind.assigned_role, 0)
SSjobs.EquipRank(player, player.mind.assigned_role, 0)
UpdateFactionList(player)
equip_custom_items(player)
-3
View File
@@ -23,9 +23,6 @@
if(!holder) return
switch(controller)
if("Jobs")
debug_variables(job_master)
feedback_add_details("admin_verb","DJobs")
if("Configuration")
debug_variables(config)
feedback_add_details("admin_verb","DConf")
+7 -2
View File
@@ -144,9 +144,14 @@ area/space/atmosalert()
if (!istype(Obj, /mob/living) || !SSarrivals)
return
log_debug("SSarrivals: [Obj] has entered arrival shuttle hotzone.")
SSarrivals.on_hotzone_enter(Obj)
SSarrivals.on_hotzone_enter()
/area/shuttle/arrival/centcom/Exited(atom/movable/Obj, atom/newLoc)
. = ..()
if (!istype(Obj, /mob/living) || !SSarrivals)
return
SSarrivals.on_hotzone_exit(Obj)
/area/shuttle/arrival/transit
icon_state = "shuttle2"
+5 -9
View File
@@ -15,19 +15,15 @@
alt_titles = list("Visitor")
/datum/job/assistant/equip(var/mob/living/carbon/human/H)
if(!H) return 0
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel(H), slot_back)
if(!H)
return FALSE
var/obj/item/clothing/under/color/grey/G = new /obj/item/clothing/under/color/grey(H)
if(H.equip_to_slot_or_del(G, slot_w_uniform))
G.autodrobe_no_remove = 1
G.autodrobe_no_remove = TRUE
var/obj/item/clothing/shoes/black/B = new /obj/item/clothing/shoes/black(H)
if(H.equip_to_slot_or_del(B, slot_shoes))
B.autodrobe_no_remove = 1
return 1
B.autodrobe_no_remove = TRUE
return TRUE
/datum/job/assistant/get_access()
if(config.assistant_maint)
+10 -15
View File
@@ -20,15 +20,15 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
ideal_character_age = 70 // Old geezer captains ftw
bag_type = /obj/item/weapon/storage/backpack/captain
satchel_type = /obj/item/weapon/storage/backpack/satchel_cap
alt_satchel_type = /obj/item/weapon/storage/backpack/satchel
duffel_type = /obj/item/weapon/storage/backpack/duffel/cap
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/captain(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_cap(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/cap(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/captain(H), slot_w_uniform)
if(H.age>49)
// Since we can have something other than the default uniform at this
@@ -51,12 +51,11 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
H.implant_loyalty(H)
return 1
return TRUE
get_access()
return get_all_station_access()
/datum/job/hop
title = "Head of Personnel"
flag = HOP
@@ -89,13 +88,9 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hop(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/head_of_personnel(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/heads/hop(H), slot_belt)
@@ -103,4 +98,4 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/ids(H), slot_l_hand)
else
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/ids(H.back), slot_in_backpack)
return 1
return TRUE
+24 -31
View File
@@ -14,18 +14,13 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel(H), slot_back)
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_service(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/bartender(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/pda/bar(H), slot_belt)
return 1
return TRUE
/datum/job/chef
@@ -44,20 +39,15 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel(H), slot_back)
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_service(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chef(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/chef(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/clothing/head/chefhat(H), slot_head)
H.equip_to_slot_or_del(new /obj/item/device/pda/chef(H), slot_belt)
return 1
return TRUE
/datum/job/hydro
@@ -76,7 +66,8 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_service(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/hydroponics(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes)
@@ -94,8 +85,7 @@
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_hyd(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/hyd(H), slot_back)
return 1
return TRUE
//Cargo
@@ -181,7 +171,8 @@
alt_titles = list("Drill Technician","Prospector")
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_cargo (H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/industrial(H), slot_back)
@@ -198,12 +189,13 @@
else
H.equip_to_slot_or_del(new /obj/item/weapon/crowbar(H), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/bag/ore(H), slot_in_backpack)
return 1
return TRUE
equip_survival(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.species.equip_survival_gear(H,1)
return 1
return TRUE
/datum/job/janitor
title = "Janitor"
@@ -220,7 +212,8 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
@@ -230,8 +223,7 @@
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/janitor(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/janitor(H), slot_belt)
return 1
return TRUE
//More or less assistants
@@ -251,7 +243,8 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
@@ -262,7 +255,7 @@
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/weapon/barcodescanner(H), slot_r_store)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/bag/books(H), slot_l_hand)
return 1
return TRUE
@@ -283,7 +276,8 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/ia(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
@@ -299,5 +293,4 @@
H.equip_to_slot_or_del(new /obj/item/device/pda/lawyer(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/briefcase(H), slot_l_hand)
return 1
return TRUE
+3 -7
View File
@@ -15,16 +15,12 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
var/obj/item/weapon/storage/bible/B = new /obj/item/weapon/storage/bible(H) //BS12 EDIT
H.equip_to_slot_or_del(B, slot_l_hand)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chaplain(H), slot_w_uniform)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/device/pda/chaplain(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes)
spawn(0)
@@ -153,4 +149,4 @@
SSticker.Bible_deity_name = B.deity_name
feedback_set_details("religion_deity","[new_deity]")
feedback_set_details("religion_book","[new_book_style]")
return 1
return TRUE
+25 -19
View File
@@ -26,15 +26,15 @@
access_ce, access_RC_announce, access_keycard_auth, access_tcomsat, access_ai_upload)
minimal_player_age = 7
bag_type = /obj/item/weapon/storage/backpack/industrial
satchel_type = /obj/item/weapon/storage/backpack/satchel_eng
alt_satchel_type = /obj/item/weapon/storage/backpack/satchel
duffel_type = /obj/item/weapon/storage/backpack/duffel/eng
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/ce(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/industrial(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_eng(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/eng(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chief_engineer(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/pda/heads/ce(H), slot_l_store)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/workboots(H), slot_shoes)
@@ -44,9 +44,10 @@
return 1
equip_survival(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.species.equip_survival_gear(H,1)
return 1
return TRUE
/datum/job/engineer
@@ -64,9 +65,14 @@
minimal_access = list(access_eva, access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, access_external_airlocks, access_construction)
alt_titles = list("Maintenance Technician","Engine Technician","Electrician")
bag_type = /obj/item/weapon/storage/backpack/industrial
satchel_type = /obj/item/weapon/storage/backpack/satchel_eng
alt_satchel_type = /obj/item/weapon/storage/backpack/satchel
duffel_type = /obj/item/weapon/storage/backpack/duffel/eng
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/industrial(H), slot_back)
@@ -79,12 +85,13 @@
H.equip_to_slot_or_del(new /obj/item/clothing/head/hardhat(H), slot_head)
H.equip_to_slot_or_del(new /obj/item/device/t_scanner(H), slot_r_store)
H.equip_to_slot_or_del(new /obj/item/device/pda/engineering(H), slot_l_store)
return 1
return TRUE
equip_survival(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.species.equip_survival_gear(H,1)
return 1
return TRUE
/datum/job/atmos
@@ -101,22 +108,21 @@
access = list(access_eva, access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, access_external_airlocks, access_construction, access_atmospherics, access_external_airlocks)
minimal_access = list(access_eva, access_engine, access_atmospherics, access_maint_tunnels, access_emergency_storage, access_construction, access_external_airlocks)
bag_type = /obj/item/weapon/storage/backpack/industrial
satchel_type = /obj/item/weapon/storage/backpack/satchel_eng
duffel_type = /obj/item/weapon/storage/backpack/duffel/eng
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/eng(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/atmospheric_technician(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/workboots(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/atmos(H), slot_l_store)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/atmostech/(H), slot_belt)
return 1
return TRUE
equip_survival(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.species.equip_survival_gear(H,1)
return 1
return TRUE
+21 -17
View File
@@ -25,27 +25,31 @@
var/account_allowed = 1 // Does this job type come with a station account?
var/economic_modifier = 2 // With how much does this job modify the initial account amount?
var/bag_type = /obj/item/weapon/storage/backpack
var/satchel_type = /obj/item/weapon/storage/backpack/satchel_norm
var/alt_satchel_type = /obj/item/weapon/storage/backpack/satchel
var/duffel_type = /obj/item/weapon/storage/backpack/duffel
/datum/job/proc/equip(var/mob/living/carbon/human/H)
return 1
/datum/job/proc/equip_backpack(var/mob/living/carbon/human/H)
switch(H.backbag)
if(2)
var/obj/item/weapon/storage/backpack/B = new /obj/item/weapon/storage/backpack(H)
if(H.equip_to_slot_or_del(B, slot_back))
B.autodrobe_no_remove = 1
if(3)
var/obj/item/weapon/storage/backpack/satchel_norm/B = new /obj/item/weapon/storage/backpack/satchel_norm(H)
if(H.equip_to_slot_or_del(B, slot_back))
B.autodrobe_no_remove = 1
if(4)
var/obj/item/weapon/storage/backpack/satchel/B = new /obj/item/weapon/storage/backpack/satchel(H)
if(H.equip_to_slot_or_del(B, slot_back))
B.autodrobe_no_remove = 1
if(5)
var/obj/item/weapon/storage/backpack/duffel/B = new /obj/item/weapon/storage/backpack/duffel(H)
if(H.equip_to_slot_or_del(B, slot_back))
B.autodrobe_no_remove = 1
var/type_to_spawn
switch (H.backbag)
//if (1) // No bag selected.
if (2)
type_to_spawn = bag_type
if (3)
type_to_spawn = satchel_type
if (4)
type_to_spawn = alt_satchel_type
if (5)
type_to_spawn = duffel_type
if (type_to_spawn)
var/obj/item/bag = new type_to_spawn
if (H.equip_to_slot_or_del(bag, slot_back))
bag.autodrobe_no_remove = TRUE
/datum/job/proc/equip_survival(var/mob/living/carbon/human/H)
if(!H) return 0
+35 -37
View File
@@ -24,21 +24,21 @@
minimal_player_age = 10
ideal_character_age = 50
bag_type = /obj/item/weapon/storage/backpack/medic
satchel_type = /obj/item/weapon/storage/backpack/satchel_med
duffel_type = /obj/item/weapon/storage/backpack/duffel/med
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/cmo(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/medic(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/med(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chief_medical_officer(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/heads/cmo(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/adv(H), slot_l_hand)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat/cmo(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store)
return 1
return TRUE
/datum/job/doctor
title = "Medical Doctor"
@@ -55,16 +55,16 @@
minimal_access = list(access_medical, access_medical_equip, access_morgue, access_surgery, access_virology, access_eva)
alt_titles = list("Surgeon","Emergency Physician","Nurse","Virologist")
bag_type = /obj/item/weapon/storage/backpack/medic
satchel_type = /obj/item/weapon/storage/backpack/satchel_med
duffel_type = /obj/item/weapon/storage/backpack/duffel/med
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_med(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/adv(H), slot_l_hand)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/medic(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/med(H), slot_back)
if (H.mind.role_alt_title)
switch(H.mind.role_alt_title)
if("Emergency Physician")
@@ -100,7 +100,7 @@
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store)
return 1
return TRUE
@@ -120,20 +120,19 @@
minimal_access = list(access_medical, access_medical_equip, access_chemistry)
alt_titles = list("Pharmacist")
bag_type = /obj/item/weapon/storage/backpack/chemistry
satchel_type = /obj/item/weapon/storage/backpack/satchel_chem
duffel_type = /obj/item/weapon/storage/backpack/duffel/chem
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_med(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chemist(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/chemist(H), slot_belt)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/chemistry(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_chem(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/chem(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat/chemist(H), slot_wear_suit)
return 1
return TRUE
/datum/job/psychiatrist
title = "Psychiatrist"
@@ -151,13 +150,9 @@
alt_titles = list("Psychologist")
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_med(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel(H), slot_back)
if (H.mind.role_alt_title)
switch(H.mind.role_alt_title)
if("Psychiatrist")
@@ -170,8 +165,10 @@
H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat(H), slot_wear_suit)
return TRUE
/datum/job/Paramedic
/datum/job/paramedic
title = "Paramedic"
flag = PARAMEDIC
department = "Medical"
@@ -186,16 +183,16 @@
minimal_access = list(access_medical, access_medical_equip, access_morgue, access_eva, access_maint_tunnels, access_external_airlocks, access_paramedic)
alt_titles = list("Emergency Medical Technician")
bag_type = /obj/item/weapon/storage/backpack/medic
satchel_type = /obj/item/weapon/storage/backpack/satchel_med
duffel_type = /obj/item/weapon/storage/backpack/duffel/med
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_med(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/adv(H), slot_l_hand)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/medic(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/med(H), slot_back)
if (H.mind.role_alt_title)
switch(H.mind.role_alt_title)
if("Emergency Medical Technician")
@@ -208,9 +205,10 @@
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/medical/emt(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_l_store)
return 1
return TRUE
equip_survival(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.species.equip_survival_gear(H,1)
return 1
return TRUE
+31 -35
View File
@@ -23,20 +23,20 @@
minimal_player_age = 14
ideal_character_age = 50
bag_type = /obj/item/weapon/storage/backpack/toxins
satchel_type = /obj/item/weapon/storage/backpack/satchel_tox
duffel_type = /obj/item/weapon/storage/backpack/duffel/tox
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/rd(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/research_director(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/pda/heads/rd(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/weapon/clipboard(H), slot_l_hand)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/toxins(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_tox(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/tox(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat(H), slot_wear_suit)
return 1
return TRUE
@@ -57,19 +57,19 @@
minimal_player_age = 14
bag_type = /obj/item/weapon/storage/backpack/toxins
satchel_type = /obj/item/weapon/storage/backpack/satchel_tox
duffel_type = /obj/item/weapon/storage/backpack/duffel/tox
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sci(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/scientist(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/science(H), slot_belt)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/toxins(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_tox(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/tox(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat/science(H), slot_wear_suit)
return 1
return TRUE
/datum/job/xenobiologist
title = "Xenobiologist"
@@ -88,19 +88,20 @@
minimal_player_age = 14
bag_type = /obj/item/weapon/storage/backpack/toxins
satchel_type = /obj/item/weapon/storage/backpack/satchel_tox
duffel_type = /obj/item/weapon/storage/backpack/duffel/tox
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sci(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/scientist(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/science(H), slot_belt)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/toxins(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_tox(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/tox(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat/science(H), slot_wear_suit)
return 1
return TRUE
/datum/job/roboticist
title = "Roboticist"
@@ -120,19 +121,15 @@
minimal_player_age = 7
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sci(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/roboticist(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/roboticist(H), slot_l_store)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat(H), slot_wear_suit)
return 1
return TRUE
/datum/job/geneticist
title = "Geneticist"
@@ -148,18 +145,17 @@
access = list(access_genetics, access_tox, access_tox_storage, access_morgue, access_research)
minimal_access = list(access_medical, access_morgue, access_genetics, access_research)
bag_type = /obj/item/weapon/storage/backpack/genetics
satchel_type = /obj/item/weapon/storage/backpack/satchel_gen
duffel_type = /obj/item/weapon/storage/backpack/duffel/gen
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sci(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/geneticist(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/geneticist(H), slot_belt)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/genetics(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_gen(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/gen(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/toggle/labcoat/genetics(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store)
return 1
return TRUE
+32 -35
View File
@@ -24,13 +24,13 @@
access_detective)
minimal_player_age = 14
bag_type = /obj/item/weapon/storage/backpack/security
satchel_type = /obj/item/weapon/storage/backpack/satchel_sec
duffel_type = /obj/item/weapon/storage/backpack/duffel/sec
equip(var/mob/living/carbon/human/H)
if(!H) return 0
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/sec(H), slot_back)
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hos(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/head_of_security(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes)
@@ -47,8 +47,7 @@
else
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
H.implant_loyalty(H)
return 1
return TRUE
/datum/job/warden
@@ -66,14 +65,14 @@
minimal_access = list(access_security, access_eva, access_sec_doors, access_brig, access_armory, access_maint_tunnels, access_external_airlocks)
minimal_player_age = 7
bag_type = /obj/item/weapon/storage/backpack/security
satchel_type = /obj/item/weapon/storage/backpack/satchel_sec
duffel_type = /obj/item/weapon/storage/backpack/duffel/sec
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/sec(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/warden(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/warden(H), slot_belt)
@@ -90,7 +89,8 @@
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_l_hand)
else
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
return 1
return TRUE
@@ -108,14 +108,12 @@
access = list(access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_detective)
minimal_access = list(access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_detective)
minimal_player_age = 7
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/det(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/laceup(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/detective(H), slot_belt)
@@ -131,6 +129,7 @@
else
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/evidence(H), slot_in_backpack)
return TRUE
/datum/job/forensics
title = "Forensic Technician"
@@ -146,14 +145,11 @@
minimal_access = list(access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels)
alt_titles = list("Crime Scene Investigator")
minimal_player_age = 3
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/det/slob(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/laceup(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/detective(H), slot_belt)
@@ -175,7 +171,7 @@
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/evidence(H), slot_in_backpack)
return 1
return TRUE
/datum/job/officer
title = "Security Officer"
@@ -192,14 +188,15 @@
access = list(access_security, access_eva, access_sec_doors, access_brig, access_maint_tunnels, access_morgue, access_external_airlocks)
minimal_access = list(access_security, access_eva, access_sec_doors, access_brig, access_maint_tunnels, access_external_airlocks)
minimal_player_age = 7
bag_type = /obj/item/weapon/storage/backpack/security
satchel_type = /obj/item/weapon/storage/backpack/satchel_sec
duffel_type = /obj/item/weapon/storage/backpack/duffel/sec
equip(var/mob/living/carbon/human/H)
if(!H) return 0
if(!H)
return FALSE
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
if(5) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/duffel/sec(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/security(H), slot_belt)
@@ -209,4 +206,4 @@
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_l_hand)
else
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
return 1
return TRUE
-792
View File
@@ -1,792 +0,0 @@
var/global/datum/controller/occupations/job_master
#define GET_RANDOM_JOB 0
#define BE_ASSISTANT 1
#define RETURN_TO_LOBBY 2
/datum/controller/occupations
//List of all jobs
var/list/occupations = list()
//Players who need jobs
var/list/unassigned = list()
//Debug info
var/list/job_debug = list()
proc/SetupOccupations(var/faction = "Station")
occupations = list()
var/list/all_jobs = typesof(/datum/job)
if(!all_jobs.len)
world << "<span class='warning'>Error setting up jobs, no job datums found!</span>"
return 0
for(var/J in all_jobs)
var/datum/job/job = new J()
if(!job) continue
if(job.faction != faction) continue
occupations += job
if (config && config.use_age_restriction_for_jobs)
job.fetch_age_restriction()
return 1
proc/Debug(var/text)
if(!Debug2) return 0
job_debug.Add(text)
return 1
proc/GetJob(var/rank)
if(!rank) return null
for(var/datum/job/J in occupations)
if(!J) continue
if(J.title == rank) return J
return null
proc/GetPlayerAltTitle(mob/new_player/player, rank)
return player.client.prefs.GetPlayerAltTitle(GetJob(rank))
proc/AssignRole(var/mob/new_player/player, var/rank, var/latejoin = 0)
Debug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
if(player && player.mind && rank)
var/datum/job/job = GetJob(rank)
if(!job)
return 0
if(jobban_isbanned(player, rank))
return 0
if(!job.player_old_enough(player.client))
return 0
var/position_limit = job.total_positions
if(!latejoin)
position_limit = job.spawn_positions
if((job.current_positions < position_limit) || position_limit == -1)
Debug("Player: [player] is now Rank: [rank], JCP:[job.current_positions], JPL:[position_limit]")
player.mind.assigned_role = rank
player.mind.role_alt_title = GetPlayerAltTitle(player, rank)
unassigned -= player
job.current_positions++
return 1
Debug("AR has failed, Player: [player], Rank: [rank]")
return 0
proc/FreeRole(var/rank) //making additional slot on the fly
var/datum/job/job = GetJob(rank)
if(job && job.current_positions >= job.total_positions && job.total_positions != -1)
job.total_positions++
return 1
return 0
proc/FindOccupationCandidates(datum/job/job, level, flag)
Debug("Running FOC, Job: [job], Level: [level], Flag: [flag]")
var/list/candidates = list()
for(var/mob/new_player/player in unassigned)
if(jobban_isbanned(player, job.title))
Debug("FOC isbanned failed, Player: [player]")
continue
if(!job.player_old_enough(player.client))
Debug("FOC player not old enough, Player: [player]")
continue
if(flag && !(flag in player.client.prefs.be_special_role))
Debug("FOC flag failed, Player: [player], Flag: [flag], ")
continue
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
Debug("FOC pass, Player: [player], Level:[level]")
candidates += player
return candidates
proc/GiveRandomJob(var/mob/new_player/player)
Debug("GRJ Giving random job, Player: [player]")
for(var/datum/job/job in shuffle(occupations))
if(!job)
continue
if(istype(job, GetJob("Assistant"))) // We don't want to give him assistant, that's boring!
continue
if(job in command_positions) //If you want a command position, select it!
continue
if(jobban_isbanned(player, job.title))
Debug("GRJ isbanned failed, Player: [player], Job: [job.title]")
continue
if(!job.player_old_enough(player.client))
Debug("GRJ player not old enough, Player: [player]")
continue
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
Debug("GRJ Random job given, Player: [player], Job: [job]")
AssignRole(player, job.title)
unassigned -= player
break
proc/ResetOccupations()
for(var/mob/new_player/player in player_list)
if((player) && (player.mind))
player.mind.assigned_role = null
player.mind.special_role = null
SetupOccupations()
unassigned = list()
return
///This proc is called before the level loop of DivideOccupations() and will try to select a head, ignoring ALL non-head preferences for every level until it locates a head or runs out of levels to check
proc/FillHeadPosition()
for(var/level = 1 to 3)
for(var/command_position in command_positions)
var/datum/job/job = GetJob(command_position)
if(!job) continue
var/list/candidates = FindOccupationCandidates(job, level)
if(!candidates.len) continue
// Build a weighted list, weight by age.
var/list/weightedCandidates = list()
for(var/mob/V in candidates)
// Log-out during round-start? What a bad boy, no head position for you!
if(!V.client) continue
var/age = V.client.prefs.age
switch(age)
if(job.minimum_character_age to (job.minimum_character_age+10))
weightedCandidates[V] = 3 // Still a bit young.
if((job.minimum_character_age+10) to (job.ideal_character_age-10))
weightedCandidates[V] = 6 // Better.
if((job.ideal_character_age-10) to (job.ideal_character_age+10))
weightedCandidates[V] = 10 // Great.
if((job.ideal_character_age+10) to (job.ideal_character_age+20))
weightedCandidates[V] = 6 // Still good.
if((job.ideal_character_age+20) to INFINITY)
weightedCandidates[V] = 3 // Geezer.
else
// If there's ABSOLUTELY NOBODY ELSE
if(candidates.len == 1) weightedCandidates[V] = 1
var/mob/new_player/candidate = pickweight(weightedCandidates)
if(AssignRole(candidate, command_position))
return 1
return 0
///This proc is called at the start of the level loop of DivideOccupations() and will cause head jobs to be checked before any other jobs of the same level
proc/CheckHeadPositions(var/level)
for(var/command_position in command_positions)
var/datum/job/job = GetJob(command_position)
if(!job) continue
var/list/candidates = FindOccupationCandidates(job, level)
if(!candidates.len) continue
var/mob/new_player/candidate = pick(candidates)
AssignRole(candidate, command_position)
return
/** Proc DivideOccupations
* fills var "assigned_role" for all ready players.
* This proc must not have any side effect besides of modifying "assigned_role".
**/
proc/DivideOccupations()
//Setup new player list and get the jobs list
Debug("Running DO")
SetupOccupations()
//Holder for Triumvirate is stored in the ticker, this just processes it
if(SSticker.triai)
for(var/datum/job/A in occupations)
if(A.title == "AI")
A.spawn_positions = 3
break
//Get the players who are ready
for(var/mob/new_player/player in player_list)
if(player.ready && player.mind && !player.mind.assigned_role)
unassigned += player
Debug("DO, Len: [unassigned.len]")
if(unassigned.len == 0) return 0
//Shuffle players and jobs
unassigned = shuffle(unassigned)
HandleFeedbackGathering()
//People who wants to be assistants, sure, go on.
Debug("DO, Running Assistant Check 1")
var/datum/job/assist = new DEFAULT_JOB_TYPE ()
var/list/assistant_candidates = FindOccupationCandidates(assist, 3)
Debug("AC1, Candidates: [assistant_candidates.len]")
for(var/mob/new_player/player in assistant_candidates)
Debug("AC1 pass, Player: [player]")
AssignRole(player, "Assistant")
assistant_candidates -= player
Debug("DO, AC1 end")
//Select one head
Debug("DO, Running Head Check")
FillHeadPosition()
Debug("DO, Head Check end")
//Other jobs are now checked
Debug("DO, Running Standard Check")
// New job giving system by Donkie
// This will cause lots of more loops, but since it's only done once it shouldn't really matter much at all.
// Hopefully this will add more randomness and fairness to job giving.
// Loop through all levels from high to low
var/list/shuffledoccupations = shuffle(occupations)
// var/list/disabled_jobs = ticker.mode.disabled_jobs // So we can use .Find down below without a colon.
for(var/level = 1 to 3)
//Check the head jobs first each level
CheckHeadPositions(level)
// Loop through all unassigned players
for(var/mob/new_player/player in unassigned)
// Loop through all jobs
for(var/datum/job/job in shuffledoccupations) // SHUFFLE ME BABY
if(!job || (job.title in SSticker.mode.disabled_jobs) ) //11/2/16
continue
if(jobban_isbanned(player, job.title))
Debug("DO isbanned failed, Player: [player], Job:[job.title]")
continue
if(!job.player_old_enough(player.client))
Debug("DO player not old enough, Player: [player], Job:[job.title]")
continue
// If the player wants that job on this level, then try give it to him.
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
// If the job isn't filled
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
Debug("DO pass, Player: [player], Level:[level], Job:[job.title]")
AssignRole(player, job.title)
unassigned -= player
break
// Hand out random jobs to the people who didn't get any in the last check
// Also makes sure that they got their preference correct
for(var/mob/new_player/player in unassigned)
if(player.client.prefs.alternate_option == GET_RANDOM_JOB)
GiveRandomJob(player)
/*
Old job system
for(var/level = 1 to 3)
for(var/datum/job/job in occupations)
Debug("Checking job: [job]")
if(!job)
continue
if(!unassigned.len)
break
if((job.current_positions >= job.spawn_positions) && job.spawn_positions != -1)
continue
var/list/candidates = FindOccupationCandidates(job, level)
while(candidates.len && ((job.current_positions < job.spawn_positions) || job.spawn_positions == -1))
var/mob/new_player/candidate = pick(candidates)
Debug("Selcted: [candidate], for: [job.title]")
AssignRole(candidate, job.title)
candidates -= candidate*/
Debug("DO, Standard Check end")
Debug("DO, Running AC2")
// For those who wanted to be assistant if their preferences were filled, here you go.
for(var/mob/new_player/player in unassigned)
if(player.client.prefs.alternate_option == BE_ASSISTANT)
Debug("AC2 Assistant located, Player: [player]")
AssignRole(player, "Assistant")
//For ones returning to lobby
for(var/mob/new_player/player in unassigned)
if(player.client.prefs.alternate_option == RETURN_TO_LOBBY)
player.ready = 0
player.new_player_panel_proc()
unassigned -= player
return 1
proc/EquipRank(var/mob/living/carbon/human/H, var/rank, var/joined_late = 0,var/megavend = 0)
if(!H)
return null
var/datum/job/job = GetJob(rank)
var/list/spawn_in_storage = list()
if(job)
var/list/custom_equip_slots = list() //If more than one item takes the same slot, all after the first one spawn in storage.
var/list/custom_equip_leftovers = list()
//Equip job items.
job.equip(H)
job.apply_fingerprints(H)
if(!megavend)//Equip custom gear loadout.
job.equip_backpack(H)
job.equip_survival(H)
job.setup_account(H)
if(H.client.prefs.gear && H.client.prefs.gear.len && job.title != "Cyborg" && job.title != "AI")
for(var/thing in H.client.prefs.gear)
var/datum/gear/G = gear_datums[thing]
if(G)
var/permitted
if(G.allowed_roles)
for(var/job_name in G.allowed_roles)
if(job.title == job_name)
permitted = 1
else
permitted = 1
if(G.whitelisted && !is_alien_whitelisted(H, all_species[G.whitelisted]))
permitted = 0
if(!permitted)
H << "<span class='warning'>Your current job or whitelist status does not permit you to spawn with [thing]!</span>"
continue
if(G.slot && !(G.slot in custom_equip_slots))
// This is a miserable way to fix the loadout overwrite bug, but the alternative requires
// adding an arg to a bunch of different procs. Will look into it after this merge. ~ Z
var/metadata = H.client.prefs.gear[G.display_name]
if(G.slot == slot_wear_mask || G.slot == slot_wear_suit || G.slot == slot_head)
custom_equip_leftovers += thing
else if(H.equip_to_slot_or_del(G.spawn_item(H, metadata), G.slot))
H << "<span class='notice'>Equipping you with \the [thing]!</span>"
custom_equip_slots.Add(G.slot)
else
custom_equip_leftovers.Add(thing)
else
spawn_in_storage += thing
// Randomize nutrition. (Between 50-100% of max.)
H.nutrition = (rand(50, 100) * 0.01) * H.max_nutrition
//If some custom items could not be equipped before, try again now.
for(var/thing in custom_equip_leftovers)
var/datum/gear/G = gear_datums[thing]
if(G.slot in custom_equip_slots)
spawn_in_storage += thing
else
var/metadata = H.client.prefs.gear[G.display_name]
if(H.equip_to_slot_or_del(G.spawn_item(H, metadata), G.slot))
H << "<span class='notice'>Equipping you with \the [thing]!</span>"
custom_equip_slots.Add(G.slot)
else
spawn_in_storage += thing
else
H << "Your job is [rank] and the game just can't handle it! Please report this bug to an administrator."
H.job = rank
if(!joined_late)
var/obj/S = null
for(var/obj/effect/landmark/start/sloc in landmarks_list)
if(sloc.name != rank) continue
if(locate(/mob/living) in sloc.loc) continue
S = sloc
break
if(!S)
S = locate("start*[rank]") // use old stype
if(istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf))
H.loc = S.loc
else
LateSpawn(H, rank)
// Moving wheelchair if they have one
if(H.buckled && istype(H.buckled, /obj/structure/bed/chair/wheelchair))
H.buckled.loc = H.loc
H.buckled.set_dir(H.dir)
// If they're head, give them the account info for their department
if(H.mind && job.head_position)
var/remembered_info = ""
var/datum/money_account/department_account = department_accounts[job.department]
if(department_account)
remembered_info += "<b>Your department's account number is:</b> #[department_account.account_number]<br>"
remembered_info += "<b>Your department's account pin is:</b> [department_account.remote_access_pin]<br>"
remembered_info += "<b>Your department's account funds are:</b> $[department_account.money]<br>"
H.mind.store_memory(remembered_info)
var/alt_title = null
if(H.mind)
H.mind.assigned_role = rank
alt_title = H.mind.role_alt_title
switch(rank)
if("Cyborg")
return H.Robotize()
if("AI")
return H
if("Captain")
var/sound/announce_sound = (SSticker.current_state <= GAME_STATE_SETTING_UP)? null : sound('sound/misc/boatswain.ogg', volume=20)
captain_announcement.Announce("All hands, Captain [H.real_name] on deck!", new_sound=announce_sound)
//Deferred item spawning.
if(spawn_in_storage && spawn_in_storage.len)
var/obj/item/weapon/storage/B
for(var/obj/item/weapon/storage/S in H.contents)
B = S
break
if(!isnull(B))
for(var/thing in spawn_in_storage)
H << "<span class='notice'>Placing \the [thing] in your [B.name]!</span>"
var/datum/gear/G = gear_datums[thing]
var/metadata = H.client.prefs.gear[G.display_name]
G.spawn_item(B, metadata)
else
H << "<span class='danger'>Failed to locate a storage object on your mob, either you spawned with no arms and no backpack or this is a bug.</span>"
if(istype(H) && !megavend) //give humans wheelchairs, if they need them.
var/obj/item/organ/external/l_foot = H.get_organ("l_foot")
var/obj/item/organ/external/r_foot = H.get_organ("r_foot")
if(!l_foot || !r_foot)
var/obj/structure/bed/chair/wheelchair/W = new /obj/structure/bed/chair/wheelchair(H.loc)
H.buckled = W
H.update_canmove()
W.set_dir(H.dir)
W.buckled_mob = H
W.add_fingerprint(H)
H << "<B>You are [job.total_positions == 1 ? "the" : "a"] [alt_title ? alt_title : rank].</B>"
if(job.supervisors)
H << "<b>As the [alt_title ? alt_title : rank] you answer directly to [job.supervisors]. Special circumstances may change this.</b>"
if(job.idtype)
spawnId(H, rank, alt_title)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset(H), slot_l_ear)
H << "<b>To speak on your department's radio channel use :h. For the use of other channels, examine your headset.</b>"
if(job.req_admin_notify)
H << "<b>You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via adminhelp.</b>"
//Gives glasses to the vision impaired
if(H.disabilities & NEARSIGHTED && !megavend)
var/equipped = H.equip_to_slot_or_del(new /obj/item/clothing/glasses/regular(H), slot_glasses)
if(equipped != 1)
var/obj/item/clothing/glasses/G = H.glasses
G.prescription = 1
BITSET(H.hud_updateflag, ID_HUD)
BITSET(H.hud_updateflag, IMPLOYAL_HUD)
BITSET(H.hud_updateflag, SPECIALROLE_HUD)
return H
proc/EquipPersonal(var/mob/living/carbon/human/H, var/rank, var/joined_late = 0,var/spawning_at)
if(!H)
return null
switch(rank)
if("Cyborg")
return EquipRank(H, rank, 1)
if("AI")
return EquipRank(H, rank, 1)
if(spawning_at != "Arrivals Shuttle")
return EquipRank(H, rank, 1)
var/datum/job/job = GetJob(rank)
var/list/spawn_in_storage = list()
addtimer(CALLBACK(GLOBAL_PROC, .proc/handle_player_despawn, H), 15 MINUTES)
if(job)
//Equip custom gear loadout.
var/list/custom_equip_slots = list() //If more than one item takes the same slot, all after the first one spawn in storage.
var/list/custom_equip_leftovers = list()
if(H.client.prefs.gear && H.client.prefs.gear.len && job.title != "Cyborg" && job.title != "AI")
for(var/thing in H.client.prefs.gear)
var/datum/gear/G = gear_datums[thing]
if(G)
var/permitted
if(G.allowed_roles)
for(var/job_name in G.allowed_roles)
if(job.title == job_name)
permitted = 1
else
permitted = 1
if(G.whitelisted && !is_alien_whitelisted(H, all_species[G.whitelisted]))
permitted = 0
if(!permitted)
H << "<span class='warning'>Your current job or whitelist status does not permit you to spawn with [thing]!</span>"
continue
if(G.slot && !(G.slot in custom_equip_slots))
// This is a miserable way to fix the loadout overwrite bug, but the alternative requires
// adding an arg to a bunch of different procs. Will look into it after this merge. ~ Z
var/metadata = H.client.prefs.gear[G.display_name]
var/obj/item/CI = G.spawn_item(H,metadata)
if(G.slot == slot_wear_mask || G.slot == slot_wear_suit || G.slot == slot_head)
custom_equip_leftovers += thing
else if(H.equip_to_slot_or_del(CI, G.slot))
CI.autodrobe_no_remove = 1
H << "<span class='notice'>Equipping you with \the [thing]!</span>"
custom_equip_slots.Add(G.slot)
else
custom_equip_leftovers.Add(thing)
else
spawn_in_storage += thing
//Equip job items.
job.late_equip(H)
job.equip_backpack(H)
job.equip_survival(H)
job.setup_account(H)
job.apply_fingerprints(H)
//If some custom items could not be equipped before, try again now.
for(var/thing in custom_equip_leftovers)
var/datum/gear/G = gear_datums[thing]
if(G.slot in custom_equip_slots)
spawn_in_storage += thing
else
var/metadata = H.client.prefs.gear[G.display_name]
var/obj/item/CI = G.spawn_item(H,metadata)
if(H.equip_to_slot_or_del(CI, G.slot))
H << "<span class='notice'>Equipping you with \the [thing]!</span>"
custom_equip_slots.Add(G.slot)
CI.autodrobe_no_remove = 1
else
spawn_in_storage += thing
else
H << "Your job is [rank] and the game just can't handle it! Please report this bug to an administrator."
H.job = rank
if(spawn_in_storage && spawn_in_storage.len)
var/obj/item/weapon/storage/B
for(var/obj/item/weapon/storage/S in H.contents)
B = S
break
if(!isnull(B))
for(var/thing in spawn_in_storage)
H << "<span class='notice'>Placing \the [thing] in your [B.name]!</span>"
var/datum/gear/G = gear_datums[thing]
var/metadata = H.client.prefs.gear[G.display_name]
G.spawn_item(B, metadata)
else
H << "<span class='danger'>Failed to locate a storage object on your mob, either you spawned with no arms and no backpack or this is a bug.</span>"
if(istype(H)) //give humans wheelchairs, if they need them.
var/obj/item/organ/external/l_foot = H.get_organ("l_foot")
var/obj/item/organ/external/r_foot = H.get_organ("r_foot")
if(!l_foot || !r_foot)
var/obj/structure/bed/chair/wheelchair/W = new /obj/structure/bed/chair/wheelchair(H.loc)
H.buckled = W
H.update_canmove()
W.set_dir(H.dir)
W.buckled_mob = H
W.add_fingerprint(H)
//Gives glasses to the vision impaired
if(H.disabilities & NEARSIGHTED)
var/equipped = H.equip_to_slot_or_del(new /obj/item/clothing/glasses/regular(H), slot_glasses)
if(equipped != 1)
var/obj/item/clothing/glasses/G = H.glasses
G.prescription = 1
G.autodrobe_no_remove = 1
// So shoes aren't silent if people never change 'em.
H.update_noise_level()
BITSET(H.hud_updateflag, ID_HUD)
BITSET(H.hud_updateflag, IMPLOYAL_HUD)
BITSET(H.hud_updateflag, SPECIALROLE_HUD)
H << "<b>Welcome to the Odin! Simply proceed down and to the right to board the shuttle to your workplace!</b>."
return H
proc/spawnId(var/mob/living/carbon/human/H, rank, title)
if(!H) return 0
var/obj/item/weapon/card/id/C = null
var/datum/job/job = null
for(var/datum/job/J in occupations)
if(J.title == rank)
job = J
break
if(job)
if(job.title == "Cyborg")
return
else
C = new job.idtype(H)
C.access = job.get_access()
else
C = new /obj/item/weapon/card/id(H)
if(C)
C.rank = rank
C.assignment = title ? title : rank
H.set_id_info(C)
//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.ownrank = C.rank
pda.name = "PDA-[H.real_name] ([pda.ownjob])"
return 1
proc/LoadJobs(jobsfile) //ran during round setup, reads info from jobs.txt -- Urist
if(!config.load_jobs_from_txt)
return 0
var/list/jobEntries = file2list(jobsfile)
for(var/job in jobEntries)
if(!job)
continue
job = trim(job)
if (!length(job))
continue
var/pos = findtext(job, "=")
var/name = null
var/value = null
if(pos)
name = copytext(job, 1, pos)
value = copytext(job, pos + 1)
else
continue
if(name && value)
var/datum/job/J = GetJob(name)
if(!J) continue
J.total_positions = text2num(value)
J.spawn_positions = text2num(value)
if(name == "AI" || name == "Cyborg")//I dont like this here but it will do for now
J.total_positions = 0
return 1
proc/HandleFeedbackGathering()
for(var/datum/job/job in occupations)
var/tmp_str = "|[job.title]|"
var/level1 = 0 //high
var/level2 = 0 //medium
var/level3 = 0 //low
var/level4 = 0 //never
var/level5 = 0 //banned
var/level6 = 0 //account too young
for(var/mob/new_player/player in player_list)
if(!(player.ready && player.mind && !player.mind.assigned_role))
continue //This player is not ready
if(jobban_isbanned(player, job.title))
level5++
continue
if(!job.player_old_enough(player.client))
level6++
continue
if(player.client.prefs.GetJobDepartment(job, 1) & job.flag)
level1++
else if(player.client.prefs.GetJobDepartment(job, 2) & job.flag)
level2++
else if(player.client.prefs.GetJobDepartment(job, 3) & job.flag)
level3++
else level4++ //not selected
tmp_str += "HIGH=[level1]|MEDIUM=[level2]|LOW=[level3]|NEVER=[level4]|BANNED=[level5]|YOUNG=[level6]|-"
feedback_add_details("job_preferences",tmp_str)
/datum/controller/occupations/proc/LateSpawn(var/mob/living/carbon/human/H, var/rank)
//spawn at one of the latespawn locations
var/datum/spawnpoint/spawnpos
if(H.client.prefs.spawnpoint)
spawnpos = spawntypes[H.client.prefs.spawnpoint]
if(spawnpos && istype(spawnpos))
if(spawnpos.check_job_spawning(rank))
H.loc = pick(spawnpos.turfs)
. = spawnpos.msg
else
H << "Your chosen spawnpoint ([spawnpos.display_name]) is unavailable for your chosen job. Spawning you at the Arrivals shuttle instead."
H.loc = pick(latejoin)
. = "is inbound from the NTCC Odin"
else
H.loc = pick(latejoin)
. = "is inbound from the NTCC Odin"
/proc/handle_player_despawn(var/mob/living/carbon/human/H)
if(istype(get_area(H), /area/centcom/spawning))
if(!H.client)
despawn_mob(H)
else
var/datum/spawnpoint/spawnpos = spawntypes["Cryogenic Storage"]
if(spawnpos && istype(spawnpos))
H << "<span class='warning'>You come to the sudden realization that you never left the Aurora at all! You were in cryo the whole time!</span>"
H.loc = pick(spawnpos.turfs)
global_announcer.autosay("[H.real_name], [H.mind.role_alt_title], [spawnpos.msg].", "Cryogenic Oversight")
else
despawn_mob(H) //somehow they can't spawn at cryo, so this is the only recourse of action.
/proc/despawn_mob(var/mob/living/carbon/human/H)
//Update any existing objectives involving this mob.
for(var/datum/objective/O in all_objectives)
// We don't want revs to get objectives that aren't for heads of staff. Letting
// them win or lose based on cryo is silly so we remove the objective.
if(O.target == H.mind)
if(O.owner && O.owner.current)
O.owner.current << "<span class='warning'>You get the feeling your target is no longer within your reach...</span>"
qdel(O)
//Handle job slot/tater cleanup.
if (H.mind)
var/job = H.mind.assigned_role
job_master.FreeRole(job)
if(H.mind.objectives.len)
qdel(H.mind.objectives)
H.mind.special_role = null
// Delete them from datacore.
if(PDA_Manifest.len)
PDA_Manifest.Cut()
for(var/datum/data/record/R in data_core.medical)
if ((R.fields["name"] == H.real_name))
qdel(R)
for(var/datum/data/record/T in data_core.security)
if ((T.fields["name"] == H.real_name))
qdel(T)
for(var/datum/data/record/G in data_core.general)
if ((G.fields["name"] == H.real_name))
qdel(G)
log_and_message_admins("[key_name(H)] ([H.mind.role_alt_title]) entered cryostorage.")
global_announcer.autosay("[H.real_name], [H.mind.role_alt_title], has entered long-term storage.", "NTCC Odin Cryogenic Oversight")
H.visible_message("<span class='notice'>[H.name] makes their way to the Odin's cryostorage, and departs.</span>", 3)
//This should guarantee that ghosts don't spawn.
H.ckey = null
// Delete the mob.
qdel(H)
+2 -50
View File
@@ -322,64 +322,16 @@
else
W.forceMove(src.loc)
//Update any existing objectives involving this mob.
for(var/datum/objective/O in all_objectives)
// We don't want revs to get objectives that aren't for heads of staff. Letting
// them win or lose based on cryo is silly so we remove the objective.
if(O.target == occupant.mind)
if(O.owner && O.owner.current)
O.owner.current << "<span class='warning'>You get the feeling your target is no longer within your reach...</span>"
qdel(O)
//Handle job slot/tater cleanup.
if (occupant.mind)
var/job = occupant.mind.assigned_role
job_master.FreeRole(job)
if(occupant.mind.objectives.len)
qdel(occupant.mind.objectives)
occupant.mind.special_role = null
//else
//if(ticker.mode.name == "AutoTraitor")
//var/datum/game_mode/traitor/autotraitor/current_mode = ticker.mode
//current_mode.possible_traitors.Remove(occupant)
// Delete them from datacore.
if(PDA_Manifest.len)
PDA_Manifest.Cut()
for(var/datum/data/record/R in data_core.medical)
if ((R.fields["name"] == occupant.real_name))
qdel(R)
for(var/datum/data/record/T in data_core.security)
if ((T.fields["name"] == occupant.real_name))
qdel(T)
for(var/datum/data/record/G in data_core.general)
if ((G.fields["name"] == occupant.real_name))
qdel(G)
icon_state = base_icon_state
//TODO: Check objectives/mode, update new targets if this mob is the target, spawn new antags?
//Make an announcement and log the person entering storage.
control_computer.frozen_crew += "[occupant.real_name], [occupant.mind.role_alt_title] - [worldtime2text()]"
control_computer._admin_logs += "[key_name(occupant)] ([occupant.mind.role_alt_title]) at [worldtime2text()]"
log_and_message_admins("[key_name(occupant)] ([occupant.mind.role_alt_title]) entered cryostorage.")
announce.autosay("[occupant.real_name], [occupant.mind.role_alt_title], [on_store_message]", "[on_store_name]")
visible_message("<span class='notice'>\The [initial(name)] hums and hisses as it moves [occupant.real_name] into storage.</span>", 3)
//This should guarantee that ghosts don't spawn.
occupant.ckey = null
// Let SSjobs handle the rest.
SSjobs.DespawnMob(occupant)
// Delete the mob.
qdel(occupant)
set_occupant(null)
/obj/machinery/cryopod/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
if(istype(G, /obj/item/weapon/grab))
+1 -1
View File
@@ -50,7 +50,7 @@
H << "<span class='notice'>You feel a pleasant breeze as the autolocker whisks away all of your clothes, packing them neatly in a box.</span>"
job_master.EquipRank(H, H.job, 1, 1)
SSjobs.EquipRank(H, H.job, 1, 1)
H.megavend = 1
return
+2 -2
View File
@@ -919,7 +919,7 @@ var/list/admin_verbs_cciaa = list(
set category = "Admin"
if(holder)
var/list/jobs = list()
for (var/datum/job/J in job_master.occupations)
for (var/datum/job/J in SSjobs.occupations)
if (J.current_positions >= J.total_positions && J.total_positions != -1)
jobs += J.title
if (!jobs.len)
@@ -927,7 +927,7 @@ var/list/admin_verbs_cciaa = list(
return
var/job = input("Please select job slot to free", "Free job slot") as null|anything in jobs
if (job)
job_master.FreeRole(job)
SSjobs.FreeRole(job)
message_admins("A job slot for [job] has been opened by [key_name_admin(usr)]")
return
+14 -21
View File
@@ -407,9 +407,6 @@
if(!M.ckey) //sanity
usr << "This mob has no ckey"
return
if(!job_master)
usr << "Job Master has not been setup!"
return
var/dat = ""
var/header = "<head><title>Job-Ban Panel: [M.name]</title></head>"
@@ -428,7 +425,7 @@
jobs += "<tr align='center' bgcolor='ccccff'><th colspan='[length(command_positions)]'><a href='?src=\ref[src];jobban3=commanddept;jobban4=\ref[M]'>Command Positions</a></th></tr><tr align='center'>"
for(var/jobPos in command_positions)
if(!jobPos) continue
var/datum/job/job = job_master.GetJob(jobPos)
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
if(jobban_isbanned(M, job.title))
@@ -449,7 +446,7 @@
jobs += "<tr bgcolor='ffddf0'><th colspan='[length(security_positions)]'><a href='?src=\ref[src];jobban3=securitydept;jobban4=\ref[M]'>Security Positions</a></th></tr><tr align='center'>"
for(var/jobPos in security_positions)
if(!jobPos) continue
var/datum/job/job = job_master.GetJob(jobPos)
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
if(jobban_isbanned(M, job.title))
@@ -470,7 +467,7 @@
jobs += "<tr bgcolor='fff5cc'><th colspan='[length(engineering_positions)]'><a href='?src=\ref[src];jobban3=engineeringdept;jobban4=\ref[M]'>Engineering Positions</a></th></tr><tr align='center'>"
for(var/jobPos in engineering_positions)
if(!jobPos) continue
var/datum/job/job = job_master.GetJob(jobPos)
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
if(jobban_isbanned(M, job.title))
@@ -491,7 +488,7 @@
jobs += "<tr bgcolor='ffeef0'><th colspan='[length(medical_positions)]'><a href='?src=\ref[src];jobban3=medicaldept;jobban4=\ref[M]'>Medical Positions</a></th></tr><tr align='center'>"
for(var/jobPos in medical_positions)
if(!jobPos) continue
var/datum/job/job = job_master.GetJob(jobPos)
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
if(jobban_isbanned(M, job.title))
@@ -512,7 +509,7 @@
jobs += "<tr bgcolor='e79fff'><th colspan='[length(science_positions)]'><a href='?src=\ref[src];jobban3=sciencedept;jobban4=\ref[M]'>Science Positions</a></th></tr><tr align='center'>"
for(var/jobPos in science_positions)
if(!jobPos) continue
var/datum/job/job = job_master.GetJob(jobPos)
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
if(jobban_isbanned(M, job.title))
@@ -533,7 +530,7 @@
jobs += "<tr bgcolor='dddddd'><th colspan='[length(civilian_positions)]'><a href='?src=\ref[src];jobban3=civiliandept;jobban4=\ref[M]'>Civilian Positions</a></th></tr><tr align='center'>"
for(var/jobPos in civilian_positions)
if(!jobPos) continue
var/datum/job/job = job_master.GetJob(jobPos)
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
if(jobban_isbanned(M, job.title))
@@ -560,7 +557,7 @@
jobs += "<tr bgcolor='ccffcc'><th colspan='[length(nonhuman_positions)+1]'><a href='?src=\ref[src];jobban3=nonhumandept;jobban4=\ref[M]'>Non-human Positions</a></th></tr><tr align='center'>"
for(var/jobPos in nonhuman_positions)
if(!jobPos) continue
var/datum/job/job = job_master.GetJob(jobPos)
var/datum/job/job = SSjobs.GetJob(jobPos)
if(!job) continue
if(jobban_isbanned(M, job.title))
@@ -637,54 +634,50 @@
alert("You cannot perform this action. You must be of a higher administrative rank!")
return
if(!job_master)
usr << "Job Master has not been setup!"
return
//get jobs for department if specified, otherwise just returnt he one job in a list.
var/list/joblist = list()
switch(href_list["jobban3"])
if("commanddept")
for(var/jobPos in command_positions)
if(!jobPos) continue
var/datum/job/temp = job_master.GetJob(jobPos)
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
if("securitydept")
for(var/jobPos in security_positions)
if(!jobPos) continue
var/datum/job/temp = job_master.GetJob(jobPos)
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
if("engineeringdept")
for(var/jobPos in engineering_positions)
if(!jobPos) continue
var/datum/job/temp = job_master.GetJob(jobPos)
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
if("medicaldept")
for(var/jobPos in medical_positions)
if(!jobPos) continue
var/datum/job/temp = job_master.GetJob(jobPos)
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
if("sciencedept")
for(var/jobPos in science_positions)
if(!jobPos) continue
var/datum/job/temp = job_master.GetJob(jobPos)
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
if("civiliandept")
for(var/jobPos in civilian_positions)
if(!jobPos) continue
var/datum/job/temp = job_master.GetJob(jobPos)
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
if("nonhumandept")
joblist += "pAI"
for(var/jobPos in nonhuman_positions)
if(!jobPos) continue
var/datum/job/temp = job_master.GetJob(jobPos)
var/datum/job/temp = SSjobs.GetJob(jobPos)
if(!temp) continue
joblist += temp.title
else
+2 -2
View File
@@ -430,13 +430,13 @@
if (isnull(selected_job))
return
var/datum/job/job = job_master.GetJob(selected_job)
var/datum/job/job = SSjobs.GetJob(selected_job)
if(!job)
return
job.equip(M)
job.apply_fingerprints(M)
job_master.spawnId(M, selected_job)
SSjobs.spawnId(M, selected_job)
if ("standard space gear")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
+4 -4
View File
@@ -451,7 +451,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
antag_data.add_antagonist(new_character.mind)
antag_data.place_mob(new_character)
else
job_master.EquipRank(new_character, new_character.mind.assigned_role, 1)
SSjobs.EquipRank(new_character, new_character.mind.assigned_role, 1)
//Announces the character on all the systems, based on the record.
if(!issilicon(new_character))//If they are not a cyborg/AI.
@@ -623,9 +623,9 @@ Traitors and the like can also be revived with the previous role mostly intact.
if (!holder)
src << "Only administrators may use this command."
return
if(job_master)
for(var/datum/job/job in job_master.occupations)
src << "[job.title]: [job.total_positions]"
for(var/datum/job/job in SSjobs.occupations)
src << "[job.title]: [job.total_positions]"
feedback_add_details("admin_verb","LFS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_explosion(atom/O as obj|mob|turf in range(world.view))
+12 -14
View File
@@ -6,17 +6,15 @@
usr << "This option is currently only usable during pregame. This may change at a later date."
return
if(job_master)
var/datum/job/job = job_master.GetJob("AI")
if(!job)
usr << "Unable to locate the AI job"
return
if(SSticker.triai)
SSticker.triai = 0
usr << "Only one AI will be spawned at round start."
message_admins("<span class='notice'>[key_name_admin(usr)] has toggled off triple AIs at round start.</span>", 1)
else
SSticker.triai = 1
usr << "There will be an AI Triumvirate at round start."
message_admins("<span class='notice'>[key_name_admin(usr)] has toggled on triple AIs at round start.</span>", 1)
return
var/datum/job/job = SSjobs.GetJob("AI")
if(!job)
usr << "Unable to locate the AI job"
return
if(SSticker.triai)
SSticker.triai = 0
usr << "Only one AI will be spawned at round start."
message_admins("<span class='notice'>[key_name_admin(usr)] has toggled off triple AIs at round start.</span>", 1)
else
SSticker.triai = 1
usr << "There will be an AI Triumvirate at round start."
message_admins("<span class='notice'>[key_name_admin(usr)] has toggled on triple AIs at round start.</span>", 1)
+6 -5
View File
@@ -187,11 +187,12 @@
qdel(M)
/proc/clear_cciaa_job(var/mob/living/carbon/human/M)
spawn(9000)
if(!M.client)
var/oldjob = M.mind.assigned_role
job_master.FreeRole(oldjob)
return
addtimer(CALLBACK(GLOBAL_PROC, /proc/actual_clear_ccia_job, M), 9000)
/proc/actual_clear_ccia_job(mob/living/carbon/human/H)
if (!H.client)
var/oldjob = H.mind.assigned_role
SSjobs.FreeRole(oldjob)
/datum/admins/proc/create_admin_fax(var/department in alldepartments)
set name = "Send admin fax"
@@ -96,17 +96,12 @@
if (!pref.player_alt_titles)
pref.player_alt_titles = new()
if(!job_master)
return
for(var/datum/job/job in job_master.occupations)
for(var/datum/job/job in SSjobs.occupations)
var/alt_title = pref.player_alt_titles[job.title]
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 = 16, list/splitJobs = list("Chief Medical Officer"))
if(!job_master)
return
. += "<tt><center>"
. += "<b>Choose occupation chances</b><br>Unavailable occupations are crossed out.<br>"
@@ -116,8 +111,7 @@
//The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows.
var/datum/job/lastJob
if (!job_master) return
for(var/datum/job/job in job_master.occupations)
for(var/datum/job/job in SSjobs.occupations)
index += 1
if((index >= limit) || (job.title in splitJobs))
@@ -222,7 +216,7 @@
pref.player_alt_titles[job.title] = new_title
/datum/category_item/player_setup_item/occupation/proc/SetJob(mob/user, role)
var/datum/job/job = job_master.GetJob(role)
var/datum/job/job = SSjobs.GetJob(role)
if(!job)
return 0
@@ -19,7 +19,7 @@ var/global/list/empty_playable_ai_cores = list()
//Handle job slot/tater cleanup.
var/job = mind.assigned_role
job_master.FreeRole(job)
SSjobs.FreeRole(job)
if(mind.objectives.len)
qdel(mind.objectives)
+5 -5
View File
@@ -302,7 +302,7 @@
vote_on_poll(pollid, optionid, 1)
proc/IsJobAvailable(rank)
var/datum/job/job = job_master.GetJob(rank)
var/datum/job/job = SSjobs.GetJob(rank)
if(!job) return 0
if(!job.is_position_available()) return 0
if(jobban_isbanned(src,rank)) return 0
@@ -329,11 +329,11 @@
spawning = 1
close_spawn_windows()
job_master.AssignRole(src, rank, 1)
SSjobs.AssignRole(src, rank, 1)
var/mob/living/character = create_character() //creates the human and transfers vars and mind
character = job_master.EquipPersonal(character, rank, 1,spawning_at) //equips the human
character = SSjobs.EquipPersonal(character, rank, 1,spawning_at) //equips the human
UpdateFactionList(character)
@@ -358,7 +358,7 @@
return
//Find our spawning point.
var/join_message = job_master.LateSpawn(character, rank)
var/join_message = SSjobs.LateSpawn(character, rank)
character.lastarea = get_area(loc)
// Moving wheelchair if they have one
@@ -404,7 +404,7 @@
dat += "<font color='red'>The station is currently undergoing crew transfer procedures.</font><br>"
dat += "Choose from the following open/valid positions:<br>"
for(var/datum/job/job in job_master.occupations)
for(var/datum/job/job in SSjobs.occupations)
if(job && IsJobAvailable(job.title))
var/active = 0
// Only players with the job assigned and AFK for less than 10 minutes count as active