mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-09 06:04:23 +01:00
TMDU: Mass Driver Overhaul
This commit overhauls mass drivers. Every component of mass drivers are now buildable. This means: - Mass Drivers - Mass Driver Control Computers - Mass Driver Buttons Mass driver control computers now support multiple mass drivers. You can link mass-drivers to buttons via multitool. Buttons have a range of 7 for their mass driver link. Computers have infinite range.
This commit is contained in:
@@ -3,13 +3,26 @@
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "launcherbtt"
|
||||
desc = "A remote control switch for a mass driver."
|
||||
var/id = null
|
||||
var/id_tag = "default"
|
||||
var/active = 0
|
||||
settagwhitelist = list("id_tag")
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
|
||||
/obj/machinery/driver_button/New(turf/loc, var/w_dir=null)
|
||||
..()
|
||||
switch(w_dir)
|
||||
if(NORTH)
|
||||
pixel_y = 25
|
||||
if(SOUTH)
|
||||
pixel_y = -25
|
||||
if(EAST)
|
||||
pixel_x = 25
|
||||
if(WEST)
|
||||
pixel_x = -25
|
||||
|
||||
/obj/machinery/ignition_switch
|
||||
name = "ignition switch"
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
|
||||
@@ -99,6 +99,9 @@
|
||||
/obj/item/weapon/circuitboard/pod
|
||||
name = "Circuit board (Massdriver Control)"
|
||||
build_path = "/obj/machinery/computer/pod"
|
||||
/obj/item/weapon/circuitboard/pod/deathsquad
|
||||
name = "Circuit board (Deathsquad Massdriver control)"
|
||||
build_path = "/obj/machinery/computer/pod/deathsquad"
|
||||
/obj/item/weapon/circuitboard/robotics
|
||||
name = "Circuit board (Robotics Control Console)"
|
||||
build_path = "/obj/machinery/computer/robotics"
|
||||
|
||||
+288
-128
@@ -1,114 +1,122 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
/obj/machinery/computer/pod
|
||||
name = "Pod Launch Control"
|
||||
name = "Mass Drivers and Pod Doors Control"
|
||||
desc = "A controll for launching pods. Some people prefer firing Mechas."
|
||||
icon_state = "computer_generic"
|
||||
light_color = LIGHT_COLOR_GREEN
|
||||
icon_state = "mass_drivers"
|
||||
light_color = "#555555"
|
||||
circuit = /obj/item/weapon/circuitboard/pod
|
||||
var/id = 1.0
|
||||
var/obj/machinery/mass_driver/connected = null
|
||||
var/timing = 0.0
|
||||
var/time = 30.0
|
||||
var/title = "Mass Driver Controls"
|
||||
|
||||
var/list/id_tags = list()
|
||||
var/list/door_only_tags = list()
|
||||
var/list/synced = list()
|
||||
var/list/timings = list()
|
||||
var/list/times = list()
|
||||
var/list/maxtimes = list()
|
||||
var/list/powers = list()
|
||||
var/list/loopings = list()
|
||||
|
||||
/obj/machinery/computer/pod/New()
|
||||
..()
|
||||
spawn( 5 )
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
if(M.id == id)
|
||||
connected = M
|
||||
else
|
||||
return
|
||||
spawn(5)
|
||||
driver_sync()
|
||||
machines += src
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/pod/proc/alarm()
|
||||
/obj/machinery/computer/pod/proc/driver_sync()
|
||||
timings = list()
|
||||
times = list()
|
||||
synced = list()
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
if(M.z != src.z) continue
|
||||
for(var/ident_tag in id_tags)
|
||||
if((M.id_tag == ident_tag) && !(ident_tag in synced))
|
||||
synced += ident_tag
|
||||
timings += ident_tag
|
||||
timings[ident_tag] = 0.0
|
||||
times += ident_tag
|
||||
times[ident_tag] = 30.0
|
||||
maxtimes += ident_tag
|
||||
maxtimes[ident_tag] = 30.0
|
||||
powers += ident_tag
|
||||
powers[ident_tag] = 1.0
|
||||
loopings += ident_tag
|
||||
loopings[ident_tag] = 0
|
||||
break
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if(M.z != src.z) continue
|
||||
for(var/ident_tag in id_tags)
|
||||
if((M.id_tag == ident_tag) && !(ident_tag in synced) && !(ident_tag in door_only_tags))
|
||||
door_only_tags += ident_tag
|
||||
break
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer/pod/proc/solo_sync(var/ident_tag)
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
if(M.z != src.z) continue
|
||||
if((M.id_tag == ident_tag) && !(ident_tag in synced))
|
||||
synced += ident_tag
|
||||
timings += ident_tag
|
||||
timings[ident_tag] = 0.0
|
||||
times += ident_tag
|
||||
times[ident_tag] = 30.0
|
||||
maxtimes += ident_tag
|
||||
maxtimes[ident_tag] = 30.0
|
||||
powers += ident_tag
|
||||
powers[ident_tag] = 1.0
|
||||
loopings += ident_tag
|
||||
loopings[ident_tag] = 0
|
||||
break
|
||||
if(!(ident_tag in synced))
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if(M.z != src.z) continue
|
||||
if((M.id_tag == ident_tag) && !(ident_tag in synced) && !(ident_tag in door_only_tags))
|
||||
door_only_tags += ident_tag
|
||||
break
|
||||
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/pod/proc/launch_sequence(var/ident_tag)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(!( connected ))
|
||||
viewers(null, null) << "Cannot locate mass driver connector. Cancelling firing sequence!"
|
||||
var/anydriver = 0
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
if(M.z != src.z) continue
|
||||
if(M.id_tag == ident_tag)
|
||||
anydriver = 1
|
||||
if(!anydriver)
|
||||
visible_message("Cannot locate any mass driver of that ID. Cancelling firing sequence!")
|
||||
return
|
||||
|
||||
if(icon_state != "old")
|
||||
flick("mass_drivers_timing", src)
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if(M.id == id)
|
||||
M.open()
|
||||
return
|
||||
if(M.z != src.z) continue
|
||||
if(M.id_tag == ident_tag)
|
||||
spawn()
|
||||
M.open()
|
||||
sleep(20)
|
||||
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
if(M.id == id)
|
||||
M.power = connected.power
|
||||
if(M.z != src.z) continue
|
||||
if(M.id_tag == ident_tag)
|
||||
M.drive()
|
||||
|
||||
sleep(50)
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if(M.id == id)
|
||||
M.close()
|
||||
return
|
||||
if(M.z != src.z) continue
|
||||
if(M.id_tag == ident_tag)
|
||||
spawn()
|
||||
M.close()
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/machinery/computer/pod/attackby(I as obj, user as mob, params)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if(stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( loc )
|
||||
getFromPool(/obj/item/weapon/shard, loc)
|
||||
|
||||
//generate appropriate circuitboard. Accounts for /pod/old computer types
|
||||
var/obj/item/weapon/circuitboard/pod/M = null
|
||||
if(istype(src, /obj/machinery/computer/pod/old))
|
||||
M = new /obj/item/weapon/circuitboard/olddoor( A )
|
||||
if(istype(src, /obj/machinery/computer/pod/old/syndicate))
|
||||
M = new /obj/item/weapon/circuitboard/syndicatedoor( A )
|
||||
if(istype(src, /obj/machinery/computer/pod/old/swf))
|
||||
M = new /obj/item/weapon/circuitboard/swfdoor( A )
|
||||
else //it's not an old computer. Generate standard pod circuitboard.
|
||||
M = new /obj/item/weapon/circuitboard/pod( A )
|
||||
|
||||
for (var/obj/C in src)
|
||||
C.loc = loc
|
||||
M.id = id
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( loc )
|
||||
|
||||
//generate appropriate circuitboard. Accounts for /pod/old computer types
|
||||
var/obj/item/weapon/circuitboard/pod/M = null
|
||||
if(istype(src, /obj/machinery/computer/pod/old))
|
||||
M = new /obj/item/weapon/circuitboard/olddoor( A )
|
||||
if(istype(src, /obj/machinery/computer/pod/old/syndicate))
|
||||
M = new /obj/item/weapon/circuitboard/syndicatedoor( A )
|
||||
if(istype(src, /obj/machinery/computer/pod/old/swf))
|
||||
M = new /obj/item/weapon/circuitboard/swfdoor( A )
|
||||
else //it's not an old computer. Generate standard pod circuitboard.
|
||||
M = new /obj/item/weapon/circuitboard/pod( A )
|
||||
|
||||
for (var/obj/C in src)
|
||||
C.loc = loc
|
||||
M.id = id
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
attack_hand(user)
|
||||
return
|
||||
*/
|
||||
|
||||
|
||||
/obj/machinery/computer/pod/attack_ai(var/mob/user as mob)
|
||||
src.add_hiddenprint(user)
|
||||
return attack_hand(user)
|
||||
|
||||
|
||||
@@ -120,73 +128,146 @@
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = "<HTML><BODY><TT><B>[title]</B>"
|
||||
var/dat = "<HTML><BODY><TT><B>[name]</B>(<A href='?src=\ref[src];rename=1'>rename</A>)"
|
||||
user.set_machine(src)
|
||||
if(connected)
|
||||
var/d2
|
||||
if(timing) //door controls do not need timers.
|
||||
d2 = "<A href='?src=\ref[src];time=0'>Stop Time Launch</A>"
|
||||
else
|
||||
d2 = "<A href='?src=\ref[src];time=1'>Initiate Time Launch</A>"
|
||||
var/second = time % 60
|
||||
var/minute = (time - second) / 60
|
||||
dat += "<HR>\nTimer System: [d2]\nTime Left: [minute ? "[minute]:" : null][second] <A href='?src=\ref[src];tp=-30'>-</A> <A href='?src=\ref[src];tp=-1'>-</A> <A href='?src=\ref[src];tp=1'>+</A> <A href='?src=\ref[src];tp=30'>+</A>"
|
||||
var/temp = ""
|
||||
var/list/L = list( 0.25, 0.5, 1, 2, 4, 8, 16 )
|
||||
for(var/t in L)
|
||||
if(t == connected.power)
|
||||
temp += "[t] "
|
||||
dat += "<BR><A href = '?src=\ref[src];sync=1'>Reset Connections</A><BR>"
|
||||
if(synced.len)
|
||||
dat += "<BR><A href = '?src=\ref[src];massfire=1'><B>Fire All Connected Drivers</B></A><BR>"
|
||||
if(istype(src,/obj/machinery/computer/pod/deathsquad))
|
||||
dat += "<BR><A href = '?src=\ref[src];dstele=1'><B>Set Teleporter Destination Z-Level</B></A><BR>"
|
||||
for(var/ident_tag in id_tags)
|
||||
if(!(ident_tag in door_only_tags))
|
||||
dat += "<BR><BR><B>[ident_tag]</B> <A href='?src=\ref[src];remove=1;driver=[ident_tag]'>remove</A>"
|
||||
if(ident_tag in synced)
|
||||
var/d2 = ""
|
||||
if(timings[ident_tag]) //door controls do not need timers.
|
||||
d2 = "<A href='?src=\ref[src];time=0;driver=[ident_tag]'>Stop Time Launch</A>"
|
||||
else
|
||||
temp += "<A href = '?src=\ref[src];power=[t]'>[t]</A> "
|
||||
dat += "<HR>\nPower Level: [temp]<BR>\n<A href = '?src=\ref[src];alarm=1'>Firing Sequence</A><BR>\n<A href = '?src=\ref[src];drive=1'>Test Fire Driver</A><BR>\n<A href = '?src=\ref[src];door=1'>Toggle Outer Door</A><BR>"
|
||||
else
|
||||
dat += "<BR>\n<A href = '?src=\ref[src];door=1'>Toggle Outer Door</A><BR>"
|
||||
d2 = "<A href='?src=\ref[src];time=1;driver=[ident_tag]'>Initiate Time Launch</A>"
|
||||
var/second = times[ident_tag] % 60
|
||||
var/minute = (times[ident_tag] - second) / 60
|
||||
var/maxsecond = maxtimes[ident_tag] % 60
|
||||
var/maxminute = (maxtimes[ident_tag] - maxsecond) / 60
|
||||
dat += "<HR>\nTimer System: [d2]\nTime Left: [minute ? "[minute]:" : null][second]/[maxminute ? "[maxminute]:" : null][maxsecond] <A href='?src=\ref[src];tp=-30;driver=[ident_tag]'>-</A> <A href='?src=\ref[src];tp=-1;driver=[ident_tag]'>-</A> <A href='?src=\ref[src];tp=1;driver=[ident_tag]'>+</A> <A href='?src=\ref[src];tp=30;driver=[ident_tag]'>+</A>"
|
||||
dat += "<BR>Set timer to loop: [loopings[ident_tag] ? "<A href = '?src=\ref[src];loop=0;driver=[ident_tag]'>Yes</A>" : "<A href = '?src=\ref[src];loop=1;driver=[ident_tag]'>No</A>"]"
|
||||
var/temp = ""
|
||||
var/list/L = list( 0.25, 0.5, 1, 2, 4, 8, 16 )
|
||||
for(var/t in L)
|
||||
if( powers[ident_tag] == t)
|
||||
temp += "<B><A href = '?src=\ref[src];power=[t];driver=[ident_tag]'>[t]</A></B> "
|
||||
else
|
||||
temp += "<A href = '?src=\ref[src];power=[t];driver=[ident_tag]'>[t]</A> "
|
||||
dat += "<HR>\nPower Level: [temp]<BR>\n<A href = '?src=\ref[src];launch=1;driver=[ident_tag]'><B>Fire Drive!</B></A><BR>\n<A href = '?src=\ref[src];door=1;driver=[ident_tag]'>Toggle Pod Doors</A><BR>"
|
||||
|
||||
for(var/ident_tag in door_only_tags)
|
||||
dat += "<BR><BR><B>[ident_tag]</B> <A href='?src=\ref[src];remove=1;driver=[ident_tag]'>remove</A>"
|
||||
dat += "<BR>\n<A href = '?src=\ref[src];door=1;driver=[ident_tag]'>Toggle Pod Doors</A><BR>"
|
||||
|
||||
dat += "<BR><A href='?src=\ref[src];add=1'>add another id_tag</A>"
|
||||
|
||||
dat += "<BR><BR><A href='?src=\ref[user];mach_close=computer'>Close</A></TT></BODY></HTML>"
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
add_fingerprint(usr)
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/pod/process()
|
||||
if(!..())
|
||||
return
|
||||
if(timing)
|
||||
if(time > 0)
|
||||
time = round(time) - 1
|
||||
var/timing = 0
|
||||
for(var/ident_tag in id_tags)
|
||||
if(timings[ident_tag])
|
||||
if(times[ident_tag] > 0)
|
||||
times[ident_tag] = round(times[ident_tag]) - 1
|
||||
timing = 1
|
||||
else
|
||||
spawn()
|
||||
launch_sequence(ident_tag)
|
||||
if(loopings[ident_tag])
|
||||
times[ident_tag] = maxtimes[ident_tag]
|
||||
else
|
||||
times[ident_tag] = 0
|
||||
timings[ident_tag] = 0
|
||||
else
|
||||
alarm()
|
||||
time = 0
|
||||
timing = 0
|
||||
times[ident_tag] = maxtimes[ident_tag]
|
||||
updateDialog()
|
||||
if(icon_state != "old")
|
||||
if(timing)
|
||||
icon_state = "mass_drivers_timing"
|
||||
else
|
||||
icon_state = "mass_drivers"
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/pod/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
else
|
||||
usr.set_machine(src)
|
||||
if(href_list["add"])
|
||||
var/new_id_tag = input("Enter a new id_tag", "Mass Driver Controls", "id_tag")
|
||||
if(!(new_id_tag in id_tags))
|
||||
id_tags += new_id_tag
|
||||
solo_sync(new_id_tag)
|
||||
if(href_list["remove"])
|
||||
var/ident_tag = href_list["driver"]
|
||||
if(ident_tag in synced)
|
||||
synced -= ident_tag
|
||||
if(ident_tag in door_only_tags)
|
||||
door_only_tags -= ident_tag
|
||||
timings -= ident_tag
|
||||
times -= ident_tag
|
||||
powers -= ident_tag
|
||||
loopings -= ident_tag
|
||||
id_tags -= ident_tag
|
||||
if(href_list["dstele"])
|
||||
var/choices = list(0)
|
||||
choices += accessable_z_levels
|
||||
var/obj/machinery/computer/pod/deathsquad/D = src
|
||||
var/input = input("Enter the destination Z-Level. The mechs will arrive from the East. Leave 0 if you don't want to set a specific ZLevel", "Mass Driver Controls", 0) in choices
|
||||
D.teleporter_dest = input
|
||||
|
||||
if(href_list["massfire"])
|
||||
for(var/ident_tag in synced)
|
||||
spawn()
|
||||
launch_sequence(ident_tag)
|
||||
if(href_list["power"])
|
||||
var/ident_tag = href_list["driver"]
|
||||
var/t = text2num(href_list["power"])
|
||||
t = min(max(0.25, t), 16)
|
||||
if(connected)
|
||||
connected.power = t
|
||||
if(href_list["alarm"])
|
||||
alarm()
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
if(M.id_tag == ident_tag)
|
||||
M.power = t
|
||||
powers[ident_tag] = t
|
||||
if(href_list["launch"])
|
||||
launch_sequence(href_list["driver"])
|
||||
if(href_list["time"])
|
||||
timing = text2num(href_list["time"])
|
||||
var/ident_tag = href_list["driver"]
|
||||
timings[ident_tag] = text2num(href_list["time"])
|
||||
if(href_list["loop"])
|
||||
var/ident_tag = href_list["driver"]
|
||||
loopings[ident_tag] = text2num(href_list["loop"])
|
||||
if(href_list["sync"])
|
||||
driver_sync()
|
||||
if(href_list["tp"])
|
||||
var/ident_tag = href_list["driver"]
|
||||
var/tp = text2num(href_list["tp"])
|
||||
time += tp
|
||||
time = min(max(round(time), 0), 120)
|
||||
maxtimes[ident_tag] += tp
|
||||
maxtimes[ident_tag] = min(max(round(maxtimes[ident_tag]), 0), 120)
|
||||
if(href_list["door"])
|
||||
var/ident_tag = href_list["driver"]
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if(M.id == id)
|
||||
if(M.density)
|
||||
M.open()
|
||||
else
|
||||
M.close()
|
||||
if(M.z != src.z) continue
|
||||
if(M.id_tag == ident_tag)
|
||||
spawn()
|
||||
if(M.density)
|
||||
M.open()
|
||||
else
|
||||
M.close()
|
||||
if(href_list["rename"])
|
||||
var/new_title = input("Enter a new title", "[name]", "[name]")
|
||||
if(new_title)
|
||||
name = new_title
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
@@ -195,19 +276,19 @@
|
||||
/obj/machinery/computer/pod/old
|
||||
icon_state = "old"
|
||||
name = "DoorMex Control Computer"
|
||||
title = "Door Controls"
|
||||
|
||||
circuit = /obj/item/weapon/circuitboard/olddoor
|
||||
|
||||
|
||||
/obj/machinery/computer/pod/old/syndicate
|
||||
name = "ProComp Executive IIc"
|
||||
name = "External Airlock Controls"
|
||||
desc = "The Syndicate operate on a tight budget. Operates external airlocks."
|
||||
title = "External Airlock Controls"
|
||||
req_access = list(access_syndicate)
|
||||
circuit = /obj/item/weapon/circuitboard/syndicatedoor
|
||||
light_color = "#00FFFF"
|
||||
|
||||
/obj/machinery/computer/pod/old/syndicate/attack_hand(var/mob/user as mob)
|
||||
if(!allowed(user))
|
||||
user << "\red Access Denied"
|
||||
user << "<span class='warning'>Access Denied</span>"
|
||||
return
|
||||
else
|
||||
..()
|
||||
@@ -215,3 +296,82 @@
|
||||
/obj/machinery/computer/pod/old/swf
|
||||
name = "Magix System IV"
|
||||
desc = "An arcane artifact that holds much magic. Running E-Knock 2.2: Sorceror's Edition"
|
||||
circuit = /obj/item/weapon/circuitboard/swfdoor
|
||||
|
||||
|
||||
/obj/machinery/computer/pod/deathsquad
|
||||
id_tags = list("ASSAULT0","ASSAULT1","ASSAULT2","ASSAULT3")
|
||||
var/teleporter_dest = 0
|
||||
circuit = /obj/item/weapon/circuitboard/pod/deathsquad
|
||||
|
||||
/obj/machinery/computer/pod/deathsquad/launch_sequence(var/ident_tag)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
var/anydriver = 0
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
if(M.z != src.z) continue
|
||||
if(M.id_tag == ident_tag)
|
||||
anydriver = 1
|
||||
if(!anydriver)
|
||||
visible_message("Cannot locate any mass driver of that ID. Cancelling firing sequence!")
|
||||
return
|
||||
|
||||
if(icon_state != "old")
|
||||
flick("mass_drivers_timing", src)
|
||||
|
||||
if(teleporter_dest)
|
||||
for(var/obj/structure/deathsquad_tele/D in world)
|
||||
if(D.z != src.z) continue
|
||||
if(D.id_tag == ident_tag)
|
||||
D.icon_state = "tele1"
|
||||
D.ztarget = teleporter_dest
|
||||
D.density = 1
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if(M.z != src.z) continue
|
||||
if(M.id_tag == ident_tag)
|
||||
spawn()
|
||||
M.open()
|
||||
sleep(20)
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
if(M.z != src.z) continue
|
||||
if(M.id_tag == ident_tag)
|
||||
M.drive()
|
||||
|
||||
sleep(50)
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if(M.z != src.z) continue
|
||||
if(M.id_tag == ident_tag)
|
||||
spawn()
|
||||
M.close()
|
||||
|
||||
for(var/obj/structure/deathsquad_tele/D in world)
|
||||
if(D.z != src.z) continue
|
||||
if(D.id_tag == ident_tag)
|
||||
D.icon_state = "tele0"
|
||||
D.density = 0
|
||||
|
||||
return
|
||||
|
||||
/obj/structure/deathsquad_tele
|
||||
name = "Mech Teleporter"
|
||||
density = 0
|
||||
anchored = 1
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "tele0"
|
||||
var/ztarget = 0
|
||||
var/id_tag = ""
|
||||
|
||||
|
||||
/obj/structure/deathsquad_tele/Bumped(var/atom/movable/AM)
|
||||
if(!ztarget) return ..()
|
||||
var/y = AM.y
|
||||
spawn()
|
||||
AM.z = ztarget
|
||||
AM.y = y
|
||||
AM.x = world.maxx - TRANSITIONEDGE - 2
|
||||
AM.dir = 8
|
||||
var/atom/target = get_edge_target_turf(AM, AM.dir)
|
||||
AM.throw_at(target, 50, 1)
|
||||
return
|
||||
@@ -142,7 +142,7 @@ var/specops_shuttle_timeleft = 0
|
||||
//Begin Marauder launchpad.
|
||||
spawn(0)//So it parallel processes it.
|
||||
for(var/obj/machinery/door/poddoor/M in special_ops)
|
||||
switch(M.id)
|
||||
switch(M.id_tag)
|
||||
if("ASSAULT0")
|
||||
spawn(10)//1 second delay between each.
|
||||
M.open()
|
||||
@@ -173,7 +173,7 @@ var/specops_shuttle_timeleft = 0
|
||||
sleep(10)
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in special_ops)
|
||||
switch(M.id)
|
||||
switch(M.id_tag)
|
||||
if("ASSAULT0")
|
||||
spawn(10)
|
||||
M.drive()
|
||||
@@ -190,7 +190,7 @@ var/specops_shuttle_timeleft = 0
|
||||
sleep(50)//Doors remain open for 5 seconds.
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in special_ops)
|
||||
switch(M.id)//Doors close at the same time.
|
||||
switch(M.id_tag)//Doors close at the same time.
|
||||
if("ASSAULT0")
|
||||
spawn(0)
|
||||
M.close()
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
if(istype(W, /obj/item/device/detective_scanner))
|
||||
return
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
/obj/machinery/door_control/emag_act(user as mob)
|
||||
if(!emagged)
|
||||
emagged = 1
|
||||
@@ -113,7 +113,7 @@
|
||||
|
||||
else
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if (M.id == src.id)
|
||||
if (M.id_tag == src.id)
|
||||
if (M.density)
|
||||
spawn( 0 )
|
||||
M.open()
|
||||
@@ -145,8 +145,27 @@
|
||||
|
||||
if(istype(W, /obj/item/device/detective_scanner))
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
update_multitool_menu(user)
|
||||
return 1
|
||||
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, 30))
|
||||
user << "<span class='notice'>You detach \the [src] from the wall.</span>"
|
||||
new/obj/item/mounted/frame/driver_button(get_turf(src))
|
||||
del(src)
|
||||
return 1
|
||||
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/driver_button/multitool_menu(var/mob/user, var/obj/item/device/multitool/P)
|
||||
return {"
|
||||
<ul>
|
||||
<li>[format_tag("ID Tag","id_tag")]</li>
|
||||
</ul>"}
|
||||
|
||||
/obj/machinery/driver_button/attack_hand(mob/user as mob)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
@@ -158,30 +177,32 @@
|
||||
|
||||
use_power(5)
|
||||
|
||||
launch_sequence()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/driver_button/proc/launch_sequence()
|
||||
active = 1
|
||||
icon_state = "launcheract"
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if (M.id == src.id)
|
||||
spawn( 0 )
|
||||
for(var/obj/machinery/door/poddoor/M in range(src,7))
|
||||
if (M.id_tag == src.id_tag)
|
||||
spawn()
|
||||
M.open()
|
||||
return
|
||||
|
||||
sleep(20)
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
if(M.id == src.id)
|
||||
if(M.id_tag == src.id_tag)
|
||||
M.drive()
|
||||
|
||||
sleep(50)
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if (M.id == src.id)
|
||||
spawn( 0 )
|
||||
if (M.id_tag == src.id_tag)
|
||||
spawn()
|
||||
M.close()
|
||||
return
|
||||
|
||||
icon_state = "launcherbtt"
|
||||
active = 0
|
||||
|
||||
return
|
||||
active = 0
|
||||
@@ -3,7 +3,7 @@
|
||||
desc = "That looks like it doesn't open easily."
|
||||
icon = 'icons/obj/doors/rapid_pdoor.dmi'
|
||||
icon_state = "pdoor1"
|
||||
var/id = 1.0
|
||||
var/id_tag = 1.0
|
||||
explosion_block = 3
|
||||
|
||||
/obj/machinery/door/poddoor/preopen
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
/obj/machinery/mass_driver
|
||||
name = "mass driver"
|
||||
desc = "Shoots things into space."
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "mass_driver"
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
@@ -12,31 +10,209 @@
|
||||
|
||||
var/power = 1.0
|
||||
var/code = 1.0
|
||||
var/id = 1.0
|
||||
var/id_tag = "default"
|
||||
settagwhitelist = list("id_tag")
|
||||
var/drive_range = 50 //this is mostly irrelevant since current mass drivers throw into space, but you could make a lower-range mass driver for interstation transport or something I guess.
|
||||
|
||||
/obj/machinery/mass_driver/attackby(obj/item/weapon/W, mob/user as mob)
|
||||
|
||||
proc/drive(amount)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
use_power(500)
|
||||
var/O_limit
|
||||
var/atom/target = get_edge_target_turf(src, dir)
|
||||
for(var/atom/movable/O in loc)
|
||||
if(!O.anchored||istype(O, /obj/mecha))//Mechs need their launch platforms.
|
||||
O_limit++
|
||||
if(O_limit >= 20)
|
||||
for(var/mob/M in hearers(src, null))
|
||||
M << "\blue The mass driver lets out a screech, it mustn't be able to handle any more items."
|
||||
break
|
||||
use_power(500)
|
||||
spawn( 0 )
|
||||
O.throw_at(target, drive_range * power, power)
|
||||
flick("mass_driver1", src)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
update_multitool_menu(user)
|
||||
return 1
|
||||
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
user << "You begin to unscrew the bolts off the [src]..."
|
||||
playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 30))
|
||||
var/obj/machinery/mass_driver_frame/F = new(get_turf(src))
|
||||
F.dir = src.dir
|
||||
F.anchored = 1
|
||||
F.build = 4
|
||||
F.update_icon()
|
||||
del(src)
|
||||
return 1
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/mass_driver/multitool_menu(var/mob/user, var/obj/item/device/multitool/P)
|
||||
return {"
|
||||
<ul>
|
||||
<li>[format_tag("ID Tag","id_tag")]</li>
|
||||
</ul>"}
|
||||
|
||||
/obj/machinery/mass_driver/proc/drive(amount)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
use_power(500*power)
|
||||
var/O_limit = 0
|
||||
var/atom/target = get_edge_target_turf(src, dir)
|
||||
for(var/atom/movable/O in loc)
|
||||
if(!O.anchored||istype(O, /obj/mecha))//Mechs need their launch platforms.
|
||||
O_limit++
|
||||
if(O_limit >= 20)//so no more than 20 items are sent at a time, probably for counter-lag purposes
|
||||
break
|
||||
use_power(500)
|
||||
spawn()
|
||||
var/coef = 1
|
||||
if(emagged)
|
||||
coef = 5
|
||||
O.throw_at(target, drive_range * power * coef, power * coef)
|
||||
flick("mass_driver1", src)
|
||||
return
|
||||
|
||||
/obj/machinery/mass_driver/emp_act(severity)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
drive()
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/mass_driver/emag_act(mob/user)
|
||||
if(!emagged)
|
||||
emagged = 1
|
||||
user << "You hack the Mass Driver, radically increasing the force at which it'll throw things. Better not stand in its way."
|
||||
return 1
|
||||
return -1
|
||||
|
||||
////////////////MASS BUMPER///////////////////
|
||||
|
||||
/obj/machinery/mass_driver/bumper
|
||||
name = "mass bumper"
|
||||
desc = "Now you're here, now you're over there."
|
||||
density = 1
|
||||
|
||||
/obj/machinery/mass_driver/bumper/Bumped(M as mob|obj)
|
||||
density = 0
|
||||
step(M, get_dir(M,src))
|
||||
spawn(1)
|
||||
density = 1
|
||||
drive()
|
||||
return
|
||||
|
||||
////////////////MASS DRIVER FRAME///////////////////
|
||||
|
||||
/obj/machinery/mass_driver_frame
|
||||
name = "mass driver frame"
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "mass_driver_b0"
|
||||
density = 0
|
||||
anchored = 0
|
||||
var/build = 0
|
||||
|
||||
/obj/machinery/mass_driver_frame/attackby(var/obj/item/W as obj, var/mob/user as mob)
|
||||
switch(build)
|
||||
if(0) // Loose frame
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(!WT.remove_fuel(0, user))
|
||||
user << "The welding tool must be on to complete this task."
|
||||
return 1
|
||||
playsound(get_turf(src), 'sound/items/Welder.ogg', 50, 1)
|
||||
user << "You begin to cut the frame apart..."
|
||||
if(do_after(user, 30) && (build == 0))
|
||||
user << "<span class='notice'>You detach the plasteel sheets from each others.</span>"
|
||||
new /obj/item/stack/sheet/plasteel(get_turf(src),3)
|
||||
del(src)
|
||||
return 1
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
user << "You begin to anchor \the [src] on the floor."
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, 10) && (build == 0))
|
||||
user << "<span class='notice'>You anchor \the [src]!</span>"
|
||||
anchored = 1
|
||||
build++
|
||||
update_icon()
|
||||
return 1
|
||||
if(1) // Fixed to the floor
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
user << "You begin to de-anchor \the [src] from the floor."
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, 10) && (build == 1))
|
||||
build--
|
||||
update_icon()
|
||||
anchored = 0
|
||||
user << "<span class='notice'>You de-anchored \the [src]!</span>"
|
||||
return 1
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(!WT.remove_fuel(0, user))
|
||||
user << "The welding tool must be on to complete this task."
|
||||
return 1
|
||||
playsound(get_turf(src), 'sound/items/Welder.ogg', 50, 1)
|
||||
user << "You begin to weld \the [src] to the floor..."
|
||||
if(do_after(user, 40) && (build == 1))
|
||||
user << "<span class='notice'>You welded \the [src] to the floor.</span>"
|
||||
build++
|
||||
update_icon()
|
||||
return 1
|
||||
if(2) // Welded to the floor
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(!WT.remove_fuel(0, user))
|
||||
user << "The welding tool must be on to complete this task."
|
||||
return 1
|
||||
playsound(get_turf(src), 'sound/items/Welder.ogg', 50, 1)
|
||||
user << "You begin to unweld \the [src] to the floor..."
|
||||
if(do_after(user, 40) && (build == 2))
|
||||
user << "<span class='notice'>You unwelded \the [src] to the floor.</span>"
|
||||
build--
|
||||
update_icon()
|
||||
if(istype(W, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C=W
|
||||
user << "You start adding cables to \the [src]..."
|
||||
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20) && (C.amount >= 3) && (build == 2))
|
||||
C.use(3)
|
||||
user << "<span class='notice'>You've added cables to \the [src].</span>"
|
||||
build++
|
||||
update_icon()
|
||||
if(3) // Wired
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
user << "You begin to remove the wiring from \the [src]."
|
||||
if(do_after(user, 10) && (build == 3))
|
||||
new /obj/item/stack/cable_coil(loc,3)
|
||||
playsound(get_turf(src), 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
user << "<span class='notice'>You've removed the cables from \the [src].</span>"
|
||||
build--
|
||||
update_icon()
|
||||
return 1
|
||||
if(istype(W, /obj/item/stack/rods))
|
||||
var/obj/item/stack/rods/R=W
|
||||
user << "You begin to complete \the [src]..."
|
||||
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20) && (R.amount >= 3) && (build == 3))
|
||||
R.use(3)
|
||||
user << "<span class='notice'>You've added the grille to \the [src].</span>"
|
||||
build++
|
||||
update_icon()
|
||||
return 1
|
||||
if(4) // Grille in place
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
user << "You begin to pry off the grille from \the [src]..."
|
||||
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
|
||||
if(do_after(user, 30) && (build == 4))
|
||||
new /obj/item/stack/rods(loc,2)
|
||||
build--
|
||||
update_icon()
|
||||
return 1
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
user << "You finalize the Mass Driver..."
|
||||
playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
var/obj/machinery/mass_driver/M = new(get_turf(src))
|
||||
M.dir = src.dir
|
||||
del(src)
|
||||
return 1
|
||||
..()
|
||||
|
||||
/obj/machinery/mass_driver_frame/update_icon()
|
||||
icon_state = "mass_driver_b[build]"
|
||||
|
||||
/obj/machinery/mass_driver_frame/verb/rotate()
|
||||
set category = "Object"
|
||||
set name = "Rotate Frame"
|
||||
set src in view(1)
|
||||
|
||||
if ( usr.stat || usr.restrained() || (usr.status_flags & FAKEDEATH))
|
||||
return
|
||||
|
||||
emp_act(severity)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
drive()
|
||||
..(severity)
|
||||
src.dir = turn(src.dir, -90)
|
||||
return
|
||||
@@ -736,7 +736,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
if("Toggle Door")
|
||||
if(cartridge && cartridge.access_remote_door)
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if(M.id == cartridge.remote_door_id)
|
||||
if(M.id_tag == cartridge.remote_door_id)
|
||||
if(M.density)
|
||||
M.open()
|
||||
else
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/obj/item/mounted/frame/driver_button
|
||||
name = "mass driver button frame"
|
||||
desc = "Used for repairing or building mass driver buttons"
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "launcherbtt_frame"
|
||||
mount_reqs = list("simfloor")
|
||||
|
||||
/obj/item/mounted/frame/driver_button/do_build(turf/on_wall, mob/user)
|
||||
new /obj/machinery/driver_button(get_turf(user), get_dir(user, on_wall))
|
||||
qdel(src)
|
||||
@@ -67,6 +67,8 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \
|
||||
new/datum/stack_recipe("multi-tile airlock assembly", /obj/structure/door_assembly/multi_tile, 4, time = 50, one_per_turf = 1, on_floor = 1), \
|
||||
), 4), \
|
||||
null, \
|
||||
new/datum/stack_recipe("mass driver button frame", /obj/item/mounted/frame/driver_button, 1, time = 50, one_per_turf = 0, on_floor = 1), \
|
||||
null, \
|
||||
new/datum/stack_recipe("grenade casing", /obj/item/weapon/grenade/chem_grenade), \
|
||||
new/datum/stack_recipe("light fixture frame", /obj/item/mounted/frame/light_fixture, 2), \
|
||||
new/datum/stack_recipe("small light fixture frame", /obj/item/mounted/frame/light_fixture/small, 1), \
|
||||
@@ -113,6 +115,7 @@ var/global/list/datum/stack_recipe/plasteel_recipes = list ( \
|
||||
new/datum/stack_recipe("AI core", /obj/structure/AIcore, 4, time = 50, one_per_turf = 1), \
|
||||
new/datum/stack_recipe("Surgery Table", /obj/machinery/optable, 5, time = 50, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("Metal crate", /obj/structure/closet/crate, 10, time = 50, one_per_turf = 1), \
|
||||
new/datum/stack_recipe("Mass Driver frame", /obj/machinery/mass_driver_frame, 3, time = 50, one_per_turf = 1), \
|
||||
// new/datum/stack_recipe("RUST fuel assembly port frame", /obj/item/rust_fuel_assembly_port_frame, 12, time = 50, one_per_turf = 1), \
|
||||
// new/datum/stack_recipe("RUST fuel compressor frame", /obj/item/rust_fuel_compressor_frame, 12, time = 50, one_per_turf = 1), \
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
compressor = C
|
||||
doors = new /list()
|
||||
for(var/obj/machinery/door/poddoor/P in machines)
|
||||
if(P.id == id)
|
||||
if(P.id_tag == id)
|
||||
doors += P
|
||||
|
||||
/*
|
||||
|
||||
@@ -320,4 +320,14 @@
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/vendor
|
||||
category = list("Misc. Machinery")
|
||||
|
||||
/datum/design/pod
|
||||
name = "Machine Board (Mass Driver and Pod Doors Control)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Mass Driver and Pod Doors Control."
|
||||
id = "pod"
|
||||
req_tech = list("programming" = 2,"engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/pod
|
||||
category = list("Misc. Machinery")
|
||||
@@ -144,7 +144,7 @@
|
||||
//Begin Marauder launchpad.
|
||||
spawn(0)//So it parallel processes it.
|
||||
for(var/obj/machinery/door/poddoor/M in special_ops)
|
||||
switch(M.id)
|
||||
switch(M.id_tag)
|
||||
if("ASSAULT0")
|
||||
spawn(10)//1 second delay between each.
|
||||
M.open()
|
||||
@@ -175,7 +175,7 @@
|
||||
sleep(10)
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in special_ops)
|
||||
switch(M.id)
|
||||
switch(M.id_tag)
|
||||
if("ASSAULT0")
|
||||
spawn(10)
|
||||
M.drive()
|
||||
@@ -192,7 +192,7 @@
|
||||
sleep(50)//Doors remain open for 5 seconds.
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in special_ops)
|
||||
switch(M.id)//Doors close at the same time.
|
||||
switch(M.id_tag)//Doors close at the same time.
|
||||
if("ASSAULT0")
|
||||
spawn(0)
|
||||
M.close()
|
||||
|
||||
Reference in New Issue
Block a user