Allow flame particles to damage walls at distance
This commit is contained in:
@@ -6,6 +6,7 @@ module Dodge.WorldEvent.SpawnParticle
|
|||||||
) where
|
) where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
import Dodge.Base
|
import Dodge.Base
|
||||||
|
import Dodge.Zone
|
||||||
import Dodge.WorldEvent.HitEffect
|
import Dodge.WorldEvent.HitEffect
|
||||||
import Dodge.WorldEvent.ThingsHit
|
import Dodge.WorldEvent.ThingsHit
|
||||||
import Dodge.WorldEvent.Cloud
|
import Dodge.WorldEvent.Cloud
|
||||||
@@ -78,9 +79,9 @@ moveFlame :: Point2 -- ^ Rotation direction
|
|||||||
moveFlame rotd w pt
|
moveFlame rotd w pt
|
||||||
| time <= 0 = (makeFlamerSmokeAt (addZ 20 ep) w, Nothing)
|
| time <= 0 = (makeFlamerSmokeAt (addZ 20 ep) w, Nothing)
|
||||||
| otherwise = case thingsHitExceptCr (_ptCrIgnore pt) sp ep w of
|
| otherwise = case thingsHitExceptCr (_ptCrIgnore pt) sp ep w of
|
||||||
((_,Left _):_) -> (doSound damcrs , mvPt 0.7)
|
((_,Left _):_) -> (doSound $ damwls damcrs , mvPt 0.7)
|
||||||
(th@(p,Right wl):_) -> (doSound . fst $ hiteff [th] damcrs , rfl wl p)
|
(th@(p,Right wl):_) -> (doSound . fst $ hiteff [th] damcrs , rfl wl p)
|
||||||
_ -> (flameFlicker pt $ doSound damcrs , mvPt 0.98)
|
_ -> (flameFlicker pt . damwls $ doSound damcrs , mvPt 0.98)
|
||||||
where
|
where
|
||||||
time = _ptTimer pt
|
time = _ptTimer pt
|
||||||
doSound = soundContinue Flame (V2 x y) fireLoudS (Just 2)
|
doSound = soundContinue Flame (V2 x y) fireLoudS (Just 2)
|
||||||
@@ -92,7 +93,9 @@ moveFlame rotd w pt
|
|||||||
, _ptPos = ep
|
, _ptPos = ep
|
||||||
, _ptCrIgnore = Nothing
|
, _ptCrIgnore = Nothing
|
||||||
, _ptVel = speed *.* vel }
|
, _ptVel = speed *.* vel }
|
||||||
|
damwls w' = foldr (\wl -> fst . hiteff [(ep,Right wl)]) w' $ IM.filter closeWls $ wallsNearPoint ep w
|
||||||
damcrs = foldr (\cr -> fst . hiteff [(ep,Left cr)]) w $ IM.filter closeCrs $ _creatures w
|
damcrs = foldr (\cr -> fst . hiteff [(ep,Left cr)]) w $ IM.filter closeCrs $ _creatures w
|
||||||
|
closeWls wl = uncurry circOnSeg (_wlLine wl) ep 5
|
||||||
closeCrs cr = dist ep (_crPos cr)
|
closeCrs cr = dist ep (_crPos cr)
|
||||||
< _crRad cr + 10 - min 9 (max 0 (fromIntegral time - 80))
|
< _crRad cr + 10 - min 9 (max 0 (fromIntegral time - 80))
|
||||||
+ 5 * angleCoeff (angleVV (ep -.- _crPos cr) rotd)
|
+ 5 * angleCoeff (angleVV (ep -.- _crPos cr) rotd)
|
||||||
|
|||||||
Reference in New Issue
Block a user