Reagent unit testing (#17080)

* initial port

* first ignore batch

* second exclusions

* Tequila fix

* Fixes Changeling Sting

* Virgin Mojito fix

* fixes Love Potion

* Rest of love potion

* Various fixes

* tweaks to unit test

* fix for decl

* get decl properly

* fixie

* put the box back

* tequila fix

* fixes tequila

* check dispenser carts too

* name not id

---------

Co-authored-by: Willburd <7099514+Willburd@users.noreply.github.com>
Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com>
This commit is contained in:
Cameron Lennox
2025-02-13 23:12:48 +01:00
committed by GitHub
co-authored by Willburd Selis
parent e94546badd
commit b949f63d27
27 changed files with 250 additions and 76 deletions
+12 -6
View File
@@ -1,5 +1,10 @@
// Gasses
// Dev
#define REAGENT_ID_DEVELOPER_WARNING "reagent"
#define REAGENT_DEVELOPER_WARNING "Reagent"
#define REAGENT_DESC_DEVELOPER_WARNING "A non-descript chemical."
// Gasses
#define GAS_CO2 "carbon_dioxide"
#define GAS_N2 "nitrogen"
#define GAS_N2O "nitrous_oxide"
@@ -7,6 +12,7 @@
#define GAS_PHORON "phoron"
#define GAS_VOLATILE_FUEL "volatile_fuel"
// Gas Reagents
#define REAGENT_CARBON_DIOXIDE "Carbon Dioxide"
#define REAGENT_NITROGEN "Nitrogen"
@@ -896,7 +902,7 @@
#define REAGENT_ID_NUCLEARWASTE "nuclearwaste"
#define REAGENT_SODAOIL "Soda Oil"
#define REAGENT_ID_SODAOIL "sodaoil"
#define REAGENT_VIRGINMOJITO "Mojito"
#define REAGENT_VIRGINMOJITO "Virgin Mojito"
#define REAGENT_ID_VIRGINMOJITO "virginmojito"
#define REAGENT_VIRGINSEXONTHEBEACH "Virgin Sex On The Beach"
#define REAGENT_ID_VIRGINSEXONTHEBEACH "virginsexonthebeach"
@@ -982,8 +988,8 @@
#define REAGENT_ID_SAKE "sake"
#define REAGENT_SEXONTHEBEACH "Sex On The Beach"
#define REAGENT_ID_SEXONTHEBEACH "sexonthebeach"
#define REAGENT_TEQUILLA "Tequila"
#define REAGENT_ID_TEQUILLA "tequilla"
#define REAGENT_TEQUILA "Tequila"
#define REAGENT_ID_TEQUILA "tequila"
#define REAGENT_THIRTEENLOKO "Thirteen Loko"
#define REAGENT_ID_THIRTEENLOKO "thirteenloko"
#define REAGENT_VERMOUTH "Vermouth"
@@ -1112,8 +1118,8 @@
#define REAGENT_ID_SUIDREAM "suidream"
#define REAGENT_SYNDICATEBOMB "Syndicate Bomb"
#define REAGENT_ID_SYNDICATEBOMB "syndicatebomb"
#define REAGENT_TEQUILLASUNRISE "Tequila Sunrise"
#define REAGENT_ID_TEQUILLASUNRISE "tequillasunrise"
#define REAGENT_TEQUILASUNRISE "Tequila Sunrise"
#define REAGENT_ID_TEQUILASUNRISE "tequilasunrise"
#define REAGENT_THREEMILEISLAND "Three Mile Island Iced Tea"
#define REAGENT_ID_THREEMILEISLAND "threemileisland"
#define REAGENT_PHORONSPECIAL "Toxins Special"
+1 -1
View File
@@ -172,7 +172,7 @@ var/syndicate_code_response//Code response for traitors.
var/safety[] = list(1,2,3)//Tells the proc which options to remove later on.
var/nouns[] = list("love","hate","anger","peace","pride","sympathy","bravery","loyalty","honesty","integrity","compassion","charity","success","courage","deceit","skill","beauty","brilliance","pain","misery","beliefs","dreams","justice","truth","faith","liberty","knowledge","thought","information","culture","trust","dedication","progress","education","hospitality","leisure","trouble","friendships", "relaxation")
var/drinks[] = list("vodka and tonic","gin fizz","bahama mama","manhattan","black Russian","whiskey soda","long island tea","margarita","Irish coffee"," manly dwarf","Irish cream","doctor's delight","Beepksy Smash","tequilla sunrise","brave bull","gargle blaster","bloody mary","whiskey cola","white Russian","vodka martini","martini","Cuba libre","kahlua","vodka","redwine","moonshine")
var/drinks[] = list("vodka and tonic","gin fizz","bahama mama","manhattan","black Russian","whiskey soda","long island tea","margarita","Irish coffee"," manly dwarf","Irish cream","doctor's delight","Beepksy Smash","tequila sunrise","brave bull","gargle blaster","bloody mary","whiskey cola","white Russian","vodka martini","martini","Cuba libre","kahlua","vodka","redwine","moonshine")
var/locations[] = teleportlocs.len ? teleportlocs : drinks//if null, defaults to drinks instead.
var/names[] = list()
+1 -1
View File
@@ -389,7 +389,7 @@
/obj/item/reagent_containers/food/drinks/bottle/gin,
/obj/item/reagent_containers/food/drinks/bottle/specialwhiskey,
/obj/item/reagent_containers/food/drinks/bottle/vodka,
/obj/item/reagent_containers/food/drinks/bottle/tequilla,
/obj/item/reagent_containers/food/drinks/bottle/tequila,
/obj/item/reagent_containers/food/drinks/bottle/absinthe,
/obj/item/reagent_containers/food/drinks/bottle/wine,
/obj/item/reagent_containers/food/drinks/bottle/cognac,
+2 -2
View File
@@ -39,7 +39,7 @@
/obj/item/reagent_containers/food/drinks/bottle/rum = 10,
/obj/item/reagent_containers/food/drinks/bottle/sake = 10,
/obj/item/reagent_containers/food/drinks/bottle/specialwhiskey = 10,
/obj/item/reagent_containers/food/drinks/bottle/tequilla = 10,
/obj/item/reagent_containers/food/drinks/bottle/tequila = 10,
/obj/item/reagent_containers/food/drinks/bottle/vermouth = 10,
/obj/item/reagent_containers/food/drinks/bottle/vodka = 10,
/obj/item/reagent_containers/food/drinks/bottle/whiskey = 10,
@@ -166,4 +166,4 @@
/obj/machinery/vending/deluxe_cigs/open
req_access = null
req_log_access = null
req_log_access = null
+5 -5
View File
@@ -114,7 +114,7 @@
/datum/reagent/ethanol/rum
price_tag = 5
/datum/reagent/ethanol/tequilla
/datum/reagent/ethanol/tequila
price_tag = 5
/datum/reagent/ethanol/thirteenloko
@@ -204,7 +204,7 @@
/datum/reagent/ethanol/booger
price_tag = 4
/datum/reagent/ethanol/brave_bull
/datum/reagent/ethanol/coffee/brave_bull
price_tag = 4
/datum/reagent/ethanol/changeling_sting
@@ -303,7 +303,7 @@
/datum/reagent/ethanol/syndicatebomb
price_tag = 4
/datum/reagent/ethanol/tequillasunrise
/datum/reagent/ethanol/tequila_sunrise
price_tag = 4
/datum/reagent/ethanol/threemileisland
@@ -465,7 +465,7 @@
/obj/item/reagent_containers/food/drinks/bottle/rum
price_tag = 15
/obj/item/reagent_containers/food/drinks/bottle/tequilla
/obj/item/reagent_containers/food/drinks/bottle/tequila
price_tag = 15
/obj/item/reagent_containers/food/drinks/bottle/vodka
@@ -1026,4 +1026,4 @@
//******************************//
/datum/reagent/ethanol/euphoria
price_tag = 30
price_tag = 30
+1 -1
View File
@@ -70,7 +70,7 @@
/obj/item/reagent_containers/food/drinks/bottle/rum = 5,
/obj/item/reagent_containers/food/drinks/bottle/sake = 5,
/obj/item/reagent_containers/food/drinks/bottle/specialwhiskey = 5,
/obj/item/reagent_containers/food/drinks/bottle/tequilla = 5,
/obj/item/reagent_containers/food/drinks/bottle/tequila = 5,
/obj/item/reagent_containers/food/drinks/bottle/vermouth = 5,
/obj/item/reagent_containers/food/drinks/bottle/vodka = 5,
/obj/item/reagent_containers/food/drinks/bottle/whiskey = 5,
+18 -18
View File
@@ -45,54 +45,54 @@
/obj/item/reagent_containers/food/drinks/bottle/specialwhiskey
description_fluff = "Nobody knows what Special Blend Whiskey really is, how it's made, or where it comes from. It's an expensive Gilthari product, for only the most luxurious, but NanoTrasen managed to secure a supply deal."
/obj/item/reagent_containers/food/drinks/bottle/vodka
description_fluff = "Centauri Provisions claims that their vodka wins in blind taste-tests against traditional mixes from Earth, but they're not fooling anyone."
/obj/item/reagent_containers/food/drinks/bottle/tequilla
description_fluff = "This tequilla comes from the 'Cancer Craze' of the 20's, where consumer products would openly advertize their blatently carcinogenic nature to a burgeoning middle class with newfound access to cloned organs."
/obj/item/reagent_containers/food/drinks/bottle/tequila
description_fluff = "This tequila comes from the 'Cancer Craze' of the 20's, where consumer products would openly advertize their blatently carcinogenic nature to a burgeoning middle class with newfound access to cloned organs."
/obj/item/reagent_containers/food/drinks/bottle/patron
description_fluff = "This emerged as a response to Caccavo, with Patron advertising claiming to be even more toxic and dangerous. Unfortunately, when the Cancer Craze ended, Patron's stocks nosedived and they now operate only a handful of distilleries."
/obj/item/reagent_containers/food/drinks/bottle/rum
description_fluff = "Captain Pete's was involved in a long, expensive lawsuit against Gilthari concerning their claims to be from Cuba. They're actually owned and operated by none other than Centauri Provisions, with no distillaries on Earth to speak of."
/obj/item/reagent_containers/food/drinks/bottle/vermouth
description_fluff = "One of Gilthari's less expensive products, Goldeneye Vermouth still manages to sell itself as a drink for only the richest and most successful; giving any number of poseurs a swollen head in the process."
/obj/item/reagent_containers/food/drinks/bottle/kahlua
description_fluff = "One of Centauri Provision's least successful products, this coffee liquour continues to be produced for the handful of mixed drinks requiring it. Surprisingly energizing!"
/obj/item/reagent_containers/food/drinks/bottle/goldschlager
description_fluff = "Drinks laced with gold and other precious metals are a common indulgence among those who live on planets where these metals are still somewhat rare and expensive. On asteroid colonies and better-developed regions, they're seen as a ridiculous waste of materials."
/obj/item/reagent_containers/food/drinks/bottle/cognac
description_fluff = "Another Gilthari product, Chataeu du Baton is one of the few brandies to still be produced using traditional methods, instead of chemical synthesizers."
/obj/item/reagent_containers/food/drinks/bottle/wine
description_fluff = "NanoTrasen makes this wine, which is generally regarded as better used for cooking than actually drinking. Morpheus specifically names Doublebeard in their recipe for Twobread."
/obj/item/reagent_containers/food/drinks/bottle/absinthe
description_fluff = "A product of the anarchists of Casini's Reach, Jailebreaker Verte is an open-source synthesized liquour that has actually managed to succeed over traditional absinthes. Gilthari is livid."
/obj/item/reagent_containers/food/drinks/bottle/melonliquor
description_fluff = "Melon liquor, formerly an obscure drink, took off when young Skrell started dabbling in alcohol. This brand is owned by Vey-Med, one of their few diversified holdings."
/obj/item/reagent_containers/food/drinks/bottle/bluecuracao
description_fluff = "Centauri Provisions is currently marketing Miss Blue as the next big thing in mixed drinks. Analysts suggest that they're mistaken."
/obj/item/reagent_containers/food/drinks/bottle/pwine
description_fluff = "You've never heard of this before, but it looks vaguely Gilthari, so it's probably good, right?"
/obj/item/reagent_containers/food/drinks/bottle/tomatojuice
description_fluff = "Morpheus used to sell 'Tomato Juice' that was actually synthetic blood in a carton, until they got sued for damages."
/obj/item/reagent_containers/food/drinks/bottle/small/beer
description_fluff = "Getting synthesized booze to taste decent is always a challenge, but Space Beer is a resounding success. As the most popular drink in human space, it'd have to be."
/obj/item/reagent_containers/food/drinks/bottle/small/ale
description_fluff = "A product of Titan and enjoyed widely among the hydrocarbon workers of the oil moon. Often described as 'Beer, but better.'"
/obj/item/reagent_containers/food/drinks/bottle/sake
description_fluff = "An export from New Kyoto, Mono-no-Aware promises to show to the drinker the beautiful transience of all life. Mostly it just tastes like dry booze."
+4 -4
View File
@@ -311,7 +311,7 @@ Drinks Data
glass_center_of_mass_y = 12
/datum/reagent/ethanol/tequila
glass_icon_state = "tequillaglass"
glass_icon_state = "tequillaglass" //Yes. It's typo'd in the .dmi file. Deal with it or fix it.
glass_center_of_mass_x = 16
glass_center_of_mass_y = 12
@@ -415,7 +415,7 @@ Drinks Data
glass_center_of_mass_x = 15
glass_center_of_mass_y = 8
/datum/reagent/ethanol/changelingsting
/datum/reagent/ethanol/changeling_sting
glass_icon_state = "changelingsting"
/datum/reagent/ethanol/martini
@@ -588,8 +588,8 @@ Drinks Data
glass_center_of_mass_x = 16
glass_center_of_mass_y = 4
/datum/reagent/ethanol/tequilla_sunrise
glass_icon_state = "tequillasunriseglass"
/datum/reagent/ethanol/tequila_sunrise
glass_icon_state = "tequillasunriseglass" //Yes. It's typo'd in the .dmi file. Deal with it or fix it.
/datum/reagent/ethanol/threemileisland
glass_icon_state = "threemileislandglass"
@@ -76,7 +76,7 @@
glass_center_of_mass_y = 8
glass_icon_file = 'icons/obj/drinks_vr.dmi'
/datum/reagent/ethanol/lovepotion
/datum/reagent/drink/love_potion
glass_icon_state = "lovepotionglass"
glass_center_of_mass_x = 16
glass_center_of_mass_y = 8
@@ -247,7 +247,7 @@
/datum/reagent/ethanol/snowwhite
glass_icon_file = 'icons/obj/drinks_vr.dmi'
/datum/reagent/ethanol/tequilla_sunrise
/datum/reagent/ethanol/tequila_sunrise
glass_icon_file = 'icons/obj/drinks_vr.dmi'
/datum/reagent/ethanol/white_russian
+4 -4
View File
@@ -264,16 +264,16 @@
. = ..()
reagents.add_reagent(REAGENT_ID_VODKA, 100)
/obj/item/reagent_containers/food/drinks/bottle/tequilla
/obj/item/reagent_containers/food/drinks/bottle/tequila
name = "Caccavo Guaranteed Quality Tequilla"
desc = "Made from premium petroleum distillates, pure thalidomide and other fine quality ingredients!"
icon_state = "tequilabottle"
center_of_mass_x = 16
center_of_mass_y = 3
/obj/item/reagent_containers/food/drinks/bottle/tequilla/Initialize()
/obj/item/reagent_containers/food/drinks/bottle/tequila/Initialize()
. = ..()
reagents.add_reagent(REAGENT_ID_TEQUILLA, 100)
reagents.add_reagent(REAGENT_ID_TEQUILA, 100)
/obj/item/reagent_containers/food/drinks/bottle/bottleofnothing
name = "Bottle of Nothing"
@@ -288,7 +288,7 @@
/obj/item/reagent_containers/food/drinks/bottle/patron
name = "Wrapp Artiste Patron"
desc = "Silver laced tequilla, served in night clubs across the galaxy."
desc = "Silver laced tequila, served in night clubs across the galaxy."
icon_state = "patronbottle"
center_of_mass_x = 16
center_of_mass_y = 6
@@ -72,7 +72,7 @@
/obj/item/reagent_containers/chem_disp_cartridge/rum
spawn_reagent = REAGENT_ID_RUM
/obj/item/reagent_containers/chem_disp_cartridge/tequila
spawn_reagent = REAGENT_ID_TEQUILLA
spawn_reagent = REAGENT_ID_TEQUILA
/obj/item/reagent_containers/chem_disp_cartridge/vermouth
spawn_reagent = REAGENT_ID_VERMOUTH
/obj/item/reagent_containers/chem_disp_cartridge/cognac
@@ -53,7 +53,7 @@
/obj/machinery/chemical_dispenser/bar_alc
dispense_reagents = list(
REAGENT_ID_LEMONLIME, REAGENT_ID_SUGAR, REAGENT_ID_ORANGEJUICE, REAGENT_ID_LIMEJUICE, REAGENT_ID_SODAWATER, REAGENT_ID_TONIC, REAGENT_ID_BEER, REAGENT_ID_KAHLUA,
REAGENT_ID_WHISKEY, REAGENT_ID_REDWINE, REAGENT_ID_WHITEWINE, REAGENT_ID_VODKA, REAGENT_ID_CIDER, REAGENT_ID_GIN, REAGENT_ID_RUM, REAGENT_ID_TEQUILLA, REAGENT_ID_VERMOUTH, REAGENT_ID_COGNAC, REAGENT_ID_ALE, REAGENT_ID_MEAD, REAGENT_ID_BITTERS
REAGENT_ID_WHISKEY, REAGENT_ID_REDWINE, REAGENT_ID_WHITEWINE, REAGENT_ID_VODKA, REAGENT_ID_CIDER, REAGENT_ID_GIN, REAGENT_ID_RUM, REAGENT_ID_TEQUILA, REAGENT_ID_VERMOUTH, REAGENT_ID_COGNAC, REAGENT_ID_ALE, REAGENT_ID_MEAD, REAGENT_ID_BITTERS
)
/obj/machinery/chemical_dispenser/bar_coffee
@@ -1,5 +1,5 @@
/decl/chemical_reaction/distilling
// name = null
name = REAGENT_DEVELOPER_WARNING // Unit test ignore
// id = null
// result = null
// required_reagents = list()
@@ -1,3 +1,6 @@
/decl/chemical_reaction/instant/drinks
name = REAGENT_DEVELOPER_WARNING // Unit test ignore
/decl/chemical_reaction/instant/drinks/coffee
name = REAGENT_COFFEE
id = REAGENT_ID_COFFEE
@@ -58,7 +61,7 @@
name = REAGENT_PATRON
id = REAGENT_ID_PATRON
result = REAGENT_ID_PATRON
required_reagents = list(REAGENT_ID_TEQUILLA = 10, REAGENT_ID_SILVER = 1)
required_reagents = list(REAGENT_ID_TEQUILA = 10, REAGENT_ID_SILVER = 1)
result_amount = 10
/decl/chemical_reaction/instant/drinks/bilk
@@ -337,14 +340,14 @@
name = REAGENT_BRAVEBULL
id = REAGENT_ID_BRAVEBULL
result = REAGENT_ID_BRAVEBULL
required_reagents = list(REAGENT_ID_TEQUILLA = 2, REAGENT_ID_KAHLUA = 1)
required_reagents = list(REAGENT_ID_TEQUILA = 2, REAGENT_ID_KAHLUA = 1)
result_amount = 3
/decl/chemical_reaction/instant/drinks/tequilla_sunrise
/decl/chemical_reaction/instant/drinks/tequila_sunrise
name = "Tequilla Sunrise"
id = REAGENT_ID_TEQUILLASUNRISE
result = REAGENT_ID_TEQUILLASUNRISE
required_reagents = list(REAGENT_ID_TEQUILLA = 2, REAGENT_ID_ORANGEJUICE = 1)
id = REAGENT_ID_TEQUILASUNRISE
result = REAGENT_ID_TEQUILASUNRISE
required_reagents = list(REAGENT_ID_TEQUILA = 2, REAGENT_ID_ORANGEJUICE = 1)
result_amount = 3
/decl/chemical_reaction/instant/drinks/phoron_special
@@ -414,14 +417,14 @@
name = REAGENT_MARGARITA
id = REAGENT_ID_MARGARITA
result = REAGENT_ID_MARGARITA
required_reagents = list(REAGENT_ID_TEQUILLA = 2, REAGENT_ID_LIMEJUICE = 1)
required_reagents = list(REAGENT_ID_TEQUILA = 2, REAGENT_ID_LIMEJUICE = 1)
result_amount = 3
/decl/chemical_reaction/instant/drinks/longislandicedtea
name = REAGENT_LONGISLANDICEDTEA
id = REAGENT_ID_LONGISLANDICEDTEA
result = REAGENT_ID_LONGISLANDICEDTEA
required_reagents = list(REAGENT_ID_VODKA = 1, REAGENT_ID_GIN = 1, REAGENT_ID_TEQUILLA = 1, REAGENT_ID_RUMANDCOLA = 3)
required_reagents = list(REAGENT_ID_VODKA = 1, REAGENT_ID_GIN = 1, REAGENT_ID_TEQUILA = 1, REAGENT_ID_RUMANDCOLA = 3)
result_amount = 6
/decl/chemical_reaction/instant/drinks/threemileisland
@@ -600,7 +603,7 @@
required_reagents = list(REAGENT_ID_IRON = 1, REAGENT_ID_REDWINE = 5, REAGENT_ID_VODKA = 5)
result_amount = 10
/decl/chemical_reaction/instant/drinks/changelingsting
/decl/chemical_reaction/instant/drinks/changeling_sting
name = REAGENT_CHANGELINGSTING
id = REAGENT_ID_CHANGELINGSTING
result = REAGENT_ID_CHANGELINGSTING
@@ -957,7 +960,7 @@
name = REAGENT_EREBUSMOONRISE
id = REAGENT_ID_EREBUSMOONRISE
result = REAGENT_ID_EREBUSMOONRISE
required_reagents = list(REAGENT_ID_WHISKEY = 1, REAGENT_ID_VODKA = 1, REAGENT_ID_TEQUILLA = 1)
required_reagents = list(REAGENT_ID_WHISKEY = 1, REAGENT_ID_VODKA = 1, REAGENT_ID_TEQUILA = 1)
result_amount = 3
/decl/chemical_reaction/instant/drinks/balloon
@@ -1006,7 +1009,7 @@
name = REAGENT_BINMANBLISS
id = REAGENT_ID_BINMANBLISS
result = REAGENT_ID_BINMANBLISS
required_reagents = list(REAGENT_ID_SAKE = 1, REAGENT_ID_TEQUILLA = 1)
required_reagents = list(REAGENT_ID_SAKE = 1, REAGENT_ID_TEQUILA = 1)
result_amount = 2
/decl/chemical_reaction/instant/drinks/chrysanthemum
@@ -1046,7 +1049,7 @@
catalysts = list(REAGENT_ID_ENZYME = 10) //10u enzyme so it requires more than is usually added. Stops overlap with wine recipe
result_amount = 5
/decl/chemical_reaction/instant/drinks/lovepotion
/decl/chemical_reaction/instant/drinks/love_potion
name = REAGENT_LOVEPOTION
id = REAGENT_ID_LOVEPOTION
result = REAGENT_ID_LOVEPOTION
@@ -1204,7 +1207,7 @@
name = REAGENT_PALOMA
id = REAGENT_ID_PALOMA
result = REAGENT_ID_PALOMA
required_reagents = list(REAGENT_ID_SODAWATER = 1, REAGENT_ID_TEQUILLASUNRISE = 2)
required_reagents = list(REAGENT_ID_SODAWATER = 1, REAGENT_ID_TEQUILASUNRISE = 2)
result_amount = 3
/decl/chemical_reaction/instant/drinks/mojito
@@ -1214,7 +1217,7 @@
required_reagents = list(REAGENT_ID_RUM = 3, REAGENT_ID_LIMEJUICE = 1, REAGENT_ID_MINT = 1)
result_amount = 5
/decl/chemical_reaction/instant/drinks/virginmojito
/decl/chemical_reaction/instant/drinks/virgin_mojito
name = REAGENT_VIRGINMOJITO
id = REAGENT_ID_VIRGINMOJITO
result = REAGENT_ID_VIRGINMOJITO
@@ -1,3 +1,6 @@
/decl/chemical_reaction/instant/food
name = REAGENT_DEVELOPER_WARNING // Unit test ignore
/decl/chemical_reaction/instant/food/hot_ramen
name = REAGENT_HOTRAMEN
id = REAGENT_ID_HOTRAMEN
@@ -3,6 +3,9 @@
/* Common reactions */
/decl/chemical_reaction/instant
name = REAGENT_DEVELOPER_WARNING // Unit test ignore
/decl/chemical_reaction/instant/inaprovaline
name = REAGENT_INAPROVALINE
id = REAGENT_ID_INAPROVALINE
@@ -167,7 +167,7 @@
REAGENT_ID_SPECIALWHISKEY,
REAGENT_ID_SUGAR,
REAGENT_ID_TEA,
REAGENT_ID_TEQUILLA,
REAGENT_ID_TEQUILA,
REAGENT_ID_TOMATOJUICE,
REAGENT_ID_TONIC,
REAGENT_ID_VERMOUTH,
+3 -3
View File
@@ -2,9 +2,9 @@
/datum/reagent
var/name = "Reagent"
var/id = "reagent"
var/description = "A non-descript chemical."
var/name = REAGENT_DEVELOPER_WARNING
var/id = REAGENT_ID_DEVELOPER_WARNING
var/description = REAGENT_DESC_DEVELOPER_WARNING
var/taste_description = "bitterness"
var/taste_mult = 1 //how this taste compares to others. Higher values means it is more noticable
var/datum/reagents/holder = null
+3
View File
@@ -2,6 +2,7 @@
data = new/list("donor" = null, "viruses" = null, "species" = SPECIES_HUMAN, "blood_DNA" = null, "blood_type" = null, "blood_colour" = "#A10808", "resistances" = null, "trace_chem" = null, REAGENT_ID_ANTIBODIES = list())
name = REAGENT_BLOOD
id = REAGENT_ID_BLOOD
description = "Blood."
taste_description = REAGENT_ID_IRON
taste_mult = 1.3
reagent_state = LIQUID
@@ -169,6 +170,7 @@
/datum/reagent/blood/synthblood
name = REAGENT_SYNTHBLOOD
description = "Synthetic Blood"
id = REAGENT_ID_SYNTHBLOOD
color = "#999966"
volume_mod = 2
@@ -191,6 +193,7 @@
/datum/reagent/antibodies
data = list(REAGENT_ID_ANTIBODIES=list())
name = REAGENT_ANTIBODIES
description = "Antibodies against some type of virus."
taste_description = "slime"
id = REAGENT_ID_ANTIBODIES
reagent_state = LIQUID
+12 -8
View File
@@ -2585,7 +2585,7 @@
glass_desc = "You can almost smell the tranquility emanating from this."
//allergen_type = ALLERGEN_FRUIT Sorry to break the news, chief. Honey is not a fruit.
/datum/reagent/drink/lovepotion
/datum/reagent/drink/love_potion
name = REAGENT_LOVEPOTION
id = REAGENT_ID_LOVEPOTION
description = "Creamy strawberries and sugar, simple and sweet."
@@ -2691,7 +2691,7 @@
if(D.water_based)
M.adjustToxLoss(removed * -2)
/datum/reagent/drink/mojito
/datum/reagent/drink/virgin_mojito
name = REAGENT_VIRGINMOJITO
id = REAGENT_ID_VIRGINMOJITO
description = "Mint, bubbly water, and citrus, made for sailing."
@@ -3101,6 +3101,7 @@
//Base type for alchoholic drinks containing coffee
/datum/reagent/ethanol/coffee
name = REAGENT_DEVELOPER_WARNING
overdose = 45
allergen_type = ALLERGEN_COFFEE|ALLERGEN_STIMULANT //Contains coffee or is made from coffee
@@ -3211,8 +3212,8 @@
allergen_type = ALLERGEN_FRUIT //Made from orange juice
/datum/reagent/ethanol/tequila
name = REAGENT_TEQUILLA
id = REAGENT_ID_TEQUILLA
name = REAGENT_TEQUILA
id = REAGENT_ID_TEQUILA
description = "A strong and mildly flavored, Mexican produced spirit. Feeling thirsty hombre?"
taste_description = "paint thinner"
color = "#FFFF91"
@@ -3356,6 +3357,9 @@
else
L.take_damage(100, 0)
/datum/reagent/ethanol/wine
name = REAGENT_DEVELOPER_WARNING // Unit test ignore
/datum/reagent/ethanol/wine/champagne
name = REAGENT_CHAMPAGNE
id = REAGENT_ID_CHAMPAGNE
@@ -3622,7 +3626,7 @@
glass_name = REAGENT_BRAVEBULL
glass_desc = "Tequilla and coffee liquor, brought together in a mouthwatering mixture. Drink up."
/datum/reagent/ethanol/changelingsting
/datum/reagent/ethanol/changeling_sting
name = REAGENT_CHANGELINGSTING
id = REAGENT_ID_CHANGELINGSTING
description = "You take a tiny sip and feel a burning sensation..."
@@ -4101,9 +4105,9 @@
allergen_type = ALLERGEN_GRAINS|ALLERGEN_STIMULANT //Made from beer(grain) and whiskeycola(whiskey(grain) and cola(caffeine))
/datum/reagent/ethanol/tequilla_sunrise
name = REAGENT_TEQUILLASUNRISE
id = REAGENT_ID_TEQUILLASUNRISE
/datum/reagent/ethanol/tequila_sunrise
name = REAGENT_TEQUILASUNRISE
id = REAGENT_ID_TEQUILASUNRISE
description = "Tequila and orange juice. Much like a Screwdriver, only Mexican~."
taste_description = "oranges"
color = "#FFE48C"
@@ -352,6 +352,9 @@
glass_name = REAGENT_SCSATW
glass_desc = "The best accessory to daydrinking."
/datum/reagent/drink
name = REAGENT_DEVELOPER_WARNING // Unit test ignore
/datum/reagent/drink/choccymilk
name = REAGENT_CHOCCYMILK
id = REAGENT_ID_CHOCCYMILK
@@ -1,6 +1,7 @@
/datum/reagent/vaccine
name = REAGENT_VACCINE
id = REAGENT_ID_VACCINE
description = "Liquid vaccine against some type of virus."
color = "#C81040"
taste_description = "antibodies"
@@ -29,6 +30,9 @@
color = "#41B0C0"
taste_mult = 1.5
/datum/reagent/medicine
name = REAGENT_DEVELOPER_WARNING // Unit test ignore
/datum/reagent/medicine/adranol/adranolvirusfood
name = REAGENT_ADRANOLVIRUSFOOD
id = REAGENT_ID_ADRANOLVIRUSFOOD
+144
View File
@@ -0,0 +1,144 @@
/datum/unit_test/reagent_shall_have_unique_name_and_id
name = "REAGENTS: Reagent IDs and names shall be unique"
/datum/unit_test/reagent_shall_have_unique_name_and_id/start_test()
var/failed = FALSE
var/collection_name = list()
var/collection_id = list()
for(var/Rpath in subtypesof(/datum/reagent))
var/datum/reagent/R = new Rpath()
if(R.name == REAGENT_DEVELOPER_WARNING) // Ignore these types as they are meant to be overridden
continue
if(R.name == "")
log_unit_test("[Rpath]: Reagents - reagent name blank.")
failed = TRUE
if(R.id == REAGENT_ID_DEVELOPER_WARNING)
log_unit_test("[Rpath]: Reagents - reagent ID not set.")
failed = TRUE
if(R.id == "")
log_unit_test("[Rpath]: Reagents - reagent ID blank.")
failed = TRUE
if(collection_name[R.name])
log_unit_test("[Rpath]: Reagents - WARNING - reagent name \"[R.name]\" is not unique, used first in [collection_name[R.name]]. Is this intentional?")
collection_name[R.name] = R.type
if(collection_id[R.id])
log_unit_test("[Rpath]: Reagents - reagent ID \"[R.id]\" is not unique, used first in [collection_id[R.id]].")
failed = TRUE
collection_id[R.id] = R.type
if(R.description == REAGENT_DESC_DEVELOPER_WARNING)
log_unit_test("[Rpath]: Reagents - reagent description unset.")
failed = TRUE
qdel(R)
if(failed)
fail("One or more /datum/reagent subtypes had invalid definitions.")
else
pass("All /datum/reagent subtypes had correct settings.")
return TRUE
/datum/unit_test/chemical_reactions_shall_use_and_produce_valid_reagents
name = "REAGENTS: Chemical Reactions shall use and produce valid reagents"
/datum/unit_test/chemical_reactions_shall_use_and_produce_valid_reagents/start_test()
var/failed = FALSE
var/list/collection_id = list()
for(var/decl/chemical_reaction/CR in decls_repository.get_decls_of_subtype(/decl/chemical_reaction))
if(CR.name == REAGENT_DEVELOPER_WARNING) // Ignore these types as they are meant to be overridden
continue
if(!CR.name)
log_unit_test("[CR.type]: Reagents - chemical reaction had null name.")
failed = TRUE
if(CR.name == "")
log_unit_test("[CR.type]: Reagents - chemical reaction had blank name.")
failed = TRUE
if(!CR.id)
log_unit_test("[CR.type]: Reagents - chemical reaction had invalid id.")
failed = TRUE
if(CR.id in collection_id)
log_unit_test("[CR.type]: Reagents - chemical reaction id \"[CR.name]\" is not unique, used first in [collection_id[CR.id]].")
failed = TRUE
else
collection_id[CR.id] = CR.type
if(CR.required_reagents)
for(var/RR in CR.required_reagents)
if(!SSchemistry.chemical_reagents[RR])
log_unit_test("[CR.type]: Reagents - chemical reaction had invalid required reagent ID \"[RR]\".")
failed = TRUE
if(CR.catalysts)
for(var/RR in CR.catalysts)
if(!SSchemistry.chemical_reagents[RR])
log_unit_test("[CR.type]: Reagents - chemical reaction had invalid required reagent ID \"[RR]\".")
failed = TRUE
if(CR.inhibitors)
for(var/RR in CR.inhibitors)
if(!SSchemistry.chemical_reagents[RR])
log_unit_test("[CR.type]: Reagents - chemical reaction had invalid required reagent ID \"[RR]\".")
failed = TRUE
if(CR.result)
if(!SSchemistry.chemical_reagents[CR.result])
log_unit_test("[CR.type]: Reagents - chemical reaction had invalid result reagent ID \"[CR.result]\".")
failed = TRUE
if(failed)
fail("One or more /decl/chemical_reaction subtypes had invalid results or components.")
else
pass("All /decl/chemical_reaction subtypes had correct settings.")
return TRUE
/datum/unit_test/prefilled_reagent_containers_shall_have_valid_reagents
name = "REAGENTS: Prefilled reagent containers shall have valid reagents"
/datum/unit_test/prefilled_reagent_containers_shall_have_valid_reagents/start_test()
var/failed = FALSE
var/obj/container = new /obj
for(var/RC in subtypesof(/obj/item/reagent_containers/glass))
var/obj/item/reagent_containers/glass/R = new RC(container)
if(R.prefill && R.prefill.len)
for(var/ID in R.prefill)
if(!SSchemistry.chemical_reagents[ID])
log_unit_test("[RC]: Reagents - reagent prefill had invalid reagent ID \"[ID]\".")
failed = TRUE
qdel(R)
for(var/DC in subtypesof(/obj/item/reagent_containers/chem_disp_cartridge))
var/obj/item/reagent_containers/chem_disp_cartridge/D = new DC(container)
if(D.spawn_reagent)
if(!SSchemistry.chemical_reagents[D.spawn_reagent])
log_unit_test("[DC]: Reagents - chemical dispenser cartridge had invalid reagent ID \"[D.spawn_reagent]\".")
failed = TRUE
qdel(D)
qdel(container)
if(failed)
fail("One or more /obj/item/reagent_containers had an invalid prefill reagent.")
else
pass("All /obj/item/reagent_containers had valid prefill reagents.")
return TRUE