# 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
      gun_magazine: !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: ItemSlots
    slots:
      gun_magazine:
        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: RedLightLaser
    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
      gun_magazine: !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: ItemSlots
    slots:
      gun_magazine:
        name: Magazine
        insertSound: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg
        ejectSound: /Audio/Weapons/Guns/MagOut/batrifle_magout.ogg
        whitelist:
          tags:
            - PowerCage
  - type: HitscanBatteryAmmoProvider
    proto: RedShuttleLaser
    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
    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:
          - Magazine40mm
        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] # Frontier: Added BaseStructureDisableToolUse
  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: CannonBall
    soundInsert:
      path: /Audio/Weapons/Guns/Gunshots/grenade_launcher.ogg
  - type: NpcFactionMember # Frontier
    factions: # Frontier
    - PirateNF # 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. Has considerable range but lower firerate. # Mono: description changed
  # categories: [ DoNotMap ] Mono
  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: 80
    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: 1
    rechargeSound:
      path: /Audio/Weapons/Guns/Bolt/lmg_bolt_closed.ogg
      params:
        pitch: 1.2
        variation: 0.08
  - type: BasicEntityAmmoProvider
    proto: BulletKineticShuttle
    capacity: 100 # Mono 10->100
    count: 100 # Mono 10->100
  - type: Machine
    board: ShuttleGunKineticCircuitboard
  - type: ExtensionCableReceiver # Frontier
  - type: ApcPowerReceiver # Frontier
    powerLoad: 1500 # Frontier
    # Mono Start
  - type: FireControllable
  - type: ShipGunClass
    shipClass: Superlight
  - type: RadarBlip
    visibleFromOtherGrids: false
    radarColor: "#FF0040"
    scale: 1.25
  - type: ShipGunType
    shipType: Ballistic
  - type: StaticPrice
    price: 400
  - type: ShipRepairable
    repairTime: 10
    repairCost: 25
    # Mono End
