Skip to content

Commit

Permalink
soth (#37440)
Browse files Browse the repository at this point in the history
* fixes

* container fixes

* bigger radiation

* linter fix maybe?

* var/list/list/obj/list/list/obj/aaaaaaaaa=list()

* better manuals, ?.

* construct

* test

* constructn

* radon ISC fix?

* suggested change

Co-authored-by: west3436 <[email protected]>

* suggested change

Co-authored-by: west3436 <[email protected]>

---------

Co-authored-by: west3436 <[email protected]>
  • Loading branch information
CrazyAmphibian and west3436 authored Feb 24, 2025
1 parent cfe500d commit c5787f4
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 36 deletions.
1 change: 0 additions & 1 deletion code/datums/supply_packs/engineering.dm
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@
/obj/item/weapon/storage/box/fissionsupply_genericassembly,
/obj/item/weapon/circuitboard/fission_control_rod, //gives you 2 expansion parts (control/fuel rod) and the casing needed to add.
/obj/item/weapon/circuitboard/fission_fuel_rod,
/obj/item/weapon/circuitboard/fission_control_rod,
/obj/item/weapon/circuitboard/fission_fuel_rod,
/obj/item/weapon/storage/box/fissionsupply_casing,
/obj/item/weapon/storage/box/fissionsupply_casing,
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items/stacks/stack_recipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,9 @@ var/list/datum/stack_recipe/plasteel_recipes = list (
null,
new/datum/stack_recipe("Reinforced machine frame", /obj/machinery/constructable_frame/machine_frame/reinforced, 5, time = 60, one_per_turf = 1 ),
null,
new/datum/stack_recipe("Reactor casing frame", /obj/structure/girder/reactor, 4, time = 50, one_per_turf = 1 ),
new/datum/stack_recipe("Reactor casing frame", /obj/structure/girder/reactor, 4, time = 30, one_per_turf = 1 ),
new/datum/stack_recipe("Reactor fuel reservoir", /obj/item/weapon/fuelrod, 2, time = 25),
new/datum/stack_recipe("Small reactor fuel reservoir", /obj/item/weapon/fuelrod/small, 1, time = 10),
)

/* ====================================================================
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/items/weapons/manuals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1463,11 +1463,11 @@ building a reactor is an expensive endeavor, costing a lot of both time and reso
The design of a nuclear reactor is very important. Build it wrong, and you may find yourself with a meltdown.

<h3>Casing</h3>
The casing of a reactor should include the whole perimeter of it, with no gaps.
The casing of a reactor should include the whole perimeter of it, with no gaps. A reactor will leak radiation and coolant into the environment if a casing is removed during operation.
<h3>Coolant Ports</h3>
A reactor should have at least 2 ports, one for a coolant input, and another for output. coolant ports can be placed at any point in the casing.
A reactor should have at least 2 ports: one for a coolant input, and another for output. Coolant ports can be placed at any point in the casing. Coolant ports simply equalize the pressure between the gas inside of the reactor and the pipe connected to it, meaning that pumps or vents are required to properly pass coolant through the reactor.
<h3>controller</h3>
A reactor can only have 1 controller to it, and must be placed at a corner of a reactor.
A reactor can only have 1 controller to it, and must be placed at a corner of a reactor. The corner which it is placed at does not matter.
<h3>Fuel Rods</h3>
Fuel rods should be placed in the interior of the reactor. For each cardinally-adjacent fuel rod, a fuel rod will gain bonus power production without affecting fuel duration. Fuel duration is only affected by the number of fuel rod assemblies.
<h3>Control Rods</h3>
Expand Down
10 changes: 8 additions & 2 deletions code/modules/fissionreactor/cleanup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,11 @@ objects used when a reactor goes boomy boom so there's some nasty rads and thing


/obj/machinery/corium/process()
for(var/mob/living/l in range(src.loc, 5))
l.apply_radiation(rads, RAD_EXTERNAL)
for(var/mob/living/l in range(src.loc, 10))
var/dx=l.x-x
var/dy=l.y-y
var/dist=(dx*dx+dy*dy)**0.5
l.apply_radiation(rads* (1.0-(dist/14)) , RAD_EXTERNAL) //div by 14 because 10 is a square, so multiply it by root2 to get the max distance as a circle.



15 changes: 8 additions & 7 deletions code/modules/fissionreactor/fission_datums.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ datums for the fission reactor, which includes the fuel and reactor
#define FISSIONREACTOR_SAFEENUFFTEMP 1000 //temp where SCRAM resets

/datum/fission_reactor_holder
var/list/fuel_rods=list() //phase 0 vars, set upon construction
var/list/control_rods=list()
var/list/coolant_ports=list()
var/list/casing_parts=list()
var/list/obj/machinery/fissionreactor/fissionreactor_fuelrod/fuel_rods=list() //phase 0 vars, set upon construction
var/list/obj/machinery/fissionreactor/fissionreactor_controlrod/control_rods=list()
var/list/obj/machinery/atmospherics/unary/fissionreactor_coolantport/coolant_ports=list()
var/list/obj/structure/fission_reactor_case/casing_parts=list()
var/list/breaches=list()
var/obj/machinery/fissioncontroller/controller=null
var/heat_capacity=0
Expand Down Expand Up @@ -374,7 +374,8 @@ datums for the fission reactor, which includes the fuel and reactor
crads=((fuel.wattage-fuel.absorbance)*fuel.life)/100000 //100kw nets 1 rad.
for(var/i=1,i<=reactorarea2,i++)
if(rand()<=0.5*dt)
for (var/obj/o in randomtileinreactor().contents)
var/turf/t=randomtileinreactor()
for (var/obj/o in t?.contents)

if(istype(o, /obj/machinery/fissioncontroller))
new /obj/machinery/corium(o.loc,crads+crads*0.5*(rand()-0.5)) //25% variance on the radiation levels.
Expand All @@ -391,7 +392,7 @@ datums for the fission reactor, which includes the fuel and reactor
else if(istype(o,/obj/machinery/atmospherics/unary/fissionreactor_coolantport))
new /obj/machinery/corium(o.loc,crads+crads*0.5*(rand()-0.5))
qdel(o)
for(var/mob/living/l in range(locate(origin_x,origin_y,zlevel), 5))
for(var/mob/living/l in range(locate(origin_x,origin_y,zlevel), 10))
l.apply_radiation(crads*5, RAD_EXTERNAL)


Expand Down Expand Up @@ -566,7 +567,7 @@ datums for the fission reactor, which includes the fuel and reactor
if(rand()>0.5) //50% chance every tick to leak
var/datum/gas_mixture/removed= coolant.remove(coolant.total_moles*0.5*dt*rand(),TRUE,TRUE) //when we leak, leak 0-50% of the coolant
breachlocation.return_air().merge(removed,TRUE)
for(var/mob/living/l in range(breachlocation, 5))
for(var/mob/living/l in range(breachlocation, 10))
var/rads = ( fuelpower*powerfactor/100000 ) * sqrt(1/(max(get_dist(l, breachlocation), 1)))
l.apply_radiation(rads, RAD_EXTERNAL)

Expand Down
34 changes: 19 additions & 15 deletions code/modules/fissionreactor/fuelmaker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ the machine which makes fuel reservoirs have things in them.
to_chat(user,"There's already a fuel reservoir inserted into \the [src].")
else
if(!user.drop_item(I))
return
return TRUE
to_chat(user,"You insert the fuel reservoir into \the [src].")
I.forceMove(src)
heldrod=I
Expand All @@ -46,7 +46,7 @@ the machine which makes fuel reservoirs have things in them.
ask_remakeUI()
playsound(src,'sound/items/crowbar.ogg',50)
update_icon()
return
return TRUE
if(iscrowbar(I) && heldrod)
user.visible_message("<span class='notice'>[user] starts prying the fuel reservoir out of \the [src].</span>", "<span class='notice'>You start prying the fuel reservoir out of \the [src].</span>")
playsound(src,'sound/items/crowbar.ogg',50)
Expand All @@ -56,28 +56,34 @@ the machine which makes fuel reservoirs have things in them.
ask_remakeUI()
playsound(src,'sound/machines/door_unbolt.ogg',50)
update_icon()
return
return TRUE

if(I.is_screwdriver(user))
I.playtoolsound(src, 100)
user.visible_message("<span class='notice'>[user] [hatchopen ? "closes" : "opens"] the maintenance hatch of the [src].</span>", "<span class='notice'>You [hatchopen ? "close" : "open"] the maintenance hatch of the [src].</span>")
hatchopen=!hatchopen
return TRUE
if(iscrowbar(I))
I.playtoolsound(src, 100)
user.visible_message("<span class='warning'>[user] starts prying the electronics out of \the [src].</span>", "<span class='notice'>You start prying the electronics out of \the [src].</span>")
if(do_after(user, src, 30 ))
user.visible_message("<span class='warning'>[user] pries the electronics out of \the [src]</span>","<span class='notice'>You pry the electronics out of \the [src].</span>")
var/obj/machinery/constructable_frame/machine_frame/newframe= new /obj/machinery/constructable_frame/machine_frame(loc)
newframe.set_build_state(3)
newframe.set_build_state(2)
newframe.forceMove(loc)
newframe.circuit= new /obj/item/weapon/circuitboard/fission_fuelmaker
newframe.components+=new /obj/item/weapon/stock_parts/console_screen
newframe.components+=new /obj/item/weapon/stock_parts/manipulator
newframe.components+=new /obj/item/weapon/stock_parts/matter_bin
newframe.components+=new /obj/item/weapon/stock_parts/matter_bin
newframe.components+=new /obj/item/weapon/stock_parts/scanning_module
newframe.components+=new /obj/item/weapon/stock_parts/scanning_module
new /obj/item/weapon/circuitboard/fission_fuelmaker(loc)
new /obj/item/weapon/stock_parts/console_screen(loc)
new /obj/item/weapon/stock_parts/manipulator(loc)
new /obj/item/weapon/stock_parts/matter_bin(loc)
new /obj/item/weapon/stock_parts/matter_bin(loc)
new /obj/item/weapon/stock_parts/scanning_module(loc)
new /obj/item/weapon/stock_parts/scanning_module(loc)
if(container)
container.forceMove(loc)
if(heldrod)
heldrod.forceMove(loc)
qdel(src)
return TRUE
if( istype(I,/obj/item/weapon/reagent_containers) )
var/obj/item/weapon/reagent_containers/C=I
if(container)
Expand All @@ -90,8 +96,6 @@ the machine which makes fuel reservoirs have things in them.
to_chat(user,"You add \the [C] to \the [src]")
ask_remakeUI()
return TRUE


//..()


Expand Down Expand Up @@ -171,7 +175,7 @@ the machine which makes fuel reservoirs have things in them.
return "no fuel reservoir"
if(reagent_id==RADON || reagent_id=="RADON")
if(air_contents)
var/actually_taken=heldrod.fueldata.take_shit_from(reagent_id,amount ,heldrod.fueldata.fuel)
var/actually_taken=heldrod.fueldata.take_shit_from(RADON,amount ,heldrod.fueldata.fuel)
if(!air_contents.gas[GAS_RADON])
air_contents.gas[GAS_RADON]=0
air_contents.gas[GAS_RADON]+=actually_taken
Expand All @@ -196,7 +200,7 @@ the machine which makes fuel reservoirs have things in them.
var/avalible_gas=air_contents.gas[GAS_RADON] || 0
amount=min(amount,avalible_gas,heldrod.units_of_storage-heldrod.fueldata.fuel.total_volume)
air_contents.gas[GAS_RADON]= max(0,avalible_gas-amount)
heldrod.fueldata.add_shit_to(reagent_id,amount ,heldrod.fueldata.fuel)
heldrod.fueldata.add_shit_to(RADON,amount ,heldrod.fueldata.fuel)
air_contents.update_values()
if(network)
network.update=1
Expand Down
25 changes: 18 additions & 7 deletions code/modules/fissionreactor/objects_external.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ included:
return
var/obj/item/tool/weldingtool/WT = I
user.visible_message("<span class='notice'>[user] starts welding \the [src]'s external plating off its frame.</span>", "<span class='notice'>You start welding \the [src]'s external plating off its frame.</span>")
if(WT.do_weld(user,src,60,0))
if(WT.do_weld(user,src,40,0))
var/obj/structure/girder/reactor/newcase= new /obj/structure/girder/reactor(loc)
newcase.forceMove(loc)
newcase.dir=dir
newcase.pipeadded=TRUE
newcase.state=3
newcase.update_icon()
qdel(src)

/obj/machinery/atmospherics/unary/fissionreactor_coolantport/update_icon()
Expand Down Expand Up @@ -760,10 +762,11 @@ included:
return
var/obj/item/tool/weldingtool/WT = I
user.visible_message("<span class='notice'>[user] starts welding \the [src]'s external plating off its frame.</span>", "<span class='notice'>You start welding \the [src]'s external plating off its frame.</span>")
if(WT.do_weld(user,src,60,0))
if(WT.do_weld(user,src,40,0))
var/obj/structure/girder/reactor/newcase= new /obj/structure/girder/reactor(loc)
newcase.forceMove(loc)
newcase.state=3
newcase.update_icon()
qdel(src)


Expand All @@ -783,9 +786,15 @@ included:
/obj/structure/girder/reactor
name="reactor casing girder"
material=/obj/item/stack/sheet/plasteel
construction_length=60
construction_length=40
var/pipeadded=FALSE



/obj/structure/girder/reactor/update_icon()
..()
overlays=null
if(pipeadded)
overlays+=image('icons/obj/fissionreactor/reactorcase.dmi', src,"coonantpipeoverlay")

/obj/structure/girder/reactor/examine()
..()
Expand Down Expand Up @@ -816,7 +825,7 @@ included:
if (dir&NORTH)
dirstr="north"
if (dir&SOUTH)
dirstr="soth"
dirstr="south"
if (dir&EAST)
dirstr="east"
if (dir&WEST)
Expand Down Expand Up @@ -847,7 +856,7 @@ included:
user.visible_message("<span class='notice'>[user] starts disassembling \the [src].</span>", "<span class='notice'>You start disassembling \the [src].</span>")
if(do_after(user, src, construction_length))
user.visible_message("<span class='warning'>[user] dissasembles \the [src].</span>", "<span class='notice'>You dissasemble \the [src].</span>")
new material(get_turf(src), 2)
new material(get_turf(src), 4)
qdel(src)
return
to_chat(user, "<span class='notice'>You can't find a use for \the [W]</span>")
Expand Down Expand Up @@ -911,15 +920,17 @@ included:
return
qdel(W)
pipeadded=TRUE
overlays+=image('icons/obj/fissionreactor/reactorcase.dmi', src,"coonantpipeoverlay")
user.visible_message("<span class='notice'>[user] adds piping into \the [src].</span>", "<span class='notice'>You add piping into \the [src].</span>")
return
if(pipeadded && W.is_wrench(user))
W.playtoolsound(src, 100)
to_chat(user, "<span class='notice'>You remove the piping from \the [src]</span>")
var/obj/item/pipe/np= new /obj/item/pipe(loc)
np.pipe_type=1
np.pipe_type=0
np.forceMove(loc)
pipeadded=FALSE
overlays=null
return
if(pipeadded && iscrowbar(W))
W.playtoolsound(src, 100)
Expand Down
11 changes: 11 additions & 0 deletions code/modules/fissionreactor/objects_internal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,22 @@ included:
associated_reactor.handledestruction(src)
..()

//commented out while a better sound solution is added, since this is buggy. here because pushing a hotfix.
/*
/obj/machinery/fissionreactor/process()
..()
if(associated_reactor && associated_reactor.considered_on())
var/volume=30*(1-associated_reactor.control_rod_insertion)+10 //volume ranges 10-40 depending on the rod level
playsound(src,'sound/machines/fission/reactor_hum.ogg',volume,1,5) //very low variance. some extra range
*/


/obj/machinery/fissionreactor/fissionreactor_controlrod
name="fission reactor control rod assembly"
desc="Monitors a nuclear reactor and can slow or halt the fission process if needed."
icon='icons/obj/fissionreactor/controlrod.dmi'
icon_state="controlrod_off"


/obj/machinery/fissionreactor/fissionreactor_controlrod/examine()
..()
Expand Down
Binary file modified icons/obj/fissionreactor/fuelrod.dmi
Binary file not shown.
Binary file added sound/machines/fission/reactor_hum.ogg
Binary file not shown.

0 comments on commit c5787f4

Please sign in to comment.