mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
* Upgraded the UI for area scrubbers
* The RD Area scrubbers are now unwrenchable, and the computer is a "wireless" computer working at a 25 square range (Just covering whole RD) * You can no longer screwdrive/weld a open falsewall As always, please report any error that you might find. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4781 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -3,8 +3,20 @@
|
||||
desc = "A computer used to control the stationary scrubbers and pumps in the area."
|
||||
icon_state = "area_atmos"
|
||||
circuit = "/obj/item/weapon/circuitboard/area_atmos"
|
||||
var/scrubber_state = 0 //0 = off; 1 = on
|
||||
|
||||
var/list/connectedscrubbers = new()
|
||||
var/status = ""
|
||||
|
||||
var/range = 25
|
||||
|
||||
//Simple variable to prevent me from doing attack_hand in both this and the child computer
|
||||
var/zone = "This computer is working on a wireless range, the range is currently limited to 25 meters."
|
||||
|
||||
New()
|
||||
..()
|
||||
//So the scrubbers have time to spawn
|
||||
spawn(10)
|
||||
scanscrubbers()
|
||||
|
||||
attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
@@ -14,38 +26,105 @@
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
var/dat = text("<center>Area Air Control:<br> <b><A href='?src=\ref[src];scrubbers=[1]'>Turn area scrubbers [scrubber_state?"off":"on"]</A></b></center>")
|
||||
user << browse("[dat]", "window=miningshuttle;size=200x100")
|
||||
var/dat = {"
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
a.green:link
|
||||
{
|
||||
color:#00CC00;
|
||||
}
|
||||
a.green:visited
|
||||
{
|
||||
color:#00CC00;
|
||||
}
|
||||
a.green:hover
|
||||
{
|
||||
color:#00CC00;
|
||||
}
|
||||
a.green:active
|
||||
{
|
||||
color:#00CC00;
|
||||
}
|
||||
a.red:link
|
||||
{
|
||||
color:#FF0000;
|
||||
}
|
||||
a.red:visited
|
||||
{
|
||||
color:#FF0000;
|
||||
}
|
||||
a.red:hover
|
||||
{
|
||||
color:#FF0000;
|
||||
}
|
||||
a.red:active
|
||||
{
|
||||
color:#FF0000;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<center><h1>Area Air Control</h1></center>
|
||||
<font color="red">[status]</font><br>
|
||||
<a href="?src=\ref[src];scan=1">Scan</a>
|
||||
<table border="1" width="90%">"}
|
||||
for(var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber in connectedscrubbers)
|
||||
dat += {"
|
||||
<tr>
|
||||
<td>[scrubber.name]</td>
|
||||
<td width="150"><a class="green" href="?src=\ref[src];scrub=\ref[scrubber];toggle=1">Turn On</a> <a class="red" href="?src=\ref[src];scrub=\ref[scrubber];toggle=0">Turn Off</a></td>
|
||||
</tr>"}
|
||||
|
||||
dat += {"
|
||||
</table><br>
|
||||
<i>[zone]</i>
|
||||
</body>
|
||||
</html>"}
|
||||
user << browse("[dat]", "window=miningshuttle;size=400x400")
|
||||
status = ""
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["scrubbers"])
|
||||
toggle_scrubbers()
|
||||
usr << "\blue Area scrubbers turned [scrubber_state?"on":"off"]"
|
||||
|
||||
proc/toggle_scrubbers()
|
||||
if( (ishuman(usr)||issilicon(usr)) && !usr.stat && !usr.restrained() )
|
||||
scrubber_state = !scrubber_state
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T.loc) return
|
||||
var/area/A = T.loc
|
||||
if (A.master)
|
||||
A = A.master
|
||||
for( var/obj/machinery/portable_atmospherics/scrubber/stationary/SCRUBBER in world )
|
||||
var/turf/T2 = get_turf(SCRUBBER)
|
||||
if ( T2 && T2.loc)
|
||||
var/area/A2 = T2.loc
|
||||
if ( istype(A2) && A2.master && A2.master == A )
|
||||
SCRUBBER.on = scrubber_state
|
||||
SCRUBBER.update_icon()
|
||||
|
||||
if(scrubber_state)
|
||||
icon_state = "area_atmos2"
|
||||
else
|
||||
icon_state = "area_atmos"
|
||||
if(href_list["scan"])
|
||||
scanscrubbers()
|
||||
else if(href_list["toggle"])
|
||||
var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber = locate(href_list["scrub"])
|
||||
|
||||
if(!validscrubber(scrubber))
|
||||
spawn(20)
|
||||
status = "ERROR: Couldn't connect to scrubber! (timeout)"
|
||||
connectedscrubbers -= scrubber
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
scrubber.on = text2num(href_list["toggle"])
|
||||
scrubber.update_icon()
|
||||
|
||||
proc/validscrubber( var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber as obj )
|
||||
if(!isobj(scrubber) || get_dist(scrubber.loc, src.loc) > src.range || scrubber.loc.z != src.loc.z)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
proc/scanscrubbers()
|
||||
connectedscrubbers = new()
|
||||
|
||||
var/found = 0
|
||||
for(var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber in range(range, src.loc))
|
||||
if(istype(scrubber))
|
||||
found = 1
|
||||
connectedscrubbers += scrubber
|
||||
|
||||
if(!found)
|
||||
status = "ERROR: No scrubber found!"
|
||||
|
||||
src.updateUsrDialog()
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
@@ -68,4 +147,55 @@
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
|
||||
del(src)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/computer/area_atmos/area
|
||||
zone = "This computer is working in a wired network limited to this area."
|
||||
|
||||
validscrubber( var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber as obj )
|
||||
if(!isobj(scrubber))
|
||||
return 0
|
||||
|
||||
/*
|
||||
wow this is stupid, someone help me
|
||||
*/
|
||||
var/turf/T_src = get_turf(src)
|
||||
if(!T_src.loc) return 0
|
||||
var/area/A_src = T_src.loc
|
||||
if (A_src.master)
|
||||
A_src = A_src.master
|
||||
|
||||
var/turf/T_scrub = get_turf(scrubber)
|
||||
if(!T_scrub.loc) return 0
|
||||
var/area/A_scrub = T_scrub.loc
|
||||
if (A_scrub.master)
|
||||
A_scrub = A_scrub.master
|
||||
|
||||
if(A_scrub != A_src)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
scanscrubbers()
|
||||
connectedscrubbers = new()
|
||||
|
||||
var/found = 0
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T.loc) return
|
||||
var/area/A = T.loc
|
||||
if (A.master)
|
||||
A = A.master
|
||||
for(var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber in world )
|
||||
var/turf/T2 = get_turf(scrubber)
|
||||
if(T2 && T2.loc)
|
||||
var/area/A2 = T2.loc
|
||||
if(istype(A2) && A2.master && A2.master == A )
|
||||
connectedscrubbers += scrubber
|
||||
found = 1
|
||||
|
||||
|
||||
if(!found)
|
||||
status = "ERROR: No scrubber found!"
|
||||
|
||||
src.updateUsrDialog()
|
||||
@@ -10,27 +10,58 @@
|
||||
|
||||
volume = 750
|
||||
|
||||
stationary
|
||||
name = "Stationary Air Scrubber"
|
||||
icon_state = "scrubber:0"
|
||||
anchored = 1
|
||||
volume = 30000
|
||||
volume_rate = 5000
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge
|
||||
name = "Huge Air Scrubber"
|
||||
icon_state = "scrubber:0"
|
||||
anchored = 1
|
||||
volume = 50000
|
||||
volume_rate = 5000
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
usr << "\blue You can't directly interact with this machine. Use the area atmos computer."
|
||||
var/global/gid = 1
|
||||
var/id = 0
|
||||
New()
|
||||
..()
|
||||
id = gid
|
||||
gid++
|
||||
|
||||
update_icon()
|
||||
src.overlays = 0
|
||||
name = "[name] (ID [id])"
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
usr << "\blue You can't directly interact with this machine. Use the area atmos computer."
|
||||
|
||||
update_icon()
|
||||
src.overlays = 0
|
||||
|
||||
if(on)
|
||||
icon_state = "scrubber:1"
|
||||
else
|
||||
icon_state = "scrubber:0"
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(on)
|
||||
icon_state = "scrubber:1"
|
||||
else
|
||||
icon_state = "scrubber:0"
|
||||
user << "\blue Turn it off first!"
|
||||
return
|
||||
|
||||
anchored = !anchored
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You [anchored ? "wrench" : "unwrench"] \the [src]."
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/stationary
|
||||
name = "Stationary Air Scrubber"
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
user << "\blue The bolts are too tight for you to unscrew!"
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/update_icon()
|
||||
src.overlays = 0
|
||||
|
||||
|
||||
@@ -92,29 +92,32 @@
|
||||
icon_state = "[mineral]fwall_open"
|
||||
|
||||
/obj/structure/falsewall/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
var/turf/T = get_turf(src)
|
||||
user.visible_message("[user] tightens some bolts on the wall.", "You tighten the bolts on the wall.")
|
||||
if(!mineral)
|
||||
T.ReplaceWithWall()
|
||||
else
|
||||
T.ReplaceWithMineralWall(mineral)
|
||||
del(src)
|
||||
|
||||
if( istype(W, /obj/item/weapon/weldingtool) )
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if( WT:welding )
|
||||
if(density)
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
var/turf/T = get_turf(src)
|
||||
user.visible_message("[user] tightens some bolts on the wall.", "You tighten the bolts on the wall.")
|
||||
if(!mineral)
|
||||
T.ReplaceWithWall()
|
||||
else
|
||||
T.ReplaceWithMineralWall(mineral)
|
||||
if(mineral != "plasma")//Stupid shit keeps me from pushing the attackby() to plasma walls -Sieve
|
||||
T = get_turf(src)
|
||||
T.attackby(W,user)
|
||||
del(src)
|
||||
|
||||
else if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
|
||||
if( istype(W, /obj/item/weapon/weldingtool) )
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if( WT:welding )
|
||||
var/turf/T = get_turf(src)
|
||||
if(!mineral)
|
||||
T.ReplaceWithWall()
|
||||
else
|
||||
T.ReplaceWithMineralWall(mineral)
|
||||
if(mineral != "plasma")//Stupid shit keeps me from pushing the attackby() to plasma walls -Sieve
|
||||
T = get_turf(src)
|
||||
T.attackby(W,user)
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You can't reach, close it first!"
|
||||
|
||||
if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
|
||||
var/turf/T = get_turf(src)
|
||||
if(!mineral)
|
||||
T.ReplaceWithWall()
|
||||
@@ -172,7 +175,7 @@
|
||||
|
||||
/obj/structure/falserwall/
|
||||
anchored = 1
|
||||
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(density)
|
||||
// Open wall
|
||||
|
||||
Reference in New Issue
Block a user