## Material costs to apply to a drink
# These bases should always be the parented before DrinkBase, or before a prototype inheriting DrinkBase.
# - That way they override any previously inherited material, and material specific sounds aren't overridden by BaseItem.

# Fragile glass
- type: entity
  abstract: true
  id: DrinkBaseMaterialGlass
  components:
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: FlimsyGlass
  - type: Destructible
    thresholds:
    - trigger: # Overkill threshold
        !type:DamageTrigger
        damage: 200
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 5
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
      - !type:SpillBehavior { }
      - !type:SpawnEntitiesBehavior
        spawn:
          ShardGlass:
            min: 1
            max: 1
        transferForensics: true
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: DamageOnLand
    ignoreResistances: true
    damage:
      types:
        Blunt: 5 # so fragile it smashes when thrown
  - type: DamageOtherOnHit
    damage:
      types:
        Blunt: 5
#  - type: EmitSoundOnLand TODO other materials need a sound
#    sound:
#      collection: GlassCrack
  - type: PhysicalComposition
    materialComposition:
      Glass: 25

# Porcelain (like glass but no shard)
- type: entity
  abstract: true
  parent: DrinkBaseMaterialGlass
  id: DrinkBaseMaterialPorcelain
  components:
  - type: Destructible
    thresholds:
    - trigger: # Overkill threshold
        !type:DamageTrigger
        damage: 200
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 5
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: GlassCrack
      - !type:SpillBehavior { }
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: PhysicalComposition
    materialComposition:
      Glass: 10 # Trace amounts of glass I guess. Important for overriding inheritance

# Fragile plastic
- type: entity
  abstract: true
  id: DrinkBaseMaterialPlastic
  components:
  - type: Damageable
    damageContainer: Inorganic
#    damageModifierSet: FlimsyPlastic TODO
  - type: Destructible
    thresholds:
    - trigger: # Overkill threshold
        !type:DamageTrigger
        damage: 200
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 5
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalCrunch # TODO a plastic break collection
      - !type:SpillBehavior { }
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: DamageOnLand
    ignoreResistances: true
    damage:
      types:
        Blunt: 1
  - type: DamageOtherOnHit
    damage:
      types:
        Blunt: 2
  - type: PhysicalComposition
    materialComposition:
      Plastic: 25

# Strong plastic
- type: entity
  abstract: true
  parent: DrinkBaseMaterialPlastic
  id: DrinkBaseMaterialStrongPlastic
  components:
  - type: Destructible
    thresholds:
    - trigger: # Overkill threshold
        !type:DamageTrigger
        damage: 200
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 20 # can take a few more hits than basic plastic
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalCrunch # TODO a plastic break collection
          params:
            volume: -4
      - !type:SpillBehavior { }
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetPlastic1:
            min: 0
            max: 1
        transferForensics: true
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: PhysicalComposition
    materialComposition:
      Plastic: 100

# Fragile cardboard
- type: entity
  abstract: true
  id: DrinkBaseMaterialCardboard
  components:
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: Card
  - type: Destructible
    thresholds:
    - trigger: # Overkill threshold
        !type:DamageTrigger
        damage: 200
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 5
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/Effects/unwrap.ogg # TODO a cardboard destruction collection
      - !type:SpillBehavior { }
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: DamageOnLand
    ignoreResistances: true
    damage:
      types:
        Blunt: 1
  - type: DamageOtherOnHit
    damage:
      types:
        Blunt: 1
  - type: PhysicalComposition
    materialComposition:
      Cardboard: 25

# Weak metal
- type: entity
  abstract: true
  id: DrinkBaseMaterialMetal
  components:
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: FlimsyMetallic
  - type: Destructible
    thresholds:
    - trigger: # Overkill threshold
        !type:DamageTrigger
        damage: 200
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 10
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalCrunch # TODO a flimsier metal break collection
      - !type:SpillBehavior { }
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: DamageOnLand
    ignoreResistances: true
    damage:
      types:
        Blunt: 1
  - type: DamageOtherOnHit
    damage:
      types:
        Blunt: 5
  - type: PhysicalComposition
    materialComposition:
      Steel: 25

# strong metal
- type: entity
  abstract: true
  parent: DrinkBaseMaterialMetal
  id: DrinkBaseMaterialStrongMetal
  components:
  - type: Damageable
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger: # Overkill threshold
        !type:DamageTrigger
        damage: 200
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 25
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalCrunch
      - !type:SpillBehavior { }
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: PhysicalComposition
    materialComposition:
      Steel: 300

# Flimsy gold
- type: entity
  abstract: true
  id: DrinkBaseMaterialGold
  components:
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: FlimsyMetallic
  - type: Destructible
    thresholds:
    - trigger: # Overkill threshold
        !type:DamageTrigger
        damage: 200
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 5 # Gold is very weak
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak # Could use a shinier sound
      - !type:SpillBehavior { }
      - !type:SpawnEntitiesBehavior
        spawn:
          IngotGold1:
            min: 1
            max: 1
        transferForensics: true
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: DamageOnLand
    ignoreResistances: true
    damage:
      types:
        Blunt: 5 # Don't drop your fancy golden cup!
  - type: DamageOtherOnHit
    damage:
      types:
        Blunt: 2
  - type: PhysicalComposition
    materialComposition:
      Gold: 25
