mirror of
https://github.com/goonstation/goonstation-2016.git
synced 2026-08-23 05:56:34 +01:00
Initial Commit
This commit is contained in:
@@ -0,0 +1,309 @@
|
||||
/obj/item/shipcomponent/mainweapon
|
||||
name = "Class-A Light Phaser"
|
||||
desc = "A simple phaser designed for scout vehicles."
|
||||
var/r_gunner = 0
|
||||
var/mob/gunner = null
|
||||
var/datum/projectile/current_projectile = new/datum/projectile/laser/light
|
||||
var/firerate = 8
|
||||
var/isfiring = 0
|
||||
var/weapon_score = 0.1
|
||||
var/appearanceString
|
||||
|
||||
var/uses_ammunition = 0
|
||||
var/remaining_ammunition = 0
|
||||
|
||||
icon_state = "m_w_system"
|
||||
power_used = 65
|
||||
system = "Main Weapon"
|
||||
opencomputer(mob/user as mob)
|
||||
if(user.loc != src.ship)
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<TT><B>[src] Console</B><BR><HR><BR>"
|
||||
if(src.active)
|
||||
if(r_gunner)
|
||||
dat += {"<B>Gunner:</B>"}
|
||||
if(!gunner)
|
||||
dat += {"<A href='?src=\ref[src];gunner=1'>Enter Gunner Seat</A><BR>"}
|
||||
else
|
||||
dat += {"[src]<BR>"}
|
||||
else
|
||||
dat += {"<B><span style=\"color:red\">SYSTEM OFFLINE</span></B>"}
|
||||
user << browse(dat, "window=ship_main_weapon")
|
||||
onclose(user, "ship_main_weapon")
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
if(usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
if (usr.loc == ship)
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["gunner"])
|
||||
MakeGunner(usr)
|
||||
src.updateDialog()
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
for(var/mob/M in ship)
|
||||
if ((M.client && M.machine == src))
|
||||
src.opencomputer(M)
|
||||
else
|
||||
usr << browse(null, "window=ship_main_weapon")
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/proc/Fire(var/mob/user)
|
||||
if(isfiring) return
|
||||
isfiring = 1
|
||||
if(uses_ammunition)
|
||||
if (remaining_ammunition < ship.AmmoPerShot())
|
||||
boutput(usr, "[ship.ship_message("You need [ship.AmmoPerShot()] to fire the weapon. You currently have [remaining_ammunition] loaded.")]")
|
||||
isfiring = 0
|
||||
return
|
||||
|
||||
var/rdir = ship.dir
|
||||
if ((rdir - 1) & rdir)
|
||||
rdir &= 12
|
||||
logTheThing("combat", usr, null, "driving [ship.name] fires [src.name] (<b>Dir:</b> <i>[dir2text(rdir)]</i>, <b>Projectile:</b> <i>[src.current_projectile]</i>) at [log_loc(ship)].") // Similar to handguns, but without target coordinates (Convair880).
|
||||
ship.ShootProjectiles(user, current_projectile, rdir)
|
||||
remaining_ammunition -= ship.AmmoPerShot()
|
||||
spawn (firerate)
|
||||
isfiring = 0
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/proc/MakeGunner(mob/M as mob)
|
||||
if(!gunner)
|
||||
gunner = M
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/light_longrange
|
||||
name = "Class-AX Light Long-range Phaser"
|
||||
desc = "A phaser designed for scout vehicles. Features a more focused energy discharge, leading to an increased range."
|
||||
current_projectile = new/datum/projectile/laser/light/longrange
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/mining
|
||||
name = "Plasma Cutter System"
|
||||
desc = "A high-temperature rock cutter for pods. Use with extreme caution."
|
||||
power_used = 130
|
||||
weapon_score = 0.7
|
||||
current_projectile = new/datum/projectile/laser/mining
|
||||
appearanceString = "pod_weapon_cutter_on"
|
||||
firerate = 12
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/taser
|
||||
name = "Mk.1 Combat Taser"
|
||||
power_used = 50
|
||||
appearanceString = "pod_weapon_taser"
|
||||
weapon_score = 0.2
|
||||
current_projectile = new/datum/projectile/energy_bolt
|
||||
firerate = 10
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/phaser
|
||||
name = "Mk 1.5 Light Phaser"
|
||||
weapon_score = 0.3
|
||||
appearanceString = "pod_weapon_ltlaser"
|
||||
current_projectile = new/datum/projectile/laser/light
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/laser
|
||||
name = "Mk.2 Scout Laser"
|
||||
weapon_score = 0.4
|
||||
appearanceString = "pod_weapon_laser"
|
||||
power_used = 100
|
||||
current_projectile = new/datum/projectile/laser
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/russian
|
||||
name = "Svet-Oruzhiye Mk.4"
|
||||
weapon_score = 0.6
|
||||
current_projectile = new/datum/projectile/laser/glitter
|
||||
firerate = 5
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/disruptor_light
|
||||
name = "Mk.3 Disruptor"
|
||||
weapon_score = 0.6
|
||||
current_projectile = new/datum/projectile/disruptor
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/precursor
|
||||
name = "IRIDIUM Spheroid Projector"
|
||||
desc = "****CLASSIFIED: THANOTECH APPLIED RESEARCH DIVISION, Y-LEVEL CLEARANCE REQUIRED****."
|
||||
weapon_score = 1.25
|
||||
current_projectile = new/datum/projectile/laser/precursor/sphere
|
||||
appearanceString = "pod_weapon_precursor"
|
||||
firerate = 25
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/gun
|
||||
name = "SPK-12 Ballistic System"
|
||||
weapon_score = 1.25
|
||||
current_projectile = new/datum/projectile/bullet/a12
|
||||
appearanceString = "pod_weapon_gun_off"
|
||||
firerate = 10
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/laser_ass // hehhh
|
||||
name = "Mk.4 Assault Laser"
|
||||
weapon_score = 1.25
|
||||
power_used = 350
|
||||
firerate = 35
|
||||
appearanceString = "pod_weapon_emitter"
|
||||
current_projectile = new/datum/projectile/laser/asslaser
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/rockdrills
|
||||
name = "Rock Drilling Rig"
|
||||
power_used = 100
|
||||
weapon_score = 1.0
|
||||
current_projectile = new/datum/projectile/laser/drill
|
||||
appearanceString = "pod_weapon_drills"
|
||||
firerate = 5
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/disruptor
|
||||
name = "Heavy Disruptor Array"
|
||||
desc = "Huh."
|
||||
power_used = 180
|
||||
weapon_score = 1.25
|
||||
current_projectile = new/datum/projectile/disruptor/high
|
||||
appearanceString = "pod_weapon_cbeam_off"
|
||||
firerate = 25
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/artillery
|
||||
name = "40mm Grenade Launcher Platform"
|
||||
desc = "A slow but extremely destructive weapon that fires explosive 40mm shells."
|
||||
current_projectile = new/datum/projectile/bullet/autocannon
|
||||
|
||||
uses_ammunition = 1
|
||||
remaining_ammunition = 14
|
||||
|
||||
weapon_score = 1.5
|
||||
appearanceString = "pod_weapon_bfg"
|
||||
firerate = 100
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/UFO
|
||||
name = "UFO Blaster"
|
||||
desc = "An extraterrestrial weapons system."
|
||||
weapon_score = 1.1
|
||||
var/datum/projectile/ufo = new/datum/projectile/bullet/flare/UFO
|
||||
var/datum/projectile/hlaser = new/datum/projectile/laser/heavy
|
||||
var/mode = 0
|
||||
|
||||
New()
|
||||
..()
|
||||
current_projectile = ufo
|
||||
|
||||
opencomputer(mob/user as mob)
|
||||
if(user.loc != src.ship)
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<TT><B>Weapon Console</B><BR><HR>"
|
||||
if(src.active)
|
||||
dat +="<B>Weapon Mode:</B><BR>"
|
||||
if(mode == 0)
|
||||
dat+="Heat Beam<BR>"
|
||||
dat+="<A href='?src=\ref[src];death=1'>Death Ray</A><BR>"
|
||||
else
|
||||
dat+="<A href='?src=\ref[src];heat=1'>Heat Beam</A><BR>"
|
||||
dat+="Death Ray<BR>"
|
||||
|
||||
else
|
||||
dat += {"<B><span style=\"color:red\">SYSTEM OFFLINE</span></B>"}
|
||||
user << browse(dat, "window=ship_main_weapon")
|
||||
onclose(user, "ship_main_weapon")
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["heat"])
|
||||
current_projectile = ufo
|
||||
mode = 0
|
||||
else if(href_list["death"])
|
||||
current_projectile = hlaser
|
||||
mode = 1
|
||||
opencomputer(usr)
|
||||
return
|
||||
|
||||
// engineer miniputt constructor utility
|
||||
|
||||
/obj/item/shipcomponent/mainweapon/foamer
|
||||
name = "Industrial Utility Arms"
|
||||
desc = "A pair of robotic arms equipped with metalfoam nozzles and cutter blades."
|
||||
current_projectile = new/datum/projectile/laser/drill/cutter
|
||||
firerate = 60
|
||||
var/mode = 0
|
||||
|
||||
|
||||
Fire(var/mob/user)
|
||||
switch(mode)
|
||||
if(0)
|
||||
if(isfiring) return
|
||||
isfiring = 1
|
||||
var/obj/decal/D = new/obj/decal(ship.loc)
|
||||
D.dir = ship.dir
|
||||
D.name = "metal foam spray"
|
||||
D.icon = 'icons/obj/chemical.dmi'
|
||||
D.icon_state = "chempuff"
|
||||
D.layer = EFFECTS_LAYER_BASE
|
||||
|
||||
playsound(src.loc, "sound/machines/mixer.ogg", 50, 1)
|
||||
|
||||
// Necessary, as the foamer doesn't use the global fire proc (Convair880).
|
||||
logTheThing("combat", usr, null, "driving [ship.name] fires [src.name], creating metal foam at [log_loc(ship)].")
|
||||
|
||||
spawn(0)
|
||||
step_towards(D, get_step(D, D.dir))
|
||||
var/location = get_turf(D)
|
||||
for(var/mob/M in AIviewers(5, location))
|
||||
boutput(M, "<span style=\"color:red\">[ship] spews out a metalic foam!</span>")
|
||||
var/list/bandaidfix = list("iron" = 3, "fluorosurfactant" = 1, "acid" = 1)
|
||||
var/datum/effects/system/foam_spread/s = new()
|
||||
s.set_up(5, location, bandaidfix, 1) // Aborts if reagent list is null (even for metal foam), but I'm not gonna touch foam_spread.dm (Convair880).
|
||||
s.start()
|
||||
sleep(3)
|
||||
D.dispose()
|
||||
|
||||
spawn(firerate)
|
||||
isfiring = 0
|
||||
if(1)
|
||||
..()
|
||||
|
||||
opencomputer(mob/user as mob)
|
||||
if(user.loc != src.ship)
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<TT><B>Weapon Console</B><BR><HR>"
|
||||
if(src.active)
|
||||
dat +="<B>Weapon Mode:</B><BR>"
|
||||
if(mode == 0)
|
||||
dat+="Metalfoam Constructor Nozzles<BR>"
|
||||
dat+="<A href='?src=\ref[src];cutter=1'>Switch to Cutter Blades</A><BR>"
|
||||
else
|
||||
dat+="<A href='?src=\ref[src];foam=1'>Switch to Foam Nozzles</A><BR>"
|
||||
dat+="Industrial Cutter Blades<BR>"
|
||||
|
||||
else
|
||||
dat += {"<B><span style=\"color:red\">SYSTEM OFFLINE</span></B>"}
|
||||
user << browse(dat, "window=ship_main_weapon")
|
||||
onclose(user, "ship_main_weapon")
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["foam"])
|
||||
mode = 0
|
||||
firerate = 60
|
||||
|
||||
else if(href_list["cutter"])
|
||||
mode = 1
|
||||
firerate = 15
|
||||
|
||||
opencomputer(usr)
|
||||
return
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
/obj/item/device/radio/intercom/ship
|
||||
name = "Communication Panel"
|
||||
anchored = 1.0
|
||||
|
||||
/obj/item/device/radio/intercom/ship/send_hear()
|
||||
if (src.listening)
|
||||
var/list/shiphears = list()
|
||||
for(var/mob/M in src.loc)
|
||||
shiphears += M
|
||||
return shiphears
|
||||
|
||||
/obj/item/shipcomponent/communications
|
||||
power_used = 10
|
||||
active = 0
|
||||
name = "Robustco Communication Array"
|
||||
desc = "Enables long-distance communications and interfacing with pod bay door controls."
|
||||
power_used = 10
|
||||
system = "Communications"
|
||||
icon_state = "com"
|
||||
color = "#16CC77"
|
||||
var/access_type = 1
|
||||
var/obj/item/device/ship_radio_control/rc_ship = null
|
||||
|
||||
mining
|
||||
name = "NT Magnet Link Array"
|
||||
desc = "Allows a pod to communicate with a Mining Magnet for more convenient mining."
|
||||
power_used = 30
|
||||
color = "#FABF0F"
|
||||
|
||||
External()
|
||||
for(var/obj/machinery/mining_magnet/MM in range(7,src.ship))
|
||||
MM.generate_interface(usr)
|
||||
return null
|
||||
boutput(usr, "<span style=\"color:red\">No magnet found in range of seven meters.</span>")
|
||||
return null
|
||||
|
||||
syndicate
|
||||
name = "Radioarbeiten Communication Array"
|
||||
desc = "A cheaper soviet-made shipboard communicator. Often used by those who oppose NanoTrasen."
|
||||
color = "#BA1313"
|
||||
access_type = -1
|
||||
|
||||
opencomputer(mob/user as mob)
|
||||
if(ship.intercom)
|
||||
ship.intercom.attack_self(user)
|
||||
return
|
||||
|
||||
deactivate()
|
||||
..()
|
||||
if(ship.intercom)
|
||||
ship.intercom.broadcasting = 0
|
||||
ship.intercom.listening = 0
|
||||
|
||||
New()
|
||||
..()
|
||||
rc_ship = new /obj/item/device/ship_radio_control( src )
|
||||
rc_ship.com = src
|
||||
return
|
||||
|
||||
proc/External()
|
||||
var/broadcast = copytext(html_encode(input(usr, "Please enter what you want to say over the external speaker.", "[src.name]")), 1, MAX_MESSAGE_LEN)
|
||||
if(!broadcast)
|
||||
return
|
||||
logTheThing("diary", usr, null, "(POD) : [broadcast]", "say")
|
||||
if (ishuman(usr))//istype(usr:wear_mask, /obj/item/clothing/mask/gas/voice))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if (H.wear_mask && H.wear_mask.vchange && H.wear_id)
|
||||
. = H.wear_id:registered
|
||||
else
|
||||
. = usr.name
|
||||
else
|
||||
. = usr.real_name
|
||||
|
||||
for(var/mob/M in ship)
|
||||
boutput(M, "<font color='green'><b>[bicon(ship)]\[[.]\]</b> says, \"[broadcast]\"</font>")
|
||||
for(var/mob/O in hearers(ship, null))
|
||||
boutput(O, "<font color='green'><b>[bicon(ship)]\[[.]\]</b> says, \"[broadcast]\"</font>")
|
||||
|
||||
return null
|
||||
|
||||
/obj/item/device/ship_radio_control
|
||||
name = "Ship Radio Control"
|
||||
var/frequency = 1142
|
||||
var/net_id = null
|
||||
var/obj/item/shipcomponent/communications/com = null
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(5)
|
||||
if(radio_controller)
|
||||
radio_controller.add_object(src, "[frequency]")
|
||||
|
||||
src.net_id = format_net_id("\ref[src]")
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(..())
|
||||
return
|
||||
return
|
||||
|
||||
proc/post_signal(datum/signal/signal,var/newfreq)
|
||||
if(!signal)
|
||||
return
|
||||
var/freq = newfreq
|
||||
if(!freq)
|
||||
freq = src.frequency
|
||||
|
||||
signal.source = src
|
||||
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency("[freq]")
|
||||
|
||||
signal.transmission_method = TRANSMISSION_RADIO
|
||||
if(frequency)
|
||||
return frequency.post_signal(src, signal)
|
||||
//else
|
||||
// qdel(signal)
|
||||
|
||||
proc/open_hangar(mob/user as mob)
|
||||
var/pass = input(usr, "Please enter panel access number.", "Access Number") as text
|
||||
pass = copytext(html_encode(pass), 1, 32)
|
||||
if(!pass)
|
||||
return
|
||||
|
||||
var/datum/signal/newsignal = get_free_signal()
|
||||
newsignal.data["command"] = "open door"
|
||||
if (com)
|
||||
newsignal.data["access_type"] = com.access_type
|
||||
else
|
||||
newsignal.data["access_type"] = 0
|
||||
newsignal.data["doorpass"] = pass
|
||||
newsignal.data["sender"] = net_id
|
||||
src.post_signal(newsignal)
|
||||
|
||||
|
||||
proc/return_to_station(mob/user as mob)
|
||||
// todo
|
||||
return 1
|
||||
@@ -0,0 +1,91 @@
|
||||
//essential part of the ship,provides power to other components
|
||||
//enables travel to other Z-Spaces.
|
||||
/obj/item/shipcomponent/engine
|
||||
name = "Warp-1 Engine"
|
||||
desc = "A standard engine"
|
||||
var/powergenerated = 200 //how much power for components the engine generates
|
||||
var/currentgen = 200 //handles engine power debuffs
|
||||
var/warprecharge = 300 //Interval it takes for warp to be ready again
|
||||
var/status = "Normal"
|
||||
var/speedmod = 2 // how fast should the vehicle be, lower is faster
|
||||
var/wormholeQueued = 0 //so users cant open a million inputs and bypass all cooldowns
|
||||
power_used = 0
|
||||
system = "Engine"
|
||||
icon_state = "engine"
|
||||
|
||||
activate()
|
||||
..()
|
||||
ship.powercapacity = src.powergenerated
|
||||
return
|
||||
////Warp requires recharge time
|
||||
ready()
|
||||
spawn(warprecharge)
|
||||
ready = 1
|
||||
wormholeQueued = 0
|
||||
|
||||
deactivate()
|
||||
..()
|
||||
ship.powercapacity = 0
|
||||
for(var/obj/item/shipcomponent/S in ship.components)
|
||||
if(S.active)
|
||||
S.deactivate()
|
||||
return
|
||||
|
||||
opencomputer(mob/user as mob)
|
||||
if(user.loc != src.ship)
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<TT><B>[src] Console</B><BR><HR><BR>"
|
||||
if(src.active)
|
||||
dat+= {"<BR><B>Current Output:</B> [currentgen]"}
|
||||
dat+= {"<BR><B>Standard Ouput:</B> [powergenerated]"}
|
||||
dat+= {"<BR><B>Engine Status:</B> [status]"}
|
||||
dat+= {"<BR><B>Current Load:</B> [ship.powercurrent]"}
|
||||
if(ready)
|
||||
dat+= {"<BR><B>Warp Status:</B> Ready"}
|
||||
else
|
||||
dat+= {"<BR><B>Warp Status:</B> Recharging"}
|
||||
else
|
||||
dat += {"<B><span style=\"color:red\">SYSTEM OFFLINE</span></B>"}
|
||||
user << browse(dat, "window=ship_engine")
|
||||
onclose(user, "ship_engine")
|
||||
return
|
||||
|
||||
/obj/item/shipcomponent/engine/proc/Wormhole()
|
||||
if (wormholeQueued)
|
||||
return
|
||||
var/list/beacons = list()
|
||||
for(var/obj/warp_beacon/W)
|
||||
beacons += W
|
||||
for (var/obj/machinery/tripod/T)
|
||||
if (istype(T.bulb, /obj/item/tripod_bulb/beacon))
|
||||
beacons += T
|
||||
wormholeQueued = 1
|
||||
var/obj/target = input(usr, "Please select a location to warp to.", "Warp Computer") as null|obj in beacons
|
||||
if(!target)
|
||||
wormholeQueued = 0
|
||||
return
|
||||
var/obj/warp_portal/P = new /obj/warp_portal( ship.loc )
|
||||
P.target = target
|
||||
step(P, ship.dir)
|
||||
ready = 0
|
||||
ready()
|
||||
/obj/item/shipcomponent/engine/helios
|
||||
name = "Helios Mark-II Engine"
|
||||
desc = "A really fast engine"
|
||||
powergenerated = 300 //how much power for components the engine generates
|
||||
currentgen = 300 //handles engine power debuffs
|
||||
warprecharge = 150 //Interval it takes for warp to be ready again
|
||||
speedmod = 1
|
||||
|
||||
/obj/item/shipcomponent/engine/hermes
|
||||
name = "Hermes 3.0 Engine"
|
||||
desc = "An incredibly powerful but slow engine"
|
||||
powergenerated = 500
|
||||
currentgen = 500
|
||||
warprecharge =300
|
||||
speedmod = 3
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/////Handles oxygen and heating
|
||||
/obj/item/shipcomponent/life_support
|
||||
name = "Nanotrasen Life-Support System"
|
||||
desc = "An advanced life-support system"
|
||||
power_used=20
|
||||
var/tempreg = 310.0
|
||||
system = "Life Support"
|
||||
icon_state = "life_support"
|
||||
@@ -0,0 +1,842 @@
|
||||
/obj/item/shipcomponent/secondary_system
|
||||
name = "Secondary System"
|
||||
desc = "Add functionality to the ship"
|
||||
power_used = 0
|
||||
system = "Secondary System"
|
||||
var/f_active = 0 //1 if use proc activates/deactivates the systems.
|
||||
var/hud_state = "blank"
|
||||
icon_state= "sec_system"
|
||||
|
||||
proc/Use(mob/user as mob)
|
||||
boutput(usr, "[ship.ship_message("No special function for this ship!")]")
|
||||
return
|
||||
|
||||
proc/Clickdrag_PodToObject(var/mob/living/user,var/atom/A)
|
||||
return
|
||||
|
||||
proc/Clickdrag_ObjectToPod(var/mob/living/user,var/atom/A)
|
||||
return
|
||||
|
||||
/obj/item/shipcomponent/secondary_system/cloak
|
||||
name = "Medusa Stealth System 300"
|
||||
desc = "When activated cloaks the ship."
|
||||
power_used = 250
|
||||
hud_state = "cloak"
|
||||
f_active = 1
|
||||
var/image/shield = null
|
||||
|
||||
Use(mob/user as mob)
|
||||
if(!active)
|
||||
activate()
|
||||
else
|
||||
deactivate()
|
||||
return
|
||||
|
||||
activate()
|
||||
..()
|
||||
if(!active)
|
||||
return
|
||||
ship.invisibility = 2
|
||||
shield = image("icon" = 'icons/obj/ship.dmi', "icon_state" = "shield", "layer" = MOB_LAYER)
|
||||
ship.overlays += shield
|
||||
return
|
||||
|
||||
deactivate()
|
||||
..()
|
||||
ship.invisibility = 0
|
||||
ship.overlays -= shield
|
||||
return
|
||||
|
||||
opencomputer(mob/user as mob)
|
||||
if(user.loc != src.ship)
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<TT><B>[src] Console</B><BR><HR><BR>"
|
||||
if(src.active)
|
||||
dat+= {"<B>SYSTEM ONLINE</B>"}
|
||||
else
|
||||
dat += {"<B><span style=\"color:red\">SYSTEM OFFLINE</span></B>"}
|
||||
user << browse(dat, "window=ship_sec_system")
|
||||
onclose(user, "ship_sec_system")
|
||||
return
|
||||
|
||||
/obj/item/shipcomponent/secondary_system/orescoop
|
||||
name = "Alloyed Solutions Ore Scoop/Hold"
|
||||
desc = "Allows the ship to scoop up ore automatically."
|
||||
var/capacity = 300
|
||||
hud_state = "cargo"
|
||||
f_active = 1
|
||||
|
||||
Use(mob/user as mob)
|
||||
activate()
|
||||
return
|
||||
|
||||
activate()
|
||||
boutput(usr, "[ship.ship_message("To unload, click and drag the pod onto a nearby tile.")]")
|
||||
return
|
||||
|
||||
deactivate()
|
||||
return
|
||||
|
||||
opencomputer(mob/user as mob)
|
||||
if(user.loc != src.ship)
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<TT><B>[src] Console</B><BR><HR><BR>"
|
||||
dat += {"<BR><B>Capacity: [src.contents.len]/[src.capacity]</B><HR>"}
|
||||
user << browse(dat, "window=ship_sec_system")
|
||||
onclose(user, "ship_sec_system")
|
||||
return
|
||||
|
||||
Clickdrag_PodToObject(var/mob/living/user,var/atom/A)
|
||||
if (contents.len < 1)
|
||||
boutput(user, "<span style=\"color:red\">[src] has nothing to unload.</span>")
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(A)
|
||||
|
||||
var/inrange = 0
|
||||
for(var/turf/ST in src.ship.locs)
|
||||
if (get_dist(T,ST) <= 1)
|
||||
inrange = 1
|
||||
break
|
||||
if (!inrange)
|
||||
boutput(user, "<span style=\"color:red\">That tile too far away.</span>")
|
||||
return
|
||||
|
||||
for(var/obj/O in T.contents)
|
||||
if(O.density)
|
||||
boutput(user, "<span style=\"color:red\">That tile is blocked by [O].</span>")
|
||||
return
|
||||
|
||||
for(var/obj/item/I in src.contents)
|
||||
I.set_loc(T)
|
||||
return
|
||||
|
||||
/obj/item/shipcomponent/secondary_system/cargo
|
||||
name = "Cargo Hold"
|
||||
desc = "Allows the ship to load crates and transport them."
|
||||
var/list/load = list() //Current crates inside
|
||||
var/maxcap = 3 //how many crates it can hold
|
||||
var/list/acceptable = list(/obj/storage/crate,
|
||||
/obj/machinery/artifact,
|
||||
/obj/artifact,
|
||||
/obj/mopbucket,
|
||||
/obj/machinery/portable_atmospherics,
|
||||
/obj/machinery/space_heater,
|
||||
/obj/machinery/oreaccumulator,
|
||||
/obj/machinery/bot,
|
||||
/obj/machinery/nuclearbomb)
|
||||
|
||||
hud_state = "cargo"
|
||||
f_active = 1
|
||||
|
||||
small
|
||||
maxcap = 1
|
||||
name = "Small Cargo Hold"
|
||||
|
||||
Use(mob/user as mob)
|
||||
activate()
|
||||
return
|
||||
|
||||
deactivate()
|
||||
return
|
||||
|
||||
activate()
|
||||
var/loadmode = input(usr, "Unload/Load", "Unload/Load") as null|anything in list("Load", "Unload")
|
||||
switch(loadmode)
|
||||
if("Load")
|
||||
var/atom/movable/AM = null
|
||||
for(var/atom/movable/A in get_step(ship.loc, turn(ship.dir,180) ))
|
||||
if(!A.anchored)
|
||||
AM = A
|
||||
break
|
||||
if(AM)
|
||||
load(AM)
|
||||
return
|
||||
if("Unload")
|
||||
var/crate = input(usr, "Choose which cargo to unload..", "Choose cargo") as null|anything in load
|
||||
if(!crate)
|
||||
return
|
||||
unload(crate)
|
||||
else
|
||||
return
|
||||
return
|
||||
|
||||
opencomputer(mob/user as mob)
|
||||
if(user.loc != src.ship)
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<TT><B>[src] Console</B><BR><HR><BR>"
|
||||
dat+= {"<BR><B>Current Contents:</B><HR>"}
|
||||
for(var/cargoitem in load)
|
||||
dat += "<BR><B>[cargoitem]</B><HR>"
|
||||
dat += "<BR>"
|
||||
user << browse(dat, "window=ship_sec_system")
|
||||
onclose(user, "ship_sec_system")
|
||||
return
|
||||
|
||||
Clickdrag_PodToObject(var/mob/living/user,var/atom/A)
|
||||
if (load.len < 1)
|
||||
boutput(user, "<span style=\"color:red\">[src] has nothing to unload.</span>")
|
||||
return
|
||||
var/turf/T = get_turf(A)
|
||||
|
||||
var/inrange = 0
|
||||
for(var/turf/ST in src.ship.locs)
|
||||
if (get_dist(T,ST) <= 1)
|
||||
inrange = 1
|
||||
break
|
||||
if (!inrange)
|
||||
boutput(user, "<span style=\"color:red\">That tile too far away.</span>")
|
||||
return
|
||||
|
||||
for(var/obj/O in T.contents)
|
||||
if(O.density)
|
||||
boutput(user, "<span style=\"color:red\">That tile is blocked by [O].</span>")
|
||||
return
|
||||
|
||||
var/crate = input(usr, "Choose which cargo to unload..", "Choose cargo") as null|anything in load
|
||||
if(!crate)
|
||||
return
|
||||
unload(crate,T)
|
||||
return
|
||||
|
||||
Clickdrag_ObjectToPod(var/mob/living/user,var/atom/A)
|
||||
if (src.load.len > src.maxcap)
|
||||
boutput(user, "<span style=\"color:red\">[src] has no available cargo space.</span>")
|
||||
return
|
||||
|
||||
switch(src.load(A))
|
||||
if (1)
|
||||
// if cargo system is not emagged, only allow crates to be loaded
|
||||
boutput(user, "<span style=\"color:red\">The pod's cargo autoloader rejects [A].</span>")
|
||||
return
|
||||
if (2)
|
||||
// cargo system full (this should never happen)
|
||||
boutput(user, "<span style=\"color:red\">[src] has no available cargo space.</span>")
|
||||
return
|
||||
if (3)
|
||||
// out of range (this should never happen)
|
||||
boutput(user, "<span style=\"color:red\">[A] is too far away to do that.</span>")
|
||||
return
|
||||
if (0)
|
||||
// success
|
||||
src.visible_message("<span style=\"color:blue\">[user] loads the [A] into [src]'s cargo bay.</span>")
|
||||
return
|
||||
|
||||
boutput(user, "<span style=\"color:red\">[src] has no cargo system or no available cargo space.</span>")
|
||||
return
|
||||
|
||||
proc/load(var/atom/movable/C)
|
||||
if(load.len >= maxcap)
|
||||
playsound(src.loc, "sound/machines/buzz-sigh.ogg", 50, 0)
|
||||
boutput(usr, "[ship.ship_message("Cargo hold is full!")]")
|
||||
return 2
|
||||
|
||||
var/inrange = 0
|
||||
for (var/turf/T in src.ship.locs)
|
||||
if (get_dist(T,C) <= 1)
|
||||
inrange = 1
|
||||
break
|
||||
if (!inrange)
|
||||
return 3
|
||||
|
||||
// if a crate, close before loading
|
||||
var/obj/storage/crate/crate = C
|
||||
if(istype(crate))
|
||||
crate.close()
|
||||
|
||||
var/acceptable_cargo = 0
|
||||
for(var/X in src.acceptable)
|
||||
if (istype(C,X))
|
||||
acceptable_cargo = 1
|
||||
break
|
||||
if (!acceptable_cargo)
|
||||
playsound(src.loc, "sound/machines/buzz-sigh.ogg", 50, 0)
|
||||
return 1 // invalid cargo
|
||||
|
||||
C.set_loc(src.loc)
|
||||
sleep(2)
|
||||
C.set_loc(src)
|
||||
load += C
|
||||
C.anchored = 1 // fix for pulled items getting pulled back out of the cargo hold
|
||||
playsound(src.loc, "sound/machines/ping.ogg", 50, 0)
|
||||
return 0
|
||||
|
||||
proc/unload(var/atom/movable/C,var/turf/T)
|
||||
if(!C)
|
||||
return
|
||||
|
||||
if(T)
|
||||
C.set_loc(T)
|
||||
else
|
||||
C.set_loc(ship.loc)
|
||||
C.anchored = 0
|
||||
step(C, turn(ship.dir,180))
|
||||
|
||||
load -= C
|
||||
return
|
||||
|
||||
/obj/item/shipcomponent/secondary_system/tractor_beam
|
||||
name = "Tri-Corp Tractor Beam"
|
||||
desc = "Allows the ship to pull objects towards it"
|
||||
var/atom/movable/target = null //how many crates it can hold
|
||||
var/seekrange = 10
|
||||
var/settingup = 1
|
||||
var/image/tractor = null
|
||||
f_active = 1
|
||||
power_used = 80
|
||||
hud_state = "tractor_beam"
|
||||
|
||||
run_component()
|
||||
if(settingup)
|
||||
return
|
||||
if(target in view(src.seekrange,ship.loc))
|
||||
step_to(target, ship, 1)
|
||||
return
|
||||
deactivate()
|
||||
return
|
||||
|
||||
Use(mob/user as mob)
|
||||
if(!active)
|
||||
activate()
|
||||
else
|
||||
deactivate()
|
||||
activate()
|
||||
..()
|
||||
if(!active)
|
||||
return
|
||||
var/list/targets = list()
|
||||
for (var/atom/movable/a in view(src.seekrange,ship.loc))
|
||||
if(!a.anchored)
|
||||
targets += a
|
||||
|
||||
target = input(usr, "Choose what to use the tractor beam on", "Choose Target") as null|anything in targets
|
||||
|
||||
if(!target)
|
||||
deactivate()
|
||||
return
|
||||
tractor = image("icon" = 'icons/obj/ship.dmi', "icon_state" = "tractor", "layer" = FLOAT_LAYER)
|
||||
target.overlays += tractor
|
||||
settingup = 0
|
||||
deactivate()
|
||||
..()
|
||||
settingup = 1
|
||||
if(target)
|
||||
target.overlays -= tractor
|
||||
target = null
|
||||
return
|
||||
|
||||
opencomputer(mob/user as mob)
|
||||
if(user.loc != src.ship)
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<TT><B>[src] Console</B><BR><HR><BR>"
|
||||
if(src.active)
|
||||
dat+= {"<BR><B>Current Target</B>: [target]"}
|
||||
else
|
||||
dat += {"<B><span style=\"color:red\">SYSTEM OFFLINE</span></B>"}
|
||||
user << browse(dat, "window=ship_sec_system")
|
||||
onclose(user, "ship_sec_system")
|
||||
return
|
||||
|
||||
/obj/item/shipcomponent/secondary_system/repair
|
||||
name = "Duracorp Construction Device"
|
||||
desc = "Gives ships the ability to repair external damage to space stations."
|
||||
var/list/load = list() //Current crates inside
|
||||
var/ammo = 30 //current ammo
|
||||
var/maxammo = 30 //max RCD ammo
|
||||
f_active = 1
|
||||
hud_state = "repair"
|
||||
|
||||
Use(mob/user as mob)
|
||||
activate()
|
||||
return
|
||||
|
||||
deactivate()
|
||||
return
|
||||
|
||||
activate()
|
||||
var/repairmode = input(usr, "Please choose the function to use.", "Repair Mode") as null|anything in list("Construct", "Repair", "Deconstruct")
|
||||
switch(repairmode)
|
||||
if("Construct")
|
||||
if(!ammo)
|
||||
return
|
||||
var/turf/T = get_turf(get_step(ship.loc, ship.dir))
|
||||
if (istype(T, /turf/space) && ammo >= 1)
|
||||
playsound(src.loc, "sound/items/Deconstruct.ogg", 50, 1)
|
||||
T:ReplaceWithFloor()
|
||||
ammo--
|
||||
return
|
||||
if (istype(T, /turf/simulated/floor) && ammo >= 3)
|
||||
playsound(src.loc, "sound/machines/click.ogg", 50, 1)
|
||||
if(after_time(20))
|
||||
T:ReplaceWithWall()
|
||||
playsound(src.loc, "sound/items/Deconstruct.ogg", 50, 1)
|
||||
ammo -= 3
|
||||
return
|
||||
|
||||
if("Repair")
|
||||
for(var/obj/structure/girder/G in get_step(ship.loc, ship.dir))
|
||||
var/turf/T = get_turf(G.loc)
|
||||
qdel(G)
|
||||
T:ReplaceWithWall()
|
||||
playsound(src.loc, "sound/items/Deconstruct.ogg", 50, 1)
|
||||
break
|
||||
return
|
||||
|
||||
|
||||
if("Deconstruct")
|
||||
var/turf/T = get_turf(get_step(ship.loc, ship.dir))
|
||||
if (istype(T, /turf/simulated/wall) && ammo >= 5)
|
||||
playsound(src.loc, "sound/machines/click.ogg", 50, 1)
|
||||
if(after_time(50))
|
||||
ammo -= 5
|
||||
T:ReplaceWithFloor()
|
||||
playsound(src.loc, "sound/items/Deconstruct.ogg", 50, 1)
|
||||
return
|
||||
if ((istype(T, /turf/simulated/wall/r_wall) || istype(T, /turf/simulated/wall/auto/reinforced) ) && ammo >= 5)
|
||||
playsound(src.loc, "sound/machines/click.ogg", 50, 1)
|
||||
if(after_time(50))
|
||||
ammo -= 5
|
||||
T:ReplaceWithWall()
|
||||
playsound(src.loc, "sound/items/Deconstruct.ogg", 50, 1)
|
||||
|
||||
return
|
||||
if (istype(T, /turf/simulated/floor) && ammo >= 5)
|
||||
playsound(src.loc, "sound/machines/click.ogg", 50, 1)
|
||||
if(after_time(50))
|
||||
ammo -= 5
|
||||
T:ReplaceWithSpace()
|
||||
playsound(src.loc, "sound/items/Deconstruct.ogg", 50, 1)
|
||||
return
|
||||
|
||||
opencomputer(mob/user as mob)
|
||||
if(user.loc != src.ship)
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<TT><B>[src] Console</B><BR><HR><BR>"
|
||||
if(src.active)
|
||||
dat+= {"<B>Current Ammo</B>:[src.ammo]/[src.maxammo]"}
|
||||
else
|
||||
dat += {"<B><span style=\"color:red\">SYSTEM OFFLINE</span></B>"}
|
||||
user << browse(dat, "window=ship_sec_system")
|
||||
onclose(user, "ship_sec_system")
|
||||
return
|
||||
|
||||
/obj/item/shipcomponent/secondary_system/gps
|
||||
name = "Ship's Navigation GPS"
|
||||
desc = "A useful navigation device for those lost in space."
|
||||
f_active = 1
|
||||
power_used = 50
|
||||
|
||||
Use(mob/user as mob)
|
||||
opencomputer(user)
|
||||
return
|
||||
opencomputer(mob/user as mob)
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<TT><B>[src] Console</B><BR><HR><BR>"
|
||||
dat+= {"<BR><B>Located at:</B><HR>
|
||||
<b>X</b>: [src.ship.x]<BR><b>Y</b>: [src.ship.y]"}
|
||||
user << browse(dat, "window=ship_sec_system")
|
||||
onclose(user, "ship_sec_system")
|
||||
|
||||
/obj/item/shipcomponent/secondary_system/UFO
|
||||
name = "Abductor"
|
||||
desc = "Useful for abducting humans for experimentation"
|
||||
f_active = 1
|
||||
power_used = 50
|
||||
hud_state = "abductor"
|
||||
|
||||
Use(mob/user as mob)
|
||||
var/mob/target = input(usr, "Choose Who to Abduct", "Choose Target") as mob in view(ship.loc)
|
||||
if(target)
|
||||
boutput(target, "<span style=\"color:red\"><B>You have been abducted!</B></span>")
|
||||
showswirl(get_turf(target))
|
||||
target.set_loc(ship)
|
||||
return
|
||||
|
||||
opencomputer(mob/user as mob)
|
||||
var/dat = "<TT><B>[src] Console</B><BR><HR>"
|
||||
for(var/mob/M in ship)
|
||||
if(M == ship.pilot) continue
|
||||
dat +="<A href='?src=\ref[src];release=[M.name]'><B><U>[M.name]</U></B></A><BR>"
|
||||
user << browse(dat, "window=ship_sec_system")
|
||||
onclose(user, "ship_sec_system")
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.machine = src
|
||||
if (href_list["release"])
|
||||
for(var/mob/M in ship)
|
||||
if(cmptext(href_list["release"], M.name))
|
||||
var/list/turfs = get_area_turfs(/area/shuttle/arrival, 1)
|
||||
if (turfs && turfs.len)
|
||||
M.set_loc(pick(turfs))
|
||||
showswirl(get_turf(M))
|
||||
opencomputer(usr)
|
||||
return
|
||||
|
||||
/obj/item/shipcomponent/secondary_system/lock
|
||||
name = "Hatch Locking Unit"
|
||||
desc = "A basic hatch locking mechanism with keypad entry."
|
||||
system = "Lock"
|
||||
f_active = 1
|
||||
power_used = 0
|
||||
icon_state = "lock"
|
||||
var/code = ""
|
||||
var/configure_mode = 0 //If true, entering a valid code sets that as the code.
|
||||
|
||||
disposing()
|
||||
if (ship)
|
||||
ship.locked = 0
|
||||
ship.lock = null
|
||||
|
||||
..()
|
||||
|
||||
deactivate()
|
||||
if (ship)
|
||||
ship.locked = 0
|
||||
|
||||
if (!src.active)
|
||||
src.active = 0
|
||||
ship.powercurrent -= power_used
|
||||
|
||||
Use(mob/user as mob)
|
||||
return show_lock_panel(user, 1)
|
||||
|
||||
proc/show_lock_panel(mob/user)
|
||||
var/dat = {"
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title>Pod Locking Mechanism</title>
|
||||
<style type="text/css">
|
||||
table.keypad, td.key
|
||||
{
|
||||
text-align:center;
|
||||
color:#1F1F1F;
|
||||
background-color:#7F7F7F;
|
||||
border:2px solid #1F1F1F;
|
||||
padding:10px;
|
||||
font-size:24px;
|
||||
font-weight:bold;
|
||||
}
|
||||
a
|
||||
{
|
||||
text-align:center;
|
||||
color:#1F1F1F;
|
||||
background-color:#7F7F7F;
|
||||
font-size:24px;
|
||||
font-weight:bold;
|
||||
border:2px solid #1F1F1F;
|
||||
text-decoration:none;
|
||||
display:block;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<body bgcolor=#2F2F2F>
|
||||
<table border = 2 bgcolor=#7F3030 width = 150px>
|
||||
<tr><td><font face='system' size = 6 color=#FF0000 id = "readout"> </font></td></tr>
|
||||
</table>
|
||||
<br>
|
||||
<table class = "keypad">
|
||||
<tr><td><a href='javascript:keypadIn(7);'>7</a></td><td><a href='javascript:keypadIn(8);'>8</a></td><td><a href='javascript:keypadIn(9);'>9</a></td></td><td><a href='javascript:keypadIn("A");'>A</a></td></tr>
|
||||
<tr><td><a href='javascript:keypadIn(4);'>4</a></td><td><a href='javascript:keypadIn(5);'>5</a></td><td><a href='javascript:keypadIn(6)'>6</a></td></td><td><a href='javascript:keypadIn("B");'>B</a></td></tr>
|
||||
<tr><td><a href='javascript:keypadIn(1);'>1</a></td><td><a href='javascript:keypadIn(2);'>2</a></td><td><a href='javascript:keypadIn(3)'>3</a></td></td><td><a href='javascript:keypadIn("C");'>C</a></td></tr>
|
||||
<tr><td><a href='javascript:keypadIn(0);'>0</a></td><td><a href='javascript:keypadIn("F");'>F</a></td><td><a href='javascript:keypadIn("E");'>E</a></td></td><td><a href='javascript:keypadIn("D");'>D</a></td></tr>
|
||||
|
||||
<tr><td colspan=2 width = 100px><a id = "enterkey" href='?src=\ref[src];enter=0;'>ENTER</a></td><td colspan = 2 width = 100px><a href='javascript:keypadIn("reset");'>RESET</a></td></tr>
|
||||
</table>
|
||||
|
||||
<script language="JavaScript">
|
||||
var currentVal = "";
|
||||
|
||||
function updateReadout(t, additive)
|
||||
{
|
||||
if ((additive != 1 && additive != "1") || currentVal == "")
|
||||
{
|
||||
document.getElementById("readout").innerHTML = " ";
|
||||
currentVal = "";
|
||||
}
|
||||
var i = 0
|
||||
while (i++ < 4 && currentVal.length < 4)
|
||||
{
|
||||
if (t.length)
|
||||
{
|
||||
document.getElementById("readout").innerHTML += t.substr(0,1) + " ";
|
||||
currentVal += t.substr(0,1);
|
||||
t = t.substr(1);
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById("enterkey").setAttribute("href","?src=\ref[src];enter=" + currentVal + ";");
|
||||
}
|
||||
|
||||
function keypadIn(num)
|
||||
{
|
||||
switch (num)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
updateReadout(num.toString(), 1);
|
||||
break;
|
||||
|
||||
case "A":
|
||||
case "B":
|
||||
case "C":
|
||||
case "D":
|
||||
case "E":
|
||||
case "F":
|
||||
updateReadout(num, 1);
|
||||
break;
|
||||
|
||||
case "reset":
|
||||
updateReadout("", 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</body>"}
|
||||
|
||||
user << browse(dat, "window=ship_lock;size=270x300;can_resize=0;can_minimize=0")
|
||||
onclose(user, "ship_lock")
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(ship, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["enter"])
|
||||
if (configure_mode)
|
||||
var/new_code = uppertext(ckey(href_list["enter"]))
|
||||
if (!new_code || length(new_code) != 4 || !ishex(new_code))
|
||||
usr << output("ERR!&0", "ship_lock.browser:updateReadout")
|
||||
else
|
||||
code = new_code
|
||||
configure_mode = 0
|
||||
usr << output("SET!&0", "ship_lock.browser:updateReadout")
|
||||
//if (ship)
|
||||
// ship.access_computer(usr)
|
||||
|
||||
else
|
||||
if (uppertext(href_list["enter"]) == src.code)
|
||||
usr << output("!OK!&0", "ship_lock.browser:updateReadout")
|
||||
if (ship)
|
||||
ship.locked = 0
|
||||
boutput(usr, "<span style=\"color:red\">The lock mechanism clicks unlocked.</span>")
|
||||
// ship.access_computer(usr)
|
||||
else
|
||||
usr << output("ERR!&0", "ship_lock.browser:updateReadout")
|
||||
var/code_attempt = uppertext(ckey(href_list["enter"]))
|
||||
if (length(code_attempt) == 4)
|
||||
var/oldcode = code
|
||||
var/i = 0
|
||||
var/incode = 0
|
||||
var/rightplace = 0
|
||||
while (++i < 5)
|
||||
if (copytext(code_attempt, i,i+1) == copytext(oldcode, 1,2))
|
||||
rightplace++
|
||||
incode++
|
||||
oldcode = copytext(oldcode,2)
|
||||
continue
|
||||
|
||||
var/foundpoint = findtext(oldcode, copytext(code_attempt,i,i+1))
|
||||
if (foundpoint)
|
||||
incode++
|
||||
oldcode = copytext(oldcode, 1,foundpoint) + copytext(oldcode, foundpoint+1)
|
||||
|
||||
var/desctext = ""
|
||||
switch(rightplace)
|
||||
if (1)
|
||||
desctext += "a short beep"
|
||||
if (2)
|
||||
desctext += "a pair of short beeps"
|
||||
if (3)
|
||||
desctext += "a trio of short beeps"
|
||||
|
||||
if (desctext && (incode - rightplace) > 0)
|
||||
desctext += " and "
|
||||
|
||||
switch(incode - rightplace)
|
||||
if (1)
|
||||
desctext += "a short boop"
|
||||
if (2)
|
||||
desctext += "two warbly boops"
|
||||
if (3)
|
||||
desctext += "a quick three boops"
|
||||
if (4)
|
||||
desctext += "a rather long boop"
|
||||
|
||||
if (desctext)
|
||||
boutput(usr, "<span style=\"color:red\">The lock panel emits [desctext].</span>")
|
||||
|
||||
else if (href_list["lock"])
|
||||
if (usr.loc != src.ship)
|
||||
boutput(usr, "<span style=\"color:red\">You must be inside the ship to do that!</span>")
|
||||
return
|
||||
|
||||
if (ship && !ship.locked)
|
||||
ship.locked = 1
|
||||
boutput(usr, "<span style=\"color:red\">The lock mechanism clunks locked.</span>")
|
||||
//ship.access_computer(usr)
|
||||
|
||||
else if (href_list["unlock"])
|
||||
if (usr.loc != src.ship)
|
||||
boutput(usr, "<span style=\"color:red\">You must be inside the ship to do that!</span>")
|
||||
return
|
||||
|
||||
if (ship && ship.locked)
|
||||
ship.locked = 0
|
||||
boutput(usr, "<span style=\"color:red\">The ship mechanism clicks unlocked.</span>")
|
||||
//ship.access_computer(usr)
|
||||
|
||||
else if (href_list["setcode"])
|
||||
if (usr.loc != src.ship)
|
||||
boutput(usr, "<span style=\"color:red\">You must be inside the ship to do that!</span>")
|
||||
return
|
||||
|
||||
src.configure_mode = 1
|
||||
if (src.ship)
|
||||
src.ship.locked = 0
|
||||
src.code = ""
|
||||
|
||||
boutput(usr, "Code reset. Please type new code and press enter.")
|
||||
show_lock_panel(usr)
|
||||
|
||||
/obj/item/shipcomponent/secondary_system/crash
|
||||
name = "Syndicate Explosive Entry Device"
|
||||
desc = "The SEED that when explosively planted in a space station, lets you grow into the best death blossom you can be."
|
||||
f_active = 1
|
||||
power_used = 0
|
||||
var/crashable = 0
|
||||
var/crashhits = 8
|
||||
var/in_bump = 0
|
||||
hud_state = "seed"
|
||||
|
||||
Use(mob/user as mob)
|
||||
activate()
|
||||
return
|
||||
|
||||
deactivate()
|
||||
crashable = 0
|
||||
return
|
||||
|
||||
activate()
|
||||
if (crashable == 0) // To avoid spam. SEEDs can't be deactivated (Convair880).
|
||||
logTheThing("vehicle", usr, null, "activates a SEED, turning [src.ship] into a flying bomb at [log_loc(src.ship)]. Direction: [dir2text(src.ship.dir)].")
|
||||
crashable = 1
|
||||
return
|
||||
|
||||
/obj/item/shipcomponent/secondary_system/crash/proc/dispense()
|
||||
for (var/mob/living/B in ship.contents)
|
||||
boutput(B, "<span style=\"color:red\">You eject!</span>")
|
||||
ship.visible_message("<span style=\"color:red\">[B] launches out of the [ship]!</span>")
|
||||
step(B,ship.dir,0)
|
||||
step(B,ship.dir,0)
|
||||
step(B,ship.dir,0)
|
||||
step_rand(B, 0)
|
||||
B.remove_shipcrewmember_powers(ship.weapon_class)
|
||||
qdel(ship)
|
||||
|
||||
/obj/item/shipcomponent/secondary_system/crash/proc/crashtime(atom/A)
|
||||
var/tempstate = ship.icon_state
|
||||
ship.icon_state = "flaming"
|
||||
A.meteorhit(ship)
|
||||
playsound(ship.loc, "sound/misc/meteorimpact.ogg", 40, 1)
|
||||
ship.icon_state = tempstate
|
||||
crashhits --
|
||||
if (crashhits <= 0)
|
||||
explosion(ship, ship.loc, 1, 2, 2, 3)
|
||||
playsound(ship.loc, "explosion", 50, 1)
|
||||
dispense()
|
||||
return
|
||||
|
||||
/obj/item/shipcomponent/secondary_system/crash/proc/crashtime2(atom/A as mob|obj|turf)
|
||||
if (in_bump)
|
||||
return
|
||||
if (A == ship.pilot)
|
||||
return
|
||||
walk(src, 0)
|
||||
in_bump = 1
|
||||
crashhits--
|
||||
if(isturf(A))
|
||||
if((istype(A, /turf/simulated/wall/r_wall) || istype(A, /turf/simulated/wall/auto/reinforced)) && prob(40))
|
||||
in_bump = 0
|
||||
return
|
||||
if(istype(A, /turf/simulated/wall))
|
||||
var/turf/simulated/wall/T = A
|
||||
T.dismantle_wall(1)
|
||||
playsound(src.loc, "sound/misc/meteorimpact.ogg", 40, 1)
|
||||
playsound(src, "sound/misc/meteorimpact.ogg", 40, 1)
|
||||
boutput(ship.pilot, "<span style=\"color:red\"><B>You crash through the wall!</B></span>")
|
||||
in_bump = 0
|
||||
if(istype(A, /turf/simulated/floor))
|
||||
qdel(A)
|
||||
if(ismob(A))
|
||||
var/mob/M = A
|
||||
boutput(ship.pilot, "<span style=\"color:red\"><B>You crash into [M]!</B></span>")
|
||||
shake_camera(M, 8, 3)
|
||||
boutput(M, "<span style=\"color:red\"><B>The [src] crashes into [M]!</B></span>")
|
||||
M.stunned = 8
|
||||
M.weakened = 5
|
||||
var/turf/target = get_edge_target_turf(ship, ship.dir)
|
||||
spawn(0)
|
||||
M.throw_at(target, 4, 2)
|
||||
playsound(src.loc, "sound/misc/meteorimpact.ogg", 40, 1)
|
||||
playsound(src, "sound/misc/meteorimpact.ogg", 40, 1)
|
||||
in_bump = 0
|
||||
if(isobj(A))
|
||||
var/obj/O = A
|
||||
if(O.density)
|
||||
boutput(ship.pilot, "<span style=\"color:red\"><B>You crash into [O]!</B></span>")
|
||||
boutput(O, "<span style=\"color:red\"><B>[ship] crashes into you!</B></span>")
|
||||
var/turf/target = get_edge_target_turf(ship, ship.dir)
|
||||
playsound(src.loc, "sound/misc/meteorimpact.ogg", 40, 1)
|
||||
playsound(src, "sound/misc/meteorimpact.ogg", 40, 1)
|
||||
O.throw_at(target, 4, 2)
|
||||
O.anchored = 0
|
||||
if (istype(O, /obj/machinery/vehicle))
|
||||
A.meteorhit(src)
|
||||
crashhits -= 3
|
||||
if (istype(O, /obj/rack) || istype(O, /obj/table))
|
||||
A.meteorhit(src)
|
||||
if (istype(O, /obj/storage/closet) || istype(O, /obj/storage/secure/closet))
|
||||
O:dump_contents()
|
||||
qdel(O)
|
||||
if (istype(O, /obj/window) || istype(O, /obj/grille) || istype(O, /obj/machinery/door) || istype(O, /obj/structure/girder) || istype(O, /obj/foamedmetal))
|
||||
qdel(O)
|
||||
if (istype(O, /obj/critter))
|
||||
O:CritterDeath()
|
||||
in_bump = 0
|
||||
if (crashhits <= 0)
|
||||
explosion(ship, ship.loc, 1, 2, 2, 3)
|
||||
playsound(ship.loc, "explosion", 50, 1)
|
||||
dispense()
|
||||
in_bump = 0
|
||||
return
|
||||
@@ -0,0 +1,134 @@
|
||||
/obj/item/shipcomponent/sensor
|
||||
name = "Standard Sensor System"
|
||||
desc = "Advanced scanning system for ships."
|
||||
power_used = 20
|
||||
system = "Sensors"
|
||||
var/ships = 0
|
||||
var/list/shiplist = list()
|
||||
var/lifeforms = 0
|
||||
var/list/lifelist = list()
|
||||
var/seekrange = 30
|
||||
var/sight = SEE_SELF
|
||||
var/see_in_dark = SEE_DARK_HUMAN + 3
|
||||
var/see_invisible = 2
|
||||
var/scanning = 0
|
||||
icon_state = "sensor"
|
||||
|
||||
mob_deactivate(mob/M as mob)
|
||||
M.sight &= ~SEE_TURFS
|
||||
M.sight &= ~SEE_MOBS
|
||||
M.sight &= ~SEE_OBJS
|
||||
M.see_in_dark = initial(M.see_in_dark)
|
||||
M.see_invisible = 0
|
||||
|
||||
opencomputer(mob/user as mob)
|
||||
if(user.loc != src.ship)
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<TT><B>[src] Console</B><BR><HR><BR>"
|
||||
if(src.active)
|
||||
dat += {"<BR><A href='?src=\ref[src];scan=1'>Scan Area</A>"}
|
||||
dat += {"<HR><B>[ships] Ships Detected:</B><BR>"}
|
||||
if(shiplist.len)
|
||||
for(var/shipname in shiplist)
|
||||
dat += {"<HR>[shipname] | "}
|
||||
dat += {"<HR>[lifeforms] Lifeforms Detected:</B><BR>"}
|
||||
if(lifelist.len)
|
||||
for(var/lifename in lifelist)
|
||||
dat += {"[lifename] | "}
|
||||
else
|
||||
dat += {"<B><span style=\"color:red\">SYSTEM OFFLINE</span></B>"}
|
||||
user << browse(dat, "window=ship_sensor")
|
||||
onclose(user, "ship_sensor")
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
if(usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
if (usr.loc == ship)
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["scan"] && !scanning)
|
||||
scan(usr)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
for(var/mob/M in ship)
|
||||
if ((M.client && M.machine == src))
|
||||
src.opencomputer(M)
|
||||
else
|
||||
usr << browse(null, "window=ship_sensor")
|
||||
return
|
||||
return
|
||||
|
||||
proc/dir_name(var/direction)
|
||||
switch (direction)
|
||||
if (1)
|
||||
return "north"
|
||||
if (2)
|
||||
return "south"
|
||||
if (4)
|
||||
return "east"
|
||||
if (8)
|
||||
return "west"
|
||||
if (5)
|
||||
return "northeast"
|
||||
if (6)
|
||||
return "southeast"
|
||||
if (9)
|
||||
return "northwest"
|
||||
if (10)
|
||||
return "southwest"
|
||||
|
||||
proc/scan(mob/user as mob)
|
||||
scanning = 1
|
||||
lifeforms = 0
|
||||
ships = 0
|
||||
lifelist = list()
|
||||
shiplist = list()
|
||||
playsound(ship.loc, "sound/machines/signal.ogg", 50, 0)
|
||||
ship.visible_message("<b>[ship] begins a sensor sweep of the area.</b>")
|
||||
boutput(usr, "<span style=\"color:blue\">Scanning...</span>")
|
||||
sleep(30)
|
||||
boutput(usr, "<span style=\"color:blue\">Scan complete.</span>")
|
||||
for (var/mob/living/C in range(src.seekrange,ship.loc))
|
||||
if(C.stat != 2)
|
||||
lifeforms++
|
||||
lifelist += C.name
|
||||
for (var/obj/critter/C in range(src.seekrange,ship.loc))
|
||||
if(C.alive && !istype(C,/obj/critter/gunbot))
|
||||
lifeforms++
|
||||
lifelist += C.name
|
||||
for (var/obj/npc/C in range(src.seekrange,ship.loc))
|
||||
if(C.alive)
|
||||
lifeforms++
|
||||
lifelist += C.name
|
||||
for (var/obj/machinery/vehicle/V in range(src.seekrange,ship.loc))
|
||||
if(V != ship)
|
||||
ships++
|
||||
shiplist += "[V.name] [dir_name(get_dir(ship, V))]"
|
||||
for (var/obj/critter/gunbot/drone/V in range(src.seekrange,ship.loc))
|
||||
ships++
|
||||
shiplist += "[V.name] [dir_name(get_dir(ship, V))]"
|
||||
src.updateDialog()
|
||||
sleep(10)
|
||||
scanning = 0
|
||||
return
|
||||
|
||||
|
||||
/obj/item/shipcomponent/sensor/ecto
|
||||
name = "Ecto-Sensor 900"
|
||||
desc = "The number one choice for reasearchers of the supernatural."
|
||||
see_invisible = 15
|
||||
power_used = 40
|
||||
|
||||
/obj/item/shipcomponent/sensor/mining
|
||||
name = "Conclave A-1984 Sensor System"
|
||||
desc = "Advanced geological meson scanners for ships."
|
||||
sight = SEE_TURFS
|
||||
power_used = 35
|
||||
|
||||
scan(mob/user as mob)
|
||||
..()
|
||||
mining_scan(get_turf(user), user, 6)
|
||||
@@ -0,0 +1,79 @@
|
||||
///ship components have their work proc called in the vehicle's process
|
||||
/obj/item/shipcomponent
|
||||
name = "Ship Component"
|
||||
icon = 'icons/obj/ship.dmi'
|
||||
icon_state = "default"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
var/power_used = 0 //How much of the engine's capacity the part takes up
|
||||
var/obj/machinery/vehicle/ship = null //The owner of the part
|
||||
var/active = 0 //If the part is working or not
|
||||
var/ready = 1 //Some parts need setup before full functionality
|
||||
var/component_class = 0 //determines if a part can be installed.
|
||||
var/system = "part" //what system it is, to avoid a bunch of istype checks
|
||||
|
||||
// Code to clean up a shipcomponent that is no longer in use
|
||||
/obj/item/shipcomponent/disposing()
|
||||
ship = null
|
||||
..()
|
||||
|
||||
//Code for when device needs recharging
|
||||
/obj/item/shipcomponent/proc/ready()
|
||||
return
|
||||
|
||||
/obj/item/shipcomponent/proc/toggle()
|
||||
if (active)
|
||||
deactivate()
|
||||
else
|
||||
activate()
|
||||
|
||||
//What the component does when activated
|
||||
/obj/item/shipcomponent/proc/activate()
|
||||
if(src.active == 1)
|
||||
return
|
||||
if(ship.powercapacity < (ship.powercurrent + power_used))
|
||||
for(var/mob/M in ship)
|
||||
boutput(M, "[ship.ship_message("Not enough power to activate [src]!")]")
|
||||
return
|
||||
else
|
||||
ship.powercurrent += power_used
|
||||
|
||||
src.active = 1
|
||||
for(var/mob/M in src.ship)
|
||||
boutput(M, "[ship.ship_message("[src] is coming online...")]")
|
||||
mob_activate(M)
|
||||
if (src.ship.myhud)
|
||||
src.ship.myhud.update_states()
|
||||
return
|
||||
|
||||
///Component does this constantly
|
||||
/obj/item/shipcomponent/proc/run_component()
|
||||
return
|
||||
|
||||
///What the component does when deactived
|
||||
/obj/item/shipcomponent/proc/deactivate()
|
||||
if(src.active == 0)
|
||||
return
|
||||
src.active = 0
|
||||
ship.powercurrent -= power_used
|
||||
for(var/mob/M in src.ship)
|
||||
boutput(M, "[ship.ship_message("[src] is shutting down...")]")
|
||||
mob_deactivate(M)
|
||||
src.ship.myhud.update_states()
|
||||
return
|
||||
///Handles mob entering ship
|
||||
/obj/item/shipcomponent/proc/mob_activate(mob/M as mob)
|
||||
return
|
||||
///Handles mob exiting from ship
|
||||
/obj/item/shipcomponent/proc/mob_deactivate(mob/M as mob)
|
||||
return
|
||||
//Opens the control panel for that component if it has one
|
||||
/obj/item/shipcomponent/proc/opencomputer()
|
||||
return
|
||||
|
||||
/obj/item/shipcomponent/proc/after_time(time as num)
|
||||
var/turf/T = ship.loc
|
||||
sleep(time)
|
||||
if (ship.loc == T )
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,102 @@
|
||||
///Warp Beacons and Wormholes
|
||||
///Used by spaceships to travel to other Z-planes
|
||||
/obj/warp_beacon
|
||||
name = "warp beacon"
|
||||
desc = "Part of an elaborate small-ship teleportation network recently deployed by Nanotrasen. Probably won't cause you to die."
|
||||
icon = 'icons/obj/ship.dmi'
|
||||
icon_state = "beacon"
|
||||
anchored = 1
|
||||
density = 1
|
||||
|
||||
// Please keep synchronizied with these lists for easy map changes:
|
||||
// /obj/machinery/door_control (door_control.dm)
|
||||
// /obj/machinery/r_door_control (door_control.dm)
|
||||
// /obj/machinery/door/poddoor/pyro (poddoor.dm)
|
||||
// /obj/machinery/door/poddoor/blast/pyro (poddoor.dm)
|
||||
// We don't need a complete copy of all hangars, though.
|
||||
// A limited-but-logical selection of beacon will suffice.
|
||||
catering
|
||||
name = "catering hangar beacon"
|
||||
arrivals
|
||||
name = "arrivals hangar beacon"
|
||||
escape
|
||||
name = "escape hangar beacon"
|
||||
mainpod1
|
||||
name = "main hangar beacon (#1)"
|
||||
mainpod2
|
||||
name = "main hangar beacon (#2)"
|
||||
engineering
|
||||
name = "engineering hangar beacon"
|
||||
security
|
||||
name = "security hangar beacon"
|
||||
medsci
|
||||
name = "medsci hangar beacon"
|
||||
research
|
||||
name = "research hangar beacon"
|
||||
medbay
|
||||
name = "medbay hangar beacon"
|
||||
qm
|
||||
name = "QM hangar beacon"
|
||||
mining
|
||||
name = "mining hangar beacon"
|
||||
miningoutpost
|
||||
name = "mining outpost beacon"
|
||||
diner
|
||||
name = "space diner beacon"
|
||||
faint
|
||||
name = "faint signal"
|
||||
|
||||
/obj/warp_portal
|
||||
name = "particularly buff portal"
|
||||
icon ='icons/obj/objects.dmi'
|
||||
icon_state = "fatportal"
|
||||
density = 0
|
||||
var/obj/target = null
|
||||
anchored = 1.0
|
||||
|
||||
|
||||
/obj/warp_portal/Bumped(mob/M as mob|obj)
|
||||
spawn(0)
|
||||
src.teleport(M)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/warp_portal/HasEntered(AM as mob|obj)
|
||||
spawn(0)
|
||||
src.teleport(AM)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/warp_portal/New()
|
||||
spawn(300)
|
||||
qdel(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/warp_portal/proc/teleport(atom/movable/M as mob|obj)
|
||||
if(istype(M, /obj/effects)) //sparks don't teleport
|
||||
return
|
||||
if (M.anchored && (!istype(M,/obj/machinery/vehicle)))
|
||||
return
|
||||
if (!( src.target ))
|
||||
qdel(src)
|
||||
return
|
||||
if (istype(M, /mob))
|
||||
var/mob/T = M
|
||||
boutput(T, "<span style=\"color:red\">You are exposed to some pretty swole strange particles, this can't be good...</span>")
|
||||
if(prob(10))
|
||||
T.gib()
|
||||
T.unlock_medal("Where we're going, we won't need eyes to see", 1)
|
||||
return
|
||||
else
|
||||
T.irradiate(rand(5,25))
|
||||
if(istype(T, /mob/living/carbon/human/))
|
||||
var/mob/living/carbon/human/H = T
|
||||
if (prob(75))
|
||||
H:bioHolder:RandomEffect("bad")
|
||||
else
|
||||
H:bioHolder:RandomEffect("good")
|
||||
if (istype(M, /atom/movable))
|
||||
do_teleport(M, src.target, 1) ///You will appear adjacent to the beacon
|
||||
|
||||
|
||||
Reference in New Issue
Block a user