{-# LANGUAGE TemplateHaskell #-}
module Dodge.Combine.Data
    where
import Dodge.Equipment.Data
import Dodge.Data.ItemAmount
import Control.Lens
import qualified Data.Map.Strict as M

-- this should probably store loaded ammo
data ItemType = ItemType 
    {_iyBase    :: ItemBaseType
    ,_iyModules :: M.Map ModuleSlot ItemModuleType
    ,_iyStack   :: Stack
    }
  deriving (Eq,Ord,Show)

data Stack = NoStack | Stack IcAmount
  deriving (Eq,Ord,Show)

data CraftType
    = PIPE
    | TUBE
    | HARDWARE
    | SPRING
    | CAN
    | TIN
    | DRUM
    | PLANK
    | SHARDGLASS
    | PUMP
    | MOTOR
    | TRANSFORMER
    | PRISM
    | LIGHTER
    | MAGNET
    | ANTIMATTER
    | PLATE
    | TRANSMITTER
    | MICROCHIP
    | AIUNIT
    | CAMERA
    | MINIDISPLAY  -- visual display unit
    | LED
    | NAILBOX
    | IRONBAR
    | LIGHTSENSOR
    | SOUNDSENSOR
    | HEATSENSOR
    | CREATURESENSOR
    | WIRE
    | BATTERY
    | FUELCELL
    | PORTABLEFUSION
    -- Modules
    -- bullet
    | INCENDIARYMODULE
    | STATICMODULE
    | CONCUSSMODULE
    | FRAGMODULE
    | FLASHMODULE
    | BOUNCEMODULE
    --
    | TELEPORTMODULE
    | TIMEMODULE
    | SIZEMODULE
    | GRAVITYMODULE
  deriving (Eq,Ord,Show,Enum,Read)

-- TODO make this an enum somehow...?
data ItemBaseType
    = NOTDEFINED
    | EFFGUN String
    | AUTOEFFGUN String
    -- Weapons
    | BANGSTICK Int
    | PISTOL
    | REVOLVER
    | REVOLVERX Int
    | MACHINEPISTOL
    | AUTOPISTOL
    | SMG
    | BANGCONE
    | BLUNDERBUSS
    | BIGBLUNDERBUSS
    | BIGGERBLUNDERBUSS
    | BIGGESTBLUNDERBUSS
--    | GRAPESHOTCANNON
--    | GRENADELAUNCHER Int -- number of chambers that can be reloaded
--    | MORTARCONE / HANDMORTAR
    | BANGCANE
--    | MINIGUN
    | MINIGUNX Int
    | BANGCANEX Int
    | RIFLE
    | REPEATER
    | AUTORIFLE
    | BURSTRIFLE
    | FASTBURSTRIFLE
    | COMPLETEBURSTRIFLE
    | BANGROD
    | ELEPHANTGUN
    | AMR
    | AUTOAMR
    | SNIPERRIFLE
    | MACHINEGUN
    | FLAMESPITTER
    | FLAMETHROWER
    | FLAMETORRENT
    | FLAMEWALL
    | BLOWTORCH
    | AUTOGUN
    | SPARKGUN
    | TESLAGUN
    | LASGUN
    | LASPULSE
    | LASGUNDUAL
    | LASGUNSWING
    | LASGUNSWAY
    | LASGUNWIDEPULSE
    | LASGUNWIDE Int
    | LASGUNFOCUS Int
    | SONICGUN
    | TRACTORGUN
    | LAUNCHER
    | LAUNCHERX Int
--    | TRACKINGLAUNCHER
    | REMOTELAUNCHER
    | POISONSPRAYER
    | DRONELAUNCHER
    
    | SHATTERGUN
--    | GRENADE
--    | REMOTEBOMB
    -- Utility items
    | BOOSTER
    | REWINDER
    | BLINKER
    | BLINKERUNSAFE
    | FORCEFIELDGUN
    | SHRINKER
    | SPAWNER
    -- Equipment
    | CLICKDETECTOR Detector
    | AUTODETECTOR Detector
    | MAGSHIELD
    | FLAMESHIELD
    | FRONTARMOUR
    | WRISTARMOUR
    | INVISIBILITYEQUIPMENT EquipSite
    | BRAINHAT
    | HEADLAMP
    | HEADLAMP1
    | POWERLEGS
    | SPEEDLEGS
    | JUMPLEGS
    | FLATSHIELD
    | JETPACK
    --
    | KEYCARD Int
    --
    | MEDKIT Int
    | CRAFT CraftType
    --
  deriving (Eq,Ord,Show,Read)

data ItemModuleType 
    = EMPTYMODULE
    | DRUMMAG
    | BELTMAG
    | MAGNETMAG
    | INCENDBUL
    | BOUNCEBUL
    | STATICBUL
    | CONCUSBUL
    | TARGCR 
    | TARGLAS
    | TARGPOS
    | MAGNETTRAJ
    | FLECHETRAJ
    | BEZIERTRAJ
    | INCENDLAS
    | SPLITLAS
    | STATICLAS
    | WEPTELE
    | LAUNCHHOME
    | EXTRABATTERY
  deriving (Eq,Ord,Show)

data Detector
    = ITEMDETECTOR
    | CREATUREDETECTOR
    | WALLDETECTOR
  deriving (Eq,Ord,Show,Read)

data ModuleSlot
    = ModBullet
    | ModRifleMag
    | ModAutoMag
    | ModTarget
    | ModBulletTrajectory
    | ModLauncherHoming
    | ModBattery
    | ModTeleport
    | ModDualBeam
  deriving (Eq,Ord,Show)

makeLenses ''ItemType
