Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into dropship-sidedoors
Browse files Browse the repository at this point in the history
  • Loading branch information
Doubleumc committed Nov 22, 2023
2 parents 8dad009 + 8f4d9ba commit 9de7f7b
Show file tree
Hide file tree
Showing 30 changed files with 255 additions and 50 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
// Subsystems shutdown in the reverse of the order they initialize in
// The numbers just define the ordering, they are meaningless otherwise.

#define SS_INIT_PROFILER 86
#define SS_INIT_INPUT 85
#define SS_INIT_TOPIC 83
#define SS_INIT_LOBBYART 82
Expand Down
22 changes: 0 additions & 22 deletions code/__HELPERS/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,10 @@
all_jobs += new jobtype
return all_jobs


/proc/get_all_centcom_jobs() return list()

//gets the actual job rank (ignoring alt titles)
//this is used solely for sechuds
/obj/proc/GetJobRealName()
if (!istype(src,/obj/item/card/id)) return
var/obj/item/card/id/I = src
if(I.rank in GLOB.joblist) return I.rank
if(I.assignment in GLOB.joblist) return I.assignment
return "Unknown"

/proc/get_all_job_icons() return GLOB.joblist + list("Prisoner")//For all existing HUD icons

/obj/proc/GetJobName() //Used in secHUD icon generation
var/obj/item/card/id/I = src
if(istype(I))
var/job_icons = get_all_job_icons()
var/centcom = get_all_centcom_jobs()

if(I.assignment in job_icons) return I.assignment//Check if the job has a hud icon
if(I.rank in job_icons) return I.rank
if(I.assignment in centcom) return "Centcom"//Return with the NT logo if it is a Centcom job
if(I.rank in centcom) return "Centcom"
return "Unknown" //Return unknown if none of the above apply

/proc/get_actual_job_name(mob/M)
if(!M)
return null
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var/obj/structure/S = A
S.do_climb(src, mods)
return TRUE
else if(!(isitem(A) && get_dist(src, A) <= 1) && client.prefs.toggle_prefs & TOGGLE_MIDDLE_MOUSE_SWAP_HANDS)
else if(!(isitem(A) && get_dist(src, A) <= 1) && (client && (client.prefs.toggle_prefs & TOGGLE_MIDDLE_MOUSE_SWAP_HANDS)))
swap_hand()
return TRUE

Expand Down
2 changes: 2 additions & 0 deletions code/controllers/configuration/entries/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -627,3 +627,5 @@ This maintains a list of ip addresses that are able to bypass topic filtering.
protection = CONFIG_ENTRY_HIDDEN|CONFIG_ENTRY_LOCKED

/datum/config_entry/flag/guest_ban

/datum/config_entry/flag/auto_profile
74 changes: 74 additions & 0 deletions code/controllers/subsystem/profiler.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#define PROFILER_FILENAME "profiler.json"
#define SENDMAPS_FILENAME "sendmaps.json"

SUBSYSTEM_DEF(profiler)
name = "Profiler"
init_order = SS_INIT_PROFILER
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
wait = 300 SECONDS
var/fetch_cost = 0
var/write_cost = 0

/datum/controller/subsystem/profiler/stat_entry(msg)
msg += "F:[round(fetch_cost,1)]ms"
msg += "|W:[round(write_cost,1)]ms"
return msg

/datum/controller/subsystem/profiler/Initialize()
if(CONFIG_GET(flag/auto_profile))
StartProfiling()
else
StopProfiling() //Stop the early start profiler
return SS_INIT_SUCCESS

/datum/controller/subsystem/profiler/OnConfigLoad()
if(CONFIG_GET(flag/auto_profile))
StartProfiling()
can_fire = TRUE
else
StopProfiling()
can_fire = FALSE

/datum/controller/subsystem/profiler/fire()
DumpFile()

/datum/controller/subsystem/profiler/Shutdown()
if(CONFIG_GET(flag/auto_profile))
DumpFile(allow_yield = FALSE)
world.Profile(PROFILE_CLEAR, type = "sendmaps")
return ..()

/datum/controller/subsystem/profiler/proc/StartProfiling()
world.Profile(PROFILE_START)
world.Profile(PROFILE_START, type = "sendmaps")

/datum/controller/subsystem/profiler/proc/StopProfiling()
world.Profile(PROFILE_STOP)
world.Profile(PROFILE_STOP, type = "sendmaps")

/datum/controller/subsystem/profiler/proc/DumpFile(allow_yield = TRUE)
var/timer = TICK_USAGE_REAL
var/current_profile_data = world.Profile(PROFILE_REFRESH, format = "json")
var/current_sendmaps_data = world.Profile(PROFILE_REFRESH, type = "sendmaps", format="json")
fetch_cost = MC_AVERAGE(fetch_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(allow_yield)
CHECK_TICK

if(!length(current_profile_data)) //Would be nice to have explicit proc to check this
stack_trace("Warning, profiling stopped manually before dump.")
var/prof_file = file("[GLOB.log_directory]/[PROFILER_FILENAME]")
if(fexists(prof_file))
fdel(prof_file)
if(!length(current_sendmaps_data)) //Would be nice to have explicit proc to check this
stack_trace("Warning, sendmaps profiling stopped manually before dump.")
var/sendmaps_file = file("[GLOB.log_directory]/[SENDMAPS_FILENAME]")
if(fexists(sendmaps_file))
fdel(sendmaps_file)

timer = TICK_USAGE_REAL
WRITE_FILE(prof_file, current_profile_data)
WRITE_FILE(sendmaps_file, current_sendmaps_data)
write_cost = MC_AVERAGE(write_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))

#undef PROFILER_FILENAME
#undef SENDMAPS_FILENAME
3 changes: 3 additions & 0 deletions code/datums/looping_sounds/misc_sounds.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/datum/looping_sound/looping_launch_announcement_alarm
mid_sounds = list('sound/vehicles/Dropships/single_alarm_brr_dropship_1.ogg' = 1)
start_sound = list('sound/vehicles/Dropships/single_alarm_brr_dropship_1.ogg' = 1)
20 changes: 19 additions & 1 deletion code/game/jobs/job/civilians/other/mess_seargent.dm
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
/datum/job/civilian/chef
title = JOB_MESS_SERGEANT
total_positions = 1
total_positions = 2
spawn_positions = 1
allow_additional = TRUE
scaled = TRUE
selection_class = "job_ot"
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
supervisors = "the auxiliary support officer"
gear_preset = /datum/equipment_preset/uscm_ship/chef
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>Your job is to service the marines with excellent food</a>, drinks and entertaining the shipside crew when needed. You have a lot of freedom and it is up to you, to decide what to do with it. Good luck!"

/datum/job/civilian/chef/set_spawn_positions(count)
spawn_positions = mess_sergeant_slot_formula(count)

/datum/job/civilian/chef/get_total_positions(latejoin = FALSE)
var/positions = spawn_positions
if(latejoin)
positions = mess_sergeant_slot_formula(get_total_marines())
if(positions <= total_positions_so_far)
positions = total_positions_so_far
else
total_positions_so_far = positions
else
total_positions_so_far = positions

return positions

/obj/effect/landmark/start/chef
name = JOB_MESS_SERGEANT
icon_state = "chef_spawn"
Expand Down
3 changes: 3 additions & 0 deletions code/game/jobs/slot_scaling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@

/proc/working_joe_slot_formula(playercount)
return job_slot_formula(playercount,30,1,3,6)

/proc/mess_sergeant_slot_formula(playercount)
return job_slot_formula(playercount, 70, 1, 1, 2)
15 changes: 15 additions & 0 deletions code/game/objects/items/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,21 @@
. = ..()
screen_loc = null

/obj/item/card/id/proc/GetJobName() //Used in secHUD icon generation

var/job_icons = get_all_job_icons()
var/centcom = get_all_centcom_jobs()

if(assignment in job_icons)
return assignment//Check if the job has a hud icon
if(rank in job_icons)
return rank
if(assignment in centcom)
return "Centcom"//Return with the NT logo if it is a Centcom job
if(rank in centcom)
return "Centcom"
return "Unknown" //Return unknown if none of the above apply

/obj/item/card/id/attack_self(mob/user as mob)
..()
user.visible_message("[user] shows you: [icon2html(src, viewers(user))] [name]: assignment: [assignment]")
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/props/helmetgarb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@
/obj/item/prop/helmetgarb/family_photo/pickup(mob/user, silent)
. = ..()
if(!owner)
RegisterSignal(user, COMSIG_POST_SPAWN_UPDATE, PROC_REF(set_owner))
RegisterSignal(user, COMSIG_POST_SPAWN_UPDATE, PROC_REF(set_owner), override = TRUE)


///Sets the owner of the family photo to the human it spawns with, needs var/source for signals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
user.put_in_hands(cookiefortune)
cookiefortune = null
else
to_chat(SPAN_WARNING("You break open the fortune cookie, but there's no fortune inside! Oh no!"))
to_chat(user, SPAN_WARNING("You break open the fortune cookie, but there's no fortune inside! Oh no!"))
else
. = ..()

Expand All @@ -109,7 +109,7 @@
user.put_in_hands(cookiefortune)
cookiefortune = null
else
to_chat(SPAN_WARNING("You break open the fortune cookie, but there's no fortune inside! Oh no!"))
to_chat(user, SPAN_WARNING("You break open the fortune cookie, but there's no fortune inside! Oh no!"))
else
. = ..()

Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items/stacks/stack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ Also change the icon to reflect the amount of sheets, if possible.*/
if(mods["alt"])
if(!CAN_PICKUP(user, src))
return
if(amount <= 1)
return
var/desired = tgui_input_number(user, "How much would you like to split off from this stack?", "How much?", 1, amount-1, 1)
if(!desired)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/tools/misc_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
/obj/item/tool/pen/fountain/pickup(mob/user, silent)
. = ..()
if(!owner_name)
RegisterSignal(user, COMSIG_POST_SPAWN_UPDATE, PROC_REF(set_owner))
RegisterSignal(user, COMSIG_POST_SPAWN_UPDATE, PROC_REF(set_owner), override = TRUE)

///Sets the owner of the pen to who it spawns with, requires var/source for signals
/obj/item/tool/pen/fountain/proc/set_owner(datum/source)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/toys/toys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@

/obj/item/toy/plush/random_plushie/pickup(mob/user, silent)
. = ..()
RegisterSignal(user, COMSIG_POST_SPAWN_UPDATE, PROC_REF(create_plushie))
RegisterSignal(user, COMSIG_POST_SPAWN_UPDATE, PROC_REF(create_plushie), override = TRUE)

///The randomizer picking and spawning a plushie on either the ground or in the humans backpack. Needs var/source due to signals
/obj/item/toy/plush/random_plushie/proc/create_plushie(datum/source)
Expand Down
5 changes: 2 additions & 3 deletions code/game/objects/structures/crates_lockers/largecrate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
material_sheet = new parts_type(current_turf, 2)

// Move the objects back to the turf, above the crate material
for(var/atom/movable/moving_atom in contents)
var/atom/movable/current_atom = contents[1]
current_atom.forceMove(current_turf)
for(var/atom/movable/moving_atom as anything in contents)
moving_atom.forceMove(current_turf)

deconstruct(TRUE)

Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/props.dm
Original file line number Diff line number Diff line change
Expand Up @@ -805,14 +805,14 @@

/obj/structure/prop/brazier/campfire/attackby(obj/item/attacking_item, mob/user)
if(!istype(attacking_item, /obj/item/stack/sheet/wood))
to_chat(SPAN_NOTICE("You cannot fuel [src] with [attacking_item]."))
to_chat(user, SPAN_NOTICE("You cannot fuel [src] with [attacking_item]."))
return
var/obj/item/stack/sheet/wood/fuel = attacking_item
if(remaining_fuel >= initial(remaining_fuel))
to_chat(user, SPAN_NOTICE("You cannot fuel [src] further."))
return
if(!fuel.use(1))
to_chat(SPAN_NOTICE("You do not have enough [attacking_item] to fuel [src]."))
to_chat(user, SPAN_NOTICE("You do not have enough [attacking_item] to fuel [src]."))
return
visible_message(SPAN_NOTICE("[user] fuels [src] with [fuel]."))
remaining_fuel++
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/under/marine_uniform.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@
return

if(!linked_hood)
to_chat(SPAN_BOLDWARNING("You are missing a linked_hood! This should not be possible."))
to_chat(user, SPAN_BOLDWARNING("You are missing a linked_hood! This should not be possible."))
CRASH("[user] attempted to toggle hood on [src] that was missing a linked_hood.")

playsound(user.loc, "armorequip", 25, 1)
Expand Down
6 changes: 4 additions & 2 deletions code/modules/droppod/droppod_ui.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ GLOBAL_LIST_INIT(droppod_target_mode, list(
/datum/admin_podlauncher/proc/refresh_bay()
bay = locate(/area/admin/droppod/loading) in GLOB.sorted_areas
if(!bay)
to_chat(SPAN_WARNING("There's no /area/admin/droppod/loading. You can make one yourself, but yell at the mappers to fix this."))
if(holder)
to_chat(holder, SPAN_WARNING("There's no /area/admin/droppod/loading. You can make one yourself, but yell at the mappers to fix this."))
CRASH("No /area/admin/droppod/loading has been mapped into the admin z-level!")
ordered_area = list()
for(var/turf/T in bay)
Expand Down Expand Up @@ -221,7 +222,8 @@ GLOBAL_LIST_INIT(droppod_target_mode, list(

custom_dropoff = TRUE
temp_pod.dropoff_point = get_turf(target)
to_chat(SPAN_NOTICE("You have selected [temp_pod.dropoff_point] as your dropoff location."))
if(holder)
to_chat(holder, SPAN_NOTICE("You have selected [temp_pod.dropoff_point] as your dropoff location."))
SStgui.update_uis(src)
return COMPONENT_INTERRUPT_CLICK

Expand Down
2 changes: 1 addition & 1 deletion code/modules/keybindings/setup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
for(var/k in 1 to length(macro_set))
var/list/split_name = splittext(macro_set[k], ".")

if(findtext(split_name[2], "srvkeybinds-") == 1)
if((length(split_name) >= 2) && (findtext(split_name[2], "srvkeybinds-") == 1))
var/macro_name = "[split_name[1]].[split_name[2]]" // [3] is "command"
erase_output = "[erase_output];[macro_name].parent=null"
winset(src, null, erase_output)
Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1741,3 +1741,9 @@
return FALSE

. = ..()

/mob/living/carbon/human/make_dizzy(amount)
dizziness = min(500, dizziness + amount) // store what will be new value
// clamped to max 500
if(dizziness > 100 && !is_dizzy)
INVOKE_ASYNC(src, PROC_REF(dizzy_process))
11 changes: 2 additions & 9 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -593,20 +593,13 @@
adds a dizziness amount to a mob
use this rather than directly changing var/dizziness
since this ensures that the dizzy_process proc is started
currently only humans get dizzy
currently only mob/living/carbon/human get dizzy
value of dizziness ranges from 0 to 1000
below 100 is not dizzy
*/
/mob/proc/make_dizzy(amount)
if(!istype(src, /mob/living/carbon/human)) // for the moment, only humans get dizzy
return

dizziness = min(500, dizziness + amount) // store what will be new value
// clamped to max 500
if(dizziness > 100 && !is_dizzy)
INVOKE_ASYNC(src, PROC_REF(dizzy_process))

return

/*
dizzy process - wiggles the client's pixel offset over time
Expand Down
3 changes: 2 additions & 1 deletion code/modules/projectiles/guns/flamer/flamer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ GLOBAL_LIST_EMPTY(flamer_particles)
tied_reagent = new R.type() // Can't get deleted this way
tied_reagent.make_alike(R)

tied_reagents = obj_reagents
if(obj_reagents)
tied_reagents = obj_reagents

target_clicked = target

Expand Down
Loading

0 comments on commit 9de7f7b

Please sign in to comment.