- type: entity
  id: BaseRock
  name: boulder
  description: Heavy as a really heavy thing.
  abstract: true
  components:
  - type: Clickable
  - type: Sprite
    noRot: true
    sprite: Objects/Decoration/Flora/flora_rockssolid.rsi
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.4
        density: 1000
        layer:
        - HalfWallLayer
        - Opaque
  - type: Climbable
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 200
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]

- type: entity
  id: BaseTree
  description: Yep, it's a tree.
  abstract: true
  components:
  - type: SpriteFade
  - type: Clickable
  - type: Sprite
    noRot: true
    sprite: Objects/Decoration/Flora/flora_trees.rsi
    drawdepth: Overdoors
    offset: 0,0.9
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.35,-0.4,0.35,0.4"
        density: 1000
        layer:
        - WallLayer
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: WoodenStructure # The wood set seems better suited to represent furniture. Shouldn't chop a tree down with three quick smacks of a hatchet. starcup: feat more trees and flora
  - type: MeleeSound
    soundGroups:
      Brute:
        path: /Audio/Effects/chop.ogg
        params:
          variation: 0.05
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 400
      behaviors:
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/Effects/tree_fell.ogg
          params:
            volume: 5
            variation: 0.05
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
      - !type:SpawnEntitiesBehavior
        spawn:
          Log:
            min: 2
            max: 8
  - type: TypingIndicator # Add diona typing indicator here so that diona players keep the same typing bubble when polymorphed into a tree.
    proto: diona

- type: entity
  parent: BaseTree
  id: BaseTreeSnow
  abstract: true
  components:
  - type: Sprite
    sprite: Objects/Decoration/Flora/flora_treessnow.rsi
    offset: 0,0.7
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.1,-0.3,0.1,0.3"
        density: 4000
        layer:
        - WallLayer

- type: entity
  parent: BaseTree
  id: BaseTreeLarge
  abstract: true
  components:
  - type: Sprite
    sprite: Objects/Decoration/Flora/flora_treeslarge.rsi
    offset: 0,1.55
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.18,-0.35,0.18,0.35"
        density: 2000
        layer:
        - WallLayer

- type: entity
  parent: BaseTree
  id: BaseTreeConifer
  abstract: true
  components:
  - type: Sprite
    sprite: Objects/Decoration/Flora/flora_treesconifer.rsi
    offset: 0,1.15
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.1,-0.35,0.1,0.35"
        density: 3500
        layer:
        - WallLayer

- type: entity
  parent: BaseRock
  id: FloraRockSolid
  components:
  - type: Sprite
    layers:
    - state: rocksolid01
      map: ["random"]
  - type: RandomSprite
    available:
    - random:
        rocksolid01: ""
        rocksolid02: ""
        rocksolid03: ""

- type: entity
  name: stalagmite
  description: Natural stone spikes.
  parent: BaseRock
  id: FloraStalagmite
  components:
  - type: Destructible
    thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 5
        behaviors:
          - !type:DoActsBehavior
            acts: [ "Destruction" ]
          - !type:PlaySoundBehavior
            sound:
              collection: GlassBreak
  - type: Sprite
    sprite: Objects/Decoration/Flora/flora_stalagmite.rsi
    layers:
    - state: stalagmite1
      map: ["random"]
  - type: RandomSprite
    available:
    - random:
        stalagmite1: ""
        stalagmite2: ""
        stalagmite3: ""
        stalagmite4: ""
        stalagmite5: ""
        stalagmite6: ""

- type: entity
  parent: FloraStalagmite
  id: FloraGreyStalagmite
  components:
  - type: Sprite
    sprite: Objects/Decoration/Flora/flora_stalagmite.rsi
    layers:
    - state: grey_stalagmite1
      map: ["random"]
  - type: RandomSprite
    available:
    - random:
        grey_stalagmite1: ""
        grey_stalagmite2: ""
        grey_stalagmite3: ""
        grey_stalagmite4: ""
        grey_stalagmite5: ""
        grey_stalagmite6: ""

- type: entity
  parent: BaseTree
  id: FloraTree
  name: tree
  suffix: jungle/swamp # Added for clarity, as there's more variation in trees now. starcup: feat. more tress & flora
  components:
  - type: Sprite
    layers:
    - state: tree01
      map: ["random"]
  - type: RandomSprite
    available:
    - random:
        tree01: ""
        tree02: ""
        tree03: ""
        tree04: ""
        tree05: ""
        tree06: ""

- type: entity
  parent: BaseTreeSnow
  id: FloraTreeSnow
  name: snowy tree
  components:
  - type: Sprite
    layers:
    - state: treesnow01
      map: ["random"]
  - type: RandomSprite
    available:
    - random:
        treesnow01: ""
        treesnow02: ""
        treesnow03: ""
        treesnow04: ""
        treesnow05: ""
        treesnow06: ""

- type: entity
  parent: BaseTreeSnow
  id: FloraTreeStump
  name: tree stump
  components:
  - type: Sprite
    state: treestump

- type: entity
  parent: BaseTreeLarge
  id: FloraTreeLarge
  name: large tree
  suffix: jungle/swamp # Added for clarity, as there's more variation in trees now. starcup: feat. more tress & flora
  components:
  - type: Sprite
    layers:
    - state: treelarge01
      map: ["random"]
  - type: RandomSprite
    available:
    - random:
        treelarge01: ""
        treelarge02: ""
        treelarge03: ""
        treelarge04: ""
        treelarge05: ""
        treelarge06: ""

- type: entity
  parent: BaseTreeConifer
  id: FloraTreeConifer
  name: snowy conifer
  components:
  - type: Sprite
    layers:
    - state: treeconifer01
      map: ["random"]
  - type: RandomSprite
    available:
    - random:
        treeconifer01: ""
        treeconifer02: ""
        treeconifer03: ""

- type: entity
  parent: BaseTreeConifer
  id: FloraTreeChristmas01
  name: christmas tree
  components:
  - type: Sprite
    state: treechristmas01

- type: entity
  parent: BaseTreeConifer
  id: FloraTreeChristmas02
  suffix: Safe Presents
  name: christmas tree
  components:
  - type: Sprite
    state: treechristmas02
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.5,0,0.5,0.75"
        density: 4500
        layer:
        - WallLayer
  - type: LimitedItemGiver
    spawnEntries:
      - id: PresentRandom
        orGroup: present
      - id: PresentRandomCash # buy your own.
        prob: 0.1
        orGroup: present
      - id: PresentRandomCoal # naughty
        prob: 0.05
        orGroup: present
    receivedPopup: christmas-tree-got-gift
    deniedPopup: christmas-tree-no-gift
    requiredHoliday: FestiveSeason

- type: entity
  parent: FloraTreeChristmas02
  id: FloraTreeChristmas03
  suffix: Insane Presents
  name: christmas tree
  components:
  - type: LimitedItemGiver
    spawnEntries:
      - id: PresentRandom
        orGroup: present
      - id: PresentRandomUnsafe
        prob: 0.5
        orGroup: present
      - id: PresentRandomInsane
        prob: 0.2
        orGroup: present

- type: entity
  parent: BaseTreeConifer
  id: FloraTreeStumpConifer
  name: tree stump
  components:
  - type: Sprite
    state: treestumpconifer

- type: entity
  parent: FloraTree
  id: ShadowTree
  name: dark wood
  description: The leaves are whispering about you.
  components:
  - type: Sprite
    sprite: Objects/Decoration/Flora/flora_shadow_trees.rsi

- type: entity
  parent: BaseTree
  id: LightTree
  name: glowing tree
  description: A marvelous tree filled with strange energy.
  components:
  - type: PointLight
    radius: 2.0
    energy: 4.5
    color: "#6270bb"
  - type: Sprite
    sprite: Objects/Decoration/Flora/flora_treeslight.rsi
    layers:
    - state: tree01
      map: ["random"]
  - type: RandomSprite
    available:
    - random:
        tree01: ""
        tree02: ""
        tree03: ""
        tree04: ""
        tree05: ""
        tree06: ""
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 400
      behaviors:
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 25
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/Effects/tree_fell.ogg
          params:
            volume: 5
            variation: 0.05
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
      - !type:SpawnEntitiesBehavior
        spawn:
          Log:
            min: 0
            max: 1
      - !type:SpawnEntitiesBehavior
        spawn:
          MobLuminousObject:
            min: 0
            max: 1
