Moving stuff around part 2!

Committing this early to allow pete to commit something involving the .dme file which would probably conflict otherwise.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4514 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
johnsonmt88@gmail.com
2012-08-22 16:32:45 +00:00
parent 19135de9eb
commit 9e30e7d2ec
20 changed files with 20 additions and 521 deletions
+252
View File
@@ -0,0 +1,252 @@
/obj/structure/closet/alter_health()
return get_turf(src)
/obj/structure/closet/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0 || wall_mounted)) return 1
return (!density)
/obj/structure/closet/proc/can_open()
if(src.welded)
return 0
return 1
/obj/structure/closet/proc/can_close()
for(var/obj/structure/closet/closet in get_turf(src))
if(closet != src)
return 0
return 1
/obj/structure/closet/proc/dump_contents()
//Cham Projector Exception
for(var/obj/effect/dummy/chameleon/AD in src)
AD.loc = src.loc
for(var/obj/item/I in src)
I.loc = src.loc
for(var/mob/M in src)
M.loc = src.loc
if(M.client)
M.client.eye = M.client.mob
M.client.perspective = MOB_PERSPECTIVE
/obj/structure/closet/proc/open()
if(src.opened)
return 0
if(!src.can_open())
return 0
src.dump_contents()
src.icon_state = src.icon_opened
src.opened = 1
if(istype(src, /obj/structure/closet/body_bag))
playsound(src.loc, 'sound/items/zip.ogg', 15, 1, -3)
else
playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3)
density = 0
return 1
/obj/structure/closet/proc/close()
if(!src.opened)
return 0
if(!src.can_close())
return 0
var/itemcount = 0
//Cham Projector Exception
for(var/obj/effect/dummy/chameleon/AD in src.loc)
if(itemcount >= storage_capacity)
break
AD.loc = src
itemcount++
for(var/obj/item/I in src.loc)
if(itemcount >= storage_capacity)
break
if(!I.anchored)
I.loc = src
itemcount++
for(var/mob/M in src.loc)
if(itemcount >= storage_capacity)
break
if(istype (M, /mob/dead/observer))
continue
if(M.buckled)
continue
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.loc = src
itemcount++
src.icon_state = src.icon_closed
src.opened = 0
if(istype(src, /obj/structure/closet/body_bag))
playsound(src.loc, 'sound/items/zip.ogg', 15, 1, -3)
else
playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3)
density = 1
return 1
/obj/structure/closet/proc/toggle()
if(src.opened)
return src.close()
return src.open()
// this should probably use dump_contents()
/obj/structure/closet/ex_act(severity)
switch(severity)
if(1)
for(var/atom/movable/A as mob|obj in src)//pulls everything out of the locker and hits it with an explosion
A.loc = src.loc
A.ex_act(severity++)
del(src)
if(2)
if(prob(50))
for (var/atom/movable/A as mob|obj in src)
A.loc = src.loc
A.ex_act(severity++)
del(src)
if(3)
if(prob(5))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
A.ex_act(severity++)
del(src)
/obj/structure/closet/bullet_act(var/obj/item/projectile/Proj)
health -= Proj.damage
..()
if(health <= 0)
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
del(src)
return
// this should probably use dump_contents()
/obj/structure/closet/blob_act()
if(prob(75))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
del(src)
/obj/structure/closet/meteorhit(obj/O as obj)
if(O.icon_state == "flaming")
for(var/mob/M in src)
M.meteorhit(O)
src.dump_contents()
del(src)
/obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(src.opened)
if(istype(W, /obj/item/weapon/grab))
src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.remove_fuel(0,user))
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return
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)
del(src)
return
if(isrobot(user))
return
usr.drop_item()
if(W)
W.loc = src.loc
else if(istype(W, /obj/item/weapon/packageWrap))
return
else if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.remove_fuel(0,user))
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return
src.welded =! src.welded
src.update_icon()
for(var/mob/M in viewers(src))
M.show_message("<span class='warning'>[src] has been [welded?"welded shut":"unwelded"] by [user.name].</span>", 3, "You hear welding.", 2)
else
src.attack_hand(user)
return
/obj/structure/closet/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
if(istype(O, /obj/screen) || istype(O, /obj/hud)) //fix for HUD elements making their way into the world -Pete
return
if(O.loc == user)
return
if(user.restrained() || user.stat || user.weakened || user.stunned || user.paralysis)
return
if((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src)))
return
if(user.loc==null) // just in case someone manages to get a closet into the blue light dimension, as unlikely as that seems
return
if(!istype(user.loc, /turf)) // are you in a container/closet/pod/etc?
return
if(!src.opened)
return
if(istype(O, /obj/structure/closet))
return
step_towards(O, src.loc)
if(user != O)
user.show_viewers("<span class='danger'>[user] stuffs [O] into [src]!</span>")
src.add_fingerprint(user)
return
/obj/structure/closet/relaymove(mob/user as mob)
if(user.stat)
return
if(!src.open())
user << "<span class='notice'>It won't budge!</span>"
if(!lastbang)
lastbang = 1
for (var/mob/M in hearers(src, null))
M << text("<FONT size=[]>BANG, bang!</FONT>", max(0, 5 - get_dist(src, M)))
spawn(30)
lastbang = 0
/obj/structure/closet/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/structure/closet/attack_hand(mob/user as mob)
src.add_fingerprint(user)
if(!src.toggle())
usr << "<span class='notice'>It won't budge!</span>"
/obj/structure/closet/verb/verb_toggleopen()
set src in oview(1)
set category = "Object"
set name = "Toggle Open"
if(!usr.canmove || usr.stat || usr.restrained())
return
if(ishuman(usr))
src.attack_hand(usr)
else
usr << "<span class='warning'>This mob type can't use this verb.</span>"
/obj/structure/closet/update_icon()//Putting the welded stuff in updateicon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
overlays = null
if(!opened)
icon_state = icon_closed
if(welded)
overlays += "welded"
else
icon_state = icon_opened
+354
View File
@@ -0,0 +1,354 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
/obj/structure/closet/crate
desc = "A crate."
name = "Crate"
icon = 'icons/obj/storage.dmi'
icon_state = "crate"
density = 1
icon_opened = "crateopen"
icon_closed = "crate"
req_access = null
opened = 0
flags = FPRINT
// mouse_drag_pointer = MOUSE_ACTIVE_POINTER //???
/obj/structure/closet/crate/internals
desc = "A internals crate."
name = "Internals crate"
icon = 'icons/obj/storage.dmi'
icon_state = "o2crate"
density = 1
icon_opened = "o2crateopen"
icon_closed = "o2crate"
/obj/structure/closet/crate/trashcart
desc = "A heavy, metal trashcart with wheels."
name = "Trash Cart"
icon = 'icons/obj/storage.dmi'
icon_state = "trashcart"
density = 1
icon_opened = "trashcartopen"
icon_closed = "trashcart"
/*these aren't needed anymore
/obj/structure/closet/crate/hat
desc = "A crate filled with Valuable Collector's Hats!."
name = "Hat Crate"
icon = 'icons/obj/storage.dmi'
icon_state = "crate"
density = 1
icon_opened = "crateopen"
icon_closed = "crate"
/obj/structure/closet/crate/contraband
name = "Poster crate"
desc = "A random assortment of posters manufactured by providers NOT listed under Nanotrasen's whitelist."
icon = 'icons/obj/storage.dmi'
icon_state = "crate"
density = 1
icon_opened = "crateopen"
icon_closed = "crate"
*/
/obj/structure/closet/crate/medical
desc = "A medical crate."
name = "Medical crate"
icon = 'icons/obj/storage.dmi'
icon_state = "medicalcrate"
density = 1
icon_opened = "medicalcrateopen"
icon_closed = "medicalcrate"
/obj/structure/closet/crate/rcd
desc = "A crate for the storage of the RCD."
name = "RCD crate"
icon = 'icons/obj/storage.dmi'
icon_state = "crate"
density = 1
icon_opened = "crateopen"
icon_closed = "crate"
/obj/structure/closet/crate/freezer
desc = "A freezer."
name = "Freezer"
icon = 'icons/obj/storage.dmi'
icon_state = "freezer"
density = 1
icon_opened = "freezeropen"
icon_closed = "freezer"
var/target_temp = T0C - 40
var/cooling_power = 40
return_air()
var/datum/gas_mixture/gas = (..())
if(!gas) return null
var/datum/gas_mixture/newgas = new/datum/gas_mixture()
newgas.oxygen = gas.oxygen
newgas.carbon_dioxide = gas.carbon_dioxide
newgas.nitrogen = gas.nitrogen
newgas.toxins = gas.toxins
newgas.volume = gas.volume
newgas.temperature = gas.temperature
if(newgas.temperature <= target_temp) return
if((newgas.temperature - cooling_power) > target_temp)
newgas.temperature -= cooling_power
else
newgas.temperature = target_temp
return newgas
/obj/structure/closet/crate/bin
desc = "A large bin."
name = "Large bin"
icon = 'icons/obj/storage.dmi'
icon_state = "largebin"
density = 1
icon_opened = "largebinopen"
icon_closed = "largebin"
/obj/structure/closet/crate/radiation
desc = "A crate with a radiation sign on it."
name = "Radioactive gear crate"
icon = 'icons/obj/storage.dmi'
icon_state = "radiation"
density = 1
icon_opened = "radiationopen"
icon_closed = "radiation"
/obj/structure/closet/crate/secure/weapon
desc = "A secure weapons crate."
name = "Weapons crate"
icon = 'icons/obj/storage.dmi'
icon_state = "weaponcrate"
density = 1
icon_opened = "weaponcrateopen"
icon_closed = "weaponcrate"
/obj/structure/closet/crate/secure/plasma
desc = "A secure plasma crate."
name = "Plasma crate"
icon = 'icons/obj/storage.dmi'
icon_state = "plasmacrate"
density = 1
icon_opened = "plasmacrateopen"
icon_closed = "plasmacrate"
/obj/structure/closet/crate/secure/gear
desc = "A secure gear crate."
name = "Gear crate"
icon = 'icons/obj/storage.dmi'
icon_state = "secgearcrate"
density = 1
icon_opened = "secgearcrateopen"
icon_closed = "secgearcrate"
/obj/structure/closet/crate/secure/bin
desc = "A secure bin."
name = "Secure bin"
icon_state = "largebins"
icon_opened = "largebinsopen"
icon_closed = "largebins"
redlight = "largebinr"
greenlight = "largebing"
sparks = "largebinsparks"
emag = "largebinemag"
/obj/structure/closet/crate/secure
desc = "A secure crate."
name = "Secure crate"
icon_state = "securecrate"
icon_opened = "securecrateopen"
icon_closed = "securecrate"
var/redlight = "securecrater"
var/greenlight = "securecrateg"
var/sparks = "securecratesparks"
var/emag = "securecrateemag"
var/broken = 0
var/locked = 1
/obj/structure/closet/crate/hydroponics
name = "Hydroponics crate"
desc = "All you need to destroy those pesky weeds and pests."
icon = 'icons/obj/storage.dmi'
icon_state = "hydrocrate"
icon_opened = "hydrocrateopen"
icon_closed = "hydrocrate"
density = 1
/obj/structure/closet/crate/hydroponics/prespawned
//This exists so the prespawned hydro crates spawn with their contents.
/* name = "Hydroponics crate"
desc = "All you need to destroy those pesky weeds and pests."
icon = 'icons/obj/storage.dmi'
icon_state = "hydrocrate"
icon_opened = "hydrocrateopen"
icon_closed = "hydrocrate"
density = 1*/
New()
..()
new /obj/item/weapon/reagent_containers/spray/plantbgone(src)
new /obj/item/weapon/reagent_containers/spray/plantbgone(src)
new /obj/item/weapon/minihoe(src)
// new /obj/item/weapon/weedspray(src)
// new /obj/item/weapon/weedspray(src)
// new /obj/item/weapon/pestspray(src)
// new /obj/item/weapon/pestspray(src)
// new /obj/item/weapon/pestspray(src)
/obj/structure/closet/crate/New()
..()
spawn(1)
if(!opened) // if closed, any item at the crate's loc is put in the contents
for(var/obj/item/I in src.loc)
if(I.density || I.anchored || I == src) continue
I.loc = src
/obj/structure/closet/crate/secure/New()
..()
if(locked)
overlays = null
overlays += redlight
else
overlays = null
overlays += greenlight
/obj/structure/closet/crate/rcd/New()
..()
new /obj/item/weapon/rcd_ammo(src)
new /obj/item/weapon/rcd_ammo(src)
new /obj/item/weapon/rcd_ammo(src)
new /obj/item/weapon/rcd(src)
/obj/structure/closet/crate/radiation/New()
..()
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
/obj/structure/closet/crate/open()
playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3)
for(var/obj/O in src)
O.loc = get_turf(src)
icon_state = icon_opened
src.opened = 1
/obj/structure/closet/crate/close()
playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3)
var/itemcount = 0
for(var/obj/O in get_turf(src))
if(itemcount >= storage_capacity)
break
if(O.density || O.anchored || O == src) continue
O.loc = src
itemcount++
icon_state = icon_closed
src.opened = 0
/obj/structure/closet/crate/attack_hand(mob/user as mob)
if(opened) close()
else open()
return
/obj/structure/closet/crate/secure/attack_hand(mob/user as mob)
if(locked && !broken)
if (allowed(user))
user << "<span class='notice'>You unlock \the [src].</span>"
src.locked = 0
overlays = null
overlays += greenlight
return
else
user << "<span class='notice'>\The [src] is locked.</span>"
return
else
..()
/obj/structure/closet/crate/secure/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/card) && src.allowed(user) && !locked && !opened && !broken)
user << "<span class='notice'>You lock \the [src].</span>"
src.locked = 1
overlays = null
overlays += redlight
return
else if ( (istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && locked &&!broken)
overlays = null
overlays += emag
overlays += sparks
spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface*
playsound(src.loc, "sparks", 60, 1)
src.locked = 0
src.broken = 1
user << "<span class='notice'>You unlock \the [src].</span>"
return
return ..()
/obj/structure/closet/crate/attack_paw(mob/user as mob)
return attack_hand(user)
/obj/structure/closet/crate/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(opened)
if(isrobot(user))
return
user.drop_item()
if(W)
W.loc = src.loc
else if(istype(W, /obj/item/weapon/packageWrap))
return
else return attack_hand(user)
/obj/structure/closet/crate/secure/emp_act(severity)
for(var/obj/O in src)
O.emp_act(severity)
if(!broken && !opened && prob(50/severity))
if(!locked)
src.locked = 1
overlays = null
overlays += redlight
else
overlays = null
overlays += emag
overlays += sparks
spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface*
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
src.locked = 0
if(!opened && prob(20/severity))
if(!locked)
open()
else
src.req_access = list()
src.req_access += pick(get_all_accesses())
..()
/obj/structure/closet/crate/ex_act(severity)
switch(severity)
if(1.0)
for(var/obj/O in src.contents)
del(O)
del(src)
return
if(2.0)
for(var/obj/O in src.contents)
if(prob(50))
del(O)
del(src)
return
if(3.0)
if (prob(50))
del(src)
return
else
return
@@ -0,0 +1,87 @@
/obj/structure/displaycase/ex_act(severity)
switch(severity)
if (1)
new /obj/item/weapon/shard( src.loc )
if (occupied)
new /obj/item/weapon/gun/energy/laser/captain( src.loc )
occupied = 0
del(src)
if (2)
if (prob(50))
src.health -= 15
src.healthcheck()
if (3)
if (prob(50))
src.health -= 5
src.healthcheck()
/obj/structure/displaycase/bullet_act(var/obj/item/projectile/Proj)
health -= Proj.damage
..()
src.healthcheck()
return
/obj/structure/displaycase/blob_act()
if (prob(75))
new /obj/item/weapon/shard( src.loc )
if (occupied)
new /obj/item/weapon/gun/energy/laser/captain( src.loc )
occupied = 0
del(src)
/obj/structure/displaycase/meteorhit(obj/O as obj)
new /obj/item/weapon/shard( src.loc )
new /obj/item/weapon/gun/energy/laser/captain( src.loc )
del(src)
/obj/structure/displaycase/proc/healthcheck()
if (src.health <= 0)
if (!( src.destroyed ))
src.density = 0
src.destroyed = 1
new /obj/item/weapon/shard( src.loc )
playsound(src, "shatter", 70, 1)
update_icon()
else
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
return
/obj/structure/displaycase/update_icon()
if(src.destroyed)
src.icon_state = "glassboxb[src.occupied]"
else
src.icon_state = "glassbox[src.occupied]"
return
/obj/structure/displaycase/attackby(obj/item/weapon/W as obj, mob/user as mob)
src.health -= W.force
src.healthcheck()
..()
return
/obj/structure/displaycase/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/structure/displaycase/attack_hand(mob/user as mob)
if (src.destroyed && src.occupied)
new /obj/item/weapon/gun/energy/laser/captain( src.loc )
user << "\b You deactivate the hover field built into the case."
src.occupied = 0
src.add_fingerprint(user)
update_icon()
return
else
usr << text("\blue You kick the display case.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] kicks the display case.", usr)
src.health -= 2
healthcheck()
return
@@ -0,0 +1,534 @@
obj/structure/door_assembly
icon = 'icons/obj/doors/door_assembly.dmi'
name = "Airlock Assembly"
icon_state = "door_as_0"
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/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
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
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"
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"
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"
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"
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"
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"
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"
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"
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
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
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
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
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"
desc = "Honk"
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"
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
/obj/structure/door_assembly/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/weldingtool) && !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.")
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)
switch(mineral)
if("glass")
new /obj/item/stack/sheet/rglass(get_turf(src))
if("gold")
new /obj/item/stack/sheet/gold(get_turf(src))
new /obj/item/stack/sheet/gold(get_turf(src))
if("silver")
new /obj/item/stack/sheet/silver(get_turf(src))
new /obj/item/stack/sheet/silver(get_turf(src))
if("diamond")
new /obj/item/stack/sheet/diamond(get_turf(src))
new /obj/item/stack/sheet/diamond(get_turf(src))
if("uranium")
new /obj/item/stack/sheet/uranium(get_turf(src))
new /obj/item/stack/sheet/uranium(get_turf(src))
if("plasma")
new /obj/item/stack/sheet/plasma(get_turf(src))
new /obj/item/stack/sheet/plasma(get_turf(src))
if("clown")
new /obj/item/stack/sheet/clown(get_turf(src))
new /obj/item/stack/sheet/clown(get_turf(src))
if("sandstone")
new /obj/item/stack/sheet/sandstone(get_turf(src))
new /obj/item/stack/sheet/sandstone(get_turf(src))
del(src)
else
user << "\blue You need more welding fuel to dissassemble the airlock assembly."
return
else if(istype(W, /obj/item/weapon/wrench) && !anchored )
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(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
else if(istype(W, /obj/item/weapon/cable_coil) && state == 0 && anchored )
var/obj/item/weapon/cable_coil/coil = W
user.visible_message("[user] wires the airlock assembly.", "You start to wire the airlock assembly.")
if(do_after(user, 40))
if(!src) return
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)
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock 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)
src.state = 0
src.name = "Secured Airlock Assembly"
else if(istype(W, /obj/item/weapon/airlock_electronics) && state == 1 )
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly.")
user.drop_item()
W.loc = src
if(do_after(user, 40))
if(!src) return
user << "\blue You installed the airlock electronics!"
src.state = 2
src.name = "Near finished Airlock Assembly"
src.electronics = W
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.")
if(do_after(user, 40))
if(!src) return
user << "\blue You removed the airlock electronics!"
src.state = 1
src.name = "Wired Airlock Assembly"
var/obj/item/weapon/airlock_electronics/ae
if (!electronics)
ae = new/obj/item/weapon/airlock_electronics( src.loc )
else
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)
switch(G.type)
if(/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.")
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.
if(/obj/item/stack/sheet/gold)
if(G.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.")
if(do_after(user, 40))
user << "\blue You installed gold plating into the airlock assembly!"
G.use(2)
src.mineral = "gold"
src.name = "Near finished Gold Airlock Assembly"
src.airlock_type = /obj/machinery/door/airlock/gold
src.base_icon_state = "door_as_gold"
if(/obj/item/stack/sheet/silver)
if(G.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.")
if(do_after(user, 40))
user << "\blue You installed silver plating into the airlock assembly!"
G.use(2)
src.mineral = "silver"
src.name = "Near finished Silver Airlock Assembly"
src.airlock_type = /obj/machinery/door/airlock/silver
src.base_icon_state = "door_as_silver"
if(/obj/item/stack/sheet/diamond)
if(G.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.")
if(do_after(user, 40))
user << "\blue You installed diamond plating into the airlock assembly!"
G.use(2)
src.mineral = "diamond"
src.name = "Near finished Diamond Airlock Assembly"
src.airlock_type = /obj/machinery/door/airlock/diamond
src.base_icon_state = "door_as_diamond"
if(/obj/item/stack/sheet/uranium)
if(G.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.")
if(do_after(user, 40))
user << "\blue You installed uranium plating into the airlock assembly!"
G.use(2)
src.mineral = "uranium"
src.name = "Near finished Uranium Airlock Assembly"
src.airlock_type = /obj/machinery/door/airlock/uranium
src.base_icon_state = "door_as_uranium"
if(/obj/item/stack/sheet/plasma)
if(G.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.")
if(do_after(user, 40))
user << "\blue You installed plasma plating into the airlock assembly!"
G.use(2)
src.mineral = "plasma"
src.name = "Near finished Plasma Airlock Assembly"
src.airlock_type = /obj/machinery/door/airlock/plasma
src.base_icon_state = "door_as_plasma"
if(/obj/item/stack/sheet/clown)
if(G.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.")
if(do_after(user, 40))
user << "\blue You installed bananium plating into the airlock assembly!HONK"
G.use(2)
playsound(src.loc, 'sound/items/bikehorn.ogg', 15, 1, -3)
src.mineral = "clown"
src.name = "Near finished Bananium Airlock Assembly"
src.airlock_type = /obj/machinery/door/airlock/clown
src.base_icon_state = "door_as_clown"
if(/obj/item/stack/sheet/sandstone)
if(G.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.")
if(do_after(user, 40))
user << "\blue You installed sandstone plating into the airlock assembly!"
G.use(2)
src.mineral = "sandstone"
src.name = "Near finished Sandstone Airlock Assembly"
src.airlock_type = /obj/machinery/door/airlock/sandstone
src.base_icon_state = "door_as_sandstone"
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."
if(do_after(user, 40))
if(!src) return
user << "\blue You finish the airlock!"
var/obj/machinery/door/airlock/door
switch(mineral)
if("glass")
airlock_type = /obj/machinery/door/airlock/glass
door = new src.airlock_type( src.loc )
if("gold")
airlock_type = /obj/machinery/door/airlock/gold
door = new src.airlock_type( src.loc )
if("silver")
airlock_type = /obj/machinery/door/airlock/silver
door = new src.airlock_type( src.loc )
if("diamond")
airlock_type = /obj/machinery/door/airlock/diamond
door = new src.airlock_type( src.loc )
if("uranium")
airlock_type = /obj/machinery/door/airlock/uranium
door = new src.airlock_type( src.loc )
if("plasma")
airlock_type = /obj/machinery/door/airlock/plasma
door = new src.airlock_type( src.loc )
if("clown")
airlock_type = /obj/machinery/door/airlock/clown
door = new src.airlock_type( src.loc )
if("sandstone")
airlock_type = /obj/machinery/door/airlock/sandstone
door = new src.airlock_type( src.loc )
else
door = new src.airlock_type( src.loc )
//door.req_access = src.req_access
door.electronics = src.electronics
door.req_access = src.electronics.conf_access
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.
@@ -0,0 +1,77 @@
/obj/structure/stool/bed/chair/e_chair
name = "electric chair"
desc = "Looks absolutely SHOCKING!"
icon_state = "echair0"
var/on = 0
var/obj/item/assembly/shock_kit/part = null
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
del(src)
return
return
/obj/structure/stool/bed/chair/e_chair/verb/toggle()
set name = "Toggle Electric Chair"
set category = "Object"
set src in oview(1)
if(on)
on = 0
icon_state = "echair0"
else
on = 1
icon_state = "echair1"
return
/obj/structure/stool/bed/chair/e_chair/rotate()
..()
overlays = null
overlays += image('icons/obj/objects.dmi', src, "echair_over", MOB_LAYER + 1, dir) //there's probably a better way of handling this, but eh. -Pete
return
/obj/structure/stool/bed/chair/e_chair/proc/shock()
if(!(src.on))
return
if((src.last_time + 50) > world.time)
return
src.last_time = world.time
// special power handling
var/area/A = get_area(src)
if(!isarea(A))
return
if(!A.powered(EQUIP))
return
A.use_power(EQUIP, 5000)
var/light = A.power_light
A.updateicon()
flick("echair1", src)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(12, 1, src)
s.start()
if(buckled_mob)
buckled_mob.burn_skin(85)
buckled_mob << "\red <B>You feel a deep shock course through your body!</B>"
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)
A.power_light = light
A.updateicon()
return
@@ -0,0 +1,97 @@
/obj/structure/lamarr
name = "Lab Cage"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "labcage1"
desc = "A glass lab container for storing interesting creatures."
density = 1
anchored = 1
unacidable = 1//Dissolving the case would also delete Lamarr
var/health = 30
var/occupied = 1
var/destroyed = 0
/obj/structure/lamarr/ex_act(severity)
switch(severity)
if (1)
new /obj/item/weapon/shard( src.loc )
Break()
del(src)
if (2)
if (prob(50))
src.health -= 15
src.healthcheck()
if (3)
if (prob(50))
src.health -= 5
src.healthcheck()
/obj/structure/lamarr/bullet_act(var/obj/item/projectile/Proj)
health -= Proj.damage
..()
src.healthcheck()
return
/obj/structure/lamarr/blob_act()
if (prob(75))
new /obj/item/weapon/shard( src.loc )
Break()
del(src)
/obj/structure/lamarr/meteorhit(obj/O as obj)
new /obj/item/weapon/shard( src.loc )
Break()
del(src)
/obj/structure/lamarr/proc/healthcheck()
if (src.health <= 0)
if (!( src.destroyed ))
src.density = 0
src.destroyed = 1
new /obj/item/weapon/shard( src.loc )
playsound(src, "shatter", 70, 1)
Break()
else
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
return
/obj/structure/lamarr/update_icon()
if(src.destroyed)
src.icon_state = "labcageb[src.occupied]"
else
src.icon_state = "labcage[src.occupied]"
return
/obj/structure/lamarr/attackby(obj/item/weapon/W as obj, mob/user as mob)
src.health -= W.force
src.healthcheck()
..()
return
/obj/structure/lamarr/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/structure/lamarr/attack_hand(mob/user as mob)
if (src.destroyed)
return
else
usr << text("\blue You kick the lab cage.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] kicks the lab cage.", usr)
src.health -= 2
healthcheck()
return
/obj/structure/lamarr/proc/Break()
if(occupied)
var/obj/item/clothing/mask/facehugger/A = new /obj/item/clothing/mask/facehugger( src.loc )
A.sterile = 1
A.name = "Lamarr"
occupied = 0
update_icon()
return
+32
View File
@@ -0,0 +1,32 @@
//wip wip wup
/obj/structure/mirror
name = "mirror"
desc = "Mirror mirror on the wall, who's the most robust of them all?"
icon = 'icons/obj/watercloset.dmi'
icon_state = "mirror"
density = 0
anchored = 1
/obj/structure/mirror/attack_hand(mob/user as mob)
if(ishuman(user))
var/mob/living/carbon/human/H = user
var/userloc = H.loc
//see code/modules/mob/new_player/preferences.dm at approx line 545 for comments!
//this is largely copypasted from there.
//handle facial hair (if necessary)
if(H.gender == MALE)
var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in facial_hair_styles_list
if(userloc != H.loc) return //no tele-grooming
if(new_style)
H.f_style = new_style
//handle normal hair
var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in hair_styles_list
if(userloc != H.loc) return //no tele-grooming
if(new_style)
H.h_style = new_style
H.update_hair()
@@ -0,0 +1,34 @@
/obj/structure/mopbucket/New()
var/datum/reagents/R = new/datum/reagents(100)
reagents = R
R.my_atom = src
/obj/structure/mopbucket/examine()
set src in usr
usr << text("\icon[] [] contains [] units of water left!", src, src.name, src.reagents.total_volume)
..()
/obj/structure/mopbucket/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/mop))
if (src.reagents.total_volume >= 2)
src.reagents.trans_to(W, 2)
user << "\blue You wet the mop"
playsound(src.loc, 'sound/effects/slosh.ogg', 25, 1)
if (src.reagents.total_volume < 1)
user << "\blue Out of water!"
return
/obj/structure/mopbucket/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
@@ -0,0 +1,311 @@
/* Windoor (window door) assembly -Nodrak
* Step 1: Create a windoor out of rglass
* Step 2: Add r-glass to the assembly to make a secure windoor (Optional)
* Step 3: Rotate or Flip the assembly to face and open the way you want
* Step 4: Wrench the assembly in place
* Step 5: Add cables to the assembly
* Step 6: Set access for the door.
* Step 7: Screwdriver the door to complete
*/
obj/structure/windoor_assembly
icon = 'icons/obj/doors/windoor.dmi'
name = "Windoor Assembly"
icon_state = "l_windoor_assembly01"
anchored = 0
density = 0
dir = NORTH
var/ini_dir
var/obj/item/weapon/airlock_electronics/electronics = null
//Vars to help with the icon's name
var/facing = "l" //Does the windoor open to the left or right?
var/secure = "" //Whether or not this creates a secure windoor
var/state = "01" //How far the door assembly has progressed in terms of sprites
obj/structure/windoor_assembly/New(dir=NORTH)
..()
src.ini_dir = src.dir
update_nearby_tiles(need_rebuild=1)
obj/structure/windoor_assembly/Del()
density = 0
update_nearby_tiles()
..()
/obj/structure/windoor_assembly/update_icon()
icon_state = "[facing]_[secure]windoor_assembly[state]"
/obj/structure/windoor_assembly/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(istype(mover) && mover.checkpass(PASSGLASS))
return 1
if(get_dir(loc, target) == dir) //Make sure looking at appropriate border
if(air_group) return 0
return !density
else
return 1
/obj/structure/windoor_assembly/CheckExit(atom/movable/mover as mob|obj, turf/target as turf)
if(istype(mover) && mover.checkpass(PASSGLASS))
return 1
if(get_dir(loc, target) == dir)
return !density
else
return 1
/obj/structure/windoor_assembly/attackby(obj/item/W as obj, mob/user as mob)
//I really should have spread this out across more states but thin little windoors are hard to sprite.
switch(state)
if("01")
if(istype(W, /obj/item/weapon/weldingtool) && !anchored )
var/obj/item/weapon/weldingtool/WT = W
if (WT.remove_fuel(0,user))
user.visible_message("[user] dissassembles the windoor assembly.", "You start to dissassemble the windoor assembly.")
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
if(do_after(user, 40))
if(!src || !WT.isOn()) return
user << "\blue You dissasembled the windoor assembly!"
new /obj/item/stack/sheet/rglass(get_turf(src), 5)
if(secure)
new /obj/item/stack/rods(get_turf(src), 4)
del(src)
else
user << "\blue You need more welding fuel to dissassemble the windoor assembly."
return
//Wrenching an unsecure assembly anchors it in place. Step 4 complete
if(istype(W, /obj/item/weapon/wrench) && !anchored)
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user.visible_message("[user] secures the windoor assembly to the floor.", "You start to secure the windoor assembly to the floor.")
if(do_after(user, 40))
if(!src) return
user << "\blue You've secured the windoor assembly!"
src.anchored = 1
if(src.secure)
src.name = "Secure Anchored Windoor Assembly"
else
src.name = "Anchored Windoor Assembly"
//Unwrenching an unsecure assembly un-anchors it. Step 4 undone
else if(istype(W, /obj/item/weapon/wrench) && anchored)
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user.visible_message("[user] unsecures the windoor assembly to the floor.", "You start to unsecure the windoor assembly to the floor.")
if(do_after(user, 40))
if(!src) return
user << "\blue You've unsecured the windoor assembly!"
src.anchored = 0
if(src.secure)
src.name = "Secure Windoor Assembly"
else
src.name = "Windoor Assembly"
//Adding plasteel makes the assembly a secure windoor assembly. Step 2 (optional) complete.
else if(istype(W, /obj/item/stack/sheet/plasteel) && !secure)
var/obj/item/stack/sheet/plasteel/P = W
if(P.amount < 2)
user << "\red You need more plasteel to do this."
return
user << "\blue You start to reinforce the windoor with plasteel."
if(do_after(user,40))
if(!src) return
P.use(2)
user << "\blue You reinforce the windoor."
src.secure = "secure_"
if(src.anchored)
src.name = "Secure Anchored Windoor Assembly"
else
src.name = "Secure Windoor Assembly"
//Adding cable to the assembly. Step 5 complete.
else if(istype(W, /obj/item/weapon/cable_coil) && anchored)
user.visible_message("[user] wires the windoor assembly.", "You start to wire the windoor assembly.")
if(do_after(user, 40))
if(!src) return
var/obj/item/weapon/cable_coil/CC = W
CC.use(1)
user << "\blue You wire the windoor!"
src.state = "02"
if(src.secure)
src.name = "Secure Wired Windoor Assembly"
else
src.name = "Wired Windoor Assembly"
else
..()
if("02")
//Removing wire from the assembly. Step 5 undone.
if(istype(W, /obj/item/weapon/wirecutters))
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.")
if(do_after(user, 40))
if(!src) return
user << "\blue You cut the windoor wires.!"
new/obj/item/weapon/cable_coil(get_turf(user), 1)
src.state = "01"
if(src.secure)
src.name = "Secure Wired Windoor Assembly"
else
src.name = "Wired Windoor Assembly"
//Adding airlock electronics for access. Step 6 complete.
else if(istype(W, /obj/item/weapon/airlock_electronics))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly.")
if(do_after(user, 40))
if(!src) return
user.drop_item()
W.loc = src
user << "\blue You've installed the airlock electronics!"
src.name = "Near finished Windoor Assembly"
src.electronics = W
else
W.loc = src.loc
//Screwdriver to remove airlock electronics. Step 6 undone.
else if(istype(W, /obj/item/weapon/screwdriver))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to uninstall electronics from the airlock assembly.")
if(do_after(user, 40))
if(!src) return
user << "\blue You've removed the airlock electronics!"
src.name = "Wired Windoor Assembly"
var/obj/item/weapon/airlock_electronics/ae
if (!electronics)
ae = new/obj/item/weapon/airlock_electronics( src.loc )
else
ae = electronics
electronics = null
ae.loc = src.loc
//Crowbar to complete the assembly, Step 7 complete.
else if(istype(W, /obj/item/weapon/crowbar))
if(!src.electronics)
usr << "\red The assembly is missing electronics."
return
usr << browse(null, "window=windoor_access")
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] pries the windoor into the frame.", "You start prying the windoor into the frame.")
if(do_after(user, 40))
if(!src) return
density = 1 //Shouldn't matter but just incase
user << "\blue You finish the windoor!"
if(secure)
var/obj/machinery/door/window/brigdoor/windoor = new /obj/machinery/door/window/brigdoor(src.loc)
if(src.facing == "l")
windoor.icon_state = "leftsecureopen"
windoor.base_state = "leftsecure"
else
windoor.icon_state = "rightsecureopen"
windoor.base_state = "rightsecure"
windoor.dir = src.dir
windoor.density = 0
windoor.req_access = src.electronics.conf_access
windoor.electronics = src.electronics
src.electronics.loc = windoor
else
var/obj/machinery/door/window/windoor = new /obj/machinery/door/window(src.loc)
if(src.facing == "l")
windoor.icon_state = "leftopen"
windoor.base_state = "left"
else
windoor.icon_state = "rightopen"
windoor.base_state = "right"
windoor.dir = src.dir
windoor.density = 0
windoor.req_access = src.electronics.conf_access
windoor.electronics = src.electronics
src.electronics.loc = windoor
del(src)
else
..()
//Update to reflect changes(if applicable)
update_icon()
//Rotates the windoor assembly clockwise
/obj/structure/windoor_assembly/verb/revrotate()
set name = "Rotate Windoor Assembly"
set category = "Object"
set src in oview(1)
if (src.anchored)
usr << "It is fastened to the floor; therefore, you can't rotate it!"
return 0
if(src.state != "01")
update_nearby_tiles(need_rebuild=1) //Compel updates before
src.dir = turn(src.dir, 270)
if(src.state != "01")
update_nearby_tiles(need_rebuild=1)
src.ini_dir = src.dir
update_icon()
return
//Flips the windoor assembly, determines whather the door opens to the left or the right
/obj/structure/windoor_assembly/verb/flip()
set name = "Flip Windoor Assembly"
set category = "Object"
set src in oview(1)
if(src.facing == "l")
usr << "The windoor will now slide to the right."
src.facing = "r"
else
src.facing = "l"
usr << "The windoor will now slide to the left."
update_icon()
return
/obj/structure/windoor_assembly/proc/update_nearby_tiles(need_rebuild)
if(!air_master) return 0
var/turf/simulated/source = loc
var/turf/simulated/target = get_step(source,dir)
if(need_rebuild)
if(istype(source)) //Rebuild/update nearby group geometry
if(source.parent)
air_master.groups_to_rebuild += source.parent
else
air_master.tiles_to_update += source
if(istype(target))
if(target.parent)
air_master.groups_to_rebuild += target.parent
else
air_master.tiles_to_update += target
else
if(istype(source)) air_master.tiles_to_update += source
if(istype(target)) air_master.tiles_to_update += target
return 1
+398
View File
@@ -0,0 +1,398 @@
/obj/structure/window/bullet_act(var/obj/item/projectile/Proj)
health -= Proj.damage
..()
if(health <=0)
new /obj/item/weapon/shard( src.loc )
new /obj/item/stack/rods( src.loc )
src.density = 0
del(src)
return
/obj/structure/window/ex_act(severity)
switch(severity)
if(1.0)
del(src)
return
if(2.0)
new /obj/item/weapon/shard( src.loc )
if(reinf) new /obj/item/stack/rods( src.loc)
//SN src = null
del(src)
return
if(3.0)
if (prob(50))
new /obj/item/weapon/shard( src.loc )
if(reinf) new /obj/item/stack/rods( src.loc)
del(src)
return
return
/obj/structure/window/blob_act()
if(reinf) new /obj/item/stack/rods( src.loc)
density = 0
del(src)
/obj/structure/window/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(istype(mover) && mover.checkpass(PASSGLASS))
return 1
if (src.dir == SOUTHWEST || src.dir == SOUTHEAST || src.dir == NORTHWEST || src.dir == NORTHEAST)
return 0 //full tile window, you can't move into it!
if(get_dir(loc, target) == dir)
return !density
else
return 1
/obj/structure/window/CheckExit(atom/movable/O as mob|obj, target as turf)
if(istype(O) && O.checkpass(PASSGLASS))
return 1
if (get_dir(O.loc, target) == dir)
return 0
return 1
/obj/structure/window/meteorhit()
//*****RM
//world << "glass at [x],[y],[z] Mhit"
src.health = 0
new /obj/item/weapon/shard( src.loc )
if(reinf) new /obj/item/stack/rods( src.loc)
src.density = 0
del(src)
return
/obj/structure/window/hitby(AM as mob|obj)
..()
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>[src] was hit by [AM].</B>", 1)
var/tforce = 0
if(ismob(AM))
tforce = 40
else
tforce = AM:throwforce
if(reinf) tforce /= 4.0
playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1)
src.health = max(0, src.health - tforce)
if (src.health <= 7 && !reinf)
src.anchored = 0
update_nearby_icons()
step(src, get_dir(AM, src))
if (src.health <= 0)
new /obj/item/weapon/shard( src.loc )
if(reinf) new /obj/item/stack/rods( src.loc)
src.density = 0
del(src)
return
//..() //Does this really need to be here twice? The parent proc doesn't even do anything yet. - Nodrak
return
//These all need to be rewritten to use visiblemessage()
/obj/structure/window/attack_hand()
if ((HULK in usr.mutations) || (SUPRSTR in usr.augmentations))
usr << "\blue You smash through the window."
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << "\red [usr] smashes through the window!"
src.health = 0
new /obj/item/weapon/shard( src.loc )
if(reinf) new /obj/item/stack/rods( src.loc)
src.density = 0
del(src)
return
/obj/structure/window/attack_paw()
if ((HULK in usr.mutations))
usr << "\blue You smash through the window."
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << "\red [usr] smashes through the window!"
src.health = 0
new /obj/item/weapon/shard( src.loc )
if(reinf) new /obj/item/stack/rods( src.loc)
src.density = 0
del(src)
return
/obj/structure/window/attack_alien()
if (istype(usr, /mob/living/carbon/alien/larva))//Safety check for larva. /N
return
usr << "\green You smash against the window."
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << "\red [usr] smashes against the window."
playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1)
src.health -= 15
if(src.health <= 0)
usr << "\green You smash through the window."
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << "\red [usr] smashes through the window!"
src.health = 0
new /obj/item/weapon/shard(src.loc)
if(reinf)
new /obj/item/stack/rods(src.loc)
src.density = 0
del(src)
return
return
/obj/structure/window/attack_animal(mob/living/simple_animal/M as mob)
if (M.melee_damage_upper == 0)
return
M << "\green You smash against the window."
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O << "\red [M] smashes against the window."
playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1)
src.health -= M.melee_damage_upper
if(src.health <= 0)
M << "\green You smash through the window."
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O << "\red [M] smashes through the window!"
src.health = 0
new /obj/item/weapon/shard(src.loc)
if(reinf)
new /obj/item/stack/rods(src.loc)
src.density = 0
del(src)
return
return
/obj/structure/window/attack_metroid()
if(!istype(usr, /mob/living/carbon/metroid/adult))
return
usr<< "\green You smash against the window."
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << "\red [usr] smashes against the window."
playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1)
src.health -= rand(10,15)
if(src.health <= 0)
usr << "\green You smash through the window."
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << "\red [usr] smashes through the window!"
src.health = 0
new /obj/item/weapon/shard(src.loc)
if(reinf)
new /obj/item/stack/rods(src.loc)
src.density = 0
del(src)
return
return
/obj/structure/window/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(!istype(W)) return//I really wish I did not need this
if (istype(W, /obj/item/weapon/screwdriver))
if(reinf && state >= 1)
state = 3 - state
playsound(src.loc, 'sound/items/Screwdriver.ogg', 75, 1)
usr << ( state==1? "You have unfastened the window from the frame." : "You have fastened the window to the frame." )
else if(reinf && state == 0)
anchored = !anchored
update_nearby_icons()
playsound(src.loc, 'sound/items/Screwdriver.ogg', 75, 1)
user << (src.anchored ? "You have fastened the frame to the floor." : "You have unfastened the frame from the floor.")
else if(!reinf)
src.anchored = !( src.anchored )
update_nearby_icons()
playsound(src.loc, 'sound/items/Screwdriver.ogg', 75, 1)
user << (src.anchored ? "You have fastened the window to the floor." : "You have unfastened the window.")
else if(istype(W, /obj/item/weapon/crowbar) && reinf && state <=1)
state = 1-state;
playsound(src.loc, 'sound/items/Crowbar.ogg', 75, 1)
user << (state ? "You have pried the window into the frame." : "You have pried the window out of the frame.")
else
var/aforce = W.force
if(reinf) aforce /= 2.0
if(W.damtype == BRUTE || W.damtype == BURN)
src.health = max(0, src.health - aforce)
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
if (src.health <= 7)
src.anchored = 0
update_nearby_icons()
step(src, get_dir(user, src))
if (src.health <= 0)
if (src.dir == SOUTHWEST)
var/index = null
index = 0
while(index < 2)
new /obj/item/weapon/shard( src.loc )
if(reinf) new /obj/item/stack/rods( src.loc)
index++
else
new /obj/item/weapon/shard( src.loc )
if(reinf) new /obj/item/stack/rods( src.loc)
src.density = 0
del(src)
return
..()
return
/obj/structure/window/verb/rotate()
set name = "Rotate Window Counter-Clockwise"
set category = "Object"
set src in oview(1)
if (src.anchored)
usr << "It is fastened to the floor; therefore, you can't rotate it!"
return 0
update_nearby_tiles(need_rebuild=1) //Compel updates before
src.dir = turn(src.dir, 90)
updateSilicate()
update_nearby_tiles(need_rebuild=1)
src.ini_dir = src.dir
return
/obj/structure/window/verb/revrotate()
set name = "Rotate Window Clockwise"
set category = "Object"
set src in oview(1)
if (src.anchored)
usr << "It is fastened to the floor; therefore, you can't rotate it!"
return 0
update_nearby_tiles(need_rebuild=1) //Compel updates before
src.dir = turn(src.dir, 270)
updateSilicate()
update_nearby_tiles(need_rebuild=1)
src.ini_dir = src.dir
return
/obj/structure/window/proc/updateSilicate()
if(silicateIcon && silicate)
src.icon = initial(icon)
var/icon/I = icon(icon,icon_state,dir)
var/r = (silicate / 100) + 1
var/g = (silicate / 70) + 1
var/b = (silicate / 50) + 1
I.SetIntensity(r,g,b)
icon = I
silicateIcon = I
/obj/structure/window/New(Loc,re=0)
..()
if(re) reinf = re
src.ini_dir = src.dir
if(reinf)
icon_state = "rwindow"
desc = "A reinforced window."
name = "reinforced window"
state = 2*anchored
health = 40
if(opacity)
icon_state = "twindow"
else
icon_state = "window"
update_nearby_tiles(need_rebuild=1)
update_nearby_icons()
return
/obj/structure/window/Del()
density = 0
update_nearby_tiles()
playsound(src, "shatter", 70, 1)
update_nearby_icons()
..()
/obj/structure/window/Move()
update_nearby_tiles(need_rebuild=1)
..()
src.dir = src.ini_dir
update_nearby_tiles(need_rebuild=1)
return
//This proc has to do with airgroups and atmos, it has nothing to do with smoothwindows, that's update_nearby_tiles().
/obj/structure/window/proc/update_nearby_tiles(need_rebuild)
if(!air_master) return 0
var/turf/simulated/source = loc
var/turf/simulated/target = get_step(source,dir)
if(need_rebuild)
if(istype(source)) //Rebuild/update nearby group geometry
if(source.parent)
air_master.groups_to_rebuild += source.parent
else
air_master.tiles_to_update += source
if(istype(target))
if(target.parent)
air_master.groups_to_rebuild += target.parent
else
air_master.tiles_to_update += target
else
if(istype(source)) air_master.tiles_to_update += source
if(istype(target)) air_master.tiles_to_update += target
return 1
//checks if this window is full-tile one
/obj/structure/window/proc/is_fulltile()
if(dir in list(5,6,9,10))
return 1
return 0
//This proc is used to update the icons of nearby windows. It should not be confused with update_nearby_tiles(), which is an atmos proc!
/obj/structure/window/proc/update_nearby_icons()
src.update_icon()
for(var/direction in cardinal)
for(var/obj/structure/window/W in get_step(src,direction) )
W.update_icon()
//merges adjacent full-tile windows into one (blatant ripoff from game/smoothwall.dm)
/obj/structure/window/update_icon()
//A little cludge here, since I don't know how it will work with slim windows. Most likely VERY wrong.
//this way it will only update full-tile ones
//This spawn is here so windows get properly updated when one gets deleted.
spawn(2)
if(!src) return
if (!is_fulltile())
return
var/junction = 0 //will be used to determine from which side the window is connected to other windows
if (src.anchored)
for(var/obj/structure/window/W in orange(src,1))
if (W.anchored && W.density && W.is_fulltile()) //Only counts anchored, not-destroyed fill-tile windows.
if (abs(src.x-W.x)-abs(src.y-W.y) ) //doesn't count windows, placed diagonally to src
junction |= get_dir(src,W)
if (opacity)
src.icon_state = "twindow[junction]"
else
if (reinf)
src.icon_state = "rwindow[junction]"
else
src.icon_state = "window[junction]"
return