Split off StreamingHelp module
This commit is contained in:
@@ -25,6 +25,7 @@ import LensHelp
|
||||
|
||||
import Data.Foldable
|
||||
import Data.Tuple
|
||||
import StreamingHelp
|
||||
import qualified Streaming.Prelude as S
|
||||
aFlameParticle
|
||||
:: Int -- ^ Timer
|
||||
@@ -240,14 +241,13 @@ makeGasCloud pos vel w = w
|
||||
(col, g) = runState (takeOne [green,yellow]) $ _randGen w
|
||||
{- Attach poison cloud damage to creatures near cloud. -}
|
||||
cloudPoisonDamage :: Cloud -> World -> World
|
||||
cloudPoisonDamage c w = w & creatures
|
||||
%~ dodamagesto damagedCrs
|
||||
cloudPoisonDamage c w = w & dodamagesto (S.filter f $ crsNearPoint clpos w)
|
||||
where
|
||||
dodamagesto :: StreamOf Creature -> IM.IntMap Creature -> IM.IntMap Creature
|
||||
dodamagesto = undefined
|
||||
damagedCrs = S.filter f $ crsNearPoint clpos w
|
||||
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
|
||||
doDam cr = cr & crState . csDamage .:~ Damage POISONDAM 1 clpos clpos clpos NoDamageEffect
|
||||
clpos = stripZ $ _clPos c
|
||||
|
||||
incBall :: RandomGen g => Point2 -> State g Particle
|
||||
|
||||
Reference in New Issue
Block a user