Merge pull request #5081 from phil235/plasmadoorfix

Plasma airlock & wall slicing fixes
This commit is contained in:
Cheridan
2014-10-05 19:58:42 -05:00
4 changed files with 133 additions and 173 deletions
+11 -9
View File
@@ -889,14 +889,15 @@ About the new airlock wires panel:
src.add_fingerprint(user)
if((istype(C, /obj/item/weapon/weldingtool) && !( src.operating ) && src.density))
var/obj/item/weapon/weldingtool/W = C
user.visible_message("<span class='warning'>[user] is [welded ? "unwelding":"welding"] the airlock.</span>", \
if(W.remove_fuel(0,user))
user.visible_message("<span class='warning'>[user] is [welded ? "unwelding":"welding"] the airlock.</span>", \
"You begin [welded ? "unwelding":"welding"] the airlock...", \
"You hear welding.")
playsound(loc, 'sound/items/Welder.ogg', 40, 1)
if(do_after(user,40,5,1))
if(density && !operating)//Door must be closed to weld.
if(W.remove_fuel(0,user))
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
playsound(loc, 'sound/items/Welder.ogg', 40, 1)
if(do_after(user,40,5,1))
if(density && !operating)//Door must be closed to weld.
if( !istype(src, /obj/machinery/door/airlock) || !user || !W || !W.isOn() || !user.loc )
return playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
welded = !welded
user.visible_message("<span class='warning'>[src] has been [welded? "welded shut":"unwelded"] by [user.name].</span>", \
"<span class='notice'>You've [welded ? "welded the airlock shut":"unwelded the airlock"].</span>")
@@ -982,10 +983,11 @@ About the new airlock wires panel:
return
/obj/machinery/door/airlock/plasma/attackby(C as obj, mob/user as mob)
if(C)
message_admins("Plasma airlock ignited by [key_name(user, user.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
log_game("Plasma airlock ignited by [user.ckey]([user]) in ([x],[y],[z])")
if(is_hot(C) > 300)//If the temperature of the object is over 300, then ignite
message_admins("Plasma wall ignited by [key_name(user, user.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")
log_game("Plasma wall ignited by [user.ckey]([user]) in ([x],[y],[z])")
ignite(is_hot(C))
return
..()
/obj/machinery/door/airlock/open(var/forced=0)
@@ -179,16 +179,16 @@
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
user << "<span class='notice'>You begin cutting the [src] apart...</span>"
playsound(loc, 'sound/items/Welder.ogg', 40, 1)
if(do_after(user,40,5,1))
if(src.opened)
if(WT.remove_fuel(0,user))
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
new /obj/item/stack/sheet/metal(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)
if(WT.remove_fuel(0,user))
user << "<span class='notice'>You begin cutting the [src] apart...</span>"
playsound(loc, 'sound/items/Welder.ogg', 40, 1)
if(do_after(user,40,5,1))
if( !src.opened || !istype(src, /obj/structure/closet) || !user || !WT || !WT.isOn() || !user.loc )
return
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
new /obj/item/stack/sheet/metal(src.loc)
visible_message("<span class='notice'>\The [src] has been cut apart by [user] with \the [WT].</span>", "You hear welding.")
qdel(src)
return
if(isrobot(user))
@@ -201,16 +201,17 @@
return
else if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
user << "<span class='notice'>You begin [welded ? "unwelding":"welding"] the [src]...</span>"
playsound(loc, 'sound/items/Welder2.ogg', 40, 1)
if(do_after(user,40,5,1))
if(!src.opened)
if(WT.remove_fuel(0,user))
playsound(loc, 'sound/items/welder.ogg', 50, 1)
welded = !welded
user << "<span class='notice'>You [welded ? "welded the [src] shut":"unwelded the [src]"]</span>"
update_icon()
user.visible_message("<span class='warning'>[src] has been [welded? "welded shut":"unwelded"] by [user.name].</span>")
if(WT.remove_fuel(0,user))
user << "<span class='notice'>You begin [welded ? "unwelding":"welding"] the [src]...</span>"
playsound(loc, 'sound/items/Welder2.ogg', 40, 1)
if(do_after(user,40,5,1))
if(src.opened || !istype(src, /obj/structure/closet) || !user || !WT || !WT.isOn() || !user.loc )
return
playsound(loc, 'sound/items/welder.ogg', 50, 1)
welded = !welded
user << "<span class='notice'>You [welded ? "welded the [src] shut":"unwelded the [src]"]</span>"
update_icon()
user.visible_message("<span class='warning'>[src] has been [welded? "welded shut":"unwelded"] by [user.name].</span>")
return
else if(!place(user, W))
src.attack_hand(user)
+35 -79
View File
@@ -155,45 +155,10 @@
//THERMITE related stuff. Calls src.thermitemelt() which handles melting simulated walls and the relevant effects
if( thermite )
if( istype(W, /obj/item/weapon/weldingtool) )
var/obj/item/weapon/weldingtool/WT = W
if( WT.remove_fuel(0,user) )
thermitemelt(user)
return
else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
if(is_hot(W))
thermitemelt(user)
return
else if(istype(W, /obj/item/weapon/lighter))
var/obj/item/weapon/lighter/L = W
if(L.lit)
thermitemelt(user)
return
else if(istype(W, /obj/item/weapon/match))
var/obj/item/weapon/match/M = W
if(M.lit)
thermitemelt(user)
return
else if(istype(W, /obj/item/device/flashlight/flare/torch))
var/obj/item/device/flashlight/flare/torch/T = W
if(T.on)
thermitemelt(user)
return
else if(istype(W, /obj/item/device/assembly/igniter))
thermitemelt(user)
return
else if(istype(W, /obj/item/candle))
var/obj/item/candle/C = W
if(C.lit)
thermitemelt(user)
return
else if( istype(W, /obj/item/weapon/melee/energy/blade) )
if( istype(W, /obj/item/weapon/melee/energy/blade) )
var/obj/item/weapon/melee/energy/blade/EB = W
EB.spark_system.start()
@@ -201,16 +166,13 @@
playsound(src, "sparks", 50, 1)
playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
thermitemelt(user)
return
return
else if(istype(W, /obj/item/weapon/melee/energy/sword))
var/obj/item/weapon/melee/energy/sword/ES = W
if(ES.active)
thermitemelt(user)
return
var/turf/T = user.loc //get user's location for delay checks
var/slicing_duration = 100 //default time taken to slice the wall
if( mineral == "diamond" )
slicing_duration = 200 //diamond wall takes twice as much time
//DECONSTRUCTION
add_fingerprint(user)
@@ -221,12 +183,12 @@
user << "<span class='notice'>You begin slicing through the outer plating.</span>"
playsound(src, 'sound/items/Welder.ogg', 100, 1)
sleep(100)
if( !istype(src, /turf/simulated/wall) || !user || !WT || !WT.isOn() || !T ) return
if( user.loc == T && user.get_active_hand() == WT )
user << "<span class='notice'>You remove the outer plating.</span>"
dismantle_wall()
if(do_after(user, slicing_duration))
if( !istype(src, /turf/simulated/wall) || !user || !WT || !WT.isOn() || !T )
return
if( user.loc == T && user.get_active_hand() == WT )
user << "<span class='notice'>You remove the outer plating.</span>"
dismantle_wall()
else
return
@@ -235,16 +197,14 @@
user << "<span class='notice'>You begin slicing through the outer plating.</span>"
playsound(src, 'sound/items/Welder.ogg', 100, 1)
sleep(60)
if(mineral == "diamond")//Oh look, it's tougher
sleep(60)
if( !istype(src, /turf/simulated/wall) || !user || !W || !T ) return
if(do_after(user, slicing_duration*0.6)) // plasma cutter is faster than welding tool
if( !istype(src, /turf/simulated/wall) || !user || !W || !T )
return
if( user.loc == T && user.get_active_hand() == W )
user << "<span class='notice'>You remove the outer plating.</span>"
dismantle_wall()
for(var/mob/O in viewers(user, 5))
O.show_message("<span class='warning'>The wall was sliced apart by [user]!</span>", 1, "<span class='warning'>You hear metal being sliced apart.</span>", 2)
if( user.loc == T && user.get_active_hand() == W )
user << "<span class='notice'>You remove the outer plating.</span>"
dismantle_wall()
visible_message("<span class='warning'>The wall was sliced apart by [user]!</span>", "<span class='warning'>You hear metal being sliced apart.</span>")
return
//DRILLING
@@ -252,16 +212,14 @@
user << "<span class='notice'>You begin to drill though the wall.</span>"
sleep(60)
if(mineral == "diamond")
sleep(60)
if( !istype(src, /turf/simulated/wall) || !user || !W || !T ) return
if(do_after(user, slicing_duration*0.6)) // diamond drill is faster than welding tool slicing
if( !istype(src, /turf/simulated/wall) || !user || !W || !T )
return
if( user.loc == T && user.get_active_hand() == W )
user << "<span class='notice'>Your drill tears though the last of the reinforced plating.</span>"
dismantle_wall()
for(var/mob/O in viewers(user, 5))
O.show_message("<span class='warning'>The wall was drilled through by [user]!</span>", 1, "<span class='warning'>You hear the grinding of metal.</span>", 2)
if( user.loc == T && user.get_active_hand() == W )
user << "<span class='notice'>Your drill tears though the last of the reinforced plating.</span>"
dismantle_wall()
visible_message("<span class='warning'>The wall was drilled through by [user]!</span>", "<span class='warning'>You hear the grinding of metal.</span>")
return
else if( istype(W, /obj/item/weapon/melee/energy/blade) )
@@ -271,18 +229,16 @@
user << "<span class='notice'>You stab \the [EB] into the wall and begin to slice it apart.</span>"
playsound(src, "sparks", 50, 1)
sleep(70)
if(mineral == "diamond")
sleep(70)
if( !istype(src, /turf/simulated/wall) || !user || !EB || !T ) return
if(do_after(user, slicing_duration*0.7)) //energy blade slicing is faster than welding tool slicing
if( !istype(src, /turf/simulated/wall) || !user || !EB || !T )
return
if( user.loc == T && user.get_active_hand() == W )
EB.spark_system.start()
playsound(src, "sparks", 50, 1)
playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
dismantle_wall(1)
for(var/mob/O in viewers(user, 5))
O.show_message("<span class='warning'>The wall was sliced apart by [user]!</span>", 1, "<span class='warning'>You hear metal being sliced apart and sparks flying.</span>", 2)
if( user.loc == T && user.get_active_hand() == W )
EB.spark_system.start()
playsound(src, "sparks", 50, 1)
playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
dismantle_wall(1)
visible_message("<span class='warning'>The wall was sliced apart by [user]!</span>", "<span class='warning'>You hear metal being sliced apart and sparks flying.</span>")
return
else if(istype(W,/obj/item/apc_frame))
+66 -65
View File
@@ -22,17 +22,10 @@
//THERMITE related stuff. Calls src.thermitemelt() which handles melting simulated walls and the relevant effects
if( thermite )
if( istype(W, /obj/item/weapon/weldingtool) )
var/obj/item/weapon/weldingtool/WT = W
if( WT.remove_fuel(0,user) )
thermitemelt(user)
return
else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
if( is_hot(W) )
thermitemelt(user)
return
else if( istype(W, /obj/item/weapon/melee/energy/blade) )
if( istype(W, /obj/item/weapon/melee/energy/blade) )
var/obj/item/weapon/melee/energy/blade/EB = W
EB.spark_system.start()
@@ -40,8 +33,7 @@
playsound(src, "sparks", 50, 1)
playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
thermitemelt(user)
return
return
else if(istype(W, /obj/item/weapon/melee/energy/blade))
user << "<span class='notice'>This wall is too thick to slice through. You will need to find a different path.</span>"
@@ -65,13 +57,14 @@
user << "<span class='notice'>You begin removing the support lines.</span>"
playsound(src, 'sound/items/Screwdriver.ogg', 100, 1)
sleep(40)
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
if(do_after(user, 40))
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T )
return
if( d_state == 1 && user.loc == T && user.get_active_hand() == W )
src.d_state = 2
src.icon_state = "r_wall-2"
user << "<span class='notice'>You remove the support lines.</span>"
if( d_state == 1 && user.loc == T && user.get_active_hand() == W )
src.d_state = 2
src.icon_state = "r_wall-2"
user << "<span class='notice'>You remove the support lines.</span>"
return
//REPAIRING (replacing the outer grille for cosmetic damage)
@@ -95,13 +88,14 @@
user << "<span class='notice'>You begin slicing through the metal cover.</span>"
playsound(src, 'sound/items/Welder.ogg', 100, 1)
sleep(60)
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !WT || !WT.isOn() || !T ) return
if(do_after(user, 60))
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !WT || !WT.isOn() || !T )
return
if( d_state == 2 && user.loc == T && user.get_active_hand() == WT )
src.d_state = 3
src.icon_state = "r_wall-3"
user << "<span class='notice'>You press firmly on the cover, dislodging it.</span>"
if( d_state == 2 && user.loc == T && user.get_active_hand() == WT )
src.d_state = 3
src.icon_state = "r_wall-3"
user << "<span class='notice'>You press firmly on the cover, dislodging it.</span>"
return
if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
@@ -109,13 +103,14 @@
user << "<span class='notice'>You begin slicing through the metal cover.</span>"
playsound(src, 'sound/items/Welder.ogg', 100, 1)
sleep(40)
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
if(do_after(user, 60))
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T )
return
if( d_state == 2 && user.loc == T && user.get_active_hand() == W )
src.d_state = 3
src.icon_state = "r_wall-3"
user << "<span class='notice'>You press firmly on the cover, dislodging it.</span>"
if( d_state == 2 && user.loc == T && user.get_active_hand() == W )
src.d_state = 3
src.icon_state = "r_wall-3"
user << "<span class='notice'>You press firmly on the cover, dislodging it.</span>"
return
if(3)
@@ -124,13 +119,14 @@
user << "<span class='notice'>You struggle to pry off the cover.</span>"
playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
sleep(100)
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
if(do_after(user, 100))
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T )
return
if( d_state == 3 && user.loc == T && user.get_active_hand() == W )
src.d_state = 4
src.icon_state = "r_wall-4"
user << "<span class='notice'>You pry off the cover.</span>"
if( d_state == 3 && user.loc == T && user.get_active_hand() == W )
src.d_state = 4
src.icon_state = "r_wall-4"
user << "<span class='notice'>You pry off the cover.</span>"
return
if(4)
@@ -139,13 +135,14 @@
user << "<span class='notice'>You start loosening the anchoring bolts which secure the support rods to their frame.</span>"
playsound(src, 'sound/items/Ratchet.ogg', 100, 1)
sleep(40)
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
if(do_after(user, 40))
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T )
return
if( d_state == 4 && user.loc == T && user.get_active_hand() == W )
src.d_state = 5
src.icon_state = "r_wall-5"
user << "<span class='notice'>You remove the bolts anchoring the support rods.</span>"
if( d_state == 4 && user.loc == T && user.get_active_hand() == W )
src.d_state = 5
src.icon_state = "r_wall-5"
user << "<span class='notice'>You remove the bolts anchoring the support rods.</span>"
return
if(5)
@@ -156,14 +153,15 @@
user << "<span class='notice'>You begin slicing through the support rods.</span>"
playsound(src, 'sound/items/Welder.ogg', 100, 1)
sleep(100)
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !WT || !WT.isOn() || !T ) return
if(do_after(user, 100))
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !WT || !WT.isOn() || !T )
return
if( d_state == 5 && user.loc == T && user.get_active_hand() == WT )
src.d_state = 6
src.icon_state = "r_wall-6"
new /obj/item/stack/rods( src )
user << "<span class='notice'>The support rods drop out as you cut them loose from the frame.</span>"
if( d_state == 5 && user.loc == T && user.get_active_hand() == WT )
src.d_state = 6
src.icon_state = "r_wall-6"
new /obj/item/stack/rods( src )
user << "<span class='notice'>The support rods drop out as you cut them loose from the frame.</span>"
return
if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
@@ -171,14 +169,15 @@
user << "<span class='notice'>You begin slicing through the support rods.</span>"
playsound(src, 'sound/items/Welder.ogg', 100, 1)
sleep(70)
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
if(do_after(user, 70))
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T )
return
if( d_state == 5 && user.loc == T && user.get_active_hand() == W )
src.d_state = 6
src.icon_state = "r_wall-6"
new /obj/item/stack/rods( src )
user << "<span class='notice'>The support rods drop out as you cut them loose from the frame.</span>"
if( d_state == 5 && user.loc == T && user.get_active_hand() == W )
src.d_state = 6
src.icon_state = "r_wall-6"
new /obj/item/stack/rods( src )
user << "<span class='notice'>The support rods drop out as you cut them loose from the frame.</span>"
return
if(6)
@@ -187,12 +186,13 @@
user << "<span class='notice'>You struggle to pry off the outer sheath.</span>"
playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
sleep(100)
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
if(do_after(user, 100))
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T )
return
if( user.loc == T && user.get_active_hand() == W )
user << "<span class='notice'>You pry off the outer sheath.</span>"
dismantle_wall()
if( user.loc == T && user.get_active_hand() == W )
user << "<span class='notice'>You pry off the outer sheath.</span>"
dismantle_wall()
return
//vv OK, we weren't performing a valid deconstruction step or igniting thermite,let's check the other possibilities vv
@@ -202,12 +202,13 @@
user << "<span class='notice'>You begin to drill though the wall.</span>"
sleep(200)
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
if(do_after(user, 200))
if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T )
return
if( user.loc == T && user.get_active_hand() == W )
user << "<span class='notice'>Your drill tears though the last of the reinforced plating.</span>"
dismantle_wall()
if( user.loc == T && user.get_active_hand() == W )
user << "<span class='notice'>Your drill tears though the last of the reinforced plating.</span>"
dismantle_wall()
//REPAIRING
else if(istype(W, /obj/item/stack/sheet/metal) && d_state)