Files
wwdpublic/Content.Server/Nutrition/Components/FoodComponent.cs
VMSolidus dc52f8bf2b Mood Rework Part 1 (#2425)
This PR significantly reworks some parts of the mood system, namely by
completely restoring and reworking the saturation scale shader so that
its not completely terrible. Additionally, I've added numerous new
instances and locations where Moodlets can be found in the game,
particularly when it comes to food and drugs, as well as a new Mood
interaction with the Deep Fryer. Chef gameplay is significantly expanded
via the introduction of flavor related moodlets, as well as the almighty
deep fryer giving a unique, moderately strong, and long lasting moodlet
to anyone who eats whatever you deep fry.

Go ahead, give someone a deep fried stick of salted butter coated in
chocolate. You'll make their day.

The big differences with the Saturation Scale are that its now variable,
with smooth transitions, with the scale scaling with your character's
mood. The more depressed you are, the more desaturated the world
becomes. Whereas if you have entirely too many positive mood bonuses,
the world becomes incredibly vibrant.

<details><summary><h1>Media</h1></summary>
<p>

Shoukou's Bar as seen by someone with the Sanguine trait(and no other
moodlets)

![image](https://github.com/user-attachments/assets/bf8e7b25-5243-41ee-a6ad-3170444faae6)

Max mood

![image](https://github.com/user-attachments/assets/fc03ee20-37a5-4163-ac35-8f2735f8b531)

Saturnine trait:

![image](https://github.com/user-attachments/assets/fc21fc20-81e5-4364-807f-fcef40837ade)

Minimum mood(dead)

![image](https://github.com/user-attachments/assets/b38e8ce8-0ea2-436d-b298-b1a715b0a6c2)

Smooth transitions for shader tone.

https://github.com/user-attachments/assets/3ab55da1-eca6-4cc5-9489-f4ad13ed0f27

</p>
</details>

🆑
- add: Re-enabled the "Mood shader" after significantly reworking it.
Mood visual effects now scale with your character's mood, instead of
only ever being near-greyscale. Being high life now makes the world more
colorful and saturated.
- add: A huge variety of medicines, drugs, and even food items(based on
flavor!) now have mood effects. Reaching for the packet of salt now
actually makes food provide a better mood buff.
- add: Being Tear-gassed causes a massive mood penalty.
- add: Deep frying food provides a strong mood bonus.
- add: Added new Manic, Mercurial, and Dead Emotions traits.

Signed-off-by: VMSolidus <evilexecutive@gmail.com>
2025-07-12 00:55:42 +10:00

86 lines
2.5 KiB
C#

using Content.Server.Body.Components;
using Content.Shared.Nutrition.Components;
using Content.Shared.FixedPoint;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
namespace Content.Server.Nutrition.Components;
[RegisterComponent]
public sealed partial class FoodComponent : Component
{
[DataField]
public string Solution = "food";
[DataField]
public SoundSpecifier UseSound = new SoundCollectionSpecifier("eating");
[DataField]
public List<EntProtoId> Trash = new();
[DataField]
public FixedPoint2? TransferAmount = FixedPoint2.New(5);
/// <summary>
/// Acceptable utensil to use
/// </summary>
[DataField]
public UtensilType Utensil = UtensilType.Fork; //There are more "solid" than "liquid" food
/// <summary>
/// Is utensil required to eat this food
/// </summary>
[DataField]
public bool UtensilRequired;
/// <summary>
/// If this is set to true, food can only be eaten if you have a stomach with a
/// <see cref="StomachComponent.SpecialDigestible"/> that includes this entity in its whitelist,
/// rather than just being digestible by anything that can eat food.
/// Whitelist the food component to allow eating of normal food.
/// </summary>
[DataField]
public bool RequiresSpecialDigestion;
/// <summary>
/// Stomachs required to digest this entity.
/// Used to simulate 'ruminant' digestive systems (which can digest grass)
/// </summary>
[DataField]
public int RequiredStomachs = 1;
/// <summary>
/// The localization identifier for the eat message. Needs a "food" entity argument passed to it.
/// </summary>
[DataField]
public LocId EatMessage = "food-nom";
/// <summary>
/// How long it takes to eat the food personally.
/// </summary>
[DataField]
public float Delay = 1;
/// <summary>
/// This is how many seconds it takes to force feed someone this food.
/// Should probably be smaller for small items like pills.
/// </summary>
[DataField]
public float ForceFeedDelay = 3;
/// <summary>
/// Shitmed Change: Whether to show a popup to everyone in range when attempting to eat this food, and upon successful eating.
/// </summary>
[DataField]
public bool PopupOnEat;
/// <summary>
/// For mobs that are food, requires killing them before eating.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public bool RequireDead = true;
[DataField]
public HashSet<string> MoodletsOnEat = new();
}