Adds two new particle smasher recipies

This commit is contained in:
Casey
2021-11-20 05:42:00 -05:00
committed by Darlantan
parent fa3b80f5c6
commit f86e3f2b88
2 changed files with 56 additions and 4 deletions

View File

@@ -2,6 +2,9 @@
* Contains the particle smasher and its recipes.
*/
#define PS_RESULT_STACK "stack"
#define PS_RESULT_ITEM "item"
/obj/machinery/particle_smasher
name = "Particle Focus"
desc = "A strange device used to create exotic matter."
@@ -190,7 +193,7 @@
var/max_prob = 0
for(var/datum/particle_smasher_recipe/R in recipes) // Only things for the smasher. Don't get things like the chef's cake recipes.
if(R.probability) // It's actually a recipe you're supposed to be able to make.
if(istype(target, R.required_material))
if(!(R.required_material) || istype(target, R.required_material))
if(energy >= R.required_energy_min && energy <= R.required_energy_max) // The machine has enough Vaguely Defined 'Energy'.
var/turf/T = get_turf(src)
var/datum/gas_mixture/environment = T.return_air()
@@ -234,8 +237,11 @@
break
var/result = recipe.result
var/obj/item/stack/material/M = new result(src)
target = M
if(recipe.recipe_type == PS_RESULT_STACK)
var/obj/item/stack/material/M = new result(src)
target = M
else if(recipe.recipe_type == PS_RESULT_ITEM)
new result(get_turf(src))
update_icon()
/obj/machinery/particle_smasher/verb/eject_contents()
@@ -266,6 +272,7 @@
/datum/particle_smasher_recipe
var/list/reagents // example: = list("pacid" = 5)
var/list/items // example: = list(/obj/item/weapon/tool/crowbar, /obj/item/weapon/welder) Place /foo/bar before /foo. Do not include fruit. Maximum of 3 items.
var/recipe_type = PS_RESULT_STACK // Are we producing a stack or an item?
var/result = /obj/item/stack/material/iron // The sheet this will produce.
var/required_material = /obj/item/stack/material/iron // The required material sheet.
@@ -378,4 +385,35 @@
required_atmos_temp_min = 3000
required_atmos_temp_max = 10000
probability = 1
probability = 1
/datum/particle_smasher_recipe/donkpockets_coal
items = list(/obj/item/weapon/reagent_containers/food/snacks/donkpocket)
recipe_type = PS_RESULT_ITEM
result = /obj/item/weapon/ore/coal
required_material = null
required_energy_min = 1
required_energy_max = 500
required_atmos_temp_min = 400
required_atmos_temp_max = 20000
probability = 90
/datum/particle_smasher_recipe/donkpockets_ascend
items = list(/obj/item/weapon/reagent_containers/food/snacks/donkpocket)
reagents = list("phoron" = 120)
recipe_type = PS_RESULT_ITEM
result = /obj/item/weapon/reagent_containers/food/snacks/donkpocket/ascended
required_material = /obj/item/stack/material/uranium
required_energy_min = 501
required_energy_max = 700
required_atmos_temp_min = 400
required_atmos_temp_max = 20000
probability = 20