[READY] Fusion: Prepare to Die Edition (and more) (#39499)

tweak: Fusion has been reworked to be a whole lot deadlier!

tweak: You can now use analyzers on gas mixtures holders (canisters, pipes, turfs, etc) that have undergone fusion to see the power of the fusion reaction that occurred.

balance: Several gases' fusion power and fusion's gas creation has been reworked to make its tier system more linear and less cheese-able.


Fusion, even after my rework, is still kinda lackluster in the 'risk <-> reward' department. It's pretty easy to bypass the consequences of fusion as it stands right now, so I wanted to change that. I think you can suspend your disbelief enough for the new effects. Also, there are a couple balance changes to fusion that I'll outline more below that I noticed happening and theorized could happen, so I tackled those here as well.

More specific reasoning for every change:

    Addition of nuclear particles/tesla zap

As said before, I thought fusion should be more dangerous. As to why these specifically, I chose the addition of nuclear particles because I felt like it was at least decently thematically appropriate, and had a lot of potential to look visually interesting. The sprite is pretty much just a downscaled gumball with some added fluff. They all have random colors that are chosen when created, and fire out from the fusion holder's turf in random angles and with a 1 decisecond delay. I chose tesla zaps because.. well, they're pretty cool, felt reasonable enough (an extremely powerful release of energy goes well with fusion) and they mix up the damage types caused by fusion (brute from explosion, burn from zap, tox from radiation/particles). I added TESLA_FUSION_FLAGS because the tesla zaps defaultly just ended up exploding whatever they came out of (canisters usually) and ruined the whole thing.

    BZ fusion power nerf, nitryl fusion power buff

These go hand in hand. When I first made BZ useful for fusion, I completely forgot (or maybe it just wasn't merged yet, don't remember) that xenobio started with a BZ canister. So, it was super easy to cheese high/super tier fusion by just stealing the canister from xenobio. Thus, I switched BZ's role in fusions progression to nitryl instead, which is harder to make and currently doesn't see much usefulness outside of making it for stimulum.

    Fusion analyzing, addition of analyzer_results to datum/gas_mixture

I quickly realized after my fusion rework that there wasn't any ingame way to really quantify how good a fusion reaction was, which is a mistake on my part. Now, you can analyze the power of a fusion reaction and its tier after it happens. I added analyzer_results, since reaction_results worked in a matter that didn't fit what I wanted (reset completely every react() cycle) and I didn't want to change it. analyzer_results is only ever initialized when it's actually going to be used, which currently is only for fusion.

    Overall fusion code cleanup

Pretty self-explanatory. I moved all the effects (radiation, tesla zap, etc) to one area instead of having it happen separately for every tier. Now the tiers just set variables used for those effects. Apologies if the diff is kinda hard to read.

    Changes to gases created

Low tier is now BZ/CO2, mid tier is nitryl/N2O, high tier is stimulum/pluoxium, and super tier is tritium.
Gas creation numbers are lower across the board, mostly for bz/nitryl/stim.
BZ/nitryl/stim were added in low quantities to the tiers to help with the progression of the various tiers. It didn't really make sense that before, super tier fusion gave stimulum/pluox when the only feasible way to get super tier fusion was using stimulum, and the low tier rewards were straight up useless. Tritium for super tier was chosen because I think it's the gas with the most potential of causing a massive disaster in this scenario.

    Plasma no longer counts towards gases fused

Before this change, I realized that you could just stack as much plasma as humanly possible and a minimum amount of trit to instantly get several thousand moles of BZ and potentially other gases for free. No thank you.

I'm still not 100% satisfied with fusion, so expect more PRs like this in the future.
This commit is contained in:
cyclowns
2018-08-05 03:48:16 -07:00
committed by oranges
parent a27fea4858
commit efe3f1e9de
9 changed files with 149 additions and 67 deletions

View File

@@ -0,0 +1,46 @@
//Nuclear particle projectile - a deadly side effect of fusion
/obj/item/projectile/energy/nuclear_particle
name = "nuclear particle"
icon_state = "nuclear_particle"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
damage = 20
damage_type = TOX
irradiate = 2500 //enough to knockdown and induce vomiting
speed = 0.4
hitsound = 'sound/weapons/emitter2.ogg'
impact_type = /obj/effect/projectile/impact/xray
var/static/list/particle_colors = list(
"red" = "#FF0000",
"blue" = "#00FF00",
"green" = "#0000FF",
"yellow" = "#FFFF00",
"cyan" = "#00FFFF",
"purple" = "#FF00FF"
)
/obj/item/projectile/energy/nuclear_particle/Initialize()
. = ..()
//Random color time!
var/our_color = pick(particle_colors)
add_atom_colour(particle_colors[our_color], FIXED_COLOUR_PRIORITY)
set_light(4, 3, particle_colors[our_color]) //Range of 4, brightness of 3 - Same range as a flashlight
/atom/proc/fire_nuclear_particles(power_ratio) //used by fusion to fire random # of nuclear particles - power ratio determines about how many are fired
var/random_particles = rand(3,6)
var/particles_to_fire
var/particles_fired
switch(power_ratio) //multiply random_particles * factor for whatever tier
if(0 to FUSION_MID_TIER_THRESHOLD)
particles_to_fire = random_particles * FUSION_PARTICLE_FACTOR_LOW
if(FUSION_MID_TIER_THRESHOLD to FUSION_HIGH_TIER_THRESHOLD)
particles_to_fire = random_particles * FUSION_PARTICLE_FACTOR_MID
if(FUSION_HIGH_TIER_THRESHOLD to FUSION_SUPER_TIER_THRESHOLD)
particles_to_fire = random_particles * FUSION_PARTICLE_FACTOR_HIGH
if(FUSION_SUPER_TIER_THRESHOLD to INFINITY)
particles_to_fire = random_particles * FUSION_PARTICLE_FACTOR_SUPER
while(particles_to_fire)
particles_fired++
var/angle = rand(0,360)
var/obj/item/projectile/energy/nuclear_particle/P = new /obj/item/projectile/energy/nuclear_particle(src)
addtimer(CALLBACK(P, /obj/item/projectile.proc/fire, angle), particles_fired) //multiply particles fired * delay so the particles end up stagnated (once every decisecond)
particles_to_fire--