Creature zoning refactor
This commit is contained in:
@@ -240,9 +240,12 @@ 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 %~ flip (foldl' (flip $ IM.adjust doDam)) damagedCrs
|
||||
cloudPoisonDamage c w = w & creatures
|
||||
%~ dodamagesto damagedCrs
|
||||
where
|
||||
damagedCrs = IM.keys $ IM.filter f $ creaturesNearPoint clpos w
|
||||
dodamagesto :: StreamOf Creature -> IM.IntMap Creature -> IM.IntMap Creature
|
||||
dodamagesto = undefined
|
||||
damagedCrs = S.filter f $ crsNearPoint clpos w
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user