From d1240309596c32d0b9ebbdf369d19b892990e99f Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sun, 16 Feb 2025 16:41:59 -0300 Subject: [PATCH 1/4] playing it safe --- code/_onclick/hud/action_button.dm | 2 +- code/_onclick/hud/alert.dm | 2 +- code/_onclick/hud/credits.dm | 13 +++++++------ code/_onclick/hud/families.dm | 2 +- code/_onclick/hud/new_player.dm | 6 +++--- code/_onclick/hud/picture_in_picture.dm | 8 ++++---- code/_onclick/hud/plane_master.dm | 14 +++++++------- code/_onclick/hud/screen_objects.dm | 6 +++--- code/_onclick/hud/screen_objects/clickdelay.dm | 2 +- code/_onclick/hud/screen_objects/storage.dm | 14 +++++++------- code/_onclick/hud/screentip.dm | 3 +-- code/modules/mob/living/silicon/ai/multicam.dm | 2 +- 12 files changed, 37 insertions(+), 37 deletions(-) diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm index 05c16c12ed..cb88f56dcb 100644 --- a/code/_onclick/hud/action_button.dm +++ b/code/_onclick/hud/action_button.dm @@ -213,7 +213,7 @@ our_hud = null return ..() -/atom/movable/screen/button_palette/Initialize(mapload) +/atom/movable/screen/button_palette/Initialize(mapload, datum/hud/hud_owner) . = ..() update_appearance() diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 4475d2a117..7f34f1ebbc 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -512,7 +512,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." var/angle = 0 var/mob/living/simple_animal/hostile/construct/Cviewer = null -/atom/movable/screen/alert/bloodsense/Initialize(mapload) +/atom/movable/screen/alert/bloodsense/Initialize(mapload, datum/hud/hud_owner) . = ..() narnar = new('icons/mob/screen_alert.dmi', "mini_nar") START_PROCESSING(SSprocessing, src) diff --git a/code/_onclick/hud/credits.dm b/code/_onclick/hud/credits.dm index 73986095de..eb6bdfe995 100644 --- a/code/_onclick/hud/credits.dm +++ b/code/_onclick/hud/credits.dm @@ -39,7 +39,7 @@ var/client/parent var/matrix/target -/atom/movable/screen/credit/Initialize(mapload, credited, client/P, icon/I) +/atom/movable/screen/credit/Initialize(mapload, datum/hud/hud_owner, credited, client/P, icon/I) . = ..() icon = I parent = P @@ -55,14 +55,15 @@ animate(src, alpha = 255, time = CREDIT_EASE_DURATION, flags = ANIMATION_PARALLEL) addtimer(CALLBACK(src, PROC_REF(FadeOut)), CREDIT_ROLL_SPEED - CREDIT_EASE_DURATION) QDEL_IN(src, CREDIT_ROLL_SPEED) - P.screen += src + if(parent) + parent.screen += src /atom/movable/screen/credit/Destroy() - var/client/P = parent - P.screen -= src icon = null - LAZYREMOVE(P.credits, src) - parent = null + if(parent) + parent.screen -= src + LAZYREMOVE(parent.credits, src) + parent = null return ..() /atom/movable/screen/credit/proc/FadeOut() diff --git a/code/_onclick/hud/families.dm b/code/_onclick/hud/families.dm index 81da541011..af2f432aaf 100644 --- a/code/_onclick/hud/families.dm +++ b/code/_onclick/hud/families.dm @@ -9,7 +9,7 @@ /// Boolean, have the cops arrived? If so, the icon stops changing and remains the same. var/cops_arrived = 0 -/atom/movable/screen/wanted/Initialize(mapload) +/atom/movable/screen/wanted/Initialize(mapload, datum/hud/hud_owner) . = ..() update_icon() diff --git a/code/_onclick/hud/new_player.dm b/code/_onclick/hud/new_player.dm index e58d330eae..f1e12bccdd 100644 --- a/code/_onclick/hud/new_player.dm +++ b/code/_onclick/hud/new_player.dm @@ -221,7 +221,7 @@ ///Whether we are readied up for the round or not var/ready = FALSE -/atom/movable/screen/lobby/button/ready/Initialize(mapload) +/atom/movable/screen/lobby/button/ready/Initialize(mapload, datum/hud/hud_owner) . = ..() switch(SSticker.current_state) if(GAME_STATE_PREGAME, GAME_STATE_STARTUP) @@ -268,7 +268,7 @@ base_icon_state = "join_game" enabled = null // set in init -/atom/movable/screen/lobby/button/join/Initialize(mapload) +/atom/movable/screen/lobby/button/join/Initialize(mapload, datum/hud/hud_owner) . = ..() switch(SSticker.current_state) if(GAME_STATE_PREGAME, GAME_STATE_STARTUP) @@ -333,7 +333,7 @@ base_icon_state = "observe" enabled = null // set in init -/atom/movable/screen/lobby/button/observe/Initialize(mapload) +/atom/movable/screen/lobby/button/observe/Initialize(mapload, datum/hud/hud_owner) . = ..() if(SSticker.current_state > GAME_STATE_STARTUP) set_button_status(TRUE) diff --git a/code/_onclick/hud/picture_in_picture.dm b/code/_onclick/hud/picture_in_picture.dm index 354a6ed546..2a23a63c50 100644 --- a/code/_onclick/hud/picture_in_picture.dm +++ b/code/_onclick/hud/picture_in_picture.dm @@ -14,7 +14,7 @@ var/mutable_appearance/standard_background var/const/max_dimensions = 10 -/atom/movable/screen/movable/pic_in_pic/Initialize(mapload) +/atom/movable/screen/movable/pic_in_pic/Initialize(mapload, datum/hud/hud_owner) . = ..() make_backgrounds() @@ -55,7 +55,7 @@ add_overlay(move_tab) if(!button_x) - button_x = new /atom/movable/screen/component_button(null, src) + button_x = new /atom/movable/screen/component_button(null, hud, src) var/mutable_appearance/MA = new /mutable_appearance() MA.name = "close" MA.icon = 'icons/misc/pic_in_pic.dmi' @@ -68,7 +68,7 @@ vis_contents += button_x if(!button_expand) - button_expand = new /atom/movable/screen/component_button(null, src) + button_expand = new /atom/movable/screen/component_button(null, hud, src) var/mutable_appearance/MA = new /mutable_appearance() MA.name = "expand" MA.icon = 'icons/misc/pic_in_pic.dmi' @@ -81,7 +81,7 @@ vis_contents += button_expand if(!button_shrink) - button_shrink = new /atom/movable/screen/component_button(null, src) + button_shrink = new /atom/movable/screen/component_button(null, hud, src) var/mutable_appearance/MA = new /mutable_appearance() MA.name = "shrink" MA.icon = 'icons/misc/pic_in_pic.dmi' diff --git a/code/_onclick/hud/plane_master.dm b/code/_onclick/hud/plane_master.dm index 3d39440dad..2db71a7258 100644 --- a/code/_onclick/hud/plane_master.dm +++ b/code/_onclick/hud/plane_master.dm @@ -24,7 +24,7 @@ blend_mode = BLEND_MULTIPLY alpha = 255 -/atom/movable/screen/plane_master/openspace/Initialize(mapload) +/atom/movable/screen/plane_master/openspace/Initialize(mapload, datum/hud/hud_owner) . = ..() filters += filter(type="alpha", render_source=FIELD_OF_VISION_RENDER_TARGET, flags=MASK_INVERSE) @@ -61,7 +61,7 @@ plane = ABOVE_WALL_PLANE appearance_flags = PLANE_MASTER -/atom/movable/screen/plane_master/above_wall/Initialize(mapload) +/atom/movable/screen/plane_master/above_wall/Initialize(mapload, datum/hud/hud_owner) . = ..() add_filter("vision_cone", 100, list(type="alpha", render_source=FIELD_OF_VISION_RENDER_TARGET, flags=MASK_INVERSE)) @@ -78,7 +78,7 @@ appearance_flags = PLANE_MASTER //should use client color blend_mode = BLEND_OVERLAY -/atom/movable/screen/plane_master/game_world/Initialize(mapload) +/atom/movable/screen/plane_master/game_world/Initialize(mapload, datum/hud/hud_owner) . = ..() add_filter("vision_cone", 100, list(type="alpha", render_source=FIELD_OF_VISION_RENDER_TARGET, flags=MASK_INVERSE)) @@ -95,7 +95,7 @@ render_target = FIELD_OF_VISION_RENDER_TARGET mouse_opacity = MOUSE_OPACITY_TRANSPARENT -/atom/movable/screen/plane_master/field_of_vision/Initialize(mapload) +/atom/movable/screen/plane_master/field_of_vision/Initialize(mapload, datum/hud/hud_owner) . = ..() filters += filter(type="alpha", render_source=FIELD_OF_VISION_BLOCKER_RENDER_TARGET, flags=MASK_INVERSE) @@ -112,7 +112,7 @@ plane = FIELD_OF_VISION_VISUAL_PLANE mouse_opacity = MOUSE_OPACITY_TRANSPARENT -/atom/movable/screen/plane_master/field_of_vision_visual/Initialize(mapload) +/atom/movable/screen/plane_master/field_of_vision_visual/Initialize(mapload, datum/hud/hud_owner) . = ..() filters += filter(type="alpha", render_source=FIELD_OF_VISION_BLOCKER_RENDER_TARGET, flags=MASK_INVERSE) @@ -138,7 +138,7 @@ * This is then used to alpha mask the lighting plane. */ -/atom/movable/screen/plane_master/lighting/Initialize(mapload) +/atom/movable/screen/plane_master/lighting/Initialize(mapload, datum/hud/hud_owner) . = ..() add_filter("emissives", 1, alpha_mask_filter(render_source = EMISSIVE_RENDER_TARGET, flags = MASK_INVERSE)) add_filter("object_lighting", 2, alpha_mask_filter(render_source = O_LIGHTING_VISUAL_RENDER_TARGET, flags = MASK_INVERSE)) @@ -152,7 +152,7 @@ mouse_opacity = MOUSE_OPACITY_TRANSPARENT render_target = EMISSIVE_RENDER_TARGET -/atom/movable/screen/plane_master/emissive/Initialize(mapload) +/atom/movable/screen/plane_master/emissive/Initialize(mapload, datum/hud/hud_owner) . = ..() add_filter("em_block_masking", 1, color_matrix_filter(GLOB.em_mask_matrix)) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 5b6d6c6387..ace6303c03 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -279,7 +279,7 @@ // plane = ABOVE_HUD_PLANE // icon_state = "backpack_close" -// /atom/movable/screen/close/Initialize(mapload, new_master) +// /atom/movable/screen/close/Initialize(mapload, datum/hud/hud_owner, new_master) // . = ..() // master = new_master @@ -341,7 +341,7 @@ icon_state = "running" mouse_over_pointer = MOUSE_HAND_POINTER -/atom/movable/screen/mov_intent/Initialize(mapload) +/atom/movable/screen/mov_intent/Initialize(mapload, datum/hud/hud_owner) . = ..() update_icon() @@ -701,7 +701,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/splash) mouse_over_pointer = MOUSE_HAND_POINTER var/atom/movable/screen/parent -/atom/movable/screen/component_button/Initialize(mapload, atom/movable/screen/parent) +/atom/movable/screen/component_button/Initialize(mapload, datum/hud/hud_owner, atom/movable/screen/parent) . = ..() src.parent = parent diff --git a/code/_onclick/hud/screen_objects/clickdelay.dm b/code/_onclick/hud/screen_objects/clickdelay.dm index b8258c7598..dc6c3e0da7 100644 --- a/code/_onclick/hud/screen_objects/clickdelay.dm +++ b/code/_onclick/hud/screen_objects/clickdelay.dm @@ -25,7 +25,7 @@ icon_state = "prog_bar_100" layer = 20 // under hand buttons -/atom/movable/screen/action_bar/clickdelay/Initialize(mapload) +/atom/movable/screen/action_bar/clickdelay/Initialize(mapload, datum/hud/hud_owner) . = ..() var/matrix/M = new M.Scale(2, 1) diff --git a/code/_onclick/hud/screen_objects/storage.dm b/code/_onclick/hud/screen_objects/storage.dm index cc96cf25e3..16804c1a78 100644 --- a/code/_onclick/hud/screen_objects/storage.dm +++ b/code/_onclick/hud/screen_objects/storage.dm @@ -2,7 +2,7 @@ name = "storage" var/insertion_click = FALSE -/atom/movable/screen/storage/Initialize(mapload, datum/hud/hud, new_master) +/atom/movable/screen/storage/Initialize(mapload, datum/hud/hud_owner, new_master) . = ..() master = new_master @@ -55,7 +55,7 @@ plane = VOLUMETRIC_STORAGE_BOX_PLANE var/obj/item/our_item -/atom/movable/screen/storage/volumetric_box/Initialize(mapload, datum/hud/hud, new_master, obj/item/our_item) +/atom/movable/screen/storage/volumetric_box/Initialize(mapload, datum/hud/hud_owner, new_master, obj/item/our_item) src.our_item = our_item RegisterSignal(our_item, COMSIG_ITEM_MOUSE_ENTER, PROC_REF(on_item_mouse_enter)) RegisterSignal(our_item, COMSIG_ITEM_MOUSE_EXIT, PROC_REF(on_item_mouse_exit)) @@ -97,9 +97,9 @@ var/atom/movable/screen/storage/item_holder/holder var/pixel_size -/atom/movable/screen/storage/volumetric_box/center/Initialize(mapload, datum/hud/hud, new_master, our_item) - left = new(null, hud, src, our_item) - right = new(null, hud, src, our_item) +/atom/movable/screen/storage/volumetric_box/center/Initialize(mapload, datum/hud/hud_owner, new_master, our_item) + left = new(null, hud_owner, src, our_item) + right = new(null, hud_owner, src, our_item) return ..() /atom/movable/screen/storage/volumetric_box/center/Destroy() @@ -155,7 +155,7 @@ layer = VOLUMETRIC_STORAGE_BOX_LAYER plane = VOLUMETRIC_STORAGE_BOX_PLANE -/atom/movable/screen/storage/volumetric_edge/Initialize(mapload, datum/hud/hud, master, our_item) +/atom/movable/screen/storage/volumetric_edge/Initialize(mapload, datum/hud/hud_owner, master, our_item) src.master = master return ..() @@ -183,7 +183,7 @@ var/obj/item/our_item vis_flags = NONE -/atom/movable/screen/storage/item_holder/Initialize(mapload, datum/hud/hud, new_master, obj/item/I) +/atom/movable/screen/storage/item_holder/Initialize(mapload, datum/hud/hud_owner, new_master, obj/item/I) . = ..() our_item = I vis_contents += I diff --git a/code/_onclick/hud/screentip.dm b/code/_onclick/hud/screentip.dm index b9b27072b3..beb705133b 100644 --- a/code/_onclick/hud/screentip.dm +++ b/code/_onclick/hud/screentip.dm @@ -8,9 +8,8 @@ maptext = "" layer = SCREENTIP_LAYER -/atom/movable/screen/screentip/Initialize(mapload, _hud) +/atom/movable/screen/screentip/Initialize(mapload, datum/hud/hud_owner) . = ..() - hud = _hud update_view() /atom/movable/screen/screentip/proc/update_view(datum/source) diff --git a/code/modules/mob/living/silicon/ai/multicam.dm b/code/modules/mob/living/silicon/ai/multicam.dm index b48b39a885..de96327540 100644 --- a/code/modules/mob/living/silicon/ai/multicam.dm +++ b/code/modules/mob/living/silicon/ai/multicam.dm @@ -6,7 +6,7 @@ var/highlighted = FALSE var/mob/camera/aiEye/pic_in_pic/aiEye -/atom/movable/screen/movable/pic_in_pic/ai/Initialize(mapload) +/atom/movable/screen/movable/pic_in_pic/ai/Initialize(mapload, datum/hud/hud_owner) . = ..() aiEye = new /mob/camera/aiEye/pic_in_pic() aiEye.screen = src From 1a694d09dea68685a27e8ac508929e539af829f7 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sun, 16 Feb 2025 17:28:29 -0300 Subject: [PATCH 2/4] yeah --- .../modules/clothing/spacesuits/chronosuit.dm | 94 +++++++++---------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/code/modules/clothing/spacesuits/chronosuit.dm b/code/modules/clothing/spacesuits/chronosuit.dm index f5c2c44f58..9e387dab3f 100644 --- a/code/modules/clothing/spacesuits/chronosuit.dm +++ b/code/modules/clothing/spacesuits/chronosuit.dm @@ -11,7 +11,7 @@ /obj/item/clothing/head/helmet/space/chronos/dropped(mob/user) if(suit) suit.deactivate(1, 1) - ..() + return ..() /obj/item/clothing/suit/space/chronos name = "Chronosuit" @@ -23,23 +23,22 @@ resistance_flags = FIRE_PROOF | ACID_PROOF mutantrace_variation = STYLE_DIGITIGRADE var/list/chronosafe_items = list(/obj/item/chrono_eraser, /obj/item/gun/energy/chrono_gun) - var/obj/item/clothing/head/helmet/space/chronos/helmet = null - var/obj/effect/chronos_cam/camera = null - var/datum/action/innate/chrono_teleport/teleport_now = new + var/obj/item/clothing/head/helmet/space/chronos/helmet + var/obj/effect/chronos_cam/camera + var/datum/action/innate/chrono_teleport/teleport_now var/activating = 0 var/activated = 0 - var/cooldowntime = 50 //deciseconds + var/cooldowntime = 5 SECONDS var/teleporting = 0 var/phase_timer_id -/obj/item/clothing/suit/space/chronos/New() - ..() +/obj/item/clothing/suit/space/chronos/Initialize(mapload) + . = ..() + teleport_now = new(src) teleport_now.chronosuit = src - teleport_now.target = src /obj/item/clothing/suit/space/chronos/proc/new_camera(mob/user) - if(camera) - qdel(camera) + QDEL_NULL(camera) camera = new /obj/effect/chronos_cam(user) camera.holder = user camera.chronosuit = src @@ -55,7 +54,7 @@ /obj/item/clothing/suit/space/chronos/dropped(mob/user) if(activated) deactivate() - ..() + return ..() /obj/item/clothing/suit/space/chronos/emp_act(severity) . = ..() @@ -64,8 +63,8 @@ var/mob/living/carbon/human/user = src.loc if(severity >= 70) if(activated && user && ishuman(user) && (user.wear_suit == src)) - to_chat(user, "E:FATAL:RAM_READ_FAIL\nE:FATAL:STACK_EMPTY\nE:FATAL:READ_NULL_POINT\nE:FATAL:PWR_BUS_OVERLOAD") - to_chat(user, "An electromagnetic pulse disrupts your [name] and violently tears you out of time-bluespace!") + to_chat(user, span_danger("E:FATAL:RAM_READ_FAIL\nE:FATAL:STACK_EMPTY\nE:FATAL:READ_NULL_POINT\nE:FATAL:PWR_BUS_OVERLOAD")) + to_chat(user, span_userdanger("An electromagnetic pulse disrupts your [name] and violently tears you out of time-bluespace!")) user.emote("scream") deactivate(1, 1) @@ -75,23 +74,24 @@ if(phase_timer_id) deltimer(phase_timer_id) phase_timer_id = 0 - if(istype(user)) - if(to_turf) - user.forceMove(to_turf) - user.SetStun(0) - user.SetNextAction(0, considered_action = FALSE, immediate = FALSE) - user.alpha = 255 - user.update_atom_colour() - user.animate_movement = FORWARD_STEPS - user.mob_transforming = 0 - user.anchored = FALSE - teleporting = 0 - for(var/obj/item/I in user.held_items) - REMOVE_TRAIT(I, TRAIT_NODROP, CHRONOSUIT_TRAIT) - if(camera) - camera.remove_target_ui() - camera.forceMove(user) - teleport_now.UpdateButtons() + if(!istype(user)) + return + if(to_turf) + user.forceMove(to_turf) + user.SetStun(0) + user.SetNextAction(0, considered_action = FALSE, immediate = FALSE) + user.alpha = 255 + user.update_atom_colour() + user.animate_movement = FORWARD_STEPS + user.mob_transforming = 0 + user.anchored = FALSE + teleporting = 0 + for(var/obj/item/I in user.held_items) + REMOVE_TRAIT(I, TRAIT_NODROP, CHRONOSUIT_TRAIT) + if(camera) + camera.remove_target_ui() + camera.forceMove(user) + teleport_now.UpdateButtons() /obj/item/clothing/suit/space/chronos/proc/chronowalk(atom/location) var/mob/living/carbon/human/user = src.loc @@ -238,7 +238,7 @@ var/mob/holder = null var/phase_time = 0 var/phase_time_length = 3 - var/atom/movable/screen/chronos_target/target_ui = null + var/atom/movable/screen/chronos_target/target_ui var/obj/item/clothing/suit/space/chronos/chronosuit /obj/effect/chronos_cam/singularity_act() @@ -249,17 +249,14 @@ /obj/effect/chronos_cam/proc/create_target_ui() if(holder && holder.client && chronosuit) - if(target_ui) - remove_target_ui() - target_ui = new(null, holder) + remove_target_ui() + target_ui = new(null, holder.hud_used, holder) holder.client.screen += target_ui /obj/effect/chronos_cam/proc/remove_target_ui() - if(target_ui) - qdel(target_ui) - target_ui = null + QDEL_NULL(target_ui) -/obj/effect/chronos_cam/relaymove(var/mob/user, direction) +/obj/effect/chronos_cam/relaymove(mob/user, direction) if(!holder) qdel(src) return @@ -305,13 +302,13 @@ color = "#ff3311" blend_mode = BLEND_SUBTRACT -/atom/movable/screen/chronos_target/New(loc, var/mob/living/carbon/human/user) - if(user) - var/icon/user_icon = getFlatIcon(user) - icon = user_icon - transform = user.transform - else - qdel(src) +/atom/movable/screen/chronos_target/Initialize(mapload, datum/hud/hud_owner, mob/living/carbon/human/user) + . = ..() + if(!user) + return INITIALIZE_HINT_QDEL + var/icon/user_icon = getFlatIcon(user) + icon = user_icon + transform = user.transform /datum/action/innate/chrono_teleport name = "Teleport Now" @@ -324,6 +321,7 @@ return (chronosuit && chronosuit.activated && chronosuit.camera && !chronosuit.teleporting) /datum/action/innate/chrono_teleport/Activate() - if(IsAvailable()) - if(chronosuit.camera) - chronosuit.chronowalk(chronosuit.camera) + if(!IsAvailable()) + return + if(chronosuit.camera) + chronosuit.chronowalk(chronosuit.camera) From 662c230490ce4dc0b5a2f84962988060e22bffd7 Mon Sep 17 00:00:00 2001 From: softcerv <100518708+sheepishgoat@users.noreply.github.com> Date: Mon, 17 Feb 2025 01:25:27 -0500 Subject: [PATCH 3/4] removes trying to access sounds that aren't there --- code/game/turfs/open/floor/catwalk_plating.dm | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/game/turfs/open/floor/catwalk_plating.dm b/code/game/turfs/open/floor/catwalk_plating.dm index ac0f3b63de..833bcdf60b 100644 --- a/code/game/turfs/open/floor/catwalk_plating.dm +++ b/code/game/turfs/open/floor/catwalk_plating.dm @@ -13,9 +13,6 @@ desc = "Flooring that shows its contents underneath. Engineers love it!" baseturfs = /turf/open/floor/plating footstep = FOOTSTEP_CATWALK - barefootstep = FOOTSTEP_CATWALK - clawfootstep = FOOTSTEP_CATWALK - heavyfootstep = FOOTSTEP_CATWALK intact = FALSE var/covered = TRUE From 3425760ceda539d42b92f1a200afe1c8ec49ddd2 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Tue, 25 Feb 2025 17:48:02 -0300 Subject: [PATCH 4/4] push --- code/__HELPERS/admin.dm | 9 +++++++ code/datums/action.dm | 2 +- code/datums/components/rotation.dm | 2 +- code/game/atoms.dm | 3 ++- code/game/atoms_movable.dm | 2 +- code/game/objects/obj_defense.dm | 12 +++++----- .../objects/structures/beds_chairs/chair.dm | 6 ++--- code/modules/admin/admin_ranks.dm | 12 +++------- code/modules/admin/holder2.dm | 24 +++++-------------- code/modules/assembly/mousetrap.dm | 4 ++-- code/modules/client/preferences.dm | 4 ++-- code/modules/holodeck/items.dm | 4 ++-- .../mob/living/carbon/monkey/combat.dm | 2 +- code/modules/mob/living/living_defense.dm | 13 ++++++---- .../mob/living/simple_animal/bot/honkbot.dm | 2 +- .../mob/living/simple_animal/bot/secbot.dm | 2 +- .../hostile/mining_mobs/mining_mobs.dm | 10 ++++---- .../living/simple_animal/hostile/mushroom.dm | 8 +++---- .../crossbreeding/_status_effects.dm | 9 +++---- code/modules/vending/_vending.dm | 8 +++---- tgstation.dme | 1 + 21 files changed, 69 insertions(+), 70 deletions(-) create mode 100644 code/__HELPERS/admin.dm diff --git a/code/__HELPERS/admin.dm b/code/__HELPERS/admin.dm new file mode 100644 index 0000000000..63df20ce46 --- /dev/null +++ b/code/__HELPERS/admin.dm @@ -0,0 +1,9 @@ +/// Returns if the given client is an admin, REGARDLESS of if they're deadminned or not. +/proc/is_admin(client/client) + return !isnull(GLOB.admin_datums[client.ckey]) || !isnull(GLOB.deadmins[client.ckey]) + +/// Sends a message in the event that someone attempts to elevate their permissions through invoking a certain proc. +/proc/alert_to_permissions_elevation_attempt(mob/user) + var/message = " has tried to elevate permissions!" + message_admins(key_name_admin(user) + message) + log_admin(key_name(user) + message) diff --git a/code/datums/action.dm b/code/datums/action.dm index 77d6b78917..a4bd371c1e 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -93,7 +93,7 @@ if(!hud.mymob) continue HideFrom(hud.mymob) - LAZYREMOVE(remove_from.actions, src) // We aren't always properly inserted into the viewers list, gotta make sure that action's cleared + LAZYREMOVE(remove_from?.actions, src) // We aren't always properly inserted into the viewers list, gotta make sure that action's cleared viewers = list() if(isnull(owner)) diff --git a/code/datums/components/rotation.dm b/code/datums/components/rotation.dm index 8eb37eabdf..043e2f8f18 100644 --- a/code/datums/components/rotation.dm +++ b/code/datums/components/rotation.dm @@ -13,7 +13,7 @@ var/rotation_flags = NONE var/default_rotation_direction = ROTATION_CLOCKWISE -/datum/component/simple_rotation/Initialize(rotation_flags = NONE ,can_user_rotate,can_be_rotated,after_rotation) +/datum/component/simple_rotation/Initialize(rotation_flags = NONE, can_user_rotate, can_be_rotated, after_rotation) if(!ismovable(parent)) return COMPONENT_INCOMPATIBLE diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 0eaba60ba8..6c1b085e0c 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -702,7 +702,8 @@ /atom/proc/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) SEND_SIGNAL(src, COMSIG_ATOM_HITBY, hitting_atom, skipcatch, hitpush, blocked, throwingdatum) if(density && !has_gravity(hitting_atom)) //thrown stuff bounces off dense stuff in no grav, unless the thrown stuff ends up inside what it hit(embedding, bola, etc...). - addtimer(CALLBACK(src, PROC_REF(hitby_react), hitting_atom), 2) + addtimer(CALLBACK(src, PROC_REF(hitby_react), hitting_atom), 0.2 SECONDS) + return FALSE /** * We have have actually hit the passed in atom diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index df751a114a..7d1bda4340 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -389,7 +389,7 @@ /atom/movable/hitby(atom/movable/hitting_atom, skipcatch, hitpush = TRUE, blocked, datum/thrownthing/throwingdatum) if(!anchored && hitpush && (!throwingdatum || (throwingdatum.force >= (move_resist * MOVE_FORCE_PUSH_RATIO)))) step(src, hitting_atom.dir) - ..() + return ..() /atom/movable/proc/safe_throw_at(atom/target, range, speed, mob/thrower, spin = TRUE, diagonals_first = FALSE, datum/callback/callback, force = MOVE_FORCE_STRONG, gentle = FALSE) if((force < (move_resist * MOVE_FORCE_THROW_RATIO)) || (move_resist == INFINITY)) diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index 831041db91..a14d207423 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -47,14 +47,14 @@ if(BURN) playsound(src.loc, 'sound/items/welder.ogg', 100, 1) -/obj/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) +/obj/hitby(atom/movable/hit_by, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) ..() - var/throwdamage = AM.throwforce - if(isobj(AM)) - var/obj/O = AM - if(O.damtype == STAMINA) + var/throwdamage = hit_by.throwforce + if(isobj(hit_by)) + var/obj/as_obj = hit_by + if(as_obj.damtype == STAMINA) throwdamage = 0 - take_damage(throwdamage, BRUTE, MELEE, 1, get_dir(src, AM)) + take_damage(throwdamage, BRUTE, MELEE, 1, get_dir(src, hit_by)) /obj/ex_act(severity, target, origin) if(resistance_flags & INDESTRUCTIBLE) diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index ba854e7ec2..f0cb2c22d0 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -17,9 +17,9 @@ /obj/structure/chair/examine(mob/user) . = ..() - . += "It's held together by a couple of bolts." + . += span_notice("It's held together by a couple of bolts.") if(!has_buckled_mobs()) - . += "Drag your sprite to sit in it." + . += span_notice("Drag your sprite to sit in it.") /obj/structure/chair/Initialize(mapload) . = ..() @@ -28,7 +28,7 @@ /obj/structure/chair/ComponentInitialize() . = ..() - AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE, CALLBACK(src, PROC_REF(can_user_rotate),CALLBACK(src), PROC_REF(can_be_rotated)),null) + AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE, CALLBACK(src, PROC_REF(can_user_rotate)), CALLBACK(src, PROC_REF(can_be_rotated)), null) /obj/structure/chair/proc/can_be_rotated(mob/user) return TRUE diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm index 79ba4abae7..08cfbe3218 100644 --- a/code/modules/admin/admin_ranks.dm +++ b/code/modules/admin/admin_ranks.dm @@ -13,9 +13,7 @@ GLOBAL_PROTECT(protected_ranks) /datum/admin_rank/New(init_name, init_rights, init_exclude_rights, init_edit_rights) if(IsAdminAdvancedProcCall()) - var/msg = " has tried to elevate permissions!" - message_admins("[key_name_admin(usr)][msg]") - log_admin("[key_name(usr)][msg]") + alert_to_permissions_elevation_attempt(usr) if (name == "NoRank") //only del if this is a true creation (and not just a New() proc call), other wise trialmins/coders could abuse this to deadmin other admins QDEL_IN(src, 0) CRASH("Admin proc call creation of admin datum") @@ -35,9 +33,7 @@ GLOBAL_PROTECT(protected_ranks) /datum/admin_rank/Destroy() if(IsAdminAdvancedProcCall()) - var/msg = " has tried to elevate permissions!" - message_admins("[key_name_admin(usr)][msg]") - log_admin("[key_name(usr)][msg]") + alert_to_permissions_elevation_attempt(usr) return QDEL_HINT_LETMELIVE . = ..() @@ -93,9 +89,7 @@ GLOBAL_PROTECT(protected_ranks) // Adds/removes rights to this admin_rank /datum/admin_rank/proc/process_keyword(word, previous_rights=0) if(IsAdminAdvancedProcCall()) - var/msg = " has tried to elevate permissions!" - message_admins("[key_name_admin(usr)][msg]") - log_admin("[key_name(usr)][msg]") + alert_to_permissions_elevation_attempt(usr) return var/flag = admin_keyword_to_flag(word, previous_rights) if(flag) diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index ea16283070..2bd6dc9236 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -40,9 +40,7 @@ GLOBAL_PROTECT(href_token) /datum/admins/New(datum/admin_rank/R, ckey, force_active = FALSE, protected) if(IsAdminAdvancedProcCall()) - var/msg = " has tried to elevate permissions!" - message_admins("[key_name_admin(usr)][msg]") - log_admin("[key_name(usr)][msg]") + alert_to_permissions_elevation_attempt(usr) if (!target) //only del if this is a true creation (and not just a New() proc call), other wise trialmins/coders could abuse this to deadmin other admins QDEL_IN(src, 0) CRASH("Admin proc call creation of admin datum") @@ -70,17 +68,13 @@ GLOBAL_PROTECT(href_token) /datum/admins/Destroy() if(IsAdminAdvancedProcCall()) - var/msg = " has tried to elevate permissions!" - message_admins("[key_name_admin(usr)][msg]") - log_admin("[key_name(usr)][msg]") + alert_to_permissions_elevation_attempt(usr) return QDEL_HINT_LETMELIVE . = ..() /datum/admins/proc/activate() if(IsAdminAdvancedProcCall()) - var/msg = " has tried to elevate permissions!" - message_admins("[key_name_admin(usr)][msg]") - log_admin("[key_name(usr)][msg]") + alert_to_permissions_elevation_attempt(usr) return GLOB.deadmins -= target GLOB.admin_datums[target] = src @@ -91,9 +85,7 @@ GLOBAL_PROTECT(href_token) /datum/admins/proc/deactivate() if(IsAdminAdvancedProcCall()) - var/msg = " has tried to elevate permissions!" - message_admins("[key_name_admin(usr)][msg]") - log_admin("[key_name(usr)][msg]") + alert_to_permissions_elevation_attempt(usr) return GLOB.deadmins[target] = src GLOB.admin_datums -= target @@ -105,9 +97,7 @@ GLOBAL_PROTECT(href_token) /datum/admins/proc/associate(client/C) if(IsAdminAdvancedProcCall()) - var/msg = " has tried to elevate permissions!" - message_admins("[key_name_admin(usr)][msg]") - log_admin("[key_name(usr)][msg]") + alert_to_permissions_elevation_attempt(usr) return if(istype(C)) @@ -127,9 +117,7 @@ GLOBAL_PROTECT(href_token) /datum/admins/proc/disassociate() if(IsAdminAdvancedProcCall()) - var/msg = " has tried to elevate permissions!" - message_admins("[key_name_admin(usr)][msg]") - log_admin("[key_name(usr)][msg]") + alert_to_permissions_elevation_attempt(usr) return if(owner) GLOB.admins -= owner diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index 2e586228af..22b1c8fd6d 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -130,10 +130,10 @@ return FALSE -/obj/item/assembly/mousetrap/hitby(atom/hit_atom, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) +/obj/item/assembly/mousetrap/hitby(atom/movable/hit_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) if(!armed) return ..() - visible_message("[src] is triggered by [hit_atom].") + visible_message(span_warning("[src] is triggered by [hit_atom].")) triggered(null) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index f38721671c..7e505d2861 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1139,11 +1139,11 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(user.client) if(unlock_content) dat += "BYOND Membership Publicity: [(toggles & MEMBER_PUBLIC) ? "Public" : "Hidden"]
" - if(unlock_content || check_rights_for(user.client, R_ADMIN)) + if(unlock_content || is_admin(user.client)) dat += "OOC Color: [ooccolor ? ooccolor : GLOB.normal_ooc_colour] Change
" dat += "Antag OOC Color: [aooccolor ? aooccolor : GLOB.normal_aooc_colour] Change
" - if(user.client.holder) + if(is_admin(user.client)) dat += "

Admin Settings

" dat += "Adminhelp Sounds: [(toggles & SOUND_ADMINHELP)?"Enabled":"Disabled"]
" dat += "Announce Login: [(toggles & ANNOUNCE_LOGIN)?"Enabled":"Disabled"]
" diff --git a/code/modules/holodeck/items.dm b/code/modules/holodeck/items.dm index 73e55487bf..48bacef977 100644 --- a/code/modules/holodeck/items.dm +++ b/code/modules/holodeck/items.dm @@ -122,10 +122,10 @@ if (isitem(AM) && !istype(AM,/obj/item/projectile)) if(prob(50)) AM.forceMove(get_turf(src)) - visible_message("Swish! [AM] lands in [src].") + visible_message(span_warning("Swish! [AM] lands in [src].")) return else - visible_message("[AM] bounces off of [src]'s rim!") + visible_message(span_danger("[AM] bounces off of [src]'s rim!")) return ..() else return ..() diff --git a/code/modules/mob/living/carbon/monkey/combat.dm b/code/modules/mob/living/carbon/monkey/combat.dm index 8976a0cc6d..6af29ca689 100644 --- a/code/modules/mob/living/carbon/monkey/combat.dm +++ b/code/modules/mob/living/carbon/monkey/combat.dm @@ -397,7 +397,7 @@ return ..() /mob/living/carbon/monkey/hitby(atom/movable/hitting_atom, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - if(istype(hitting_atom, /obj/item)) + if(isitem(hitting_atom)) var/obj/item/item_hitby = hitting_atom var/mob/thrown_by = item_hitby.thrownby?.resolve() if(item_hitby.throwforce < src.health && thrown_by && ishuman(thrown_by)) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 7e4497f5cd..e1427302c2 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -107,37 +107,42 @@ return FALSE /mob/living/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) + var/zone = ran_zone(BODY_ZONE_CHEST, 65)//Hits a random part of the body, geared towards the chest if(!isitem(AM)) // Filled with made up numbers for non-items. - if(mob_run_block(AM, 30, "\the [AM.name]", ATTACK_TYPE_THROWN, 0, throwingdatum.thrower, throwingdatum.thrower.zone_selected, list())) + if(mob_run_block(AM, 30, "\the [AM.name]", ATTACK_TYPE_THROWN, 0, throwingdatum.thrower, zone, list()) & BLOCK_SUCCESS) hitpush = FALSE skipcatch = TRUE blocked = TRUE + return TRUE else playsound(loc, 'sound/weapons/genhit.ogg', 50, TRUE, -1) //Item sounds are handled in the item itself + log_combat(AM, src, "hit ") return ..() var/obj/item/thrown_item = AM if(thrown_item.thrownby == WEAKREF(src)) //No throwing stuff at yourself to trigger hit reactions return ..() - if(mob_run_block(AM, thrown_item.throwforce, "\the [thrown_item.name]", ATTACK_TYPE_THROWN, 0, throwingdatum.thrower, throwingdatum.thrower.zone_selected, list())) + if(mob_run_block(AM, thrown_item.throwforce, "\the [thrown_item.name]", ATTACK_TYPE_THROWN, 0, throwingdatum.thrower, zone, list())) hitpush = FALSE skipcatch = TRUE blocked = TRUE - var/zone = ran_zone(BODY_ZONE_CHEST, 65)//Hits a random part of the body, geared towards the chest + // zone moved up because things need it early while checking it from the thrower is unnecessary var/nosell_hit = SEND_SIGNAL(thrown_item, COMSIG_MOVABLE_IMPACT_ZONE, src, zone, throwingdatum, blocked, FALSE) if(nosell_hit) skipcatch = TRUE hitpush = FALSE if(blocked) - return TRUE + return BLOCK_SUCCESS var/mob/thrown_by = thrown_item.thrownby?.resolve() if(thrown_by) log_combat(thrown_by, src, "threw and hit", thrown_item) + else + log_combat(thrown_item, src, "hit ") if(nosell_hit) return ..() visible_message(span_danger("[src] is hit by [thrown_item]!"), \ diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm index a5b2655a09..c6af5ff770 100644 --- a/code/modules/mob/living/simple_animal/bot/honkbot.dm +++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm @@ -139,7 +139,7 @@ /mob/living/simple_animal/bot/honkbot/hitby(atom/movable/hitting_atom, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - if(istype(hitting_atom, /obj/item)) + if(isitem(hitting_atom)) playsound(src, honksound, 50, TRUE, -1) var/obj/item/item_hitby = hitting_atom var/mob/thrown_by = item_hitby.thrownby?.resolve() diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 4a228e29a1..464e430bfd 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -352,7 +352,7 @@ /mob/living/simple_animal/bot/secbot/hitby(atom/movable/hitting_atom, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - if(istype(hitting_atom, /obj/item)) + if(isitem(hitting_atom)) var/obj/item/item_hitby = hitting_atom var/mob/thrown_by = item_hitby.thrownby?.resolve() if(item_hitby.throwforce < src.health && thrown_by && ishuman(thrown_by)) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm index 2463431ad3..9494f2de78 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm @@ -44,13 +44,13 @@ visible_message("[P] has a reduced effect on [src]!") return ..() -/mob/living/simple_animal/hostile/asteroid/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)//No floor tiling them to death, wiseguy - if(istype(AM, /obj/item)) - var/obj/item/T = AM +/mob/living/simple_animal/hostile/asteroid/hitby(atom/movable/hitting_atom, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)//No floor tiling them to death, wiseguy + if(isitem(hitting_atom)) + var/obj/item/item_hitby = hitting_atom if(!stat) Aggro() - if(T.throwforce <= 20) - visible_message(span_notice("The [T.name] [throw_message] [src.name]!")) + if(item_hitby.throwforce <= 20) + visible_message(span_notice("\The [item_hitby] [throw_message] [src]!")) return ..() diff --git a/code/modules/mob/living/simple_animal/hostile/mushroom.dm b/code/modules/mob/living/simple_animal/hostile/mushroom.dm index ecac9591a4..9a6fbd0cd0 100644 --- a/code/modules/mob/living/simple_animal/hostile/mushroom.dm +++ b/code/modules/mob/living/simple_animal/hostile/mushroom.dm @@ -180,11 +180,11 @@ if(M.a_intent == INTENT_HARM) Bruise() -/mob/living/simple_animal/hostile/mushroom/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) +/mob/living/simple_animal/hostile/mushroom/hitby(atom/movable/hitting_atom, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) ..() - if(istype(AM, /obj/item)) - var/obj/item/T = AM - if(T.throwforce) + if(isitem(hitting_atom)) + var/obj/item/item_hitby = hitting_atom + if(item_hitby.throwforce) Bruise() /mob/living/simple_animal/hostile/mushroom/bullet_act(obj/item/projectile/P) diff --git a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm index 977d210bc6..ab4f5dc76b 100644 --- a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm +++ b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm @@ -552,7 +552,7 @@ if(S.amount < S.max_amount) sheets += S - if(sheets.len > 0) + if(length(sheets)) var/obj/item/stack/sheet/S = pick(sheets) S.add(1) // Dare var edit directly again and i'll strangle you. to_chat(owner, "[linked_extract] adds a layer of slime to [S], which metamorphosizes into another sheet of material!") @@ -587,6 +587,7 @@ /obj/item/hothands name = "burning fingertips" desc = "You shouldn't see this." + item_flags = ABSTRACT /obj/item/hothands/get_temperature() return 290 //Below what's required to ignite plasma. @@ -595,11 +596,11 @@ id = "stabilizeddarkpurple" colour = "dark purple" var/obj/item/hothands/fire - examine_text = "Their fingertips burn brightly!" + examine_text = span_notice("Their fingertips burn brightly!") /datum/status_effect/stabilized/darkpurple/on_apply() ADD_TRAIT(owner, TRAIT_RESISTHEATHANDS, "slimestatus") - fire = new(owner) + fire = new() return ..() /datum/status_effect/stabilized/darkpurple/tick() @@ -607,7 +608,7 @@ if(item) var/obj/item/reagent_containers/food/snacks/F = item if(istype(F) && F.cooked_type) - to_chat(owner, "[linked_extract] flares up brightly, and your hands alone are enough cook [F]!") + to_chat(owner, span_warning("[linked_extract] flares up brightly, and your hands alone are enough cook [F]!")) F.microwave_act() else item.attackby(fire, owner) diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 7af2aca81b..618308b509 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -1027,13 +1027,13 @@ GLOBAL_LIST_EMPTY(vending_products) /obj/machinery/vending/proc/canLoadItem(obj/item/I, mob/user) return FALSE -/obj/machinery/vending/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) +/obj/machinery/vending/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) . = ..() - var/mob/living/L = AM - if(tilted || !istype(L) || !prob(20 * (throwingdatum.speed - L.throw_speed))) // hulk throw = +20%, neckgrab throw = +20% + var/mob/living/living_mob = hitting_atom + if(tilted || !istype(living_mob) || !prob(20 * (throwingdatum.speed - living_mob.throw_speed))) // hulk throw = +20%, neckgrab throw = +20% return - tilt(L) + tilt(living_mob) /obj/machinery/vending/attack_tk_grab(mob/user) to_chat(user, span_warning("[src] seems to resist your mental grasp!")) diff --git a/tgstation.dme b/tgstation.dme index 6adf6658d6..14b128e4c8 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -196,6 +196,7 @@ #include "code\__HELPERS\_lists.dm" #include "code\__HELPERS\_logging.dm" #include "code\__HELPERS\_string_lists.dm" +#include "code\__HELPERS\admin.dm" #include "code\__HELPERS\angles.dm" #include "code\__HELPERS\areas.dm" #include "code\__HELPERS\chat.dm"