Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Runtime bugfixes bundle №2 #6118

Merged
merged 12 commits into from
Dec 27, 2024
Merged
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
5 changes: 4 additions & 1 deletion code/__HELPERS/_logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,17 @@ GLOBAL_PROTECT(log_end)
var/list/targets = target
for(var/t in targets)
add_attack_logs(user, t, what_done, custom_level)

return

var/user_str
if(ismecha(user?.loc) || isspacepod(user?.loc))
if((user?.loc) && (ismecha(user?.loc) || isspacepod(user?.loc)))
var/obj/vehicle = user.loc
user_str = key_name_log(user) + COORD(vehicle)

else
user_str = key_name_log(user) + COORD(user)

var/target_str
var/target_info
if(isatom(target))
Expand Down
8 changes: 5 additions & 3 deletions code/_onclick/hud/action_button.dm
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,13 @@
icon = initial(icon)
icon_state = "bg_default"
if(user.client) // Apply the client's UI style
icon = ui_style2icon(user.client.prefs.UI_style)
icon = ui_style2icon(user.client.prefs?.UI_style)
icon_state = "template"

if(user.client)
alpha = user.client.prefs.UI_style_alpha
color = user.client.prefs.UI_style_color
alpha = user.client.prefs?.UI_style_alpha
color = user.client.prefs?.UI_style_color

update_icon(UPDATE_OVERLAYS)


Expand Down
8 changes: 7 additions & 1 deletion code/controllers/subsystem/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,19 @@ SUBSYSTEM_DEF(chat)
var/oldest = text2num(client_history[1])
for(var/index in 2 to length(client_history))
var/test = text2num(client_history[index])

if(test < oldest)
oldest = test

client_history -= "[oldest]"

return payload

/datum/controller/subsystem/chat/proc/send_payload_to_client(client/target, datum/chat_payload/payload)
target.tgui_panel.window.send_message("chat/message", payload.into_message())
if(!target || !payload)
return

target.tgui_panel?.window?.send_message("chat/message", payload.into_message())
SEND_TEXT(target, payload.get_content_as_html())

/datum/controller/subsystem/chat/fire()
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/non-firing/titlescreen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ SUBSYSTEM_DEF(title)
var/screen_image_url = SSassets.transport.get_asset_url(asset_cache_item = screen_image)

//hope that client won`t use custom theme
html += {"<body class="[color2tguitheme[winget(viewer, "mainwindow", "background-color")]][viewer.prefs.toggles2 & PREFTOGGLE_2_PIXELATED_MENU ? " pixelated" : ""]" style="background-image: [screen_image_url ? "url([screen_image_url])" : "" ];">"}
html += {"<body class="[color2tguitheme[winget(viewer, "mainwindow", "background-color")]][viewer?.prefs?.toggles2 & PREFTOGGLE_2_PIXELATED_MENU ? " pixelated" : ""]" style="background-image: [screen_image_url ? "url([screen_image_url])" : "" ];">"}

html += {"<input type="checkbox" id="hide_menu">"}

Expand Down
2 changes: 2 additions & 0 deletions code/game/gamemodes/cult/blood_magic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@
/datum/action/innate/cult/blood_spell/Grant(mob/living/owner, datum/action/innate/cult/blood_magic/BM)
if(health_cost)
desc += "<br>Deals <u>[health_cost] damage</u> to your arm per use."

base_desc = desc
desc += "<br><b><u>Has [charges] use\s remaining</u></b>."
all_magic = BM
button.ordered = FALSE

..()

/datum/action/innate/cult/blood_spell/override_location()
Expand Down
35 changes: 23 additions & 12 deletions code/game/gamemodes/wizard/soulstone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -503,37 +503,48 @@
/obj/item/soulstone/proc/init_shade(mob/living/M, mob/user, forced = FALSE)
var/type = get_shade_type()
var/mob/living/simple_animal/shade/S = new type(src)

S.name = "Shade of [M.real_name]"
S.real_name = "Shade of [M.real_name]"
S.key = M.key
S.cancel_camera()

update_appearance(UPDATE_ICON_STATE|UPDATE_NAME)
log_game("[S.key] has become [S.name] with [purified ? "holy" : "corrupted"] essence.")
if(user)
S.faction |= "\ref[user]" //Add the master as a faction, allowing inter-mob cooperation
if(iswizard(user))
SSticker.mode.update_wiz_icons_added(S.mind)
S.mind.special_role = SPECIAL_ROLE_WIZARD_APPRENTICE
if(iscultist(user))
SSticker.mode.add_cultist(S.mind)
S.mind.special_role = SPECIAL_ROLE_CULTIST
S.mind.store_memory("<b>Serve the cult's will.</b>")
to_chat(S, "<span class='userdanger'>Your soul has been captured! You are now bound to the cult's will. Help them succeed in their goals at all costs.</span>")
else
S.mind.store_memory("<b>Serve [user.real_name], your creator.</b>")
to_chat(S, "<span class='userdanger'>Your soul has been captured! You are now bound to [user.real_name]'s will. Help them succeed in their goals at all costs.</span>")

if(S.mind)
if(iswizard(user))
SSticker.mode.update_wiz_icons_added(S.mind)
S.mind.special_role = SPECIAL_ROLE_WIZARD_APPRENTICE

if(iscultist(user))
SSticker.mode.add_cultist(S.mind)
S.mind.special_role = SPECIAL_ROLE_CULTIST
S.mind.store_memory("<b>Serve the cult's will.</b>")
to_chat(S, span_userdanger("Your soul has been captured! You are now bound to the cult's will. Help them succeed in their goals at all costs."))

else
S.mind.store_memory("<b>Serve [user.real_name], your creator.</b>")
to_chat(S, span_userdanger("Your soul has been captured! You are now bound to [user.real_name]'s will. Help them succeed in their goals at all costs."))

if(forced && user)
to_chat(user, "<span class='info'><b>Capture successful!</b>:</span> [M.real_name]'s soul has been ripped from [user.p_their()] body and stored within the soul stone.")
to_chat(user, "[span_info("<b>Capture successful!</b>:")] [M.real_name]'s soul has been ripped from [user.p_their()] body and stored within the soul stone.")

if(isrobot(M))//Robots have to dust or else they spill out an empty robot brain, and unequiping them spills robot components that shouldn't spawn.
M.dust()

else
for(var/obj/item/I in M)
M.drop_item_ground(I)

M.dust()

/obj/item/soulstone/proc/get_shade_type()
if(purified)
return /mob/living/simple_animal/shade/holy

return /mob/living/simple_animal/shade/cult

/obj/item/soulstone/proc/get_cult_ghost(mob/living/M, mob/user, get_new_player = FALSE)
Expand Down
40 changes: 28 additions & 12 deletions code/game/objects/items/devices/whistle.dm
Original file line number Diff line number Diff line change
@@ -1,32 +1,48 @@
/obj/item/hailer
name = "hailer"
desc = "Used by obese officers to save their breath for running."

icon = 'icons/obj/device.dmi'
icon_state = "voice0"
item_state = "flashtool" //looks exactly like a flash (and nothing like a flashbang)

w_class = WEIGHT_CLASS_TINY
flags = CONDUCT

var/spamcheck = 0
var/emagged = 0
COOLDOWN_DECLARE(spamcheck)
var/emagged = FALSE

/obj/item/hailer/attack_self(mob/living/carbon/user as mob)
if(spamcheck)
hail(user)

/obj/item/hailer/proc/hail(mob/living/carbon/user)
if(!COOLDOWN_FINISHED(src, spamcheck))
return

var/sound_to_play
var/message

if(emagged)
playsound(get_turf(src), 'sound/voice/binsult.ogg', 100, 1, vary = 0)//hueheuheuheuheuheuhe
user.visible_message("<span class='warning'>[user]'s [name] gurgles, \"FUCK YOUR CUNT YOU SHIT EATING CUNT TILL YOU ARE A MASS EATING SHIT CUNT. EAT PENISES IN YOUR FUCK FACE AND SHIT OUT ABORTIONS TO FUCK UP SHIT IN YOUR ASS YOU COCK FUCK SHIT MONKEY FROM THE DEPTHS OF SHIT\"</span>")
sound_to_play = 'sound/voice/binsult.ogg'
message = span_warning("[user]'s [name] gurgles, \"FUCK YOUR CUNT YOU SHIT EATING CUNT TILL YOU ARE A MASS EATING SHIT CUNT. EAT PENISES IN YOUR FUCK FACE AND SHIT OUT ABORTIONS TO FUCK UP SHIT IN YOUR ASS YOU COCK FUCK SHIT MONKEY FROM THE DEPTHS OF SHIT\"")

else
playsound(get_turf(src), 'sound/voice/halt.ogg', 100, 1, vary = 0)
user.visible_message("<span class='warning'>[user]'s [name] rasps, \"Halt! Security!\"</span>")
sound_to_play = 'sound/voice/halt.ogg'
message = span_warning("[user]'s [name] rasps, \"Halt! Security!\"")

if(sound_to_play)
playsound(get_turf(src), sound_to_play, 100, 1, vary = FALSE)

if(message)
user.visible_message(message)

spamcheck = 1
spawn(20)
spamcheck = 0
COOLDOWN_START(src, spamcheck, 2 SECONDS)

return

/obj/item/hailer/emag_act(mob/user)
if(!emagged)
if(user)
to_chat(user, "<span class='warning'>You overload \the [src]'s voice synthesizer.</span>")
emagged = 1
to_chat(user, span_warning("You overload \the [src]'s voice synthesizer."))

emagged = TRUE
3 changes: 3 additions & 0 deletions code/modules/assembly/holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,19 @@
/obj/item/assembly_holder/proc/process_activation(obj/D, normal = TRUE, special = TRUE, mob/user)
if(!D)
return FALSE

if(normal && a_right && a_left)
if(a_right != D)
a_right.pulsed()
if(a_left != D)
a_left.pulsed()

if(master)
var/datum/signal/signal = new
signal.source = src
signal.user = user
master.receive_signal(signal)

return TRUE


Expand Down
8 changes: 4 additions & 4 deletions code/modules/events/abductor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
processing = 0 //so it won't fire again in next tick
if(!makeAbductorTeam())
message_admins("Abductor event failed to find players. Retrying in 30s.")
spawn(300)
makeAbductorTeam()
addtimer(CALLBACK(src, PROC_REF(makeAbductorTeam)), 30 SECONDS)

/datum/event/abductor/proc/get_teams_num()
return min(round(num_station_players() / for_players) + 1, game_mode_ref.max_teams)

/datum/event/abductor/proc/makeAbductorTeam()
var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Вы хотите занять роль Абдуктора?", ROLE_ABDUCTOR, TRUE)

if(length(candidates) < 2)
if(LAZYLEN(candidates) < 2)
return FALSE

if(SSticker.mode.config_tag == "abduction")
Expand All @@ -26,7 +25,7 @@

var/num_teams = get_teams_num()
for(var/i in 1 to num_teams)
if(length(candidates) < 2)
if(LAZYLEN(candidates) < 2)
break

var/number = SSticker.mode.abductor_teams + 1
Expand Down Expand Up @@ -54,6 +53,7 @@

if(SSticker.mode.config_tag != "abduction")
SSticker.mode.abductors |= game_mode_ref.abductors

processing = 1
return TRUE

Expand Down
6 changes: 3 additions & 3 deletions code/modules/events/tear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
animation.icon_state = "newtear"
animation.icon = 'icons/effects/tear.dmi'
animation.master = src
spawn(15)
if(animation)
qdel(animation)

if(animation)
addtimer(CALLBACK(GLOBAL_PROC, /proc/qdel, animation), 1.5 SECONDS)

addtimer(CALLBACK(src, PROC_REF(spew_critters)), rand(30, 120))

Expand Down
Loading
Loading