mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
* 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.
55 lines
1.6 KiB
Plaintext
55 lines
1.6 KiB
Plaintext
#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
|