Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/__HELPERS/~monkestation-helpers/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/proc/get_unlocked_closed_locker()
var/list/eligible_lockers = list()
for(var/obj/structure/closet/closet as anything in GLOB.closets)
if(QDELETED(closet) || closet.opened || istype(closet, /obj/structure/closet/secure_closet))
if(QDELETED(closet) || closet.opened || istype(closet, /obj/structure/closet/secure_closet) || istype(closet, /obj/structure/closet/crate/secure))
continue
var/turf/closet_turf = get_turf(closet)
if(!closet_turf || !is_station_level(closet_turf.z) || !is_safe_turf(closet_turf, dense_atoms = TRUE))
Expand Down
11 changes: 11 additions & 0 deletions code/datums/records/manifest.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ GLOBAL_DATUM_INIT(manifest, /datum/manifest, new)
/// Injects a record into the manifest.
/datum/manifest/proc/inject(mob/living/carbon/human/person, client/person_client, atom/appearance_proxy)
set waitfor = FALSE
// OCULIS PORT START - unassigned job so we need the check to not early return
var/is_hidden_stowaway = is_stowaway(person, person_client)

if(!is_hidden_stowaway && !(person.mind?.assigned_role.job_flags & JOB_CREW_MANIFEST))
return
// OCULIS PORT END
if(!(person.mind?.assigned_role.job_flags & JOB_CREW_MANIFEST))
return
//if you're cargo, and not a boss, you're part of the Union.
Expand Down Expand Up @@ -137,6 +143,11 @@ GLOBAL_DATUM_INIT(manifest, /datum/manifest, new)
mind_ref = person.mind,
)

// OCULIS PORT START - they're in /datum/record/locked now, we can return
if(is_hidden_stowaway)
return
// OCULIS PORT END

var/datum/record/crew/crewfile = new (
age = person.age,
blood_type = "[person.get_blood_type() || "None"]",
Expand Down
8 changes: 8 additions & 0 deletions code/modules/jobs/job_types/stowaway.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Copy of Unassigned Crewmember, so Stowaways appear properly in ghost orbit and playtime.
**/

/datum/job/stowaway
title = "Stowaway"
rpg_title = "Wanderer"
paycheck = PAYCHECK_ZERO
4 changes: 2 additions & 2 deletions code/modules/mob/dead/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@
humanc = character //Let's retypecast the var to be human,

if(humanc) //These procs all expect humans
process_stowaway_latejoin(humanc, job, humanc.client) // OCULIS PORT - stowaway latejoin flow
var/chosen_rank = humanc.client?.prefs.alt_job_titles[rank] || rank
if(SSshuttle.arrivals)
SSshuttle.arrivals.QueueAnnounce(humanc, chosen_rank)
else
if(!HAS_TRAIT(character, TRAIT_STOWAWAY))
announce_arrival(humanc, chosen_rank)
announce_arrival(humanc, chosen_rank)
AddEmploymentContract(humanc)

humanc.increment_scar_slot()
Expand Down
21 changes: 13 additions & 8 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,19 @@
id_examine += "<div class='img_by_text_container'>"
id_examine += "[id_icon]"
id_examine += "<div class='img_text'>"
id_examine += jointext(list(
"&bull; Name: [id_name || "Unknown"]",
"&bull; Job: [id_job || "Unassigned"]",
"&bull; Age: [id_age || "Unknown"]",
"&bull; Gender: [id_gender || "Unknown"]",
"&bull; Blood Type: [id_blood_type || "?"]",
"&bull; Species: [id_species || "Unknown"]",
), "<br>")
if(id_job == "Stowaway")
id_examine += jointext(list(
"&bull; Name: [id_name || "Unknown"]",
), "<br>")
else
id_examine += jointext(list(
"&bull; Name: [id_name || "Unknown"]",
"&bull; Job: [id_job || "Unassigned"]",
"&bull; Age: [id_age || "Unknown"]",
"&bull; Gender: [id_gender || "Unknown"]",
"&bull; Blood Type: [id_blood_type || "?"]",
"&bull; Species: [id_species || "Unknown"]",
), "<br>")
id_examine += "</div>" // container
id_examine += "</div>" // text

Expand Down
41 changes: 37 additions & 4 deletions monkestation/code/datums/quirks/negative_quirks/stowaway.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@

/datum/quirk/stowaway/add_unique()
var/mob/living/carbon/human/stowaway = quirk_holder
var/obj/item/card/id/trashed = stowaway.get_item_by_slot(ITEM_SLOT_ID) //No ID
qdel(trashed)
var/obj/item/card/id/realid = stowaway.get_item_by_slot(ITEM_SLOT_ID) //No ID
qdel(realid)

for(var/obj/item/modular_computer/pda/pda in stowaway.contents)
qdel(pda)

var/obj/item/card/id/fake_card/card = new(quirk_holder.drop_location()) //a fake ID with two uses for maint doors
quirk_holder.equip_to_slot_if_possible(card, ITEM_SLOT_ID)
Expand All @@ -23,7 +26,7 @@

/datum/quirk/stowaway/post_add()
to_chat(quirk_holder, span_boldnotice("You've awoken to find yourself inside [GLOB.station_name] without real identification!"))
addtimer(CALLBACK(quirk_holder.mind, TYPE_PROC_REF(/datum/mind, remove_from_manifest)), 5 SECONDS)
force_stowaway_unassigned_role(quirk_holder, quirk_holder.client)

/obj/item/card/id/fake_card //not a proper ID but still shares a lot of functions
name = "\"ID Card\""
Expand All @@ -45,7 +48,7 @@
/obj/item/card/id/fake_card/proc/register_name(mob/living/carbon/human/quirk_holder)
registered_name = quirk_holder.real_name
name = "[quirk_holder.real_name]'s \"ID Card\""
assignment = quirk_holder.mind.assigned_role.title
assignment = "Stowaway"

/obj/item/card/id/fake_card/proc/used()
uses--
Expand Down Expand Up @@ -73,3 +76,33 @@
. += "It's falling apart!"
else
. += "It looks frail!"
//OCULIS PORT START: Removes job assignment and handles latejoin stowaways
/proc/is_stowaway(mob/living/carbon/human/person, client/person_client)
if(!person)
return FALSE

var/client/target_client = person_client || person.client
var/list/all_quirks = target_client?.prefs.all_quirks

return person.has_quirk(/datum/quirk/stowaway) || (all_quirks && ("Stowaway" in all_quirks))

/proc/force_stowaway_unassigned_role(mob/living/carbon/human/person, client/person_client)
if(!person?.mind || is_unassigned_job(person.mind.assigned_role))
return

var/datum/job/previous_role = person.mind.assigned_role
if(previous_role?.title)
SSjob.FreeRole(previous_role.title)

person.mind.set_assigned_role(SSjob.GetJobType(/datum/job/stowaway))
person.job = "Stowaway"

/proc/process_stowaway_latejoin(mob/living/carbon/human/person, datum/job/current_job, client/person_client)
if(!person?.mind || !is_stowaway(person, person_client))
return

if((current_job?.job_flags & JOB_ASSIGN_QUIRKS) && CONFIG_GET(flag/roundstart_traits))
SSquirks.AssignQuirks(person, person_client)

force_stowaway_unassigned_role(person, person_client)
//OCULIS PORT END
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4528,6 +4528,7 @@
#include "code\modules\jobs\job_types\servant_golem.dm"
#include "code\modules\jobs\job_types\shaft_miner.dm"
#include "code\modules\jobs\job_types\station_engineer.dm"
#include "code\modules\jobs\job_types\stowaway.dm"
#include "code\modules\jobs\job_types\unassigned.dm"
#include "code\modules\jobs\job_types\virologist.dm"
#include "code\modules\jobs\job_types\warden.dm"
Expand Down
1 change: 1 addition & 0 deletions tgui/packages/tgui/interfaces/common/JobToIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const BASEICONS = {
'Shaft Miner': 'digging',
Skeleton: 'skull-crossbones',
'Station Engineer': 'gears',
Stowaway: 'person-through-window', // MONKESTATION ADDITION
'Syndicate Operative': 'dragon',
Virologist: 'virus',
Warden: 'handcuffs',
Expand Down
Loading