Added combat text to smashing windoors

Windoor construction
- You now require airlock electronics to build windoors.
- You can now completely de-construct windoor assemblies with a welder.
- Windoors built by assemblies start open. This is because Cheridan's awesome construction sprite is in the 'open' position and it doesnt make sense for a crowbar to insta-close them.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3716 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
johnsonmt88@gmail.com
2012-06-01 23:37:08 +00:00
parent 7158432be4
commit bb6222eec6
3 changed files with 73 additions and 69 deletions
+2
View File
@@ -169,9 +169,11 @@ SHARDS
if(isturf(user.loc) && locate(/obj/structure/windoor_assembly/, user.loc))
user << "\red There is already a windoor assembly in that location."
return 1
if(isturf(user.loc) && locate(/obj/machinery/door/window/, user.loc))
user << "\red There is already a windoor in that location."
return 1
if(src.amount < 5)
user << "\red You need more glass to do that."
+68 -69
View File
@@ -19,12 +19,12 @@ obj/structure/windoor_assembly
dir = NORTH
var/ini_dir
var/list/conf_access = null //configuring access, step 6
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 or not
var/state = "01" //How far the door assembly has progressed
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)
..()
@@ -60,6 +60,24 @@ obj/structure/windoor_assembly/Del()
/obj/structure/windoor_assembly/attackby(obj/item/W as obj, mob/user as mob)
switch(state)
if("01")
if(istype(W, /obj/item/weapon/weldingtool) && W:welding && !anchored )
if (W:remove_fuel(0,user))
W:welding = 2
user.visible_message("[user] dissassembles the windoor assembly.", "You start to dissassemble the windoor assembly.")
playsound(src.loc, 'Welder2.ogg', 50, 1)
if(do_after(user, 40))
if(!src) 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)
W:welding = 1
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, 'Ratchet.ogg', 100, 1)
@@ -142,15 +160,42 @@ obj/structure/windoor_assembly/Del()
else
src.name = "Wired Windoor Assembly"
//Screwdrivering the wires in place (setting door access). Step 6 in progress.
//Adding airlock electronics for access. Step 6 complete.
else if(istype(W, /obj/item/weapon/airlock_electronics))
playsound(src.loc, '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, 'Screwdriver.ogg', 100, 1)
user.visible_message("[user] adjusts the access wires of the windoor assembly.", "You start to adjust the access wires of the windoor assembly.")
configure_access()
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'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.
if(istype(W, /obj/item/weapon/crowbar))
else if(istype(W, /obj/item/weapon/crowbar))
usr << browse(null, "window=windoor_access")
playsound(src.loc, 'Crowbar.ogg', 100, 1)
user.visible_message("[user] pries the windoor into the frame.", "You start prying the windoor into the frame.")
@@ -165,23 +210,31 @@ obj/structure/windoor_assembly/Del()
if(secure)
var/obj/machinery/door/window/brigdoor/windoor = new /obj/machinery/door/window/brigdoor(src.loc)
if(src.facing == "l")
windoor.icon_state = "leftsecure"
windoor.icon_state = "leftsecureopen"
windoor.base_state = "leftsecure"
else
windoor.icon_state = "rightsecure"
windoor.icon_state = "rightsecureopen"
windoor.base_state = "rightsecure"
windoor.dir = src.dir
windoor.req_access = src.conf_access
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 = "left"
windoor.icon_state = "leftopen"
windoor.base_state = "left"
else
windoor.icon_state = "right"
windoor.icon_state = "rightopen"
windoor.base_state = "right"
windoor.dir = src.dir
windoor.req_access = src.conf_access
windoor.density = 0
windoor.req_access = src.electronics.conf_access
windoor.electronics = src.electronics
src.electronics.loc = windoor
del(src)
@@ -193,61 +246,6 @@ obj/structure/windoor_assembly/Del()
//Update to reflect changes(if applicable)
update_icon()
//Adjust the access of the door and pass it to Topic
/obj/structure/windoor_assembly/proc/configure_access()
if(!src || !usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
return
var/t1 = "<B>Access control</B><br>\n"
if(!conf_access)
t1 += "<font color=red>All</font><br>"
else
t1 += "<a href='?src=\ref[src];access=all'>All</a><br>"
t1 += "<br>"
var/list/accesses = get_all_accesses()
for (var/acc in accesses)
var/aname = get_access_desc(acc)
if (!conf_access || !conf_access.len || !(acc in conf_access))
t1 += "<a href='?src=\ref[src];access=[acc]'>[aname]</a><br>"
else
t1 += "<a style='color: red' href='?src=\ref[src];access=[acc]'>[aname]</a><br>"
t1 += text("<p><a href='?src=\ref[];close=1'>Close</a></p>\n", src)
usr << browse(t1, "window=windoor_access")
//Finalize door accesses. Step 6 complete.
/obj/structure/windoor_assembly/Topic(href, href_list)
if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr) || href_list["close"])
usr << browse(null, "window=windoor_access")
return
if(href_list["access"])
var/acc = href_list["access"]
if (acc == "all")
conf_access = null
else
var/req = text2num(acc)
if(conf_access == null)
conf_access = list()
if(!(req in conf_access))
conf_access += req
else
conf_access -= req
if (!conf_access.len)
conf_access = null
//Refresh the window.
configure_access()
//Rotates the windoor assembly clockwise
/obj/structure/windoor_assembly/verb/revrotate()
@@ -267,6 +265,7 @@ obj/structure/windoor_assembly/Del()
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
@@ -282,7 +281,7 @@ obj/structure/windoor_assembly/Del()
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)