RUST additions and updates, Modular guns, and Lead. (#4667)

* expanding rupture procs
adds hydromagnetic traps for power production.

* Minor tweaks.

* Adds modular guns using research components.

* Updates materials to have a radiation_resistance variable, used in calculating radiation. Adds Lead as a material.

* Un-zeros stock material radiation resistance.

* Adds, and enables four 'end-events' for the RUST in place of the old Rupture() proc.

* Map muckery?

* absolute pathing i guess?

* getting angry, travis.

* TRAVIS
STAHP

* I...
Comments? Lists? Who the hell knows.
This commit is contained in:
Andromeda-K22
2018-02-04 19:04:28 -05:00
committed by Anewbe
parent 0c643e589e
commit cee3066a41
12 changed files with 440 additions and 40 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ var/list/fusion_cores = list()
if(owned_field)
icon_state = "core0"
if(force_rupture || owned_field.plasma_temperature > 1000)
owned_field.Rupture()
owned_field.MRC()
else
owned_field.RadiateAll()
qdel(owned_field)
+161 -32
View File
@@ -1,6 +1,7 @@
#define FUSION_ENERGY_PER_K 20
#define FUSION_MAX_ENVIRO_HEAT 5000 //raise this if you want the reactor to dump more energy into the atmosphere
#define PLASMA_TEMP_RADIATION_DIVISIOR 15 //radiation divisior. plasma temp / divisor = radiation.
#define PLASMA_TEMP_RADIATION_DIVISIOR 20 //radiation divisior. plasma temp / divisor = radiation.
/obj/effect/fusion_em_field
name = "electromagnetic field"
@@ -19,6 +20,8 @@
var/tick_instability = 0
var/percent_unstable = 0
var/stable = 1
var/id_tag
var/critical = 0
var/obj/machinery/power/fusion_core/owned_core
var/list/dormant_reactant_quantities = list()
@@ -31,7 +34,8 @@
/obj/structure/cable,
/obj/machinery/atmospherics,
/obj/machinery/air_sensor,
/mob/observer/dead
/mob/observer/dead,
/obj/machinery/power/hydromagnetic_trap
)
var/light_min_range = 2
@@ -52,7 +56,7 @@
owned_core = new_owned_core
if(!owned_core)
qdel(src)
id_tag = owned_core.id_tag
//create the gimmicky things to handle field collisions
var/obj/effect/fusion_particle_catcher/catcher
@@ -194,37 +198,46 @@
if(percent_unstable >= 1)
owned_core.Shutdown(force_rupture=1)
else
if(percent_unstable > 0.5 && prob(percent_unstable*100))
if(percent_unstable > 0.1 && prob(percent_unstable*100))
if(plasma_temperature < 2000)
visible_message("<span class='danger'>\The [src] ripples uneasily, like a disturbed pond.</span>")
else
var/flare
var/fuel_loss
var/rupture
if(percent_unstable < 0.2)
if(percent_unstable > 0.2)
visible_message("<span class='danger'>\The [src] ripples uneasily, like a disturbed pond.</span>")
fuel_loss = prob(5)
flare = prob(50)
else if(percent_unstable < 0.9)
flare = prob(25)
else if(percent_unstable > 0.5)
visible_message("<span class='danger'>\The [src] undulates violently, shedding plumes of plasma!</span>")
flare = prob(50)
fuel_loss = prob(20)
rupture = prob(5)
else
else if(percent_unstable > 0.8)
visible_message("<span class='danger'>\The [src] is wracked by a series of horrendous distortions, buckling and twisting like a living thing!</span>")
flare = 1
fuel_loss = prob(50)
rupture = prob(25)
if(rupture)
owned_core.Shutdown(force_rupture=1)
if(prob(80))
MagneticQuench()
return
else if(prob(15))
MRC()
return
else if(prob(5))
QuantumFluxCascade()
return
else if(prob(5))
BluespaceQuenchEvent()
return
else
var/lost_plasma = (plasma_temperature*percent_unstable)
radiation += lost_plasma
if(flare)
radiation += plasma_temperature/2
plasma_temperature -= lost_plasma
spawn(1)
emflare()
if(fuel_loss)
for(var/particle in dormant_reactant_quantities)
var/lost_fuel = dormant_reactant_quantities[particle]*percent_unstable
@@ -234,17 +247,19 @@
dormant_reactant_quantities.Remove(particle)
Radiate()
return
/obj/effect/fusion_em_field/proc/Rupture()
visible_message("<span class='danger'>\The [src] shudders like a dying animal before flaring to eye-searing brightness and rupturing!</span>")
set_light(15, 15, "#CCCCFF")
empulse(get_turf(src), ceil(plasma_temperature/1000), ceil(plasma_temperature/300))
sleep(5)
global_announcer.autosay("WARNING: FIELD RUPTURE IMMINENT!", "Containment Monitor")
RadiateAll()
explosion(get_turf(owned_core),-1,-1,8,10) // Blow out all the windows.
return
/*/obj/effect/fusion_em_field/proc/CheckCriticality()
if (plasma_temperature > 70000)
critical += 0.2
else if (instability > 0.45)
critical += 0.6
if(critical >= 25 && prob(percent_unstable*100))
if (critical >= 90)
visible_message("<span class='danger'>\The [src] rumbles and quivers violently, threatening to break free!</span>")
else if(critical >= 50)
visible_message("<span class='danger'>\The [src] rumbles and quivers energetically, the walls distorting slightly.</span>")
else if(critical >= 25)
visible_message("<span class='danger'>\The [src] rumbles and quivers slightly, vibrating the deck.</span>")
*/
/obj/effect/fusion_em_field/proc/ChangeFieldStrength(var/new_strength)
var/calc_size = 1
if(new_strength <= 50)
@@ -490,19 +505,19 @@
//All procs below this point are called in _core.dm, starting at line 41.
//Stability monitoring. Gives radio annoucements if field stability is below 80%
/obj/effect/fusion_em_field/proc/stability_monitor()
var/warnpoint = 0.10
var/warnpoint = 0.10 //start warning at 10% instability
var/warnmessage = "Warning! Field unstable! Instability at [percent_unstable * 100]%, plasma temperature at [plasma_temperature + 295]k."
var/stablemessage = "Containment field returning to stable conditions."
if(percent_unstable >= warnpoint)
if(percent_unstable >= warnpoint) //we're unstable, start warning engineering
global_announcer.autosay(warnmessage, "Field Stability Monitor", "Engineering")
stable = 0
sleep(20 SECONDS)
return
if(percent_unstable < warnpoint && stable == 0)
stable = 0 //we know we're not stable, so let's not state the safe message.
sleep(20)
return
if(percent_unstable < warnpoint && stable == 0) //The field is stable again. Let's set our safe variable and state the safe message.
global_announcer.autosay(stablemessage, "Field Stability Monitor", "Engineering")
stable = 1
return
return
//Reaction radiation is fairly buggy and there's at least three procs dealing with radiation here, this is to ensure constant radiation output.
/obj/effect/fusion_em_field/proc/radiation_scale()
@@ -513,7 +528,8 @@
if(owned_core && owned_core.loc)
var/datum/gas_mixture/environment = owned_core.loc.return_air()
if(environment && environment.temperature < (T0C+FUSION_MAX_ENVIRO_HEAT))
environment.add_thermal_energy(plasma_temperature*20000)
environment.add_thermal_energy(plasma_temperature*5000)
check_instability()
//Temperature changes depending on color.
/obj/effect/fusion_em_field/proc/temp_color()
@@ -538,8 +554,121 @@
light_max_range = 5
light_max_power = 5
return
//moved the flare to a proc for various reasons. Called on line 225.
/obj/effect/fusion_em_field/proc/emflare()
radiation += plasma_temperature/2
light_color = "#ff0000"
light_max_power = 30
light_min_power = 30
light_min_range = 30
light_max_range = 30
visible_message("<span class='danger'>\The [src] flares to eye-searing brightness!</span>")
sleep(60)
temp_color()
//plasma_temperature -= lost_plasma
return
//Rupture() is no longer the end all be all. Fear the magnetic resonance cascade and quantum flux cascade
/obj/effect/fusion_em_field/proc/Rupture()
visible_message("<span class='danger'>\The [src] shudders like a dying animal before flaring to eye-searing brightness and rupturing!</span>")
set_light(15, 15, "#CCCCFF")
empulse(get_turf(src), ceil(plasma_temperature/1000), ceil(plasma_temperature/300))
global_announcer.autosay("WARNING: FIELD RUPTURE IMMINENT!", "Containment Monitor")
RadiateAll()
var/list/things_in_range = range(10, owned_core)
var/list/turfs_in_range = list()
var/turf/T
for (T in things_in_range)
turfs_in_range.Add(T)
explosion(pick(things_in_range), -1, 5, 5, 5)
empulse(pick(things_in_range), ceil(plasma_temperature/1000), ceil(plasma_temperature/300))
spawn(25)
explosion(pick(things_in_range), -1, 5, 5, 5)
spawn(25)
explosion(pick(things_in_range), -1, 5, 5, 5)
spawn(25)
explosion(pick(things_in_range), -1, 5, 5, 5)
spawn(10)
explosion(pick(things_in_range), -1, 5, 5, 5)
spawn(10)
explosion(pick(things_in_range), -1, 5, 5, 5)
spawn(10)
explosion(pick(things_in_range), -1, 5, 5, 5)
return
/obj/effect/fusion_em_field/proc/MRC() //spews electromagnetic pulses in an area around the core.
visible_message("<span class='danger'>\The [src] glows an extremely bright pink and flares out of existance!</span>")
global_announcer.autosay("Warning! Magnetic Resonance Cascade detected! Brace for electronic system distruption.", "Field Stability Monitor")
set_light(15, 15, "#ff00d8")
var/list/things_in_range = range(15, owned_core)
var/list/turfs_in_range = list()
var/turf/T
for (T in things_in_range)
turfs_in_range.Add(T)
for(var/loopcount = 1 to 10)
spawn(200)
empulse(pick(things_in_range), 10, 15)
Destroy()
return
/obj/effect/fusion_em_field/proc/QuantumFluxCascade() //spews hot phoron and oxygen in a radius around the RUST. Will probably set fire to things
global_announcer.autosay("Warning! Quantum fluxuation detected! Flammable gas release expected.", "Field Stability Monitor")
var/list/things_in_range = range(15, owned_core)
var/list/turfs_in_range = list()
var/turf/T
for (T in things_in_range)
turfs_in_range.Add(T)
for(var/loopcount = 1 to 10)
var/turf/TT = get_turf(pick(turfs_in_range))
if(istype(TT))
var/datum/gas_mixture/plasma = new
plasma.adjust_gas("oxygen", (size*100), 0)
plasma.adjust_gas("phoron", (size*100), 0)
plasma.temperature = (plasma_temperature/2)
plasma.update_values()
TT.assume_air(plasma)
TT.hotspot_expose(plasma_temperature)
plasma = null
Destroy()
return
/obj/effect/fusion_em_field/proc/MagneticQuench() //standard hard shutdown. dumps hot oxygen/phoron into the core's area and releases an EMP in the area around the core.
global_announcer.autosay("Warning! Magnetic Quench event detected, engaging hard shutdown.", "Field Stability Monitor")
empulse(owned_core, 10, 15)
var/turf/TT = get_turf(owned_core)
if(istype(TT))
var/datum/gas_mixture/plasma = new
plasma.adjust_gas("oxygen", (size*100), 0)
plasma.adjust_gas("phoron", (size*100), 0)
plasma.temperature = (plasma_temperature/2)
plasma.update_values()
TT.assume_air(plasma)
TT.hotspot_expose(plasma_temperature)
plasma = null
Destroy()
owned_core.Shutdown()
return
/obj/effect/fusion_em_field/proc/BluespaceQuenchEvent() //!!FUN!! causes a number of explosions in an area around the core. Will likely destory or heavily damage the reactor.
visible_message("<span class='danger'>\The [src] shudders like a dying animal before flaring to eye-searing brightness and rupturing!</span>")
set_light(15, 15, "#CCCCFF")
empulse(get_turf(src), ceil(plasma_temperature/1000), ceil(plasma_temperature/300))
global_announcer.autosay("WARNING: FIELD RUPTURE IMMINENT!", "Containment Monitor")
RadiateAll()
var/list/things_in_range = range(10, owned_core)
var/list/turfs_in_range = list()
var/turf/T
for (T in things_in_range)
turfs_in_range.Add(T)
for(var/loopcount = 1 to 10)
explosion(pick(things_in_range), -1, 5, 5, 5)
empulse(pick(things_in_range), ceil(plasma_temperature/1000), ceil(plasma_temperature/300))
Destroy()
owned_core.Shutdown()
return
#undef FUSION_HEAT_CAP
#undef FUSION_MAX_ENVIRO_HEAT
#undef PLASMA_TEMP_RADIATION_DIVISIOR
@@ -117,7 +117,7 @@ proc/get_fusion_reaction(var/p_react, var/s_react, var/m_energy)
var/turf/origin = get_turf(holder)
holder.Rupture()
qdel(holder)
var/radiation_level = rand(100, 200)
var/radiation_level = 200
// Copied from the SM for proof of concept. //Not any more --Cirra //Use the whole z proc --Leshana
radiation_repository.z_radiate(locate(1, 1, holder.z), radiation_level, 1)
@@ -141,7 +141,6 @@ proc/get_fusion_reaction(var/p_react, var/s_react, var/m_energy)
return 1
// High end reactions.
/decl/fusion_reaction/boron_hydrogen
p_react = "boron"
+11 -1
View File
@@ -5,4 +5,14 @@
description = "A colorless, odorless, tasteless and generally inert gas used in fusion reactors. Non-radioactive."
id = "helium-3"
reagent_state = GAS
color = "#808080"
color = "#808080"
/obj/structure/reagent_dispensers/he3
name = "fueltank"
desc = "A fueltank."
icon = 'icons/obj/objects.dmi'
icon_state = "weldtank"
amount_per_transfer_from_this = 10
New()
..()
reagents.add_reagent("helium-3",1000)
+54
View File
@@ -0,0 +1,54 @@
#define ENERGY_PER_K 20
#define MINIMUM_PLASMA_TEMPERATURE 10000
/obj/machinery/power/hydromagnetic_trap
name = "\improper hydromagnetic trap"
desc = "A device for extracting power from high-energy plasma in toroidal fields."
icon = 'icons/obj/machines/power/fusion.dmi'
icon_state = "mag_trap0"
anchored = 1
var/list/things_in_range = list()//what is in a radius of us?
var/list/fields_in_range = list()//What EM fields are in that radius?
var/list/active_field = list()//Our active field.
var/active = 0 //are we even on?
var/id_tag //needed for !!rasins!!
/obj/machinery/power/hydromagnetic_trap/process()
if(!powernet && anchored == 1)
return
spawn(1)
Active()
Search()
/obj/machinery/power/hydromagnetic_trap/proc/Search()//let's not have +100 instances of the same field in active_field.
things_in_range = range(7, src)
var/obj/effect/fusion_em_field/FFF
for (FFF in things_in_range)
fields_in_range.Add(FFF)
for (FFF in fields_in_range)
if (active_field.len > 0)
return
else if (active_field.len == 0)
Link()
return
/obj/machinery/power/hydromagnetic_trap/proc/Link() //discover our EM field
var/obj/effect/fusion_em_field/FFF
for(FFF in fields_in_range)
if (FFF.id_tag != id_tag)
return
active_field += FFF
active = 1
return
/obj/machinery/power/hydromagnetic_trap/proc/Active()//POWERRRRR
var/obj/effect/fusion_em_field/FF
if (active == 0)
return
for (FF in active_field)
if (FF.plasma_temperature >= MINIMUM_PLASMA_TEMPERATURE)
icon_state = "mag_trap1"
add_avail(ENERGY_PER_K * FF.plasma_temperature)
if (FF.plasma_temperature <= MINIMUM_PLASMA_TEMPERATURE)
icon_state = "mag_trap0"
return