only show flavor above 0.1u (#17169)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -25,13 +25,12 @@ public sealed class FlavorProfileSystem : EntitySystem
|
|||||||
public string GetLocalizedFlavorsMessage(EntityUid uid, EntityUid user, Solution solution,
|
public string GetLocalizedFlavorsMessage(EntityUid uid, EntityUid user, Solution solution,
|
||||||
FlavorProfileComponent? flavorProfile = null)
|
FlavorProfileComponent? flavorProfile = null)
|
||||||
{
|
{
|
||||||
var flavors = new HashSet<string>();
|
|
||||||
if (!Resolve(uid, ref flavorProfile, false))
|
if (!Resolve(uid, ref flavorProfile, false))
|
||||||
{
|
{
|
||||||
return Loc.GetString(BackupFlavorMessage);
|
return Loc.GetString(BackupFlavorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
flavors.UnionWith(flavorProfile.Flavors);
|
var flavors = new HashSet<string>(flavorProfile.Flavors);
|
||||||
flavors.UnionWith(GetFlavorsFromReagents(solution, FlavorLimit - flavors.Count, flavorProfile.IgnoreReagents));
|
flavors.UnionWith(GetFlavorsFromReagents(solution, FlavorLimit - flavors.Count, flavorProfile.IgnoreReagents));
|
||||||
|
|
||||||
var ev = new FlavorProfileModificationEvent(user, flavors);
|
var ev = new FlavorProfileModificationEvent(user, flavors);
|
||||||
@@ -96,7 +95,14 @@ public sealed class FlavorProfileSystem : EntitySystem
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var flavor = _prototypeManager.Index<ReagentPrototype>(reagent.ReagentId).Flavor;
|
var proto = _prototypeManager.Index<ReagentPrototype>(reagent.ReagentId);
|
||||||
|
// don't care if the quantity is negligible
|
||||||
|
if (reagent.Quantity < proto.FlavorMinimum)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var flavor = proto.Flavor;
|
||||||
|
|
||||||
flavors.Add(flavor);
|
flavors.Add(flavor);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,12 @@ namespace Content.Shared.Chemistry.Reagent
|
|||||||
[DataField("flavor")]
|
[DataField("flavor")]
|
||||||
public string Flavor { get; } = default!;
|
public string Flavor { get; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// There must be at least this much quantity in a solution to be tasted.
|
||||||
|
/// </summary>
|
||||||
|
[DataField("flavorMinimum")]
|
||||||
|
public FixedPoint2 FlavorMinimum = FixedPoint2.New(0.1f);
|
||||||
|
|
||||||
[DataField("color")]
|
[DataField("color")]
|
||||||
public Color SubstanceColor { get; } = Color.White;
|
public Color SubstanceColor { get; } = Color.White;
|
||||||
|
|
||||||
|
|||||||
@@ -139,6 +139,7 @@
|
|||||||
desc: reagent-desc-oil-olive
|
desc: reagent-desc-oil-olive
|
||||||
physicalDesc: reagent-physical-desc-oily
|
physicalDesc: reagent-physical-desc-oily
|
||||||
flavor: oily
|
flavor: oily
|
||||||
|
flavorMinimum: 0.05
|
||||||
color: olive
|
color: olive
|
||||||
recognizable: true
|
recognizable: true
|
||||||
metabolisms:
|
metabolisms:
|
||||||
@@ -155,6 +156,7 @@
|
|||||||
desc: reagent-desc-oil
|
desc: reagent-desc-oil
|
||||||
physicalDesc: reagent-physical-desc-oily
|
physicalDesc: reagent-physical-desc-oily
|
||||||
flavor: oily
|
flavor: oily
|
||||||
|
flavorMinimum: 0.05
|
||||||
recognizable: true
|
recognizable: true
|
||||||
color: "#b67823"
|
color: "#b67823"
|
||||||
boilingPoint: 300.0
|
boilingPoint: 300.0
|
||||||
@@ -169,6 +171,7 @@
|
|||||||
desc: reagent-desc-capsaicin-oil
|
desc: reagent-desc-capsaicin-oil
|
||||||
physicalDesc: reagent-physical-desc-oily
|
physicalDesc: reagent-physical-desc-oily
|
||||||
flavor: spicy
|
flavor: spicy
|
||||||
|
flavorMinimum: 0.05
|
||||||
color: "#FF0000"
|
color: "#FF0000"
|
||||||
recognizable: true
|
recognizable: true
|
||||||
meltingPoint: 146
|
meltingPoint: 146
|
||||||
|
|||||||
@@ -283,6 +283,7 @@
|
|||||||
desc: reagent-desc-thc-oil
|
desc: reagent-desc-thc-oil
|
||||||
physicalDesc: reagent-physical-desc-skunky
|
physicalDesc: reagent-physical-desc-skunky
|
||||||
flavor: bitter
|
flavor: bitter
|
||||||
|
flavorMinimum: 0.05
|
||||||
color: "#DAA520"
|
color: "#DAA520"
|
||||||
metabolisms:
|
metabolisms:
|
||||||
Narcotic:
|
Narcotic:
|
||||||
|
|||||||
@@ -144,6 +144,7 @@
|
|||||||
physicalDesc: reagent-physical-desc-oily
|
physicalDesc: reagent-physical-desc-oily
|
||||||
slippery: true
|
slippery: true
|
||||||
flavor: bitter
|
flavor: bitter
|
||||||
|
flavorMinimum: 0.01
|
||||||
color: "#a76b1c"
|
color: "#a76b1c"
|
||||||
recognizable: true
|
recognizable: true
|
||||||
boilingPoint: -84.7 # Acetylene. Close enough.
|
boilingPoint: -84.7 # Acetylene. Close enough.
|
||||||
|
|||||||
Reference in New Issue
Block a user