Cleanup
This commit is contained in:
@@ -55,7 +55,7 @@ aFlameParticle t pos vel maycid = PtZ
|
||||
, _btPassThrough' = maycid
|
||||
, _btWidth' = 4
|
||||
, _btTimer' = t
|
||||
, _btHitEffect' = destroyOnImpact (doFlameDam 1) noEff noEff
|
||||
, _btHitEffect' = destroyOnImpact (doFlameDam 1) noEff
|
||||
, _ptZ = 20
|
||||
}
|
||||
drawFlame
|
||||
@@ -98,8 +98,8 @@ moveFlame
|
||||
moveFlame rotd w pt
|
||||
| time <= 0 = (makeFlamerSmokeAt (addZ 20 ep) w, Nothing)
|
||||
| otherwise = case thingsHitExceptCr (_btPassThrough' pt) sp ep w of
|
||||
((_,E3x1 _):_) -> (doSound damcrs , mvPt 0.7)
|
||||
(thing@(p,E3x2 wl):_) -> (doSound . fst $ hiteff [thing] damcrs , rfl wl p)
|
||||
((_,Left _):_) -> (doSound damcrs , mvPt 0.7)
|
||||
(thing@(p,Right wl):_) -> (doSound . fst $ hiteff [thing] damcrs , rfl wl p)
|
||||
_ -> (flameFlicker pt $ doSound damcrs , mvPt 0.98)
|
||||
where
|
||||
time = _btTimer' pt
|
||||
@@ -112,7 +112,7 @@ moveFlame rotd w pt
|
||||
, _btPos' = ep
|
||||
, _btPassThrough' = Nothing
|
||||
, _btVel' = speed *.* vel }
|
||||
damcrs = foldr (\cr -> fst . hiteff [(ep,E3x1 cr)]) w
|
||||
damcrs = foldr (\cr -> fst . hiteff [(ep,Left cr)]) w
|
||||
$ IM.filter closeCrs $ _creatures w
|
||||
closeCrs cr = dist ep (_crPos cr)
|
||||
< _crRad cr + 10 - min 9 (max 0 (fromIntegral time - 80))
|
||||
@@ -150,7 +150,7 @@ makeFlameletTimed (V2 x y) z vel maycid size time w = w
|
||||
, _btPassThrough' = maycid
|
||||
, _btWidth' = size
|
||||
, _btTimer' = time
|
||||
, _btHitEffect' = destroyOnImpact (doFlameDam 1) noEff noEff
|
||||
, _btHitEffect' = destroyOnImpact (doFlameDam 1) noEff
|
||||
, _ptZ = z
|
||||
}
|
||||
(rot ,g) = randomR (0,3) $ _randGen w
|
||||
@@ -205,7 +205,7 @@ Applies movement and attaches damage to nearby creatures. -}
|
||||
moveFlamelet :: World -> Particle -> (World, Maybe Particle)
|
||||
moveFlamelet w pt
|
||||
| _btTimer' pt <= 0 = ( w, Nothing)
|
||||
| otherwise = (flameFlicker pt $ damcrs, mvPt)
|
||||
| otherwise = (flameFlicker pt damcrs, mvPt)
|
||||
where
|
||||
sp = _btPos' pt
|
||||
vel = _btVel' pt
|
||||
@@ -389,7 +389,7 @@ createSparkCol time col pos dir = worldEvents %~ ( over particles (spark :) . )
|
||||
, _btPassThrough' = Nothing
|
||||
, _btWidth' = 1
|
||||
, _btTimer' = time
|
||||
, _btHitEffect' = destroyOnImpact sparkEff noEff noEff
|
||||
, _btHitEffect' = destroyOnImpact sparkEff noEff
|
||||
}
|
||||
sparkEff bt p cr
|
||||
= creatures . ix (_crID cr) . crState . crDamage %~ ( SparkDam 1 sp p ep : )
|
||||
|
||||
Reference in New Issue
Block a user