From beaf4178b3f627f31d1fcd456b493a2503c76d64 Mon Sep 17 00:00:00 2001 From: cuberound <122645057+cuberound@users.noreply.github.com> Date: Sat, 9 Nov 2024 03:17:06 +0100 Subject: [PATCH] autoclimbable handrails on harm intent (#6652) # About the pull request you do climb when you collide with handrail, rejoice. this makes handrails lot less of an obsticle for both huge xenos and highly rained and agile marines. also there is autoclimbable var that can be set to FALSE on req railing so you can not throw others out of the line # Explain why it's good for the game handrails can be major pain in ass for both marines and xenos, especily as they are used near ledges so you auto climb from one side to other but have to manualy climb back. they are also sometimes hard to spot and can get you stuck and killed, generly getting stoped by railing that you did not see feels like shit as both sides can shoot or slash it down in seconds. I am gona put this as QOL but if you think it is balance then so be it # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: qol: handrails are autoclimbable when on harm intent, you take some harm when doing so balance: crusher and ravager destroy handrails when trying to pass them similar to tables /:cl: --------- Co-authored-by: vincibrv Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/game/objects/structures.dm | 7 +-- .../objects/structures/barricade/handrail.dm | 44 +++++++++++++++++++ 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 9e0fcf297346..6706f0a2f2ed 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -110,7 +110,7 @@ /obj/structure/proc/do_climb(mob/living/user, mods) if(!can_climb(user)) - return + return FALSE var/list/climbdata = list("climb_delay" = climb_delay) SEND_SIGNAL(user, COMSIG_LIVING_CLIMB_STRUCTURE, climbdata) @@ -120,10 +120,10 @@ user.visible_message(SPAN_WARNING("[user] starts [flags_atom & ON_BORDER ? "leaping over" : climb_over_string] \the [src]!")) if(!do_after(user, final_climb_delay, INTERRUPT_NO_NEEDHAND, BUSY_ICON_GENERIC, numticks = 2)) - return + return FALSE if(!can_climb(user)) - return + return FALSE var/turf/TT = get_turf(src) if(flags_atom & ON_BORDER) @@ -145,6 +145,7 @@ user.forceMove(TT) for(var/atom/movable/thing as anything in grabbed_things) // grabbed things aren't moved to the tile immediately to: make the animation better, preserve the grab thing.forceMove(TT) + return TRUE /obj/structure/proc/structure_shaken() diff --git a/code/game/objects/structures/barricade/handrail.dm b/code/game/objects/structures/barricade/handrail.dm index 2fde8de3fe98..f1cb891a9588 100644 --- a/code/game/objects/structures/barricade/handrail.dm +++ b/code/game/objects/structures/barricade/handrail.dm @@ -18,6 +18,18 @@ var/build_state = BARRICADE_BSTATE_SECURED var/reinforced = FALSE //Reinforced to be a cade or not var/can_be_reinforced = TRUE //can we even reinforce this handrail or not? + ///Whether a ground z-level handrail allows auto-climbing on harm intent + var/autoclimb = TRUE + +/obj/structure/barricade/handrail/Initialize(mapload, ...) + . = ..() + if(!is_ground_level(z)) + if(autoclimb && is_mainship_level(z)) + RegisterSignal(SSdcs, COMSIG_GLOB_HIJACK_LANDED, PROC_REF(reset_autoclimb)) + autoclimb = FALSE + +/obj/structure/barricade/handrail/proc/reset_autoclimb() + autoclimb = initial(autoclimb) /obj/structure/barricade/handrail/update_icon() overlays.Cut() @@ -40,6 +52,38 @@ if(E.icon_path && E.obj_icon_state_path) overlays += image(E.icon_path, icon_state = E.obj_icon_state_path) +/obj/structure/barricade/handrail/Collided(atom/movable/movable) + if(!ismob(movable)) + return ..() + + if(istype(movable, /mob/living/carbon/xenomorph/ravager) || istype(movable, /mob/living/carbon/xenomorph/crusher)) + var/mob/living/carbon/xenomorph/xenomorph = movable + if(!xenomorph.stat) + visible_message(SPAN_DANGER("[xenomorph] plows straight through [src]!")) + deconstruct(FALSE) + return + else + if(!autoclimb) + return ..() + + if(movable.last_bumped == world.time) + return ..() + + var/mob/living/climber = movable + if(climber.a_intent != INTENT_HARM) + return ..() + + climber.client?.move_delay += 3 DECISECONDS + if(do_climb(climber)) + if(prob(25)) + if(ishuman(climber)) + var/mob/living/carbon/human/human = climber + human.apply_damage(5, BRUTE, no_limb_loss = TRUE) + else + climber.apply_damage(5, BRUTE) + climber.visible_message(SPAN_WARNING("[climber] injures themselves vaulting over [src]."), SPAN_WARNING("You hit yourself as you vault over [src].")) + ..() + /obj/structure/barricade/handrail/get_examine_text(mob/user) . = ..() switch(build_state)