multiple R-UST tweaks and slight updates. this should fix any (all?) known outstanding bugs. i also modified values to be a bit more gameplay sensible (max average output on standard operating levels is ~150-200k per gen)

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2012-07-27 02:04:44 +10:00
parent c214db907a
commit 0e6939de85
9 changed files with 108 additions and 51 deletions
@@ -116,7 +116,6 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
volume_covered = PI * major_radius * minor_radius * 2.5 * 2.5 * 1000
process()
..()
//make sure the field generator is still intact
if(!owned_core)
del(src)
@@ -131,29 +130,21 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
radiation = 0
//update values
var/transfer_ratio = field_strength / 50
major_radius = field_strength * 0.21875// max = 8.75
minor_radius = field_strength * 0.2125// max = 8.625
volume_covered = PI * major_radius * minor_radius * 2.5 * 2.5 * 2.5 * 7 * 7 * transfer_ratio
var/transfer_ratio = field_strength / 50 //higher field strength will result in faster plasma aggregation
major_radius = field_strength * 0.21875// max = 8.75m
minor_radius = field_strength * 0.2125// max = 8.625m
volume_covered = PI * major_radius * minor_radius * 2.5 * 2.5 * 2.5 * 7 * 7 * transfer_ratio //one tile = 2.5m*2.5m*2.5m
//add plasma from the surrounding environment
var/datum/gas_mixture/environment = loc.return_air()
/*
if(air_contents.temperature > 0)
var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
loc.assume_air(removed)
*/
//we're going to hack in some stuff to remove plasma from the air because QUANTUM PHYSICS
//hack in some stuff to remove plasma from the air because SCIENCE
//the amount of plasma pulled in each update is relative to the field strength, with 50T (max field strength) = 100% of area covered by the field
//at minimum strength, 0.25% of the field volume is pulled in per update (?)
//have a max of 1000 moles suspended
if(held_plasma.toxins < transfer_ratio * 1000)
var/moles_covered = environment.return_pressure()*volume_covered/(environment.temperature * R_IDEAL_GAS_EQUATION)
//world << "\blue moles_covered: [moles_covered]"
//
var/datum/gas_mixture/gas_covered = environment.remove(moles_covered)
var/datum/gas_mixture/plasma_captured = new /datum/gas_mixture()
@@ -161,9 +152,10 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
plasma_captured.toxins = round(gas_covered.toxins * transfer_ratio)
//world << "\blue[plasma_captured.toxins] moles of plasma captured"
plasma_captured.temperature = gas_covered.temperature
//plasma_captured.update_values()
plasma_captured.update_values()
//
gas_covered.toxins -= plasma_captured.toxins
//gas_covered.update_values()
gas_covered.update_values()
//
held_plasma.merge(plasma_captured)
//
@@ -8,6 +8,7 @@
var/obj/machinery/rust/core/core_generator = null
New()
..()
spawn(0)
core_generator = locate() in world
@@ -41,7 +42,7 @@
process()
..()
updateDialog()
src.updateDialog()
proc
interact(mob/user)
@@ -60,7 +61,7 @@
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>Plasma temperature: [core_generator.owned_field.held_plasma.temperature]</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)
@@ -74,5 +75,5 @@
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=500x800")
user << browse(t, "window=core_monitor;size=500x400")
user.machine = src
@@ -4,7 +4,7 @@
icon_state = "fuel_assembly"
name = "Fuel Rod Assembly"
var/list/rod_quantities
var/amount_depleted = 0 //percent depleted
var/percent_depleted = 0
//
New()
rod_quantities = new/list
@@ -3,22 +3,34 @@
name = "Fuel Injection Control"
icon_state = "power"
var/list/fuel_injectors
var/active_stage = "Cooling"
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
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
spawn(0)
for(var/obj/machinery/rust/fuel_injector/Injector in world)
if(Injector.stage in fuel_injectors)
@@ -46,20 +58,33 @@
usr.machine = null
return
if( href_list["beginstage"] )
active_stage = href_list["beginstage"]
if(active_stage in fuel_injectors)
for(var/obj/machinery/rust/fuel_injector/Injector in fuel_injectors[active_stage])
Injector.BeginInjecting()
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"] )
if(active_stage in fuel_injectors)
for(var/obj/machinery/rust/fuel_injector/Injector in fuel_injectors[active_stage])
for(var/stage_name in fuel_injectors)
for(var/obj/machinery/rust/fuel_injector/Injector in fuel_injectors[stage_name])
Injector.StopInjecting()
active_stage = "Cooling"
stage_status[stage_name] = 0
updateDialog()
return
if( href_list["update"] )
@@ -94,7 +119,7 @@
process()
..()
updateDialog()
src.updateDialog()
proc
interact(mob/user)
@@ -104,12 +129,17 @@
user << browse(null, "window=fuel_monitor")
return
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>"
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>"
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>"] "
@@ -126,18 +156,18 @@
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/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 ? "[100 - Injector.owned_assembly_port.cur_assembly.amount_depleted*100]%" : ""]</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=500x800")
user << browse(t, "window=fuel_monitor;size=500x600")
user.machine = src
@@ -196,7 +196,7 @@
//
owned_assembly_port.cur_assembly.rod_quantities[reagent] -= amount
amount_left += owned_assembly_port.cur_assembly.rod_quantities[reagent]
owned_assembly_port.cur_assembly.amount_depleted = amount_left / 300
owned_assembly_port.cur_assembly.percent_depleted = amount_left / 300
flick("injector-emitting",src)
use_power(fuel_usage * 10000 + 100) //0.0001
if(injecting)
@@ -88,9 +88,33 @@
for(var/obj/machinery/computer/rust/gyrotron_controller/comp in range(25))
comp.updateDialog()
return
/*
var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter( src.loc )
playsound(src.loc, 'emitter.ogg', 25, 1)
if(prob(35))
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
A.dir = src.dir
if(src.dir == 1)//Up
A.yo = 20
A.xo = 0
else if(src.dir == 2)//Down
A.yo = -20
A.xo = 0
else if(src.dir == 4)//Right
A.yo = 0
A.xo = 20
else if(src.dir == 8)//Left
A.yo = 0
A.xo = -20
else // Any other
A.yo = -20
A.xo = 0
A.fired()
*/
proc/Emit()
var/obj/item/projectile/beam/ehf_beam/A = new ( src.loc )
var/obj/item/projectile/beam/ehf_beam/A = new /obj/item/projectile/beam/ehf_beam( src.loc )
A.frequency = frequency
A.damage = mega_energy * 500
//
@@ -33,7 +33,7 @@
process()
..()
//updateDialog()
src.updateDialog()
proc
interact(mob/user)
@@ -96,5 +96,5 @@
t += "</table>"
*/
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse(t, "window=gyrotron_controller;size=500x800")
user << browse(t, "window=gyrotron_controller;size=500x400")
user.machine = src