mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
[MIRROR] refactors climbing into an element (#2865)
* refactors climbing into an element (#55978) Co-authored-by: Fikou <piotrbryla@ onet.pl> Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Jared-Fogle@ users.noreply.github.com> * refactors climbing into an element * Update trash_pile.dm Co-authored-by: Qustinnus <Floydje123@hotmail.com> Co-authored-by: Fikou <piotrbryla@ onet.pl> Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Jared-Fogle@ users.noreply.github.com> Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
This commit is contained in:
co-authored by
Fikou
Ghom
Mothblocks
Qustinnus
Gandalf2k15
parent
05460ae15e
commit
38ac7c5e4d
@@ -166,11 +166,15 @@
|
||||
opened = TRUE
|
||||
if(!dense_when_open)
|
||||
density = FALSE
|
||||
climb_time *= 0.5 //it's faster to climb onto an open thing
|
||||
dump_contents()
|
||||
update_icon()
|
||||
after_open(user, force)
|
||||
return TRUE
|
||||
|
||||
///Proc to override for effects after opening a door
|
||||
/obj/structure/closet/proc/after_open(mob/living/user, force = FALSE)
|
||||
return
|
||||
|
||||
/obj/structure/closet/proc/insert(atom/movable/AM)
|
||||
if(contents.len >= storage_capacity)
|
||||
return -1
|
||||
@@ -217,12 +221,17 @@
|
||||
return FALSE
|
||||
take_contents()
|
||||
playsound(loc, close_sound, close_sound_volume, TRUE, -3)
|
||||
climb_time = initial(climb_time)
|
||||
opened = FALSE
|
||||
density = TRUE
|
||||
update_icon()
|
||||
after_close(user)
|
||||
return TRUE
|
||||
|
||||
///Proc to override for effects after closing a door
|
||||
/obj/structure/closet/proc/after_close(mob/living/user)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/proc/toggle(mob/living/user)
|
||||
if(opened)
|
||||
return close(user)
|
||||
|
||||
@@ -9,15 +9,13 @@
|
||||
allow_objects = TRUE
|
||||
allow_dense = TRUE
|
||||
dense_when_open = TRUE
|
||||
climbable = TRUE
|
||||
climb_time = 10 //real fast, because let's be honest stepping into or onto a crate is easy
|
||||
climb_stun = 0 //climbing onto crates isn't hard, guys
|
||||
delivery_icon = "deliverycrate"
|
||||
open_sound = 'sound/machines/crate_open.ogg'
|
||||
close_sound = 'sound/machines/crate_close.ogg'
|
||||
open_sound_volume = 35
|
||||
close_sound_volume = 50
|
||||
drag_slowdown = 0
|
||||
var/climb_time = 20
|
||||
var/obj/item/paper/fluff/jobs/cargo/manifest/manifest
|
||||
|
||||
/obj/structure/closet/crate/Initialize()
|
||||
@@ -25,6 +23,7 @@
|
||||
if(icon_state == "[initial(icon_state)]open")
|
||||
opened = TRUE
|
||||
update_icon()
|
||||
AddElement(/datum/element/climbable, climb_time = opened ? climb_time : climb_time * 0.5, climb_stun = 0)
|
||||
|
||||
/obj/structure/closet/crate/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
@@ -51,6 +50,17 @@
|
||||
if(manifest)
|
||||
tear_manifest(user)
|
||||
|
||||
/obj/structure/closet/crate/after_open(mob/living/user, force)
|
||||
. = ..()
|
||||
RemoveElement(/datum/element/climbable)
|
||||
AddElement(/datum/element/climbable, climb_time = climb_time * 0.5, climb_stun = 0)
|
||||
|
||||
/obj/structure/closet/crate/after_close(mob/living/user)
|
||||
. = ..()
|
||||
RemoveElement(/datum/element/climbable)
|
||||
AddElement(/datum/element/climbable, climb_time = climb_time, climb_stun = 0)
|
||||
|
||||
|
||||
/obj/structure/closet/crate/open(mob/living/user, force = FALSE)
|
||||
. = ..()
|
||||
if(. && manifest)
|
||||
|
||||
@@ -79,11 +79,11 @@
|
||||
if(MEDIUM_HOLE)
|
||||
visible_message("<span class='notice'>\The [user] cuts into \the [src] some more.</span>")
|
||||
to_chat(user, "<span class='info'>You could probably fit yourself through that hole now. Although climbing through would be much faster if you made it even bigger.</span>")
|
||||
climbable = TRUE
|
||||
AddElement(/datum/element/climbable)
|
||||
if(LARGE_HOLE)
|
||||
visible_message("<span class='notice'>\The [user] completely cuts through \the [src].</span>")
|
||||
to_chat(user, "<span class='info'>The hole in \the [src] is now big enough to walk through.</span>")
|
||||
climbable = FALSE
|
||||
RemoveElement(/datum/element/climbable)
|
||||
|
||||
update_cut_status()
|
||||
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
icon_state = "railing"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
climbable = TRUE
|
||||
|
||||
var/climbable = TRUE
|
||||
///Initial direction of the railing.
|
||||
var/ini_dir
|
||||
|
||||
/obj/structure/railing/corner //aesthetic corner sharp edges hurt oof ouch
|
||||
icon_state = "railing_corner"
|
||||
@@ -16,6 +19,13 @@
|
||||
. = ..()
|
||||
AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS ,null,CALLBACK(src, .proc/can_be_rotated),CALLBACK(src,.proc/after_rotation))
|
||||
|
||||
|
||||
/obj/structure/railing/Initialize()
|
||||
. = ..()
|
||||
ini_dir = dir
|
||||
if(climbable)
|
||||
AddElement(/datum/element/climbable)
|
||||
|
||||
/obj/structure/railing/attackby(obj/item/I, mob/living/user, params)
|
||||
..()
|
||||
add_fingerprint(user)
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
anchored = TRUE
|
||||
pass_flags_self = PASSTABLE | LETPASSTHROW
|
||||
layer = TABLE_LAYER
|
||||
climbable = TRUE
|
||||
var/frame = /obj/structure/table_frame
|
||||
var/framestack = /obj/item/stack/rods
|
||||
var/buildstack = /obj/item/stack/sheet/metal
|
||||
@@ -37,6 +36,12 @@
|
||||
smoothing_groups = list(SMOOTH_GROUP_TABLES)
|
||||
canSmoothWith = list(SMOOTH_GROUP_TABLES)
|
||||
|
||||
/obj/structure/table/Initialize(mapload, _buildstack)
|
||||
. = ..()
|
||||
if(_buildstack)
|
||||
buildstack = _buildstack
|
||||
AddElement(/datum/element/climbable)
|
||||
|
||||
/obj/structure/table/examine(mob/user)
|
||||
. = ..()
|
||||
. += deconstruction_hints(user)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
density = TRUE
|
||||
layer = LOW_ITEM_LAYER
|
||||
anchored = TRUE
|
||||
climbable = TRUE
|
||||
pass_flags_self = PASSGLASS
|
||||
var/tube_construction = /obj/structure/c_transit_tube
|
||||
var/list/tube_dirs //list of directions this tube section can connect to.
|
||||
@@ -20,6 +19,7 @@
|
||||
setDir(newdirection)
|
||||
init_tube_dirs()
|
||||
generate_tube_overlays()
|
||||
AddElement(/datum/element/climbable)
|
||||
|
||||
/obj/structure/transit_tube/Destroy()
|
||||
for(var/obj/structure/transit_tube_pod/P in loc)
|
||||
|
||||
Reference in New Issue
Block a user