Merge branch 'bleeding-edge-freeze' of https://github.com/Baystation12/Baystation12 into bleeding-edge-freeze
Conflicts: code/modules/events/infestation.dm
@@ -0,0 +1,120 @@
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Core Control computer
|
||||
|
||||
/obj/item/weapon/circuitboard/rust_core_control
|
||||
name = "Circuit board (RUST core controller)"
|
||||
build_path = "/obj/machinery/computer/rust_core_control"
|
||||
origin_tech = "programming=3;engineering=4"
|
||||
|
||||
datum/design/rust_core_control
|
||||
name = "Circuit Design (RUST core controller)"
|
||||
desc = "Allows for the construction of circuit boards used to build a core control console for the RUST fusion engine."
|
||||
id = "rust_core_control"
|
||||
req_tech = list("programming" = 3, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_core_control"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Fuel Control computer
|
||||
|
||||
/obj/item/weapon/circuitboard/rust_fuel_control
|
||||
name = "Circuit board (RUST fuel controller)"
|
||||
build_path = "/obj/machinery/computer/rust_fuel_control"
|
||||
origin_tech = "programming=3;engineering=4"
|
||||
|
||||
datum/design/rust_fuel_control
|
||||
name = "Circuit Design (RUST fuel controller)"
|
||||
desc = "Allows for the construction of circuit boards used to build a fuel injector control console for the RUST fusion engine."
|
||||
id = "rust_fuel_control"
|
||||
req_tech = list("programming" = 3, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_fuel_control"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Fuel Port board
|
||||
|
||||
/obj/item/weapon/module/rust_fuel_port
|
||||
name = "Internal circuitry (RUST fuel port)"
|
||||
icon_state = "card_mod"
|
||||
origin_tech = "engineering=4;materials=5"
|
||||
|
||||
datum/design/rust_fuel_port
|
||||
name = "Internal circuitry (RUST fuel port)"
|
||||
desc = "Allows for the construction of circuit boards used to build a fuel injection port for the RUST fusion engine."
|
||||
id = "rust_fuel_port"
|
||||
req_tech = list("engineering" = 4, "materials" = 5)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$uranium" = 3000)
|
||||
build_path = "/obj/item/weapon/module/rust_fuel_port"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Fuel Compressor board
|
||||
|
||||
/obj/item/weapon/module/rust_fuel_compressor
|
||||
name = "Internal circuitry (RUST fuel compressor)"
|
||||
icon_state = "card_mod"
|
||||
origin_tech = "materials=7;plasmatech=4"
|
||||
|
||||
datum/design/rust_fuel_compressor
|
||||
name = "Circuit Design (RUST fuel compressor)"
|
||||
desc = "Allows for the construction of circuit boards used to build a fuel compressor of the RUST fusion engine."
|
||||
id = "rust_fuel_compressor"
|
||||
req_tech = list("materials" = 7, "plasmatech" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$diamond" = 1000)
|
||||
build_path = "/obj/item/weapon/module/rust_fuel_compressor"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Tokamak Core board
|
||||
|
||||
/obj/item/weapon/circuitboard/rust_core
|
||||
name = "Internal circuitry (RUST tokamak core)"
|
||||
build_path = "/obj/machinery/power/rust_core"
|
||||
board_type = "machine"
|
||||
origin_tech = "bluespace=3;plasmatech=4;magnets=5;materials=6;powerstorage=6"
|
||||
frame_desc = "Requires 2 Pico Manipulators, 1 Ultra Micro-Laser, 5 Pieces of Cable, 1 Subspace Crystal and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
|
||||
"/obj/item/weapon/stock_parts/micro_laser/ultra" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/crystal" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/weapon/cable_coil" = 5)
|
||||
|
||||
datum/design/rust_core
|
||||
name = "Internal circuitry (RUST tokamak core)"
|
||||
desc = "The circuit board that for a RUST-pattern tokamak fusion core."
|
||||
id = "pacman"
|
||||
req_tech = list(bluespace = 3, plasmatech = 4, magnets = 5, materials = 6, powerstorage = 6)
|
||||
build_type = IMPRINTER
|
||||
reliability_base = 79
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$diamond" = 2000)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_core"
|
||||
|
||||
//////////////////////////////////////
|
||||
// RUST Fuel Injector board
|
||||
|
||||
/obj/item/weapon/circuitboard/rust_injector
|
||||
name = "Internal circuitry (RUST fuel injector)"
|
||||
build_path = "/obj/machinery/power/rust_fuel_injector"
|
||||
board_type = "machine"
|
||||
origin_tech = "powerstorage=3;engineering=4;plasmatech=4;materials=6"
|
||||
frame_desc = "Requires 2 Pico Manipulators, 1 Phasic Scanning Module, 1 Super Matter Bin, 1 Console Screen and 5 Pieces of Cable."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
|
||||
"/obj/item/weapon/stock_parts/scanning_module/phasic" = 1,
|
||||
"/obj/item/weapon/stock_parts/matter_bin/super" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/weapon/cable_coil" = 5)
|
||||
|
||||
datum/design/rust_injector
|
||||
name = "Internal circuitry (RUST tokamak core)"
|
||||
desc = "The circuit board that for a RUST-pattern particle accelerator."
|
||||
id = "pacman"
|
||||
req_tech = list(powerstorage = 3, engineering = 4, plasmatech = 4, materials = 6)
|
||||
build_type = IMPRINTER
|
||||
reliability_base = 79
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 3000, "$uranium" = 2000)
|
||||
build_path = "/obj/item/weapon/circuitboard/rust_core"
|
||||
|
Before Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,142 @@
|
||||
|
||||
/obj/machinery/computer/rust_core_control
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "core"
|
||||
var/list/connected_devices = list()
|
||||
var/id_tag = "allan remember to update this before you leave"
|
||||
var/scan_range = 25
|
||||
|
||||
//currently viewed
|
||||
var/obj/machinery/power/rust_core/cur_viewed_device
|
||||
|
||||
/obj/machinery/computer/rust_core_control/process()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
/obj/machinery/computer/rust_core_control/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/rust_core_control/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/computer/rust_core_control/interact(mob/user)
|
||||
if(stat & BROKEN)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=core_control")
|
||||
return
|
||||
if (!istype(user, /mob/living/silicon) && (get_dist(src, user) > 1 ))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=core_control")
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
if(stat & NOPOWER)
|
||||
dat += "<i>The console is dark and nonresponsive.</i>"
|
||||
else
|
||||
dat += "<B>Reactor Core Primary Monitor</B><BR>"
|
||||
if(cur_viewed_device && cur_viewed_device.stat & (BROKEN|NOPOWER))
|
||||
cur_viewed_device = null
|
||||
if(cur_viewed_device && !cur_viewed_device.remote_access_enabled)
|
||||
cur_viewed_device = null
|
||||
|
||||
if(cur_viewed_device)
|
||||
dat += "<b>Device tag:</b> [cur_viewed_device.id_tag ? cur_viewed_device.id_tag : "UNSET"]<br>"
|
||||
dat += "<font color=blue>Device [cur_viewed_device.owned_field ? "activated" : "deactivated"].</font><br>"
|
||||
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];toggle_active=1'>\[Bring field [cur_viewed_device.owned_field ? "offline" : "online"]\]</a><br>"
|
||||
dat += "<b>Device [cur_viewed_device.anchored ? "secured" : "unsecured"].</b><br>"
|
||||
dat += "<hr>"
|
||||
dat += "<b>Field encumbrance:</b> [cur_viewed_device.owned_field ? 0 : "NA"]<br>"
|
||||
dat += "<b>Field strength:</b> [cur_viewed_device.field_strength] Wm^3<br>"
|
||||
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-1000'>\[----\]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-100'>\[--- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-10'>\[-- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=-1'>\[- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=1'>\[+ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=10'>\[++ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=100'>\[+++ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];str=1000'>\[++++\]</a><br>"
|
||||
dat += "<b>Field frequency:</b> [cur_viewed_device.field_frequency] MHz<br>"
|
||||
dat += "<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-1000'>\[----\]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-100'>\[--- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-10'>\[-- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=-1'>\[- \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=1'>\[+ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=10'>\[++ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=100'>\[+++ \]</a> \
|
||||
<a href='?src=\ref[cur_viewed_device];extern_update=\ref[src];freq=1000'>\[++++\]</a><br>"
|
||||
|
||||
var/power_stat = "Good"
|
||||
if(cur_viewed_device.cached_power_avail < cur_viewed_device.active_power_usage)
|
||||
power_stat = "Insufficient"
|
||||
else if(cur_viewed_device.cached_power_avail < cur_viewed_device.active_power_usage * 2)
|
||||
power_stat = "Check"
|
||||
dat += "<b>Power status:</b> [power_stat]<br>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];scan=1'>\[Refresh device list\]</a><br><br>"
|
||||
if(connected_devices.len)
|
||||
dat += "<table width='100%' border=1>"
|
||||
dat += "<tr>"
|
||||
dat += "<td><b>Device tag</b></td>"
|
||||
dat += "<td></td>"
|
||||
dat += "</tr>"
|
||||
for(var/obj/machinery/power/rust_core/C in connected_devices)
|
||||
if(!check_core_status(C))
|
||||
connected_devices.Remove(C)
|
||||
continue
|
||||
|
||||
dat += "<tr>"
|
||||
dat += "<td>[C.id_tag]</td>"
|
||||
dat += "<td><a href='?src=\ref[src];manage_individual=\ref[C]'>\[Manage\]</a></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
else
|
||||
dat += "No devices connected.<br>"
|
||||
|
||||
dat += "<hr>"
|
||||
dat += "<a href='?src=\ref[src];refresh=1'>Refresh</a> "
|
||||
dat += "<a href='?src=\ref[src];close=1'>Close</a>"
|
||||
|
||||
user << browse(dat, "window=core_control;size=500x400")
|
||||
onclose(user, "core_control")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/computer/rust_core_control/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if( href_list["goto_scanlist"] )
|
||||
cur_viewed_device = null
|
||||
|
||||
if( href_list["manage_individual"] )
|
||||
cur_viewed_device = locate(href_list["manage_individual"])
|
||||
|
||||
if( href_list["scan"] )
|
||||
connected_devices = list()
|
||||
for(var/obj/machinery/power/rust_core/C in range(scan_range, src))
|
||||
if(check_core_status(C))
|
||||
connected_devices.Add(C)
|
||||
|
||||
if( href_list["startup"] )
|
||||
if(cur_viewed_device)
|
||||
cur_viewed_device.Startup()
|
||||
|
||||
if( href_list["shutdown"] )
|
||||
if(cur_viewed_device)
|
||||
cur_viewed_device.Shutdown()
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=core_control")
|
||||
usr.unset_machine()
|
||||
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/computer/rust_core_control/proc/check_core_status(var/obj/machinery/power/rust_core/C)
|
||||
if(!C)
|
||||
return 0
|
||||
|
||||
if(C.stat & (BROKEN|NOPOWER) || !C.remote_access_enabled || !C.id_tag)
|
||||
if(connected_devices.Find(C))
|
||||
connected_devices.Remove(C)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
@@ -40,80 +40,247 @@ max volume of plasma storeable by the field = the total volume of a number of ti
|
||||
|
||||
*/
|
||||
|
||||
/obj/machinery/rust/core
|
||||
name = "Tokamak core"
|
||||
#define MAX_FIELD_FREQ 1000
|
||||
#define MIN_FIELD_FREQ 1
|
||||
#define MAX_FIELD_STR 1000
|
||||
#define MIN_FIELD_STR 1
|
||||
|
||||
/obj/machinery/power/rust_core
|
||||
name = "RUST Tokamak core"
|
||||
desc = "Enormous solenoid for generating extremely high power electromagnetic fields"
|
||||
icon = 'core.dmi'
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "core0"
|
||||
anchored = 1
|
||||
var/on = 0
|
||||
var/obj/machinery/rust/em_field/owned_field
|
||||
var/field_strength = 0.01
|
||||
//
|
||||
density = 1
|
||||
var/obj/effect/rust_em_field/owned_field
|
||||
var/field_strength = 1//0.01
|
||||
var/field_frequency = 1
|
||||
var/id_tag = "allan, don't forget to set the ID of this one too"
|
||||
req_access = list(access_engine)
|
||||
//
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 300
|
||||
idle_power_usage = 50
|
||||
active_power_usage = 500 //multiplied by field strength
|
||||
var/cached_power_avail = 0
|
||||
directwired = 1
|
||||
|
||||
var/state = 0
|
||||
var/locked = 0
|
||||
var/remote_access_enabled = 1
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["startup"] )
|
||||
Startup()
|
||||
return
|
||||
if( href_list["shutdown"] )
|
||||
Shutdown()
|
||||
return
|
||||
if( href_list["modify_field_strength"] )
|
||||
var/new_field_str = text2num(input("Enter new field strength", "Modifying field strength", owned_field.field_strength))
|
||||
if(!new_field_str)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
field_strength = max(new_field_str,0.1)
|
||||
field_strength = min(new_field_str,50)
|
||||
if(owned_field)
|
||||
owned_field.ChangeFieldStrength(field_strength)
|
||||
return
|
||||
/obj/machinery/power/rust_core/process()
|
||||
if(stat & BROKEN || !powernet)
|
||||
Shutdown()
|
||||
|
||||
proc/Startup()
|
||||
cached_power_avail = avail()
|
||||
//luminosity = round(owned_field.field_strength/10)
|
||||
//luminosity = max(luminosity,1)
|
||||
|
||||
/obj/machinery/power/rust_core/attackby(obj/item/W, mob/user)
|
||||
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(owned_field)
|
||||
user << "Turn off [src] first."
|
||||
return
|
||||
on = 1
|
||||
owned_field = new(src.loc)
|
||||
switch(state)
|
||||
if(0)
|
||||
state = 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] secures [src.name] to the floor.", \
|
||||
"You secure the external reinforcing bolts to the floor.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 1
|
||||
if(1)
|
||||
state = 0
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
|
||||
"You undo the external reinforcing bolts.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 0
|
||||
if(2)
|
||||
user << "\red The [src.name] needs to be unwelded from the floor."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(owned_field)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
user << "\red The [src.name] needs to be wrenched to the floor."
|
||||
if(1)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
|
||||
"You start to weld the [src] to the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 2
|
||||
user << "You weld the [src] to the floor."
|
||||
connect_to_network()
|
||||
src.directwired = 1
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
if(2)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
|
||||
"You start to cut the [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 1
|
||||
user << "You cut the [src] free from the floor."
|
||||
disconnect_from_network()
|
||||
src.directwired = 0
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
|
||||
if(emagged)
|
||||
user << "\red The lock seems to be broken"
|
||||
return
|
||||
if(src.allowed(user))
|
||||
if(owned_field)
|
||||
src.locked = !src.locked
|
||||
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
src.locked = 0 //just in case it somehow gets locked
|
||||
user << "\red The controls can only be locked when the [src] is online"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
locked = 0
|
||||
emagged = 1
|
||||
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
|
||||
return
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/power/rust_core/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/power/rust_core/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/power/rust_core/interact(mob/user)
|
||||
if(stat & BROKEN)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=core_gen")
|
||||
return
|
||||
if(!istype(user, /mob/living/silicon) && get_dist(src, user) > 1)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=core_gen")
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
if(!powernet || locked)
|
||||
dat += "<i>The console is dark and nonresponsive.</i>"
|
||||
else
|
||||
dat += "<b>RUST Tokamak pattern Electromagnetic Field Generator</b><br>"
|
||||
dat += "<b>Device ID tag: </b> [id_tag ? id_tag : "UNSET"] <a href='?src=\ref[src];new_id_tag=1'>\[Modify\]</a><br>"
|
||||
dat += "<a href='?src=\ref[src];toggle_active=1'>\[[owned_field ? "Deactivate" : "Activate"]\]</a><br>"
|
||||
dat += "<a href='?src=\ref[src];toggle_remote=1'>\[[remote_access_enabled ? "Disable remote access to this device" : "Enable remote access to this device"]\]</a><br>"
|
||||
dat += "<hr>"
|
||||
dat += "<b>Field strength:</b> [field_strength]Wm^3<br>"
|
||||
dat += "<a href='?src=\ref[src];str=-1000'>\[----\]</a> \
|
||||
<a href='?src=\ref[src];str=-100'>\[--- \]</a> \
|
||||
<a href='?src=\ref[src];str=-10'>\[-- \]</a> \
|
||||
<a href='?src=\ref[src];str=-1'>\[- \]</a> \
|
||||
<a href='?src=\ref[src];str=1'>\[+ \]</a> \
|
||||
<a href='?src=\ref[src];str=10'>\[++ \]</a> \
|
||||
<a href='?src=\ref[src];str=100'>\[+++ \]</a> \
|
||||
<a href='?src=\ref[src];str=1000'>\[++++\]</a><br>"
|
||||
|
||||
dat += "<b>Field frequency:</b> [field_frequency]MHz<br>"
|
||||
dat += "<a href='?src=\ref[src];freq=-1000'>\[----\]</a> \
|
||||
<a href='?src=\ref[src];freq=-100'>\[--- \]</a> \
|
||||
<a href='?src=\ref[src];freq=-10'>\[-- \]</a> \
|
||||
<a href='?src=\ref[src];freq=-1'>\[- \]</a> \
|
||||
<a href='?src=\ref[src];freq=1'>\[+ \]</a> \
|
||||
<a href='?src=\ref[src];freq=10'>\[++ \]</a> \
|
||||
<a href='?src=\ref[src];freq=100'>\[+++ \]</a> \
|
||||
<a href='?src=\ref[src];freq=1000'>\[++++\]</a><br>"
|
||||
|
||||
var/font_colour = "green"
|
||||
if(cached_power_avail < active_power_usage)
|
||||
font_colour = "red"
|
||||
else if(cached_power_avail < active_power_usage * 2)
|
||||
font_colour = "orange"
|
||||
dat += "<b>Power status:</b> <font color=[font_colour]>[active_power_usage]/[cached_power_avail] W</font><br>"
|
||||
|
||||
user << browse(dat, "window=core_gen;size=500x300")
|
||||
onclose(user, "core_gen")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/power/rust_core/Topic(href, href_list)
|
||||
if(href_list["str"])
|
||||
var/dif = text2num(href_list["str"])
|
||||
field_strength = min(max(field_strength + dif, MIN_FIELD_STR), MAX_FIELD_STR)
|
||||
active_power_usage = 5 * field_strength //change to 500 later
|
||||
if(owned_field)
|
||||
owned_field.ChangeFieldStrength(field_strength)
|
||||
icon_state = "core1"
|
||||
luminosity = 1
|
||||
return 1
|
||||
|
||||
proc/Shutdown()
|
||||
if(href_list["freq"])
|
||||
var/dif = text2num(href_list["freq"])
|
||||
field_frequency = min(max(field_frequency + dif, MIN_FIELD_FREQ), MAX_FIELD_FREQ)
|
||||
if(owned_field)
|
||||
owned_field.ChangeFieldFrequency(field_frequency)
|
||||
|
||||
if(href_list["toggle_active"])
|
||||
if(!Startup())
|
||||
Shutdown()
|
||||
|
||||
if( href_list["toggle_remote"] )
|
||||
remote_access_enabled = !remote_access_enabled
|
||||
|
||||
if(href_list["new_id_tag"])
|
||||
if(usr)
|
||||
id_tag = input("Enter a new ID tag", "Tokamak core ID tag", id_tag) as text|null
|
||||
|
||||
if(href_list["close"])
|
||||
usr << browse(null, "window=core_gen")
|
||||
usr.unset_machine()
|
||||
|
||||
if(href_list["extern_update"])
|
||||
var/obj/machinery/computer/rust_core_control/C = locate(href_list["extern_update"])
|
||||
if(C)
|
||||
C.updateDialog()
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
/obj/machinery/power/rust_core/proc/Startup()
|
||||
if(owned_field)
|
||||
return
|
||||
owned_field = new(src.loc)
|
||||
owned_field.ChangeFieldStrength(field_strength)
|
||||
owned_field.ChangeFieldFrequency(field_frequency)
|
||||
icon_state = "core1"
|
||||
luminosity = 1
|
||||
use_power = 2
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/rust_core/proc/Shutdown()
|
||||
//todo: safety checks for field status
|
||||
if(owned_field)
|
||||
icon_state = "core0"
|
||||
on = 0
|
||||
del(owned_field)
|
||||
luminosity = 0
|
||||
use_power = 1
|
||||
|
||||
proc/AddParticles(var/name, var/quantity = 1)
|
||||
if(owned_field)
|
||||
owned_field.AddParticles(name, quantity)
|
||||
return 1
|
||||
return 0
|
||||
/obj/machinery/power/rust_core/proc/AddParticles(var/name, var/quantity = 1)
|
||||
if(owned_field)
|
||||
owned_field.AddParticles(name, quantity)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
process()
|
||||
..()
|
||||
use_power(100 * field_strength + 500)
|
||||
if(on && !owned_field)
|
||||
Shutdown()
|
||||
return
|
||||
//
|
||||
luminosity = round(owned_field.field_strength/10)
|
||||
luminosity = max(luminosity,1)
|
||||
//
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
Shutdown()
|
||||
|
||||
bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet" && owned_field)
|
||||
var/obj/item/projectile/beam/laserbeam = Proj
|
||||
owned_field.AddEnergy(0, laserbeam.damage / 5000, laserbeam.frequency)
|
||||
return 0
|
||||
/obj/machinery/power/rust_core/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet" && owned_field)
|
||||
owned_field.AddEnergy(Proj.damage, 0, 1)
|
||||
return 0
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
|
||||
/obj/machinery/computer/rust_radiation_monitor
|
||||
name = "Radiation Monitor"
|
||||
icon_state = "power"
|
||||
|
||||
/obj/machinery/computer/rust_energy_monitor
|
||||
name = "Core Primary Monitor"
|
||||
icon_state = "power"
|
||||
var/obj/machinery/rust/core/core_generator = null
|
||||
var/updating = 1
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(0)
|
||||
core_generator = locate() in world
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["shutdown"] )
|
||||
updating = 0
|
||||
core_generator.Topic(href, href_list)
|
||||
updateDialog()
|
||||
updating = 1
|
||||
return
|
||||
if( href_list["startup"] )
|
||||
updating = 0
|
||||
core_generator.Topic(href, href_list)
|
||||
updateDialog()
|
||||
updating = 1
|
||||
return
|
||||
if( href_list["modify_field_strength"] )
|
||||
updating = 0
|
||||
core_generator.Topic(href, href_list)
|
||||
updateDialog()
|
||||
updating = 1
|
||||
return
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=core_monitor")
|
||||
usr.machine = null
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
if(updating)
|
||||
src.updateDialog()
|
||||
|
||||
interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=core_monitor")
|
||||
return
|
||||
var/t = "<B>Reactor Core Primary Monitor</B><BR>"
|
||||
if(core_generator)
|
||||
t += "<font color=blue>[core_generator.on ? "Core Generator connected" : "Core Generator operational"]</font><br>"
|
||||
if(core_generator.owned_field)
|
||||
t += "<font color=green>Core suspension field online</font> <a href='?src=\ref[src];shutdown=1'>\[Bring field offline\]</a><br>"
|
||||
t += "Electromagnetic plasma suspension field status:<br>"
|
||||
t += " <font color=blue>Strength (T): [core_generator.owned_field.field_strength]</font> <a href='?src=\ref[src];modify_field_strength=1'>\[Modify\]</a><br>"
|
||||
t += " <font color=blue>Energy levels (MeV): [core_generator.owned_field.mega_energy]</font><br>"
|
||||
t += " <font color=blue>Core frequency: [core_generator.owned_field.frequency]</font><br>"
|
||||
t += " <font color=blue>Moles of plasma: [core_generator.owned_field.held_plasma.toxins]</font><br>"
|
||||
t += " <font color=blue>Core temperature: [core_generator.owned_field.held_plasma.temperature]</font><br>"
|
||||
t += "<hr>"
|
||||
t += "<b>Core atomic and subatomic constituents:</font></b><br>"
|
||||
if(core_generator.owned_field.dormant_reactant_quantities && core_generator.owned_field.dormant_reactant_quantities.len)
|
||||
for(var/reagent in core_generator.owned_field.dormant_reactant_quantities)
|
||||
t += " <font color=green>[reagent]:</font> [core_generator.owned_field.dormant_reactant_quantities[reagent]]<br>"
|
||||
else
|
||||
t += " <font color=blue>No reactants present.</font><br>"
|
||||
else
|
||||
t += "<font color=red>Core suspension field offline</font> <a href='?src=\ref[src];startup=1'>\[Bring field online\]</a><br>"
|
||||
else
|
||||
t += "<b><font color=red>Core Generator unresponsive</font></b><br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=core_monitor;size=500x400")
|
||||
user.machine = src
|
||||
|
Before Width: | Height: | Size: 7.8 KiB |
@@ -1,10 +1,10 @@
|
||||
|
||||
/obj/item/weapon/fuel_assembly
|
||||
icon = 'fuel_assembly.dmi'
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel_assembly"
|
||||
name = "Fuel Rod Assembly"
|
||||
var/list/rod_quantities
|
||||
var/percent_depleted = 0
|
||||
var/percent_depleted = 1
|
||||
//
|
||||
New()
|
||||
rod_quantities = new/list
|
||||
|
||||
|
Before Width: | Height: | Size: 251 B |
@@ -1,31 +1,130 @@
|
||||
|
||||
/obj/machinery/rust/fuel_assembly_port
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port
|
||||
name = "Fuel Assembly Port"
|
||||
icon = 'fuel_assembly_port.dmi'
|
||||
icon_state = "port0"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "port2"
|
||||
density = 0
|
||||
var/obj/item/weapon/fuel_assembly/cur_assembly = null
|
||||
var/obj/item/weapon/fuel_assembly/cur_assembly
|
||||
layer = 4
|
||||
var/busy = 0
|
||||
anchored = 1
|
||||
|
||||
attackby(var/obj/item/I, var/mob/user)
|
||||
if(istype(I,/obj/item/weapon/fuel_assembly))
|
||||
if(cur_assembly)
|
||||
del cur_assembly
|
||||
var/opened = 1 //0=closed, 1=opened
|
||||
var/has_electronics = 0 // 0 - none, bit 1 - circuitboard, bit 2 - wires
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/attackby(var/obj/item/I, var/mob/user)
|
||||
if(istype(I,/obj/item/weapon/fuel_assembly) && !opened)
|
||||
if(cur_assembly)
|
||||
user << "\red There is already a fuel rod assembly in there!"
|
||||
else
|
||||
cur_assembly = I
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
icon_state = "port1"
|
||||
|
||||
attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
/*if(stat & (BROKEN|NOPOWER))
|
||||
return*/
|
||||
/obj/machinery/rust_fuel_assembly_port/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER) || opened)
|
||||
return
|
||||
|
||||
if(!busy)
|
||||
busy = 1
|
||||
if(cur_assembly)
|
||||
cur_assembly.loc = src.loc
|
||||
spawn(30)
|
||||
if(!try_insert_assembly())
|
||||
spawn(30)
|
||||
eject_assembly()
|
||||
busy = 0
|
||||
else
|
||||
busy = 0
|
||||
else
|
||||
spawn(30)
|
||||
try_draw_assembly()
|
||||
busy = 0
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/proc/try_insert_assembly()
|
||||
var/success = 0
|
||||
if(cur_assembly)
|
||||
var/turf/check_turf = get_step(get_turf(src), src.dir)
|
||||
check_turf = get_step(check_turf, src.dir)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in check_turf)
|
||||
if(I.stat & (BROKEN|NOPOWER))
|
||||
break
|
||||
if(I.cur_assembly)
|
||||
break
|
||||
|
||||
I.cur_assembly = cur_assembly
|
||||
cur_assembly.loc = I
|
||||
cur_assembly = null
|
||||
icon_state = "port0"
|
||||
success = 1
|
||||
|
||||
New()
|
||||
//embed the fuel port into a wall
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? 24 : -24)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? 24 : -24) : 0
|
||||
if(success)
|
||||
src.visible_message("\blue \icon[src] a green light flashes on [src] as it inserts it's fuel rod assembly into an injector.")
|
||||
else
|
||||
src.visible_message("\red \icon[src] a red light flashes on [src] as it attempts to insert it's fuel rod assembly into an injector.")
|
||||
return success
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/proc/eject_assembly()
|
||||
if(cur_assembly)
|
||||
var/turf/check_turf = get_step(get_turf(src), src.dir)
|
||||
cur_assembly.loc = check_turf
|
||||
cur_assembly = null
|
||||
icon_state = "port0"
|
||||
return 1
|
||||
else
|
||||
src.visible_message("\red \icon[src] a red light flashes on [src] as it attempts to eject it's fuel rod assembly.")
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/proc/try_draw_assembly()
|
||||
var/success = 0
|
||||
if(cur_assembly)
|
||||
var/turf/check_turf = get_step(get_turf(src), src.dir)
|
||||
check_turf = get_step(check_turf, src.dir)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in check_turf)
|
||||
if(I.stat & (BROKEN|NOPOWER))
|
||||
break
|
||||
if(!I.cur_assembly)
|
||||
break
|
||||
if(I.injecting)
|
||||
break
|
||||
if(I.stat != 2)
|
||||
break
|
||||
|
||||
cur_assembly = I.cur_assembly
|
||||
cur_assembly.loc = src
|
||||
I.cur_assembly = null
|
||||
icon_state = "port1"
|
||||
success = 1
|
||||
|
||||
if(success)
|
||||
src.visible_message("\icon[src] a blue light flashes on [src] as it draws a fuel rod assembly from an injector.")
|
||||
else
|
||||
src.visible_message("\red \icon[src] a red light flashes on [src] as it attempts to draw a fuel rod assembly from an injector.")
|
||||
return success
|
||||
|
||||
/*
|
||||
/obj/machinery/rust_fuel_assembly_port/verb/try_insert_assembly_verb()
|
||||
set name = "Attempt to insert assembly from port into injector"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(!busy)
|
||||
try_insert_assembly()
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/verb/eject_assembly_verb()
|
||||
set name = "Attempt to eject assembly from port"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(!busy)
|
||||
eject_assembly()
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/verb/try_draw_assembly_verb()
|
||||
set name = "Draw assembly from injector"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(!busy)
|
||||
try_draw_assembly()
|
||||
*/
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,133 @@
|
||||
|
||||
//frame assembly
|
||||
|
||||
/obj/item/rust_fuel_assembly_port_frame
|
||||
name = "Fuel Assembly Port frame"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "port2"
|
||||
w_class = 4
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/rust_fuel_assembly_port_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
new /obj/item/stack/sheet/plasteel( get_turf(src.loc), 12 )
|
||||
del(src)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/rust_fuel_assembly_port_frame/proc/try_build(turf/on_wall)
|
||||
if (get_dist(on_wall,usr)>1)
|
||||
return
|
||||
var/ndir = get_dir(usr,on_wall)
|
||||
if (!(ndir in cardinal))
|
||||
return
|
||||
var/turf/loc = get_turf(usr)
|
||||
var/area/A = loc.loc
|
||||
if (!istype(loc, /turf/simulated/floor))
|
||||
usr << "\red Port cannot be placed on this spot."
|
||||
return
|
||||
if (A.requires_power == 0 || A.name == "Space")
|
||||
usr << "\red Port cannot be placed in this area."
|
||||
return
|
||||
new /obj/machinery/rust_fuel_assembly_port(loc, ndir, 1)
|
||||
del(src)
|
||||
|
||||
//construction steps
|
||||
/obj/machinery/rust_fuel_assembly_port/New(turf/loc, var/ndir, var/building=0)
|
||||
..()
|
||||
|
||||
// offset 24 pixels in direction of dir
|
||||
// this allows the APC to be embedded in a wall, yet still inside an area
|
||||
if (building)
|
||||
dir = ndir
|
||||
else
|
||||
has_electronics = 3
|
||||
opened = 1
|
||||
icon_state = "port0"
|
||||
|
||||
//20% easier to read than apc code
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? 32 : -32)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? 32 : -32) : 0
|
||||
|
||||
/obj/machinery/rust_fuel_assembly_port/attackby(obj/item/W, mob/user)
|
||||
|
||||
if (istype(user, /mob/living/silicon) && get_dist(src,user)>1)
|
||||
return src.attack_hand(user)
|
||||
if (istype(W, /obj/item/weapon/crowbar))
|
||||
if(opened)
|
||||
if(has_electronics & 1)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "You begin removing the circuitboard" //lpeters - fixed grammar issues
|
||||
if(do_after(user, 50))
|
||||
user.visible_message(\
|
||||
"\red [user.name] has removed the circuitboard from [src.name]!",\
|
||||
"\blue You remove the circuitboard.")
|
||||
has_electronics = 0
|
||||
new /obj/item/weapon/module/rust_fuel_port(loc)
|
||||
has_electronics &= ~1
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "port0"
|
||||
user << "\blue You close the maintenance cover."
|
||||
else
|
||||
if(cur_assembly)
|
||||
user << "\red You cannot open the cover while there is a fuel assembly inside."
|
||||
else
|
||||
opened = 1
|
||||
user << "\blue You open the maintenance cover."
|
||||
icon_state = "port2"
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/cable_coil) && opened && !(has_electronics & 2))
|
||||
var/obj/item/weapon/cable_coil/C = W
|
||||
if(C.amount < 10)
|
||||
user << "\red You need more wires."
|
||||
return
|
||||
user << "You start adding cables to the frame..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20) && C.amount >= 10)
|
||||
C.use(10)
|
||||
user.visible_message(\
|
||||
"\red [user.name] has added cables to the port frame!",\
|
||||
"You add cables to the port frame.")
|
||||
has_electronics &= 2
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/wirecutters) && opened && (has_electronics & 2))
|
||||
user << "You begin to cut the cables..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 50))
|
||||
new /obj/item/weapon/cable_coil(loc,10)
|
||||
user.visible_message(\
|
||||
"\red [user.name] cut the cabling inside the port.",\
|
||||
"You cut the cabling inside the port.")
|
||||
has_electronics &= ~2
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/module/rust_fuel_port) && opened && !(has_electronics & 1))
|
||||
user << "You trying to insert the port control board into the frame..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 10))
|
||||
has_electronics &= 1
|
||||
user << "You place the port control board inside the frame."
|
||||
del(W)
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/weldingtool) && opened && !has_electronics)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.get_fuel() < 3)
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return
|
||||
user << "You start welding the port frame..."
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
if(do_after(user, 50))
|
||||
if(!src || !WT.remove_fuel(3, user)) return
|
||||
new /obj/item/rust_fuel_assembly_port_frame(loc)
|
||||
user.visible_message(\
|
||||
"\red [src] has been cut away from the wall by [user.name].",\
|
||||
"You detached the port frame.",\
|
||||
"\red You hear welding.")
|
||||
del(src)
|
||||
return
|
||||
|
||||
..()
|
||||
@@ -1,87 +1,113 @@
|
||||
var/const/max_assembly_amount = 300
|
||||
|
||||
/obj/machinery/rust/fuel_compressor
|
||||
icon = 'fuel_compressor.dmi'
|
||||
icon_state = "fuel_compressor"
|
||||
/obj/machinery/rust_fuel_compressor
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel_compressor0"
|
||||
name = "Fuel Compressor"
|
||||
var/list/new_assembly_quantities
|
||||
//
|
||||
New()
|
||||
new_assembly_quantities = new/list
|
||||
spawn(0)
|
||||
new_assembly_quantities["Deuterium"] = 200
|
||||
new_assembly_quantities["Tritium"] = 100
|
||||
//
|
||||
new_assembly_quantities["Helium-3"] = 0
|
||||
new_assembly_quantities["Lithium-6"] = 0
|
||||
new_assembly_quantities["Silver"] = 0
|
||||
var/compressed_matter = 0
|
||||
anchored = 1
|
||||
|
||||
attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
var/opened = 1 //0=closed, 1=opened
|
||||
var/locked = 0
|
||||
var/has_electronics = 0 // 0 - none, bit 1 - circuitboard, bit 2 - wires
|
||||
|
||||
attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
/*if(stat & (BROKEN|NOPOWER))
|
||||
return*/
|
||||
interact(user)
|
||||
|
||||
/*power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
else
|
||||
if( powered() )
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "c_unpowered"
|
||||
stat |= NOPOWER*/
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuelcomp")
|
||||
usr.machine = null
|
||||
return
|
||||
/obj/machinery/rust_fuel_compressor/New()
|
||||
new_assembly_quantities = new/list
|
||||
spawn(0)
|
||||
new_assembly_quantities["Deuterium"] = 200
|
||||
new_assembly_quantities["Tritium"] = 100
|
||||
//
|
||||
for(var/reagent in new_assembly_quantities)
|
||||
if(href_list[reagent])
|
||||
var/new_amount = text2num(input("Enter new rod amount", "Fuel Assembly Rod Composition ([reagent])", new_assembly_quantities[reagent]) as text|null)
|
||||
if(!new_amount)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
var/sum_reactants = new_amount - new_assembly_quantities[reagent]
|
||||
for(var/rod in new_assembly_quantities)
|
||||
sum_reactants += new_assembly_quantities[rod]
|
||||
if(sum_reactants > max_assembly_amount)
|
||||
usr << "\red You have entered too many rods."
|
||||
else
|
||||
new_assembly_quantities[reagent] = new_amount
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["activate"] )
|
||||
var/obj/item/weapon/fuel_assembly/F = new(src)
|
||||
//world << "\blue New fuel rod assembly"
|
||||
for(var/reagent in new_assembly_quantities)
|
||||
F.rod_quantities[reagent] = new_assembly_quantities[reagent]
|
||||
//world << "\blue [reagent]: new_assembly_quantities[reagent]<br>"
|
||||
F.loc = src.loc
|
||||
new_assembly_quantities["Helium-3"] = 0
|
||||
new_assembly_quantities["Lithium-6"] = 0
|
||||
new_assembly_quantities["Silver"] = 0
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
/*if(stat & (BROKEN|NOPOWER))
|
||||
return*/
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/rcd_ammo))
|
||||
compressed_matter += 10
|
||||
del(W)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuelcomp")
|
||||
return
|
||||
|
||||
interact(mob/user)
|
||||
/*if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=fuelcomp")
|
||||
return*/
|
||||
var/t = "<B>Reactor Fuel Rod Compressor / Assembler</B><BR>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
var/t = "<B>Reactor Fuel Rod Compressor / Assembler</B><BR>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
if(locked)
|
||||
t += "Swipe your ID to unlock this console."
|
||||
else
|
||||
t += "Compressed matter in storage: [compressed_matter] <A href='?src=\ref[src];eject_matter=1'>\[Eject all\]</a>"
|
||||
t += "<A href='?src=\ref[src];activate=1'><b>Activate Fuel Synthesis</b></A><BR> (fuel assemblies require no more than [max_assembly_amount] rods).<br>"
|
||||
t += "<hr>"
|
||||
t += "- New fuel assembly constituents:- <br>"
|
||||
for(var/reagent in new_assembly_quantities)
|
||||
t += " [reagent] rods: [new_assembly_quantities[reagent]] \[<A href='?src=\ref[src];reagent=1'>Modify</A>\]<br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=fuelcomp;size=500x800")
|
||||
user.machine = src
|
||||
t += " [reagent] rods: [new_assembly_quantities[reagent]] \[<A href='?src=\ref[src];change_reagent=[reagent]'>Modify</A>\]<br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
|
||||
user << browse(t, "window=fuelcomp;size=500x300")
|
||||
user.set_machine(src)
|
||||
|
||||
//var/locked
|
||||
//var/coverlocked
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuelcomp")
|
||||
usr.machine = null
|
||||
|
||||
if( href_list["eject_matter"] )
|
||||
while(compressed_matter > 10)
|
||||
new /obj/item/weapon/rcd_ammo(src.loc)
|
||||
compressed_matter -= 10
|
||||
src.visible_message("\blue \icon[src] [src] ejects some compressed matter units.")
|
||||
|
||||
if( href_list["activate"] )
|
||||
//world << "\blue New fuel rod assembly"
|
||||
var/obj/item/weapon/fuel_assembly/F = new(src)
|
||||
var/fail = 0
|
||||
var/old_matter = compressed_matter
|
||||
for(var/reagent in new_assembly_quantities)
|
||||
var/req_matter = F.rod_quantities[reagent] / 10
|
||||
if(req_matter <= compressed_matter)
|
||||
F.rod_quantities[reagent] = new_assembly_quantities[reagent]
|
||||
compressed_matter -= req_matter
|
||||
else
|
||||
fail = 1
|
||||
break
|
||||
//world << "\blue [reagent]: new_assembly_quantities[reagent]<br>"
|
||||
if(fail)
|
||||
del(F)
|
||||
compressed_matter = old_matter
|
||||
src.visible_message("\red \icon[src] [src] flashes red: \'Out of matter.\'")
|
||||
else
|
||||
F.loc = src.loc
|
||||
F.percent_depleted = 0
|
||||
|
||||
if( href_list["change_reagent"] )
|
||||
var/cur_reagent = href_list["change_reagent"]
|
||||
var/avail_rods = 300
|
||||
for(var/rod in new_assembly_quantities)
|
||||
avail_rods -= new_assembly_quantities[rod]
|
||||
avail_rods += new_assembly_quantities[cur_reagent]
|
||||
avail_rods = max(avail_rods, 0)
|
||||
|
||||
var/new_amount = min(input("Enter new [cur_reagent] rod amount (max [avail_rods])", "Fuel Assembly Rod Composition ([cur_reagent])") as num, avail_rods)
|
||||
new_assembly_quantities[cur_reagent] = new_amount
|
||||
|
||||
updateDialog()
|
||||
|
||||
|
Before Width: | Height: | Size: 312 B |
@@ -0,0 +1,160 @@
|
||||
|
||||
//frame assembly
|
||||
|
||||
/obj/item/rust_fuel_compressor_frame
|
||||
name = "Fuel Compressor frame"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel_compressor0"
|
||||
w_class = 4
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/rust_fuel_compressor_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
new /obj/item/stack/sheet/plasteel( get_turf(src.loc), 12 )
|
||||
del(src)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/rust_fuel_compressor_frame/proc/try_build(turf/on_wall)
|
||||
if (get_dist(on_wall,usr)>1)
|
||||
return
|
||||
var/ndir = get_dir(usr,on_wall)
|
||||
if (!(ndir in cardinal))
|
||||
return
|
||||
var/turf/loc = get_turf(usr)
|
||||
var/area/A = loc.loc
|
||||
if (!istype(loc, /turf/simulated/floor))
|
||||
usr << "\red Compressor cannot be placed on this spot."
|
||||
return
|
||||
if (A.requires_power == 0 || A.name == "Space")
|
||||
usr << "\red Compressor cannot be placed in this area."
|
||||
return
|
||||
new /obj/machinery/rust_fuel_assembly_port(loc, ndir, 1)
|
||||
del(src)
|
||||
|
||||
//construction steps
|
||||
/obj/machinery/rust_fuel_compressor/New(turf/loc, var/ndir, var/building=0)
|
||||
..()
|
||||
|
||||
// offset 24 pixels in direction of dir
|
||||
// this allows the APC to be embedded in a wall, yet still inside an area
|
||||
if (building)
|
||||
dir = ndir
|
||||
else
|
||||
has_electronics = 3
|
||||
opened = 1
|
||||
locked = 0
|
||||
icon_state = "port0"
|
||||
|
||||
//20% easier to read than apc code
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? 32 : -32)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? 32 : -32) : 0
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attackby(obj/item/W, mob/user)
|
||||
|
||||
if (istype(user, /mob/living/silicon) && get_dist(src,user)>1)
|
||||
return src.attack_hand(user)
|
||||
if (istype(W, /obj/item/weapon/crowbar))
|
||||
if(opened)
|
||||
if(has_electronics & 1)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "You begin removing the circuitboard" //lpeters - fixed grammar issues
|
||||
if(do_after(user, 50))
|
||||
user.visible_message(\
|
||||
"\red [user.name] has removed the circuitboard from [src.name]!",\
|
||||
"\blue You remove the circuitboard board.")
|
||||
has_electronics = 0
|
||||
new /obj/item/weapon/module/rust_fuel_compressor(loc)
|
||||
has_electronics &= ~1
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "fuel_compressor0"
|
||||
user << "\blue You close the maintenance cover."
|
||||
else
|
||||
if(compressed_matter > 0)
|
||||
user << "\red You cannot open the cover while there is compressed matter inside."
|
||||
else
|
||||
opened = 1
|
||||
user << "\blue You open the maintenance cover."
|
||||
icon_state = "fuel_compressor1"
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) // trying to unlock the interface with an ID card
|
||||
if(opened)
|
||||
user << "You must close the cover to swipe an ID card."
|
||||
else
|
||||
if(src.allowed(usr))
|
||||
locked = !locked
|
||||
user << "You [ locked ? "lock" : "unlock"] the compressor interface."
|
||||
update_icon()
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/emag) && !emagged) // trying to unlock with an emag card
|
||||
if(opened)
|
||||
user << "You must close the cover to swipe an ID card."
|
||||
else
|
||||
flick("apc-spark", src)
|
||||
if (do_after(user,6))
|
||||
if(prob(50))
|
||||
emagged = 1
|
||||
locked = 0
|
||||
user << "You emag the port interface."
|
||||
else
|
||||
user << "You fail to [ locked ? "unlock" : "lock"] the compressor interface."
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/cable_coil) && opened && !(has_electronics & 2))
|
||||
var/obj/item/weapon/cable_coil/C = W
|
||||
if(C.amount < 10)
|
||||
user << "\red You need more wires."
|
||||
return
|
||||
user << "You start adding cables to the compressor frame..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20) && C.amount >= 10)
|
||||
C.use(10)
|
||||
user.visible_message(\
|
||||
"\red [user.name] has added cables to the compressor frame!",\
|
||||
"You add cables to the port frame.")
|
||||
has_electronics &= 2
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/wirecutters) && opened && (has_electronics & 2))
|
||||
user << "You begin to cut the cables..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 50))
|
||||
new /obj/item/weapon/cable_coil(loc,10)
|
||||
user.visible_message(\
|
||||
"\red [user.name] cut the cabling inside the compressor.",\
|
||||
"You cut the cabling inside the port.")
|
||||
has_electronics &= ~2
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/module/rust_fuel_compressor) && opened && !(has_electronics & 1))
|
||||
user << "You trying to insert the circuitboard into the frame..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 10))
|
||||
has_electronics &= 1
|
||||
user << "You place the circuitboard inside the frame."
|
||||
del(W)
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/weldingtool) && opened && !has_electronics)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.get_fuel() < 3)
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return
|
||||
user << "You start welding the compressor frame..."
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
if(do_after(user, 50))
|
||||
if(!src || !WT.remove_fuel(3, user)) return
|
||||
new /obj/item/rust_fuel_assembly_port_frame(loc)
|
||||
user.visible_message(\
|
||||
"\red [src] has been cut away from the wall by [user.name].",\
|
||||
"You detached the compressor frame.",\
|
||||
"\red You hear welding.")
|
||||
del(src)
|
||||
return
|
||||
|
||||
..()
|
||||
@@ -1,172 +1,192 @@
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control
|
||||
name = "Fuel Injection Control"
|
||||
icon_state = "power"
|
||||
var/list/fuel_injectors
|
||||
var/list/stage_status
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "fuel"
|
||||
var/list/connected_injectors = list()
|
||||
var/list/active_stages = list()
|
||||
var/list/proceeding_stages = list()
|
||||
var/list/stage_times = list()
|
||||
//var/list/stage_status
|
||||
var/announce_fueldepletion = 0
|
||||
var/announce_stageprogression = 0
|
||||
//var/obj/machinery/rust/fuel_injector/Injector = null
|
||||
New()
|
||||
..()
|
||||
//these are the only three stages we can accept
|
||||
//we have another console for SCRAM
|
||||
fuel_injectors = new/list
|
||||
stage_status = new/list
|
||||
var/scan_range = 25
|
||||
var/ticks_this_stage = 0
|
||||
|
||||
fuel_injectors.Add("One")
|
||||
fuel_injectors["One"] = new/list
|
||||
stage_status.Add("One")
|
||||
stage_status["One"] = 0
|
||||
fuel_injectors.Add("Two")
|
||||
fuel_injectors["Two"] = new/list
|
||||
stage_status.Add("Two")
|
||||
stage_status["Two"] = 0
|
||||
fuel_injectors.Add("Three")
|
||||
fuel_injectors["Three"] = new/list
|
||||
stage_status.Add("Three")
|
||||
stage_status["Three"] = 0
|
||||
fuel_injectors.Add("SCRAM")
|
||||
fuel_injectors["SCRAM"] = new/list
|
||||
stage_status.Add("SCRAM")
|
||||
stage_status["SCRAM"] = 0
|
||||
/*/obj/machinery/computer/rust_fuel_control/New()
|
||||
..()
|
||||
//these are the only three stages we can accept
|
||||
//we have another console for SCRAM
|
||||
fuel_injectors = new/list
|
||||
stage_status = new/list
|
||||
|
||||
spawn(0)
|
||||
for(var/obj/machinery/rust/fuel_injector/Injector in world)
|
||||
if(Injector.stage in fuel_injectors)
|
||||
var/list/targetlist = fuel_injectors[Injector.stage]
|
||||
targetlist.Add(Injector)
|
||||
fuel_injectors.Add("One")
|
||||
fuel_injectors["One"] = new/list
|
||||
stage_status.Add("One")
|
||||
stage_status["One"] = 0
|
||||
fuel_injectors.Add("Two")
|
||||
fuel_injectors["Two"] = new/list
|
||||
stage_status.Add("Two")
|
||||
stage_status["Two"] = 0
|
||||
fuel_injectors.Add("Three")
|
||||
fuel_injectors["Three"] = new/list
|
||||
stage_status.Add("Three")
|
||||
stage_status["Three"] = 0
|
||||
fuel_injectors.Add("SCRAM")
|
||||
fuel_injectors["SCRAM"] = new/list
|
||||
stage_status.Add("SCRAM")
|
||||
stage_status["SCRAM"] = 0
|
||||
|
||||
attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
spawn(0)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/Injector in world)
|
||||
if(Injector.stage in fuel_injectors)
|
||||
var/list/targetlist = fuel_injectors[Injector.stage]
|
||||
targetlist.Add(Injector)*/
|
||||
|
||||
attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
/*if(stat & (BROKEN|NOPOWER))
|
||||
return*/
|
||||
interact(user)
|
||||
/obj/machinery/computer/rust_fuel_control/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/*updateDialog()
|
||||
for(var/mob/M in range(1))
|
||||
if(M.machine == src)
|
||||
interact(m)*/
|
||||
/obj/machinery/computer/rust_fuel_control/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuel_monitor")
|
||||
usr.machine = null
|
||||
return
|
||||
if( href_list["beginstage"] )
|
||||
var/stage_name = href_list["beginstage"]
|
||||
if(stage_name in fuel_injectors)
|
||||
var/success = 1
|
||||
for(var/obj/machinery/rust/fuel_injector/Injector in fuel_injectors[stage_name])
|
||||
if(!Injector.BeginInjecting())
|
||||
success = 0
|
||||
if(!success) //may still partially complete
|
||||
usr << "\red Unable to complete command."
|
||||
stage_status[stage_name] = 1
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["begincool"] )
|
||||
var/stage_name = href_list["begincool"]
|
||||
if(stage_name in fuel_injectors)
|
||||
for(var/obj/machinery/rust/fuel_injector/Injector in fuel_injectors[stage_name])
|
||||
Injector.StopInjecting()
|
||||
stage_status[stage_name] = 0
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["restart"] )
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["cooldown"] )
|
||||
for(var/stage_name in fuel_injectors)
|
||||
for(var/obj/machinery/rust/fuel_injector/Injector in fuel_injectors[stage_name])
|
||||
Injector.StopInjecting()
|
||||
stage_status[stage_name] = 0
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["update"] )
|
||||
updateDialog()
|
||||
return
|
||||
//
|
||||
if( href_list["disable_fueldepletion"] )
|
||||
announce_fueldepletion = 0
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["announce_fueldepletion"] )
|
||||
announce_fueldepletion = 1
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["broadcast_fueldepletion"] )
|
||||
announce_fueldepletion = 2
|
||||
updateDialog()
|
||||
return
|
||||
//
|
||||
if( href_list["disable_stageprogression"] )
|
||||
announce_stageprogression = 0
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["announce_stageprogression"] )
|
||||
announce_stageprogression = 1
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["broadcast_stageprogression"] )
|
||||
announce_stageprogression = 2
|
||||
updateDialog()
|
||||
return
|
||||
/obj/machinery/computer/rust_fuel_control/interact(mob/user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_control")
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
src.updateDialog()
|
||||
if (!istype(user, /mob/living/silicon) && get_dist(src, user) > 1)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_control")
|
||||
return
|
||||
|
||||
interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=fuel_monitor")
|
||||
return
|
||||
var/t = "<B>Reactor Core Fuel Control</B><BR>"
|
||||
var/cooling = 0
|
||||
for(var/stage in stage_status)
|
||||
if(stage_status[stage])
|
||||
t += "Fuel injection: <font color=blue>Active</font><br>"
|
||||
t += "<a href='?src=\ref[src];cooldown=1;'>Enter cooldown phase</a><br>"
|
||||
cooling = 1
|
||||
break
|
||||
if(!cooling)
|
||||
t += "Fuel injection: <font color=blue>Cooling</font><br>"
|
||||
t += "----<br>"
|
||||
//
|
||||
t += "Fuel depletion announcement: "
|
||||
t += "[announce_fueldepletion ? "<a href='?src=\ref[src];disable_fueldepletion=1'>Disable</a>" : "<b>Disabled</b>"] "
|
||||
t += "[announce_fueldepletion == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_fueldepletion=1'>Announce</a>"] "
|
||||
t += "[announce_fueldepletion == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_fueldepletion=1'>Broadcast</a>"]<br>"
|
||||
t += "Stage progression announcement: "
|
||||
t += "[announce_stageprogression ? "<a href='?src=\ref[src];disable_stageprogression=1'>Disable</a>" : "<b>Disabled</b>"] "
|
||||
t += "[announce_stageprogression == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_stageprogression=1'>Announce</a>"] "
|
||||
t += "[announce_stageprogression == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_stageprogression=1'>Broadcast</a>"] "
|
||||
t += "<hr>"
|
||||
t += "<table border=1><tr>"
|
||||
t += "<td><b>Injector Status</b></td>"
|
||||
t += "<td><b>Injection interval (sec)</b></td>"
|
||||
t += "<td><b>Assembly consumption per injection</b></td>"
|
||||
t += "<td><b>Fuel Assembly Port</b></td>"
|
||||
t += "<td><b>Assembly depletion percentage</b></td>"
|
||||
t += "</tr>"
|
||||
for(var/stage_name in fuel_injectors)
|
||||
var/list/cur_stage = fuel_injectors[stage_name]
|
||||
t += "<tr><td colspan=5><b>Fuel Injection Stage:</b> [stage_name]</font>, [stage_status[stage_name] ? "<font color=green>Active</font> <a href='?src=\ref[src];begincool=[stage_name]'>\[Enter cooldown\]</a>" : "Cooling <a href='?src=\ref[src];beginstage=[stage_name]'>\[Begin injection\]</a>"]</td></tr>"
|
||||
for(var/obj/machinery/rust/fuel_injector/Injector in cur_stage)
|
||||
t += "<tr>"
|
||||
t += "<td>[Injector.on && Injector.remote_enabled ? "<font color=green>Operational</font>" : "<font color=red>Unresponsive</font>"]</td>"
|
||||
t += "<td>[Injector.rate/10] <a href='?src=\ref[Injector];cyclerate=1'>Modify</a></td>"
|
||||
t += "<td>[Injector.fuel_usage*100]% <a href='?src=\ref[Injector];fuel_usage=1'>Modify</a></td>"
|
||||
t += "<td>[Injector.owned_assembly_port ? "[Injector.owned_assembly_port.cur_assembly ? "<font color=green>Loaded</font>": "<font color=blue>Empty</font>"]" : "<font color=red>Disconnected</font>" ]</td>"
|
||||
t += "<td>[Injector.owned_assembly_port && Injector.owned_assembly_port.cur_assembly ? "[Injector.owned_assembly_port.cur_assembly.percent_depleted]%" : ""]</td>"
|
||||
t += "</tr>"
|
||||
t += "</table>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=fuel_monitor;size=500x600")
|
||||
user.machine = src
|
||||
var/dat = "<B>Reactor Core Fuel Control</B><BR>"
|
||||
/*dat += "<b>Fuel depletion announcement:</b> "
|
||||
dat += "[announce_fueldepletion == 0 ? "Disabled" : "<a href='?src=\ref[src];announce_fueldepletion=0'>\[Disable\]</a>"] "
|
||||
dat += "[announce_fueldepletion == 1 ? "Announcing" : "<a href='?src=\ref[src];announce_fueldepletion=1'>\[Announce\]</a>"] "
|
||||
dat += "[announce_fueldepletion == 2 ? "Broadcasting" : "<a href='?src=\ref[src];announce_fueldepletion=2'>\[Broadcast\]</a>"]<br>"
|
||||
dat += "<b>Stage progression announcement:</b> "
|
||||
dat += "[announce_stageprogression == 0 ? "Disabled" : "<a href='?src=\ref[src];announce_stageprogression=0'>\[Disable\]</a>"] "
|
||||
dat += "[announce_stageprogression == 1 ? "Announcing" : "<a href='?src=\ref[src];announce_stageprogression=1'>\[Announce\]</a>"] "
|
||||
dat += "[announce_stageprogression == 2 ? "Broadcasting" : "<a href='?src=\ref[src];announce_stageprogression=2'>\[Broadcast\]</a>"]<br>"*/
|
||||
dat += "<hr>"
|
||||
|
||||
dat += "<b>Detected devices</b> <a href='?src=\ref[src];scan=1'>\[Refresh list\]</a>"
|
||||
dat += "<table border=1 width='100%'>"
|
||||
dat += "<tr>"
|
||||
dat += "<td><b>ID</b></td>"
|
||||
dat += "<td><b>Assembly</b></td>"
|
||||
dat += "<td><b>Consumption</b></td>"
|
||||
dat += "<td><b>Depletion</b></td>"
|
||||
dat += "<td><b>Duration</b></td>"
|
||||
dat += "<td><b>Next stage</b></td>"
|
||||
dat += "<td></td>"
|
||||
dat += "<td></td>"
|
||||
dat += "</tr>"
|
||||
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
dat += "<tr>"
|
||||
dat += "<td>[I.id_tag]</td>"
|
||||
if(I.cur_assembly)
|
||||
dat += "<td><a href='?src=\ref[I];toggle_injecting=1;update_extern=\ref[src]'>\[[I.injecting ? "Halt injecting" : "Begin injecting"]\]</a></td>"
|
||||
else
|
||||
dat += "<td>None</td>"
|
||||
dat += "<td>[I.fuel_usage * 100]%</td>"
|
||||
if(I.cur_assembly)
|
||||
dat += "<td>[I.cur_assembly.percent_depleted * 100]%</td>"
|
||||
else
|
||||
dat += "<td>NA</td>"
|
||||
if(stage_times.Find(I.id_tag))
|
||||
dat += "<td>[ticks_this_stage]/[stage_times[I.id_tag]]s <a href='?src=\ref[src];stage_time=[I.id_tag]'>Modify</td>"
|
||||
else
|
||||
dat += "<td>[ticks_this_stage]s <a href='?src=\ref[src];stage_time=[I.id_tag]'>Set</td>"
|
||||
if(proceeding_stages.Find(I.id_tag))
|
||||
dat += "<td><a href='?src=\ref[src];set_next_stage=[I.id_tag]'>[proceeding_stages[I.id_tag]]</a></td>"
|
||||
else
|
||||
dat += "<td>None <a href='?src=\ref[src];set_next_stage=[I.id_tag]'>\[modify\]</a></td>"
|
||||
dat += "<td><a href='?src=\ref[src];toggle_stage=[I.id_tag]'>\[[active_stages.Find(I.id_tag) ? "Deactivate stage" : "Activate stage "] \]</a></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
|
||||
dat += "<hr>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> "
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(dat, "window=fuel_control;size=800x400")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if( href_list["scan"] )
|
||||
connected_injectors = list()
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in range(scan_range, src))
|
||||
if(check_injector_status(I))
|
||||
connected_injectors.Add(I)
|
||||
|
||||
if( href_list["toggle_stage"] )
|
||||
var/cur_stage = href_list["toggle_stage"]
|
||||
if(active_stages.Find(cur_stage))
|
||||
active_stages.Remove(cur_stage)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
if(I.id_tag == cur_stage && check_injector_status(I))
|
||||
I.StopInjecting()
|
||||
else
|
||||
active_stages.Add(cur_stage)
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
if(I.id_tag == cur_stage && check_injector_status(I))
|
||||
I.BeginInjecting()
|
||||
|
||||
if( href_list["cooldown"] )
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
if(check_injector_status(I))
|
||||
I.StopInjecting()
|
||||
active_stages = list()
|
||||
|
||||
if( href_list["warmup"] )
|
||||
for(var/obj/machinery/power/rust_fuel_injector/I in connected_injectors)
|
||||
if(check_injector_status(I))
|
||||
I.BeginInjecting()
|
||||
if(!active_stages.Find(I.id_tag))
|
||||
active_stages.Add(I.id_tag)
|
||||
|
||||
if( href_list["stage_time"] )
|
||||
var/cur_stage = href_list["stage_time"]
|
||||
var/new_duration = input("Enter new stage duration in seconds", "Stage duration") as num
|
||||
if(new_duration)
|
||||
stage_times[cur_stage] = new_duration
|
||||
else if(stage_times.Find(cur_stage))
|
||||
stage_times.Remove(cur_stage)
|
||||
|
||||
if( href_list["announce_fueldepletion"] )
|
||||
announce_fueldepletion = text2num(href_list["announce_fueldepletion"])
|
||||
|
||||
if( href_list["announce_stageprogression"] )
|
||||
announce_stageprogression = text2num(href_list["announce_stageprogression"])
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuel_control")
|
||||
usr.unset_machine()
|
||||
|
||||
if( href_list["set_next_stage"] )
|
||||
var/cur_stage = href_list["set_next_stage"]
|
||||
if(!proceeding_stages.Find(cur_stage))
|
||||
proceeding_stages.Add(cur_stage)
|
||||
var/next_stage = input("Enter next stage ID", "Automated stage procession") as text|null
|
||||
if(next_stage)
|
||||
proceeding_stages[cur_stage] = next_stage
|
||||
else
|
||||
proceeding_stages.Remove(cur_stage)
|
||||
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control/proc/check_injector_status(var/obj/machinery/power/rust_fuel_injector/I)
|
||||
if(!I)
|
||||
return 0
|
||||
|
||||
if(I.stat & (BROKEN|NOPOWER) || !I.remote_access_enabled || !I.id_tag)
|
||||
if(connected_injectors.Find(I))
|
||||
connected_injectors.Remove(I)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
@@ -1,210 +1,289 @@
|
||||
|
||||
/obj/machinery/rust/fuel_injector
|
||||
/obj/machinery/power/rust_fuel_injector
|
||||
name = "Fuel Injector"
|
||||
icon = 'fuel_injector.dmi'
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "injector0"
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/obj/machinery/rust/fuel_assembly_port/owned_assembly_port
|
||||
//var/list/stageone_assemblyports
|
||||
//var/list/stagetwo_assemblyports
|
||||
//var/list/scram_assemblyports
|
||||
var/obj/machinery/rust/reactor_vessel/Vessel = null
|
||||
var/rate = 10 //microseconds between each cycle
|
||||
var/fuel_usage = 0.0001 //percentage of available fuel to use per cycle
|
||||
var/on = 1
|
||||
var/remote_enabled = 1
|
||||
var/state = 0
|
||||
var/locked = 0
|
||||
var/obj/item/weapon/fuel_assembly/cur_assembly
|
||||
var/fuel_usage = 0.0001 //percentage of available fuel to use per cycle
|
||||
var/id_tag = "One"
|
||||
var/injecting = 0
|
||||
var/stage = "One"
|
||||
var/targetting_field = 0
|
||||
layer = 4
|
||||
var/trying_to_swap_fuel = 0
|
||||
//
|
||||
req_access = list(access_engine)
|
||||
//
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 300
|
||||
active_power_usage = 500
|
||||
var/remote_access_enabled = 1
|
||||
var/cached_power_avail = 0
|
||||
var/emergency_insert_ready = 0
|
||||
|
||||
//fuel assembly should be embedded into the wall behind the injector
|
||||
New()
|
||||
..()
|
||||
name = "Stage [stage] Fuel Injector"
|
||||
//pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
|
||||
//pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
|
||||
/*
|
||||
stageone_assemblyports = new/list()
|
||||
stagetwo_assemblyports = new/list()
|
||||
scram_assemblyports = new/list()
|
||||
spawn(1)
|
||||
Vessel = locate() in range(6,src)
|
||||
for(var/obj/machinery/rust/fuel_assembly_port/S in range(6,src))
|
||||
switch(S.stage)
|
||||
if("One")
|
||||
stageone_assemblyports.Add(S)
|
||||
if("Two")
|
||||
stagetwo_assemblyports.Add(S)
|
||||
if("SCRAM")
|
||||
scram_assemblyports.Add(S)
|
||||
*/
|
||||
spawn(1)
|
||||
var/rev_dir = reverse_direction(dir)
|
||||
var/turf/mid = get_step(src, rev_dir)
|
||||
for(var/obj/machinery/rust/fuel_assembly_port/port in get_step(mid, rev_dir))
|
||||
owned_assembly_port = port
|
||||
//
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuel_injector")
|
||||
usr.machine = null
|
||||
return
|
||||
if( href_list["begin_injecting"] )
|
||||
BeginInjecting()
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["end_injecting"] )
|
||||
/obj/machinery/power/rust_fuel_injector/process()
|
||||
if(injecting)
|
||||
if(stat & BROKEN || !powernet)
|
||||
StopInjecting()
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["cyclerate"] )
|
||||
var/new_rate = text2num(input("Enter new injection rate (0.1 - 10 sec)", "Modifying injection rate", rate/10))
|
||||
if(!new_rate)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
new_rate = min(new_rate,0.1)
|
||||
new_rate = max(new_rate,10)
|
||||
rate = new_rate * 10
|
||||
updateDialog()
|
||||
return
|
||||
if( href_list["fuel_usage"] )
|
||||
var/new_rate = text2num(input("Enter new fuel usage (1 - 100%)", "Modifying fuel usage", rate/10))
|
||||
if(!new_rate)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
new_rate = min(new_rate,0.1)
|
||||
new_rate = max(new_rate,10)
|
||||
rate = new_rate * 10
|
||||
updateDialog()
|
||||
return
|
||||
|
||||
attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
/*if(stat & (BROKEN|NOPOWER))
|
||||
return*/
|
||||
interact(user)
|
||||
|
||||
interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=fuel_injector")
|
||||
return
|
||||
var/t = "<B>Reactor Core Fuel Injector</B><hr>"
|
||||
t += "<b>Stage:</b> <font color=blue>[stage]</font><br>"
|
||||
t += "<b>Status:</b> [injecting ? "<font color=green>Active</font> <a href='?src=\ref[src];end_injecting=1'>\[Disable\]</a>" : "<font color=blue>Standby</font> <a href='?src=\ref[src];begin_injecting=1'>\[Enable\]</a>"]<br>"
|
||||
t += "<b>Interval (sec):</b> <font color=blue>[rate/10]</font> <a href='?src=\ref[src];cyclerate=1'>\[Modify\]</a><br>"
|
||||
t += "<b>Fuel usage:</b> [fuel_usage*100]% <a href='?src=\ref[src];fuel_usage=1'>\[Modify\]</a><br>"
|
||||
/*
|
||||
var/t = "<B>Reactor Core Fuel Control</B><BR>"
|
||||
t += "Current fuel injection stage: [active_stage]<br>"
|
||||
if(active_stage == "Cooling")
|
||||
//t += "<a href='?src=\ref[src];restart=1;'>Restart injection cycle</a><br>"
|
||||
t += "----<br>"
|
||||
else
|
||||
t += "<a href='?src=\ref[src];cooldown=1;'>Enter cooldown phase</a><br>"
|
||||
t += "Fuel depletion announcement: "
|
||||
t += "[announce_fueldepletion ? "<a href='?src=\ref[src];disable_fueldepletion=1'>Disable</a>" : "<b>Disabled</b>"] "
|
||||
t += "[announce_fueldepletion == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_fueldepletion=1'>Announce</a>"] "
|
||||
t += "[announce_fueldepletion == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_fueldepletion=1'>Broadcast</a>"]<br>"
|
||||
t += "Stage progression announcement: "
|
||||
t += "[announce_stageprogression ? "<a href='?src=\ref[src];disable_stageprogression=1'>Disable</a>" : "<b>Disabled</b>"] "
|
||||
t += "[announce_stageprogression == 1 ? "<b>Announcing</b>" : "<a href='?src=\ref[src];announce_stageprogression=1'>Announce</a>"] "
|
||||
t += "[announce_stageprogression == 2 ? "<b>Broadcasting</b>" : "<a href='?src=\ref[src];broadcast_stageprogression=1'>Broadcast</a>"] "
|
||||
t += "<hr>"
|
||||
t += "<table border=1><tr>"
|
||||
t += "<td><b>Injector Status</b></td>"
|
||||
t += "<td><b>Injection interval (sec)</b></td>"
|
||||
t += "<td><b>Assembly consumption per injection</b></td>"
|
||||
t += "<td><b>Fuel Assembly Port</b></td>"
|
||||
t += "<td><b>Assembly depletion percentage</b></td>"
|
||||
t += "</tr>"
|
||||
for(var/stage in fuel_injectors)
|
||||
var/list/cur_stage = fuel_injectors[stage]
|
||||
t += "<tr><td colspan=5><b>Fuel Injection Stage:</b> <font color=blue>[stage]</font> [active_stage == stage ? "<font color=green> (Currently active)</font>" : "<a href='?src=\ref[src];beginstage=[stage]'>Activate</a>"]</td></tr>"
|
||||
for(var/obj/machinery/rust/fuel_injector/Injector in cur_stage)
|
||||
t += "<tr>"
|
||||
t += "<td>[Injector.on && Injector.remote_enabled ? "<font color=green>Operational</font>" : "<font color=red>Unresponsive</font>"]</td>"
|
||||
t += "<td>[Injector.rate/10] <a href='?src=\ref[Injector];cyclerate=1'>Modify</a></td>"
|
||||
t += "<td>[Injector.fuel_usage*100]% <a href='?src=\ref[Injector];fuel_usage=1'>Modify</a></td>"
|
||||
t += "<td>[Injector.owned_assembly_port ? "[Injector.owned_assembly_port.cur_assembly ? "<font color=green>Loaded</font>": "<font color=blue>Empty</font>"]" : "<font color=red>Disconnected</font>" ]</td>"
|
||||
t += "<td>[Injector.owned_assembly_port && Injector.owned_assembly_port.cur_assembly ? "[100 - Injector.owned_assembly_port.cur_assembly.amount_depleted*100]%" : ""]</td>"
|
||||
t += "</tr>"
|
||||
t += "</table>"
|
||||
*/
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=fuel_injector;size=500x800")
|
||||
user.machine = src
|
||||
Inject()
|
||||
|
||||
proc/BeginInjecting()
|
||||
if(!injecting && owned_assembly_port && owned_assembly_port.cur_assembly)
|
||||
icon_state = "injector1"
|
||||
injecting = 1
|
||||
spawn(rate)
|
||||
Inject()
|
||||
return 1
|
||||
return 0
|
||||
cached_power_avail = avail()
|
||||
|
||||
proc/StopInjecting()
|
||||
/obj/machinery/power/rust_fuel_injector/attackby(obj/item/W, mob/user)
|
||||
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(injecting)
|
||||
injecting = 0
|
||||
icon_state = "injector0"
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/Inject()
|
||||
if(!injecting)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
if(owned_assembly_port.cur_assembly)
|
||||
var/obj/machinery/rust/em_field/target_field
|
||||
if(targetting_field)
|
||||
for(var/obj/machinery/rust/em_field/field in range(15))
|
||||
target_field = field
|
||||
var/amount_left = 0
|
||||
for(var/reagent in owned_assembly_port.cur_assembly.rod_quantities)
|
||||
//world << "checking [reagent]"
|
||||
if(owned_assembly_port.cur_assembly.rod_quantities[reagent] > 0)
|
||||
//world << " rods left: [owned_assembly_port.cur_assembly.rod_quantities[reagent]]"
|
||||
var/amount = owned_assembly_port.cur_assembly.rod_quantities[reagent] * fuel_usage
|
||||
var/numparticles = round(amount * 1000)
|
||||
if(numparticles < 1)
|
||||
numparticles = 1
|
||||
//world << " amount: [amount]"
|
||||
//world << " numparticles: [numparticles]"
|
||||
//
|
||||
var/obj/effect/accelerated_particle/particle = new/obj/effect/accelerated_particle(src.loc, src.dir)
|
||||
particle.particle_type = reagent
|
||||
particle.energy = 0
|
||||
particle.icon_state = "particle"
|
||||
particle.additional_particles = numparticles - 1
|
||||
particle.target = target_field
|
||||
//
|
||||
owned_assembly_port.cur_assembly.rod_quantities[reagent] -= amount
|
||||
amount_left += owned_assembly_port.cur_assembly.rod_quantities[reagent]
|
||||
owned_assembly_port.cur_assembly.percent_depleted = amount_left / 300
|
||||
flick("injector-emitting",src)
|
||||
use_power(fuel_usage * 10000 + 100) //0.0001
|
||||
if(injecting)
|
||||
spawn(rate)
|
||||
Inject()
|
||||
else
|
||||
injecting = 0
|
||||
switch(state)
|
||||
if(0)
|
||||
state = 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] secures [src.name] to the floor.", \
|
||||
"You secure the external reinforcing bolts to the floor.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 1
|
||||
if(1)
|
||||
state = 0
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
|
||||
"You undo the external reinforcing bolts.", \
|
||||
"You hear a ratchet")
|
||||
src.anchored = 0
|
||||
if(2)
|
||||
user << "\red The [src.name] needs to be unwelded from the floor."
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(injecting)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
user << "\red The [src.name] needs to be wrenched to the floor."
|
||||
if(1)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
|
||||
"You start to weld the [src] to the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 2
|
||||
user << "You weld the [src] to the floor."
|
||||
connect_to_network()
|
||||
src.directwired = 1
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
if(2)
|
||||
if (WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
|
||||
"You start to cut the [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 1
|
||||
user << "You cut the [src] free from the floor."
|
||||
disconnect_from_network()
|
||||
src.directwired = 0
|
||||
else
|
||||
user << "\red You need more welding fuel to complete this task."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
|
||||
if(emagged)
|
||||
user << "\red The lock seems to be broken"
|
||||
return
|
||||
if(src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
locked = 0
|
||||
emagged = 1
|
||||
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/fuel_assembly) && !cur_assembly)
|
||||
if(emergency_insert_ready)
|
||||
cur_assembly = W
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
emergency_insert_ready = 0
|
||||
return
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/interact(mob/user)
|
||||
if(stat & BROKEN)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_injector")
|
||||
return
|
||||
if(get_dist(src, user) > 1 )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=fuel_injector")
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
if (!powernet || locked || state != 2)
|
||||
dat += "<i>The console is dark and nonresponsive.</i>"
|
||||
else
|
||||
dat += "<B>Reactor Core Fuel Injector</B><hr>"
|
||||
dat += "<b>Device ID tag:</b> [id_tag] <a href='?src=\ref[src];modify_tag=1'>\[Modify\]</a><br>"
|
||||
dat += "<b>Status:</b> [injecting ? "<font color=green>Active</font> <a href='?src=\ref[src];toggle_injecting=1'>\[Disable\]</a>" : "<font color=blue>Standby</font> <a href='?src=\ref[src];toggle_injecting=1'>\[Enable\]</a>"]<br>"
|
||||
dat += "<b>Fuel usage:</b> [fuel_usage*100]% <a href='?src=\ref[src];fuel_usage=1'>\[Modify\]</a><br>"
|
||||
dat += "<b>Fuel assembly port:</b> "
|
||||
dat += "<a href='?src=\ref[src];fuel_assembly=1'>\[[cur_assembly ? "Eject assembly to port" : "Draw assembly from port"]\]</a> "
|
||||
if(cur_assembly)
|
||||
dat += "<a href='?src=\ref[src];emergency_fuel_assembly=1'>\[Emergency eject\]</a><br>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];emergency_fuel_assembly=1'>\[[emergency_insert_ready ? "Cancel emergency insertion" : "Emergency insert"]\]</a><br>"
|
||||
var/font_colour = "green"
|
||||
if(cached_power_avail < active_power_usage)
|
||||
font_colour = "red"
|
||||
else if(cached_power_avail < active_power_usage * 2)
|
||||
font_colour = "orange"
|
||||
dat += "<b>Power status:</b> <font color=[font_colour]>[active_power_usage]/[cached_power_avail] W</font><br>"
|
||||
dat += "<a href='?src=\ref[src];toggle_remote=1'>\[[remote_access_enabled ? "Disable remote access" : "Enable remote access"]\]</a><br>"
|
||||
|
||||
dat += "<hr>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> "
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
|
||||
user << browse(dat, "window=fuel_injector;size=500x300")
|
||||
onclose(user, "fuel_injector")
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if( href_list["modify_tag"] )
|
||||
id_tag = input("Enter new ID tag", "Modifying ID tag") as text|null
|
||||
|
||||
if( href_list["fuel_assembly"] )
|
||||
if(!trying_to_swap_fuel)
|
||||
trying_to_swap_fuel = 1
|
||||
spawn(50)
|
||||
attempt_fuel_swap()
|
||||
trying_to_swap_fuel = 0
|
||||
|
||||
if( href_list["emergency_fuel_assembly"] )
|
||||
if(cur_assembly)
|
||||
cur_assembly.loc = src.loc
|
||||
cur_assembly = null
|
||||
//irradiate!
|
||||
else
|
||||
emergency_insert_ready = !emergency_insert_ready
|
||||
|
||||
if( href_list["toggle_injecting"] )
|
||||
if(injecting)
|
||||
StopInjecting()
|
||||
else
|
||||
BeginInjecting()
|
||||
|
||||
if( href_list["toggle_remote"] )
|
||||
remote_access_enabled = !remote_access_enabled
|
||||
|
||||
if( href_list["fuel_usage"] )
|
||||
var/new_usage = text2num(input("Enter new fuel usage (0.01% - 100%)", "Modifying fuel usage", fuel_usage * 100))
|
||||
if(!new_usage)
|
||||
usr << "\red That's not a valid number."
|
||||
return
|
||||
new_usage = max(new_usage, 0.01)
|
||||
new_usage = min(new_usage, 100)
|
||||
fuel_usage = new_usage / 100
|
||||
active_power_usage = 500 + 1000 * fuel_usage
|
||||
|
||||
if( href_list["update_extern"] )
|
||||
var/obj/machinery/computer/rust_fuel_control/C = locate(href_list["update_extern"])
|
||||
if(C)
|
||||
C.updateDialog()
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuel_injector")
|
||||
usr.unset_machine()
|
||||
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/proc/BeginInjecting()
|
||||
if(!injecting && cur_assembly)
|
||||
icon_state = "injector1"
|
||||
injecting = 1
|
||||
use_power = 1
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/proc/StopInjecting()
|
||||
if(injecting)
|
||||
injecting = 0
|
||||
icon_state = "injector0"
|
||||
use_power = 0
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/proc/Inject()
|
||||
if(!injecting)
|
||||
return
|
||||
if(cur_assembly)
|
||||
var/amount_left = 0
|
||||
for(var/reagent in cur_assembly.rod_quantities)
|
||||
//world << "checking [reagent]"
|
||||
if(cur_assembly.rod_quantities[reagent] > 0)
|
||||
//world << " rods left: [cur_assembly.rod_quantities[reagent]]"
|
||||
var/amount = cur_assembly.rod_quantities[reagent] * fuel_usage
|
||||
var/numparticles = round(amount * 1000)
|
||||
if(numparticles < 1)
|
||||
numparticles = 1
|
||||
//world << " amount: [amount]"
|
||||
//world << " numparticles: [numparticles]"
|
||||
//
|
||||
|
||||
var/obj/effect/accelerated_particle/A = new/obj/effect/accelerated_particle(get_turf(src), dir)
|
||||
A.particle_type = reagent
|
||||
A.additional_particles = numparticles - 1
|
||||
//A.target = target_field
|
||||
//
|
||||
cur_assembly.rod_quantities[reagent] -= amount
|
||||
amount_left += cur_assembly.rod_quantities[reagent]
|
||||
cur_assembly.percent_depleted = amount_left / 300
|
||||
flick("injector-emitting",src)
|
||||
else
|
||||
StopInjecting()
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/proc/attempt_fuel_swap()
|
||||
var/rev_dir = reverse_direction(dir)
|
||||
var/turf/mid = get_step(src, rev_dir)
|
||||
var/success = 0
|
||||
for(var/obj/machinery/rust_fuel_assembly_port/check_port in get_step(mid, rev_dir))
|
||||
if(cur_assembly)
|
||||
if(!check_port.cur_assembly)
|
||||
check_port.cur_assembly = cur_assembly
|
||||
cur_assembly.loc = check_port
|
||||
cur_assembly = null
|
||||
check_port.icon_state = "port1"
|
||||
success = 1
|
||||
else
|
||||
if(check_port.cur_assembly)
|
||||
cur_assembly = check_port.cur_assembly
|
||||
cur_assembly.loc = src
|
||||
check_port.cur_assembly = null
|
||||
check_port.icon_state = "port0"
|
||||
success = 1
|
||||
|
||||
break
|
||||
if(success)
|
||||
src.visible_message("\blue \icon[src] a green light flashes on [src].")
|
||||
updateDialog()
|
||||
//
|
||||
else
|
||||
src.visible_message("\red \icon[src] a red light flashes on [src].")
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB |
@@ -3,7 +3,7 @@
|
||||
/obj/item/projectile/beam/ehf_beam
|
||||
|
||||
/obj/machinery/rust/gyrotron
|
||||
icon = 'gyrotron.dmi'
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "emitter-off"
|
||||
name = "Gyrotron"
|
||||
anchored = 1
|
||||
|
||||
|
Before Width: | Height: | Size: 6.0 KiB |
@@ -1,7 +1,8 @@
|
||||
|
||||
/obj/machinery/computer/rust_gyrotron_controller
|
||||
name = "Gyrotron Remote Controller"
|
||||
icon_state = "power"
|
||||
icon = 'code/WorkInProgress/Cael_Aislinn/Rust/rust.dmi'
|
||||
icon_state = "engine"
|
||||
var/updating = 1
|
||||
|
||||
New()
|
||||
|
||||
@@ -67,4 +67,8 @@
|
||||
//particle.invisibility = 2
|
||||
//
|
||||
return particle
|
||||
*/
|
||||
*/
|
||||
|
||||
/obj/machinery/computer/rust_radiation_monitor
|
||||
name = "Radiation Monitor"
|
||||
icon_state = "power"
|
||||
|
||||
|
Before Width: | Height: | Size: 617 B After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 492 B |
@@ -1,49 +1,53 @@
|
||||
|
||||
//gimmicky hack to collect particles and direct them into the field
|
||||
//byond multitiles are basically... shit
|
||||
/obj/machinery/rust/particle_catcher
|
||||
invisibility = 101
|
||||
/obj/effect/rust_particle_catcher
|
||||
icon = 'effects.dmi'
|
||||
icon_state = "energynet"
|
||||
density = 0
|
||||
anchored = 1
|
||||
var/obj/machinery/rust/em_field/parent
|
||||
invisibility = 101
|
||||
layer = 4
|
||||
var/obj/effect/rust_em_field/parent
|
||||
var/mysize = 0
|
||||
|
||||
/*New()
|
||||
for(var/obj/machinery/rust/em_field/field in range(6))
|
||||
parent = field
|
||||
if(!parent)
|
||||
del(src)*/
|
||||
/*/obj/effect/rust_particle_catcher/New()
|
||||
for(var/obj/machinery/rust/em_field/field in range(6))
|
||||
parent = field
|
||||
if(!parent)
|
||||
del(src)*/
|
||||
|
||||
proc/SetSize(var/newsize)
|
||||
name = "collector [newsize]"
|
||||
mysize = newsize
|
||||
UpdateSize()
|
||||
/obj/effect/rust_particle_catcher/process()
|
||||
if(!parent)
|
||||
del(src)
|
||||
|
||||
proc/AddParticles(var/name, var/quantity = 1)
|
||||
if(parent && parent.size >= mysize)
|
||||
parent.AddParticles(name, quantity)
|
||||
return 1
|
||||
return 0
|
||||
/obj/effect/rust_particle_catcher/proc/SetSize(var/newsize)
|
||||
name = "collector [newsize]"
|
||||
mysize = newsize
|
||||
UpdateSize()
|
||||
|
||||
proc/UpdateSize()
|
||||
if(parent.size >= mysize)
|
||||
density = 1
|
||||
//invisibility = 101
|
||||
name = "collector [mysize] ON"
|
||||
else
|
||||
density = 0
|
||||
name = "collector [mysize] OFF"
|
||||
//invisibility = 101
|
||||
/obj/effect/rust_particle_catcher/proc/AddParticles(var/name, var/quantity = 1)
|
||||
if(parent && parent.size >= mysize)
|
||||
parent.AddParticles(name, quantity)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet" && parent)
|
||||
var/obj/item/projectile/beam/laserbeam = Proj
|
||||
parent.AddEnergy(0, laserbeam.damage / 5000, laserbeam.frequency)
|
||||
return 0
|
||||
/obj/effect/rust_particle_catcher/proc/UpdateSize()
|
||||
if(parent.size >= mysize)
|
||||
density = 1
|
||||
invisibility = 0
|
||||
name = "collector [mysize] ON"
|
||||
else
|
||||
density = 0
|
||||
invisibility = 101
|
||||
name = "collector [mysize] OFF"
|
||||
|
||||
process()
|
||||
..()
|
||||
if(!parent)
|
||||
del(src)
|
||||
/obj/effect/rust_particle_catcher/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet" && parent)
|
||||
parent.AddEnergy(Proj.damage, 0, 1)
|
||||
update_icon()
|
||||
return 0
|
||||
|
||||
/obj/effect/rust_particle_catcher/Bumped(atom/AM)
|
||||
if(ismob(AM) && density && prob(10))
|
||||
AM << "\red A powerful force pushes you back."
|
||||
..()
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
|
||||
////////////////////////////////////////
|
||||
// Shield Generator
|
||||
|
||||
/obj/item/weapon/circuitboard/shield_gen
|
||||
name = "Circuit board (Experimental shield generator)"
|
||||
board_type = "machine"
|
||||
build_path = "/obj/machinery/shield_gen/external"
|
||||
origin_tech = "bluespace=4;plasmatech=3"
|
||||
frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Transmitter, 5 Pieces of cable, 1 Subspace Crystal, 1 Subspace Amplifier and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
|
||||
"/obj/item/weapon/stock_parts/subspace/transmitter" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/crystal" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/amplifier" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/weapon/cable_coil" = 5)
|
||||
|
||||
datum/design/shield_gen
|
||||
name = "Circuit Design (Experimental hull shield generator)"
|
||||
desc = "Allows for the construction of circuit boards used to build an experimental hull shield generator."
|
||||
id = "shield_gen"
|
||||
req_tech = list("bluespace" = 4, "plasmatech" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$gold" = 10000)
|
||||
build_path = "/obj/machinery/shield_gen/external"
|
||||
|
||||
////////////////////////////////////////
|
||||
// Shield Capacitor
|
||||
|
||||
/obj/item/weapon/circuitboard/shield_cap
|
||||
name = "Circuit board (Experimental shield capacitor)"
|
||||
board_type = "machine"
|
||||
build_path = "/obj/machinery/shield_capacitor"
|
||||
origin_tech = "magnets=3;powerstorage=4"
|
||||
frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Filter, 5 Pieces of cable, 1 Subspace Treatment disk, 1 Subspace Analyzer and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
|
||||
"/obj/item/weapon/stock_parts/subspace/filter" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/treatment" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/analyzer" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/weapon/cable_coil" = 5)
|
||||
|
||||
datum/design/shield_cap
|
||||
name = "Circuit Design (Experimental shield capacitor)"
|
||||
desc = "Allows for the construction of circuit boards used to build an experimental shielding capacitor."
|
||||
id = "shield_cap"
|
||||
req_tech = list("magnets" = 3, "powerstorage" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$plasma" = 10000, "$diamond" = 5000, "$silver" = 10000)
|
||||
build_path = "/obj/machinery/shield_gen/external"
|
||||
@@ -1,52 +1,52 @@
|
||||
|
||||
//---------- actual energy field
|
||||
|
||||
/obj/effect/energy_field
|
||||
name = "energy field"
|
||||
desc = "Impenetrable field of energy, capable of blocking anything as long as it's active."
|
||||
icon = 'shielding.dmi'
|
||||
icon_state = "shieldsparkles"
|
||||
anchored = 1
|
||||
layer = 2.1
|
||||
density = 0
|
||||
invisibility = 2
|
||||
var/strength = 0
|
||||
var/obj/machinery/shield_gen/parent
|
||||
var/stress = 0
|
||||
|
||||
/obj/effect/energy_field/ex_act(var/severity)
|
||||
Stress(0.5 + severity)
|
||||
|
||||
/obj/effect/energy_field/bullet_act(var/obj/item/projectile/Proj)
|
||||
Stress(1 + 1 * (Proj.damage / 100))
|
||||
|
||||
|
||||
/obj/effect/energy_field/meteorhit(obj/effect/meteor/M as obj)
|
||||
if(M)
|
||||
walk(M,0)
|
||||
|
||||
/obj/effect/energy_field/proc/Stress(var/severity)
|
||||
strength -= severity
|
||||
stress += severity
|
||||
|
||||
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
|
||||
if(strength < 1)
|
||||
invisibility = 2
|
||||
density = 0
|
||||
|
||||
/obj/effect/energy_field/proc/Strengthen(var/severity)
|
||||
strength += severity
|
||||
|
||||
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
|
||||
if(strength > 1)
|
||||
invisibility = 0
|
||||
density = 1
|
||||
|
||||
/obj/effect/energy_field/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||
//Purpose: Determines if the object (or airflow) can pass this atom.
|
||||
//Called by: Movement, airflow.
|
||||
//Inputs: The moving atom (optional), target turf, "height" and air group
|
||||
//Outputs: Boolean if can pass.
|
||||
|
||||
//return (!density || !height || air_group)
|
||||
return density
|
||||
|
||||
//---------- actual energy field
|
||||
|
||||
/obj/effect/energy_field
|
||||
name = "energy field"
|
||||
desc = "Impenetrable field of energy, capable of blocking anything as long as it's active."
|
||||
icon = 'shielding.dmi'
|
||||
icon_state = "shieldsparkles"
|
||||
anchored = 1
|
||||
layer = 2.1
|
||||
density = 0
|
||||
invisibility = 2
|
||||
var/strength = 0
|
||||
var/obj/machinery/shield_gen/parent
|
||||
var/stress = 0
|
||||
|
||||
/obj/effect/energy_field/ex_act(var/severity)
|
||||
Stress(0.5 + severity)
|
||||
|
||||
/obj/effect/energy_field/bullet_act(var/obj/item/projectile/Proj)
|
||||
Stress(1 + 1 * (Proj.damage / 100))
|
||||
|
||||
|
||||
/obj/effect/energy_field/meteorhit(obj/effect/meteor/M as obj)
|
||||
if(M)
|
||||
walk(M,0)
|
||||
|
||||
/obj/effect/energy_field/proc/Stress(var/severity)
|
||||
strength -= severity
|
||||
stress += severity
|
||||
|
||||
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
|
||||
if(strength < 1)
|
||||
invisibility = 2
|
||||
density = 0
|
||||
|
||||
/obj/effect/energy_field/proc/Strengthen(var/severity)
|
||||
strength += severity
|
||||
|
||||
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
|
||||
if(strength > 1)
|
||||
invisibility = 0
|
||||
density = 1
|
||||
|
||||
/obj/effect/energy_field/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||
//Purpose: Determines if the object (or airflow) can pass this atom.
|
||||
//Called by: Movement, airflow.
|
||||
//Inputs: The moving atom (optional), target turf, "height" and air group
|
||||
//Outputs: Boolean if can pass.
|
||||
|
||||
//return (!density || !height || air_group)
|
||||
return density
|
||||
@@ -1,36 +1,36 @@
|
||||
|
||||
//---------- external shield generator
|
||||
//generates an energy field that loops around any built up area in space (is useless inside) halts movement and airflow, is blocked by walls, windows, airlocks etc
|
||||
|
||||
/obj/machinery/shield_gen/external/New()
|
||||
..()
|
||||
|
||||
/obj/machinery/shield_gen/external/get_shielded_turfs()
|
||||
var
|
||||
list
|
||||
open = list(get_turf(src))
|
||||
closed = list()
|
||||
|
||||
while(open.len)
|
||||
for(var/turf/T in open)
|
||||
for(var/turf/O in orange(1, T))
|
||||
if(get_dist(O,src) > field_radius)
|
||||
continue
|
||||
var/add_this_turf = 0
|
||||
if(istype(O,/turf/space))
|
||||
for(var/turf/simulated/G in orange(1, O))
|
||||
add_this_turf = 1
|
||||
break
|
||||
for(var/obj/structure/S in orange(1, O))
|
||||
add_this_turf = 1
|
||||
break
|
||||
for(var/obj/structure/S in O)
|
||||
add_this_turf = 0
|
||||
break
|
||||
|
||||
if(add_this_turf && !(O in open) && !(O in closed))
|
||||
open += O
|
||||
open -= T
|
||||
closed += T
|
||||
|
||||
return closed
|
||||
|
||||
//---------- external shield generator
|
||||
//generates an energy field that loops around any built up area in space (is useless inside) halts movement and airflow, is blocked by walls, windows, airlocks etc
|
||||
|
||||
/obj/machinery/shield_gen/external/New()
|
||||
..()
|
||||
|
||||
/obj/machinery/shield_gen/external/get_shielded_turfs()
|
||||
var
|
||||
list
|
||||
open = list(get_turf(src))
|
||||
closed = list()
|
||||
|
||||
while(open.len)
|
||||
for(var/turf/T in open)
|
||||
for(var/turf/O in orange(1, T))
|
||||
if(get_dist(O,src) > field_radius)
|
||||
continue
|
||||
var/add_this_turf = 0
|
||||
if(istype(O,/turf/space))
|
||||
for(var/turf/simulated/G in orange(1, O))
|
||||
add_this_turf = 1
|
||||
break
|
||||
for(var/obj/structure/S in orange(1, O))
|
||||
add_this_turf = 1
|
||||
break
|
||||
for(var/obj/structure/S in O)
|
||||
add_this_turf = 0
|
||||
break
|
||||
|
||||
if(add_this_turf && !(O in open) && !(O in closed))
|
||||
open += O
|
||||
open -= T
|
||||
closed += T
|
||||
|
||||
return closed
|
||||
@@ -1,158 +1,159 @@
|
||||
|
||||
//---------- shield capacitor
|
||||
//pulls energy out of a power net and charges an adjacent generator
|
||||
|
||||
/obj/machinery/shield_capacitor
|
||||
name = "shield capacitor"
|
||||
desc = "Machine that charges a shield generator."
|
||||
icon = 'shielding.dmi'
|
||||
icon_state = "capacitor"
|
||||
var/active = 1
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/shield_gen/target_generator
|
||||
var/stored_charge = 0
|
||||
var/time_since_fail = 100
|
||||
var/max_charge = 1000000
|
||||
var/max_charge_rate = 100000
|
||||
var/min_charge_rate = 0
|
||||
var/locked = 0
|
||||
//
|
||||
use_power = 1 //0 use nothing
|
||||
//1 use idle power
|
||||
//2 use active power
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
var/charge_rate = 100
|
||||
|
||||
/obj/machinery/shield_capacitor/New()
|
||||
spawn(10)
|
||||
for(var/obj/machinery/shield_gen/possible_gen in range(1, src))
|
||||
if(get_dir(src, possible_gen) == src.dir)
|
||||
target_generator = possible_gen
|
||||
possible_gen.owned_capacitor = src
|
||||
break
|
||||
..()
|
||||
|
||||
/obj/machinery/shield_capacitor/verb/rotate()
|
||||
set name = "Rotate Clockwise"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if (src.anchored || usr:stat)
|
||||
usr << "It is fastened to the floor!"
|
||||
return 0
|
||||
src.dir = turn(src.dir, 270)
|
||||
target_generator = locate() in get_step(src,dir)
|
||||
if(target_generator && !target_generator.owned_capacitor)
|
||||
target_generator.owned_capacitor = src
|
||||
return 1
|
||||
|
||||
/obj/machinery/shield_capacitor/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broke"
|
||||
else
|
||||
if( powered() )
|
||||
if (src.active)
|
||||
icon_state = "capacitor"
|
||||
else
|
||||
icon_state = "capacitor"
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "capacitor"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/shield_capacitor/process()
|
||||
//
|
||||
if(active)
|
||||
use_power = 2
|
||||
if(stored_charge + charge_rate > max_charge)
|
||||
active_power_usage = max_charge - stored_charge
|
||||
else
|
||||
active_power_usage = charge_rate
|
||||
stored_charge += active_power_usage
|
||||
else
|
||||
use_power = 1
|
||||
|
||||
time_since_fail++
|
||||
if(stored_charge < active_power_usage * 1.5)
|
||||
time_since_fail = 0
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_capacitor/attackby(obj/item/W, mob/user)
|
||||
/*if(istype(W, /obj/item/weapon/wrench))
|
||||
if(active)
|
||||
user << "Turn off the field generator first."
|
||||
return
|
||||
|
||||
else if(state == 0)
|
||||
state = 1
|
||||
playsound(src.loc, 'Ratchet.ogg', 75, 1)
|
||||
user << "You secure the external reinforcing bolts to the floor."
|
||||
src.anchored = 1
|
||||
return
|
||||
|
||||
else if(state == 1)
|
||||
state = 0
|
||||
playsound(src.loc, 'Ratchet.ogg', 75, 1)
|
||||
user << "You undo the external reinforcing bolts."
|
||||
src.anchored = 0
|
||||
return*/
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if (src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
src.anchored = !src.anchored
|
||||
src.visible_message("\blue \icon[src] [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].")
|
||||
|
||||
else
|
||||
src.add_fingerprint(user)
|
||||
user << "\red You hit the [src.name] with your [W.name]!"
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user) continue
|
||||
M.show_message("\red The [src.name] has been hit with the [W.name] by [user.name]!")
|
||||
|
||||
/obj/machinery/shield_capacitor/Topic(href, href_list[])
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=shield_capacitor")
|
||||
usr.machine = null
|
||||
return
|
||||
if( href_list["toggle"] )
|
||||
active = !active
|
||||
if(active)
|
||||
use_power = 2
|
||||
else
|
||||
use_power = 1
|
||||
if( href_list["charge_rate"] )
|
||||
charge_rate += text2num(href_list["charge_rate"])
|
||||
if(charge_rate > max_charge_rate)
|
||||
charge_rate = max_charge_rate
|
||||
else if(charge_rate < min_charge_rate)
|
||||
charge_rate = min_charge_rate
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_capacitor/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=shield_capacitor")
|
||||
return
|
||||
var/t = "<B>Shield Capacitor Control Console</B><BR>"
|
||||
t += "[target_generator ? "<font color=green>Shield generator connected.</font>" : "<font color=red>Unable to locate shield generator!</font>"]<br>"
|
||||
t += "This capacitor is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
|
||||
t += "[time_since_fail > 2 ? "<font color=green>Charging stable.</font>" : "<font color=red>Warning, low charge!</font>"]<br>"
|
||||
t += "Capacitor charge: [stored_charge] Watts ([100 * stored_charge/max_charge]%)<br>"
|
||||
t += "Capacitor charge rate (approx): <a href='?src=\ref[src];charge_rate=[-max_charge_rate]'>\[min\]</a> <a href='?src=\ref[src];charge_rate=-1000'>\[--\]</a> <a href='?src=\ref[src];charge_rate=-100'>\[-\]</a>[charge_rate] Watts/sec <a href='?src=\ref[src];charge_rate=100'>\[+\]</a> <a href='?src=\ref[src];charge_rate=1000'>\[++\]</a> <a href='?src=\ref[src];charge_rate=[max_charge_rate]'>\[max\]</a><br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=shield_capacitor;size=500x800")
|
||||
user.machine = src
|
||||
|
||||
//---------- shield capacitor
|
||||
//pulls energy out of a power net and charges an adjacent generator
|
||||
|
||||
/obj/machinery/shield_capacitor
|
||||
name = "shield capacitor"
|
||||
desc = "Machine that charges a shield generator."
|
||||
icon = 'shielding.dmi'
|
||||
icon_state = "capacitor"
|
||||
var/active = 1
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/shield_gen/target_generator
|
||||
var/stored_charge = 0
|
||||
var/time_since_fail = 100
|
||||
var/max_charge = 1000000
|
||||
var/max_charge_rate = 100000
|
||||
var/min_charge_rate = 0
|
||||
var/locked = 0
|
||||
//
|
||||
use_power = 1 //0 use nothing
|
||||
//1 use idle power
|
||||
//2 use active power
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
var/charge_rate = 100
|
||||
|
||||
/obj/machinery/shield_capacitor/New()
|
||||
spawn(10)
|
||||
for(var/obj/machinery/shield_gen/possible_gen in range(1, src))
|
||||
if(get_dir(src, possible_gen) == src.dir)
|
||||
target_generator = possible_gen
|
||||
possible_gen.owned_capacitor = src
|
||||
break
|
||||
..()
|
||||
|
||||
/obj/machinery/shield_capacitor/verb/rotate()
|
||||
set name = "Rotate Clockwise"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if (src.anchored || usr:stat)
|
||||
usr << "It is fastened to the floor!"
|
||||
return 0
|
||||
src.dir = turn(src.dir, 270)
|
||||
target_generator = locate() in get_step(src,dir)
|
||||
if(target_generator && !target_generator.owned_capacitor)
|
||||
target_generator.owned_capacitor = src
|
||||
return 1
|
||||
|
||||
/obj/machinery/shield_capacitor/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broke"
|
||||
else
|
||||
if( powered() )
|
||||
if (src.active)
|
||||
icon_state = "capacitor"
|
||||
else
|
||||
icon_state = "capacitor"
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "capacitor"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/shield_capacitor/process()
|
||||
//
|
||||
if(active)
|
||||
use_power = 2
|
||||
if(stored_charge + charge_rate > max_charge)
|
||||
active_power_usage = max_charge - stored_charge
|
||||
else
|
||||
active_power_usage = charge_rate
|
||||
stored_charge += active_power_usage
|
||||
else
|
||||
use_power = 1
|
||||
|
||||
time_since_fail++
|
||||
if(stored_charge < active_power_usage * 1.5)
|
||||
time_since_fail = 0
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_capacitor/attackby(obj/item/W, mob/user)
|
||||
/*if(istype(W, /obj/item/weapon/wrench))
|
||||
if(active)
|
||||
user << "Turn off the field generator first."
|
||||
return
|
||||
|
||||
else if(state == 0)
|
||||
state = 1
|
||||
playsound(src.loc, 'Ratchet.ogg', 75, 1)
|
||||
user << "You secure the external reinforcing bolts to the floor."
|
||||
src.anchored = 1
|
||||
return
|
||||
|
||||
else if(state == 1)
|
||||
state = 0
|
||||
playsound(src.loc, 'Ratchet.ogg', 75, 1)
|
||||
user << "You undo the external reinforcing bolts."
|
||||
src.anchored = 0
|
||||
return*/
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if (src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
src.anchored = !src.anchored
|
||||
src.visible_message("\blue \icon[src] [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].")
|
||||
|
||||
else
|
||||
src.add_fingerprint(user)
|
||||
user << "\red You hit the [src.name] with your [W.name]!"
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user) continue
|
||||
M.show_message("\red The [src.name] has been hit with the [W.name] by [user.name]!")
|
||||
|
||||
/obj/machinery/shield_capacitor/Topic(href, href_list[])
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=shield_capacitor")
|
||||
usr.machine = null
|
||||
return
|
||||
if( href_list["toggle"] )
|
||||
active = !active
|
||||
if(active)
|
||||
use_power = 2
|
||||
else
|
||||
use_power = 1
|
||||
if( href_list["charge_rate"] )
|
||||
charge_rate += text2num(href_list["charge_rate"])
|
||||
if(charge_rate > max_charge_rate)
|
||||
charge_rate = max_charge_rate
|
||||
else if(charge_rate < min_charge_rate)
|
||||
charge_rate = min_charge_rate
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_capacitor/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=shield_capacitor")
|
||||
return
|
||||
var/t = "<B>Shield Capacitor Control Console</B><BR>"
|
||||
t += "[target_generator ? "<font color=green>Shield generator connected.</font>" : "<font color=red>Unable to locate shield generator!</font>"]<br>"
|
||||
t += "This capacitor is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
|
||||
t += "[time_since_fail > 2 ? "<font color=green>Charging stable.</font>" : "<font color=red>Warning, low charge!</font>"]<br>"
|
||||
t += "Capacitor charge: [stored_charge] Watts ([100 * stored_charge/max_charge]%)<br>"
|
||||
t += "Capacitor charge rate (approx): <a href='?src=\ref[src];charge_rate=[-max_charge_rate]'>\[min\]</a> <a href='?src=\ref[src];charge_rate=-1000'>\[--\]</a> <a href='?src=\ref[src];charge_rate=-100'>\[-\]</a>[charge_rate] Watts/sec <a href='?src=\ref[src];charge_rate=100'>\[+\]</a> <a href='?src=\ref[src];charge_rate=1000'>\[++\]</a> <a href='?src=\ref[src];charge_rate=[max_charge_rate]'>\[max\]</a><br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
|
||||
user << browse(t, "window=shield_capacitor;size=500x800")
|
||||
user.machine = src
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -24,13 +24,18 @@
|
||||
side_effects += M
|
||||
|
||||
/mob/living/carbon/human/proc/handle_medical_side_effects()
|
||||
if(src.reagents.has_reagent("bicaridine") && prob(40) || src.reagents.has_reagent("tricordrazine") && prob(10) || src.reagents.has_reagent("cryoxadone") && prob(20))
|
||||
if(src.reagents.has_reagent("cryoxadone") || src.reagents.get_reagent_amount("bicaridine") >= 15 || src.reagents.get_reagent_amount("tricordrazine") >= 15)
|
||||
src.add_side_effect("Headache")
|
||||
|
||||
|
||||
if(src.reagents.has_reagent("kelotane") && prob(20) || src.reagents.has_reagent("dermaline") && prob(40))
|
||||
if(src.reagents.get_reagent_amount("kelotane") >= 30 || src.reagents.get_reagent_amount("dermaline") >= 15)
|
||||
src.add_side_effect("Bad Stomach")
|
||||
|
||||
if(src.reagents.get_reagent_amount("tramadol") >= 16 || src.reagents.get_reagent_amount("anti_toxin") >= 30)
|
||||
src.add_side_effect("Cramps")
|
||||
|
||||
if(src.reagents.get_reagent_amount("space_drugs") >= 10)
|
||||
src.add_side_effect("Itch")
|
||||
|
||||
// One full cycle(in terms of strength) every 10 minutes
|
||||
var/strength_percent = sin(life_tick / 2)
|
||||
|
||||
|
||||
@@ -63,8 +63,8 @@
|
||||
|
||||
var/server
|
||||
var/banappeals
|
||||
var/wikiurl
|
||||
var/forumurl
|
||||
var/wikiurl = "http://baystation12.net/wiki/index.php?title=Main_Page"
|
||||
var/forumurl = "http://baystation12.net/forums/"
|
||||
|
||||
//Alert level description
|
||||
var/alert_desc_green = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced."
|
||||
|
||||
@@ -849,3 +849,48 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
containertype = /obj/structure/closet
|
||||
containername = "Formalwear for the best occasions."
|
||||
group = "Operations"
|
||||
|
||||
/datum/supply_packs/rust_injector
|
||||
contains = list(/obj/machinery/power/rust_fuel_injector)
|
||||
name = "RUST fuel injector"
|
||||
cost = 50
|
||||
containertype = /obj/structure/largecrate
|
||||
containername = "RUST injector crate"
|
||||
group = "Engineering"
|
||||
access = access_engine
|
||||
|
||||
/datum/supply_packs/rust_compressor
|
||||
contains = list(/obj/item/weapon/module/rust_fuel_compressor)
|
||||
name = "RUST fuel compressor circuitry"
|
||||
cost = 60
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "RUST fuel compressor circuitry"
|
||||
group = "Engineering"
|
||||
access = access_engine
|
||||
|
||||
/datum/supply_packs/rust_core
|
||||
contains = list(/obj/machinery/power/rust_core)
|
||||
name = "RUST Tokamak Core"
|
||||
cost = 75
|
||||
containertype = /obj/structure/largecrate
|
||||
containername = "RUST tokamak crate"
|
||||
group = "Engineering"
|
||||
access = access_engine
|
||||
|
||||
/datum/supply_packs/shield_gen
|
||||
contains = list(/obj/item/weapon/circuitboard/shield_gen)
|
||||
name = "Experimental shield generator circuitry"
|
||||
cost = 50
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "Experimental shield generator"
|
||||
group = "Engineering"
|
||||
access = access_ce
|
||||
|
||||
/datum/supply_packs/shield_cap
|
||||
contains = list(/obj/item/weapon/circuitboard/shield_cap)
|
||||
name = "Experimental shield capacitor circuitry"
|
||||
cost = 50
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "Experimental shield capacitor"
|
||||
group = "Engineering"
|
||||
access = access_ce
|
||||
|
||||
@@ -73,6 +73,8 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \
|
||||
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("Metal crate", /obj/structure/closet/crate, 10, 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), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/plasteel
|
||||
|
||||
@@ -265,6 +265,16 @@
|
||||
AH.try_build(src)
|
||||
return
|
||||
|
||||
else if(istype(W,/obj/item/rust_fuel_compressor_frame))
|
||||
var/obj/item/rust_fuel_compressor_frame/AH = W
|
||||
AH.try_build(src)
|
||||
return
|
||||
|
||||
else if(istype(W,/obj/item/rust_fuel_assembly_port_frame))
|
||||
var/obj/item/rust_fuel_assembly_port_frame/AH = W
|
||||
AH.try_build(src)
|
||||
return
|
||||
|
||||
//Poster stuff
|
||||
else if(istype(W,/obj/item/weapon/contraband/poster))
|
||||
place_poster(W,user)
|
||||
|
||||
@@ -41,22 +41,25 @@ var/global/normal_ooc_colour = "#002eb8"
|
||||
|
||||
log_ooc("[mob.name]/[key] : [msg]")
|
||||
|
||||
var/display_colour = normal_ooc_colour
|
||||
if(holder && !holder.fakekey)
|
||||
display_colour = "#0099cc" //light blue
|
||||
if(holder.rights & R_MOD)
|
||||
display_colour = "#184880" //dark blue
|
||||
else if(holder.rights & R_ADMIN)
|
||||
if(config.allow_admin_ooccolor)
|
||||
display_colour = src.prefs.ooccolor
|
||||
else
|
||||
display_colour = "#b82e00" //orange
|
||||
|
||||
for(var/client/C in clients)
|
||||
if(C.prefs.toggles & CHAT_OOC)
|
||||
var/display_name = src.key
|
||||
var/display_colour = normal_ooc_colour
|
||||
|
||||
if(holder)
|
||||
if(holder.fakekey)
|
||||
if(C.holder)
|
||||
display_name = "[holder.fakekey]/([src.key])"
|
||||
else
|
||||
display_name = holder.fakekey
|
||||
else if(config.allow_admin_ooccolor)
|
||||
display_colour = src.prefs.ooccolor
|
||||
if(holder.fakekey)
|
||||
if(C.holder)
|
||||
display_name = "[holder.fakekey]/([src.key])"
|
||||
else
|
||||
display_colour = "#b82e00"
|
||||
|
||||
display_name = holder.fakekey
|
||||
C << "<font color='[display_colour]'><span class='ooc'><span class='prefix'>OOC:</span> <EM>[display_name]:</EM> <span class='message'>[msg]</span></span></font>"
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
oneShot = 1
|
||||
|
||||
var/list/obj/machinery/vending/vendingMachines = list()
|
||||
var/list/obj/machinery/vending/infectedVendingMachines = list()
|
||||
var/obj/machinery/vending/originMachine
|
||||
|
||||
|
||||
@@ -28,20 +29,29 @@
|
||||
|
||||
/datum/event/brand_intelligence/tick()
|
||||
if(!vendingMachines.len || !originMachine || originMachine.shut_up) //if every machine is infected, or if the original vending machine is missing or has it's voice switch flipped
|
||||
end()
|
||||
kill()
|
||||
return
|
||||
|
||||
if(IsMultiple(activeFor, 3))
|
||||
var/obj/machinery/vending/infectedMachine = pick(vendingMachines)
|
||||
vendingMachines.Remove(infectedMachine)
|
||||
infectedMachine.shut_up = 0
|
||||
infectedMachine.shoot_inventory = 1
|
||||
if(IsMultiple(activeFor, 5))
|
||||
if(prob(25))
|
||||
var/obj/machinery/vending/infectedMachine = pick(vendingMachines)
|
||||
vendingMachines.Remove(infectedMachine)
|
||||
infectedVendingMachines.Add(infectedMachine)
|
||||
infectedMachine.shut_up = 0
|
||||
infectedMachine.shoot_inventory = 1
|
||||
|
||||
if(IsMultiple(activeFor, 12))
|
||||
originMachine.speak(pick("Try our aggressive new marketing strategies!", \
|
||||
"You should buy products to feed your lifestyle obession!", \
|
||||
"Consume!", \
|
||||
"Your money can buy happiness!", \
|
||||
"Engage direct marketing!", \
|
||||
"Advertising is legalized lying! But don't let that put you off our great deals!", \
|
||||
"You don't want to buy anything? Yeah, well I didn't want to buy your mom either."))
|
||||
if(IsMultiple(activeFor, 12))
|
||||
originMachine.speak(pick("Try our aggressive new marketing strategies!", \
|
||||
"You should buy products to feed your lifestyle obession!", \
|
||||
"Consume!", \
|
||||
"Your money can buy happiness!", \
|
||||
"Engage direct marketing!", \
|
||||
"Advertising is legalized lying! But don't let that put you off our great deals!", \
|
||||
"You don't want to buy anything? Yeah, well I didn't want to buy your mom either."))
|
||||
|
||||
/datum/event/brand_intelligence/end()
|
||||
for(var/obj/machinery/vending/infectedMachine in infectedVendingMachines)
|
||||
if(prob(90))
|
||||
infectedMachine.shut_up = 1
|
||||
infectedMachine.shoot_inventory = 0
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
/datum/event/carp_migration/end()
|
||||
for(var/mob/living/simple_animal/hostile/carp/C in spawned_carp)
|
||||
var/turf/T = get_turf(C)
|
||||
if(istype(T, /turf/space))
|
||||
del(C)
|
||||
if(!C.stat)
|
||||
var/turf/T = get_turf(C)
|
||||
if(istype(T, /turf/space))
|
||||
del(C)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
possibleEvents[/datum/event/carp_migration] = 50 + 50 * active_with_role["Engineer"]
|
||||
possibleEvents[/datum/event/brand_intelligence] = 50 + 25 * active_with_role["Janitor"]
|
||||
|
||||
possibleEvents[/datum/event/rogue_drone] = 50 + 25 * active_with_role["Engineer"] + 25 * active_with_role["Security"]
|
||||
possibleEvents[/datum/event/rogue_drone] = 25 + 25 * active_with_role["Engineer"] + 25 * active_with_role["Security"]
|
||||
possibleEvents[/datum/event/infestation] = 50 + 25 * active_with_role["Janitor"]
|
||||
|
||||
possibleEvents[/datum/event/communications_blackout] = 50 + 25 * active_with_role["AI"] + active_with_role["Scientist"] * 25
|
||||
|
||||
@@ -4,7 +4,6 @@ var/list/potentialRandomEvents = typesof(/datum/event) - /datum/event
|
||||
|
||||
var/eventTimeLower = 15000 //15 minutes
|
||||
var/eventTimeUpper = 30000 //30 minutes
|
||||
|
||||
var/scheduledEvent = null
|
||||
|
||||
|
||||
@@ -19,7 +18,7 @@ var/scheduledEvent = null
|
||||
/proc/checkEvent()
|
||||
if(!scheduledEvent)
|
||||
//more players = more time between events, less players = less time between events
|
||||
var/playercount_modifier = 0.5
|
||||
var/playercount_modifier = 1
|
||||
switch(player_list.len)
|
||||
if(0 to 10)
|
||||
playercount_modifier = 1.2
|
||||
@@ -63,4 +62,4 @@ var/scheduledEvent = null
|
||||
|
||||
if(ispath(type))
|
||||
new type
|
||||
message_admins("[key_name_admin(usr)] has triggered an event. ([type])", 1)
|
||||
message_admins("[key_name_admin(usr)] has triggered an event. ([type])", 1)
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
var/turf/simulated/floor/T = pick(turfs)
|
||||
turfs.Remove(T)
|
||||
num--
|
||||
|
||||
|
||||
if(vermin == VERM_SPIDERS)
|
||||
var/obj/effect/spider/spiderling/S = new(T)
|
||||
@@ -100,6 +101,7 @@
|
||||
var/spawn_type = pick(spawn_types)
|
||||
new spawn_type(T)
|
||||
|
||||
|
||||
/datum/event/infestation/announce()
|
||||
command_alert("Bioscans indicate that [vermstring] have been breeding in [locstring]. Clear them out, before this starts to affect productivity.", "Vermin infestation")
|
||||
|
||||
|
||||
@@ -34,6 +34,13 @@
|
||||
for(var/mob/M in view())
|
||||
M << 'sound/effects/mousesqueek.ogg'
|
||||
|
||||
if(prob(0.5) && stat == CONSCIOUS)
|
||||
stat = UNCONSCIOUS
|
||||
icon_state = "mouse_[color]_sleep"
|
||||
if(stat == UNCONSCIOUS && prob(1))
|
||||
stat = CONSCIOUS
|
||||
icon_state = "mouse_[color]"
|
||||
|
||||
/mob/living/simple_animal/mouse/New()
|
||||
..()
|
||||
if(!color)
|
||||
|
||||
@@ -382,11 +382,30 @@
|
||||
*/
|
||||
|
||||
/datum/sprite_accessory/hair
|
||||
tentacle_m
|
||||
name = "Skrell Male Tentacles"
|
||||
icon_state = "skrell_hair_m"
|
||||
species_allowed = list("Skrell")
|
||||
gender = MALE
|
||||
spines_long
|
||||
name = "Long Unathi Spines"
|
||||
icon_state = "soghun_longspines"
|
||||
species_allowed = list("Unathi")
|
||||
|
||||
spines_short
|
||||
name = "Short Unathi Spines"
|
||||
icon_state = "soghun_shortspines"
|
||||
species_allowed = list("Unathi")
|
||||
|
||||
frills_long
|
||||
name = "Long Unathi Frills"
|
||||
icon_state = "soghun_longfrills"
|
||||
species_allowed = list("Unathi")
|
||||
|
||||
frills_short
|
||||
name = "Short Unathi Frills"
|
||||
icon_state = "soghun_shortfrill"
|
||||
species_allowed = list("Unathi")
|
||||
|
||||
horns
|
||||
name = "Unathi Horns"
|
||||
icon_state = "soghun_horns"
|
||||
species_allowed = list("Unathi")
|
||||
|
||||
tentacle_f
|
||||
name = "Skrell Female Tentacles"
|
||||
@@ -499,6 +518,7 @@
|
||||
name = "Smallsatche"
|
||||
icon_state = "facial_smallstache"
|
||||
species_allowed = list("Tajaran")
|
||||
|
||||
//skin styles - WIP
|
||||
//going to have to re-integrate this with surgery
|
||||
//let the icon_state hold an icon preview for now
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
for(var/mob/M in player_list)
|
||||
if(istype(M, /mob/new_player))
|
||||
continue
|
||||
if(M.client && M.client.holder && (M.client.prefs.toggles & CHAT_DEAD)) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above
|
||||
if(M.client && M.client.holder && M.client.holder.rights & R_ADMIN && (M.client.prefs.toggles & CHAT_DEAD)) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above
|
||||
M << rendered //Admins can hear deadchat, if they choose to, no matter if they're blind/deaf or not.
|
||||
else if(M.stat == DEAD)
|
||||
M.show_message(rendered, 2) //Takes into account blindness and such.
|
||||
|
||||
@@ -43,14 +43,14 @@
|
||||
toxmob(A)
|
||||
if((istype(A,/obj/machinery/the_singularitygen))||(istype(A,/obj/machinery/singularity/)))
|
||||
A:energy += energy
|
||||
else if( istype(A,/obj/machinery/rust/particle_catcher) )
|
||||
var/obj/machinery/rust/particle_catcher/collided_catcher = A
|
||||
else if( istype(A,/obj/effect/rust_particle_catcher) )
|
||||
var/obj/effect/rust_particle_catcher/collided_catcher = A
|
||||
if(particle_type && particle_type != "neutron")
|
||||
if(collided_catcher.AddParticles(particle_type, 1 + additional_particles))
|
||||
collided_catcher.parent.AddEnergy(energy,mega_energy)
|
||||
del (src)
|
||||
else if( istype(A,/obj/machinery/rust/core) )
|
||||
var/obj/machinery/rust/core/collided_core = A
|
||||
else if( istype(A,/obj/machinery/power/rust_core) )
|
||||
var/obj/machinery/power/rust_core/collided_core = A
|
||||
if(particle_type && particle_type != "neutron")
|
||||
if(collided_core.AddParticles(particle_type, 1 + additional_particles))
|
||||
var/energy_loss_ratio = abs(collided_core.owned_field.frequency - frequency) / 1e9
|
||||
|
||||
@@ -19,6 +19,8 @@ datum
|
||||
var/list/data = null
|
||||
var/volume = 0
|
||||
var/nutriment_factor = 0
|
||||
var/custom_metabolism = REAGENTS_METABOLISM
|
||||
var/mildly_toxic = 0
|
||||
//var/list/viruses = list()
|
||||
var/color = "#000000" // rgb: 0, 0, 0 (does not support alpha channels - yet!)
|
||||
|
||||
@@ -68,7 +70,14 @@ datum
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!istype(M, /mob/living))
|
||||
return //Noticed runtime errors from pacid trying to damage ghosts, this should fix. --NEO
|
||||
holder.remove_reagent(src.id, REAGENTS_METABOLISM) //By default it slowly disappears.
|
||||
// Certain elements in too large amounts cause side-effects
|
||||
|
||||
if(mildly_toxic && istype(M, /mob/living/carbon/human/))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.side_effects.len == 0)
|
||||
M.add_side_effect(pick("Headache", "Bad Stomach", "Itch"))
|
||||
|
||||
holder.remove_reagent(src.id, custom_metabolism) //By default it slowly disappears.
|
||||
return
|
||||
|
||||
on_move(var/mob/M)
|
||||
@@ -199,6 +208,7 @@ datum
|
||||
description = "A ubiquitous chemical substance that is composed of hydrogen and oxygen."
|
||||
reagent_state = LIQUID
|
||||
color = "#0064C8" // rgb: 0, 100, 200
|
||||
custom_metabolism = 0.01
|
||||
|
||||
reaction_turf(var/turf/simulated/T, var/volume)
|
||||
if (!istype(T)) return
|
||||
@@ -309,24 +319,28 @@ datum
|
||||
description = "A Toxic chemical."
|
||||
reagent_state = LIQUID
|
||||
color = "#CF3600" // rgb: 207, 54, 0
|
||||
custom_metabolism = 0.01
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
M.adjustToxLoss(1.5*REM)
|
||||
// Toxins are really weak, but without being treated, last very long.
|
||||
M.adjustToxLoss(0.2)
|
||||
..()
|
||||
return
|
||||
|
||||
cyanide
|
||||
// Fast and lethal
|
||||
name = "Cyanide"
|
||||
id = "cyanide"
|
||||
description = "A highly toxic chemical."
|
||||
reagent_state = LIQUID
|
||||
color = "#CF3600" // rgb: 207, 54, 0
|
||||
custom_metabolism = 0.4
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
M.adjustToxLoss(3*REM)
|
||||
M.adjustOxyLoss(3*REM)
|
||||
M.adjustToxLoss(4)
|
||||
M.adjustOxyLoss(4)
|
||||
M.sleeping += 1
|
||||
..()
|
||||
return
|
||||
@@ -405,6 +419,8 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#E895CC" // rgb: 232, 149, 204
|
||||
|
||||
custom_metabolism = 0.1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
if(!data) data = 1
|
||||
@@ -540,12 +556,17 @@ datum
|
||||
reagent_state = GAS
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
|
||||
custom_metabolism = 0.01
|
||||
|
||||
copper
|
||||
name = "Copper"
|
||||
id = "copper"
|
||||
description = "A highly ductile metal."
|
||||
color = "#6E3B08" // rgb: 110, 59, 8
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
nitrogen
|
||||
name = "Nitrogen"
|
||||
id = "nitrogen"
|
||||
@@ -553,6 +574,9 @@ datum
|
||||
reagent_state = GAS
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
hydrogen
|
||||
name = "Hydrogen"
|
||||
id = "hydrogen"
|
||||
@@ -560,6 +584,9 @@ datum
|
||||
reagent_state = GAS
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
potassium
|
||||
name = "Potassium"
|
||||
id = "potassium"
|
||||
@@ -567,6 +594,10 @@ datum
|
||||
reagent_state = SOLID
|
||||
color = "#A0A0A0" // rgb: 160, 160, 160
|
||||
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
mercury
|
||||
name = "Mercury"
|
||||
id = "mercury"
|
||||
@@ -589,6 +620,9 @@ datum
|
||||
reagent_state = SOLID
|
||||
color = "#BF8C00" // rgb: 191, 140, 0
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
carbon
|
||||
name = "Carbon"
|
||||
id = "carbon"
|
||||
@@ -596,6 +630,9 @@ datum
|
||||
reagent_state = SOLID
|
||||
color = "#1C1300" // rgb: 30, 20, 0
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
reaction_turf(var/turf/T, var/volume)
|
||||
src = null
|
||||
if(!istype(T, /turf/space))
|
||||
@@ -634,6 +671,9 @@ datum
|
||||
reagent_state = SOLID
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
phosphorus
|
||||
name = "Phosphorus"
|
||||
id = "phosphorus"
|
||||
@@ -641,6 +681,9 @@ datum
|
||||
reagent_state = SOLID
|
||||
color = "#832828" // rgb: 131, 40, 40
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
lithium
|
||||
name = "Lithium"
|
||||
id = "lithium"
|
||||
@@ -826,6 +869,9 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
nitroglycerin
|
||||
name = "Nitroglycerin"
|
||||
id = "nitroglycerin"
|
||||
@@ -833,6 +879,9 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
|
||||
mildly_toxic = 1
|
||||
custom_metabolism = 0.01
|
||||
|
||||
radium
|
||||
name = "Radium"
|
||||
id = "radium"
|
||||
@@ -1403,6 +1452,7 @@ datum
|
||||
description = "Synaptizine is used to treat various diseases."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.01
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1440,6 +1490,7 @@ datum
|
||||
description = "Hyronalin is a medicinal drug used to counter the effect of radiation poisoning."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.05
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1453,6 +1504,7 @@ datum
|
||||
description = "Arithrazine is an unstable medication used for the most extreme cases of radiation poisoning."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.05
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(M.stat == 2.0)
|
||||
@@ -1471,6 +1523,7 @@ datum
|
||||
description = "Alkysine is a drug used to lessen the damage to neurological tissue after a catastrophic injury. Can heal brain tissue."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.05
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1516,11 +1569,11 @@ datum
|
||||
description = "Hyperzine is a highly effective, long lasting, muscle stimulant."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.03
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
if(prob(5)) M.emote(pick("twitch","blink_r","shiver"))
|
||||
holder.remove_reagent(src.id, 0.5 * REAGENTS_METABOLISM)
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -1535,9 +1588,9 @@ datum
|
||||
if(!M) M = holder.my_atom
|
||||
if(M.bodytemperature < 170)
|
||||
M.adjustCloneLoss(-1)
|
||||
M.adjustOxyLoss(-3)
|
||||
M.heal_organ_damage(3,3)
|
||||
M.adjustToxLoss(-3)
|
||||
M.adjustOxyLoss(-1)
|
||||
M.heal_organ_damage(1,1)
|
||||
M.adjustToxLoss(-1)
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -1564,9 +1617,9 @@ datum
|
||||
description = "An all-purpose antiviral agent."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.01
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)//no more mr. panacea
|
||||
holder.remove_reagent(src.id, 0.2)
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -1612,6 +1665,7 @@ datum
|
||||
description = "A powerful hallucinogen. Not a thing to be messed with."
|
||||
reagent_state = LIQUID
|
||||
color = "#B31008" // rgb: 139, 166, 233
|
||||
custom_metabolism = 0.05
|
||||
|
||||
on_mob_life(var/mob/living/M)
|
||||
if(!M) M = holder.my_atom
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
icon_state = "pill17"
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("anti_toxin", 50)
|
||||
reagents.add_reagent("anti_toxin", 25)
|
||||
|
||||
/obj/item/weapon/reagent_containers/pill/tox
|
||||
name = "Toxins pill"
|
||||
@@ -175,4 +175,4 @@
|
||||
..()
|
||||
reagents.add_reagent("impedrezene", 10)
|
||||
reagents.add_reagent("synaptizine", 5)
|
||||
reagents.add_reagent("hyperzine", 5)
|
||||
reagents.add_reagent("hyperzine", 5)
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
#define HUNGER_FACTOR 0.05
|
||||
|
||||
// How many units of reagent are consumed per tick, by default.
|
||||
#define REAGENTS_METABOLISM 0.4
|
||||
#define REAGENTS_METABOLISM 0.2
|
||||
|
||||
// By defining the effect multiplier this way, it'll exactly adjust
|
||||
// all effects according to how they originally were with the 0.4 metabolism
|
||||
|
||||