Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
definitelynotspaghetti committed Oct 29, 2024
2 parents c5fcfdf + 6165b5f commit e7fd504
Show file tree
Hide file tree
Showing 26 changed files with 123 additions and 72 deletions.
9 changes: 1 addition & 8 deletions _maps/map_files/Talos/TGS_Talos.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -20372,13 +20372,6 @@
/obj/effect/turf_decal/siding/metal,
/turf/open/floor/mainship/metal,
/area/mainship/hallways/port_hallway)
"mgc" = (
/obj/item/tool/mop,
/obj/effect/turf_decal/siding/metal{
dir = 8
},
/turf/open/floor/mainship/metal,
/area/mainship/hallways/bow_hallway)
"mgh" = (
/obj/effect/turf_decal/warning_stripes/cargo/yellow,
/obj/item/radio/intercom/general{
Expand Down Expand Up @@ -71014,7 +71007,7 @@ fkO
taD
fkO
fkO
mgc
fkO
uoK
rBl
xkT
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
#define COMSIG_MOVABLE_POST_THROW "movable_post_throw" //called on tail of atom/movable/throw_at()
#define COMSIG_MOVABLE_DISPOSING "movable_disposing" //called when the movable is added to a disposal holder object for disposal movement: (obj/structure/disposalholder/holder, obj/machinery/disposal/source)
#define COMSIG_MOVABLE_HEAR "movable_hear" //from base of atom/movable/Hear(): (message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode)
#define COMSIG_MOVABLE_Z_CHANGED "movable_ztransit" //from base of atom/movable/onTransitZ(): (old_z, new_z)
#define COMSIG_MOVABLE_Z_CHANGED "movable_ztransit" //from base of atom/movable/on_changed_z_level(): (old_z, new_z)
#define COMSIG_MOVABLE_PREBUMP_TURF "movable_prebump_turf"
#define COMSIG_MOVABLE_PREBUMP_MOVABLE "movable_prebump_movable"
#define COMPONENT_MOVABLE_PREBUMP_STOPPED (1<<0)
Expand Down
7 changes: 4 additions & 3 deletions code/_onclick/hud/fullscreen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@
if(fs_view == client_view)
return
if(screen_loc != "CENTER-7,CENTER-7")
var/list/actualview = getviewsize(client_view)
fs_view = client_view
transform = matrix(actualview[1] / FULLSCREEN_OVERLAY_RESOLUTION_X, 0, 0, 0, actualview[2] / FULLSCREEN_OVERLAY_RESOLUTION_Y, 0)
return
var/list/actualview = getviewsize(client_view)
fs_view = client_view
transform = matrix(actualview[1] / FULLSCREEN_OVERLAY_RESOLUTION_X, 0, 0, 0, actualview[2] / FULLSCREEN_OVERLAY_RESOLUTION_Y, 0)

/atom/movable/screen/fullscreen/proc/should_show_to(mob/mob)
if(!show_when_dead && mob.stat == DEAD)
Expand Down
27 changes: 17 additions & 10 deletions code/game/atoms/atom_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,8 @@ RU TGMC EDIT */
old_area.Exited(src, movement_dir)
var/turf/oldturf = get_turf(oldloc)
var/turf/destturf = get_turf(destination)
var/old_z = (oldturf ? oldturf.z : null)
var/dest_z = (destturf ? destturf.z : null)
if(old_z != dest_z)
onTransitZ(old_z, dest_z)
if(oldturf?.z != destturf?.z)
on_changed_z_level(oldturf, destturf)
destination.Entered(src, oldloc)
if(destarea && old_area != destarea)
destarea.Entered(src, oldloc)
Expand Down Expand Up @@ -848,13 +846,22 @@ RU TGMC EDIT */
H.selected_default_language = .
. = chosen_langtype

/**
* Called when a movable changes z-levels.
*
* Arguments:
* * old_turf - The previous turf they were on before.
* * new_turf - The turf they have now entered.
* * notify_contents - Whether or not to notify the movable's contents that their z-level has changed. NOTE, IF YOU SET THIS, YOU NEED TO MANUALLY SET PLANE OF THE CONTENTS LATER
*/
/atom/movable/proc/on_changed_z_level(turf/old_turf, turf/new_turf, notify_contents = TRUE)
SHOULD_CALL_PARENT(TRUE)
SEND_SIGNAL(src, COMSIG_MOVABLE_Z_CHANGED, old_turf?.z, new_turf?.z)

/atom/movable/proc/onTransitZ(old_z,new_z)
SEND_SIGNAL(src, COMSIG_MOVABLE_Z_CHANGED, old_z, new_z)
for(var/item in src) // Notify contents of Z-transition. This can be overridden IF we know the items contents do not care.
var/atom/movable/AM = item
AM.onTransitZ(old_z,new_z)

if(!notify_contents)
return
for(var/atom/movable/content as anything in src)
content.on_changed_z_level(old_turf, new_turf)

/atom/movable/proc/safe_throw_at(atom/target, range, speed, mob/thrower, spin = TRUE, force = MOVE_FORCE_STRONG)
if(anchored || (force < (move_resist * MOVE_FORCE_THROW_RATIO)) || (move_resist == INFINITY))
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/machinery/squad_supply/supply_beacon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@
SIGNAL_HANDLER
beacon_datum = null

/obj/item/beacon/supply_beacon/onTransitZ(old_z,new_z)
/obj/item/beacon/supply_beacon/on_changed_z_level(old_turf, new_turf, notify_contents)
. = ..()
//Assumes doMove sets loc before onTransitZ
if(beacon_datum) // RUTGMC ADDITION, supply beacon runtime fix
if(beacon_datum)
beacon_datum.drop_location = loc

/obj/item/beacon/supply_beacon/activate(mob/living/carbon/human/H)
Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/machinery/vending/marine_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
/obj/item/ammo_magazine/rifle/pepperball/pepperball_mini = -1,
/obj/item/attachable/stock/t76 = -1,
/obj/item/attachable/flamer_nozzle = -1,
/obj/item/attachable/flamer_nozzle/wide = -1,
/obj/item/attachable/flamer_nozzle/long = -1,
),
"Boxes" = list(
Expand Down Expand Up @@ -375,6 +376,7 @@
/obj/item/ammo_magazine/rifle/pepperball/pepperball_mini = -1,
/obj/item/attachable/stock/t76 = -1,
/obj/item/attachable/flamer_nozzle = -1,
/obj/item/attachable/flamer_nozzle/wide = -1,
/obj/item/attachable/flamer_nozzle/long = -1,
),
"Boxes" = list(
Expand Down Expand Up @@ -621,6 +623,7 @@
/obj/item/ammo_magazine/rifle/pepperball/pepperball_mini = -1,
/obj/item/attachable/stock/t76 = -1,
/obj/item/attachable/flamer_nozzle = -1,
/obj/item/attachable/flamer_nozzle/wide = -1,
/obj/item/attachable/flamer_nozzle/long = -1,
),
"Boxes" = list(
Expand Down
42 changes: 24 additions & 18 deletions code/game/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,44 +49,50 @@ A good representation is: 'byond applies a volume reduction to the sound every X
/proc/playsound(atom/source, soundin, vol, vary, sound_range, falloff, is_global, frequency, channel = 0, ambient_sound = FALSE)
var/turf/turf_source = get_turf(source)

if(!turf_source)
if(!turf_source || !soundin || !vol)
return

//allocate a channel if necessary now so its the same for everyone
channel = channel || SSsounds.random_available_channel()

if(!sound_range)
sound_range = round(0.5*vol) //if no specific range, the max range is equal to half the volume.
sound_range = round(0.5 * vol) //if no specific range, the max range is equal to half the volume.

if(!frequency)
frequency = GET_RANDOM_FREQ // Same frequency for everybody
// Looping through the player list has the added bonus of working for mobs inside containers
frequency = GET_RANDOM_FREQ
var/sound/S = sound(get_sfx(soundin))
var/source_z = turf_source.z

var/list/listeners = SSmobs.clients_by_zlevel[source_z].Copy()
for(var/mob/listening_mob in listeners | SSmobs.dead_players_by_zlevel[source_z])
if(get_dist(listening_mob, turf_source) > sound_range)
var/list/listeners = SSmobs.clients_by_zlevel[turf_source.z].Copy()
for(var/mob/ai_eye AS in GLOB.aiEyes)
var/turf/eye_turf = get_turf(ai_eye)
if(!eye_turf || eye_turf.z != turf_source.z)
continue
listening_mob.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, is_global, channel, S, sound_reciever = listening_mob)
listeners += ai_eye

for(var/mob/M AS in GLOB.aiEyes)
if(ambient_sound && !(M.client?.prefs?.toggles_sound & SOUND_AMBIENCE))
for(var/mob/listener AS in listeners|SSmobs.dead_players_by_zlevel[turf_source.z])
if(get_dist(listener, turf_source) > sound_range)
continue
var/turf/T = get_turf(M)
if(!T || T.z != turf_source.z || get_dist(M, turf_source) > sound_range)
if(ambient_sound && !(listener.client?.prefs?.toggles_sound & SOUND_AMBIENCE))
continue
M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, is_global, channel, S, sound_reciever = M)
listener.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, is_global, channel, S)


//We do tanks separately, since they are not actually on the source z, and we need some other stuff to get accurate directional sound
for(var/obj/vehicle/sealed/armored/armor AS in GLOB.tank_list)
if(!armor.interior || armor.z != turf_source.z || get_dist(armor, turf_source) > sound_range)
if(!armor.interior || armor.z != turf_source.z || get_dist(armor.loc, turf_source) > sound_range)
continue
if(!length(armor.interior.occupants))
continue
var/turf/middle_turf = armor.interior.loaded_turfs[floor(length(armor.interior.loaded_turfs) * 0.5)]
var/turf/origin_point = locate(clamp(middle_turf.x - armor.x + turf_source.x, 1, world.maxx), clamp(middle_turf.y - armor.y + turf_source.y, 1, world.maxy), middle_turf.z)
//origin point is regardless of vehicle orientation for player QOL and simple sanity

for(var/mob/crew AS in armor.interior.occupants)
if(!crew.client)
continue
//turf source is null on purpose because it will not work properly since crew is on a different z
crew.playsound_local(null, soundin, vol*0.5, vary, frequency, falloff, is_global, channel, S, sound_reciever = crew)

if(ambient_sound && !(crew.client.prefs.toggles_sound & SOUND_AMBIENCE))
continue
crew.playsound_local(origin_point, soundin, vol*0.5, vary, frequency, falloff, is_global, channel, S)

//todo rename S to sound_to_use
/mob/proc/playsound_local(turf/turf_source, soundin, vol, vary, frequency, falloff, is_global, channel = 0, sound/S, distance_multiplier = 1, mob/sound_reciever)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/lighting/emissive_blocker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
/atom/movable/emissive_blocker/ex_act(severity)
return FALSE

/atom/movable/emissive_blocker/onTransitZ()
/atom/movable/emissive_blocker/on_changed_z_level(turf/old_turf, turf/new_turf, notify_contents = TRUE)
SHOULD_CALL_PARENT(FALSE)
return

//Prevents people from moving these after creation, because they shouldn't be.
Expand Down
8 changes: 3 additions & 5 deletions code/modules/mob/dead/dead.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ INITIALIZE_IMMEDIATE(/mob/dead)
move_resist = INFINITY
resistance_flags = RESIST_ALL


/mob/dead/dust() //ghosts can't be vaporised.
return

Expand All @@ -18,15 +17,14 @@ INITIALIZE_IMMEDIATE(/mob/dead)
var/turf/old_turf = get_turf(src)
var/turf/new_turf = get_turf(destination)
if (old_turf?.z != new_turf?.z)
onTransitZ(old_turf?.z, new_turf?.z)
on_changed_z_level(old_turf, new_turf)
var/oldloc = loc
loc = destination
Moved(oldloc, NONE, TRUE)

/mob/dead/abstract_move(atom/destination)
var/turf/old_turf = get_turf(src)
var/turf/new_turf = get_turf(destination)
if (old_turf?.z != new_turf?.z)
onTransitZ(old_turf?.z, new_turf?.z)
if(old_turf?.z != new_turf?.z)
on_changed_z_level(old_turf, new_turf)
return ..()

3 changes: 2 additions & 1 deletion code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

GLOB.human_mob_list += src
GLOB.alive_human_list += src
LAZYADD(GLOB.humans_by_zlevel["[z]"], src)
if(z)
LAZYADD(GLOB.humans_by_zlevel["[z]"], src)

var/datum/action/skill/toggle_orders/toggle_orders_action = new
toggle_orders_action.give_action(src)
Expand Down
21 changes: 19 additions & 2 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@

updatehealth()

if(client)
var/turf/T = get_turf(src)
if(!T)
return
if(registered_z != T.z)
#ifdef TESTING
message_admins("[ADMIN_LOOKUPFLW(src)] has somehow ended up in Z-level [T.z] despite being registered in Z-level [registered_z]. If you could ask them how that happened and notify coderbus, it would be appreciated.")
#endif
log_game("Z-TRACKING: [src] has somehow ended up in Z-level [T.z] despite being registered in Z-level [registered_z].")
update_z(T.z)
return
if(registered_z)
log_game("Z-TRACKING: [src] of type [src.type] has a Z-registration despite not having a client.")
update_z(null)


//this updates all special effects: knockdown, druggy, etc.., DELETE ME!!
/mob/living/proc/handle_status_effects()
Expand Down Expand Up @@ -200,6 +215,7 @@
if(client)
reset_perspective()

///Updates the mob's registered_z
/mob/living/proc/update_z(new_z) // 1+ to register, null to unregister
if(registered_z == new_z)
return
Expand Down Expand Up @@ -761,9 +777,10 @@ below 100 is not dizzy
/mob/living/can_interact_with(datum/D)
return D == src || D.Adjacent(src)

/mob/living/onTransitZ(old_z, new_z)
. = ..()
/mob/living/on_changed_z_level(turf/old_turf, turf/new_turf, notify_contents = TRUE)
set_jump_component()
. = ..()
update_z(new_turf?.z)

/**
* Changes the inclination angle of a mob, used by humans and others to differentiate between standing up and prone positions.
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,5 @@
var/time_entered_stasis = 0
///The world.time of when this mob entered a cryo tube
var/time_entered_cryo = 0
///The z level this mob is currently registered in
var/registered_z = null
6 changes: 3 additions & 3 deletions code/modules/mob/living/login.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

INVOKE_ASYNC(SSdiscord, TYPE_PROC_REF(/datum/controller/subsystem/discord, get_boosty_tier), ckey)

var/turf/T = get_turf(src)
if (isturf(T))
update_z(T.z)
var/turf/mob_turf = get_turf(src)
if(isturf(mob_turf))
update_z(mob_turf.z)

if(length(pipes_shown)) //ventcrawling, need to reapply pipe vision
var/obj/machinery/atmospherics/A = loc
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/logout.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/mob/living/Logout()
update_z(null)
..()
if (mind)
. = ..()
if(mind)
if(!key) //key and mind have become seperated.
mind.active = 0 //This is to stop say, a mind.transfer_to call on a corpse causing a ghost to re-enter its body.
if(!immune_to_ssd && mind.active)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/ai/freelook/eye.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
var/turf/old_turf = get_turf(src)
var/turf/new_turf = get_turf(new_loc)
if(old_turf?.z != new_turf?.z)
onTransitZ(old_turf?.z, new_turf?.z)
on_changed_z_level(old_turf, new_turf)
return ..()


Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/simple_animal/simple_animal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@
else
stack_trace("Something attempted to set simple animals AI to an invalid state: [togglestatus]")

/mob/living/simple_animal/onTransitZ(old_z, new_z)
/mob/living/simple_animal/on_changed_z_level(turf/old_turf, turf/new_turf, notify_contents = TRUE)
. = ..()
if(AIStatus == AI_Z_OFF)
SSidlenpcpool.idle_mobs_by_zlevel[old_z] -= src
SSidlenpcpool.idle_mobs_by_zlevel[old_turf.z] -= src
toggle_ai(initial(AIStatus))

/mob/living/simple_animal/proc/handle_automated_action()
Expand Down
9 changes: 3 additions & 6 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -827,16 +827,13 @@
clear_important_client_contents()
canon_client = null

/mob/onTransitZ(old_z, new_z)
/mob/on_changed_z_level(turf/old_turf, turf/new_turf, notify_contents = TRUE)
. = ..()
if(!client || !hud_used)
return
if(old_z == new_z)
if(old_turf?.z == new_turf?.z)
return
if(isliving(src))
var/mob/living/living = src
living.update_z(new_z)
if(is_ground_level(new_z))
if(is_ground_level(new_turf.z))
hud_used.remove_parallax(src)
return
hud_used.create_parallax(src)
Expand Down
3 changes: 0 additions & 3 deletions code/modules/mob/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,3 @@
var/list/pain_stored = list()
var/last_pain_message = ""
var/next_pain_time = 0

///The z level this mob is currently registered in
var/registered_z = null //for sound optimization
4 changes: 2 additions & 2 deletions code/modules/projectiles/guns/flamer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
///Max range of the flamer in tiles.
var/flame_max_range = 6
///Max resin wall penetration in tiles.
var/flame_max_wall_pen = 2
var/flame_max_wall_pen = 3
///After how many total resin walls the flame wont proceed further
var/flame_max_wall_pen_wide = 9
var/flame_max_wall_pen_wide = 7
///Travel speed of the flames in seconds.
var/flame_spread_time = 0.1 SECONDS
///Gun based modifier for burn level. Percentage based.
Expand Down
2 changes: 1 addition & 1 deletion code/modules/shuttle/on_move.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ All ShuttleMove procs go here

var/turf/newT = get_turf(src)
if (newT.z != oldT.z)
onTransitZ(oldT.z, newT.z)
on_changed_z_level(oldT, newT)

if(light)
update_light()
Expand Down
6 changes: 6 additions & 0 deletions html/changelogs/AutoChangeLog-pr-598.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
author: "Tatarla"
delete-after: True
changes:
- balance: "Спрей-насадка возвращена в вендор оружия"
- balance: "Спрей насадка прожигает до 7 стенок вместо 9"
- balance: "Обычная насадка прожигает до 3 стенок вместо 2"
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-601.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Helg2"
delete-after: True
changes:
- bugfix: "Исправил баг с неправильным звучанием различных звуков в танке."
Loading

0 comments on commit e7fd504

Please sign in to comment.