- type: entity
  parent: [ BaseStructure, StructureHealthFurniture ]
  id: Spaceshroom
  name: spaceshroom
  suffix: Structure
  description: A cluster of wild mushrooms that likes to grow in dark, moist environments.
  components:
    - type: Sprite
      sprite: Objects/Misc/spaceshroom.rsi
      state: structure
    - type: Transform
      anchored: true
    - type: Physics
      bodyType: Static
    - type: Fixtures
      fixtures:
        fix1:
          shape:
            !type:PhysShapeCircle
            radius: 0.2
    - type: InteractionOutline
    - type: Gatherable
      toolWhitelist:
        components:
          - Hands
      loot:
        All: !type:GroupSelector
          children:
          - id: FoodSpaceshroom
    - type: Damageable
      damageModifierSet: WoodMod
    - type: Injurable
      damageContainer: StructuralBiological
    - type: Destructible
      thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 40
        behaviors:
        - !type:PlaySoundBehavior
          sound:
            path: /Audio/Effects/tree_fell.ogg
            params:
              volume: -5
              variation: 0.05
        - !type:SpawnEntitiesBehavior
          spawn:
            FoodSpaceshroom:
              min: 0
              max: 1

- type: entity
  name: spaceshroom
  parent: [SolutionSmall, FoodProduceBase]
  id: FoodSpaceshroom
  description: A wild mushroom. There's no telling what effect it could have...
  components:
  - type: Produce
  - type: Sprite
    sprite: Objects/Misc/spaceshroom.rsi
    state: object
  - type: FlavorProfile
    flavors:
      - spaceshroom
  - type: Extractable
    juiceSolution:
      reagents:
      - ReagentId: SpaceDrugs
        Quantity: 10
  - type: Solution
    solution:
      reagents: # 20u out of 60u space, with 10-15 extra from solution random fill
      - ReagentId: Nutriment
        Quantity: 12
      - ReagentId: Vitamin
        Quantity: 8
  - type: RandomFillSolution
    solution: food
    weightedRandomId: RandomFillSpaceshroom
  - type: StaticPrice
    price: 20
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.25,-0.25,0.25,0.25"
        density: 1
        mask:
        - ItemMask
        restitution: 0.3
        friction: 0.2
  - type: Construction
    graph: CookedSpaceshroom
    node: start
    defaultTarget: cooked spaceshroom
  - type: AtmosExposed
  - type: Temperature
    thermalConductivity: 1
    temperature: 293.15
    heatCapacity: 750
  - type: TemperatureDamage
  - type: InternalTemperature
  - type: Tag
    tags:
    - Mushroom

- type: weightedRandomFillSolution
  id: RandomFillSpaceshroom
  fills:
  - quantity: 10
    weight: 10
    reagents:
    - SpaceDrugs
  - quantity: 0
    weight: 5
    reagents:
    - Water
  - quantity: 10
    weight: 3
    reagents:
    - Ephedrine
  - quantity: 10
    weight: 1
    reagents:
    - Lexorin
  - quantity: 15
    weight: 1
    reagents:
    - Amatoxin

# Cooked Object
- type: entity
  name: cooked spaceshroom
  parent: [SolutionSmall, FoodProduceBase]
  id: FoodSpaceshroomCooked
  description: A wild mushroom that has been cooked through. It seems the heat has removed its chemical effects.
  components:
  - type: FlavorProfile
    flavors:
      - spaceshroomcooked
  - type: Solution
    solution:
      reagents: # Cooked means no drugs I guess? Lame!
      - ReagentId: Nutriment
        Quantity: 20
      - ReagentId: Vitamin
        Quantity: 10
  - type: Sprite
    sprite: Objects/Misc/spaceshroom.rsi
    state: spaceshroom_cooked
  - type: Produce
  - type: StaticPrice
    price: 40
  - type: Construction
    graph: CookedSpaceshroom
    node: cooked spaceshroom
