Implement randomised markings on sensors

This commit is contained in:
2022-03-13 19:59:46 +00:00
parent 06a501ff88
commit 1b6f11709c
16 changed files with 169 additions and 95 deletions
+4 -4
View File
@@ -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