# Most of these have DO NOT MAP, since stations are completely unequipped to deal with ship combat + these are basically placeholder.

- type: entity
  id: ShuttleGunBase
  parent: BaseStructure
  name: shittle gun
  abstract: true
  components:
  - type: Appearance
  - type: InteractionOutline
  - type: Anchorable
  - type: Rotatable
  - type: ContainerContainer
  - type: Gun
    selectedMode: SemiAuto
    availableModes:
      - SemiAuto
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Electronic
  - type: DeviceNetwork
    deviceNetId: Wireless
    receiveFrequencyId: BasicDevice
  - type: WirelessNetworkConnection
    range: 200
  - type: DeviceLinkSink
    ports:
    - Trigger
    - Toggle
    - On
    - Off
  - type: AutoShootGun
  - type: GunSignalControl
  - type: StaticPrice
    price: 1500
  - type: Repairable # Frontier
    doAfterDelay: 3 # Frontier

# ---- Laser weapon branch ----
# naming: LSE (Laser) + conventional power + suffix (c for PowerCage, e for wired energy) + Name
# example: LSE-100e "Clown destroyer" (powered by the wiring, very weak)

- type: entity
  id: ShuttleGunSvalinnMachineGun
  parent: [ ShuttleGunBase, ConstructibleMachine]
  name: LSE-400c "Svalinn machine gun"
  description: Basic stationary laser unit. Effective against live targets and electronics. Uses regular power cells to fire, and has an extremely high rate of fire.
  categories: [ DoNotMap ]
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shuttles/laser.rsi
    layers:
    - state: lse-400c
    - state: mag-unshaded-9
      map: ["enum.GunVisualLayers.MagUnshaded"]
      shader: unshaded
  - type: ContainerContainer
    containers:
      machine_board: !type:Container
      machine_parts: !type:Container
      cell_slot: !type:ContainerSlot
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 150
      behaviors:
        - !type:ChangeConstructionNodeBehavior
          node: machineFrame
        - !type:DoActsBehavior
          acts: ["Destruction"]
  - type: Gun
    fireRate: 3
    useKey: false
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/ship_svalinn.ogg
      params:
        variation: 0.05
  - type: MagazineVisuals
    magState: mag
    steps: 10
    zeroVisible: true
  - type: Machine
    board: ShuttleGunSvalinnMachineGunCircuitboard
  - type: PowerCellSlot
    cellSlotId: cell_slot
  - type: ItemSlots
    slots:
      cell_slot:
        name: Magazine
        insertSound: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg
        ejectSound: /Audio/Weapons/Guns/MagOut/batrifle_magout.ogg
        whitelist:
          tags:
            - PowerCell
            - PowerCellSmall
  - type: HitscanBatteryAmmoProvider
    proto: NFRedLightLaser # Frontier: use NF prefix
    fireCost: 50

- type: entity
  id: ShuttleGunPerforator
  parent: [ ShuttleGunBase, ConstructibleMachine]
  name: LSE-1200c "Perforator"
  description: Advanced stationary laser unit. Annihilates electronics and is extremely dangerous to health! Uses the power cage to fire.
  categories: [ DoNotMap ]
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shuttles/laser.rsi
    layers:
    - state: lse-1200c
    - state: mag-unshaded-9
      map: ["enum.GunVisualLayers.MagUnshaded"]
      shader: unshaded
  - type: ContainerContainer
    containers:
      machine_board: !type:Container
      machine_parts: !type:Container
      cell_slot: !type:ContainerSlot
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 300
      behaviors:
        - !type:ChangeConstructionNodeBehavior
          node: machineFrame
        - !type:DoActsBehavior
          acts: ["Destruction"]
  - type: Gun
    fireRate: 1
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/ship_perforator.ogg
      params:
        variation: 0.05
  - type: MagazineVisuals
    magState: mag
    steps: 10
    zeroVisible: true
  - type: Machine
    board: ShuttleGunPerforatorCircuitboard
  - type: PowerCellSlot
    cellSlotId: cell_slot
  - type: ItemSlots
    slots:
      cell_slot:
        name: Magazine
        insertSound: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg
        ejectSound: /Audio/Weapons/Guns/MagOut/batrifle_magout.ogg
        whitelist:
          tags:
            - PowerCage
  - type: HitscanBatteryAmmoProvider
    proto: NFRedShuttleLaser # Frontier: use NF variant
    fireCost: 150

# ---- Launchers ----
# naming: EXP (Explosion) + conventional power + suffix (g for Grenade, c for RPG Cartridge) + Name
# example: EXP-100c "Poppy"

- type: entity
  id: ShuttleGunFriendship
  parent: [ShuttleGunBase] # Frontier: Removed ConstructibleMachine
  name: EXP-320g "Friendship"
  description: A small stationary grenade launcher that holds 2 grenades.
  categories: [ DoNotMap ]
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shuttles/launcher.rsi
    layers:
    - state: exp-320g
    - state: mag-7
      map: ["enum.GunVisualLayers.Mag"]
  - type: ContainerContainer
    containers:
      machine_board: !type:Container
      machine_parts: !type:Container
      ballistic-ammo: !type:Container
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 200
      behaviors:
        - !type:ChangeConstructionNodeBehavior
          node: machineFrame
        - !type:DoActsBehavior
          acts: ["Destruction"]
  - type: Gun
    projectileSpeed: 80
    fireRate: 1
    angleDecay: 45
    minAngle: 0
    maxAngle: 15
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/ship_friendship.ogg
      params:
        pitch: 0.8
    soundEmpty:
      path: /Audio/Weapons/Guns/Empty/empty.ogg
  - type: BallisticAmmoProvider
    whitelist:
      tags:
        - Grenade
        - NFCartridgeGrenade40mm #frontier
    capacity: 2
    soundInsert:
      path: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg
  - type: Machine
    board: ShuttleGunFriendshipCircuitboard
  - type: MagazineVisuals
    magState: mag
    steps: 8
    zeroVisible: false

- type: entity
  id: ShuttleGunDuster
  parent: [ShuttleGunBase, ConstructibleMachine]
  name: EXP-2100g "Duster"
  description: A powerful stationary grenade launcher. A cartridge is required for use.
  categories: [ DoNotMap ]
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shuttles/launcher.rsi
    layers:
    - state: exp-2100g
    - state: mag-7
      map: ["enum.GunVisualLayers.Mag"]
  - type: ContainerContainer
    containers:
      machine_board: !type:Container
      machine_parts: !type:Container
      gun_magazine: !type:ContainerSlot
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 350
      behaviors:
        - !type:ChangeConstructionNodeBehavior
          node: machineFrame
        - !type:DoActsBehavior
          acts: ["Destruction"]
  - type: Gun
    projectileSpeed: 40
    fireRate: 0.3
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/ship_duster.ogg
      params:
        variation: 0.05
        pitch: 0.8
    soundEmpty:
      path: /Audio/Weapons/Guns/Empty/empty.ogg
  - type: Machine
    board: ShuttleGunDusterCircuitboard
  - type: MagazineAmmoProvider
  - type: MagazineVisuals
    magState: mag
    steps: 8
    zeroVisible: false
  - type: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        priority: 2
        whitelist:
          tags:
          - MagazineGrenade
        insertSound:
          path: /Audio/Weapons/Guns/MagIn/kinetic_reload.ogg
          params:
            pitch: 2
        ejectSound: /Audio/Weapons/Guns/MagOut/smg_magout.ogg

# ---- Other weapon ----

- type: entity
  id: ShuttleGunPirateCannon
  parent: [BaseStructureDisableToolUse, ShuttleGunBase, BaseC3PirateContrabandNoValue] # Frontier: Added BaseStructureDisableToolUse, BaseC3PirateContrabandNoValue
  name: pirate ship cannon
  description: Kaboom!
  components:
  - type: ContainerContainer
    containers:
      ballistic-ammo: !type:Container
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 300
      behaviors:
        - !type:DoActsBehavior
          acts: ["Destruction"]
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shuttles/pirate_cannon.rsi
    layers:
    - state: base
  - type: Gun
    fireRate: 1
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/mateba.ogg
  - type: BallisticAmmoProvider
    whitelist:
      tags:
        - CannonBall
    capacity: 1
    proto: NFCannonBall # Frontier: use NF variant
    soundInsert:
      path: /Audio/Weapons/Guns/Gunshots/grenade_launcher.ogg
  - type: NpcFactionMember # Frontier
    factions: # Frontier
    - NFPirate # Frontier
  - type: Rotatable # Frontier
    rotateWhileAnchored: true # Frontier

- type: entity
  id: ShuttleGunKinetic
  parent: [ ShuttleGunBase, ConstructibleMachine]
  name: PTK-1500e "Matter Dematerializer" # Frontier: "800"<"1500e" (consistent with naming scheme)
  description: Mining turret, effective for blasting hardened targets, but overpowered for softer rock. Gradually accumulates charges on its own. # Frontier: description changed
  categories: [ DoNotMap ]
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shuttles/kinetic.rsi
    layers:
    - state: ptk-800
    - state: mag-7
  - type: ContainerContainer
    containers:
      machine_board: !type:Container
      machine_parts: !type:Container
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
        - !type:ChangeConstructionNodeBehavior
          node: machineFrame
        - !type:DoActsBehavior
          acts: ["Destruction"]
  - type: Gun
    projectileSpeed: 20
    fireRate: 2
    selectedMode: SemiAuto
    angleDecay: 45
    minAngle: 5
    maxAngle: 15
    availableModes:
    - SemiAuto
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/kinetic_accel.ogg
      params:
        variation: 0.12
  - type: RechargeBasicEntityAmmo
    rechargeCooldown: 3
    rechargeSound:
      path: /Audio/Weapons/Guns/Bolt/lmg_bolt_closed.ogg
      params:
        pitch: 1.2
        variation: 0.08
  - type: BasicEntityAmmoProvider
    proto: NFBulletKineticShuttle
    capacity: 10
    count: 10
  - type: Machine
    board: ShuttleGunKineticCircuitboard
  - type: ExtensionCableReceiver # Frontier
  - type: ApcPowerReceiver # Frontier
    powerLoad: 1500 # Frontier

- type: entity
  parent: ShuttleGunBase
  id: ShuttleGunKineticOld
  name: exomorphic dematerializer
  description: An ancient ship gun, utilizing biomechanical systems to store and release energy. While unique in its design, it has been rendered obsolete due to its inferior charging and firing speed compared to mechanical constructions.
  components:
  - type: Sprite
    sprite: Objects/Weapons/Guns/Shuttles/xeno.rsi
    layers:
    - state: rail
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 100
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
      - !type:DoActsBehavior
        acts: ["Destruction"]
  - type: Gun
    projectileSpeed: 20
    fireRate: 0.2
    selectedMode: SemiAuto
    angleDecay: 45
    minAngle: 5
    maxAngle: 15
    availableModes:
    - SemiAuto
    soundGunshot:
      path: /Audio/Weapons/Guns/Gunshots/kinetic_accel.ogg
      params:
        variation: 0.12
  - type: RechargeBasicEntityAmmo
    rechargeCooldown: 35
    rechargeSound:
      path: /Audio/Weapons/Guns/Bolt/lmg_bolt_closed.ogg
      params:
        pitch: 1.2
        variation: 0.08
  - type: BasicEntityAmmoProvider
    proto: NFBulletKineticShuttle # Frontier: use NF variant
    capacity: 3
    count: 3
  - type: DeviceLinkSink
    ports:
    - Trigger
