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

autoclimbable handrails on harm intent #6652

Merged
merged 20 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from 13 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
7 changes: 4 additions & 3 deletions code/game/objects/structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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()

Expand Down
22 changes: 22 additions & 0 deletions code/game/objects/structures/barricade/handrail.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
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?
var/autoclimb = TRUE

/obj/structure/barricade/handrail/update_icon()
overlays.Cut()
Expand All @@ -40,6 +41,27 @@
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(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)
else
if(ismob(movable) && autoclimb)
var/mob/living/climber = movable
if(climber.a_intent == INTENT_HARM)
var/climbed = do_climb(climber)
if(climbed)
climber.client.move_delay += 3 DECISECONDS
cuberound marked this conversation as resolved.
Show resolved Hide resolved
if(prob(25))
if(ishuman(climber))
climber.apply_damage(15,BRUTE,no_limb_loss = TRUE)

Check failure on line 59 in code/game/objects/structures/barricade/handrail.dm

View workflow job for this annotation

GitHub Actions / Run Linters

bad keyword argument "no_limb_loss" to /mob/living/proc/apply_damage
cuberound marked this conversation as resolved.
Show resolved Hide resolved
else
climber.apply_damage(15,BRUTE)
climber.visible_message(SPAN_WARNING("You hit yourself as you vault over the [src]"))
..()
cuberound marked this conversation as resolved.
Show resolved Hide resolved

/obj/structure/barricade/handrail/get_examine_text(mob/user)
. = ..()
switch(build_state)
Expand Down
Loading