mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 16:38:22 +01:00
Converts Reagents to Typepaths and Centralises Reagent Spawning (#9140)
Converts reagents to use typepaths instead of IDs.
Centralises reagent spawning in a lot of places to use reagents_to_add instead of a variety of custom methods or initialise overrides.
This commit is contained in:
@@ -15,14 +15,14 @@
|
||||
var/list/forbidden = list(/obj/item/reagent_containers/inhaler, /obj/item/reagent_containers/hypospray, /obj/item/reagent_containers/glass, /obj/item/extinguisher)
|
||||
// duplicate from blender code, since it's not really worth a define. also, it has fewer things.
|
||||
var/list/sheet_reagents = list( //have a number of reagents which is a factor of REAGENTS_PER_SHEET (default 20) unless you like decimals
|
||||
/obj/item/stack/material/iron = list("iron"),
|
||||
/obj/item/stack/material/uranium = list("uranium"),
|
||||
/obj/item/stack/material/phoron = list("phoron"),
|
||||
/obj/item/stack/material/gold = list("gold"),
|
||||
/obj/item/stack/material/silver = list("silver"),
|
||||
/obj/item/stack/material/steel = list("iron", "carbon"),
|
||||
/obj/item/stack/material/sandstone = list("silicon", "acetone"),
|
||||
/obj/item/stack/material/glass = list("silicate"),
|
||||
/obj/item/stack/material/iron = list(/datum/reagent/iron),
|
||||
/obj/item/stack/material/uranium = list(/datum/reagent/uranium),
|
||||
/obj/item/stack/material/phoron = list(/datum/reagent/toxin/phoron),
|
||||
/obj/item/stack/material/gold = list(/datum/reagent/gold),
|
||||
/obj/item/stack/material/silver = list(/datum/reagent/silver),
|
||||
/obj/item/stack/material/steel = list(/datum/reagent/iron, /datum/reagent/carbon),
|
||||
/obj/item/stack/material/sandstone = list(/datum/reagent/silicon, /datum/reagent/acetone),
|
||||
/obj/item/stack/material/glass = list(/datum/reagent/silicate),
|
||||
) // removed borosilicate glass, platinum, and plasteel, too tough. just steal a grinder if you need it
|
||||
|
||||
/obj/structure/chemkit/Initialize()
|
||||
@@ -218,12 +218,12 @@
|
||||
if(!istype(R, /datum/reagent/alcohol))
|
||||
return
|
||||
var/datum/reagent/alcohol/AR = R
|
||||
reagents.add_reagent("water", (1-(AR.strength/100))*AR.volume)
|
||||
reagents.add_reagent(/datum/reagent/water, (1-(AR.strength/100))*AR.volume)
|
||||
if(istype(AR, /datum/reagent/alcohol/ethanol))
|
||||
reagents.add_reagent("ethanol", (AR.strength/100)*AR.volume)
|
||||
reagents.add_reagent(/datum/reagent/alcohol/ethanol, (AR.strength/100)*AR.volume)
|
||||
if(istype(AR, /datum/reagent/alcohol/butanol))
|
||||
reagents.add_reagent("butanol", (AR.strength/100)*AR.volume)
|
||||
reagents.remove_reagent(AR.id, AR.volume)
|
||||
reagents.add_reagent(/datum/reagent/alcohol/butanol, (AR.strength/100)*AR.volume)
|
||||
reagents.remove_reagent(AR.type, AR.volume)
|
||||
src.icon_state = "distillery-off"
|
||||
|
||||
/obj/structure/distillery/attackby(obj/item/W, mob/user)
|
||||
|
||||
Reference in New Issue
Block a user