-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Food Rework Update #1839
Open
whatston3
wants to merge
108
commits into
new-frontiers-14:master
Choose a base branch
from
whatston3:2024-07-09-GoblinFoodSystem-cleanup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,099
−593
Open
Food Rework Update #1839
Changes from all commits
Commits
Show all changes
108 commits
Select commit
Hold shift + click to select a range
3ced7d0
draft
ErhardSteinhauer a147065
Food System
dvir001 199e72b
Create fun.yml
dvir001 d9862db
food stuffs
ErhardSteinhauer 79f80e2
Merge branch 'GoblinFoodSystem' of https://github.com/ErhardSteinhaue…
ErhardSteinhauer 2fca643
there_do_be_goblins.txt
ErhardSteinhauer 142b1a3
revert changes to toxins.yml
ErhardSteinhauer 443322c
Merge branch 'GoblinFoodSystem' of https://github.com/ErhardSteinhaue…
ErhardSteinhauer 03ce1a6
Update pie.yml
dvir001 d7f6d41
Merge branch 'GoblinFoodSystem' of https://github.com/ErhardSteinhaue…
dvir001 0c82113
mail things
ErhardSteinhauer a93646a
Merge branch 'GoblinFoodSystem' of https://github.com/ErhardSteinhaue…
ErhardSteinhauer 06c29ad
Update StomachComponent.cs
dvir001 85538a2
Update FoodComponent.cs
dvir001 c4e7c52
Update StomachComponent.cs
dvir001 730522f
Merge branch 'master' into GoblinFoodSystem
dvir001 38f3a33
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer 075435b
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer 611be4a
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer ba68a1b
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer 802d6f1
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer 3fafed3
Merge branch 'master' of https://github.com/dvir001/frontier-station-…
dvir001 a41995a
Food System Multi types support
dvir001 9693762
trash eating gob stomach
ErhardSteinhauer fe792f7
Update FoodSystem.cs
dvir001 2ff271a
Merge branch 'GoblinFoodSystem' of https://github.com/ErhardSteinhaue…
dvir001 bd84268
Update FoodSystem.cs
dvir001 a3cf959
more trash food
ErhardSteinhauer 24c27e8
Food
dvir001 d009322
Merge branch 'GoblinFoodSystem' of https://github.com/ErhardSteinhaue…
dvir001 f890786
Allow goblin to eat open mail only
dvir001 94294be
yml fixes
ErhardSteinhauer e9a96a6
more yml fixes
ErhardSteinhauer 0b59814
No More refill
dvir001 39aefbd
less corn in cob
ErhardSteinhauer 0d099ee
Pain
dvir001 0d15fce
Fixing
dvir001 052d619
Moff
dvir001 118699e
Update paper.yml
dvir001 ac5ed9a
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer b68dbc3
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer 4986a68
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer 43c326c
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer e170050
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer 69e9585
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer 86e939a
Merge branch 'master' into GoblinFoodSystem
ErhardSteinhauer a411773
Merge branch 'master' of https://github.com/dvir001/frontier-station-…
dvir001 4874a83
Merge branch 'GoblinFoodSystem' of https://github.com/ErhardSteinhaue…
dvir001 eaee2bf
Fixup
dvir001 7298cf6
Update burger.yml
dvir001 7a6338e
Update FoodSystem.cs
dvir001 6c7010f
Update FoodSystem.cs
dvir001 483d048
Update Resources/Locale/en-US/_NF/nutrition/components/food-component…
dvir001 311260b
Update FoodSystem.cs
dvir001 92dd46b
Update Resources/Locale/en-US/_NF/reagents/foods.ftl
dvir001 4130c94
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer bf200cb
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer 9aebf22
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer 38f6b4e
mail
ErhardSteinhauer 5773635
Merge branch 'GoblinFoodSystem' of https://github.com/ErhardSteinhaue…
ErhardSteinhauer 5b5852e
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer 743d8f2
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer cbc57d7
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer 27f449a
Merge branch 'new-frontiers-14:master' into GoblinFoodSystem
ErhardSteinhauer ad7958c
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 1dda7a0
Stomach: Digestion types & function enums
whatston3 af99523
FoodSystem: digestion rework
whatston3 20d78a5
digestion check proof of concept
whatston3 c7065b4
Quality to enum, restore special digestion for now
whatston3 e354ede
Missing food qualities, restore special digestion
whatston3 1633fe7
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 a822ac3
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 61939fd
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 0e84795
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 ab50cd9
Merge branch 'master' into 2024-07-09-GoblinFoodSystem-cleanup
ErhardSteinhauer 07c2abf
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 08cd56e
Species-specific digestion progress with prototype
whatston3 02d0806
Compilation fix (bad merge)
whatston3 f719d0a
Bugfixes, initial bloatamine pass
whatston3 e972738
more stuff
whatston3 488d9f8
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 0b34d57
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 32c3372
Merge branch 'master' into 2024-07-09-GoblinFoodSystem-cleanup
dvir001 8c3286a
Merge branch 'master' into 2024-07-09-GoblinFoodSystem-cleanup
dvir001 c76854f
Fix food Flavorol
dvir001 a45480f
Merge branch 'master' into 2024-07-09-GoblinFoodSystem-cleanup
dvir001 342b355
Merge branch 'master' into 2024-07-09-GoblinFoodSystem-cleanup
dvir001 cf20071
Update EntryPoint.cs
dvir001 3ae461f
Update digestion.yml
dvir001 d2226e1
Update digestion.yml
dvir001 6fba51c
Fixups
dvir001 0505634
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 5e98d3c
Carnivore diet: no bland food buffs
whatston3 6515ed7
Fix dependencies
whatston3 92253b0
Merge branch 'master' into 2024-07-09-GoblinFoodSystem-cleanup
dvir001 b6d024f
Merge branch 'master' into 2024-07-09-GoblinFoodSystem-cleanup
dvir001 ce7222a
Food rework changes (WIP)
whatston3 d8b7fae
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 35bc96f
Fix ruminant digestion prototype
whatston3 801f28e
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 b62aa9b
Merge branch 'master' into 2024-07-09-GoblinFoodSystem-cleanup
dvir001 fa73563
No TrashJuice, weaker goblin gourmet
whatston3 f6871a8
Merge branch 'master' into 2024-07-09-GoblinFoodSystem-cleanup
dvir001 d55d56f
Merge branch 'master' into 2024-07-09-GoblinFoodSystem-cleanup
dvir001 eb752d8
Merge branch 'master' into 2024-07-09-GoblinFoodSystem-cleanup
dvir001 4c5f0ec
Merge branch 'master' into 2024-07-09-GoblinFoodSystem-cleanup
dvir001 3619495
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 b2c3b3d
adjustments to food quality
whatston3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
Content.Server/_NF/Nutrition/EntitySystems/FoodSystem.Digestion.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// New Frontiers - This file is licensed under AGPLv3 | ||
// Copyright (c) 2024 New Frontiers Contributors | ||
// See AGPLv3.txt for details. | ||
using Content.Server.Nutrition.Components; | ||
using Content.Shared.Chemistry.Reagent; | ||
using Content.Shared.Chemistry.Components; | ||
using Content.Server.Body.Components; | ||
using Robust.Shared.Prototypes; | ||
using Content.Shared.EntityEffects; | ||
using Robust.Shared.Random; | ||
using Content.Shared.Chemistry; | ||
|
||
namespace Content.Server.Nutrition.EntitySystems; | ||
|
||
// Frontier: extending food system to handle species-specific digestion quirks. | ||
public sealed partial class FoodSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototype = default!; | ||
[Dependency] private readonly IRobustRandom _random = default!; | ||
|
||
public struct DigestionResult | ||
{ | ||
public bool ShowFlavors; | ||
} | ||
|
||
DigestionResult DigestFood(Entity<FoodComponent> food, Entity<StomachComponent> stomach, Solution eatenSolution, EntityUid target, EntityUid _) | ||
{ | ||
var result = new DigestionResult | ||
{ | ||
ShowFlavors = true | ||
}; | ||
|
||
// Frontier - Food quality system | ||
if (!_prototype.TryIndex(stomach.Comp.Digestion, out var digestion)) | ||
{ | ||
return result; | ||
} | ||
|
||
var eatenVolume = eatenSolution.Volume; | ||
while (digestion != null) | ||
{ | ||
// Iterate through effects | ||
foreach (var effect in digestion.Effects) | ||
{ | ||
// Precondition: match food quality and/or whitelist. | ||
if (effect.Quality.Contains(food.Comp.Quality)) | ||
continue; | ||
|
||
if (_whitelistSystem.IsWhitelistFail(effect.Whitelist, food.Owner) | ||
|| _whitelistSystem.IsBlacklistPass(effect.Whitelist, food.Owner)) | ||
continue; | ||
|
||
// Run reagent conversions | ||
foreach (var (beforeReagent, afterDict) in effect.Conversions) | ||
{ | ||
var removedAmount = eatenSolution.RemoveReagent(new ReagentQuantity(beforeReagent, eatenVolume)); | ||
foreach (var (afterReagent, afterRatio) in afterDict) | ||
{ | ||
eatenSolution.AddReagent(new ReagentQuantity(afterReagent, removedAmount * afterRatio)); | ||
} | ||
} | ||
|
||
var args = new EntityEffectReagentArgs(target, EntityManager, stomach.Owner, eatenSolution, eatenSolution.Volume, null, ReactionMethod.Ingestion, 1.0f); | ||
foreach (var entEffect in effect.Effects) | ||
{ | ||
if (!EntityEffectExt.ShouldApply(entEffect, args, _random)) | ||
continue; | ||
entEffect.Effect(args); | ||
} | ||
} | ||
|
||
// Get next digestion to run | ||
if (!_prototype.TryIndex(digestion.PostDigest, out digestion)) | ||
{ | ||
digestion = null; | ||
} | ||
} | ||
|
||
return result; | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
Content.Server/_NF/Nutrition/Prototypes/DigestionPrototype.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using Content.Server.Nutrition.Components; | ||
using Content.Shared.Chemistry.Reagent; | ||
using Content.Shared.EntityEffects; | ||
using Content.Shared.FixedPoint; | ||
using Content.Shared.Whitelist; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server._NF.Nutrition.Prototypes; | ||
|
||
[Prototype("digestion")] | ||
[DataDefinition] | ||
public sealed partial class DigestionPrototype : IPrototype | ||
{ | ||
[ViewVariables] | ||
[IdDataField] | ||
public string ID { get; private set; } = default!; | ||
|
||
/// <summary> | ||
/// The list of digestive effects that occur in this organ. | ||
/// </summary> | ||
[DataField] | ||
public List<DigestionEffect> Effects { get; private set; } = new(); | ||
|
||
/// <summary> | ||
/// The list of digestive effects that occur in this organ. | ||
/// </summary> | ||
[DataField] | ||
public ProtoId<DigestionPrototype>? PostDigest { get; private set; } = null; | ||
} | ||
|
||
[DataDefinition] | ||
public sealed partial class DigestionEffect | ||
{ | ||
/// <summary> | ||
/// The quality of food this effect occurs on. | ||
/// </summary> | ||
[DataField] | ||
public List<FoodQuality> Quality { get; private set; } = new(); | ||
|
||
/// <summary> | ||
/// A whitelist on the food item this bite was taken from. | ||
/// </summary> | ||
[DataField] | ||
public EntityWhitelist? Whitelist { get; private set; } = null; | ||
|
||
/// <summary> | ||
/// A blacklist on the food item this bite was taken from. | ||
/// </summary> | ||
[DataField] | ||
public EntityWhitelist? Blacklist { get; private set; } = null; | ||
|
||
/// <summary> | ||
/// A list of reagent effects that happen on the stomach solution | ||
/// </summary> | ||
[DataField] | ||
public List<EntityEffect> Effects { get; private set; } = new(); | ||
|
||
/// <summary> | ||
/// A list of conversions. All values should be ratios of the input reagent, and the sum of their values should be <= 1. | ||
/// </summary> | ||
[DataField] | ||
public Dictionary<ProtoId<ReagentPrototype>, Dictionary<ProtoId<ReagentPrototype>, FixedPoint2>> Conversions { get; private set; } = new(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
reagent-name-trashjuice = trash juice | ||
reagent-desc-trashjuice = Do you really want to know what it is? |
3 changes: 3 additions & 0 deletions
3
Resources/Locale/en-US/_NF/reagents/meta/consumable/food/food.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
reagent-name-flavorol = flavorol | ||
reagent-desc-flavorol = All the vitamins, minerals, and carbohydrates the body needs in pure form. | ||
|
||
reagent-name-bloatamine = bloatamine | ||
reagent-desc-bloatamine = A metabolized version of the preservatives put in junk food. Carcinogenic in large quantities. | ||
|
||
reagent-name-raisins = raisins | ||
reagent-desc-raisins = Are they the best or worst part of the cookie? They're a bunch of desiccated grapes is what they are. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
reagent-physical-desc-trashjuice = ... Wait.. Did it just move? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ | |
solutions: | ||
stomach: | ||
maxVol: 80 | ||
- type: Stomach # Frontier | ||
digestion: Ruminant # Frontier |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this , doesnt need to be in files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pr been open so long we kind of forgot about it, should be removed