Skip to content

Commit

Permalink
Merge branch 'master' into Pre-awaking-equipment
Browse files Browse the repository at this point in the history
  • Loading branch information
LC4492 authored Jan 17, 2024
2 parents 3eee29e + cdf25c8 commit 2899baf
Show file tree
Hide file tree
Showing 21 changed files with 113 additions and 71 deletions.
5 changes: 4 additions & 1 deletion code/__DEFINES/tgs.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// tgstation-server DMAPI

#define TGS_DMAPI_VERSION "7.0.1"
#define TGS_DMAPI_VERSION "7.0.2"

// All functions and datums outside this document are subject to change with any version and should not be relied on.

Expand Down Expand Up @@ -426,6 +426,7 @@

/**
* Send a message to connected chats. This function may sleep!
* If TGS is offline when called, the message may be placed in a queue to be sent and this function will return immediately. Your message will be sent when TGS reconnects to the game.
*
* message - The [/datum/tgs_message_content] to send.
* admin_only: If [TRUE], message will be sent to admin connected chats. Vice-versa applies.
Expand All @@ -435,6 +436,7 @@

/**
* Send a private message to a specific user. This function may sleep!
* If TGS is offline when called, the message may be placed in a queue to be sent and this function will return immediately. Your message will be sent when TGS reconnects to the game.
*
* message - The [/datum/tgs_message_content] to send.
* user: The [/datum/tgs_chat_user] to PM.
Expand All @@ -444,6 +446,7 @@

/**
* Send a message to connected chats that are flagged as game-related in TGS. This function may sleep!
* If TGS is offline when called, the message may be placed in a queue to be sent and this function will return immediately. Your message will be sent when TGS reconnects to the game.
*
* message - The [/datum/tgs_message_content] to send.
* channels - Optional list of [/datum/tgs_chat_channel]s to restrict the message to.
Expand Down
7 changes: 1 addition & 6 deletions code/datums/balloon_alerts/balloon_alerts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,15 @@
if (isnull(viewer_client))
return

var/bound_width = world.icon_size
if (ismovable(src))
var/atom/movable/movable_source = src
bound_width = movable_source.bound_width

var/image/balloon_alert = image(loc = get_atom_on_turf(src), layer = ABOVE_MOB_LAYER)
balloon_alert.plane = RUNECHAT_PLANE
balloon_alert.alpha = 0
balloon_alert.color = text_color
balloon_alert.appearance_flags = NO_CLIENT_COLOR|KEEP_APART|RESET_COLOR|RESET_TRANSFORM|RESET_ALPHA
balloon_alert.maptext = MAPTEXT("<span class='center langchat'>[text]</span>")
balloon_alert.maptext_x = (BALLOON_TEXT_WIDTH - bound_width) * -0.5
balloon_alert.maptext_height = WXH_TO_HEIGHT(viewer_client?.MeasureText(text, null, BALLOON_TEXT_WIDTH))
balloon_alert.maptext_width = BALLOON_TEXT_WIDTH
balloon_alert.maptext_x = get_maxptext_x_offset(balloon_alert)
if(appearance_flags & PIXEL_SCALE)
balloon_alert.appearance_flags |= PIXEL_SCALE
//"<span style='text-align: center; -dm-text-outline: 1px #0005'>[text]</span>"
Expand Down
18 changes: 9 additions & 9 deletions code/datums/langchat/langchat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
M.client.images -= langchat_image
langchat_listeners = null

/atom/proc/langchat_set_x_offset()
langchat_image.maptext_x = world.icon_size / 2 - langchat_image.maptext_width / 2
/atom/movable/langchat_set_x_offset()
langchat_image.maptext_x = bound_width / 2 - langchat_image.maptext_width / 2
/mob/langchat_set_x_offset()
langchat_image.maptext_x = icon_size / 2 - langchat_image.maptext_width / 2
/atom/proc/get_maxptext_x_offset(image/maptext_image)
return (world.icon_size / 2) - (maptext_image.maptext_width / 2)
/atom/movable/get_maxptext_x_offset(image/maptext_image)
return (bound_width / 2) - (maptext_image.maptext_width / 2)
/mob/get_maxptext_x_offset(image/maptext_image)
return (icon_size / 2) - (maptext_image.maptext_width / 2)

///Creates the image if one does not exist, resets settings that are modified by speech procs.
/atom/proc/langchat_make_image(override_color = null)
Expand All @@ -64,7 +64,7 @@
langchat_image.maptext_y = langchat_height
langchat_image.maptext_height = 64
langchat_image.maptext_y -= LANGCHAT_MESSAGE_POP_Y_SINK
langchat_set_x_offset()
langchat_image.maptext_x = get_maxptext_x_offset(langchat_image)

langchat_image.pixel_y = 0
langchat_image.alpha = 0
Expand Down Expand Up @@ -109,7 +109,7 @@

langchat_image.maptext = text_to_display
langchat_image.maptext_width = LANGCHAT_WIDTH
langchat_set_x_offset()
langchat_image.maptext_x = get_maxptext_x_offset(langchat_image)

langchat_listeners = listeners
for(var/mob/M in langchat_listeners)
Expand Down Expand Up @@ -156,7 +156,7 @@

langchat_image.maptext = text_to_display
langchat_image.maptext_width = LANGCHAT_WIDTH * 2
langchat_set_x_offset()
langchat_image.maptext_x = get_maxptext_x_offset(langchat_image)

langchat_listeners = listeners
for(var/mob/M in langchat_listeners)
Expand Down
1 change: 0 additions & 1 deletion code/modules/cm_marines/smartgun_mount.dm
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,6 @@
/// What firemodes this gun has
var/static/list/gun_firemodes = list(
GUN_FIREMODE_SEMIAUTO,
GUN_FIREMODE_BURSTFIRE,
GUN_FIREMODE_AUTOMATIC,
)
/// A multiplier for how slow this gun should fire in automatic as opposed to burst. 1 is normal, 1.2 is 20% slower, 0.8 is 20% faster, etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@

if(xeno.crest_defense)
to_chat(xeno, SPAN_XENOWARNING("We lower our crest."))
xeno.balloon_alert(xeno, "crest lowered")

xeno.ability_speed_modifier += speed_debuff
xeno.armor_deflection_buff += armor_buff
xeno.mob_size = MOB_SIZE_BIG //knockback immune
button.icon_state = "template_active"
xeno.update_icons()
else
to_chat(xeno, SPAN_XENOWARNING("We raise our crest."))
xeno.balloon_alert(xeno, "crest raised")

xeno.ability_speed_modifier -= speed_debuff
xeno.armor_deflection_buff -= armor_buff
xeno.mob_size = MOB_SIZE_XENO //no longer knockback immune
Expand Down Expand Up @@ -313,4 +317,3 @@

/datum/action/xeno_action/onclick/soak/proc/remove_enrage()
owner.remove_filter("steelcrest_enraged")

5 changes: 5 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/hive_status.dm
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,12 @@
spawning_area = pick(totalXenos) // FUCK IT JUST GO ANYWHERE
var/list/turf_list
for(var/turf/open/open_turf in orange(3, spawning_area))
if(istype(open_turf, /turf/open/space))
continue
LAZYADD(turf_list, open_turf)
// just on the off-chance
if(!LAZYLEN(turf_list))
return FALSE
var/turf/open/spawning_turf = pick(turf_list)

var/mob/living/carbon/xenomorph/larva/new_xeno = spawn_hivenumber_larva(spawning_turf, hivenumber)
Expand Down
5 changes: 4 additions & 1 deletion code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,10 @@
/mob/living/launch_towards(datum/launch_metadata/LM)
if(src)
SEND_SIGNAL(src, COMSIG_MOB_MOVE_OR_LOOK, TRUE, dir, dir)
if(!istype(LM) || !LM.target || !src || buckled)
if(!istype(LM) || !LM.target || !src)
return
if(buckled)
LM.invoke_end_throw_callbacks(src)
return
if(pulling)
stop_pulling() //being thrown breaks pulls.
Expand Down
17 changes: 11 additions & 6 deletions code/modules/movement/launching/launching.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@
matching_procs += collision_callbacks[path]
return matching_procs

/// Invoke end_throw_callbacks on this metadata.
/// Takes argument of type /atom/movable
/datum/launch_metadata/proc/invoke_end_throw_callbacks(atom/movable/movable_atom)
if(length(end_throw_callbacks))
for(var/datum/callback/callback as anything in end_throw_callbacks)
if(istype(callback, /datum/callback/dynamic))
callback.Invoke(movable_atom)
else
callback.Invoke()

/atom/movable/var/datum/launch_metadata/launch_metadata = null

//called when src is thrown into hit_atom
Expand Down Expand Up @@ -210,12 +220,7 @@
rebounding = FALSE
cur_speed = old_speed
remove_temp_pass_flags(pass_flags)
if(length(LM.end_throw_callbacks))
for(var/datum/callback/CB as anything in LM.end_throw_callbacks)
if(istype(CB, /datum/callback/dynamic))
CB.Invoke(src)
else
CB.Invoke()
LM.invoke_end_throw_callbacks(src)
QDEL_NULL(launch_metadata)

/atom/movable/proc/throw_random_direction(range, speed = 0, atom/thrower, spin, launch_type = NORMAL_LAUNCH, pass_flags = NO_FLAGS)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/projectiles/gun_attachables.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ Defined in conflicts.dm of the #defines folder.
/obj/item/attachable/proc/Detach(mob/user, obj/item/weapon/gun/detaching_gub)
if(!istype(detaching_gub)) return //Guns only

detaching_gub.on_detach(user)
if(user)
detaching_gub.on_detach(user, src)

if(flags_attach_features & ATTACH_ACTIVATION)
activate_attachment(detaching_gub, null, TRUE)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/gun_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ DEFINES in setup.dm, referenced here.
playsound(user, 'sound/handling/attachment_add.ogg', 15, 1, 4)
return TRUE

/obj/item/weapon/gun/proc/on_detach(obj/item/attachable/attachment)
/obj/item/weapon/gun/proc/on_detach(mob/user, obj/item/attachable/attachment)
return

/obj/item/weapon/gun/proc/update_attachables() //Updates everything. You generally don't need to use this.
Expand Down
54 changes: 32 additions & 22 deletions code/modules/tgs/v5/api.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@

var/reboot_mode = TGS_REBOOT_MODE_NORMAL

/// List of chat messages list()s that attempted to be sent during a topic call. To be bundled in the result of the call
var/list/intercepted_message_queue

/// List of chat messages list()s that attempted to be sent during a topic call. To be bundled in the result of the call
var/list/offline_message_queue

var/list/custom_commands

var/list/test_merges
Expand Down Expand Up @@ -194,17 +198,7 @@
var/datum/tgs_chat_channel/channel = I
ids += channel.id

message2 = UpgradeDeprecatedChatMessage(message2)

if (!length(channels))
return

var/list/data = message2._interop_serialize()
data[DMAPI5_CHAT_MESSAGE_CHANNEL_IDS] = ids
if(intercepted_message_queue)
intercepted_message_queue += list(data)
else
Bridge(DMAPI5_BRIDGE_COMMAND_CHAT_SEND, list(DMAPI5_BRIDGE_PARAMETER_CHAT_MESSAGE = data))
SendChatMessageRaw(message2, ids)

/datum/tgs_api/v5/ChatTargetedBroadcast(datum/tgs_message_content/message2, admin_only)
var/list/channels = list()
Expand All @@ -213,26 +207,42 @@
if (!channel.is_private_channel && ((channel.is_admin_channel && admin_only) || (!channel.is_admin_channel && !admin_only)))
channels += channel.id

SendChatMessageRaw(message2, channels)

/datum/tgs_api/v5/ChatPrivateMessage(datum/tgs_message_content/message2, datum/tgs_chat_user/user)
SendChatMessageRaw(message2, list(user.channel.id))

/datum/tgs_api/v5/proc/SendChatMessageRaw(datum/tgs_message_content/message2, list/channel_ids)
message2 = UpgradeDeprecatedChatMessage(message2)

if (!length(channels))
if (!length(channel_ids))
return

var/list/data = message2._interop_serialize()
data[DMAPI5_CHAT_MESSAGE_CHANNEL_IDS] = channels
data[DMAPI5_CHAT_MESSAGE_CHANNEL_IDS] = channel_ids
if(intercepted_message_queue)
intercepted_message_queue += list(data)
else
Bridge(DMAPI5_BRIDGE_COMMAND_CHAT_SEND, list(DMAPI5_BRIDGE_PARAMETER_CHAT_MESSAGE = data))
return

/datum/tgs_api/v5/ChatPrivateMessage(datum/tgs_message_content/message2, datum/tgs_chat_user/user)
message2 = UpgradeDeprecatedChatMessage(message2)
var/list/data = message2._interop_serialize()
data[DMAPI5_CHAT_MESSAGE_CHANNEL_IDS] = list(user.channel.id)
if(intercepted_message_queue)
intercepted_message_queue += list(data)
if(offline_message_queue)
offline_message_queue += list(data)
return

if(detached)
offline_message_queue = list(data)

WaitForReattach(FALSE)

data = offline_message_queue
offline_message_queue = null

for(var/queued_message in data)
SendChatDataRaw(queued_message)
else
Bridge(DMAPI5_BRIDGE_COMMAND_CHAT_SEND, list(DMAPI5_BRIDGE_PARAMETER_CHAT_MESSAGE = data))
SendChatDataRaw(data)

/datum/tgs_api/v5/proc/SendChatDataRaw(list/data)
Bridge(DMAPI5_BRIDGE_COMMAND_CHAT_SEND, list(DMAPI5_BRIDGE_PARAMETER_CHAT_MESSAGE = data))

/datum/tgs_api/v5/ChatChannelInfo()
RequireInitialBridgeResponse()
Expand Down
4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-5440.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-5443.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-5445.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-5449.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-5451.yml

This file was deleted.

4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-5464.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Birdtalon"
delete-after: True
changes:
- bugfix: "Fixed buckled mobs unable to move after being thrown by a xeno."
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-5470.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Drathek"
delete-after: True
changes:
- code_imp: "Cleaned up some oversights in attachment Detatch logic"
5 changes: 5 additions & 0 deletions html/changelogs/AutoChangeLog-pr-5473.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
author: "SabreML"
delete-after: True
changes:
- rscadd: "Added a 'balloon alert' when toggling Crest Defense as a Defender."
- code_imp: "Made balloon alerts centre themselves on xeno sprites."
19 changes: 19 additions & 0 deletions html/changelogs/archive/2024-01.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,22 @@
- bugfix: removed a light fixture being doubled on trijent
- maptweak: moved some trijent lights in marshals off windows
- maptweak: Alamayer PermaBrig Chairs face the right way
2024-01-16:
Drathek:
- bugfix: Fix all hands on deck message not sending to those in cryopods
Huffie56:
- rscadd: Add the ability to build multi tile assembly from metal sheets.
ItsVyzo:
- balance: m56d loses burst fire
SabreML:
- bugfix: Fixed dead marines being able to man and fire the M56D.
TheGamerdk:
- bugfix: Overwatch now works on Whiskey Outpost again, not that you will use it.
Zonespace27:
- balance: 3 smartgun drums now spawn in the SG's equipment crate. Smartgun drums
cannot be purchased from the SG vendor.
2024-01-17:
SabreML:
- bugfix: Fixed larvae sometimes spawning in space on Fiorina.
TheGamerdk:
- bugfix: The Kutjevo Refinery has been granted an additional SMES
10 changes: 8 additions & 2 deletions maps/map_files/Kutjevo/Kutjevo.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -8549,6 +8549,12 @@
},
/turf/open/auto_turf/sand/layer0,
/area/kutjevo/interior/colony_north)
"lBu" = (
/obj/structure/machinery/power/terminal{
dir = 4
},
/turf/open/floor/kutjevo/multi_tiles,
/area/kutjevo/interior/power)
"lBP" = (
/obj/structure/window/framed/kutjevo/reinforced,
/obj/structure/machinery/door/poddoor/shutters/almayer{
Expand Down Expand Up @@ -25968,7 +25974,7 @@ uGd
fkP
vin
pBV
hQj
lBu
uBz
cvm
hQj
Expand Down Expand Up @@ -26135,7 +26141,7 @@ eyU
dyU
pyp
pyp
hQj
sNp
pyp
xjY
xjY
Expand Down

0 comments on commit 2899baf

Please sign in to comment.