Adds eating with utensils (#1136)

* Add Utensil component

For eating. With utensils.
Added to fork, plastic fork, spoon, plastic spoon and plastic knife.
Ignored component on the client.

* Add break chance to utensils

Set to 20% for plastic ones

* Add break sound to utensils

* Add utensil kinds

None, fork, spoon and knife.
For sporks, forknifes and sporknifes, of course.

* Add restricting foods by utensils needed

* Fix utensils breaking when food isn't eaten

* Moved getting held utensils to FoodComponent

* Add breaking a clicking utensil even if its not necessary to eat the food

* Move use utensil code to a separate method

* Add telling a handless entity when they need an utensil to eat

The immersion is off the charts

* Change food trash to only be held when the food was also being held

* Fix Wi-Fi utensils

* Remove unnecessary utensil ItemGroup

* Made TryUseFood public, removed redundant trash position update

* Renamed UtensilKind to UtensilType

* Remove eating food when clicking with it on nothing

* Disable eating food when clicked directly if it requires an untensil to eat
This commit is contained in:
DrSmugleaf
2020-06-19 15:20:59 +02:00
committed by GitHub
parent cda8f8b2bc
commit 99a5e06b98
6 changed files with 263 additions and 26 deletions

Binary file not shown.

View File

@@ -5,7 +5,6 @@
components:
- type: Sprite
sprite: Objects/utensils.rsi
- type: Icon
sprite: Objects/utensils.rsi
@@ -17,9 +16,11 @@
components:
- type: Sprite
state: fork
- type: Icon
state: fork
- type: Utensil
types:
- Fork
- type: entity
parent: UtensilBase
@@ -28,9 +29,12 @@
components:
- type: Sprite
state: plastic_fork
- type: Icon
state: plastic_fork
- type: Utensil
types:
- Fork
breakChance: 0.20
- type: entity
parent: UtensilBase
@@ -40,9 +44,11 @@
components:
- type: Sprite
state: spoon
- type: Icon
state: spoon
- type: Utensil
types:
- Spoon
- type: entity
parent: UtensilBase
@@ -52,9 +58,12 @@
components:
- type: Sprite
state: plastic_spoon
- type: Icon
state: plastic_spoon
- type: Utensil
types:
- Spoon
breakChance: 0.20
- type: entity
parent: UtensilBase
@@ -63,6 +72,9 @@
components:
- type: Sprite
state: plastic_knife
- type: Icon
state: plastic_knife
- type: Utensil
types:
- Knife
breakChance: 0.20