mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 21:19:00 +01:00
Hydroponic, food and reagent taste mult
This commit is contained in:
@@ -784,51 +784,54 @@ var/const/INGEST = 2
|
||||
temp.Add(v.Copy())
|
||||
trans_data["viruses"] = temp
|
||||
return trans_data
|
||||
|
||||
/datum/reagents/proc/generate_0(minimum_percent=15)
|
||||
// the lower the minimum percent, the more sensitive the message is.
|
||||
/datum/reagents/proc/generate_taste_message(minimum_percent = TASTE_SENSITIVITY_NORMAL)
|
||||
var/list/out = list()
|
||||
var/list/tastes = list() //descriptor = strength
|
||||
if(minimum_percent <= 100)
|
||||
for(var/datum/reagent/R in reagent_list)
|
||||
if(!R.taste_mult)
|
||||
continue
|
||||
|
||||
if(istype(R, /datum/reagent/consumable/nutriment))
|
||||
var/list/taste_data = R.data
|
||||
for(var/taste in taste_data)
|
||||
var/ratio = taste_data[taste]
|
||||
var/amount = ratio * R.taste_mult * R.volume
|
||||
if(taste in tastes)
|
||||
tastes[taste] += amount
|
||||
else
|
||||
tastes[taste] = amount
|
||||
var/list/reagent_tastes = list() //in the form reagent_tastes["descriptor"] = strength
|
||||
//mobs should get this message when either they cannot taste, the tastes are all too weak for them to detect, or the tastes somehow don't have any strength
|
||||
var/no_taste_text = "something indescribable"
|
||||
if(minimum_percent > 100)
|
||||
return no_taste_text
|
||||
for(var/datum/reagent/R in reagent_list)
|
||||
if(!R.taste_mult)
|
||||
continue
|
||||
//nutriment carries a list of tastes that originates from the snack food that the nutriment came from
|
||||
if(istype(R, /datum/reagent/consumable/nutriment))
|
||||
var/list/nutriment_taste_data = R.data
|
||||
for(var/nutriment_taste in nutriment_taste_data)
|
||||
var/ratio = nutriment_taste_data[nutriment_taste]
|
||||
var/amount = ratio * R.taste_mult * R.volume
|
||||
if(nutriment_taste in reagent_tastes)
|
||||
reagent_tastes[nutriment_taste] += amount
|
||||
else
|
||||
reagent_tastes[nutriment_taste] = amount
|
||||
else
|
||||
var/taste_desc = R.taste_description
|
||||
var/taste_amount = R.volume * R.taste_mult
|
||||
if(taste_desc in reagent_tastes)
|
||||
reagent_tastes[taste_desc] += taste_amount
|
||||
else
|
||||
var/taste_desc = R.taste_description
|
||||
var/taste_amount = R.volume * R.taste_mult
|
||||
if(taste_desc in tastes)
|
||||
tastes[taste_desc] += taste_amount
|
||||
else
|
||||
tastes[taste_desc] = taste_amount
|
||||
//deal with percentages
|
||||
// TODO it would be great if we could sort these from strong to weak
|
||||
var/total_taste = counterlist_sum(tastes)
|
||||
if(total_taste > 0)
|
||||
for(var/taste_desc in tastes)
|
||||
var/percent = tastes[taste_desc]/total_taste * 100
|
||||
if(percent < minimum_percent)
|
||||
continue
|
||||
var/intensity_desc = "a hint of"
|
||||
if(percent > minimum_percent * 2 || percent == 100)
|
||||
intensity_desc = ""
|
||||
else if(percent > minimum_percent * 3)
|
||||
intensity_desc = "the strong flavor of"
|
||||
if(intensity_desc != "")
|
||||
out += "[intensity_desc] [taste_desc]"
|
||||
else
|
||||
out += "[taste_desc]"
|
||||
reagent_tastes[taste_desc] = taste_amount
|
||||
//deal with percentages
|
||||
//TODO: may want to sort these from strong to weak
|
||||
var/total_taste = counterlist_sum(reagent_tastes)
|
||||
if(total_taste <= 0)
|
||||
return no_taste_text
|
||||
for(var/taste_desc in reagent_tastes)
|
||||
var/percent = (reagent_tastes[taste_desc] / total_taste) * 100
|
||||
if(percent < minimum_percent) //the lower the minimum percent, the more sensitive the message is
|
||||
continue
|
||||
var/intensity_desc = "a hint of"
|
||||
if(percent > minimum_percent * 3 && percent != 100)
|
||||
intensity_desc = "a strong flavor of"
|
||||
else if(percent > minimum_percent * 2 || percent == 100)
|
||||
intensity_desc = ""
|
||||
|
||||
return english_list(out, "something indescribable")
|
||||
if(intensity_desc != "")
|
||||
out += "[intensity_desc] [taste_desc]"
|
||||
else
|
||||
out += "[taste_desc]"
|
||||
|
||||
return english_list(out, no_taste_text)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -181,6 +181,7 @@
|
||||
name = "sucrose agar"
|
||||
id = "sugarvirusfood"
|
||||
color = "#41B0C0" // rgb: 65,176,192
|
||||
taste_mult = 1.5
|
||||
|
||||
/datum/reagent/medicine/diphenhydramine/diphenhydraminevirusfood
|
||||
name = "virus rations"
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
reagent_state = GAS
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
taste_description = null
|
||||
taste_mult = 0
|
||||
|
||||
/datum/reagent/nitrogen
|
||||
name = "Nitrogen"
|
||||
@@ -47,6 +48,7 @@
|
||||
reagent_state = GAS
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
taste_description = null
|
||||
taste_mult = 0
|
||||
|
||||
/datum/reagent/hydrogen
|
||||
name = "Hydrogen"
|
||||
@@ -55,6 +57,7 @@
|
||||
reagent_state = GAS
|
||||
color = "#808080" // rgb: 128, 128, 128
|
||||
taste_description = null
|
||||
taste_mult = 0
|
||||
|
||||
/datum/reagent/potassium
|
||||
name = "Potassium"
|
||||
|
||||
@@ -141,6 +141,7 @@
|
||||
reagent_state = LIQUID
|
||||
color = "#7A2B94"
|
||||
taste_description = "corporate assets going to waste"
|
||||
taste_mult = 1.5
|
||||
|
||||
/datum/reagent/plasma/reaction_temperature(exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature >= T0C + 100)
|
||||
@@ -407,6 +408,7 @@
|
||||
description = "A fine dust of plasma. This chemical has unusual mutagenic properties for viruses and slimes alike."
|
||||
color = "#500064" // rgb: 80, 0, 100
|
||||
taste_description = "corporate assets going to waste"
|
||||
taste_mult = 1.5
|
||||
|
||||
/datum/reagent/plasma_dust/reaction_temperature(exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature >= T0C + 100)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
description = "A Toxic chemical."
|
||||
reagent_state = LIQUID
|
||||
color = "#CF3600" // rgb: 207, 54, 0
|
||||
taste_mult = 1.2
|
||||
|
||||
/datum/reagent/toxin/on_mob_life(mob/living/M)
|
||||
var/update_flags = STATUS_UPDATE_NONE
|
||||
@@ -42,6 +43,7 @@
|
||||
reagent_state = LIQUID
|
||||
color = "#801E28" // rgb: 128, 30, 40
|
||||
taste_description = "slimes"
|
||||
taste_mult = 1.3
|
||||
|
||||
/datum/reagent/slimejelly/on_mob_life(mob/living/M)
|
||||
var/update_flags = STATUS_UPDATE_NONE
|
||||
@@ -94,6 +96,7 @@
|
||||
metabolization_rate = 0.2
|
||||
penetrates_skin = TRUE
|
||||
taste_description = "metal"
|
||||
taste_mult = 0 // elemental mercury is tasteless
|
||||
|
||||
/datum/reagent/mercury/on_mob_life(mob/living/M)
|
||||
var/update_flags = STATUS_UPDATE_NONE
|
||||
@@ -156,6 +159,7 @@
|
||||
reagent_state = LIQUID
|
||||
color = "#04DF27"
|
||||
metabolization_rate = 0.3
|
||||
taste_mult = 0.9
|
||||
|
||||
/datum/reagent/mutagen/reaction_mob(mob/living/M, method=TOUCH, volume)
|
||||
if(!..())
|
||||
@@ -681,6 +685,7 @@
|
||||
color = "#1E4664"
|
||||
metabolization_rate = 0.2
|
||||
taste_description = null
|
||||
taste_mult = 0
|
||||
|
||||
/datum/reagent/pancuronium/on_mob_life(mob/living/M)
|
||||
var/update_flags = STATUS_UPDATE_NONE
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
drink_name = "Glass of Tomato juice"
|
||||
drink_desc = "Are you sure this is tomato juice?"
|
||||
taste_description = "<span class='warning'>blood</span>"
|
||||
taste_mult = 1.3
|
||||
|
||||
/datum/reagent/blood/reaction_mob(mob/living/M, method=TOUCH, volume)
|
||||
if(data && data["viruses"])
|
||||
|
||||
Reference in New Issue
Block a user