- type: entity
  id: PlastitaniumWindowBase
  parent: BaseStructure
  abstract: true
  name: plastitanium window
  description: Don't smudge up the glass down there.
  placement:
    mode: SnapgridCenter
    snap:
    - Window
  components:
  - type: RCDDeconstructable
    deconstructable: false
  - type: MeleeSound
    soundGroups:
      Brute:
        collection: GlassSmack
  - type: WallMount
    arc: 360 # interact despite grilles
  - type: Tag
    tags:
      - ForceFixRotations
      - Window
  - type: Physics
    bodyType: Static
  - type: ExaminableDamage
    messages: WindowMessages
  - type: InteractionPopup
    interactSuccessString: comp-window-knock
    messagePerceivedByOthers: comp-window-knock
    interactSuccessSound:
      path: /Audio/Effects/glass_knock.ogg
  - type: Appearance
  - type: StaticPrice
    price: 100
  - type: BlockWeather
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.5,-0.5,0.5,0.5"
        mask:
        - FullTileMask
        layer:
        - WallLayer
        density: 4000
  - type: PlacementReplacement
    key: walls

- type: entity
  id: PlastitaniumWindowSquareBase
  abstract: true
  name: plastitanium window
  parent: PlastitaniumWindowBase
  components:
  - type: Sprite
    drawdepth: WallTops
    sprite: Structures/Windows/window-plastitanium.rsi
  - type: Icon
    sprite: Structures/Windows/window-plastitanium.rsi
    state: full
  - type: IconSmooth
    key: walls
    base: ptwindow
  - type: Airtight
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb {}
        mask:
        - FullTileMask
        layer:
        - GlassLayer

- type: entity
  id: PlastitaniumWindowIndestructible
  name: plastitanium window
  parent: PlastitaniumWindowSquareBase
  suffix: indestructible
  components:
  - type: ExaminableDamage
    messages: null

- type: entity
  parent: [ PlastitaniumWindowSquareBase, StructureHealthBarrierStrong ]
  id: PlastitaniumWindow
  name: plastitanium window
  components:
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 120
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: WindowShatter
      - !type:SpawnEntitiesBehavior
        spawn:
          ShardGlassReinforced:
            min: 1
            max: 2
          PartRodMetal:
            min: 1
            max: 2
  - type: DamageVisuals
    thresholds: [5, 10, 20]
    damageDivisor: 20
    trackAllDamage: true
    damageOverlay:
      sprite: Structures/Windows/cracks.rsi
  - type: Repairable
    fuelCost: 15
    doAfterDelay: 3
  - type: Damageable
    damageModifierSet: PlastitaniumMod

- type: entity
  id: PlastitaniumWindowDiagonalBase
  abstract: true
  name: plastitanium window
  parent: PlastitaniumWindowBase
  suffix: diagonal
  components:
  - type: Sprite
    drawdepth: WallTops
    sprite: Structures/Windows/window-diagonal-plastitanium.rsi
    state: state0
  - type: Tag
    tags:
    - Diagonal
    - Window
  - type: Icon
    sprite: Structures/Windows/window-diagonal-plastitanium.rsi
    state: state0
  - type: IconSmooth
    mode: Diagonal
    key: walls
    base: state
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PolygonShape
            vertices:
            - "-0.5,-0.5"
            - "0.5,0.5"
            - "0.5,-0.5"
        mask:
        - FullTileMask
        layer:
        - GlassLayer
        density: 4000
  - type: Airtight
    noAirWhenFullyAirBlocked: false
    airBlockedDirection:
    - South
    - East

- type: entity
  id: PlastitaniumWindowDiagonalIndestructible
  name: plastitanium window
  parent: PlastitaniumWindowDiagonalBase
  suffix: diagonal, indestructible
  components:
  - type: ExaminableDamage
    messages: null

- type: entity
  id: PlastitaniumWindowDiagonal
  name: plastitanium window
  parent: [ PlastitaniumWindowDiagonalBase, StructureHealthBarrierStrong ]
  suffix: diagonal
  components:
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 120
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: WindowShatter
      - !type:SpawnEntitiesBehavior
        spawn:
          ShardGlassReinforced:
            min: 1
            max: 2
          PartRodMetal:
            min: 1
            max: 2
  - type: DamageVisuals
    thresholds: [5, 10, 20]
    damageDivisor: 20
    trackAllDamage: true
    damageOverlay:
      sprite: Structures/Windows/cracks-diagonal.rsi
  - type: Repairable
    fuelCost: 15
    doAfterDelay: 3
  - type: Damageable
    damageModifierSet: PlastitaniumMod
