module Dodge.Update.Cloud where import Data.Foldable import Dodge.Data.World import Dodge.Zoning.Creature import Geometry.Vector3D import LensHelp cloudPoisonDamage :: Cloud -> World -> World cloudPoisonDamage c w = w & dodamagesto (filter f $ crsNearPoint clpos w) where dodamagesto :: [Creature] -> World -> World dodamagesto scrs mcrs = foldl' (flip doDam) mcrs scrs doDam cr = cWorld . lWorld . 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