Custom burgers - FoodSequence system (#30755)
* setup foodsequence * name generation and max layers limit * move to nutrition * move code to serverside * move to appearance data * marked fields as required * Update foodsequence.yml * b * burgeers! * Update produce.yml * Update meat.yml * Update burger.yml * fix duplicate naming * Update Resources/Locale/en-US/nutrition/components/food-sequence.ftl Co-authored-by: Hrosts <35345601+Hrosts@users.noreply.github.com> * merge flavor profiles * make food trash List<> * merge trash * Update FoodComponent.cs * Update FoodComponent.cs * organs and cannabis support --------- Co-authored-by: Hrosts <35345601+Hrosts@users.noreply.github.com>
This commit is contained in:
@@ -335,27 +335,31 @@ public sealed class FoodSystem : EntitySystem
|
||||
if (ev.Cancelled)
|
||||
return;
|
||||
|
||||
if (string.IsNullOrEmpty(component.Trash))
|
||||
if (component.Trash.Count == 0)
|
||||
{
|
||||
QueueDel(food);
|
||||
return;
|
||||
}
|
||||
|
||||
//We're empty. Become trash.
|
||||
//cache some data as we remove food, before spawning trash and passing it to the hand.
|
||||
|
||||
var position = _transform.GetMapCoordinates(food);
|
||||
var finisher = Spawn(component.Trash, position);
|
||||
var trashes = component.Trash;
|
||||
var tryPickup = _hands.IsHolding(user, food, out _);
|
||||
|
||||
// If the user is holding the item
|
||||
if (_hands.IsHolding(user, food, out var hand))
|
||||
Del(food);
|
||||
foreach (var trash in trashes)
|
||||
{
|
||||
Del(food);
|
||||
var spawnedTrash = Spawn(trash, position);
|
||||
|
||||
// Put the trash in the user's hand
|
||||
_hands.TryPickup(user, finisher, hand);
|
||||
return;
|
||||
// If the user is holding the item
|
||||
if (tryPickup)
|
||||
{
|
||||
// Put the trash in the user's hand
|
||||
_hands.TryPickupAnyHand(user, spawnedTrash);
|
||||
}
|
||||
}
|
||||
|
||||
QueueDel(food);
|
||||
}
|
||||
|
||||
private void AddEatVerb(Entity<FoodComponent> entity, ref GetVerbsEvent<AlternativeVerb> ev)
|
||||
|
||||
Reference in New Issue
Block a user