# SPDX-License-Identifier: AGPL-3.0-or-later
# Base component for edible food-like items
#
- type: entity
  abstract: true
  parent: BaseItem
  id: EdibleBase
  components:
  - type: FlavorProfile
    flavors:
      - food
  - type: Edible
  - type: Sprite
  - type: StaticPrice
    price: 0

#
# Base component for consumable food
# that should be cleaned up in space
#
- type: entity
  abstract: true
  parent: EdibleBase
  id: FoodBase
  components:
  - type: SpaceGarbage
  - type: Appearance
  - type: HeatTint # Goob - Heat tint
    colorGradient:
    - temperature: 200
      color: "#6699FF"
    - temperature: 293
      color: "#FFFFFF"
    - temperature: 350
      color: "#FF6600"
    - temperature: 600
      color: "#FF2200"

# 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
  abstract: true
  parent: FoodBase
  id: FoodInjectableBase
  components:
  - type: InjectableSolution
    solution: food
  - type: RefillableSolution
    solution: food

# usable by any food that can be opened
# handles appearance with states "icon" and "icon-open"
- type: entity
  abstract: true
  id: FoodOpenableBase
  components:
  - type: Appearance
  - type: Sprite
    layers:
    - state: icon
      map: ["icon"]
  - type: GenericVisualizer
    visuals:
      enum.OpenableVisuals.Opened:
        icon:
          True: {state: "icon-open"}
          False: {state: "icon"}
  - type: Openable
