Files
Batrachophreno b3b4f4b9c6 INDRA, general nuclear fusion update (#21285)
Fixes https://github.com/Aurorastation/Aurora.3/issues/18951
Fixes https://github.com/Aurorastation/Aurora.3/issues/19447
Fixes https://github.com/Aurorastation/Aurora.3/issues/20283
Fixes https://github.com/Aurorastation/Aurora.3/issues/21395

Overhauls a wide variety of INDRA behaviors and related gas/material
properties.
changes:
- balance: "Fusion reaction modifications. Higher radiation and
temperature output, comparable power output."
- balance: "Increased rad resistance modifier of Borosilicate Windows
from 1 -> 4 and (closed) Blast Doors from 1 -> 6."
- balance: "INDRA Field Strength minima/maxima changed from 1-100 ->
20-120. Power costs increased significantly."
- balance: "INDRA instability increase per tick now limited, similar to
Supermatter (prevents sudden instability spike from instantly nuking
it)."
  - balance: "APC cell charge rate increased 10x."
  - balance: "Rebalanced contents of INDRA hard storage compartment."
  - balance: "SMES coils capacities halved, throughputs doubled."
  - balance: "SMES unit maximum coil capacity increased from 6 -> 8."
- balance: "TEG maximum power output increased from 500000 -> 2500000."
- balance: "Power wasted from exceeding TEG maximum power output
decreased from 50% to 33%."
- balance: "Portable generators of all types have had their power
generation capacity doubled."
- rscadd: "New 'Fusion Codex' app added for all crew with ACCESS_ENGINE
that details all available nuclear fusion chains."
- rscadd: "Boron added as a singleton/reagent. Poisonous to vaurca,
still usable in nuclear fusion as fuel assembly rods."
- rscadd: "INDRA Field Strength now scales plasma temperature entropy,
power output from temperature multiplier, and instability increase per
tick."
- refactor: "'Boron' gas renamed to 'Helium-3'. Boron is not a gas. Deal
with it."
  - refactor: "'Steam' gas renamed to 'Water Vapor'."
  - code_imp: "Descriptions added to gas singletons for future use."
  - qol: "Minor remap of INDRA control room for usability."
  - qol: "Standardized gas canister naming conventions."
- qol: "INDRA and APC TGUI interfaces now use use kW, MW abbreviations
for high wattages."
- bugfix: "INDRA Kinetic Harvester no longer rapidly deselects materials
for harvest when too many are being generated at once."
- bugfix: "INDRA EM Field effect no longer considers the camera within
its reactor chamber a destabilizing influence."
  - bugfix: "INDRA reactor core now produces radiation as intended."
- bugfix: "Deuterium and Tritium canisters no longer contain 50%
standard hydrogen (inheritance issue)."

---------

Signed-off-by: Batrachophreno <Batrochophreno@gmail.com>
Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>
Co-authored-by: Geeves <22774890+Geevies@users.noreply.github.com>
2025-10-05 20:13:06 +00:00

297 lines
9.8 KiB
Plaintext

/obj/item/custom_ka_upgrade/cells/attack_self(mob/user)
if(is_pumping)
return
if(pump_restore)
is_pumping = TRUE
if(stored_charge >= cell_increase)
to_chat(user, SPAN_WARNING("The pump on \the [src] refuses to move."))
else
if(!pump_delay || do_after(user, pump_delay, do_flags = (DO_SHOW_PROGRESS|DO_USER_CAN_MOVE|DO_USER_CAN_TURN)))
if(last_pump < world.time)
if(isturf(src.loc))
to_chat(user, SPAN_NOTICE("You pump \the [src]."))
else
to_chat(user, SPAN_NOTICE("You pump \the [src.loc]."))
last_pump = world.time + 100 // every ten seconds
stored_charge = min(stored_charge + pump_restore, cell_increase)
playsound(src, 'sound/weapons/kinetic_reload.ogg', 50, FALSE)
is_pumping = FALSE
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
/obj/item/custom_ka_upgrade/cells/cell01
//Pump Action
name = "pump recharging KA cell"
build_name = "pump-recharging"
desc = "A very basic power cell and pump action combo that stores 4 charges. Low capacity however it has slightly increased range."
icon_state = "cell01"
firedelay_increase = 0.25 SECONDS
range_increase = 2
recoil_increase = -3
cell_increase = 4
capacity_increase = -1
mod_limit_increase = 0
pump_restore = 1
pump_delay = 0.4 SECONDS
origin_tech = list(TECH_MATERIAL = 1,TECH_ENGINEERING = 1,TECH_MAGNET = 1,TECH_POWER = 1)
/obj/item/custom_ka_upgrade/cells/cell02
//Pump Action
name = "advanced pump recharging KA cell"
build_name = "pump-recharging"
desc = "A somewhat more advanced, standard issue pump and cell assembly that stores charges up to a capacity of 12. Can fire and pump quite quickly."
icon_state = "cell02"
firedelay_increase = 0.1 SECONDS
recoil_increase = 1
cell_increase = 12
capacity_increase = -2
mod_limit_increase = 0
pump_restore = 1
pump_delay = 0.3 SECONDS
origin_tech = list(TECH_MATERIAL = 3,TECH_ENGINEERING = 1,TECH_MAGNET = 1,TECH_POWER = 3)
/obj/item/custom_ka_upgrade/cells/cell03
name = "kinetic charging KA cell"
build_name = "kinetic"
desc = "A complex pump and cell assembly that uses the kinetic energy of an initial pump to significantly charge the cell. Deals increased damage at the cost of reduced firerate."
icon_state = "cell03"
damage_increase = 10
firedelay_increase = 0.5 SECONDS
cost_increase = -1
cell_increase = 40
capacity_increase = -3
mod_limit_increase = 0
pump_restore = 40
pump_delay = 1 SECONDS
origin_tech = list(TECH_MATERIAL = 4,TECH_ENGINEERING = 3,TECH_MAGNET = 2,TECH_POWER = 3)
/obj/item/custom_ka_upgrade/cells/cell04
name = "uranium charging KA cell"
build_name = "recharging"
desc = "A pumpless cell assembly that containes a miniaturized nuclear reactor housed safely inside the assembly. Recharges the cell shortly over time, however deals slightly reduced damage."
icon_state = "cell04"
firedelay_increase = 0.1 SECONDS
damage_increase = -5
recoil_increase = 0
cost_increase = 0
cell_increase = 60
capacity_increase = -4
mod_limit_increase = 0
pump_restore = 0
pump_delay = 0
origin_tech = list(TECH_MATERIAL = 5,TECH_ENGINEERING = 4,TECH_MAGNET = 3,TECH_POWER = 5)
/obj/item/custom_ka_upgrade/cells/cell04/on_update(var/obj/item/gun/custom_ka/the_gun)
stored_charge = min(stored_charge + 3,cell_increase)
/obj/item/custom_ka_upgrade/cells/cell05
name = "recoil reloader KA cell"
build_name = "recoil-reloading"
desc = "A very experimental and well designed cell and pump assembly that converts some of the kinetic energy from the weapon's recoil into usable energy. Only works if the recoil is high enough. Contains a basic top-mounted pump just in case, however it blocks the chip slot."
icon_state = "cell05"
firedelay_increase = 0.4 SECONDS
damage_increase = 0
recoil_increase = -5
cost_increase = -3
cell_increase = 80
capacity_increase = -5
mod_limit_increase = 0
pump_restore = 5
pump_delay = 0.5 SECONDS
origin_tech = list(TECH_MATERIAL = 5,TECH_ENGINEERING = 6,TECH_MAGNET = 5,TECH_POWER = 5, TECH_PHORON = 5)
disallow_chip = TRUE
/obj/item/custom_ka_upgrade/cells/cell05/on_fire(var/obj/item/gun/custom_ka/the_gun)
if(the_gun.recoil_increase > 0)
stored_charge = min(stored_charge + min(the_gun.recoil_increase*2,the_gun.cost_increase*0.5),cell_increase)
/obj/item/custom_ka_upgrade/cells/cyborg
name = "cyborg KA cell"
build_name = "battery powered"
desc = "A pumpless cell assembly that leaches power from the cyborg's internal battery."
icon_state = "cell_cyborg"
damage_increase = 0
recoil_increase = 0
cost_increase = 0
cell_increase = 20
capacity_increase = 0
mod_limit_increase = 0
firedelay_increase = 0.25 SECONDS
pump_restore = 0
pump_delay = 0
origin_tech = list()
/obj/item/custom_ka_upgrade/cells/cyborg/on_update(var/obj/item/gun/custom_ka/the_gun)
var/mob/living/silicon/robot/owner_robot = the_gun.loc
if(!istype(owner_robot))
return
var/obj/item/cell/external = owner_robot.cell
var/charge_to_give = cell_increase - stored_charge
if(istype(external) && external.use(charge_to_give*5))
stored_charge += charge_to_give
/obj/item/custom_ka_upgrade/cells/exosuit
name = "exosuit KA cell"
build_name = "battery powered"
desc = "A pumpless cell assembly that leaches power from the exosuit's power core."
icon_state = "cell_cyborg"
damage_increase = 0
recoil_increase = 0
cost_increase = 0
cell_increase = 150
capacity_increase = 0
mod_limit_increase = 0
firedelay_increase = 0.1 SECONDS
pump_restore = 0
pump_delay = 0
origin_tech = list()
/obj/item/custom_ka_upgrade/cells/exosuit/on_update(var/obj/item/gun/custom_ka/the_gun)
var/charge_to_give = cell_increase - stored_charge
if(!charge_to_give)
return
var/obj/item/mecha_equipment/mounted_system/mining/kinetic_accelerator/owner_equipment = the_gun.loc
if(!istype(owner_equipment))
return
var/mob/living/heavy_vehicle/owner_exosuit = owner_equipment.loc
if(!istype(owner_exosuit))
return
var/obj/item/cell/external = owner_exosuit.get_cell()
if(istype(external) && external.use(charge_to_give * 5))
stored_charge += charge_to_give
/obj/item/custom_ka_upgrade/cells/illegal
//Pump Action
name = "pump action KA cell"
build_name = "pump-action"
desc = "A clusterfuck of circuitry and battery parts all snuggly fit inside a solid, static plastisteel frame. A single pump is enough to fully charge any set-up."
icon_state = "cell_illegal"
firedelay_increase = 0
recoil_increase = 0
cost_increase = -100
stored_charge = 5
cell_increase = 5
capacity_increase = 0
mod_limit_increase = 0
pump_restore = 30
pump_delay = 0.3 SECONDS
origin_tech = list(TECH_MATERIAL = 3,TECH_ENGINEERING = 3,TECH_MAGNET = 3,TECH_POWER = 3, TECH_ILLEGAL = 4)
/obj/item/custom_ka_upgrade/cells/inertia_charging
name = "inertial charging KA cell"
build_name = "inertial recharging"
desc = "A curious cell and pump combo that automatically charges based on how much charge is already present in the cell."
icon_state = "cell_burst"
firedelay_increase = 0.1 SECONDS
damage_increase = 0
recoil_increase = 0
cost_increase = 0
cell_increase = 30
capacity_increase = -4
mod_limit_increase = 0
pump_restore = 3
pump_delay = 0.3 SECONDS
origin_tech = list(TECH_MATERIAL = 6,TECH_ENGINEERING = 5,TECH_MAGNET = 4,TECH_POWER = 6)
/obj/item/custom_ka_upgrade/cells/inertia_charging/on_update(var/obj/item/gun/custom_ka/the_gun)
stored_charge = min(stored_charge + round(stored_charge*0.2),cell_increase)
/obj/item/custom_ka_upgrade/cells/loader
name = "phoron loading KA cell"
build_name = "phoron loading"
desc = "A bottom feeding mount that accepts sheets of phoron, and processes them into useable energy. Wildy ineffecient and expensive to maintain, however the charge lasts a while and the damage boost makes it worth it."
icon_state = "cell_phoronloader"
damage_increase = 10
recoil_increase = 2
cell_increase = 250
capacity_increase = -5
pump_restore = 0
pump_delay = 0
origin_tech = list(TECH_MATERIAL = 5,TECH_ENGINEERING = 6,TECH_MAGNET = 5,TECH_POWER = 6, TECH_PHORON = 5)
var/type_to_take = "phoron"
var/charge_per_sheet = 100
/obj/item/custom_ka_upgrade/cells/loader/attackby(obj/item/attacking_item, mob/user)
var/obj/item/stack/material/the_sheet = attacking_item
if(istype(the_sheet) && the_sheet.default_type == type_to_take)
var/amount_to_take = 1
if(stored_charge + charge_per_sheet > cell_increase)
to_chat(user,SPAN_NOTICE("You can't put any more [attacking_item] into \the [src]."))
return
amount_to_take = min(amount_to_take,the_sheet.amount)
the_sheet.amount -= amount_to_take
stored_charge += amount_to_take*charge_per_sheet
user.visible_message(SPAN_NOTICE("\The [user] inserts a sheet [attacking_item] into \the [src]."), \
SPAN_NOTICE("You insert a sheet of [attacking_item]s into \the [src]."), \
SPAN_NOTICE("You hear mechanical whirring."))
if(the_sheet.amount <= 0)
qdel(attacking_item)
/obj/item/custom_ka_upgrade/cells/loader/uranium
name = "uranium loading KA cell"
build_name = "uranium loading"
desc = "A bottom feeding mount that accepts sheets of uranium, and processes them into useable energy. Wildy ineffecient and expensive to maintain, however the charge lasts a while."
icon_state = "cell_uraniumloader"
cell_increase = 300
capacity_increase = -5
firedelay_increase = 0.5 SECONDS
pump_restore = 0
pump_delay = 0
origin_tech = list(TECH_MATERIAL = 5,TECH_ENGINEERING = 6,TECH_MAGNET = 5,TECH_POWER = 6)
type_to_take = "uranium"
charge_per_sheet = 75
/obj/item/custom_ka_upgrade/cells/loader/hydrogen
name = "hydrogen loading KA cell"
build_name = "hydrogen loading"
desc = "A bottom feeding mount that accepts sheets of hydrogen, and processes them into useable energy. Wildy ineffecient and expensive to maintain."
icon_state = "cell_hydrogenloader"
cell_increase = 100
capacity_increase = -4
pump_restore = 0
pump_delay = 0
origin_tech = list(TECH_MATERIAL = 4,TECH_ENGINEERING = 5,TECH_MAGNET = 4,TECH_POWER = 4)
type_to_take = "metallic hydrogen"
charge_per_sheet = 90