Refactor shells

This commit is contained in:
2024-12-27 23:04:59 +00:00
parent 9168acf12e
commit 233fe5995c
8 changed files with 44 additions and 55 deletions
+2 -5
View File
@@ -17,9 +17,6 @@ import Data.Aeson.TH
import Dodge.Data.Bullet
import Dodge.Data.Payload
data ProjectileDraw = DrawShell | DrawRemoteShell | DrawDrone | DrawBlankProjectile
deriving (Show, Eq, Ord, Enum, Bounded, Read) --Generic, Flat)
data ProjectileHoming
= NoHoming
| HomeUsingRemoteScreen {_phRemoteID :: NewInt ItmInt}
@@ -29,7 +26,8 @@ data ProjectileHoming
data ProjectileUpdate
= ThrustPU {_pjuStart :: Int, _pjuEnd :: Int, _pjuSmokeless :: Bool}
| StartSpinPU {_pjuTime :: Int, _pjuCID :: Int, _pjuSpinAmound :: Int}
| RemoteDirectionPU {_pjuStart :: Int, _pjuEnd :: Int, _pjuControllerID :: ProjectileHoming}
-- | RemoteDirectionPU {_pjuStart :: Int, _pjuEnd :: Int, _pjuControllerID :: ProjectileHoming}
| RemoteDirectionPU {_pjuStart :: Int, _pjuEnd :: Int}
| ReduceSpinPU {_pjuReduceSpin :: Float}
| DestroyPU {_pjuScreenID :: Maybe (NewInt ItmInt)
,_pjuTimer :: Int}
@@ -66,7 +64,6 @@ makeLenses ''AmmoType
makeLenses ''ProjectileHoming
deriveJSON defaultOptions ''GasFuel
deriveJSON defaultOptions ''ProjectileHoming
deriveJSON defaultOptions ''ProjectileDraw
deriveJSON defaultOptions ''ProjectileUpdate
deriveJSON defaultOptions ''GasCreate
deriveJSON defaultOptions ''ForceFieldType
+2 -3
View File
@@ -13,17 +13,15 @@ import Geometry.Data
data ProjectileType
= Grenade
| Rocket
| Rocket {_rocketHoming :: ProjectileHoming}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data Projectile
= Shell
{ _prjPos :: Point2
, _prjVel :: Point2
-- , _prjAcc :: Point2
, _prjDir :: Float
, _prjSpin :: Float
, _prjDraw :: ProjectileDraw
, _prjID :: Int
, _prjPayload :: Payload
, _prjTimer :: Int
@@ -35,5 +33,6 @@ data Projectile
deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''Projectile
makeLenses ''ProjectileType
deriveJSON defaultOptions ''ProjectileType
deriveJSON defaultOptions ''Projectile