Split out more data files

This commit is contained in:
2022-07-16 17:32:11 +01:00
parent e4a4766ddf
commit 11732358ed
9 changed files with 122 additions and 87 deletions
+16
View File
@@ -0,0 +1,16 @@
module Dodge.Update.Cloud where
import Dodge.Data
import Dodge.Zone
import Geometry.Vector3D
import LensHelp
import StreamingHelp
import qualified Streaming.Prelude as S
cloudPoisonDamage :: Cloud -> World -> World
cloudPoisonDamage c w = w & dodamagesto (S.filter f $ crsNearPoint clpos w)
where
dodamagesto :: StreamOf Creature -> World -> World
dodamagesto scrs mcrs = runIdentity $ S.fold_ (flip doDam) mcrs id scrs
doDam cr = creatures . ix (_crID cr) . crState . csDamage
.:~ Damage POISONDAM 1 clpos clpos clpos NoDamageEffect
f cr = dist3 (addZ 20 $ _crPos cr) (_clPos c) < _crRad cr + _clRad c + 10
clpos = stripZ $ _clPos c