# Base

# uses "icon" and "icon-open" states for the main item.
# trash prototypes use "trash" state
- type: entity
  abstract: true
  parent: [FoodBase, FoodOpenableBase]
  id: FoodTinBase
  name: tin
  description: A tin of something, sealed tight.
  components:
  - type: SolutionContainerManager
    solutions:
      food:
        maxVol: 20
        reagents:
        - ReagentId: Nutriment
          Quantity: 15
  - type: Openable
    openableByHand: false
    sound:
      path: /Audio/Items/can_open3.ogg
  - type: Destructible
    thresholds:
    # if tinned food is nuked just delete it, no sound
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 6
      behaviors:
      - !type:OpenBehavior
  - type: Item
    sprite: Objects/Consumable/Food/snacks.rsi
    heldPrefix: packet
    size: Small
  - type: DamageOnLand
    damage:
      types:
        Blunt: 3
  - type: DamageOtherOnHit
    damage:
      types:
        Blunt: 3
  - type: Damageable
    damageContainer: Inorganic
  - type: StaticPrice
    price: 50

- type: entity
  abstract: true
  parent: BaseItem
  id: FoodTinBaseTrash
  name: empty tin
  description: An empty tin. Could get a bit of metal from this.
  components:
  - type: Sprite
    state: trash
  - type: Item
    sprite: Objects/Consumable/Food/snacks.rsi
    heldPrefix: packet
    size: Small
  - type: PhysicalComposition
    materialComposition:
      Steel: 100
  - type: Tag
    tags:
    - Trash

# Tins

# Need something that you can open these tins with. I suggest a prying or cutting tool.

- type: entity
  parent: FoodTinBase
  id: FoodTinPeaches
  name: tinned peaches
  description: Just a nice can of ripe peaches swimming in their own juices.
  components:
  - type: Item
    storedOffset: 0,-3
  - type: Sprite
    sprite: Objects/Consumable/Food/Tins/peaches.rsi
  - type: FlavorProfile
    flavors:
    - sweet
    - funny
  - type: Edible
    trash:
    - FoodTinPeachesTrash
  - type: Tag
    tags:
    - Fruit

- type: entity
  parent: FoodTinBaseTrash
  id: FoodTinPeachesTrash
  name: tinned peaches
  components:
  - type: Item
    storedOffset: 0,-3
  - type: Sprite
    sprite: Objects/Consumable/Food/Tins/peaches.rsi

# slightly run down texture and different name
- type: entity
  parent: FoodTinPeaches
  id: FoodTinPeachesMaint
  name: maintenance peaches
  components:
  - type: Sprite
    sprite: Objects/Consumable/Food/Tins/maint_peaches.rsi
  - type: Edible
    trash:
    - FoodTinPeachesMaintTrash

# only exists for backwards compatibility with a few maps, nothing else uses it
- type: entity
  parent: FoodTinPeachesMaint
  id: FoodTinPeachesMaintOpen
  suffix: Open
  components:
  - type: Sprite
    layers:
    - state: icon-open
      map: ["icon"]
  - type: Openable
    opened: true

- type: entity
  parent: FoodTinBaseTrash
  id: FoodTinPeachesMaintTrash
  name: maintenance peaches
  components:
  - type: Item
    storedOffset: 0,-3
  - type: Sprite
    sprite: Objects/Consumable/Food/Tins/maint_peaches.rsi

- type: entity
  parent: FoodTinBase
  id: FoodTinBeans
  name: tin of beans
  description: Musical fruit in a slightly less musical container.
  components:
  - type: Item
    storedOffset: 0,-3
  - type: Sprite
    sprite: Objects/Consumable/Food/Tins/beans.rsi
  - type: FlavorProfile
    flavors:
    - savory
    - salty
    - cheap
  - type: Edible
    trash:
    - FoodTinBeansTrash

- type: entity
  parent: FoodTinBaseTrash
  id: FoodTinBeansTrash
  name: tin of beans
  components:
  - type: Item
    storedOffset: 0,-3
  - type: Sprite
    sprite: Objects/Consumable/Food/Tins/beans.rsi

# MRE can

- type: entity
  parent: FoodTinBase
  id: FoodTinMRE
  name: tinned meat
  description: A standard issue tin of meat with a convenient pull tab.
  components:
  - type: Item
    size: Tiny
    shape:
    - 0,0,0,0
  - type: Sprite
    sprite: Objects/Consumable/Food/Tins/meat.rsi
  # the convenient pull tab
  - type: Openable
    openableByHand: true
  - type: FlavorProfile
    flavors:
    - meaty
    - salty
    - cheap
  - type: Edible
    trash:
    - FoodTinMRETrash
  - type: Tag
    tags:
    - Meat

- type: entity
  parent: FoodTinBaseTrash
  id: FoodTinMRETrash
  name: tinned meat
  components:
  - type: Item
    size: Tiny
    shape:
    - 0,0,0,0
  - type: Sprite
    sprite: Objects/Consumable/Food/Tins/meat.rsi
