[no gbp] fixes being unable to climb up onto unblocked spaces with a climbing hook (#79744)

## About The Pull Request
climbing hook (the thing in your internals box on icebox and other
multiz planetary maps if any)

should now allow you to climb through directional windows if they arent
blocking your direction on the target tile, and over railing

## Why It's Good For The Game

hooks should be easier to use

## Changelog
🆑
fix: you can climb over more stuff with a climbing hook
/🆑
This commit is contained in:
jimmyl
2023-11-18 04:31:00 +01:00
committed by GitHub
parent 22826d2aca
commit 8355a43e2f
+23 -3
View File
@@ -32,20 +32,23 @@
return
if(!istype(target) || isopenspaceturf(target))
return
if(target.is_blocked_turf(exclude_mobs = TRUE))
return
var/turf/user_turf = get_turf(user)
var/turf/above = GET_TURF_ABOVE(user_turf)
if(target_blocked(target, above))
return
if(!isopenspaceturf(above) || !above.Adjacent(target)) //are we below a hole, is the target blocked, is the target adjacent to our hole
balloon_alert(user, "blocked!")
return
var/away_dir = get_dir(above, target)
user.visible_message(span_notice("[user] begins climbing upwards with [src]."), span_notice("You get to work on properly hooking [src] and going upwards."))
playsound(target, 'sound/effects/picaxe1.ogg', 50) //plays twice so people above and below can hear
playsound(user_turf, 'sound/effects/picaxe1.ogg', 50)
var/list/effects = list(new /obj/effect/temp_visual/climbing_hook(target, away_dir), new /obj/effect/temp_visual/climbing_hook(user_turf, away_dir))
if(do_after(user, climb_time, target))
user.Move(target)
user.forceMove(target)
uses--
if(uses <= 0)
@@ -54,6 +57,23 @@
QDEL_LIST(effects)
// didnt want to mess up is_blocked_turf_ignore_climbable
/// checks if our target is blocked, also checks for border objects facing the above turf and climbable stuff
/obj/item/climbing_hook/proc/target_blocked(turf/target, turf/above)
if(target.density || above.density)
return TRUE
for(var/atom/movable/atom_content as anything in target.contents)
if(isliving(atom_content))
continue
if(HAS_TRAIT(atom_content, TRAIT_CLIMBABLE))
continue
if((atom_content.flags_1 & ON_BORDER_1) && atom_content.dir != get_dir(target, above)) //if the border object is facing the hole then it is blocking us, likely
continue
if(atom_content.density)
return TRUE
return FALSE
/obj/item/climbing_hook/emergency
name = "emergency climbing hook"
desc = "An emergency climbing hook to scale up holes. The rope is EXTREMELY cheap and may not withstand extended use."