Make laser fire above corpses
This commit is contained in:
@@ -5,6 +5,7 @@ module Dodge.Item.Weapon.LaserPath (
|
||||
reflectPulseLaserAlong,
|
||||
) where
|
||||
|
||||
import ListHelp
|
||||
import Data.Bifunctor
|
||||
import Data.Tuple
|
||||
import Dodge.Base.Wall
|
||||
@@ -19,7 +20,7 @@ import Linear
|
||||
reflectLaserAlong ::
|
||||
Float -> Point2 -> Point2 -> World -> (Maybe (Point2, Either Creature Wall), [Point2])
|
||||
{-# INLINE reflectLaserAlong #-}
|
||||
reflectLaserAlong phasev sp ep w = case thingHitFilt (const True) _wlUnshadowed sp ep w of
|
||||
reflectLaserAlong phasev sp ep w = case safeHead $ filter g $ thingsHitZ 20 sp ep w of
|
||||
Just (p, Right wl)
|
||||
| Metal <- wl ^. wlMaterial ->
|
||||
f
|
||||
@@ -32,6 +33,8 @@ reflectLaserAlong phasev sp ep w = case thingHitFilt (const True) _wlUnshadowed
|
||||
Nothing -> (Nothing, [ep])
|
||||
where
|
||||
f p a b = reflectLaserAlong phasev a b w & _2 .:~ p
|
||||
g (_,Right wl) = wl ^. wlUnshadowed
|
||||
g _ = True
|
||||
|
||||
refract :: Float -> Point2 -> Point2 -> Wall -> Point2 -> Point2
|
||||
{-# INLINE refract #-}
|
||||
|
||||
Reference in New Issue
Block a user