Files
Paradise/code/game/objects/structures/depot_structures.dm
Migratingcocofruit ebf7fdbfd2 Radiation Rework (#28320)
* initial changes

* Rad wave is working. now to implement the rest

* Makes the waves square

* Makes wave square

* multiplies the strength in all instances of radiation_pulse by 4 because each pulse makes one wave instead of 4 now

* Undef thing and apply suggestion

* Make radiation_pulse() not radiate the radiation source and implements contamination

* Adds contamination to uranium walls and meteors

* Fixes stuff

* Handle some contamination on attack still need to take care of meteors

* Fixed the meteor stuff

* Introduce emission types

* moves contaminate_touch to an atom proc and renames it to contaminate_atom

* deduplicates some contamination code

* Move inherent radioactivity to a component and signals from the atom vars and behaviour

* fix some things with the new component

* Update inherent_radioactivity.dm

* implement contaminating things that hit things that are inherently radioactive

* window things

* adds emission type to the rad_act call

* Changes radiation insulation values on a bunch of stuff

* fixes radioactive component radiating the wrong type

* more adjustments

* refactros rad_act

* adjustments to collector power production

* Adds plastitaniumglass windows and makes further adjustments

* Adds sprites to the shards and plastitanium directional window

* Update misc_cleanables.dm

* removes alpha rad insulation from floor turfs

* Fixes a bug with the starting tile of radiation waves

* More adjustments

* Adjusting singularity rad production

* reduces window half life a bit to make power smoother and buffs full window rad conversion

* Strengthens gamma and beta radiation effect on mobs.

* Makes radsuit block radiation completely

* Fixes Geiger Counters

* Fixes contamination not irradiating the contaminated thing

* Fixes inherent radioactivity not processing. Also makes it stop processing when a nuke core is contained

* Fixes ghost contamination

* Adds info to the collector

* Handles alpha radiation better on humans and changes some instances of rad_act to base_rad_act

* oops

* adjustments and fixes to alpha rad handling on mobs

* Make collector info more compact

* Core no longer radiates and contaminates from within the nuke until the plates are removed

* Contamination no longer counts as being inside a mob(it is supposed to be surface level)

* Adds inherent radioactivity to a bunch of uranium things. makes it all process.

* Nerf full windows

* Adjustments to collector and fulltile window radiation absorption

* Reduces passive contamination, especially while on the floor

* Adds different rad types to the geiger counter and fixes a runtime

* Makes full tile windows strong again and disallows building them on top of collectors

* adds emissive blockers to the rad blacklist and gives windows and collectors priority when irradiating for increased consistency

* Gives each contamination type it's own color.

* Gives each contamination type it's own color.  And makes the rad hud display them separately

* Changes how much the radiation wave affects the source tile, adds decay for performance reasons and adjusts collector parameters as well as SM and singulo rad production

* improves performance at very high rad amounts

* Fixes supermatter sliver box not containing radiation

* Restores supermatter sliver to old behaviour(not inherently radioactive)

* Slight nerf to fulltile windows and removes an unnecessary multiplication from rad wave processing

* Removes redundant line from window rad act

* Fixes radiation waves ignoring walls

* fixes it better

* more adjustments to collector stats

* Adjustment to collector gamma absorption

* increases grille beta blocking

* Review changes
2025-03-02 20:34:45 +00:00

122 lines
3.6 KiB
Plaintext

/obj/structure/fusionreactor
name = "syndicate fusion reactor"
desc = "Significantly less cool than a supermatter crystal, but just as likely to fuck up."
icon = 'icons/goonstation/objects/powersink.dmi'
icon_state = "powersink1"
anchored = TRUE
max_integrity = 50
var/area/syndicate_depot/core/depotarea
var/has_overloaded = FALSE
/obj/structure/fusionreactor/Initialize(mapload)
. = ..()
depotarea = get_area(src)
if(istype(depotarea))
depotarea.reactor = src
for(var/obj/machinery/porta_turret/syndicate/T in range(50, loc))
if(!istype(T.depotarea))
T.depotarea = depotarea
else
log_debug("[src] at [x],[y],[z] failed depotarea istype check during Initialize()! Either it was spawned outside the depot area (bad idea), or a bug is happening.")
/obj/structure/fusionreactor/Destroy()
if(istype(depotarea))
if(!has_overloaded)
overload(TRUE, TRUE)
depotarea.reactor = null
return ..()
/obj/structure/fusionreactor/ex_act(severity)
if(severity < EXPLODE_LIGHT)
obj_integrity = 0
healthcheck()
/obj/structure/fusionreactor/proc/healthcheck()
if(obj_integrity <= 0 && istype(depotarea))
overload(TRUE)
/obj/structure/fusionreactor/screwdriver_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
to_chat(user, "<span class='danger'>You try to screwdriver open [src], but accidentally release some radiation!</span>")
if(prob(50))
empulse(src, 4, 10)
else
radiation_pulse(get_turf(src), 2000, BETA_RAD)
/obj/structure/fusionreactor/wrench_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
to_chat(user, "<span class='notice'>[src] is too well secured to the floor.</span>")
/obj/structure/fusionreactor/proc/overload(containment_failure = FALSE, skip_qdel = FALSE)
if(has_overloaded)
return
has_overloaded = TRUE
if(istype(depotarea) && !depotarea.used_self_destruct)
depotarea.activate_self_destruct("Fusion reactor cracked open. Core loose!", TRUE)
var/obj/effect/overload/O = new /obj/effect/overload(get_turf(src))
if(containment_failure)
playsound(loc, 'sound/machines/alarm.ogg', 100, FALSE, 0)
O.deliberate = TRUE
O.max_cycles = 6
if(!skip_qdel)
qdel(src)
/obj/effect/overload
icon = 'icons/obj/tesla_engine/energy_ball.dmi'
icon_state = "energy_ball"
pixel_x = -32
pixel_y = -32
anchored = TRUE
var/cycles = 0
var/beepsound = 'sound/items/timer.ogg'
var/deliberate = FALSE
var/max_cycles = 10
var/area/syndicate_depot/core/depotarea
/obj/effect/overload/Initialize(mapload)
. = ..()
START_PROCESSING(SSobj, src)
depotarea = get_area(src)
if(istype(depotarea))
if(!depotarea.used_self_destruct)
depotarea.used_self_destruct = TRUE // Silences all further alerts from this point onwards.
depotarea.update_state()
else
log_debug("[src] at [x],[y],[z] failed depotarea istype check during Initialize()! Either it was spawned outside the depot area (bad idea), or a bug is happening.")
/obj/effect/overload/process()
var/turf/T = get_turf(src)
if(cycles < max_cycles)
if(!deliberate)
playsound(loc, beepsound, 50, 0)
cycles++
return
if(!istype(depotarea))
depotarea = get_area(src)
if(istype(depotarea))
depotarea.destroyed = TRUE
depotarea.update_state()
for(var/obj/structure/closet/L in range(30, T))
for(var/obj/O in L)
qdel(O)
L.open()
depotarea.shields_down()
for(var/mob/living/M in range(30, T))
M.gib()
for(var/obj/mecha/E in range(30, T))
E.take_damage(E.max_integrity)
explosion(get_turf(src), 25, 35, 45, 55, 1, 1, 60, 0)
STOP_PROCESSING(SSobj, src)
qdel(src)
/obj/effect/overload/ex_act(severity)
return