icecream
This commit is contained in:
@@ -62,6 +62,7 @@
|
||||
var/fermiIsReacting = FALSE //that prevents multiple reactions from occurring (i.e. add_reagent calls to process_reactions(), this stops any extra reactions.)
|
||||
var/fermiReactID //instance of the chem reaction used during a fermireaction, kept here so it's cache isn't lost between loops/procs.
|
||||
var/value_multiplier = DEFAULT_REAGENTS_VALUE //used for cargo reagents selling.
|
||||
var/force_alt_taste = FALSE
|
||||
|
||||
/datum/reagents/New(maximum=100, new_flags = NONE, new_value = DEFAULT_REAGENTS_VALUE)
|
||||
maximum_volume = maximum
|
||||
@@ -1120,47 +1121,54 @@
|
||||
. = locate(type) in cached_reagents
|
||||
|
||||
/datum/reagents/proc/generate_taste_message(minimum_percent=15)
|
||||
// the lower the minimum percent, the more sensitive the message is.
|
||||
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
|
||||
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)
|
||||
if(!force_alt_taste)
|
||||
// the lower the minimum percent, the more sensitive the message is.
|
||||
var/list/tastes = list() //descriptor = strength
|
||||
if(minimum_percent <= 100)
|
||||
for(var/datum/reagent/R in reagent_list)
|
||||
if(!R.taste_mult)
|
||||
continue
|
||||
var/intensity_desc = "a hint of"
|
||||
if(ISINRANGE(percent, minimum_percent * 2, minimum_percent * 3)|| percent == 100)
|
||||
intensity_desc = ""
|
||||
else if(percent > minimum_percent * 3)
|
||||
intensity_desc = "the strong flavor of"
|
||||
if(intensity_desc != "")
|
||||
out += "[intensity_desc] [taste_desc]"
|
||||
|
||||
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
|
||||
else
|
||||
out += "[taste_desc]"
|
||||
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(ISINRANGE(percent, minimum_percent * 2, minimum_percent * 3)|| 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]"
|
||||
|
||||
else
|
||||
// alternate taste is to force the taste of the atom if its a food item
|
||||
if(my_atom && isfood(my_atom))
|
||||
var/obj/item/reagent_containers/food/snacks/F = my_atom
|
||||
out = F.tastes
|
||||
|
||||
return english_list(out, "something indescribable")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user