Merge branch 'bleeding-edge-freeze' of https://github.com/Baystation12/Baystation12 into bleeding-edge-freeze

This commit is contained in:
Whitellama
2013-06-24 21:48:33 -07:00
76 changed files with 2416 additions and 1754 deletions

View File

@@ -110,6 +110,11 @@
for(var/mob/O in oviewers(src))
O.show_message("\red [usr] destroys the [name]!", 1)
health = 0
else
usr << "\blue You claw at the [name]."
for(var/mob/O in oviewers(src))
O.show_message("\red [usr] claws at the [name]!", 1)
health -= rand(5,10)
healthcheck()
return

View File

@@ -0,0 +1,9 @@
/obj/effect/decal/warning_stripes
icon = 'icons/effects/warning_stripes.dmi'
layer = 2
/obj/effect/decal/warning_stripes/New()
. = ..()
loc.overlays += src
del src

View File

@@ -850,7 +850,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
P.overlays.Cut()
P.overlays += image('icons/obj/pda.dmi', "pda-r")
else
U << "<span class='notice'>ERROR: Server isn't responding.</span>"
U << "<span class='notice'>ERROR: Messaging server is not responding.</span>"
/obj/item/device/pda/verb/verb_remove_id()
@@ -1162,7 +1162,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
plist[text("[name]")] = P
return plist
//Some spare PDAs in a box
/obj/item/weapon/storage/box/PDAs

View File

@@ -162,7 +162,7 @@
else
user << "\blue You need to attach a flash to it first!"
if(istype(W, /obj/item/device/mmi) || istype(W, /obj/item/device/mmi/posibrain))
if(istype(W, /obj/item/device/mmi))
var/obj/item/device/mmi/M = W
if(check_completion())
if(!istype(loc,/turf))
@@ -194,7 +194,7 @@
user << "\red This [W] does not seem to fit."
return
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(loc))
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(loc), unfinished = 1)
if(!O) return
user.drop_item()

View File

@@ -124,7 +124,6 @@ var/global/list/datum/stack_recipe/plasma_recipes = list ( \
throw_range = 3
origin_tech = "materials=3"
perunit = 2000
sheettype = "plastic"
var/global/list/datum/stack_recipe/plastic_recipes = list ( \
new/datum/stack_recipe("plastic crate", /obj/structure/closet/pcrate, 10, one_per_turf = 1, on_floor = 1), \

View File

@@ -13,10 +13,20 @@
var/global/list/datum/stack_recipe/metal_recipes = list ( \
new/datum/stack_recipe("stool", /obj/structure/stool, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("chair", /obj/structure/stool/bed/chair, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("swivel chair", /obj/structure/stool/bed/chair/office/dark, 5, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("comfy chair", /obj/structure/stool/bed/chair/comfy/beige, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("bed", /obj/structure/stool/bed, 2, one_per_turf = 1, on_floor = 1), \
null, \
new/datum/stack_recipe_list("office chairs",list( \
new/datum/stack_recipe("dark office chair", /obj/structure/stool/bed/chair/office/dark, 5, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("light office chair", /obj/structure/stool/bed/chair/office/light, 5, one_per_turf = 1, on_floor = 1), \
), 5), \
new/datum/stack_recipe_list("comfy chairs", list( \
new/datum/stack_recipe("beige comfy chair", /obj/structure/stool/bed/chair/comfy/beige, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("black comfy chair", /obj/structure/stool/bed/chair/comfy/black, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("brown comfy chair", /obj/structure/stool/bed/chair/comfy/brown, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("lime comfy chair", /obj/structure/stool/bed/chair/comfy/lime, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("teal comfy chair", /obj/structure/stool/bed/chair/comfy/teal, 2, one_per_turf = 1, on_floor = 1), \
), 2), \
null, \
new/datum/stack_recipe("table parts", /obj/item/weapon/table_parts, 2), \
new/datum/stack_recipe("rack parts", /obj/item/weapon/rack_parts), \
new/datum/stack_recipe("closet", /obj/structure/closet, 2, time = 15, one_per_turf = 1, on_floor = 1), \
@@ -28,10 +38,28 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \
null, \
new/datum/stack_recipe("computer frame", /obj/structure/computerframe, 5, time = 25, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("wall girders", /obj/structure/girder, 2, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("airlock assembly", /obj/structure/door_assembly, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("machine frame", /obj/machinery/constructable_frame/machine_frame, 5, time = 25, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("turret frame", /obj/machinery/porta_turret_construct, 5, time = 25, one_per_turf = 1, on_floor = 1), \
null, \
new/datum/stack_recipe_list("airlock assemblies", list( \
new/datum/stack_recipe("standard airlock assembly", /obj/structure/door_assembly, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("command airlock assembly", /obj/structure/door_assembly/door_assembly_com, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("security airlock assembly", /obj/structure/door_assembly/door_assembly_sec, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("engineering airlock assembly", /obj/structure/door_assembly/door_assembly_eng, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("mining airlock assembly", /obj/structure/door_assembly/door_assembly_min, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("atmospherics airlock assembly", /obj/structure/door_assembly/door_assembly_atmo, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("research airlock assembly", /obj/structure/door_assembly/door_assembly_research, 4, time = 50, one_per_turf = 1, on_floor = 1), \
/* new/datum/stack_recipe("science airlock assembly", /obj/structure/door_assembly/door_assembly_science, 4, time = 50, one_per_turf = 1, on_floor = 1), \ */
new/datum/stack_recipe("medical airlock assembly", /obj/structure/door_assembly/door_assembly_med, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("maintenance airlock assembly", /obj/structure/door_assembly/door_assembly_mai, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("external airlock assembly", /obj/structure/door_assembly/door_assembly_ext, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("freezer airlock assembly", /obj/structure/door_assembly/door_assembly_fre, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("airtight hatch assembly", /obj/structure/door_assembly/door_assembly_hatch, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("maintenance hatch assembly", /obj/structure/door_assembly/door_assembly_mhatch, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("high security airlock assembly", /obj/structure/door_assembly/door_assembly_highsecurity, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("multi-tile airlock assembly", /obj/structure/door_assembly/multi_tile, 4, time = 50, one_per_turf = 1, on_floor = 1), \
), 4), \
null, \
new/datum/stack_recipe("grenade casing", /obj/item/weapon/grenade/chem_grenade), \
new/datum/stack_recipe("light fixture frame", /obj/item/light_fixture_frame, 2), \
new/datum/stack_recipe("small light fixture frame", /obj/item/light_fixture_frame/small, 1), \

View File

@@ -1,7 +1,8 @@
/* Stack type objects!
* Contains:
* Stacks
* Recipe datum
* Recipe datum
* Recipe list datum
*/
/*
@@ -32,51 +33,66 @@
return
/obj/item/stack/attack_self(mob/user as mob)
interact(user)
list_recipes(user)
/obj/item/stack/interact(mob/user as mob)
/obj/item/stack/proc/list_recipes(mob/user as mob, recipes_sublist)
if (!recipes)
return
if (!src || amount<=0)
user << browse(null, "window=stack")
user.set_machine(src) //for correct work of onclose
var/list/recipe_list = recipes
if (recipes_sublist && recipe_list[recipes_sublist] && istype(recipe_list[recipes_sublist], /datum/stack_recipe_list))
var/datum/stack_recipe_list/srl = recipe_list[recipes_sublist]
recipe_list = srl.recipes
var/t1 = text("<HTML><HEAD><title>Constructions from []</title></HEAD><body><TT>Amount Left: []<br>", src, src.amount)
for(var/i=1;i<=recipes.len,i++)
var/datum/stack_recipe/R = recipes[i]
if (isnull(R))
for(var/i=1;i<=recipe_list.len,i++)
var/E = recipe_list[i]
if (isnull(E))
t1 += "<hr>"
continue
if (i>1 && !isnull(recipes[i-1]))
if (i>1 && !isnull(recipe_list[i-1]))
t1+="<br>"
var/max_multiplier = round(src.amount / R.req_amount)
var/title as text
var/can_build = 1
can_build = can_build && (max_multiplier>0)
/*
if (R.one_per_turf)
can_build = can_build && !(locate(R.result_type) in usr.loc)
if (R.on_floor)
can_build = can_build && istype(usr.loc, /turf/simulated/floor)
*/
if (R.res_amount>1)
title+= "[R.res_amount]x [R.title]\s"
else
title+= "[R.title]"
title+= " ([R.req_amount] [src.singular_name]\s)"
if (can_build)
t1 += text("<A href='?src=\ref[];make=[]'>[]</A> ", src, i, title)
else
t1 += text("[]", title)
continue
if (R.max_res_amount>1 && max_multiplier>1)
max_multiplier = min(max_multiplier, round(R.max_res_amount/R.res_amount))
t1 += " |"
var/list/multipliers = list(5,10,25)
for (var/n in multipliers)
if (max_multiplier>=n)
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[n]'>[n*R.res_amount]x</A>"
if (!(max_multiplier in multipliers))
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[max_multiplier]'>[max_multiplier*R.res_amount]x</A>"
if (istype(E, /datum/stack_recipe_list))
var/datum/stack_recipe_list/srl = E
if (src.amount >= srl.req_amount)
t1 += "<a href='?src=\ref[src];sublist=[i]'>[srl.title] ([srl.req_amount] [src.singular_name]\s)</a>"
else
t1 += "[srl.title] ([srl.req_amount] [src.singular_name]\s)<br>"
if (istype(E, /datum/stack_recipe))
var/datum/stack_recipe/R = E
var/max_multiplier = round(src.amount / R.req_amount)
var/title as text
var/can_build = 1
can_build = can_build && (max_multiplier>0)
/*
if (R.one_per_turf)
can_build = can_build && !(locate(R.result_type) in usr.loc)
if (R.on_floor)
can_build = can_build && istype(usr.loc, /turf/simulated/floor)
*/
if (R.res_amount>1)
title+= "[R.res_amount]x [R.title]\s"
else
title+= "[R.title]"
title+= " ([R.req_amount] [src.singular_name]\s)"
if (can_build)
t1 += text("<A href='?src=\ref[src];sublist=[recipes_sublist];make=[i]'>[title]</A> ")
else
t1 += text("[]", title)
continue
if (R.max_res_amount>1 && max_multiplier>1)
max_multiplier = min(max_multiplier, round(R.max_res_amount/R.res_amount))
t1 += " |"
var/list/multipliers = list(5,10,25)
for (var/n in multipliers)
if (max_multiplier>=n)
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[n]'>[n*R.res_amount]x</A>"
if (!(max_multiplier in multipliers))
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[max_multiplier]'>[max_multiplier*R.res_amount]x</A>"
t1 += "</TT></body></HTML>"
user << browse(t1, "window=stack")
@@ -87,10 +103,18 @@
..()
if ((usr.restrained() || usr.stat || usr.get_active_hand() != src))
return
if (href_list["sublist"] && !href_list["make"])
list_recipes(usr, text2num(href_list["sublist"]))
if (href_list["make"])
if (src.amount < 1) del(src) //Never should happen
var/datum/stack_recipe/R = recipes[text2num(href_list["make"])]
var/list/recipes_list = recipes
if (href_list["sublist"])
var/datum/stack_recipe_list/srl = recipes_list[text2num(href_list["sublist"])]
recipes_list = srl.recipes
var/datum/stack_recipe/R = recipes_list[text2num(href_list["make"])]
var/multiplier = text2num(href_list["multiplier"])
if (!multiplier) multiplier = 1
if (src.amount < R.req_amount*multiplier)
@@ -222,4 +246,16 @@
src.max_res_amount = max_res_amount
src.time = time
src.one_per_turf = one_per_turf
src.on_floor = on_floor
src.on_floor = on_floor
/*
* Recipe list datum
*/
/datum/stack_recipe_list
var/title = "ERROR"
var/list/recipes = null
var/req_amount = 1
New(title, recipes, req_amount = 1)
src.title = title
src.recipes = recipes
src.req_amount = req_amount

View File

@@ -6,278 +6,129 @@ obj/structure/door_assembly
anchored = 0
density = 1
var/state = 0
var/mineral = null
var/base_icon_state = "door_as_0"
var/glass_base_icon_state = "door_as_g0"
var/base_icon_state = ""
var/base_name = "Airlock"
var/obj/item/weapon/airlock_electronics/electronics = null
var/airlock_type = /obj/machinery/door/airlock //the type path of the airlock once completed
var/glass_type = /obj/machinery/door/airlock/glass
var/glass = null
var/airlock_type = "" //the type path of the airlock once completed
var/glass_type = "/glass"
var/glass = 0 // 0 = glass can be installed. -1 = glass can't be installed. 1 = glass is already installed. Text = mineral plating is installed instead.
var/created_name = null
New()
base_icon_state = copytext(icon_state,1,lentext(icon_state))
door_assembly_0
name = "Airlock Assembly"
icon_state = "door_as_1"
airlock_type = /obj/machinery/door/airlock
anchored = 1
density = 1
state = 1
glass = 0
update_state()
door_assembly_com
name = "Command Airlock Assembly"
icon_state = "door_as_com1"
glass_base_icon_state = "door_as_gcom"
glass_type = /obj/machinery/door/airlock/glass_command
airlock_type = /obj/machinery/door/airlock/command
anchored = 1
density = 1
state = 1
glass = 0
glass
glass = 1
icon_state = "door_as_gcom1"
base_icon_state = "com"
base_name = "Command Airlock"
glass_type = "/glass_command"
airlock_type = "/command"
door_assembly_sec
name = "Security Airlock Assembly"
icon_state = "door_as_sec1"
glass_base_icon_state = "door_as_gsec"
glass_type = /obj/machinery/door/airlock/glass_security
airlock_type = /obj/machinery/door/airlock/security
anchored = 1
density = 1
state = 1
glass = 0
glass
glass = 1
icon_state = "door_as_gsec1"
base_icon_state = "sec"
base_name = "Security Airlock"
glass_type = "/glass_security"
airlock_type = "/security"
door_assembly_eng
name = "Engineering Airlock Assembly"
icon_state = "door_as_eng1"
glass_base_icon_state = "door_as_geng"
glass_type = /obj/machinery/door/airlock/glass_engineering
airlock_type = /obj/machinery/door/airlock/engineering
anchored = 1
density = 1
state = 1
glass = 0
glass
glass = 1
icon_state = "door_as_geng1"
base_icon_state = "eng"
base_name = "Engineering Airlock"
glass_type = "/glass_engineering"
airlock_type = "/engineering"
door_assembly_min
name = "Mining Airlock Assembly"
icon_state = "door_as_min1"
glass_base_icon_state = "door_as_gmin"
glass_type = /obj/machinery/door/airlock/glass_mining
airlock_type = /obj/machinery/door/airlock/mining
anchored = 1
density = 1
state = 1
glass = 0
glass
glass = 1
icon_state = "door_as_gmin1"
base_icon_state = "min"
base_name = "Mining Airlock"
glass_type = "/glass_mining"
airlock_type = "/mining"
door_assembly_atmo
name = "Atmospherics Airlock Assembly"
icon_state = "door_as_atmo1"
glass_base_icon_state = "door_as_gatmo"
glass_type = /obj/machinery/door/airlock/glass_atmos
airlock_type = /obj/machinery/door/airlock/atmos
anchored = 1
density = 1
state = 1
glass = 0
glass
glass = 1
icon_state = "door_as_gatmo1"
base_icon_state = "atmo"
base_name = "Atmospherics Airlock"
glass_type = "/glass_atmos"
airlock_type = "/atmos"
door_assembly_research
name = "Research Airlock Assembly"
icon_state = "door_as_res1"
glass_base_icon_state = "door_as_gres"
glass_type = /obj/machinery/door/airlock/glass_research
airlock_type = /obj/machinery/door/airlock/research
anchored = 1
density = 1
state = 1
glass = 0
glass
glass = 1
icon_state = "door_as_gres1"
base_icon_state = "res"
base_name = "Research Airlock"
glass_type = "/glass_research"
airlock_type = "/research"
door_assembly_science
name = "Science Airlock Assembly"
icon_state = "door_as_sci1"
glass_base_icon_state = "door_as_gsci"
glass_type = /obj/machinery/door/airlock/glass_science
airlock_type = /obj/machinery/door/airlock/science
anchored = 1
density = 1
state = 1
glass = 0
glass
glass = 1
icon_state = "door_as_gsci1"
base_icon_state = "sci"
base_name = "Science Airlock"
glass_type = "/glass_science"
airlock_type = "/science"
door_assembly_med
name = "Medical Airlock Assembly"
icon_state = "door_as_med1"
airlock_type = /obj/machinery/door/airlock/medical
anchored = 1
density = 1
state = 1
glass
mineral = "glass"
icon_state = "door_as_gmed1"
base_icon_state = "med"
base_name = "Medical Airlock"
glass_type = "/glass_medical"
airlock_type = "/medical"
door_assembly_mai
name = "Maintenance Airlock Assembly"
icon_state = "door_as_mai1"
airlock_type = /obj/machinery/door/airlock/maintenance
anchored = 1
density = 1
state = 1
glass = 0
base_icon_state = "mai"
base_name = "Maintenance Airlock"
airlock_type = "/maintenance"
glass = -1
door_assembly_ext
name = "External Airlock Assembly"
icon_state = "door_as_ext1"
airlock_type = /obj/machinery/door/airlock/external
anchored = 1
density = 1
state = 1
glass = 0
base_icon_state = "ext"
base_name = "External Airlock"
airlock_type = "/external"
glass = -1
door_assembly_fre
name = "Freezer Airlock Assembly"
icon_state = "door_as_fre1"
airlock_type = /obj/machinery/door/airlock/freezer
anchored = 1
density = 1
state = 1
glass = 0
base_icon_state = "fre"
base_name = "Freezer Airlock"
airlock_type = "/freezer"
glass = -1
door_assembly_hatch
name = "Airtight Hatch Assembly"
icon_state = "door_as_hatch1"
airlock_type = /obj/machinery/door/airlock/hatch
anchored = 1
density = 1
state = 1
glass = 0
base_icon_state = "hatch"
base_name = "Airtight Hatch"
airlock_type = "/hatch"
glass = -1
door_assembly_mhatch
name = "Maintenance Hatch Assembly"
icon_state = "door_as_mhatch1"
airlock_type = /obj/machinery/door/airlock/maintenance_hatch
anchored = 1
density = 1
state = 1
glass = 0
door_assembly_glass
name = "Glass Airlock Assembly"
icon_state = "door_as_g1"
airlock_type = /obj/machinery/door/airlock/glass
anchored = 1
density = 1
state = 1
mineral = "glass"
door_assembly_gold
name = "Gold Airlock Assembly"
icon_state = "door_as_gold1"
airlock_type = /obj/machinery/door/airlock/gold
anchored = 1
density = 1
state = 1
mineral = "gold"
door_assembly_silver
name = "Silver Airlock Assembly"
icon_state = "door_as_silver1"
airlock_type = /obj/machinery/door/airlock/silver
anchored = 1
density = 1
state = 1
mineral = "silver"
door_assembly_diamond
name = "Diamond Airlock Assembly"
icon_state = "door_as_diamond1"
airlock_type = /obj/machinery/door/airlock/diamond
anchored = 1
density = 1
state = 1
mineral = "diamond"
door_assembly_uranium
name = "Uranium Airlock Assembly"
icon_state = "door_as_uranium1"
airlock_type = /obj/machinery/door/airlock/uranium
anchored = 1
density = 1
state = 1
mineral = "uranium"
door_assembly_plasma
name = "Plasma Airlock Assembly"
icon_state = "door_as_plasma1"
airlock_type = /obj/machinery/door/airlock/plasma
anchored = 1
density = 1
state = 1
mineral = "plasma"
door_assembly_clown
name = "Bananium Airlock Assembly"
icon_state = "door_as_clown1"
airlock_type = /obj/machinery/door/airlock/clown
anchored = 1
density = 1
state = 1
mineral = "clown"
door_assembly_sandstone
name = "Sandstone Airlock Assembly"
icon_state = "door_as_sandstone1"
airlock_type = /obj/machinery/door/airlock/sandstone
anchored = 1
density = 1
state = 1
mineral = "sandstone"
door_assembly_sandstone
name = "Sandstone Airlock Assembly"
icon_state = "door_as_sandstone1"
airlock_type = /obj/machinery/door/airlock/sandstone
anchored = 1
density = 1
state = 1
mineral = "sandstone"
base_icon_state = "mhatch"
base_name = "Maintenance Hatch"
airlock_type = "/maintenance_hatch"
glass = -1
door_assembly_highsecurity // Borrowing this until WJohnston makes sprites for the assembly
name = "High Tech Security Assembly"
icon_state = "door_as_highsec1"
airlock_type = /obj/machinery/door/airlock/highsecurity
anchored = 1
density = 1
state = 1
glass = 0
base_icon_state = "highsec"
base_name = "High Security Airlock"
airlock_type = "/highsecurity"
glass = -1
multi_tile
icon = 'icons/obj/doors/door_assembly2x1.dmi'
dir = EAST
var/width = 1
//Temporary until we get sprites.
// airlock_type = "/multi_tile/maint"
glass = 1
glass_type = "/multi_tile/glass"
New()
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size
Move()
. = ..()
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size
/obj/structure/door_assembly/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/pen))
@@ -287,46 +138,47 @@ obj/structure/door_assembly
created_name = t
return
if(istype(W, /obj/item/weapon/weldingtool) && !anchored )
if(istype(W, /obj/item/weapon/weldingtool) && ( (istext(glass)) || (glass == 1) || (!anchored) ))
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0,user))
user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.")
if (WT.remove_fuel(0, user))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
if(do_after(user, 40))
if(!src || !WT.isOn()) return
user << "\blue You dissasembled the airlock assembly!"
new /obj/item/stack/sheet/metal(get_turf(src), 4)
if (mineral)
if (mineral == "glass")
new /obj/item/stack/sheet/rglass(get_turf(src))
else
var/M = text2path("/obj/item/stack/sheet/mineral/[mineral]")
new M(get_turf(src))
new M(get_turf(src))
del(src)
if(istext(glass))
user.visible_message("[user] welds the [glass] plating off the airlock assembly.", "You start to weld the [glass] plating off the airlock assembly.")
if(do_after(user, 40))
if(!src || !WT.isOn()) return
user << "\blue You welded the [glass] plating off!"
var/M = text2path("/obj/item/stack/sheet/mineral/[glass]")
new M(src.loc, 2)
glass = 0
else if(glass == 1)
user.visible_message("[user] welds the glass panel out of the airlock assembly.", "You start to weld the glass panel out of the airlock assembly.")
if(do_after(user, 40))
if(!src || !WT.isOn()) return
user << "\blue You welded the glass panel out!"
new /obj/item/stack/sheet/rglass(src.loc)
glass = 0
else if(!anchored)
user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.")
if(do_after(user, 40))
if(!src || !WT.isOn()) return
user << "\blue You dissasembled the airlock assembly!"
new /obj/item/stack/sheet/metal(src.loc, 4)
del (src)
else
user << "\blue You need more welding fuel to dissassemble the airlock assembly."
user << "\blue You need more welding fuel."
return
else if(istype(W, /obj/item/weapon/wrench) && !anchored )
else if(istype(W, /obj/item/weapon/wrench) && state == 0)
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user.visible_message("[user] secures the airlock assembly to the floor.", "You start to secure the airlock assembly to the floor.")
if(anchored)
user.visible_message("[user] unsecures the airlock assembly from the floor.", "You start to unsecure the airlock assembly from the floor.")
else
user.visible_message("[user] secures the airlock assembly to the floor.", "You start to secure the airlock assembly to the floor.")
if(do_after(user, 40))
if(!src) return
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, 'sound/items/Ratchet.ogg', 100, 1)
user.visible_message("[user] unsecures the airlock assembly from the floor.", "You start to unsecure the airlock assembly from the floor.")
if(do_after(user, 40))
if(!src) return
user << "\blue You unsecured the airlock assembly!"
src.name = "Airlock Assembly"
src.anchored = 0
user << "\blue You [anchored? "un" : ""]secured the airlock assembly!"
anchored = !anchored
else if(istype(W, /obj/item/weapon/cable_coil) && state == 0 && anchored )
var/obj/item/weapon/cable_coil/coil = W
@@ -336,7 +188,6 @@ obj/structure/door_assembly
coil.use(1)
src.state = 1
user << "\blue You wire the Airlock!"
src.name = "Wired Airlock Assembly"
else if(istype(W, /obj/item/weapon/wirecutters) && state == 1 )
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
@@ -345,9 +196,8 @@ obj/structure/door_assembly
if(do_after(user, 40))
if(!src) return
user << "\blue You cut the airlock wires.!"
new/obj/item/weapon/cable_coil(get_turf(user), 1)
new/obj/item/weapon/cable_coil(src.loc, 1)
src.state = 0
src.name = "Secured Airlock Assembly"
else if(istype(W, /obj/item/weapon/airlock_electronics) && state == 1 && W:icon_state != "door_electronics_smoked")
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
@@ -364,8 +214,6 @@ obj/structure/door_assembly
else
W.loc = src.loc
//del(W)
else if(istype(W, /obj/item/weapon/crowbar) && state == 2 )
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to install electronics into the airlock assembly.")
@@ -382,32 +230,28 @@ obj/structure/door_assembly
ae = electronics
electronics = null
ae.loc = src.loc
else if(istype(W, /obj/item/stack/sheet) && !mineral)
var/obj/item/stack/sheet/G = W
if(G)
if(G.amount>=1)
if(G.type == /obj/item/stack/sheet/rglass)
else if(istype(W, /obj/item/stack/sheet) && !glass)
var/obj/item/stack/sheet/S = W
if (S)
if (S.amount>=1)
if(istype(S, /obj/item/stack/sheet/rglass))
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] adds [G.name] to the airlock assembly.", "You start to install [G.name] into the airlock assembly.")
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))
user << "\blue You installed reinforced glass windows into the airlock assembly!"
G.use(1)
src.mineral = "glass"
src.name = "Near finished Window Airlock Assembly"
src.airlock_type = /obj/machinery/door/airlock/glass
src.base_icon_state = "door_as_g" //this will be applied to the icon_state with the correct state number at the proc's end.
else if(istype(G, /obj/item/stack/sheet/mineral))
var/M = G.sheettype
if(G.amount>=2)
S.use(1)
glass = 1
else if(istype(S, /obj/item/stack/sheet/mineral) && S.sheettype)
var/M = S.sheettype
if(S.amount>=2)
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] adds [G.name] to the airlock assembly.", "You start to install [G.name] into the airlock assembly.")
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))
user << "\blue You installed [M] plating into the airlock assembly!"
G.use(2)
src.mineral = "[M]"
src.name = "Near finished [M] Airlock Assembly"
src.airlock_type = text2path ("/obj/machinery/door/airlock/[M]")
src.base_icon_state = "door_as_[M]"
S.use(2)
glass = "[M]"
else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 )
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
user << "\blue Now finishing the airlock."
@@ -415,11 +259,15 @@ obj/structure/door_assembly
if(do_after(user, 40))
if(!src) return
user << "\blue You finish the airlock!"
var/obj/machinery/door/airlock/door
if (mineral)
airlock_type = text2path("/obj/machinery/door/airlock/[mineral]")
door = new src.airlock_type( src.loc )
//door.req_access = src.req_access
var/path
if(istext(glass))
path = text2path("/obj/machinery/door/airlock/[glass]")
else if (glass == 1)
path = text2path("/obj/machinery/door/airlock[glass_type]")
else
path = text2path("/obj/machinery/door/airlock[airlock_type]")
var/obj/machinery/door/airlock/door = new path(src.loc)
door.assembly_type = type
door.electronics = src.electronics
if(src.electronics.one_access)
door.req_access = null
@@ -428,11 +276,23 @@ obj/structure/door_assembly
door.req_access = src.electronics.conf_access
if(created_name)
door.name = created_name
else
door.name = "[istext(glass) ? "[glass] airlock" : base_name]"
src.electronics.loc = door
del(src)
else
..()
icon_state = "[base_icon_state][state]"
//This updates the icon_state. They are named as "door_as1_eng" where the 1 in that example
//represents what state it's in. So the most generic algorithm for the correct updating of
//this is simply to change the number.
update_state()
/obj/structure/door_assembly/proc/update_state()
icon_state = "door_as_[glass == 1 ? "g" : ""][istext(glass) ? glass : base_icon_state][state]"
name = ""
switch (state)
if(0)
if (anchored)
name = "Secured "
if(1)
name = "Wired "
if(2)
name = "Near Finished "
name += "[glass == 1 ? "Window " : ""][istext(glass) ? "[glass] Airlock" : base_name] Assembly"