Refactor items, suspect a leak
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.Item.Misc where
|
||||
import Geometry.Data
|
||||
import Control.Lens
|
||||
|
||||
data ItemDimension = ItemDimension
|
||||
{ _dimRad :: Float
|
||||
, _dimCenter :: Point3
|
||||
, _dimAttachPos :: Point3
|
||||
}
|
||||
data ItemPortage
|
||||
= HeldItem
|
||||
{ _handlePos :: Float
|
||||
, _muzPos :: Float
|
||||
}
|
||||
| WornItem
|
||||
| NoPortage
|
||||
|
||||
data ItemValue = ItemValue
|
||||
{ _ivInt :: Int
|
||||
, _ivType :: ItemValueType
|
||||
}
|
||||
data ItemValueType = MundaneItem | ArtefactItem
|
||||
data ItemPos
|
||||
= InInv { _ipCrID :: Int , _ipInvID :: Int }
|
||||
| OnFloor { _ipFlID :: Int }
|
||||
| VoidItm
|
||||
makeLenses ''ItemDimension
|
||||
makeLenses ''ItemPortage
|
||||
makeLenses ''ItemValue
|
||||
makeLenses ''ItemPos
|
||||
@@ -1,3 +1,84 @@
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.Item.Params where
|
||||
import Dodge.Data.Beam
|
||||
import Dodge.Data.ArcStep
|
||||
import Geometry.Data
|
||||
import Color
|
||||
import Control.Lens
|
||||
|
||||
data ItemParams
|
||||
= NoParams
|
||||
| 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
|
||||
, _gunBarrels :: GunBarrels
|
||||
, _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}
|
||||
data PreviousArcEffect = NoPreviousArcEffect | PerturbTillBreakPreviousArc
|
||||
data GunBarrels
|
||||
= MultiBarrel
|
||||
{ _brlSpread :: BarrelSpread
|
||||
, _brlNum :: Int
|
||||
, _brlInaccuracy :: Float
|
||||
}
|
||||
| RotBarrel
|
||||
{ _brlNum :: Int
|
||||
, _brlInaccuracy :: Float
|
||||
}
|
||||
| SingleBarrel {_brlInaccuracy :: Float}
|
||||
data Nozzle = Nozzle
|
||||
{ _nzPressure :: Float
|
||||
, _nzDir :: Float
|
||||
, _nzMaxWalkAngle :: Float
|
||||
, _nzCurrentWalkAngle :: Float
|
||||
, _nzWalkSpeed :: Float
|
||||
, _nzLength :: Float
|
||||
}
|
||||
data BarrelSpread
|
||||
= AlignedBarrels
|
||||
| SpreadBarrels {_spreadAngle :: Float}
|
||||
| RotatingBarrels {_rotatingBarrelInaccuracy :: Float}
|
||||
|
||||
makeLenses ''BarrelSpread
|
||||
makeLenses ''ItemParams
|
||||
|
||||
Reference in New Issue
Block a user