mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-26 14:46:52 +01:00
Merge branch 'master' into shep-dev-upstream-screenport
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
health -= amount
|
||||
if(health <= 0)
|
||||
visible_message("<span class='warning'>\The [src] breaks down!</span>")
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/grillehit.ogg', 50, 1)
|
||||
new /obj/item/stack/rods(get_turf(src))
|
||||
Destroy()
|
||||
|
||||
|
||||
@@ -1,474 +1,473 @@
|
||||
/obj/structure/closet
|
||||
name = "closet"
|
||||
desc = "It's a basic storage unit."
|
||||
icon = 'icons/obj/closet.dmi'
|
||||
icon_state = "closed"
|
||||
density = 1
|
||||
w_class = ITEMSIZE_HUGE
|
||||
layer = UNDER_JUNK_LAYER
|
||||
var/icon_closed = "closed"
|
||||
var/icon_opened = "open"
|
||||
var/opened = 0
|
||||
var/sealed = 0
|
||||
var/seal_tool = /obj/item/weapon/weldingtool //Tool used to seal the closet, defaults to welder
|
||||
var/wall_mounted = 0 //never solid (You can always pass over it)
|
||||
var/health = 100
|
||||
|
||||
var/breakout = 0 //if someone is currently breaking out. mutex
|
||||
var/breakout_time = 2 //2 minutes by default
|
||||
var/breakout_sound = 'sound/effects/grillehit.ogg' //Sound that plays while breaking out
|
||||
|
||||
var/storage_capacity = 2 * MOB_MEDIUM //This is so that someone can't pack hundreds of items in a locker/crate
|
||||
//then open it in a populated area to crash clients.
|
||||
var/storage_cost = 40 //How much space this closet takes up if it's stuffed in another closet
|
||||
|
||||
var/open_sound = 'sound/machines/click.ogg'
|
||||
var/close_sound = 'sound/machines/click.ogg'
|
||||
|
||||
var/store_misc = 1 //Chameleon item check
|
||||
var/store_items = 1 //Will the closet store items?
|
||||
var/store_mobs = 1 //Will the closet store mobs?
|
||||
var/max_closets = 0 //Number of other closets allowed on tile before it won't close.
|
||||
|
||||
var/list/starts_with
|
||||
|
||||
/obj/structure/closet/Initialize()
|
||||
..()
|
||||
// Closets need to come later because of spawners potentially creating objects during init.
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/structure/closet/LateInitialize()
|
||||
. = ..()
|
||||
if(starts_with)
|
||||
create_objects_in_loc(src, starts_with)
|
||||
starts_with = null
|
||||
|
||||
if(!opened) // if closed, any item at the crate's loc is put in the contents
|
||||
var/obj/item/I
|
||||
for(I in src.loc)
|
||||
if(I.density || I.anchored || I == src) continue
|
||||
I.forceMove(src)
|
||||
// adjust locker size to hold all items with 5 units of free store room
|
||||
var/content_size = 0
|
||||
for(I in src.contents)
|
||||
content_size += CEILING(I.w_class/2, 1)
|
||||
if(content_size > storage_capacity-5)
|
||||
storage_capacity = content_size + 5
|
||||
update_icon()
|
||||
|
||||
/obj/structure/closet/examine(mob/user)
|
||||
. = ..()
|
||||
if(Adjacent(user) || isobserver(user))
|
||||
var/content_size = 0
|
||||
for(var/obj/item/I in src.contents)
|
||||
if(!I.anchored)
|
||||
content_size += CEILING(I.w_class/2, 1)
|
||||
if(!content_size)
|
||||
. += "It is empty."
|
||||
else if(storage_capacity > content_size*4)
|
||||
. += "It is barely filled."
|
||||
else if(storage_capacity > content_size*2)
|
||||
. += "It is less than half full."
|
||||
else if(storage_capacity > content_size)
|
||||
. += "There is still some free space."
|
||||
else
|
||||
. += "It is full."
|
||||
|
||||
if(!src.opened && isobserver(user))
|
||||
. += "It contains: [counting_english_list(contents)]"
|
||||
|
||||
/obj/structure/closet/CanPass(atom/movable/mover, turf/target)
|
||||
if(wall_mounted)
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/proc/can_open()
|
||||
if(src.sealed)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/proc/can_close()
|
||||
var/closet_count = 0
|
||||
for(var/obj/structure/closet/closet in get_turf(src))
|
||||
if(closet != src)
|
||||
if(!closet.anchored)
|
||||
closet_count ++
|
||||
if(closet_count > max_closets)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/proc/dump_contents()
|
||||
//Cham Projector Exception
|
||||
for(var/obj/effect/dummy/chameleon/AD in src)
|
||||
AD.forceMove(src.loc)
|
||||
|
||||
for(var/obj/I in src)
|
||||
I.forceMove(src.loc)
|
||||
|
||||
for(var/mob/M in src)
|
||||
M.forceMove(src.loc)
|
||||
if(M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
|
||||
/obj/structure/closet/proc/open()
|
||||
if(src.opened)
|
||||
return 0
|
||||
|
||||
if(!src.can_open())
|
||||
return 0
|
||||
|
||||
src.dump_contents()
|
||||
|
||||
src.icon_state = src.icon_opened
|
||||
src.opened = 1
|
||||
playsound(src.loc, open_sound, 15, 1, -3)
|
||||
if(initial(density))
|
||||
density = !density
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/proc/close()
|
||||
if(!src.opened)
|
||||
return 0
|
||||
if(!src.can_close())
|
||||
return 0
|
||||
|
||||
var/stored_units = 0
|
||||
|
||||
if(store_misc)
|
||||
stored_units += store_misc(stored_units)
|
||||
if(store_items)
|
||||
stored_units += store_items(stored_units)
|
||||
if(store_mobs)
|
||||
stored_units += store_mobs(stored_units)
|
||||
if(max_closets)
|
||||
stored_units += store_closets(stored_units)
|
||||
|
||||
src.icon_state = src.icon_closed
|
||||
src.opened = 0
|
||||
|
||||
playsound(src.loc, close_sound, 15, 1, -3)
|
||||
if(initial(density))
|
||||
density = !density
|
||||
return 1
|
||||
|
||||
//Cham Projector Exception
|
||||
/obj/structure/closet/proc/store_misc(var/stored_units)
|
||||
var/added_units = 0
|
||||
for(var/obj/effect/dummy/chameleon/AD in src.loc)
|
||||
if((stored_units + added_units) > storage_capacity)
|
||||
break
|
||||
AD.forceMove(src)
|
||||
added_units++
|
||||
return added_units
|
||||
|
||||
/obj/structure/closet/proc/store_items(var/stored_units)
|
||||
var/added_units = 0
|
||||
for(var/obj/item/I in src.loc)
|
||||
var/item_size = CEILING(I.w_class / 2, 1)
|
||||
if(stored_units + added_units + item_size > storage_capacity)
|
||||
continue
|
||||
if(!I.anchored)
|
||||
I.forceMove(src)
|
||||
added_units += item_size
|
||||
return added_units
|
||||
|
||||
/obj/structure/closet/proc/store_mobs(var/stored_units)
|
||||
var/added_units = 0
|
||||
for(var/mob/living/M in src.loc)
|
||||
if(M.buckled || M.pinned.len)
|
||||
continue
|
||||
if(stored_units + added_units + M.mob_size > storage_capacity)
|
||||
break
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.forceMove(src)
|
||||
added_units += M.mob_size
|
||||
return added_units
|
||||
|
||||
/obj/structure/closet/proc/store_closets(var/stored_units)
|
||||
var/added_units = 0
|
||||
for(var/obj/structure/closet/C in src.loc)
|
||||
if(C == src) //Don't store ourself
|
||||
continue
|
||||
if(C.anchored) //Don't worry about anchored things on the same tile
|
||||
continue
|
||||
if(C.max_closets) //Prevents recursive storage
|
||||
continue
|
||||
if(stored_units + added_units + storage_cost > storage_capacity)
|
||||
break
|
||||
C.forceMove(src)
|
||||
added_units += storage_cost
|
||||
return added_units
|
||||
|
||||
|
||||
/obj/structure/closet/proc/toggle(mob/user as mob)
|
||||
if(!(src.opened ? src.close() : src.open()))
|
||||
to_chat(user, "<span class='notice'>It won't budge!</span>")
|
||||
return
|
||||
update_icon()
|
||||
|
||||
// this should probably use dump_contents()
|
||||
/obj/structure/closet/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1)
|
||||
for(var/atom/movable/A as mob|obj in src)//pulls everything out of the locker and hits it with an explosion
|
||||
A.forceMove(src.loc)
|
||||
A.ex_act(severity + 1)
|
||||
qdel(src)
|
||||
if(2)
|
||||
if(prob(50))
|
||||
for (var/atom/movable/A as mob|obj in src)
|
||||
A.forceMove(src.loc)
|
||||
A.ex_act(severity + 1)
|
||||
qdel(src)
|
||||
if(3)
|
||||
if(prob(5))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.forceMove(src.loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/closet/blob_act()
|
||||
damage(100)
|
||||
|
||||
/obj/structure/closet/proc/damage(var/damage)
|
||||
health -= damage
|
||||
if(health <= 0)
|
||||
for(var/atom/movable/A in src)
|
||||
A.forceMove(src.loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/closet/bullet_act(var/obj/item/projectile/Proj)
|
||||
var/proj_damage = Proj.get_structure_damage()
|
||||
if(!proj_damage)
|
||||
return
|
||||
|
||||
..()
|
||||
damage(proj_damage)
|
||||
|
||||
return
|
||||
|
||||
/obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(src.opened)
|
||||
if(istype(W, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = W
|
||||
src.MouseDrop_T(G.affecting, user) //act like they were dragged onto the closet
|
||||
return 0
|
||||
if(istype(W,/obj/item/tk_grab))
|
||||
return 0
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(!WT.remove_fuel(0,user))
|
||||
if(!WT.isOn())
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You need more welding fuel to complete this task.</span>")
|
||||
return
|
||||
playsound(src, WT.usesound, 50)
|
||||
new /obj/item/stack/material/steel(src.loc)
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("<span class='notice'>\The [src] has been cut apart by [user] with \the [WT].</span>", 3, "You hear welding.", 2)
|
||||
qdel(src)
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/storage/laundry_basket) && W.contents.len)
|
||||
var/obj/item/weapon/storage/laundry_basket/LB = W
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/obj/item/I in LB.contents)
|
||||
LB.remove_from_storage(I, T)
|
||||
user.visible_message("<span class='notice'>[user] empties \the [LB] into \the [src].</span>", \
|
||||
"<span class='notice'>You empty \the [LB] into \the [src].</span>", \
|
||||
"<span class='notice'>You hear rustling of clothes.</span>")
|
||||
return
|
||||
if(isrobot(user))
|
||||
return
|
||||
if(W.loc != user) // This should stop mounted modules ending up outside the module.
|
||||
return
|
||||
usr.drop_item()
|
||||
if(W)
|
||||
W.forceMove(src.loc)
|
||||
else if(istype(W, /obj/item/weapon/packageWrap))
|
||||
return
|
||||
else if(seal_tool)
|
||||
if(istype(W, seal_tool))
|
||||
var/obj/item/weapon/S = W
|
||||
if(istype(S, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = S
|
||||
if(!WT.remove_fuel(0,user))
|
||||
if(!WT.isOn())
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You need more welding fuel to complete this task.</span>")
|
||||
return
|
||||
if(do_after(user, 20 * S.toolspeed))
|
||||
playsound(src, S.usesound, 50)
|
||||
src.sealed = !src.sealed
|
||||
src.update_icon()
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("<span class='warning'>[src] has been [sealed?"sealed":"unsealed"] by [user.name].</span>", 3)
|
||||
else if(W.is_wrench())
|
||||
if(sealed)
|
||||
if(anchored)
|
||||
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
|
||||
else
|
||||
user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
|
||||
playsound(src, W.usesound, 50)
|
||||
if(do_after(user, 20 * W.toolspeed))
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='notice'>You [anchored? "un" : ""]secured \the [src]!</span>")
|
||||
anchored = !anchored
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/structure/closet/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
|
||||
if(istype(O, /obj/screen)) //fix for HUD elements making their way into the world -Pete
|
||||
return
|
||||
if(O.loc == user)
|
||||
return
|
||||
if(user.restrained() || user.stat || user.weakened || user.stunned || user.paralysis)
|
||||
return
|
||||
if((!( istype(O, /atom/movable) ) || O.anchored || !Adjacent(user) || !Adjacent(O) || !user.Adjacent(O) || user.contents.Find(src)))
|
||||
return
|
||||
if(!isturf(user.loc)) // are you in a container/closet/pod/etc?
|
||||
return
|
||||
if(!src.opened)
|
||||
return
|
||||
if(istype(O, /obj/structure/closet))
|
||||
return
|
||||
step_towards(O, src.loc)
|
||||
if(user != O)
|
||||
user.show_viewers("<span class='danger'>[user] stuffs [O] into [src]!</span>")
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/structure/closet/attack_robot(mob/user)
|
||||
if(Adjacent(user))
|
||||
attack_hand(user)
|
||||
|
||||
/obj/structure/closet/relaymove(mob/user as mob)
|
||||
if(user.stat || !isturf(src.loc))
|
||||
return
|
||||
|
||||
if(!src.open())
|
||||
to_chat(user, "<span class='notice'>It won't budge!</span>")
|
||||
|
||||
/obj/structure/closet/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
src.toggle(user)
|
||||
|
||||
// tk grab then use on self
|
||||
/obj/structure/closet/attack_self_tk(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
if(!src.toggle())
|
||||
to_chat(usr, "<span class='notice'>It won't budge!</span>")
|
||||
|
||||
/obj/structure/closet/verb/verb_toggleopen()
|
||||
set src in oview(1)
|
||||
set category = "Object"
|
||||
set name = "Toggle Open"
|
||||
|
||||
if(!usr.canmove || usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
if(ishuman(usr) || isrobot(usr))
|
||||
src.add_fingerprint(usr)
|
||||
src.toggle(usr)
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
|
||||
|
||||
/obj/structure/closet/update_icon()//Putting the sealed stuff in updateicon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
|
||||
overlays.Cut()
|
||||
if(!opened)
|
||||
icon_state = icon_closed
|
||||
if(sealed)
|
||||
overlays += "welded"
|
||||
else
|
||||
icon_state = icon_opened
|
||||
|
||||
/obj/structure/closet/attack_generic(var/mob/user, var/damage, var/attack_message = "destroys")
|
||||
if(damage < STRUCTURE_MIN_DAMAGE_THRESHOLD)
|
||||
return
|
||||
user.do_attack_animation(src)
|
||||
visible_message("<span class='danger'>[user] [attack_message] the [src]!</span>")
|
||||
dump_contents()
|
||||
spawn(1) qdel(src)
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/proc/req_breakout()
|
||||
if(opened)
|
||||
return 0 //Door's open... wait, why are you in it's contents then?
|
||||
if(!sealed)
|
||||
return 0 //closed but not sealed...
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/container_resist(var/mob/living/escapee)
|
||||
if(breakout || !req_breakout())
|
||||
return
|
||||
|
||||
escapee.setClickCooldown(100)
|
||||
|
||||
//okay, so the closet is either sealed or locked... resist!!!
|
||||
to_chat(escapee, "<span class='warning'>You lean on the back of \the [src] and start pushing the door open. (this will take about [breakout_time] minutes)</span>")
|
||||
|
||||
visible_message("<span class='danger'>\The [src] begins to shake violently!</span>")
|
||||
|
||||
spawn(0)
|
||||
breakout = 1 //can't think of a better way to do this right now.
|
||||
for(var/i in 1 to (6*breakout_time * 2)) //minutes * 6 * 5seconds * 2
|
||||
if(!do_after(escapee, 50)) //5 seconds
|
||||
breakout = 0
|
||||
return
|
||||
if(!escapee || escapee.incapacitated() || escapee.loc != src)
|
||||
breakout = 0
|
||||
return //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened
|
||||
//Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'...
|
||||
if(!req_breakout())
|
||||
breakout = 0
|
||||
return
|
||||
|
||||
playsound(src.loc, breakout_sound, 100, 1)
|
||||
animate_shake()
|
||||
add_fingerprint(escapee)
|
||||
|
||||
//Well then break it!
|
||||
breakout = 0
|
||||
to_chat(escapee, "<span class='warning'>You successfully break out!</span>")
|
||||
visible_message("<span class='danger'>\The [escapee] successfully broke out of \the [src]!</span>")
|
||||
playsound(src.loc, breakout_sound, 100, 1)
|
||||
break_open()
|
||||
animate_shake()
|
||||
|
||||
/obj/structure/closet/proc/break_open()
|
||||
sealed = 0
|
||||
update_icon()
|
||||
//Do this to prevent contents from being opened into nullspace (read: bluespace)
|
||||
if(istype(loc, /obj/structure/bigDelivery))
|
||||
var/obj/structure/bigDelivery/BD = loc
|
||||
BD.unwrap()
|
||||
open()
|
||||
|
||||
/obj/structure/closet/proc/animate_shake()
|
||||
var/init_px = pixel_x
|
||||
var/shake_dir = pick(-1, 1)
|
||||
animate(src, transform=turn(matrix(), 8*shake_dir), pixel_x=init_px + 2*shake_dir, time=1)
|
||||
animate(transform=null, pixel_x=init_px, time=6, easing=ELASTIC_EASING)
|
||||
|
||||
/obj/structure/closet/onDropInto(var/atom/movable/AM)
|
||||
return
|
||||
|
||||
/obj/structure/closet/AllowDrop()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/closet/return_air_for_internal_lifeform(var/mob/living/L)
|
||||
if(src.loc)
|
||||
if(istype(src.loc, /obj/structure/closet))
|
||||
return (loc.return_air_for_internal_lifeform(L))
|
||||
return return_air()
|
||||
|
||||
/obj/structure/closet/take_damage(var/damage)
|
||||
if(damage < STRUCTURE_MIN_DAMAGE_THRESHOLD)
|
||||
return
|
||||
dump_contents()
|
||||
spawn(1) qdel(src)
|
||||
return 1
|
||||
/obj/structure/closet
|
||||
name = "closet"
|
||||
desc = "It's a basic storage unit."
|
||||
icon = 'icons/obj/closet.dmi'
|
||||
icon_state = "closed"
|
||||
density = 1
|
||||
w_class = ITEMSIZE_HUGE
|
||||
layer = UNDER_JUNK_LAYER
|
||||
var/icon_closed = "closed"
|
||||
var/icon_opened = "open"
|
||||
var/opened = 0
|
||||
var/sealed = 0
|
||||
var/seal_tool = /obj/item/weapon/weldingtool //Tool used to seal the closet, defaults to welder
|
||||
var/wall_mounted = 0 //never solid (You can always pass over it)
|
||||
var/health = 100
|
||||
|
||||
var/breakout = 0 //if someone is currently breaking out. mutex
|
||||
var/breakout_time = 2 //2 minutes by default
|
||||
var/breakout_sound = 'sound/effects/grillehit.ogg' //Sound that plays while breaking out
|
||||
|
||||
var/storage_capacity = 2 * MOB_MEDIUM //This is so that someone can't pack hundreds of items in a locker/crate
|
||||
//then open it in a populated area to crash clients.
|
||||
var/storage_cost = 40 //How much space this closet takes up if it's stuffed in another closet
|
||||
|
||||
var/open_sound = 'sound/machines/click.ogg'
|
||||
var/close_sound = 'sound/machines/click.ogg'
|
||||
|
||||
var/store_misc = 1 //Chameleon item check
|
||||
var/store_items = 1 //Will the closet store items?
|
||||
var/store_mobs = 1 //Will the closet store mobs?
|
||||
var/max_closets = 0 //Number of other closets allowed on tile before it won't close.
|
||||
|
||||
var/list/starts_with
|
||||
|
||||
/obj/structure/closet/Initialize()
|
||||
..()
|
||||
// Closets need to come later because of spawners potentially creating objects during init.
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/structure/closet/LateInitialize()
|
||||
. = ..()
|
||||
if(starts_with)
|
||||
create_objects_in_loc(src, starts_with)
|
||||
starts_with = null
|
||||
|
||||
if(!opened) // if closed, any item at the crate's loc is put in the contents
|
||||
var/obj/item/I
|
||||
for(I in src.loc)
|
||||
if(I.density || I.anchored || I == src) continue
|
||||
I.forceMove(src)
|
||||
// adjust locker size to hold all items with 5 units of free store room
|
||||
var/content_size = 0
|
||||
for(I in src.contents)
|
||||
content_size += CEILING(I.w_class/2, 1)
|
||||
if(content_size > storage_capacity-5)
|
||||
storage_capacity = content_size + 5
|
||||
update_icon()
|
||||
|
||||
/obj/structure/closet/examine(mob/user)
|
||||
. = ..()
|
||||
if(Adjacent(user) || isobserver(user))
|
||||
var/content_size = 0
|
||||
for(var/obj/item/I in src.contents)
|
||||
if(!I.anchored)
|
||||
content_size += CEILING(I.w_class/2, 1)
|
||||
if(!content_size)
|
||||
. += "It is empty."
|
||||
else if(storage_capacity > content_size*4)
|
||||
. += "It is barely filled."
|
||||
else if(storage_capacity > content_size*2)
|
||||
. += "It is less than half full."
|
||||
else if(storage_capacity > content_size)
|
||||
. += "There is still some free space."
|
||||
else
|
||||
. += "It is full."
|
||||
|
||||
if(!src.opened && isobserver(user))
|
||||
. += "It contains: [counting_english_list(contents)]"
|
||||
|
||||
/obj/structure/closet/CanPass(atom/movable/mover, turf/target)
|
||||
if(wall_mounted)
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/proc/can_open()
|
||||
if(src.sealed)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/proc/can_close()
|
||||
var/closet_count = 0
|
||||
for(var/obj/structure/closet/closet in get_turf(src))
|
||||
if(closet != src)
|
||||
if(!closet.anchored)
|
||||
closet_count ++
|
||||
if(closet_count > max_closets)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/proc/dump_contents()
|
||||
//Cham Projector Exception
|
||||
for(var/obj/effect/dummy/chameleon/AD in src)
|
||||
AD.forceMove(src.loc)
|
||||
|
||||
for(var/obj/I in src)
|
||||
I.forceMove(src.loc)
|
||||
|
||||
for(var/mob/M in src)
|
||||
M.forceMove(src.loc)
|
||||
if(M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
|
||||
/obj/structure/closet/proc/open()
|
||||
if(src.opened)
|
||||
return 0
|
||||
|
||||
if(!src.can_open())
|
||||
return 0
|
||||
|
||||
src.dump_contents()
|
||||
|
||||
src.icon_state = src.icon_opened
|
||||
src.opened = 1
|
||||
playsound(src, open_sound, 15, 1, -3)
|
||||
if(initial(density))
|
||||
density = !density
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/proc/close()
|
||||
if(!src.opened)
|
||||
return 0
|
||||
if(!src.can_close())
|
||||
return 0
|
||||
|
||||
var/stored_units = 0
|
||||
|
||||
if(store_misc)
|
||||
stored_units += store_misc(stored_units)
|
||||
if(store_items)
|
||||
stored_units += store_items(stored_units)
|
||||
if(store_mobs)
|
||||
stored_units += store_mobs(stored_units)
|
||||
if(max_closets)
|
||||
stored_units += store_closets(stored_units)
|
||||
|
||||
src.icon_state = src.icon_closed
|
||||
src.opened = 0
|
||||
|
||||
playsound(src, close_sound, 15, 1, -3)
|
||||
if(initial(density))
|
||||
density = !density
|
||||
return 1
|
||||
|
||||
//Cham Projector Exception
|
||||
/obj/structure/closet/proc/store_misc(var/stored_units)
|
||||
var/added_units = 0
|
||||
for(var/obj/effect/dummy/chameleon/AD in src.loc)
|
||||
if((stored_units + added_units) > storage_capacity)
|
||||
break
|
||||
AD.forceMove(src)
|
||||
added_units++
|
||||
return added_units
|
||||
|
||||
/obj/structure/closet/proc/store_items(var/stored_units)
|
||||
var/added_units = 0
|
||||
for(var/obj/item/I in src.loc)
|
||||
var/item_size = CEILING(I.w_class / 2, 1)
|
||||
if(stored_units + added_units + item_size > storage_capacity)
|
||||
continue
|
||||
if(!I.anchored)
|
||||
I.forceMove(src)
|
||||
added_units += item_size
|
||||
return added_units
|
||||
|
||||
/obj/structure/closet/proc/store_mobs(var/stored_units)
|
||||
var/added_units = 0
|
||||
for(var/mob/living/M in src.loc)
|
||||
if(M.buckled || M.pinned.len)
|
||||
continue
|
||||
if(stored_units + added_units + M.mob_size > storage_capacity)
|
||||
break
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.forceMove(src)
|
||||
added_units += M.mob_size
|
||||
return added_units
|
||||
|
||||
/obj/structure/closet/proc/store_closets(var/stored_units)
|
||||
var/added_units = 0
|
||||
for(var/obj/structure/closet/C in src.loc)
|
||||
if(C == src) //Don't store ourself
|
||||
continue
|
||||
if(C.anchored) //Don't worry about anchored things on the same tile
|
||||
continue
|
||||
if(C.max_closets) //Prevents recursive storage
|
||||
continue
|
||||
if(stored_units + added_units + storage_cost > storage_capacity)
|
||||
break
|
||||
C.forceMove(src)
|
||||
added_units += storage_cost
|
||||
return added_units
|
||||
|
||||
|
||||
/obj/structure/closet/proc/toggle(mob/user as mob)
|
||||
if(!(src.opened ? src.close() : src.open()))
|
||||
to_chat(user, "<span class='notice'>It won't budge!</span>")
|
||||
return
|
||||
update_icon()
|
||||
|
||||
// this should probably use dump_contents()
|
||||
/obj/structure/closet/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1)
|
||||
for(var/atom/movable/A as mob|obj in src)//pulls everything out of the locker and hits it with an explosion
|
||||
A.forceMove(src.loc)
|
||||
A.ex_act(severity + 1)
|
||||
qdel(src)
|
||||
if(2)
|
||||
if(prob(50))
|
||||
for (var/atom/movable/A as mob|obj in src)
|
||||
A.forceMove(src.loc)
|
||||
A.ex_act(severity + 1)
|
||||
qdel(src)
|
||||
if(3)
|
||||
if(prob(5))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.forceMove(src.loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/closet/blob_act()
|
||||
damage(100)
|
||||
|
||||
/obj/structure/closet/proc/damage(var/damage)
|
||||
health -= damage
|
||||
if(health <= 0)
|
||||
for(var/atom/movable/A in src)
|
||||
A.forceMove(src.loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/closet/bullet_act(var/obj/item/projectile/Proj)
|
||||
var/proj_damage = Proj.get_structure_damage()
|
||||
if(!proj_damage)
|
||||
return
|
||||
|
||||
..()
|
||||
damage(proj_damage)
|
||||
|
||||
return
|
||||
|
||||
/obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(src.opened)
|
||||
if(istype(W, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = W
|
||||
src.MouseDrop_T(G.affecting, user) //act like they were dragged onto the closet
|
||||
return 0
|
||||
if(istype(W,/obj/item/tk_grab))
|
||||
return 0
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(!WT.remove_fuel(0,user))
|
||||
if(!WT.isOn())
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You need more welding fuel to complete this task.</span>")
|
||||
return
|
||||
playsound(src, WT.usesound, 50)
|
||||
new /obj/item/stack/material/steel(src.loc)
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("<span class='notice'>\The [src] has been cut apart by [user] with \the [WT].</span>", 3, "You hear welding.", 2)
|
||||
qdel(src)
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/storage/laundry_basket) && W.contents.len)
|
||||
var/obj/item/weapon/storage/laundry_basket/LB = W
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/obj/item/I in LB.contents)
|
||||
LB.remove_from_storage(I, T)
|
||||
user.visible_message("<span class='notice'>[user] empties \the [LB] into \the [src].</span>", \
|
||||
"<span class='notice'>You empty \the [LB] into \the [src].</span>", \
|
||||
"<span class='notice'>You hear rustling of clothes.</span>")
|
||||
return
|
||||
if(isrobot(user))
|
||||
return
|
||||
if(W.loc != user) // This should stop mounted modules ending up outside the module.
|
||||
return
|
||||
usr.drop_item()
|
||||
if(W)
|
||||
W.forceMove(src.loc)
|
||||
else if(istype(W, /obj/item/weapon/packageWrap))
|
||||
return
|
||||
else if(seal_tool)
|
||||
if(istype(W, seal_tool))
|
||||
var/obj/item/weapon/S = W
|
||||
if(istype(S, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = S
|
||||
if(!WT.remove_fuel(0,user))
|
||||
if(!WT.isOn())
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You need more welding fuel to complete this task.</span>")
|
||||
return
|
||||
if(do_after(user, 20 * S.toolspeed))
|
||||
playsound(src, S.usesound, 50)
|
||||
src.sealed = !src.sealed
|
||||
src.update_icon()
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("<span class='warning'>[src] has been [sealed?"sealed":"unsealed"] by [user.name].</span>", 3)
|
||||
else if(W.is_wrench())
|
||||
if(sealed)
|
||||
if(anchored)
|
||||
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
|
||||
else
|
||||
user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
|
||||
playsound(src, W.usesound, 50)
|
||||
if(do_after(user, 20 * W.toolspeed))
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='notice'>You [anchored? "un" : ""]secured \the [src]!</span>")
|
||||
anchored = !anchored
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/structure/closet/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
|
||||
if(istype(O, /obj/screen)) //fix for HUD elements making their way into the world -Pete
|
||||
return
|
||||
if(O.loc == user)
|
||||
return
|
||||
if(user.restrained() || user.stat || user.weakened || user.stunned || user.paralysis)
|
||||
return
|
||||
if((!( istype(O, /atom/movable) ) || O.anchored || !Adjacent(user) || !Adjacent(O) || !user.Adjacent(O) || user.contents.Find(src)))
|
||||
return
|
||||
if(!isturf(user.loc)) // are you in a container/closet/pod/etc?
|
||||
return
|
||||
if(!src.opened)
|
||||
return
|
||||
if(istype(O, /obj/structure/closet))
|
||||
return
|
||||
step_towards(O, src.loc)
|
||||
if(user != O)
|
||||
user.show_viewers("<span class='danger'>[user] stuffs [O] into [src]!</span>")
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/structure/closet/attack_robot(mob/user)
|
||||
if(Adjacent(user))
|
||||
attack_hand(user)
|
||||
|
||||
/obj/structure/closet/relaymove(mob/user as mob)
|
||||
if(user.stat || !isturf(src.loc))
|
||||
return
|
||||
|
||||
if(!src.open())
|
||||
to_chat(user, "<span class='notice'>It won't budge!</span>")
|
||||
|
||||
/obj/structure/closet/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
src.toggle(user)
|
||||
|
||||
// tk grab then use on self
|
||||
/obj/structure/closet/attack_self_tk(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
if(!src.toggle())
|
||||
to_chat(usr, "<span class='notice'>It won't budge!</span>")
|
||||
|
||||
/obj/structure/closet/verb/verb_toggleopen()
|
||||
set src in oview(1)
|
||||
set category = "Object"
|
||||
set name = "Toggle Open"
|
||||
|
||||
if(!usr.canmove || usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
if(ishuman(usr) || isrobot(usr))
|
||||
src.add_fingerprint(usr)
|
||||
src.toggle(usr)
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
|
||||
|
||||
/obj/structure/closet/update_icon()//Putting the sealed stuff in updateicon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
|
||||
overlays.Cut()
|
||||
if(!opened)
|
||||
icon_state = icon_closed
|
||||
if(sealed)
|
||||
overlays += "welded"
|
||||
else
|
||||
icon_state = icon_opened
|
||||
|
||||
/obj/structure/closet/attack_generic(var/mob/user, var/damage, var/attack_message = "destroys")
|
||||
if(damage < STRUCTURE_MIN_DAMAGE_THRESHOLD)
|
||||
return
|
||||
user.do_attack_animation(src)
|
||||
visible_message("<span class='danger'>[user] [attack_message] the [src]!</span>")
|
||||
dump_contents()
|
||||
spawn(1) qdel(src)
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/proc/req_breakout()
|
||||
if(opened)
|
||||
return 0 //Door's open... wait, why are you in it's contents then?
|
||||
if(!sealed)
|
||||
return 0 //closed but not sealed...
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/container_resist(var/mob/living/escapee)
|
||||
if(breakout || !req_breakout())
|
||||
return
|
||||
|
||||
escapee.setClickCooldown(100)
|
||||
|
||||
//okay, so the closet is either sealed or locked... resist!!!
|
||||
to_chat(escapee, "<span class='warning'>You lean on the back of \the [src] and start pushing the door open. (this will take about [breakout_time] minutes)</span>")
|
||||
|
||||
visible_message("<span class='danger'>\The [src] begins to shake violently!</span>")
|
||||
|
||||
breakout = 1 //can't think of a better way to do this right now.
|
||||
for(var/i in 1 to (6*breakout_time * 2)) //minutes * 6 * 5seconds * 2
|
||||
if(!do_after(escapee, 50)) //5 seconds
|
||||
breakout = 0
|
||||
return
|
||||
if(!escapee || escapee.incapacitated() || escapee.loc != src)
|
||||
breakout = 0
|
||||
return //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened
|
||||
//Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'...
|
||||
if(!req_breakout())
|
||||
breakout = 0
|
||||
return
|
||||
|
||||
playsound(src, breakout_sound, 100, 1)
|
||||
animate_shake()
|
||||
add_fingerprint(escapee)
|
||||
|
||||
//Well then break it!
|
||||
breakout = 0
|
||||
to_chat(escapee, "<span class='warning'>You successfully break out!</span>")
|
||||
visible_message("<span class='danger'>\The [escapee] successfully broke out of \the [src]!</span>")
|
||||
playsound(src, breakout_sound, 100, 1)
|
||||
break_open()
|
||||
animate_shake()
|
||||
|
||||
/obj/structure/closet/proc/break_open()
|
||||
sealed = 0
|
||||
update_icon()
|
||||
//Do this to prevent contents from being opened into nullspace (read: bluespace)
|
||||
if(istype(loc, /obj/structure/bigDelivery))
|
||||
var/obj/structure/bigDelivery/BD = loc
|
||||
BD.unwrap()
|
||||
open()
|
||||
|
||||
/obj/structure/closet/proc/animate_shake()
|
||||
var/init_px = pixel_x
|
||||
var/shake_dir = pick(-1, 1)
|
||||
animate(src, transform=turn(matrix(), 8*shake_dir), pixel_x=init_px + 2*shake_dir, time=1)
|
||||
animate(transform=null, pixel_x=init_px, time=6, easing=ELASTIC_EASING)
|
||||
|
||||
/obj/structure/closet/onDropInto(var/atom/movable/AM)
|
||||
return
|
||||
|
||||
/obj/structure/closet/AllowDrop()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/closet/return_air_for_internal_lifeform(var/mob/living/L)
|
||||
if(src.loc)
|
||||
if(istype(src.loc, /obj/structure/closet))
|
||||
return (loc.return_air_for_internal_lifeform(L))
|
||||
return return_air()
|
||||
|
||||
/obj/structure/closet/take_damage(var/damage)
|
||||
if(damage < STRUCTURE_MIN_DAMAGE_THRESHOLD)
|
||||
return
|
||||
dump_contents()
|
||||
spawn(1) qdel(src)
|
||||
return 1
|
||||
|
||||
@@ -78,8 +78,8 @@
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src.loc)
|
||||
spark_system.start()
|
||||
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
|
||||
playsound(src.loc, "sparks", 50, 1)
|
||||
playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
|
||||
playsound(src, "sparks", 50, 1)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Access Denied</span>")
|
||||
return
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
return
|
||||
if(src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
playsound(src, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
for(var/mob/O in viewers(user, 3))
|
||||
if((O.client && !( O.blinded )))
|
||||
to_chat(O, "<span class='notice'>The locker has been [locked ? null : "un"]locked by [user].</span>")
|
||||
@@ -86,8 +86,8 @@
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src.loc)
|
||||
spark_system.start()
|
||||
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
|
||||
playsound(src.loc, "sparks", 50, 1)
|
||||
playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
|
||||
playsound(src, "sparks", 50, 1)
|
||||
else if(W.is_wrench())
|
||||
if(sealed)
|
||||
if(anchored)
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
if(usr.stunned)
|
||||
return 2
|
||||
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
playsound(src, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
for(var/obj/O in src)
|
||||
O.forceMove(get_turf(src))
|
||||
icon_state = icon_opened
|
||||
@@ -50,7 +50,7 @@
|
||||
if(!src.can_close())
|
||||
return 0
|
||||
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
playsound(src, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
var/itemcount = 0
|
||||
for(var/obj/O in get_turf(src))
|
||||
if(itemcount >= storage_capacity)
|
||||
@@ -97,7 +97,7 @@
|
||||
else if(W.is_wirecutter())
|
||||
if(rigged)
|
||||
to_chat(user , "<span class='notice'>You cut away the wiring.</span>")
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
rigged = 0
|
||||
return
|
||||
else return attack_hand(user)
|
||||
@@ -206,7 +206,7 @@
|
||||
overlays += emag
|
||||
overlays += sparks
|
||||
spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface*
|
||||
playsound(src.loc, "sparks", 60, 1)
|
||||
playsound(src, "sparks", 60, 1)
|
||||
src.locked = 0
|
||||
src.broken = 1
|
||||
to_chat(user, "<span class='notice'>You unlock \the [src].</span>")
|
||||
@@ -225,7 +225,7 @@
|
||||
overlays += emag
|
||||
overlays += sparks
|
||||
spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface*
|
||||
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
|
||||
playsound(src, 'sound/effects/sparks4.ogg', 75, 1)
|
||||
src.locked = 0
|
||||
if(!opened && prob(20/severity))
|
||||
if(!locked)
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
if(!T)
|
||||
to_chat(user, "<span class='notice'>You can't open this here!</span>")
|
||||
if(W.is_wrench() && do_after(user, 60 * W.toolspeed, src))
|
||||
playsound(loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
disassemble(W, user)
|
||||
user.visible_message("<span class='notice'>[user] begins loosening \the [src]'s bolts.</span>")
|
||||
if(W.is_wirecutter() && do_after(user, 70 * W.toolspeed, src))
|
||||
playsound(loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
disassemble(W, user)
|
||||
user.visible_message("<span class='notice'>[user] begins cutting \the [src]'s bolts.</span>")
|
||||
else
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
..(P, def_zone)
|
||||
|
||||
/obj/structure/curtain/attack_hand(mob/user)
|
||||
playsound(get_turf(loc), "rustle", 15, 1, -5)
|
||||
playsound(src, "rustle", 15, 1, -5)
|
||||
toggle()
|
||||
..()
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
playsound(src, "shatter", 70, 1)
|
||||
update_icon()
|
||||
else
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
return
|
||||
|
||||
/obj/structure/displaycase/update_icon()
|
||||
@@ -57,7 +57,7 @@
|
||||
/obj/structure/displaycase/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
user.setClickCooldown(user.get_attack_speed(W))
|
||||
user.do_attack_animation(src)
|
||||
playsound(loc, 'sound/effects/Glasshit.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 50, 1)
|
||||
src.health -= W.force
|
||||
src.healthcheck()
|
||||
..()
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
if (S)
|
||||
if (S.get_amount() >= 1)
|
||||
if(material_name == "rglass")
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
|
||||
playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
|
||||
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
|
||||
if(do_after(user, 40) && !glass)
|
||||
if (S.use(1))
|
||||
@@ -280,7 +280,7 @@
|
||||
to_chat(user, "You cannot make an airlock out of that material.")
|
||||
return
|
||||
if(S.get_amount() >= 2)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
|
||||
playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
|
||||
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
|
||||
if(do_after(user, 40) && !glass)
|
||||
if (S.use(2))
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
if(O.is_wrench())
|
||||
if(!has_extinguisher)
|
||||
to_chat(user, "<span class='notice'>You start to unwrench the extinguisher cabinet.</span>")
|
||||
playsound(src.loc, O.usesound, 50, 1)
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
if(do_after(user, 15 * O.toolspeed))
|
||||
to_chat(user, "<span class='notice'>You unwrench the extinguisher cabinet.</span>")
|
||||
new /obj/item/frame/extinguisher_cabinet( src.loc )
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
if (isrobot(user) || locked)
|
||||
if(istype(O, /obj/item/device/multitool))
|
||||
to_chat(user, "<span class='warning'>Resetting circuitry...</span>")
|
||||
playsound(user, 'sound/machines/lockreset.ogg', 50, 1)
|
||||
playsound(src, 'sound/machines/lockreset.ogg', 50, 1)
|
||||
if(do_after(user, 20 * O.toolspeed))
|
||||
locked = 0
|
||||
to_chat(user, "<span class = 'caution'> You disable the locking modules.</span>")
|
||||
@@ -44,13 +44,13 @@
|
||||
toggle_close_open()
|
||||
return
|
||||
else
|
||||
playsound(user, 'sound/effects/Glasshit.ogg', 100, 1) //We don't want this playing every time
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 100, 1) //We don't want this playing every time
|
||||
if(W.force < 15)
|
||||
to_chat(user, "<span class='notice'>The cabinet's protective glass glances off the hit.</span>")
|
||||
else
|
||||
hitstaken++
|
||||
if(hitstaken == 4)
|
||||
playsound(user, 'sound/effects/Glassbr3.ogg', 100, 1) //Break cabinet, receive goodies. Cabinet's fucked for life after that.
|
||||
playsound(src, 'sound/effects/Glassbr3.ogg', 100, 1) //Break cabinet, receive goodies. Cabinet's fucked for life after that.
|
||||
smashed = 1
|
||||
locked = 0
|
||||
open= 1
|
||||
@@ -82,7 +82,7 @@
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Resetting circuitry...</span>")
|
||||
playsound(user, 'sound/machines/lockenable.ogg', 50, 1)
|
||||
playsound(src, 'sound/machines/lockenable.ogg', 50, 1)
|
||||
if(do_after(user,20 * O.toolspeed))
|
||||
locked = 1
|
||||
to_chat(user, "<span class = 'caution'> You re-enable the locking modules.</span>")
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
if(user.a_intent == I_HURT)
|
||||
user.setClickCooldown(user.get_attack_speed())
|
||||
flick("[icon_state]_hit", src)
|
||||
playsound(src.loc, 'sound/effects/woodhit.ogg', 25, 1, -1)
|
||||
playsound(src, 'sound/effects/woodhit.ogg', 25, 1, -1)
|
||||
user.do_attack_animation(src)
|
||||
user.nutrition = user.nutrition - 5
|
||||
to_chat(user, "<span class='warning'>You [pick(hit_message)] \the [src].</span>")
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
/obj/structure/fitness/weightlifter/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_wrench())
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 75, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 75, 1)
|
||||
weight = ((weight) % qualifiers.len) + 1
|
||||
to_chat(user, "You set the machine's weight level to [weight].")
|
||||
|
||||
@@ -52,12 +52,12 @@
|
||||
return
|
||||
else
|
||||
being_used = 1
|
||||
playsound(src.loc, 'sound/effects/weightlifter.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/weightlifter.ogg', 50, 1)
|
||||
user.set_dir(SOUTH)
|
||||
flick("[icon_state]_[weight]", src)
|
||||
if(do_after(user, 20 + (weight * 10)))
|
||||
playsound(src.loc, 'sound/effects/weightdrop.ogg', 25, 1)
|
||||
user.nutrition -= weight * 10
|
||||
playsound(src, 'sound/effects/weightdrop.ogg', 25, 1)
|
||||
user.adjust_nutrition(weight * -10)
|
||||
to_chat(user, "<span class='notice'>You lift the weights [qualifiers[weight]].</span>")
|
||||
being_used = 0
|
||||
else
|
||||
|
||||
@@ -58,9 +58,9 @@
|
||||
damage_to_do = round(damage_to_do / 4)
|
||||
if(damage_to_do > 0)
|
||||
if(W.sharp && W.edge)
|
||||
playsound(get_turf(src), 'sound/effects/woodcutting.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/woodcutting.ogg', 50, 1)
|
||||
else
|
||||
playsound(get_turf(src), W.hitsound, 50, 1)
|
||||
playsound(src, W.hitsound, 50, 1)
|
||||
if(damage_to_do > 5 && !indestructable)
|
||||
adjust_health(-damage_to_do)
|
||||
else
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
/obj/structure/grille/attack_hand(mob/user as mob)
|
||||
|
||||
user.setClickCooldown(user.get_attack_speed())
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
playsound(src, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
user.do_attack_animation(src)
|
||||
|
||||
var/damage_dealt = 1
|
||||
@@ -153,7 +153,7 @@
|
||||
else if((W.flags & NOCONDUCT) || !shock(user, 70))
|
||||
user.setClickCooldown(user.get_attack_speed(W))
|
||||
user.do_attack_animation(src)
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
playsound(src, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
switch(W.damtype)
|
||||
if("fire")
|
||||
health -= W.force
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
/obj/structure/inflatable/proc/hit(var/damage, var/sound_effect = 1)
|
||||
health = max(0, health - damage)
|
||||
if(sound_effect)
|
||||
playsound(loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
if(health <= 0)
|
||||
puncture()
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/inflatable/proc/deflate()
|
||||
playsound(loc, 'sound/machines/hiss.ogg', 75, 1)
|
||||
playsound(src, 'sound/machines/hiss.ogg', 75, 1)
|
||||
//to_chat(user, "<span class='notice'>You slowly deflate the inflatable wall.</span>")
|
||||
visible_message("[src] slowly deflates.")
|
||||
spawn(50)
|
||||
@@ -111,7 +111,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/inflatable/proc/puncture()
|
||||
playsound(loc, 'sound/machines/hiss.ogg', 75, 1)
|
||||
playsound(src, 'sound/machines/hiss.ogg', 75, 1)
|
||||
visible_message("[src] rapidly deflates!")
|
||||
var/obj/item/inflatable/torn/R = new /obj/item/inflatable/torn(loc)
|
||||
src.transfer_fingerprints_to(R)
|
||||
@@ -227,7 +227,7 @@
|
||||
icon_state = "door_closed"
|
||||
|
||||
/obj/structure/inflatable/door/deflate()
|
||||
playsound(loc, 'sound/machines/hiss.ogg', 75, 1)
|
||||
playsound(src, 'sound/machines/hiss.ogg', 75, 1)
|
||||
visible_message("[src] slowly deflates.")
|
||||
spawn(50)
|
||||
var/obj/item/inflatable/door/R = new /obj/item/inflatable/door(loc)
|
||||
@@ -235,7 +235,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/inflatable/door/puncture()
|
||||
playsound(loc, 'sound/machines/hiss.ogg', 75, 1)
|
||||
playsound(src, 'sound/machines/hiss.ogg', 75, 1)
|
||||
visible_message("[src] rapidly deflates!")
|
||||
var/obj/item/inflatable/door/torn/R = new /obj/item/inflatable/door/torn(loc)
|
||||
src.transfer_fingerprints_to(R)
|
||||
|
||||
@@ -329,7 +329,7 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart)
|
||||
if(reagents.total_volume > 1)
|
||||
reagents.trans_to_obj(I, 2)
|
||||
to_chat(user, "<span class='notice'>You wet [I] in the [callme].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
playsound(src, 'sound/effects/slosh.ogg', 25, 1)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>This [callme] is out of water!</span>")
|
||||
else if(istype(I, /obj/item/key))
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
/obj/structure/mirror/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(I.is_wrench())
|
||||
if(!glass)
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
if(do_after(user, 20 * I.toolspeed))
|
||||
to_chat(user, "<span class='notice'>You unfasten the frame.</span>")
|
||||
new /obj/item/frame/mirror( src.loc )
|
||||
@@ -65,7 +65,7 @@
|
||||
new /obj/item/weapon/material/shard( src.loc )
|
||||
return
|
||||
if(!shattered && glass)
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You remove the glass.</span>")
|
||||
glass = !glass
|
||||
icon_state = "mirror_frame"
|
||||
@@ -88,7 +88,7 @@
|
||||
return
|
||||
|
||||
if(shattered && glass)
|
||||
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
|
||||
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
|
||||
return
|
||||
|
||||
if(prob(I.force * 2))
|
||||
@@ -97,13 +97,13 @@
|
||||
shatter()
|
||||
else
|
||||
visible_message("<span class='warning'>[user] hits [src] with [I]!</span>")
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 70, 1)
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 70, 1)
|
||||
|
||||
/obj/structure/mirror/attack_generic(var/mob/user, var/damage)
|
||||
|
||||
user.do_attack_animation(src)
|
||||
if(shattered && glass)
|
||||
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
|
||||
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
|
||||
return 0
|
||||
|
||||
if(damage)
|
||||
|
||||
@@ -28,4 +28,4 @@ GLOBAL_LIST_BOILERPLATE(all_mopbuckets, /obj/structure/mopbucket)
|
||||
else
|
||||
reagents.trans_to_obj(I, 5)
|
||||
to_chat(user, "<span class='notice'>You wet \the [I] in \the [src].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
playsound(src, 'sound/effects/slosh.ogg', 25, 1)
|
||||
|
||||
@@ -95,13 +95,13 @@
|
||||
for(var/atom/movable/A as mob|obj in src.connected.loc)
|
||||
if (!( A.anchored ))
|
||||
A.forceMove(src)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
qdel(src.connected)
|
||||
src.connected = null
|
||||
|
||||
|
||||
/obj/structure/morgue/proc/open()
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
src.connected = new /obj/structure/m_tray( src.loc )
|
||||
step(src.connected, src.dir)
|
||||
src.connected.layer = OBJ_LAYER
|
||||
@@ -225,11 +225,11 @@ GLOBAL_LIST_BOILERPLATE(all_crematoriums, /obj/structure/morgue/crematorium)
|
||||
for(var/atom/movable/A as mob|obj in src.connected.loc)
|
||||
if (!( A.anchored ))
|
||||
A.forceMove(src)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
//src.connected = null
|
||||
qdel(src.connected)
|
||||
else if (src.locked == 0)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
src.connected = new /obj/structure/m_tray/c_tray( src.loc )
|
||||
step(src.connected, EAST)
|
||||
src.connected.layer = OBJ_LAYER
|
||||
@@ -319,7 +319,7 @@ GLOBAL_LIST_BOILERPLATE(all_crematoriums, /obj/structure/morgue/crematorium)
|
||||
sleep(30)
|
||||
cremating = 0
|
||||
locked = 0
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
playsound(src, 'sound/machines/ding.ogg', 50, 1)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@
|
||||
/obj/structure/device/piano/attackby(obj/item/O as obj, mob/user as mob)
|
||||
if(O.is_wrench())
|
||||
if(anchored)
|
||||
playsound(src.loc, O.usesound, 50, 1)
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to loosen \the [src]'s casters...</span>")
|
||||
if (do_after(user, 40 * O.toolspeed))
|
||||
user.visible_message( \
|
||||
@@ -354,7 +354,7 @@
|
||||
"You hear ratchet.")
|
||||
src.anchored = 0
|
||||
else
|
||||
playsound(src.loc, O.usesound, 50, 1)
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to tighten \the [src] to the floor...</span>")
|
||||
if (do_after(user, 20 * O.toolspeed))
|
||||
user.visible_message( \
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
to_chat(user, "<span class='notice'>You reach to pin your paper to the board but hesitate. You are certain your paper will not be seen among the many others already attached.</span>")
|
||||
if(O.is_wrench())
|
||||
to_chat(user, "<span class='notice'>You start to unwrench the noticeboard.</span>")
|
||||
playsound(src.loc, O.usesound, 50, 1)
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
if(do_after(user, 15 * O.toolspeed))
|
||||
to_chat(user, "<span class='notice'>You unwrench the noticeboard.</span>")
|
||||
new /obj/item/frame/noticeboard( src.loc )
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
if(prob(1 + damage * 3))
|
||||
visible_message("<span class='danger'>[shatter_message]</span>")
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
playsound(get_turf(src),shatter_sound, 75, 1)
|
||||
playsound(src,shatter_sound, 75, 1)
|
||||
isbroken = 1
|
||||
density = 0
|
||||
icon_state = "[initial(icon_state)]-broken"
|
||||
@@ -53,21 +53,21 @@
|
||||
)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
user.do_attack_animation(src)
|
||||
playsound(get_turf(src),shatter_sound, 75, 1)
|
||||
playsound(src,shatter_sound, 75, 1)
|
||||
isbroken = 1
|
||||
density = 0
|
||||
icon_state = "[initial(icon_state)]-broken"
|
||||
set_light(0)
|
||||
else
|
||||
to_chat(user, "You hit \the [src]!")
|
||||
playsound(get_turf(src),impact_sound, 75, 1)
|
||||
playsound(src,impact_sound, 75, 1)
|
||||
else
|
||||
if(prob(damage * 2))
|
||||
to_chat(user, "You pulverize what was left of \the [src]!")
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "You hit \the [src]!")
|
||||
playsound(get_turf(src),impact_sound, 75, 1)
|
||||
playsound(src,impact_sound, 75, 1)
|
||||
|
||||
/obj/structure/cult/pylon/swarm/pylon_unique()
|
||||
. = ..()
|
||||
@@ -117,7 +117,7 @@
|
||||
if(prob(1 + damage * 3) && damage >= 25)
|
||||
visible_message("<span class='danger'>[shatter_message]</span>")
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
playsound(get_turf(src),shatter_sound, 75, 1)
|
||||
playsound(src,shatter_sound, 75, 1)
|
||||
isbroken = 1
|
||||
density = 0
|
||||
icon_state = "[initial(icon_state)]-broken"
|
||||
@@ -133,18 +133,18 @@
|
||||
)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
user.do_attack_animation(src)
|
||||
playsound(get_turf(src),shatter_sound, 75, 1)
|
||||
playsound(src,shatter_sound, 75, 1)
|
||||
isbroken = 1
|
||||
density = 0
|
||||
icon_state = "[initial(icon_state)]-broken"
|
||||
set_light(0)
|
||||
else
|
||||
to_chat(user, "You hit \the [src]!")
|
||||
playsound(get_turf(src),impact_sound, 75, 1)
|
||||
playsound(src,impact_sound, 75, 1)
|
||||
else
|
||||
if(prob(damage * 3))
|
||||
to_chat(user, "You pulverize what was left of \the [src]!")
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "You hit \the [src]!")
|
||||
playsound(get_turf(src),impact_sound, 75, 1)
|
||||
playsound(src,impact_sound, 75, 1)
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
health -= amount
|
||||
if(health <= 0)
|
||||
visible_message("<span class='warning'>\The [src] breaks down!</span>")
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/grillehit.ogg', 50, 1)
|
||||
new /obj/item/stack/rods(get_turf(src))
|
||||
qdel(src)
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
/obj/structure/railing/attackby(obj/item/W as obj, mob/user as mob)
|
||||
// Dismantle
|
||||
if(W.is_wrench() && !anchored)
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
if(do_after(user, 20, src))
|
||||
user.visible_message("<span class='notice'>\The [user] dismantles \the [src].</span>", "<span class='notice'>You dismantle \the [src].</span>")
|
||||
new /obj/item/stack/material/steel(get_turf(usr), 2)
|
||||
@@ -214,7 +214,7 @@
|
||||
if(health < maxhealth && istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/F = W
|
||||
if(F.welding)
|
||||
playsound(src.loc, F.usesound, 50, 1)
|
||||
playsound(src, F.usesound, 50, 1)
|
||||
if(do_after(user, 20, src))
|
||||
user.visible_message("<span class='notice'>\The [user] repairs some damage to \the [src].</span>", "<span class='notice'>You repair some damage to \the [src].</span>")
|
||||
health = min(health+(maxhealth/5), maxhealth) // 20% repair per application
|
||||
@@ -223,7 +223,7 @@
|
||||
// Install
|
||||
if(W.is_screwdriver())
|
||||
user.visible_message(anchored ? "<span class='notice'>\The [user] begins unscrewing \the [src].</span>" : "<span class='notice'>\The [user] begins fasten \the [src].</span>" )
|
||||
playsound(loc, W.usesound, 75, 1)
|
||||
playsound(src, W.usesound, 75, 1)
|
||||
if(do_after(user, 10, src))
|
||||
to_chat(user, (anchored ? "<span class='notice'>You have unfastened \the [src] from the floor.</span>" : "<span class='notice'>You have fastened \the [src] to the floor.</span>"))
|
||||
anchored = !anchored
|
||||
@@ -245,7 +245,7 @@
|
||||
M.apply_damage(8,def_zone = "head")
|
||||
take_damage(8)
|
||||
visible_message("<span class='danger'>[G.assailant] slams [G.affecting]'s face against \the [src]!</span>")
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/grillehit.ogg', 50, 1)
|
||||
else
|
||||
to_chat(user, "<span class='danger'>You need a better grip to do that!</span>")
|
||||
return
|
||||
@@ -260,7 +260,7 @@
|
||||
return
|
||||
|
||||
else
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/grillehit.ogg', 50, 1)
|
||||
take_damage(W.force)
|
||||
user.setClickCooldown(user.get_attack_speed(W))
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ FLOOR SAFES
|
||||
tumbler_2_pos = decrement(tumbler_2_pos)
|
||||
if(canhear)
|
||||
to_chat(user, "<span class='notice'>You hear a [pick("click", "chink", "clink")] from \the [src].</span>")
|
||||
playsound(user, 'sound/machines/click.ogg', 20, 1)
|
||||
playsound(src, 'sound/machines/click.ogg', 20, 1)
|
||||
check_unlocked(user, canhear)
|
||||
|
||||
updateUsrDialog()
|
||||
@@ -130,7 +130,7 @@ FLOOR SAFES
|
||||
tumbler_2_pos = increment(tumbler_2_pos)
|
||||
if(canhear)
|
||||
to_chat(user, "<span class='notice'>You hear a [pick("click", "chink", "clink")] from \the [src].</span>")
|
||||
playsound(user, 'sound/machines/click.ogg', 20, 1)
|
||||
playsound(src, 'sound/machines/click.ogg', 20, 1)
|
||||
check_unlocked(user, canhear)
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
/obj/structure/salvageable/attackby(obj/item/I, mob/user)
|
||||
if(I.is_crowbar())
|
||||
playsound(loc, I.usesound, 50, 1)
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
var/actual_time = I.toolspeed * 170
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] begins salvaging from \the [src].</span>", \
|
||||
@@ -240,7 +240,7 @@ obj/structure/salvageable/bliss/Initialize()
|
||||
|
||||
/obj/structure/salvageable/bliss/attackby(obj/item/I, mob/user)
|
||||
if((. = ..()))
|
||||
playsound(user, 'sound/machines/shutdown.ogg', 60, 1)
|
||||
playsound(src, 'sound/machines/shutdown.ogg', 60, 1)
|
||||
|
||||
//////////////////
|
||||
//// ONE STAR ////
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
/obj/structure/simple_door/proc/Open()
|
||||
isSwitchingStates = 1
|
||||
playsound(loc, material.dooropen_noise, 100, 1)
|
||||
playsound(src, material.dooropen_noise, 100, 1)
|
||||
flick("[material.door_icon_base]opening",src)
|
||||
sleep(10)
|
||||
density = 0
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
/obj/structure/simple_door/proc/Close()
|
||||
isSwitchingStates = 1
|
||||
playsound(loc, material.dooropen_noise, 100, 1)
|
||||
playsound(src, material.dooropen_noise, 100, 1)
|
||||
flick("[material.door_icon_base]closing",src)
|
||||
sleep(10)
|
||||
density = 1
|
||||
@@ -135,9 +135,9 @@
|
||||
hardness -= W.force/10
|
||||
visible_message("<span class='danger'>[user] hits [src] with [W]!</span>")
|
||||
if(material == get_material_by_name("resin"))
|
||||
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
|
||||
playsound(src, 'sound/effects/attackblob.ogg', 100, 1)
|
||||
else if(material == (get_material_by_name(MAT_WOOD) || get_material_by_name(MAT_SIFWOOD)))
|
||||
playsound(loc, 'sound/effects/woodcutting.ogg', 100, 1)
|
||||
playsound(src, 'sound/effects/woodcutting.ogg', 100, 1)
|
||||
else
|
||||
playsound(src, 'sound/weapons/smash.ogg', 50, 1)
|
||||
CheckHardness()
|
||||
@@ -160,9 +160,9 @@
|
||||
/obj/structure/simple_door/attack_generic(var/mob/user, var/damage, var/attack_verb)
|
||||
visible_message("<span class='danger'>[user] [attack_verb] the [src]!</span>")
|
||||
if(material == get_material_by_name("resin"))
|
||||
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
|
||||
playsound(src, 'sound/effects/attackblob.ogg', 100, 1)
|
||||
else if(material == (get_material_by_name(MAT_WOOD) || get_material_by_name(MAT_SIFWOOD)))
|
||||
playsound(loc, 'sound/effects/woodcutting.ogg', 100, 1)
|
||||
playsound(src, 'sound/effects/woodcutting.ogg', 100, 1)
|
||||
else
|
||||
playsound(src, 'sound/weapons/smash.ogg', 50, 1)
|
||||
user.do_attack_animation(src)
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
/obj/structure/bed/nest/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
var/aforce = W.force
|
||||
health = max(0, health - aforce)
|
||||
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
|
||||
playsound(src, 'sound/effects/attackblob.ogg', 100, 1)
|
||||
for(var/mob/M in viewers(src, 7))
|
||||
M.show_message("<span class='warning'>[user] hits [src] with [W]!</span>", 1)
|
||||
healthcheck()
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
to_chat(user, "\The [src] has no padding to remove.")
|
||||
return
|
||||
to_chat(user, "You remove the padding from \the [src].")
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
remove_padding()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/grab))
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
return
|
||||
user.drop_item()
|
||||
var/obj/structure/bed/chair/e_chair/E = new (src.loc, material.name)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
E.set_dir(dir)
|
||||
E.part = SK
|
||||
SK.loc = E
|
||||
@@ -188,7 +188,7 @@
|
||||
occupant.apply_effect(6, WEAKEN, blocked)
|
||||
occupant.apply_effect(6, STUTTER, blocked)
|
||||
occupant.apply_damage(10, BRUTE, def_zone, blocked, soaked)
|
||||
playsound(src.loc, 'sound/weapons/punch1.ogg', 50, 1, -1)
|
||||
playsound(src, 'sound/weapons/punch1.ogg', 50, 1, -1)
|
||||
if(istype(A, /mob/living))
|
||||
var/mob/living/victim = A
|
||||
def_zone = ran_zone()
|
||||
|
||||
@@ -145,7 +145,7 @@ var/global/list/stool_cache = list() //haha stool
|
||||
to_chat(user, "\The [src] has no padding to remove.")
|
||||
return
|
||||
to_chat(user, "You remove the padding from \the [src].")
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
remove_padding()
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
occupant.apply_effect(6, WEAKEN, blocked)
|
||||
occupant.apply_effect(6, STUTTER, blocked)
|
||||
occupant.apply_damage(10, BRUTE, def_zone, soaked)
|
||||
playsound(src.loc, 'sound/weapons/punch1.ogg', 50, 1, -1)
|
||||
playsound(src, 'sound/weapons/punch1.ogg', 50, 1, -1)
|
||||
if(istype(A, /mob/living))
|
||||
var/mob/living/victim = A
|
||||
def_zone = ran_zone()
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
/obj/structure/toilet/attackby(obj/item/I as obj, mob/living/user as mob)
|
||||
if(I.is_crowbar())
|
||||
to_chat(user, "<span class='notice'>You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"].</span>")
|
||||
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
|
||||
if(do_after(user, 30))
|
||||
user.visible_message("<span class='notice'>[user] [cistern ? "replaces the lid on the cistern" : "lifts the lid off the cistern"]!</span>", "<span class='notice'>You [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]!</span>", "You hear grinding porcelain.")
|
||||
cistern = !cistern
|
||||
@@ -172,7 +172,7 @@
|
||||
if(I.is_wrench())
|
||||
var/newtemp = input(user, "What setting would you like to set the temperature valve to?", "Water Temperature Valve") in temperature_settings
|
||||
to_chat(user, "<span class='notice'>You begin to adjust the temperature valve with \the [I].</span>")
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
if(do_after(user, 50 * I.toolspeed))
|
||||
watertemp = newtemp
|
||||
user.visible_message("<span class='notice'>[user] adjusts the shower with \the [I].</span>", "<span class='notice'>You adjust the shower with \the [I].</span>")
|
||||
@@ -384,7 +384,7 @@
|
||||
return
|
||||
|
||||
to_chat(usr, "<span class='notice'>You start washing your hands.</span>")
|
||||
playsound(loc, 'sound/effects/sink_long.ogg', 75, 1)
|
||||
playsound(src, 'sound/effects/sink_long.ogg', 75, 1)
|
||||
|
||||
busy = 1
|
||||
sleep(40)
|
||||
@@ -407,7 +407,7 @@
|
||||
if (istype(RG) && RG.is_open_container())
|
||||
RG.reagents.add_reagent("water", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
|
||||
user.visible_message("<span class='notice'>[user] fills \the [RG] using \the [src].</span>","<span class='notice'>You fill \the [RG] using \the [src].</span>")
|
||||
playsound(loc, 'sound/effects/sink.ogg', 75, 1)
|
||||
playsound(src, 'sound/effects/sink.ogg', 75, 1)
|
||||
return 1
|
||||
|
||||
else if (istype(O, /obj/item/weapon/melee/baton))
|
||||
@@ -431,7 +431,7 @@
|
||||
else if(istype(O, /obj/item/weapon/mop))
|
||||
O.reagents.add_reagent("water", 5)
|
||||
to_chat(user, "<span class='notice'>You wet \the [O] in \the [src].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
playsound(src, 'sound/effects/slosh.ogg', 25, 1)
|
||||
return
|
||||
|
||||
var/turf/location = user.loc
|
||||
|
||||
@@ -91,7 +91,7 @@ obj/structure/windoor_assembly/Destroy()
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.remove_fuel(0,user))
|
||||
user.visible_message("[user] disassembles the windoor assembly.", "You start to disassemble the windoor assembly.")
|
||||
playsound(src.loc, WT.usesound, 50, 1)
|
||||
playsound(src, WT.usesound, 50, 1)
|
||||
|
||||
if(do_after(user, 40 * WT.toolspeed))
|
||||
if(!src || !WT.isOn()) return
|
||||
@@ -157,7 +157,7 @@ obj/structure/windoor_assembly/Destroy()
|
||||
|
||||
//Adding airlock electronics for access. Step 6 complete.
|
||||
else if(istype(W, /obj/item/weapon/airlock_electronics))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
|
||||
playsound(src, 'sound/items/Screwdriver.ogg', 100, 1)
|
||||
user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly.")
|
||||
|
||||
if(do_after(user, 40))
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
shatter()
|
||||
else
|
||||
if(sound_effect)
|
||||
playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 100, 1)
|
||||
if(health < maxhealth / 4 && initialhealth >= maxhealth / 4)
|
||||
visible_message("[src] looks like it's about to shatter!" )
|
||||
update_icon()
|
||||
@@ -172,7 +172,7 @@
|
||||
|
||||
/obj/structure/window/attack_tk(mob/user as mob)
|
||||
user.visible_message("<span class='notice'>Something knocks on [src].</span>")
|
||||
playsound(loc, 'sound/effects/Glasshit.ogg', 50, 1)
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 50, 1)
|
||||
|
||||
/obj/structure/window/attack_hand(mob/user as mob)
|
||||
user.setClickCooldown(user.get_attack_speed())
|
||||
@@ -190,13 +190,13 @@
|
||||
attack_generic(H,25)
|
||||
return
|
||||
|
||||
playsound(src.loc, 'sound/effects/glassknock.ogg', 80, 1)
|
||||
playsound(src, 'sound/effects/glassknock.ogg', 80, 1)
|
||||
user.do_attack_animation(src)
|
||||
usr.visible_message("<span class='danger'>\The [usr] bangs against \the [src]!</span>",
|
||||
"<span class='danger'>You bang against \the [src]!</span>",
|
||||
"You hear a banging sound.")
|
||||
else
|
||||
playsound(src.loc, 'sound/effects/glassknock.ogg', 80, 1)
|
||||
playsound(src, 'sound/effects/glassknock.ogg', 80, 1)
|
||||
usr.visible_message("[usr.name] knocks on the [src.name].",
|
||||
"You knock on the [src.name].",
|
||||
"You hear a knocking sound.")
|
||||
@@ -297,13 +297,13 @@
|
||||
else if(istype(W, /obj/item/stack/cable_coil) && reinf && state == 0 && !istype(src, /obj/structure/window/reinforced/polarized))
|
||||
var/obj/item/stack/cable_coil/C = W
|
||||
if (C.use(1))
|
||||
playsound(src.loc, 'sound/effects/sparks1.ogg', 75, 1)
|
||||
playsound(src, 'sound/effects/sparks1.ogg', 75, 1)
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] begins to wire \the [src] for electrochromic tinting.</span>", \
|
||||
"<span class='notice'>You begin to wire \the [src] for electrochromic tinting.</span>", \
|
||||
"You hear sparks.")
|
||||
if(do_after(user, 20 * C.toolspeed, src) && state == 0)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
var/obj/structure/window/reinforced/polarized/P = new(loc, dir)
|
||||
if(is_fulltile())
|
||||
P.fulltile = TRUE
|
||||
@@ -326,7 +326,7 @@
|
||||
update_nearby_icons()
|
||||
step(src, get_dir(user, src))
|
||||
else
|
||||
playsound(loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
playsound(src, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user