Allow grenades to stick to creatures

This commit is contained in:
2025-01-01 17:44:00 +00:00
parent e8fe4c2d72
commit 511e765e3a
6 changed files with 178 additions and 163 deletions
+3 -2
View File
@@ -5,6 +5,7 @@
module Dodge.Data.Projectile where
import Dodge.Data.Wall.Structure
import Dodge.Data.Item.Location
import NewInt
import Control.Lens
@@ -51,8 +52,8 @@ data RocketHoming
data GrenadeHitEffect
= GBounce {_bounceTolerance :: Float}
| GStick
| GStuckCreature {_stuckCrID :: Int, _stuckCrOffset :: Point2}
| GStuckWall {_stuckWlID :: Int}
| GStuckCreature {_stuckCrID :: Int, _stuckCrOffset :: Point2, _stuckCrRot :: Float}
| GStuckWall {_stuckWlID :: WallStructure}
deriving (Show, Eq, Ord, Read) --Generic, Flat)
data RocketSmoke
+3 -13
View File
@@ -1,10 +1,11 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Wall (
module Dodge.Data.Wall,
module Dodge.Data.Wall.Structure,
module Dodge.Data.Material,
) where
@@ -13,6 +14,7 @@ import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Dodge.Data.Material
import Dodge.Data.Wall.Structure
import Geometry
data Wall = Wall
@@ -45,20 +47,8 @@ data Opacity
data WallDraw = DrawForceField
deriving (Eq, Ord, Show, Enum, Bounded, Read) --Generic, Flat)
data WallStructure
= StandaloneWall
| DoorPart {_wsDoor :: Int}
| MachinePart {_wsMachine :: Int}
| BlockPart {_wsBlock :: Int}
| CreaturePart
{ _wlStCreature :: Int
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''Wall
makeLenses ''Opacity
makeLenses ''WallStructure
deriveJSON defaultOptions ''WallDraw
deriveJSON defaultOptions ''Opacity
deriveJSON defaultOptions ''WallStructure
deriveJSON defaultOptions ''Wall