Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/kirieee/kirie-2
Browse files Browse the repository at this point in the history
  • Loading branch information
kirieee committed Nov 21, 2023
2 parents a875f46 + c620cb1 commit 5e34a71
Show file tree
Hide file tree
Showing 25 changed files with 245 additions and 28 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
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
34 changes: 21 additions & 13 deletions code/datums/looping_sounds/_looping_sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
/// Has the looping started yet?
var/loop_started = FALSE

/**
* Let's you make a "loud" sound that "projects." IE you can hear this sound from a further distance away.
* Think of like an air raid siren. They're loud if you're close yeah... but you can hear them from mad far away, bruv
* with a longer "falloff distance." Fixes the extra_range stuff
*/
var/is_sound_projecting = FALSE
///only applicable to is_sound_projecting: max range till sound volume starts dropping as distance increases
var/falloff_distance = 50

/* // as of yet unused varen \\
/// How much the sound will be affected by falloff per tile.
Expand Down Expand Up @@ -130,19 +139,18 @@
sound_to_play.channel = get_free_channel()
sound_to_play.volume = volume_override || volume //Use volume as fallback if theres no override
SEND_SOUND(parent, sound_to_play)
else
playsound(
parent,
sound_to_play,
volume,
vary,
extra_range//,
// falloff_exponent = falloff_exponent,
// pressure_affected = pressure_affected,
// ignore_walls = ignore_walls,
// falloff_distance = falloff_distance,
// use_reverb = use_reverb
)
return
if (is_sound_projecting)
playsound(parent, sound_to_play, volume, vary, extra_range, VOLUME_SFX, 0, 0, falloff_distance)
return

playsound(
parent,
sound_to_play,
volume,
vary,
extra_range
)

/// Returns the sound we should now be playing.
/datum/looping_sound/proc/get_sound(_mid_sounds)
Expand Down
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)
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
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
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
22 changes: 22 additions & 0 deletions code/modules/shuttle/computers/dropship_computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@
.["door_status"] = is_remote ? list() : shuttle.get_door_data()
.["has_flyby_skill"] = skillcheck(user, SKILL_PILOT, SKILL_PILOT_EXPERT)

// Launch Alarm Variables
.["playing_launch_announcement_alarm"] = shuttle.playing_launch_announcement_alarm

.["destinations"] = list()
// add flight
.["destinations"] += list(
Expand Down Expand Up @@ -381,6 +384,7 @@
msg_admin_niche(log)
log_interact(user, msg = "[log]")
shuttle.send_for_flyby()
stop_playing_launch_announcement_alarm()
return TRUE

update_equipment(is_optimised, FALSE)
Expand Down Expand Up @@ -410,6 +414,7 @@
var/log = "[key_name(user)] launched the dropship [src.shuttleId] on transport."
msg_admin_niche(log)
log_interact(user, msg = "[log]")
stop_playing_launch_announcement_alarm()
return TRUE
if("button-push")
playsound(loc, get_sfx("terminal_button"), KEYBOARD_SOUND_VOLUME, 1)
Expand Down Expand Up @@ -469,6 +474,23 @@
if("cancel-flyby")
if(shuttle.in_flyby && shuttle.timer && shuttle.timeLeft(1) >= DROPSHIP_WARMUP_TIME)
shuttle.setTimer(DROPSHIP_WARMUP_TIME)
if("play_launch_announcement_alarm")
if (shuttle.mode != SHUTTLE_IDLE && shuttle.mode != SHUTTLE_RECHARGING)
to_chat(usr, SPAN_WARNING("The Launch Announcement Alarm is designed to tell people that you're going to take off soon."))
return
shuttle.alarm_sound_loop.start()
shuttle.playing_launch_announcement_alarm = TRUE
return
if ("stop_playing_launch_announcement_alarm")
stop_playing_launch_announcement_alarm()
return

/obj/structure/machinery/computer/shuttle/dropship/flight/proc/stop_playing_launch_announcement_alarm()
var/obj/docking_port/mobile/marine_dropship/shuttle = SSshuttle.getShuttle(shuttleId)

shuttle.alarm_sound_loop.stop()
shuttle.playing_launch_announcement_alarm = FALSE
return

/obj/structure/machinery/computer/shuttle/dropship/flight/lz1
icon = 'icons/obj/structures/machinery/computer.dmi'
Expand Down
12 changes: 12 additions & 0 deletions code/modules/shuttle/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@
var/rechargeTime = 0 //time spent after arrival before being able to launch again
var/prearrivalTime = 0 //delay after call time finishes for sound effects, explosions, etc.

var/playing_launch_announcement_alarm = FALSE // FALSE = off ; TRUE = on
var/datum/looping_sound/looping_launch_announcement_alarm/alarm_sound_loop

var/landing_sound = 'sound/effects/engine_landing.ogg'
var/ignition_sound = 'sound/effects/engine_startup.ogg'
/// Default shuttle audio ambience while flying
Expand Down Expand Up @@ -383,6 +386,7 @@

/obj/docking_port/mobile/Destroy(force)
if(force)
QDEL_NULL(alarm_sound_loop)
SSshuttle.mobile -= src
destination = null
previous = null
Expand Down Expand Up @@ -410,6 +414,14 @@
initial_engines = count_engines()
current_engines = initial_engines

//Launch Announcement Alarm variables setup
alarm_sound_loop = new(src)
alarm_sound_loop.mid_length = 20
alarm_sound_loop.extra_range = 30
alarm_sound_loop.volume = 100
alarm_sound_loop.is_sound_projecting = TRUE
alarm_sound_loop.falloff_distance = 7

#ifdef DOCKING_PORT_HIGHLIGHT
highlight("#0f0")
#endif
Expand Down
4 changes: 3 additions & 1 deletion code/modules/tooltip/tooltip.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ Notes:
last_target = null

/datum/tooltip/proc/do_hide()
winshow(owner, control, FALSE)
if(owner)
winshow(owner, control, FALSE)

/datum/tooltip/Destroy(force, ...)
last_target = null
owner = null
return ..()

//Open a tooltip for user, at a location based on params
Expand Down
2 changes: 2 additions & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@
#include "code\controllers\subsystem\police_clues.dm"
#include "code\controllers\subsystem\power.dm"
#include "code\controllers\subsystem\predships.dm"
#include "code\controllers\subsystem\profiler.dm"
#include "code\controllers\subsystem\projectiles.dm"
#include "code\controllers\subsystem\quadtrees.dm"
#include "code\controllers\subsystem\reagents.dm"
Expand Down Expand Up @@ -553,6 +554,7 @@
#include "code\datums\langchat\langchat.dm"
#include "code\datums\looping_sounds\_looping_sound.dm"
#include "code\datums\looping_sounds\item_sounds.dm"
#include "code\datums\looping_sounds\misc_sounds.dm"
#include "code\datums\origin\civilian.dm"
#include "code\datums\origin\origin.dm"
#include "code\datums\origin\upp.dm"
Expand Down
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-4793.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "AnturK"
delete-after: True
changes:
- server: "the server now supports auto-profiling"
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-4858.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "hislittlecuzingames"
delete-after: True
changes:
- rscadd: "Launch Announcement Alarm for dropships to notify ground forces of departure."
4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-4946.yml

This file was deleted.

4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-4983.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Morrow"
delete-after: True
changes:
- rscadd: "Mess tech positions now scale from 1 to 2 after 70 marines are in the game"
7 changes: 7 additions & 0 deletions html/changelogs/archive/2023-11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,10 @@
time). Abuse at your discretion.
ihatethisengine:
- rscadd: Cloaked lurker devouring now shows a message to target again.
2023-11-20:
Zonespace27:
- bugfix: Jump-to-area verb will now warn you if there aren't any turfs in the given
area.
2023-11-21:
hislittlecuzingames:
- code_imp: Added ability to have looping sounds from further away
Binary file not shown.
Loading

0 comments on commit 5e34a71

Please sign in to comment.