62 lines
1.6 KiB
Haskell
62 lines
1.6 KiB
Haskell
{-# LANGUAGE DeriveAnyClass #-}
|
|
{-# LANGUAGE DeriveGeneric #-}
|
|
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Dodge.Data.Item.Use (
|
|
module Dodge.Data.Item.Use,
|
|
module Dodge.Data.Item.Targeting,
|
|
module Dodge.Data.GenFloat,
|
|
module Dodge.Data.Item.Scope,
|
|
module Dodge.Data.Item.BulletMod,
|
|
module Dodge.Data.Payload,
|
|
module Dodge.Data.Bullet,
|
|
module Dodge.Data.Item.Use.Consumption.Ammo,
|
|
) where
|
|
|
|
import Dodge.Data.Item.Use.Consumption.Ammo
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
import qualified Data.Set as S
|
|
import Dodge.Data.Bullet
|
|
import Dodge.Data.GenFloat
|
|
import Dodge.Data.Item.BulletMod
|
|
import Dodge.Data.Item.Scope
|
|
import Dodge.Data.Item.Targeting
|
|
import Dodge.Data.Payload
|
|
import Geometry.Data
|
|
|
|
data ItemUse
|
|
= UseHeld
|
|
| UseAttach {_uaParams :: AttachParams}
|
|
| UseInt {_uInt :: Int}
|
|
| UseNothing
|
|
| UseValue {_uValue :: Either Int String}
|
|
| UseScope {_uScope :: Scope}
|
|
| UseBulletMod {_ubMod :: BulletMod}
|
|
| UseToggle {_useToggle :: Bool}
|
|
| UseMapper
|
|
{ _useMapperLines :: S.Set (Point2, Point2)
|
|
, _useMapperPoints :: S.Set Point2
|
|
}
|
|
deriving (Eq, Show, Read)
|
|
|
|
data AttachParams
|
|
= APProjectiles {_apProjectiles :: [Int]}
|
|
| APInt {_apInt :: Int}
|
|
| APNothing
|
|
deriving (Eq, Show, Read)
|
|
|
|
data AmmoParams
|
|
= BulletParams {_ampBullet :: Bullet}
|
|
| ProjectileParams {_ampPayload :: Payload}
|
|
| GasParams {_ampCreateGas :: GasFuel}
|
|
deriving (Eq, Show, Read) --Generic, Flat)
|
|
|
|
makeLenses ''ItemUse
|
|
makeLenses ''AttachParams
|
|
makeLenses ''AmmoParams
|
|
deriveJSON defaultOptions ''AttachParams
|
|
deriveJSON defaultOptions ''ItemUse
|