mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Merge pull request #1235 from Erthilo/TGUpdates
TG Updates r3695 to r3712
This commit is contained in:
@@ -232,3 +232,30 @@
|
||||
|
||||
if(!src.toggle())
|
||||
usr << "\blue It won't budge!"
|
||||
|
||||
/obj/structure/closet/verb/verb_toggleopen()
|
||||
set src in view(1)
|
||||
set category = "Object"
|
||||
set name = "Toggle Open"
|
||||
|
||||
if(!(usr))
|
||||
return
|
||||
if(!istype(src.loc, /turf) || usr.stat || usr.restrained() )
|
||||
usr << "\red You can't interact with this!"
|
||||
return
|
||||
if(src.anchored)
|
||||
usr << "\red You can't interact with this!"
|
||||
return
|
||||
if(istype(usr, /mob/living/silicon/robot))
|
||||
src.attack_hand(usr)
|
||||
return
|
||||
if((!istype(usr, /mob/living/carbon)) || (istype(usr, /mob/living/carbon/brain)))
|
||||
usr << "\red You can't interact with this!"
|
||||
return
|
||||
if(istype(usr, /mob/living/carbon/human))
|
||||
src.attack_hand(usr)
|
||||
if(istype(usr, /mob/living/carbon/alien))
|
||||
src.attack_alien(usr)
|
||||
if(istype(usr, /mob/living/carbon/monkey))
|
||||
src.attack_paw(usr)
|
||||
return
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/obj/structure/closet/athletic_mixed/New()
|
||||
..()
|
||||
sleep(2)
|
||||
new /obj/item/clothing/under/shorts/grey(src)
|
||||
new /obj/item/clothing/under/shorts/black(src)
|
||||
new /obj/item/clothing/under/shorts/red(src)
|
||||
new /obj/item/clothing/under/shorts/blue(src)
|
||||
new /obj/item/clothing/under/shorts/green(src)
|
||||
|
||||
/obj/structure/closet/boxinggloves/New()
|
||||
..()
|
||||
sleep(2)
|
||||
new /obj/item/clothing/gloves/boxing/blue(src)
|
||||
new /obj/item/clothing/gloves/boxing/green(src)
|
||||
new /obj/item/clothing/gloves/boxing/yellow(src)
|
||||
new /obj/item/clothing/gloves/boxing(src)
|
||||
|
||||
/obj/structure/closet/masks/New()
|
||||
..()
|
||||
sleep(2)
|
||||
new /obj/item/clothing/mask/luchador(src)
|
||||
new /obj/item/clothing/mask/luchador/rudos(src)
|
||||
new /obj/item/clothing/mask/luchador/tecnicos(src)
|
||||
|
||||
/obj/structure/closet/lasertag/red/New()
|
||||
..()
|
||||
sleep(2)
|
||||
new /obj/item/clothing/suit/redtag(src)
|
||||
new /obj/item/clothing/suit/redtag(src)
|
||||
new /obj/item/weapon/gun/energy/laser/redtag(src)
|
||||
new /obj/item/weapon/gun/energy/laser/redtag(src)
|
||||
|
||||
/obj/structure/closet/lasertag/blue/New()
|
||||
..()
|
||||
sleep(2)
|
||||
new /obj/item/clothing/suit/bluetag(src)
|
||||
new /obj/item/clothing/suit/bluetag(src)
|
||||
new /obj/item/weapon/gun/energy/laser/bluetag(src)
|
||||
new /obj/item/weapon/gun/energy/laser/bluetag(src)
|
||||
@@ -24,6 +24,19 @@
|
||||
src.req_access += pick(get_all_accesses())
|
||||
..()
|
||||
|
||||
/obj/structure/closet/secure_closet/proc/togglelock(mob/user as mob)
|
||||
if(src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
for(var/mob/O in viewers(user, 3))
|
||||
if((O.client && !( O.blinded )))
|
||||
O << "\blue The locker has been [src.locked ? null : "un"]locked by [user]."
|
||||
if(src.locked)
|
||||
src.icon_state = src.icon_locked
|
||||
else
|
||||
src.icon_state = src.icon_closed
|
||||
else
|
||||
user << "\red Access Denied"
|
||||
|
||||
/obj/structure/closet/secure_closet/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(src.opened)
|
||||
if(istype(W, /obj/item/weapon/grab))
|
||||
@@ -83,8 +96,7 @@
|
||||
else
|
||||
user << "You need to stay still!"
|
||||
else
|
||||
user << "\red Access Denied"
|
||||
return
|
||||
togglelock(user)
|
||||
|
||||
/obj/structure/closet/secure_closet/relaymove(mob/user as mob)
|
||||
if(user.stat)
|
||||
@@ -114,4 +126,16 @@
|
||||
return src.attackby(null, user)
|
||||
|
||||
/obj/structure/closet/secure_closet/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/structure/closet/secure_closet/verb/verb_togglelock()
|
||||
set src in oview(1) // Can only use it from one square distance
|
||||
set category = "Object"
|
||||
set name = "Toggle Lock"
|
||||
|
||||
if(!usr.canmove || usr.stat || usr.restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
|
||||
return
|
||||
|
||||
if(!opened) // If we let him lock it while it's open, it will close without the items inside going with it
|
||||
togglelock(usr)
|
||||
|
||||
|
||||
@@ -74,12 +74,15 @@ obj/structure/closet/wardrobe/hop/New()
|
||||
|
||||
/obj/structure/closet/wardrobe/chaplain_black/New()
|
||||
//new /obj/item/clothing/suit/imperium_monk(src) //No. -- Urist
|
||||
new /obj/item/clothing/under/rank/chaplain(src)
|
||||
new /obj/item/clothing/shoes/black(src)
|
||||
new /obj/item/clothing/suit/nun(src)
|
||||
new /obj/item/clothing/head/nun_hood(src)
|
||||
new /obj/item/clothing/suit/storage/chaplain_hoodie(src)
|
||||
new /obj/item/clothing/head/chaplain_hood(src)
|
||||
new /obj/item/clothing/suit/holidaypriest(src)
|
||||
new /obj/item/clothing/suit/hastur (src)
|
||||
new /obj/item/clothing/head/hasturhood (src)
|
||||
//new /obj/item/clothing/suit/hastur (src) //No. -- Urist
|
||||
//new /obj/item/clothing/head/hasturhood (src) //No. -- Urist
|
||||
return
|
||||
|
||||
/obj/structure/closet/wardrobe/green/New()
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
ttone = "holy"
|
||||
|
||||
/obj/item/device/pda/lawyer
|
||||
default_cartridge = /obj/item/weapon/cartridge/lawyer
|
||||
icon_state = "pda-lawyer"
|
||||
ttone = "objection"
|
||||
|
||||
@@ -1034,15 +1035,15 @@
|
||||
var/newcart = pick(1,2,3,4)
|
||||
switch(newcart)
|
||||
if(1)
|
||||
new /obj/item/weapon/cartridge/janitor(src)
|
||||
new /obj/item/weapon/cartridge/engineering(src)
|
||||
if(2)
|
||||
new /obj/item/weapon/cartridge/security(src)
|
||||
if(3)
|
||||
new /obj/item/weapon/cartridge/medical(src)
|
||||
if(4)
|
||||
new /obj/item/weapon/cartridge/head(src)
|
||||
new /obj/item/weapon/cartridge/signal/toxins(src)
|
||||
|
||||
new /obj/item/weapon/cartridge/signal/toxins(src)
|
||||
new /obj/item/weapon/cartridge/head(src)
|
||||
|
||||
|
||||
// Pass along the pulse to atoms in contents, largely added so pAIs are vulnerable to EMP
|
||||
|
||||
@@ -56,7 +56,6 @@
|
||||
spawn(5)
|
||||
radio = new /obj/item/radio/integrated/beepsky(src)
|
||||
|
||||
|
||||
detective
|
||||
name = "D.E.T.E.C.T. Cartridge"
|
||||
icon_state = "cart-s"
|
||||
@@ -70,6 +69,11 @@
|
||||
icon_state = "cart-j"
|
||||
access_janitor = 1
|
||||
|
||||
lawyer
|
||||
name = "P.R.O.V.E. Cartridge"
|
||||
icon_state = "cart-s"
|
||||
access_security = 1
|
||||
|
||||
clown
|
||||
name = "Honkworks 5.0"
|
||||
icon_state = "cart-clown"
|
||||
@@ -153,6 +157,7 @@
|
||||
name = "Med-U DELUXE"
|
||||
icon_state = "cart-cmo"
|
||||
access_status_display = 1
|
||||
access_reagent_scanner = 1
|
||||
access_medical = 1
|
||||
|
||||
rd
|
||||
|
||||
@@ -184,7 +184,9 @@ obj/structure/door_assembly
|
||||
W:welding = 2
|
||||
user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.")
|
||||
playsound(src.loc, 'Welder2.ogg', 50, 1)
|
||||
|
||||
if(do_after(user, 40))
|
||||
if(!src) return
|
||||
user << "\blue You dissasembled the airlock assembly!"
|
||||
new /obj/item/stack/sheet/metal(get_turf(src), 4)
|
||||
if(src.glass==1)
|
||||
@@ -194,52 +196,55 @@ obj/structure/door_assembly
|
||||
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, 'Ratchet.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user.visible_message("[user] secures the airlock assembly to the floor.", "You start to secure the airlock assembly to the floor.")
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
|
||||
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, 'Ratchet.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user.visible_message("[user] unsecures the airlock assembly from the floor.", "You start to unsecure the airlock assembly from the floor.")
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
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
|
||||
var/turf/T = get_turf(user)
|
||||
user.visible_message("[user] wires the airlock assembly.", "You start to wire the airlock assembly.")
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
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, 'Wirecutter.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.")
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
|
||||
if(do_after(user, 40))
|
||||
if(!src) return
|
||||
user << "\blue You cut the airlock wires.!"
|
||||
new/obj/item/weapon/cable_coil(T, 1)
|
||||
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, 'Screwdriver.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly.")
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
|
||||
if(do_after(user, 40))
|
||||
if(!src) return
|
||||
user << "\blue You installed the airlock electronics!"
|
||||
|
||||
var/obj/item/weapon/airlock_electronics/E = W
|
||||
@@ -263,12 +268,13 @@ obj/structure/door_assembly
|
||||
W.loc = src.loc
|
||||
|
||||
//del(W)
|
||||
|
||||
else if(istype(W, /obj/item/weapon/crowbar) && state == 2 )
|
||||
playsound(src.loc, 'Crowbar.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to install electronics into the airlock assembly.")
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
|
||||
if(do_after(user, 40))
|
||||
if(!src) return
|
||||
user << "\blue You removed the airlock electronics!"
|
||||
src.state = 1
|
||||
src.name = "Wired Airlock Assembly"
|
||||
@@ -279,6 +285,7 @@ obj/structure/door_assembly
|
||||
ae = electronics
|
||||
electronics = null
|
||||
ae.loc = src.loc
|
||||
|
||||
else if(istype(W, /obj/item/stack/sheet/rglass) && glass == 0 && ispath(glass_type))
|
||||
playsound(src.loc, 'Crowbar.ogg', 100, 1)
|
||||
user.visible_message("[user] adds reinforced glass windows to the airlock assembly.", "You start to install reinforced glass windows into the airlock assembly.")
|
||||
@@ -293,10 +300,10 @@ obj/structure/door_assembly
|
||||
src.airlock_type = glass_type
|
||||
else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 )
|
||||
playsound(src.loc, 'Screwdriver.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user << "\blue Now finishing the airlock."
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
|
||||
if(do_after(user, 40))
|
||||
if(!src) return
|
||||
user << "\blue You finish the airlock!"
|
||||
var/obj/machinery/door/airlock/door
|
||||
if(glass)
|
||||
|
||||
@@ -70,41 +70,6 @@
|
||||
|
||||
src.loc = T
|
||||
|
||||
|
||||
obj/item/verb/pick_up()
|
||||
set name = "Pick Up"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(!(usr))
|
||||
return
|
||||
if((!istype(usr, /mob/living/carbon)) || (istype(usr, /mob/living/carbon/brain)))//Is humanoid, and is not a brain
|
||||
usr << "\red You can't pick things up!"
|
||||
return
|
||||
if( usr.stat || usr.restrained() )//Is not asleep/dead and is not restrained
|
||||
usr << "\red You can't pick things up!"
|
||||
return
|
||||
if(src.anchored) //Object isn't anchored
|
||||
usr << "\red You can't pick that up!"
|
||||
return
|
||||
if(!usr.hand && usr.r_hand) //Right hand is not full
|
||||
usr << "\red Your right hand is full."
|
||||
return
|
||||
if(usr.hand && usr.l_hand) //Left hand is not full
|
||||
usr << "\red Your left hand is full."
|
||||
return
|
||||
if(!istype(src.loc, /turf)) //Object is on a turf
|
||||
usr << "\red You can't pick that up!"
|
||||
return
|
||||
//All checks are done, time to pick it up!
|
||||
if(istype(usr, /mob/living/carbon/human))
|
||||
src.attack_hand(usr)
|
||||
if(istype(usr, /mob/living/carbon/alien))
|
||||
src.attack_alien(usr)
|
||||
if(istype(usr, /mob/living/carbon/monkey))
|
||||
src.attack_paw(usr)
|
||||
return
|
||||
|
||||
/obj/item/examine()
|
||||
set src in view()
|
||||
|
||||
|
||||
@@ -27,7 +27,29 @@ WELDINGTOOOL
|
||||
|
||||
// SCREWDRIVER
|
||||
/obj/item/weapon/screwdriver/New()
|
||||
icon_state = pick("screwdriver","screwdriver2","screwdriver3","screwdriver4","screwdriver5","screwdriver6","screwdriver7")
|
||||
switch(pick("red","blue","purple","brown","green","cyan","yellow"))
|
||||
if ("red")
|
||||
icon_state = "screwdriver2"
|
||||
item_state = "screwdriver"
|
||||
if ("blue")
|
||||
icon_state = "screwdriver"
|
||||
item_state = "screwdriver_blue"
|
||||
if ("purple")
|
||||
icon_state = "screwdriver3"
|
||||
item_state = "screwdriver_purple"
|
||||
if ("brown")
|
||||
icon_state = "screwdriver4"
|
||||
item_state = "screwdriver_brown"
|
||||
if ("green")
|
||||
icon_state = "screwdriver5"
|
||||
item_state = "screwdriver_green"
|
||||
if ("cyan")
|
||||
icon_state = "screwdriver6"
|
||||
item_state = "screwdriver_cyan"
|
||||
if ("yellow")
|
||||
icon_state = "screwdriver7"
|
||||
item_state = "screwdriver_yellow"
|
||||
|
||||
if (prob(75))
|
||||
src.pixel_y = rand(0, 16)
|
||||
return
|
||||
@@ -327,6 +349,7 @@ WELDINGTOOOL
|
||||
New()
|
||||
if(prob(50))
|
||||
icon_state = "cutters-y"
|
||||
item_state = "cutters_yellow"
|
||||
|
||||
/obj/item/weapon/wirecutters/attack(mob/M as mob, mob/user as mob)
|
||||
if((M.handcuffed) && (istype(M:handcuffed, /obj/item/weapon/handcuffs/cable)))
|
||||
|
||||
@@ -17,8 +17,8 @@ SHARDS
|
||||
var/obj/item/weapon/cable_coil/CC = W
|
||||
if(CC.amount < 5)
|
||||
user << "\b There is not enough wire in this coil. You need 5 lengths."
|
||||
CC.amount -= 5
|
||||
amount -= 1
|
||||
CC.use(5)
|
||||
src.use(1)
|
||||
user << "\blue You attach wire to the [name]."
|
||||
new/obj/item/stack/light_w(user.loc)
|
||||
if(CC.amount <= 0)
|
||||
@@ -50,37 +50,39 @@ SHARDS
|
||||
return 0
|
||||
var/title = "Sheet-Glass"
|
||||
title += " ([src.amount] sheet\s left)"
|
||||
switch(alert(title, "Would you like full tile glass or one direction?", "one direct", "full (2 sheets)", "cancel", null))
|
||||
if("one direct")
|
||||
switch(alert(title, "Would you like full tile glass or one direction?", "One Direction", "Full Window", "Cancel", null))
|
||||
if("One Direction")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
|
||||
var/list/directions = new/list(cardinal)
|
||||
var/i = 0
|
||||
for (var/obj/structure/window/win in user.loc)
|
||||
i++
|
||||
if(i >= 4)
|
||||
user << "\red There are too many windows in this location."
|
||||
return 1
|
||||
directions-=win.dir
|
||||
if(!(win.ini_dir in cardinal))
|
||||
user << "\red Can't let you do that."
|
||||
return 1
|
||||
var/dir_to_set = 2
|
||||
//yes, this could probably be done better but hey... it works...
|
||||
|
||||
var/dir_to_set = NORTH
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 4
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 1
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 8
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 2
|
||||
if (WT.dir == SOUTH)
|
||||
dir_to_set = EAST
|
||||
if (WT.dir == WEST)
|
||||
dir_to_set = SOUTH
|
||||
if (WT.dir == NORTH)
|
||||
dir_to_set = WEST
|
||||
|
||||
var/obj/structure/window/W
|
||||
W = new /obj/structure/window/basic( user.loc, 0 )
|
||||
W.dir = dir_to_set
|
||||
W.ini_dir = W.dir
|
||||
W.anchored = 0
|
||||
src.use(1)
|
||||
if("full (2 sheets)")
|
||||
if("Full Window")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
if(src.amount < 2)
|
||||
@@ -111,30 +113,32 @@ SHARDS
|
||||
return 0
|
||||
var/title = "Sheet Reinf. Glass"
|
||||
title += " ([src.amount] sheet\s left)"
|
||||
switch(alert(title, "Would you like full tile glass or one direction?", "one direct", "full (2 sheets)", "cancel", null))
|
||||
if("one direct")
|
||||
switch(input(title, "Would you like full tile glass a one direction glass pane or a windoor?") in list("One Direction", "Full Window", "Windoor", "Cancel"))
|
||||
if("One Direction")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
var/list/directions = new/list(cardinal)
|
||||
var/i = 0
|
||||
for (var/obj/structure/window/win in user.loc)
|
||||
i++
|
||||
if(i >= 4)
|
||||
user << "\red There are too many windows in this location."
|
||||
return 1
|
||||
directions-=win.dir
|
||||
if(!(win.ini_dir in cardinal))
|
||||
user << "\red Can't let you do that."
|
||||
return 1
|
||||
var/dir_to_set = 2
|
||||
//yes, this could probably be done better but hey... it works...
|
||||
var/dir_to_set = NORTH
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 4
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 1
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 8
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 2
|
||||
if (WT.dir == SOUTH)
|
||||
dir_to_set = EAST
|
||||
if (WT.dir == WEST)
|
||||
dir_to_set = SOUTH
|
||||
if (WT.dir == NORTH)
|
||||
dir_to_set = WEST
|
||||
/*else
|
||||
dir_to_set stays NORTH*/
|
||||
|
||||
var/obj/structure/window/W
|
||||
W = new /obj/structure/window/reinforced( user.loc, 1 )
|
||||
W.state = 0
|
||||
@@ -142,7 +146,8 @@ SHARDS
|
||||
W.ini_dir = W.dir
|
||||
W.anchored = 0
|
||||
src.use(1)
|
||||
if("full (2 sheets)")
|
||||
|
||||
if("Full Window")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
if(src.amount < 2)
|
||||
@@ -158,6 +163,44 @@ SHARDS
|
||||
W.ini_dir = SOUTHWEST
|
||||
W.anchored = 0
|
||||
src.use(2)
|
||||
|
||||
if("Windoor")
|
||||
if(!src || src.loc != user) return 1
|
||||
|
||||
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."
|
||||
return 1
|
||||
|
||||
var/obj/structure/windoor_assembly/WD
|
||||
WD = new /obj/structure/windoor_assembly(user.loc)
|
||||
WD.state = "01"
|
||||
WD.anchored = 0
|
||||
src.use(5)
|
||||
switch(user.dir)
|
||||
if(SOUTH)
|
||||
WD.dir = SOUTH
|
||||
WD.ini_dir = SOUTH
|
||||
if(EAST)
|
||||
WD.dir = EAST
|
||||
WD.ini_dir = EAST
|
||||
if(WEST)
|
||||
WD.dir = WEST
|
||||
WD.ini_dir = WEST
|
||||
else//If the user is facing northeast. northwest, southeast, southwest or north, default to north
|
||||
WD.dir = NORTH
|
||||
WD.ini_dir = NORTH
|
||||
else
|
||||
return 1
|
||||
|
||||
|
||||
return 0
|
||||
|
||||
// SHARDS
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
/* 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 = 'windoor.dmi'
|
||||
|
||||
name = "Windoor Assembly"
|
||||
icon_state = "l_windoor_assembly01"
|
||||
anchored = 0
|
||||
density = 0
|
||||
dir = NORTH
|
||||
|
||||
var/ini_dir
|
||||
var/list/conf_access = null //configuring access, step 6
|
||||
|
||||
//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.pass_flags & 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.pass_flags & 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)
|
||||
switch(state)
|
||||
if("01")
|
||||
//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)
|
||||
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, '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 r-glass makes the assembly a secure windoor assembly. Step 2 (optional) complete.
|
||||
else if(istype(W, /obj/item/stack/rods) && !secure)
|
||||
var/obj/item/stack/rods/R = W
|
||||
if(R.amount < 4)
|
||||
user << "\red You need more rods to do this."
|
||||
return
|
||||
user << "\blue You start to reinforce the windoor with rods."
|
||||
|
||||
if(do_after(user,40))
|
||||
if(!src) return
|
||||
|
||||
R.use(4)
|
||||
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, '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"
|
||||
|
||||
//Screwdrivering the wires in place (setting door access). Step 6 in progress.
|
||||
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()
|
||||
|
||||
|
||||
//Crowbar to complete the assembly, Step 7 complete.
|
||||
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.")
|
||||
|
||||
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.req_access = src.conf_access
|
||||
|
||||
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.req_access = src.conf_access
|
||||
|
||||
del(src)
|
||||
|
||||
|
||||
else
|
||||
..()
|
||||
|
||||
//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()
|
||||
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
|
||||
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."
|
||||
|
||||
|
||||
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(istype(source)) air_master.tiles_to_update += source
|
||||
if(istype(target)) air_master.tiles_to_update += target
|
||||
|
||||
return 1
|
||||
@@ -87,7 +87,7 @@
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user