mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Added Veryinky's construct/deconstruct doors code. Construction is 4 metal, wrench, wire, multitool, screwdriver. Deconstruction is weld, screwdriver, crowbar, wirecutter, wrench, welder. Add reinforced glass at any construction stage to make it a glass airlock door.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@102 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -75,41 +75,47 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
|
||||
var/list/signalers[9]
|
||||
var/lockdownbyai = 0
|
||||
autoclose = 1
|
||||
|
||||
var/doortype = 0
|
||||
/obj/machinery/door/airlock/command
|
||||
name = "Airlock"
|
||||
icon = 'Doorcom.dmi'
|
||||
req_access = list(access_heads)
|
||||
doortype = 1
|
||||
|
||||
/obj/machinery/door/airlock/security
|
||||
name = "Airlock"
|
||||
icon = 'Doorsec.dmi'
|
||||
req_access = list(access_security)
|
||||
|
||||
doortype = 2
|
||||
|
||||
/obj/machinery/door/airlock/engineering
|
||||
name = "Airlock"
|
||||
icon = 'Dooreng.dmi'
|
||||
req_access = list(access_engine)
|
||||
doortype = 3
|
||||
|
||||
/obj/machinery/door/airlock/medical
|
||||
name = "Airlock"
|
||||
icon = 'Doormed.dmi'
|
||||
req_access = list(access_medical)
|
||||
doortype = 4
|
||||
|
||||
/obj/machinery/door/airlock/maintenance
|
||||
name = "Maintenance Access"
|
||||
icon = 'Doormaint.dmi'
|
||||
req_access = list(access_maint_tunnels)
|
||||
doortype = 5
|
||||
|
||||
/obj/machinery/door/airlock/external
|
||||
name = "External Airlock"
|
||||
icon = 'Doorext.dmi'
|
||||
doortype = 6
|
||||
|
||||
/obj/machinery/door/airlock/glass
|
||||
name = "Glass Airlock"
|
||||
icon = 'Doorglass.dmi'
|
||||
opacity = 0
|
||||
doortype = 7
|
||||
|
||||
/*
|
||||
About the new airlock wires panel:
|
||||
@@ -841,6 +847,7 @@ About the new airlock wires panel:
|
||||
|
||||
/obj/machinery/door/airlock/attackby(C as obj, mob/user as mob)
|
||||
//world << text("airlock attackby src [] obj [] mob []", src, C, user)
|
||||
var/turf/T = get_turf(user)
|
||||
if (!istype(usr, /mob/living/silicon))
|
||||
if (src.isElectrified())
|
||||
if(src.shock(user, 75))
|
||||
@@ -872,6 +879,24 @@ About the new airlock wires panel:
|
||||
else if (istype(C, /obj/item/device/radio/signaler))
|
||||
return src.attack_hand(user)
|
||||
else if (istype(C, /obj/item/weapon/crowbar))
|
||||
if ((src.density) && ( src.welded ) && !( src.operating ) && src.p_open )
|
||||
playsound(src.loc, 'Crowbar.ogg', 100, 1)
|
||||
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics into the airlock assembly.")
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
user << "\blue You removed the airlock electronics!"
|
||||
switch(src.doortype)
|
||||
if(0) new/obj/door_assembly/door_assembly_0( src.loc )
|
||||
if(1) new/obj/door_assembly/door_assembly_com( src.loc )
|
||||
if(2) new/obj/door_assembly/door_assembly_sec( src.loc )
|
||||
if(3) new/obj/door_assembly/door_assembly_eng( src.loc )
|
||||
if(4) new/obj/door_assembly/door_assembly_med( src.loc )
|
||||
if(5) new/obj/door_assembly/door_assembly_mai( src.loc )
|
||||
if(6) new/obj/door_assembly/door_assembly_ext( src.loc )
|
||||
if(7) new/obj/door_assembly/door_assembly_g( src.loc )
|
||||
new/obj/item/device/multitool( src.loc )
|
||||
del(src)
|
||||
return
|
||||
if ((src.density) && (!( src.welded ) && !( src.operating ) && ((!src.arePowerSystemsOn()) || (stat & NOPOWER)) && !( src.locked )))
|
||||
spawn( 0 )
|
||||
src.operating = 1
|
||||
|
||||
232
code/game/objects/door_assembly.dm
Normal file
232
code/game/objects/door_assembly.dm
Normal file
@@ -0,0 +1,232 @@
|
||||
obj/door_assembly
|
||||
icon = 'door_assembly.dmi'
|
||||
|
||||
name = "Airlock Assembly"
|
||||
icon_state = "door_as0"
|
||||
anchored = 0
|
||||
density = 1
|
||||
var/doortype = 0
|
||||
var/state = 0
|
||||
var/glass = 0
|
||||
|
||||
door_assembly_0
|
||||
name = "Airlock Assembly"
|
||||
icon_state = "door_as1"
|
||||
anchored = 1
|
||||
density = 1
|
||||
doortype = 0
|
||||
state = 1
|
||||
glass = 0
|
||||
|
||||
door_assembly_com
|
||||
name = "Command Airlock Assembly"
|
||||
icon_state = "door_as1_com"
|
||||
anchored = 1
|
||||
density = 1
|
||||
doortype = 1
|
||||
state = 1
|
||||
glass = 0
|
||||
|
||||
door_assembly_sec
|
||||
name = "Security Airlock Assembly"
|
||||
icon_state = "door_as1_sec"
|
||||
anchored = 1
|
||||
density = 1
|
||||
doortype = 2
|
||||
state = 1
|
||||
glass = 0
|
||||
|
||||
door_assembly_eng
|
||||
name = "Engineering Airlock Assembly"
|
||||
icon_state = "door_as1_eng"
|
||||
anchored = 1
|
||||
density = 1
|
||||
doortype = 3
|
||||
state = 1
|
||||
glass = 0
|
||||
|
||||
door_assembly_med
|
||||
name = "Medical Airlock Assembly"
|
||||
icon_state = "door_as1_med"
|
||||
anchored = 1
|
||||
density = 1
|
||||
doortype = 4
|
||||
state = 1
|
||||
glass = 0
|
||||
|
||||
door_assembly_mai
|
||||
name = "Maintenance Airlock Assembly"
|
||||
icon_state = "door_as1_mai"
|
||||
anchored = 1
|
||||
density = 1
|
||||
doortype = 5
|
||||
state = 1
|
||||
glass = 0
|
||||
|
||||
door_assembly_ext
|
||||
name = "External Airlock Assembly"
|
||||
icon_state = "door_as1_ext"
|
||||
anchored = 1
|
||||
density = 1
|
||||
doortype = 6
|
||||
state = 1
|
||||
glass = 0
|
||||
|
||||
door_assembly_g
|
||||
name = "Glass Airlock Assembly"
|
||||
icon_state = "door_as1_g"
|
||||
anchored = 1
|
||||
density = 1
|
||||
doortype = 7
|
||||
state = 1
|
||||
glass = 1
|
||||
|
||||
/obj/door_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/weldingtool) && W:welding && !anchored )
|
||||
if (W:get_fuel() < 1)
|
||||
user << "\blue You need more welding fuel to dissassemble the airlock assembly."
|
||||
return
|
||||
W:use_fuel(1)
|
||||
user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.")
|
||||
playsound(src.loc, 'Welder2.ogg', 50, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
user << "\blue You dissasembled the airlock assembly!"
|
||||
new /obj/item/weapon/sheet/metal(get_turf(src))
|
||||
new /obj/item/weapon/sheet/metal(get_turf(src))
|
||||
new /obj/item/weapon/sheet/metal(get_turf(src))
|
||||
new /obj/item/weapon/sheet/metal(get_turf(src))
|
||||
if(src.glass==1)
|
||||
new /obj/item/weapon/sheet/rglass(get_turf(src))
|
||||
del(src)
|
||||
else if(istype(W, /obj/item/weapon/wrench) && !anchored )
|
||||
playsound(src.loc, 'Ratchet.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user.visible_message("[user] secures the airlock assembly to the floor.", "You start to secure the airlock assembly to the floor.")
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
user << "\blue You secured the airlock assembly!"
|
||||
src.name = "Secured Airlock Assembly"
|
||||
src.anchored = 1
|
||||
else if(istype(W, /obj/item/weapon/wrench) && anchored )
|
||||
playsound(src.loc, 'Ratchet.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user.visible_message("[user] unsecures the airlock assembly from the floor.", "You start to unsecure the airlock assembly from the floor.")
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
user << "\blue You unsecured the airlock assembly!"
|
||||
src.name = "Airlock Assembly"
|
||||
src.anchored = 0
|
||||
else if(istype(W, /obj/item/weapon/cable_coil) && state == 0 && anchored )
|
||||
var/obj/item/weapon/cable_coil/coil = W
|
||||
var/turf/T = get_turf(user)
|
||||
user.visible_message("[user] wires the airlock assembly.", "You start to wire the airlock assembly.")
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
coil.use(1)
|
||||
src.state = 1
|
||||
switch(src.doortype)
|
||||
if(0) src.icon_state = "door_as1"
|
||||
if(1) src.icon_state = "door_as1_com"
|
||||
if(2) src.icon_state = "door_as1_sec"
|
||||
if(3) src.icon_state = "door_as1_eng"
|
||||
if(4) src.icon_state = "door_as1_med"
|
||||
if(5) src.icon_state = "door_as1_mai"
|
||||
if(6) src.icon_state = "door_as1_ext"
|
||||
if(7) src.icon_state = "door_as1_g"
|
||||
user << "\blue You wire the Airlock!"
|
||||
src.name = "Wired Airlock Assembly"
|
||||
else if(istype(W, /obj/item/weapon/wirecutters) && state == 1 )
|
||||
playsound(src.loc, 'Wirecutter.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.")
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
user << "\blue You cut the airlock wires.!"
|
||||
new/obj/item/weapon/cable_coil(T, 1)
|
||||
src.state = 0
|
||||
switch(doortype)
|
||||
if(0) src.icon_state = "door_as0"
|
||||
if(1) src.icon_state = "door_as0_com"
|
||||
if(2) src.icon_state = "door_as0_sec"
|
||||
if(3) src.icon_state = "door_as0_eng"
|
||||
if(4) src.icon_state = "door_as0_med"
|
||||
if(5) src.icon_state = "door_as0_mai"
|
||||
if(6) src.icon_state = "door_as0_ext"
|
||||
if(7) src.icon_state = "door_as0_g"
|
||||
src.name = "Secured Airlock Assembly"
|
||||
else if(istype(W, /obj/item/device/multitool) && state == 1 )
|
||||
playsound(src.loc, 'Screwdriver.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly.")
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
user << "\blue You installed the airlock electronics!"
|
||||
src.state = 2
|
||||
switch(src.doortype)
|
||||
if(0) src.icon_state = "door_as2"
|
||||
if(1) src.icon_state = "door_as2_com"
|
||||
if(2) src.icon_state = "door_as2_sec"
|
||||
if(3) src.icon_state = "door_as2_eng"
|
||||
if(4) src.icon_state = "door_as2_med"
|
||||
if(5) src.icon_state = "door_as2_mai"
|
||||
if(6) src.icon_state = "door_as2_ext"
|
||||
if(7) src.icon_state = "door_as2_g"
|
||||
src.name = "Near finished Airlock Assembly"
|
||||
del(W)
|
||||
else if(istype(W, /obj/item/weapon/crowbar) && state == 2 )
|
||||
playsound(src.loc, 'Crowbar.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to install electronics into the airlock assembly.")
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
user << "\blue You removed the airlock electronics!"
|
||||
src.state = 1
|
||||
switch(src.doortype)
|
||||
if(0) src.icon_state = "door_as1"
|
||||
if(1) src.icon_state = "door_as1_com"
|
||||
if(2) src.icon_state = "door_as1_sec"
|
||||
if(3) src.icon_state = "door_as1_eng"
|
||||
if(4) src.icon_state = "door_as1_med"
|
||||
if(5) src.icon_state = "door_as1_mai"
|
||||
if(6) src.icon_state = "door_as1_ext"
|
||||
if(7) src.icon_state = "door_as1_g"
|
||||
src.name = "Wired Airlock Assembly"
|
||||
new/obj/item/device/multitool( src.loc )
|
||||
else if(istype(W, /obj/item/weapon/sheet/rglass) && glass == 0)
|
||||
playsound(src.loc, 'Crowbar.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user.visible_message("[user] adds reinforced glass windows to the airlock assembly.", "You start to install reinforced glass windows into the airlock assembly.")
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
user << "\blue You installed glass windows the airlock assembly!"
|
||||
src.glass = 1
|
||||
src.doortype = 7
|
||||
src.name = "Near finished Window Airlock Assembly"
|
||||
switch(src.state)
|
||||
if(0) src.icon_state = "door_as0_g"
|
||||
if(1) src.icon_state = "door_as1_g"
|
||||
if(2) src.icon_state = "door_as2_g"
|
||||
if(3) src.icon_state = "door_as3_g"
|
||||
else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 )
|
||||
playsound(src.loc, 'Screwdriver.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user << "\blue Now finishing the airlock."
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
user << "\blue You finish the airlock!"
|
||||
if (!src.glass)
|
||||
switch(src.doortype)
|
||||
if(0) new/obj/machinery/door/airlock( src.loc )
|
||||
if(1) new/obj/machinery/door/airlock/command( src.loc )
|
||||
if(2) new/obj/machinery/door/airlock/security( src.loc )
|
||||
if(3) new/obj/machinery/door/airlock/engineering( src.loc )
|
||||
if(4) new/obj/machinery/door/airlock/medical( src.loc )
|
||||
if(5) new/obj/machinery/door/airlock/maintenance( src.loc )
|
||||
if(6) new/obj/machinery/door/airlock/external( src.loc )
|
||||
else
|
||||
new/obj/machinery/door/airlock/glass( src.loc )
|
||||
del(src)
|
||||
else
|
||||
..()
|
||||
@@ -161,6 +161,7 @@ LATTICE
|
||||
L["reinforced"] = "reinforced sheet (2 metal)<BR>"
|
||||
L["computer"] = "computer frame (5 metal)<BR>"
|
||||
L["construct"] = "construct wall girders (2 metal)"
|
||||
L["airlock"] = "construct airlock assembly (4 metal)"
|
||||
|
||||
for(var/t in L)
|
||||
counter++
|
||||
@@ -312,6 +313,18 @@ LATTICE
|
||||
|
||||
src.amount -= 2
|
||||
new /obj/structure/girder(location)
|
||||
if("airlock")
|
||||
if (src.amount < 4)
|
||||
usr << text("\red You haven't got enough metal to construct the airlock assembly!")
|
||||
return
|
||||
usr << "\blue Building airlock assembly ..."
|
||||
var/turf/location = usr.loc
|
||||
sleep(50)
|
||||
if ((usr.loc == location))
|
||||
if (!istype(location, /turf/simulated/floor))
|
||||
return
|
||||
src.amount -= 4
|
||||
new /obj/door_assembly(location)
|
||||
|
||||
if (src.amount <= 0)
|
||||
usr << browse(null, "window=met_sheet")
|
||||
|
||||
Reference in New Issue
Block a user