Fixes issue 865.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4694 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
petethegoat@gmail.com
2012-09-15 23:37:20 +00:00
parent 0bbb591b3e
commit 5b33027e69
4 changed files with 106 additions and 152 deletions

View File

@@ -7,18 +7,18 @@
var/last_time = 1.0
/obj/structure/stool/bed/chair/e_chair/New()
..()
overlays += image('icons/obj/objects.dmi', src, "echair_over", MOB_LAYER + 1, dir)
return
/obj/structure/stool/bed/chair/e_chair/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
var/obj/structure/stool/bed/chair/C = new /obj/structure/stool/bed/chair(src.loc)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
C.dir = src.dir
src.part.loc = src.loc
src.part.master = null
src.part = null
var/obj/structure/stool/bed/chair/C = new /obj/structure/stool/bed/chair(loc)
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
C.dir = dir
part.loc = loc
part.master = null
part = null
del(src)
return
return
@@ -34,6 +34,7 @@
else
on = 1
icon_state = "echair1"
usr << "<span class='notice'>You switch [on ? "on" : "off"] [src].</span>"
return
/obj/structure/stool/bed/chair/e_chair/rotate()
@@ -43,11 +44,11 @@
return
/obj/structure/stool/bed/chair/e_chair/proc/shock()
if(!(src.on))
if(!on)
return
if((src.last_time + 50) > world.time)
if(last_time + 50 > world.time)
return
src.last_time = world.time
last_time = world.time
// special power handling
var/area/A = get_area(src)
@@ -65,12 +66,11 @@
s.start()
if(buckled_mob)
buckled_mob.burn_skin(85)
buckled_mob << "\red <B>You feel a deep shock course through your body!</B>"
buckled_mob << "<span class='danger'>You feel a deep shock course through your body!</span>"
sleep(1)
buckled_mob.burn_skin(85)
buckled_mob.Stun(600)
for(var/mob/M in hearers(src, null))
M.show_message("\red The electric chair went off!.", 3, "\red You hear a deep sharp shock.", 2)
visible_message("<span class='danger'>The electric chair went off!</span>", "<span class='danger'>You hear a deep sharp shock!</span>")
A.power_light = light
A.updateicon()

View File

@@ -6,25 +6,26 @@
/obj/structure/stool/bed/chair/New()
if(anchored)
src.verbs -= /atom/movable/verb/pull
handle_rotation()
..()
spawn(3) //sorry. i don't think there's a better way to do this.
handle_rotation()
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/item/assembly/shock_kit/SK = W
if(!SK.status)
user << "<span class='notice'>[SK] is not ready to be attached!</span>"
return
user.drop_item()
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)
E.dir = dir
E.part = SK
SK.loc = E
SK.master = E
del(src)
return
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)