# region Base
- type: entity
  abstract: true
  id: NFBaseProximityMine
  components:
  - type: Clickable
  - type: InteractionOutline
  - type: Pullable
  - type: MovedByPressure
  - type: GravityAffected
  - type: Physics
    bodyType: Dynamic
    fixedRotation: false
  - type: Fixtures
    fixtures:
      fix1:
        shape: !type:PhysShapeCircle
          radius: 0.3
        density: 20
        mask:
        - ItemMask
        restitution: 0.3
        friction: 0.2
  - type: EmitSoundOnCollide
    sound:
      collection: WeakHit
  - type: EmitSoundOnLand
    sound:
      path: /Audio/Effects/drop.ogg
      params:
        volume: 2
  - type: DamageOnHighSpeedImpact
    damage:
      types:
        Blunt: 5
    soundHit:
      collection: MetalThud
  - type: Damageable
    damageContainer: Inorganic
  - type: DamageExaminable
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 50
      behaviors:
      - !type:TriggerBehavior
        keyOut: timer # explode immediately
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: RequireProjectileTarget
  - type: AmbientSound
    volume: -10
    range: 4
    enabled: true
    sound:
      path: /Audio/Items/newton_cradle.ogg
  - type: TimerTrigger
    delay: 2
    beepSound:
      path: "/Audio/Effects/beep1.ogg"
      params:
        volume: 5
    initialBeepDelay: 0
    beepInterval: 1
    examinable: false
  - type: DeleteOnTrigger
    keysIn:
    - timer
  - type: TriggerOnProximity
    triggerSpeed: 0
    shape:
      !type:PhysShapeCircle
        radius: 0.5
    repeating: false
    requiresAnchored: false
    whitelist:
      components:
        - Actor

# region base types
- type: entity
  abstract: true
  parent: NFBaseProximityMine
  id: NFBaseMineExplosive
  suffix: Mine, Explosive
  components:
  - type: ExplodeOnTrigger
    keysIn:
      - timer
  - type: Explosive
    explosionType: Default
    maxIntensity: 20
    totalIntensity: 30 # about a ~3 tile radius
    canCreateVacuum: false

- type: entity
  abstract: true
  parent: NFBaseProximityMine
  id: NFBaseMineCryo
  suffix: Mine, Cryo
  components:
  - type: ExplodeOnTrigger
    keysIn:
      - timer
  - type: Explosive
    explosionType: Cryo
    maxIntensity: 10
    totalIntensity: 30 # about a ~3 tile radius
    canCreateVacuum: false

- type: entity
  abstract: true
  parent: NFBaseProximityMine
  id: NFBaseMineFire
  suffix: Mine, Fire
  components:
  - type: ExplodeOnTrigger
    keysIn:
      - timer
  - type: Explosive
    explosionType: FireBomb
    maxIntensity: 10
    totalIntensity: 30 # about a ~3 tile radius
    canCreateVacuum: false

- type: entity
  abstract: true
  parent: NFBaseProximityMine
  id: NFBaseMineEmp
  suffix: Mine, EMP
  components:
  - type: EmpOnTrigger
    keysIn:
      - timer
    range: 6
    energyConsumption: 10000

- type: entity
  abstract: true
  parent: NFBaseProximityMine
  id: NFBaseMineFlash
  suffix: Mine, Flash
  components:
  - type: FlashOnTrigger
    keysIn:
      - timer
    range: 7
  - type: SpawnOnTrigger
    keysIn:
    - timer
    proto: GrenadeFlashEffect
    predicted: true

- type: entity
  abstract: true
  parent: NFBaseProximityMine
  id: NFBaseMineSmoke
  suffix: Mine, Smoke
  components:
  - type: SmokeOnTrigger
    keysIn:
      - timer
    duration: 5
    spreadAmount: 5
  - type: EmitSoundOnTrigger
    keysIn:
      - timer
    sound:
      path: /Audio/Effects/smoke.ogg
    positional: true

- type: entity
  abstract: true
  parent: NFBaseProximityMine
  id: NFBaseMineCluster
  components:
  - type: SpawnOnTrigger
    keysIn:
    - timer
    proto: GrenadeFlashEffect
    predicted: true
  - type: EmitSoundOnTrigger
    keysIn:
      - timer
    sound:
      collection: ExplosionSmall
    positional: true
  - type: ContainerContainer
    containers:
      cluster-payload: !type:Container

- type: entity
  abstract: true
  parent: NFBaseMineCluster
  id: NFBaseMineClusterStinger
  suffix: Mine, Stinger
  components:
  - type: ProjectileGrenade
    fillPrototype: NFPelletClusterRubber
    capacity: 30

- type: entity
  abstract: true
  parent: NFBaseMineCluster
  id: NFBaseMineClusterShrapnel
  suffix: Mine, Shrapnel
  components:
  - type: ProjectileGrenade
    fillPrototype: NFPelletClusterLethal
    capacity: 15

- type: entity
  abstract: true
  parent: NFBaseMineCluster
  id: NFBaseMineClusterShrapnelIncendiary
  suffix: Mine, Shrapnel (Incendiary)
  components:
  - type: ProjectileGrenade
    fillPrototype: NFPelletClusterIncendiary
    capacity: 15

# region base visuals
- type: entity
  abstract: true
  id: NFConcealedMineVisualsRandomized
  components:
  - type: Sprite
    drawdepth: SmallObjects
    sprite: _NF/Objects/Weapons/Bombs/ied_overlay.rsi
  - type: RandomSprite
    available:
      - ied_wiring1:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
        ied_wiring2:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
        ied_wiring3:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
          mask_null: ""
        ied_light:
          ied_light: Rainbow

- type: entity
  abstract: true
  parent: NFConcealedMineVisualsRandomized
  id: NFConcealedMineToolbox
  name: mechanical toolbox
  description: A toolbox box, stocked with various tools.
  components:
  - type: Sprite
    layers:
    - state: ied_wiring1
      map: [ "ied_wiring1" ]
    - state: ied_wiring2
      map: [ "ied_wiring2" ]
    - state: ied_wiring3
      map: [ "ied_wiring3" ]
    - sprite: Objects/Tools/Toolboxes/toolbox_blue.rsi
      state: icon
    - state: ied_display
    - state: ied_light
      map: [ "ied_light" ]
      shader: unshaded

- type: entity
  abstract: true
  parent: NFConcealedMineVisualsRandomized
  id: NFConcealedMineWetFloorSign
  name: wet floor sign
  description: Caution! Wet Floor!
  components:
  - type: Sprite
    layers:
    - state: ied_wiring1
      map: [ "ied_wiring1" ]
    - state: ied_wiring2
      map: [ "ied_wiring2" ]
    - state: ied_wiring3
      map: [ "ied_wiring3" ]
    - sprite: Objects/Specific/Janitorial/wet_floor_sign.rsi
      state: icon
    - state: ied_display
    - state: ied_light
      map: [ "ied_light" ]
      shader: unshaded

- type: entity
  abstract: true
  parent: NFConcealedMineVisualsRandomized
  id: NFConcealedMinePlushie
  name: plushie
  description: A stuffed toy to remind adults of what they can no longer have - youth.
  components:
  - type: Sprite
    layers:
    - state: ied_wiring1
      map: [ "ied_wiring1" ]
    - state: ied_wiring2
      map: [ "ied_wiring2" ]
    - state: ied_wiring3
      map: [ "ied_wiring3" ]
    - sprite: Objects/Fun/Plushies/nukie.rsi
      state: icon
      map: [ "ied_sprite_toy" ]
    - state: ied_display
    - state: ied_light
      map: [ "ied_light" ]
      shader: unshaded
  - type: RandomSprite
    available:
      # TODO: Restore this after you add every individual plushie RSI to the layers above and figure out layering
      # - ied_sprite_toy:
      #     carpplush: ""
      #     magicplush: ""
      #     narplush: ""
      #     nuketoy: ""
      #     plushie_atmosian: ""
      #     plushie_arachnid: ""
      #     plushie_diona: ""
      #     plushie_h: ""
      #     plushie_hampter: ""
      #     plushie_lizard: ""
      #     plushie_vox: ""
      #     plushie_nuke: ""
      #     plushie_moth: ""
      #     plushie_xeno: ""
      #     plushie_slime: ""
      #     plushie_rouny: ""
      #     plushie_human: ""
      #     plushie_lizard_inversed: ""
      #     plushie_ratvar: ""
      #     plushie_spacelizard: ""
      #     plushie_lamp: ""
      - ied_wiring1:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
        ied_wiring2:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
        ied_wiring3:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
          mask_null: ""
        ied_light:
          ied_light: Rainbow

- type: entity
  abstract: true
  parent: NFConcealedMineVisualsRandomized
  id: NFConcealedMineBox
  name: box
  description: What's inside the box?
  components:
  - type: Sprite
    layers:
    - state: ied_wiring1
      map: [ "ied_wiring1" ]
    - state: ied_wiring2
      map: [ "ied_wiring2" ]
    - state: ied_wiring3
      map: [ "ied_wiring3" ]
    - sprite: Objects/Storage/boxicons.rsi
      state: bodybags
      map: [ "ied_sprite_box" ]
    - state: ied_display
    - state: ied_light
      map: [ "ied_light" ]
      shader: unshaded
  - type: RandomSprite
    available:
      - ied_sprite_box:
          beaker: ""
          bodybags: ""
          box: ""
          box_of_doom: ""
          circuit: ""
          disk_kit: ""
          donk_kit: ""
          flashbang: ""
          glasses: ""
          mousetraps: ""
          throwing_knives: ""
        ied_wiring1:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
        ied_wiring2:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
        ied_wiring3:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
          mask_null: ""
        ied_light:
          ied_light: Rainbow

- type: entity
  abstract: true
  parent: NFConcealedMineVisualsRandomized
  id: NFConcealedMineTrash
  name: discarded wrapper
  description: A discarded packaging from an item that a generous person could describe as a food item.
  components:
  - type: Sprite
    layers:
    - state: ied_wiring1
      map: [ "ied_wiring1" ]
    - state: ied_wiring2
      map: [ "ied_wiring2" ]
    - state: ied_wiring3
      map: [ "ied_wiring3" ]
    - sprite: Objects/Consumable/Food/snacks.rsi
      state: cheesiehonkers-trash
      map: [ "ied_sprite_trash" ]
    - state: ied_display
    - state: ied_light
      map: [ "ied_light" ]
      shader: unshaded
  - type: RandomSprite
    available:
      - ied_sprite_trash:
          cheesiehonkers-trash: ""
          chocolatebar-trash: ""
          cnds-trash: ""
          energybar-trash: ""
          mre-wrapper: ""
          pistachio-trash: ""
          popcorn-trash: ""
          raisins-trash: ""
          semki-trash: ""
          susjerky-trash: ""
          syndicakes-trash: ""
        ied_wiring1:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
        ied_wiring2:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
        ied_wiring3:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
          mask_null: ""
        ied_light:
          ied_light: Rainbow

- type: entity
  abstract: true
  parent: NFConcealedMineVisualsRandomized
  id: NFConcealedMineScrap
  name: scrap
  description: Worthless junk. You could probably get some materials out of it though.
  components:
  - type: Sprite
    layers:
    - state: ied_wiring1
      map: [ "ied_wiring1" ]
    - state: ied_wiring2
      map: [ "ied_wiring2" ]
    - state: ied_wiring3
      map: [ "ied_wiring3" ]
    - sprite: Objects/Materials/Scrap/generic.rsi
      state: glass-1
      map: [ "ied_sprite_scrap" ]
    - state: ied_display
    - state: ied_light
      map: [ "ied_light" ]
      shader: unshaded
  - type: RandomSprite
    available:
      - ied_sprite_scrap:
          glass-1: ""
          glass-2: ""
          glass-3: ""
          glass-4: ""
          glass-5: ""
          glass-6: ""
          junk-airlock-1: ""
          junk-fax: ""
          junk-fireextinguisher: ""
          junk-pai: ""
          junk-pai-gold: ""
          metal-1: ""
          metal-2: ""
          metal-3: ""
          junk-mop-bucket: ""
        ied_wiring1:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
        ied_wiring2:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
        ied_wiring3:
          ied_wiring1: Rainbow
          ied_wiring2: Rainbow
          ied_wiring3: Rainbow
          ied_wiring4: Rainbow
          ied_wiring5: Rainbow
          ied_wiring6: Rainbow
          mask_null: ""
        ied_light:
          ied_light: Rainbow
