Start to move damage effects of bullets into a more sensible place
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user