Files
Paradise/code/game/objects/stool.dm
elly1989@rocketmail.com 4073ac9b00 Replaced all 'file.extension' references with 'relativepath/file.extension' using a script by thvortex of ss13-daedalus.
All credits to the author for this handy little script.
I Committed the modified python script to tool directory. Although it needs to be in the root folder of your repo to work.

To notice the improved compile times, in dreammaker go to Build > Preferences > and untick "automatically set file_dir for subfolders"

If this commit inteferes with any large projects just revert it, do your thing, then rerun the script. Easy-peasy.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4488 316c924e-a436-60f5-8080-3fe189b3f50e
2012-08-18 16:33:40 +00:00

194 lines
5.1 KiB
Plaintext

/obj/structure/stool/ex_act(severity)
switch(severity)
if(1.0)
del(src)
return
if(2.0)
if (prob(50))
del(src)
return
if(3.0)
if (prob(5))
del(src)
return
return
/obj/structure/stool/blob_act()
if(prob(75))
new /obj/item/stack/sheet/metal(src.loc)
del(src)
/obj/structure/stool/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
new /obj/item/stack/sheet/metal(src.loc)
del(src)
return
/obj/structure/stool/bed/chair/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/assembly/shock_kit))
var/obj/structure/stool/bed/chair/e_chair/E = new /obj/structure/stool/bed/chair/e_chair(src.loc)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
E.dir = src.dir
E.part = W
W.loc = E
W.master = E
user.u_equip(W)
W.layer = initial(W.layer)
del(src)
return
return
/obj/structure/stool/bed/chair/wood/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
new /obj/item/stack/sheet/wood(src.loc)
del(src)
else
..()
/obj/structure/stool/bed/Del()
unbuckle()
..()
return
/obj/structure/stool/bed/proc/unbuckle()
if(buckled_mob)
if(buckled_mob.buckled == src) //this is probably unneccesary, but it doesn't hurt
buckled_mob.buckled = null
buckled_mob.anchored = initial(buckled_mob.anchored)
buckled_mob.update_canmove()
buckled_mob = null
return
/obj/structure/stool/bed/proc/manual_unbuckle(mob/user as mob)
if(buckled_mob)
if(buckled_mob.buckled == src)
if(buckled_mob != user)
buckled_mob.visible_message(\
"\blue [buckled_mob.name] was unbuckled by [user.name]!",\
"You unbuckled from [src] by [user.name].",\
"You hear metal clanking")
else
buckled_mob.visible_message(\
"\blue [buckled_mob.name] unbuckled himself!",\
"You unbuckle yourself from [src].",\
"You hear metal clanking")
unbuckle()
src.add_fingerprint(user)
return
/obj/structure/stool/bed/proc/buckle_mob(mob/M as mob, mob/user as mob)
if (!ticker)
user << "You can't buckle anyone in before the game starts."
if ( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.restrained() || user.lying || user.stat || M.buckled || istype(user, /mob/living/silicon/pai) )
return
unbuckle()
if (M == usr)
M.visible_message(\
"\blue [M.name] buckles in!",\
"You buckle yourself to [src].",\
"You hear metal clanking")
else
M.visible_message(\
"\blue [M.name] is buckled in to [src] by [user.name]!",\
"You are buckled in to [src] by [user.name].",\
"You hear metal clanking")
M.buckled = src
M.loc = src.loc
M.dir = src.dir
M.update_canmove()
src.buckled_mob = M
src.add_fingerprint(user)
return
/obj/structure/stool/bed/MouseDrop_T(mob/M as mob, mob/user as mob)
if(!istype(M)) return
buckle_mob(M, user)
return
/obj/structure/stool/bed/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/structure/stool/bed/attack_hand(mob/user as mob)
manual_unbuckle(user)
return
/obj/structure/stool/bed/chair/New()
if(anchored)
src.verbs -= /atom/movable/verb/pull
handle_rotation()
..()
return
/obj/structure/stool/bed/chair/proc/handle_rotation() //making this into a seperate proc so office chairs can call it on Move()
if(src.dir == NORTH)
src.layer = FLY_LAYER
else
src.layer = OBJ_LAYER
if(buckled_mob)
if(buckled_mob.loc != src.loc)
buckled_mob.buckled = null //Temporary, so Move() succeeds.
if(!buckled_mob.Move(loc))
unbuckle()
buckled_mob = null
else
buckled_mob.buckled = src //Restoring
if(buckled_mob)
buckled_mob.dir = dir
/obj/structure/stool/bed/chair/verb/rotate()
set name = "Rotate Chair"
set category = "Object"
set src in oview(1)
src.dir = turn(src.dir, 90)
handle_rotation()
return
/obj/structure/stool/bed/chair/MouseDrop_T(mob/M as mob, mob/user as mob)
if(!istype(M)) return
buckle_mob(M, user)
return
//roller bed
/obj/structure/stool/bed/roller
name = "roller bed"
icon = 'icons/obj/rollerbed.dmi'
icon_state = "down"
anchored = 0
/obj/structure/stool/bed/roller/Move()
..()
if(buckled_mob)
if(buckled_mob.buckled == src)
buckled_mob.loc = src.loc
/obj/structure/stool/bed/roller/buckle_mob(mob/M as mob, mob/user as mob)
if ( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.restrained() || user.lying || user.stat || M.buckled || istype(usr, /mob/living/silicon/pai) )
return
M.pixel_y = 6
density = 1
icon_state = "up"
..()
return
/obj/structure/stool/bed/roller/manual_unbuckle(mob/user as mob)
if(buckled_mob)
if(buckled_mob.buckled == src) //this is probably unneccesary, but it doesn't hurt
buckled_mob.pixel_y = 0
buckled_mob.anchored = initial(buckled_mob.anchored)
buckled_mob.buckled = null
buckled_mob.update_canmove()
buckled_mob = null
density = 0
icon_state = "down"
..()
return