105 lines
2.8 KiB
Haskell
105 lines
2.8 KiB
Haskell
{-# LANGUAGE DeriveGeneric #-}
|
|
{-# LANGUAGE DeriveAnyClass #-}
|
|
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Dodge.Data.Item.Params where
|
|
|
|
import Color
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
import Dodge.Data.ArcStep
|
|
import Dodge.Data.Beam
|
|
import Geometry.Data
|
|
|
|
data ItemParams
|
|
= NoParams
|
|
| MagShieldParams
|
|
{_magShieldMgMIX :: Maybe Int}
|
|
| ShrinkGunParams
|
|
{_shrinkGunStatus :: ShrinkGunStatus}
|
|
| FlatShieldParams
|
|
{_flatShieldWlMIX :: Maybe Int}
|
|
| ShellLauncher
|
|
{ _shellSpinDrag :: Int
|
|
, _shellSpinAmount :: Int
|
|
, _shellThrustDelay :: Int
|
|
}
|
|
| Refracting
|
|
{ _phaseV :: Float
|
|
, _lasColor :: Color
|
|
, _lasColor2 :: Color
|
|
, _lasCycle :: Int
|
|
, _lasDamage :: Int
|
|
}
|
|
| DualBeam
|
|
{ _phaseV :: Float
|
|
, _lasColor :: Color
|
|
, _lasColor2 :: Color
|
|
, _lasCycle :: Int
|
|
, _lasDamage :: Int
|
|
, _lasBeam :: BeamType
|
|
, _subParams :: Maybe ItemParams
|
|
, _dbGap :: Float
|
|
}
|
|
| Attracting {_attractionPower :: Point2}
|
|
| BulletShooter
|
|
{ _muzVel :: Float
|
|
, _rifling :: Float
|
|
, _bore :: Float
|
|
, _recoil :: Float
|
|
, _torqueAfter :: Float
|
|
, _randomOffset :: Float
|
|
}
|
|
| Sprayer {_sprayNozzles :: [Nozzle]}
|
|
| AngleWalk
|
|
{ _maxWalkAngle :: Float
|
|
, _currentWalkAngle :: Float
|
|
, _walkSpeed :: Float
|
|
}
|
|
| Arcing
|
|
{ _currentArc :: Maybe [ArcStep]
|
|
, _arcSize :: Float
|
|
, _arcNumber :: Int
|
|
, _newArcStep :: NextArcStep --ItemParams -> World -> ArcStep -> State StdGen (Maybe ArcStep)
|
|
, _previousArcEffect :: PreviousArcEffect
|
|
}
|
|
| ParamMID {_paramMID :: Maybe Int}
|
|
| BoostPropIX {_boostPropIX :: Maybe Int}
|
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data ShrinkGunStatus = FullSize | Shrunk
|
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data PreviousArcEffect = NoPreviousArcEffect | PerturbTillBreakPreviousArc
|
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
--data GunBarrels
|
|
---- = MultiBarrel
|
|
---- { _brlSpread :: BarrelSpread
|
|
---- , _brlNum :: Int
|
|
---- , _brlInaccuracy :: Float
|
|
---- }
|
|
-- = BarrelList
|
|
-- { _brlList :: [GunBarrel]
|
|
-- }
|
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data Nozzle = Nozzle
|
|
{ _nzPressure :: Float
|
|
, _nzDir :: Float
|
|
, _nzMaxWalkAngle :: Float
|
|
, _nzCurrentWalkAngle :: Float
|
|
, _nzWalkSpeed :: Float
|
|
, _nzLength :: Float
|
|
}
|
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
makeLenses ''ItemParams
|
|
makeLenses ''Nozzle
|
|
deriveJSON defaultOptions ''ShrinkGunStatus
|
|
deriveJSON defaultOptions ''PreviousArcEffect
|
|
deriveJSON defaultOptions ''Nozzle
|
|
deriveJSON defaultOptions ''ItemParams
|