mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-29 07:59:01 +01:00
Emergency ladder sprites + placement (#2658)
Ladders added to emergency storage lockers (random chance), engineering storage (1), and EVA (1). We'll see if that's too much or not.
This commit is contained in:
@@ -1189,8 +1189,9 @@
|
||||
|
||||
spawn(0)
|
||||
regenerate_icons()
|
||||
vessel.add_reagent("blood",560-vessel.total_volume)
|
||||
fixblood()
|
||||
if (vessel)
|
||||
vessel.add_reagent("blood",560-vessel.total_volume)
|
||||
fixblood()
|
||||
|
||||
// Rebuild the HUD. If they aren't logged in then login() should reinstantiate it for them.
|
||||
if(client && client.screen)
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
/obj/item/weapon/ladder_mobile
|
||||
name = "mobile ladder"
|
||||
desc = "A lightweight deployable ladder, which you can use to move up or down. Or alternatively, you can bash some faces in."
|
||||
icon_state = "mobile_ladder"
|
||||
item_state = "mobile_ladder"
|
||||
icon = 'icons/obj/multiz_items.dmi'
|
||||
contained_sprite = TRUE
|
||||
throw_range = 3
|
||||
force = 10
|
||||
w_class = 4.0
|
||||
slot_flags = SLOT_BACK
|
||||
|
||||
/obj/item/weapon/ladder_mobile/proc/place_ladder(atom/A, mob/user)
|
||||
|
||||
if (istype(A, /turf/simulated/open)) //Place into open space
|
||||
var/turf/below_loc = GetBelow(A)
|
||||
if (!below_loc || (istype(/turf/space, below_loc)))
|
||||
to_chat(user, "<span class='notice'>Why would you do that?! There is only infinite space there...</span>")
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] begins to lower \the [src] into \the [A].</span>",
|
||||
"<span class='warning'>You begin to lower \the [src] into \the [A].</span>")
|
||||
if (!handle_action(A, user))
|
||||
return
|
||||
// Create the lower ladder first. ladder/Initialize() will make the upper
|
||||
// ladder create the appropriate links. So the lower ladder must exist first.
|
||||
var/obj/structure/ladder/mobile/downer = new(below_loc)
|
||||
downer.allowed_directions = UP
|
||||
|
||||
new /obj/structure/ladder/mobile(A)
|
||||
|
||||
user.drop_item()
|
||||
qdel(src)
|
||||
|
||||
else if (istype(A, /turf/simulated/floor)) //Place onto Floor
|
||||
var/turf/upper_loc = GetAbove(A)
|
||||
if (!upper_loc || !istype(upper_loc,/turf/simulated/open))
|
||||
user << "<span class='notice'>There is something above. You can't deploy!</span>"
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] begins deploying \the [src] on \the [A].</span>",
|
||||
"<span class='warning'>You begin to deploy \the [src] on \the [A].</span>")
|
||||
if (!handle_action(A, user))
|
||||
return
|
||||
// Ditto here. Create the lower ladder first.
|
||||
var/obj/structure/ladder/mobile/downer = new(A)
|
||||
downer.allowed_directions = UP
|
||||
|
||||
new /obj/structure/ladder/mobile(upper_loc)
|
||||
|
||||
user.drop_item()
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/ladder_mobile/afterattack(atom/A, mob/user,proximity)
|
||||
if (!proximity)
|
||||
return
|
||||
|
||||
place_ladder(A,user)
|
||||
|
||||
/obj/item/weapon/ladder_mobile/proc/handle_action(atom/A, mob/user)
|
||||
if (!do_after(user, 30, act_target = user))
|
||||
to_chat(user, "Can't place ladder! You were interrupted!")
|
||||
return FALSE
|
||||
if (!A || QDELETED(src) || QDELETED(user))
|
||||
// Shit was deleted during delay, call is no longer valid.
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/ladder/mobile
|
||||
base_icon = "mobile_ladder"
|
||||
|
||||
/obj/structure/ladder/mobile/verb/fold()
|
||||
set name = "Fold Ladder"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.incapacitated() || !usr.IsAdvancedToolUser() || !ishuman(usr))
|
||||
to_chat(usr, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = usr
|
||||
H.visible_message("<span class='notice'>[H] starts folding up [src].</span>",
|
||||
"<span class='notice'>You start folding up [src].</span>")
|
||||
|
||||
if (!do_after(H, 30, act_target = src))
|
||||
to_chat(H, "<span class='warning'>You are interrupted!</span>")
|
||||
return
|
||||
|
||||
if (QDELETED(src))
|
||||
return
|
||||
|
||||
var/obj/item/weapon/ladder_mobile/R = new(get_turf(H))
|
||||
transfer_fingerprints_to(R)
|
||||
|
||||
H.visible_message("<span class='notice'>[H] folds [src] up into [R]!</span>",
|
||||
"<span class='notice'>You fold [src] up into [R]!</span>")
|
||||
|
||||
if(target_down)
|
||||
QDEL_NULL(target_down)
|
||||
qdel(src)
|
||||
else
|
||||
QDEL_NULL(target_up)
|
||||
qdel(src)
|
||||
@@ -1,60 +0,0 @@
|
||||
/obj/item/weapon/ladder_mobile
|
||||
name = "mobile ladder"
|
||||
desc = "A lightweight deployable ladder, which you can use to move up or down. Or alternatively, you can bash some faces in."
|
||||
icon_state = "ladder01"
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
throw_range = 3
|
||||
force = 10
|
||||
w_class = 4.0
|
||||
slot_flags = SLOT_BACK
|
||||
|
||||
/obj/item/weapon/ladder_mobile/proc/place_ladder(atom/A,mob/user)
|
||||
|
||||
if(istype(A, /turf/simulated/open)) //Place into open space
|
||||
var/turf/below_loc = GetBelow(A)
|
||||
if (!below_loc || (istype(/turf/space,below_loc)))
|
||||
user << "<span class='notice'>Why would you do that?! There is only infinite space there...</span>"
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] begins to lower \the [src] into \the [A].</span>")
|
||||
if(!handle_action(A,user))
|
||||
return
|
||||
var/obj/structure/ladder/mobile/body/R = new(A)
|
||||
var/obj/structure/ladder/mobile/base/D = new(A)
|
||||
D.forceMove(below_loc)
|
||||
R.target_down = D
|
||||
D.target_up = R
|
||||
|
||||
user.drop_item()
|
||||
qdel(src)
|
||||
|
||||
if(istype(A, /turf/simulated/floor)) //Place onto Floor
|
||||
var/turf/upper_loc = GetAbove(A)
|
||||
if (!upper_loc || !istype(upper_loc,/turf/simulated/open))
|
||||
user << "<span class='notice'>There is something above. You can't deploy!</span>"
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] begins deploying \the [src] on \the [A].</span>")
|
||||
if(!handle_action(A,user))
|
||||
return
|
||||
var/obj/structure/ladder/mobile/base/R = new(A)
|
||||
var/obj/structure/ladder/mobile/body/D = new(A)
|
||||
D.forceMove(upper_loc) // moves A up to upper_loc.
|
||||
R.target_up = D
|
||||
D.target_down = R
|
||||
|
||||
user.drop_item()
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/ladder_mobile/afterattack(atom/A, mob/user,proximity)
|
||||
if(!proximity)
|
||||
return
|
||||
//addtimer(CALLBACK(src, .proc/place_ladder, A, user), 5000)
|
||||
place_ladder(A,user)
|
||||
|
||||
/obj/item/weapon/ladder_mobile/proc/handle_action(atom/A, mob/user)
|
||||
if (!do_after(user, 30, act_target = user))
|
||||
to_chat(user, "Can't place ladder! You were interrupted!")
|
||||
return FALSE
|
||||
if (!A || QDELETED(src) || QDELETED(user))
|
||||
// Shit was deleted during delay, call is no longer valid.
|
||||
return FALSE
|
||||
return TRUE
|
||||
@@ -14,6 +14,7 @@
|
||||
var/allowed_directions = DOWN
|
||||
var/obj/structure/ladder/target_up
|
||||
var/obj/structure/ladder/target_down
|
||||
var/base_icon = "ladder"
|
||||
|
||||
var/const/climb_time = 2 SECONDS
|
||||
|
||||
@@ -25,7 +26,10 @@
|
||||
if(L.allowed_directions & UP)
|
||||
target_down = L
|
||||
L.target_up = src
|
||||
return
|
||||
|
||||
L.update_icon()
|
||||
break
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/structure/ladder/Destroy()
|
||||
@@ -113,7 +117,7 @@
|
||||
return airflow || !density
|
||||
|
||||
/obj/structure/ladder/update_icon()
|
||||
icon_state = "ladder[!!(allowed_directions & UP)][!!(allowed_directions & DOWN)]"
|
||||
icon_state = "[base_icon][!!(allowed_directions & UP)][!!(allowed_directions & DOWN)]"
|
||||
|
||||
/obj/structure/ladder/up
|
||||
allowed_directions = UP
|
||||
@@ -123,27 +127,6 @@
|
||||
allowed_directions = UP|DOWN
|
||||
icon_state = "ladder11"
|
||||
|
||||
/obj/structure/ladder/mobile/base
|
||||
allowed_directions = UP
|
||||
icon_state = "ladder11"
|
||||
/obj/structure/ladder/mobile/body
|
||||
allowed_directions = DOWN
|
||||
icon_state = "ladder11"
|
||||
|
||||
/obj/structure/ladder/mobile/verb/fold()
|
||||
set name = "Fold Ladder"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
var/obj/item/weapon/ladder_mobile/R = new(src.loc)
|
||||
src.transfer_fingerprints_to(R)
|
||||
|
||||
if(src.target_down == null)
|
||||
QDEL_NULL(src.target_up)
|
||||
qdel(src)
|
||||
else
|
||||
QDEL_NULL(src.target_down)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/stairs
|
||||
name = "Stairs"
|
||||
desc = "Stairs leading to another deck. Not too useful if the gravity goes out."
|
||||
|
||||
Reference in New Issue
Block a user