From b0f1f4ae8925db28d423b92046fe2aa45689cde3 Mon Sep 17 00:00:00 2001 From: bloodrizer Date: Sun, 30 Jan 2022 05:27:51 -0800 Subject: [PATCH] added consumption timeout for beverages and snacks (#5013) Co-authored-by: metalgearsloth --- .../Food/{injectable_base.yml => food_base.yml} | 17 ++++++++++++++--- .../Entities/Objects/Consumable/Food/snacks.yml | 2 +- .../Entities/Objects/Consumable/Food/soup.yml | 2 +- .../Entities/Objects/Consumable/drinks.yml | 3 +++ .../Objects/Consumable/drinks_bottles.yml | 10 +--------- .../Entities/Objects/Consumable/drinks_cans.yml | 3 +++ .../Entities/Objects/Consumable/drinks_cups.yml | 3 +++ 7 files changed, 26 insertions(+), 14 deletions(-) rename Resources/Prototypes/Entities/Objects/Consumable/Food/{injectable_base.yml => food_base.yml} (69%) diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/injectable_base.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/food_base.yml similarity index 69% rename from Resources/Prototypes/Entities/Objects/Consumable/Food/injectable_base.yml rename to Resources/Prototypes/Entities/Objects/Consumable/Food/food_base.yml index 3cba19b61c..a78d2757d5 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/injectable_base.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/food_base.yml @@ -1,13 +1,24 @@ +# +# Base component for consumable food +# +- type: entity + parent: BaseItem + id: FoodBase + abstract: true + components: + - type: Food + - type: ItemCooldown + - type: UseDelay + delay: 1.5 + # This base type is used to cover all of the "obvious" things that should be doable to open-package food. # Practically this means injection. # But it might in future also mean drawing with a syringe, so this is a base prototype just in case. - type: entity - parent: BaseItem + parent: FoodBase id: FoodInjectableBase abstract: true components: - - type: Food - type: InjectableSolution solution: food - diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml index 541d0a098d..a71ba5c886 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/snacks.yml @@ -1,7 +1,7 @@ # Base - type: entity - parent: BaseItem + parent: FoodBase id: FoodSnackBase abstract: true components: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml index f772cde850..83e4c84a06 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml @@ -1,5 +1,5 @@ - type: entity - parent: BaseItem + parent: FoodBase id: FoodBowlBase abstract: true components: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/drinks.yml b/Resources/Prototypes/Entities/Objects/Consumable/drinks.yml index bee404e018..52e62f661a 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/drinks.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/drinks.yml @@ -20,6 +20,9 @@ interfaces: - key: enum.TransferAmountUiKey.Key type: TransferAmountBoundUserInterface + - type: ItemCooldown + - type: UseDelay + delay: 1.0 - type: entity parent: DrinkBase diff --git a/Resources/Prototypes/Entities/Objects/Consumable/drinks_bottles.yml b/Resources/Prototypes/Entities/Objects/Consumable/drinks_bottles.yml index 689c5eab1a..388a1a122d 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/drinks_bottles.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/drinks_bottles.yml @@ -1,5 +1,5 @@ - type: entity - parent: BaseItem + parent: DrinkBase id: DrinkBottleBaseFull abstract: true components: @@ -10,12 +10,6 @@ solutions: drink: maxVol: 100 - - type: SolutionTransfer - canChangeTransferAmount: true - - type: UserInterface - interfaces: - - key: enum.TransferAmountUiKey.Key - type: TransferAmountBoundUserInterface - type: Sprite state: icon - type: DamageOnLand @@ -26,8 +20,6 @@ damage: types: Blunt: 4 - - type: Spillable - solution: drink - type: Damageable damageContainer: Inorganic - type: Destructible diff --git a/Resources/Prototypes/Entities/Objects/Consumable/drinks_cans.yml b/Resources/Prototypes/Entities/Objects/Consumable/drinks_cans.yml index 3dc1b19f24..356c4ac1e7 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/drinks_cans.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/drinks_cans.yml @@ -37,6 +37,9 @@ - type: Tag tags: - Trash + - type: ItemCooldown + - type: UseDelay + delay: 1.0 - type: entity parent: DrinkCanBaseFull diff --git a/Resources/Prototypes/Entities/Objects/Consumable/drinks_cups.yml b/Resources/Prototypes/Entities/Objects/Consumable/drinks_cups.yml index bc9a82092e..f76fed768b 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/drinks_cups.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/drinks_cups.yml @@ -28,6 +28,9 @@ state: icon - type: Spillable solution: drink + - type: ItemCooldown + - type: UseDelay + delay: 1.0 - type: entity parent: DrinkBaseCup