Implement randomised markings on sensors
This commit is contained in:
@@ -23,10 +23,10 @@ import Geometry
|
||||
--import Geometry.Vector3D
|
||||
import Shape
|
||||
import Dodge.SoundLogic
|
||||
import LensHelp
|
||||
|
||||
import System.Random
|
||||
import Data.List
|
||||
import Control.Lens
|
||||
|
||||
barrel :: Creature
|
||||
barrel = defaultInanimate
|
||||
@@ -89,7 +89,7 @@ damToExpBarrel :: [Damage] -> Creature -> Creature
|
||||
damToExpBarrel ds cr = foldr damToExpBarrel' (foldr damToExpBarrel' cr pierceDam) otherDam
|
||||
where
|
||||
(pierceDam,otherDam) = partition isPierce ds
|
||||
isPierce (Damage {_dmType = Piercing{}}) = True
|
||||
isPierce Damage{_dmType = Piercing{}} = True
|
||||
isPierce _ = False
|
||||
|
||||
damToExpBarrel' :: Damage -> Creature -> Creature
|
||||
@@ -98,8 +98,8 @@ damToExpBarrel' dm cr = case _dmType dm of
|
||||
$ over crHP (\hp -> hp - div amount 200) cr
|
||||
PoisonDam -> cr
|
||||
SparkDam -> cr
|
||||
PushDam -> cr Control.Lens.& crPos %~ (+.+) (1 / _crMass cr *.* (_dePushBack $ _dmEffect dm))
|
||||
dt -> cr Control.Lens.& crHP -~ amount
|
||||
PushDam -> cr LensHelp.& crPos .+.+~ (1 / _crMass cr *.* _dePushBack (_dmEffect dm))
|
||||
_ -> cr LensHelp.& crHP -~ amount
|
||||
where
|
||||
amount = _dmAmount dm
|
||||
int = _dmAt dm
|
||||
|
||||
Reference in New Issue
Block a user