Start to move damage effects of bullets into a more sensible place

This commit is contained in:
2022-03-25 09:45:11 +00:00
parent 41ad289de2
commit af6cdfd048
7 changed files with 102 additions and 99 deletions
+3 -42
View File
@@ -1,17 +1,11 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
{-
Datatypes describing the type of damage effects that are to be applied to
creatures.
-}
module Dodge.Data.DamageType
where
--import Geometry
import Geometry.Data
import Control.Lens
data DamageType = Piercing
module Dodge.Data.DamageType where
data DamageType
= Piercing
| Blunt
| Cutting
| SparkDam
@@ -24,36 +18,3 @@ data DamageType = Piercing
| PushDam
| PoisonDam
deriving (Eq,Ord,Show)
-- this should possibly be pushed into the damage type
data DamageEffect
= PushDamage
{ _dePush :: Float
, _dePushExp :: Float
, _dePushRadius :: Float
}
| TorqueDamage { _deTorque :: Float }
| PushBackDamage {_dePushBack :: Point2 }
| NoDamageEffect
-- deriving (Eq,Ord,Show)
data Damage = Damage
{ _dmType :: DamageType
, _dmAmount :: Int , _dmFrom :: Point2 , _dmAt :: Point2 , _dmTo :: Point2
, _dmEffect :: DamageEffect
}
-- deriving (Eq,Ord,Show)
isElectrical :: Damage -> Bool
isElectrical dm = case _dmType dm of
Electrical{} -> True
_ -> False
isMovementDam :: Damage -> Bool
isMovementDam dm = case _dmType dm of
TorqueDam{} -> True
PushDam{} -> True
_ -> False
makeLenses ''Damage
makeLenses ''DamageEffect