Skip to content

Commit

Permalink
nuclear glowsticks
Browse files Browse the repository at this point in the history
  • Loading branch information
amylizzle committed Aug 29, 2023
1 parent 81decb4 commit 2da7736
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 7 deletions.
7 changes: 7 additions & 0 deletions code/modules/materials/Mat_FabParts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@
if(!I.material || (I.material.getID() != "starstone")) return 0
return ..()

/datum/matfab_part/glowstick
name = "Glowsticks"
checkMatch(var/obj/item/I)
if(!istype(I, /obj/item/device/light/glowstick)) return 0
return ..()


//////////////////////////////////////////////BASE CLASS BELOW

/// Base material fabrication part
Expand Down
18 changes: 18 additions & 0 deletions code/modules/materials/Mat_FabRecipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@
materials = list("!any"=2)
result = /obj/item/reactor_component/fuel_rod

/datum/matfab_recipe/makeshift_fuel_rod
name = "Makeshift Nuclear Fuel Rod"
desc = "A fuel rod for a nuclear reactor, made out of glowsticks"
category = "Nuclear"

New()
..()
required_parts.Add(new/datum/matfab_part/glowstick {part_name = "Glowstick"; required_amount = 1} ())

build(amount, obj/machinery/nanofab/owner)
for(var/i=0, i<amount, i++)
var/obj/item/device/light/glowstick/stick = getObjectByPartName("Glowstick")
var/datum/material/glowstick_mat = getMaterial("glowstick")
glowstick_mat = glowstick_mat.getMutable()
glowstick_mat.setColor(rgb(stick.col_r*255, stick.col_g*255, stick.col_b*255))
var/obj/item/reactor_component/fuel_rod/glowsticks/result_rod = new /obj/item/reactor_component/fuel_rod/glowsticks(glowstick_mat)
result_rod.set_loc(getOutputLocation(owner))

/datum/matfab_recipe/simple/nuclear/control_rod
name = "Control Rod"
desc = "A control rod for a nuclear reactor"
Expand Down
3 changes: 2 additions & 1 deletion code/modules/materials/Mat_Fabrication.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
blueprints = list(/datum/matfab_recipe/simple/nuclear/gas_channel,
/datum/matfab_recipe/simple/nuclear/heat_exchanger,
/datum/matfab_recipe/simple/nuclear/control_rod,
/datum/matfab_recipe/simple/nuclear/fuel_rod)
/datum/matfab_recipe/simple/nuclear/fuel_rod,
/datum/matfab_recipe/makeshift_fuel_rod)

/obj/machinery/nanofab/prototype
name = "Nano-fabricator (Protoype)"
Expand Down
10 changes: 10 additions & 0 deletions code/modules/materials/Mat_MaterialProcs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -733,3 +733,13 @@ triggerOnEntered(var/atom/owner, var/atom/entering)
attacker.visible_message("<span class='alert'>Cuts apart [owner], revealing space!</span>","<span class='alert'>You finish cutting apart [owner], revealing space.</span>","The sound of cutting cardboard stops.")
floor_owner.ReplaceWithSpace()
return

/datum/materialProc/glowstick_add
desc = "It has a chemical glow."
max_generations = 1
var/datum/component/loctargeting/sm_light/light_c

execute(var/atom/owner)
var/list/color = rgb2num(owner.material.getColor())
light_c = owner.AddComponent(/datum/component/loctargeting/sm_light, color[1], color[2], color[3], 255 * 0.33)
light_c.update(1)
19 changes: 19 additions & 0 deletions code/modules/materials/Mat_Materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1855,3 +1855,22 @@ ABSTRACT_TYPE(/datum/material/rubber)
setProperty("n_radioactive", 5)
setProperty("radioactive", 3)
setProperty("electrical", 7)

/// Material for bundles of glowsticks as fuel rods
/datum/material/metal/glowstick
mat_id = "glowstick"
name = "glowsticks" //"it is made of glowsticks"
canMix = 0 //don't make alloys of this
desc = "It's just a bunch of glowsticks stuck together. How is this an ingot?"
color = "#00e618"
alpha = 200
quality = 60

New()
..()
setProperty("density", 3)
setProperty("hard", 3)
setProperty("radioactive", 1)
setProperty("electrical", 2)
setProperty("thermal", 3)
addTrigger(TRIGGERS_ON_ADD, new /datum/materialProc/glowstick_add())
11 changes: 11 additions & 0 deletions code/obj/nuclearreactor/nuclearreactor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,17 @@
src.component_grid[x][y] = new /obj/item/reactor_component/fuel_rod("cerenkite")
..()

/obj/machinery/atmospherics/binary/nuclear_reactor/prefilled/glowstick
New()
var/datum/material/glowstick_mat = getMaterial("glowstick")
glowstick_mat = glowstick_mat.getMutable()

for(var/x=1 to REACTOR_GRID_WIDTH)
for(var/y=1 to REACTOR_GRID_HEIGHT)
glowstick_mat.setColor(rgb(rand(0,255), rand(0,255), rand(0,255)))
src.component_grid[x][y] = new /obj/item/reactor_component/fuel_rod/glowsticks(glowstick_mat)
..()

#undef REACTOR_GRID_WIDTH
#undef REACTOR_GRID_HEIGHT
#undef REACTOR_TOO_HOT_TEMP
Expand Down
24 changes: 18 additions & 6 deletions code/obj/nuclearreactor/reactorcomponents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ ABSTRACT_TYPE(/obj/item/reactor_component)
var/thermal_mass = 420*250//specific heat capacity of steel (420 J/KgK) * mass of component (Kg)


New(material_name="steel")
New(material="steel")
..()
src.setMaterial(getMaterial(material_name))
if(istype(material, /datum/material))
src.setMaterial(material)
else
src.setMaterial(getMaterial(material))
melt_health = _max_health
var/img_check = ui_image_base64_cache[src.type]
if (img_check)
Expand Down Expand Up @@ -90,9 +93,6 @@ ABSTRACT_TYPE(/obj/item/reactor_component)
else
src.cap_icon.Blend(rgb(setcolor[1],setcolor[2],setcolor[3],setcolor[4]), ICON_MULTIPLY)




proc/melt()
if(melted)
return
Expand Down Expand Up @@ -243,6 +243,17 @@ ABSTRACT_TYPE(/obj/item/reactor_component)
extra_info()
. = ..()
. += "Radioactivity: [max(src.material.getProperty("n_radioactive")*10,src.material.getProperty("radioactive")*10)]%"

/obj/item/reactor_component/fuel_rod/glowsticks
name = "makeshift fuel rod"
desc = "A fuel rod fo- hey this is just a bundle of glowsticks!"
melting_point = T0C+400 //plastic glowsticks melt easy

New(material)
if(isnull(material))
.=..("glowstick") //force material
else
.=..()
////////////////////////////////////////////////////////////////
//Control rod
/obj/item/reactor_component/control_rod
Expand Down Expand Up @@ -479,7 +490,8 @@ ABSTRACT_TYPE(/obj/item/reactor_component)
15;"cardboard",\
15;"frozenfart",\
5;"negativematter",\
5;"plutonium"
5;"plutonium",\
100; "glowstick"

/obj/item/reactor_component/fuel_rod/random_material
New()
Expand Down

0 comments on commit 2da7736

Please sign in to comment.