mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 14:37:04 +01:00
Refactors large crates. Adds sound and makes them not-instant. (#30068)
* bonk * refactors large crates
This commit is contained in:
@@ -37,6 +37,12 @@
|
|||||||
|
|
||||||
/obj/structure/largecrate/crowbar_act(mob/living/user, obj/item/I)
|
/obj/structure/largecrate/crowbar_act(mob/living/user, obj/item/I)
|
||||||
. = TRUE
|
. = TRUE
|
||||||
|
if(!I.use_tool(src, user, 20, volume = I.tool_volume))
|
||||||
|
return TRUE
|
||||||
|
break_open()
|
||||||
|
user.visible_message("<span class='notice'>[user] pries [src] open.</span>", \
|
||||||
|
"<span class='notice'>You pry open [src].</span>", \
|
||||||
|
"<span class='notice'>You hear splitting wood.</span>")
|
||||||
if(manifest)
|
if(manifest)
|
||||||
manifest.forceMove(loc)
|
manifest.forceMove(loc)
|
||||||
manifest = null
|
manifest = null
|
||||||
@@ -46,11 +52,11 @@
|
|||||||
for(var/O in contents)
|
for(var/O in contents)
|
||||||
var/atom/movable/A = O
|
var/atom/movable/A = O
|
||||||
A.forceMove(T)
|
A.forceMove(T)
|
||||||
user.visible_message("<span class='notice'>[user] pries [src] open.</span>", \
|
|
||||||
"<span class='notice'>You pry open [src].</span>", \
|
|
||||||
"<span class='notice'>You hear splitting wood.</span>")
|
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
|
/obj/structure/largecrate/proc/break_open()
|
||||||
|
return
|
||||||
|
|
||||||
/obj/structure/largecrate/Destroy()
|
/obj/structure/largecrate/Destroy()
|
||||||
var/turf/src_turf = get_turf(src)
|
var/turf/src_turf = get_turf(src)
|
||||||
for(var/obj/O in contents)
|
for(var/obj/O in contents)
|
||||||
@@ -62,60 +68,42 @@
|
|||||||
/obj/structure/largecrate/lisa
|
/obj/structure/largecrate/lisa
|
||||||
icon_state = "lisacrate"
|
icon_state = "lisacrate"
|
||||||
|
|
||||||
/obj/structure/largecrate/lisa/crowbar_act(mob/living/user, obj/item/I)
|
/obj/structure/largecrate/lisa/break_open()
|
||||||
if(!I.use_tool(src, user, I.tool_volume))
|
|
||||||
return
|
|
||||||
new /mob/living/simple_animal/pet/dog/corgi/lisa(loc)
|
new /mob/living/simple_animal/pet/dog/corgi/lisa(loc)
|
||||||
return ..()
|
|
||||||
|
|
||||||
/obj/structure/largecrate/cow
|
/obj/structure/largecrate/cow
|
||||||
name = "cow crate"
|
name = "cow crate"
|
||||||
icon_state = "lisacrate"
|
icon_state = "lisacrate"
|
||||||
|
|
||||||
/obj/structure/largecrate/cow/crowbar_act(mob/living/user, obj/item/I)
|
/obj/structure/largecrate/cow/break_open()
|
||||||
if(!I.use_tool(src, user, I.tool_volume))
|
|
||||||
return
|
|
||||||
new /mob/living/basic/cow(loc)
|
new /mob/living/basic/cow(loc)
|
||||||
return ..()
|
|
||||||
|
|
||||||
/obj/structure/largecrate/goat
|
/obj/structure/largecrate/goat
|
||||||
name = "goat crate"
|
name = "goat crate"
|
||||||
icon_state = "lisacrate"
|
icon_state = "lisacrate"
|
||||||
|
|
||||||
/obj/structure/largecrate/goat/crowbar_act(mob/living/user, obj/item/I)
|
/obj/structure/largecrate/goat/break_open()
|
||||||
if(!I.use_tool(src, user, I.tool_volume))
|
|
||||||
return
|
|
||||||
new /mob/living/simple_animal/hostile/retaliate/goat(loc)
|
new /mob/living/simple_animal/hostile/retaliate/goat(loc)
|
||||||
return ..()
|
|
||||||
|
|
||||||
/obj/structure/largecrate/chick
|
/obj/structure/largecrate/chick
|
||||||
name = "chicken crate"
|
name = "chicken crate"
|
||||||
icon_state = "lisacrate"
|
icon_state = "lisacrate"
|
||||||
|
|
||||||
/obj/structure/largecrate/chick/crowbar_act(mob/living/user, obj/item/I)
|
/obj/structure/largecrate/chick/break_open()
|
||||||
if(!I.use_tool(src, user, I.tool_volume))
|
|
||||||
return
|
|
||||||
var/num = rand(4, 6)
|
var/num = rand(4, 6)
|
||||||
for(var/i in 1 to num)
|
for(var/i in 1 to num)
|
||||||
new /mob/living/simple_animal/chick(loc)
|
new /mob/living/simple_animal/chick(loc)
|
||||||
return ..()
|
|
||||||
|
|
||||||
/obj/structure/largecrate/cat
|
/obj/structure/largecrate/cat
|
||||||
name = "cat crate"
|
name = "cat crate"
|
||||||
icon_state = "lisacrate"
|
icon_state = "lisacrate"
|
||||||
|
|
||||||
/obj/structure/largecrate/cat/crowbar_act(mob/living/user, obj/item/I)
|
/obj/structure/largecrate/cat/break_open()
|
||||||
if(!I.use_tool(src, user, I.tool_volume))
|
|
||||||
return
|
|
||||||
new /mob/living/simple_animal/pet/cat(loc)
|
new /mob/living/simple_animal/pet/cat(loc)
|
||||||
return ..()
|
|
||||||
|
|
||||||
/obj/structure/largecrate/secway
|
/obj/structure/largecrate/secway
|
||||||
name = "secway crate"
|
name = "secway crate"
|
||||||
|
|
||||||
/obj/structure/largecrate/secway/crowbar_act(mob/living/user, obj/item/I)
|
/obj/structure/largecrate/secway/break_open()
|
||||||
if(!I.use_tool(src, user, I.tool_volume))
|
|
||||||
return
|
|
||||||
new /obj/vehicle/secway(loc)
|
new /obj/vehicle/secway(loc)
|
||||||
new /obj/item/key/security(loc)
|
new /obj/item/key/security(loc)
|
||||||
return ..()
|
|
||||||
|
|||||||
Reference in New Issue
Block a user