More streaming refactoring

This commit is contained in:
2022-06-24 23:37:01 +01:00
parent 0270d423fd
commit 3c2df2542a
10 changed files with 96 additions and 198 deletions
+1 -2
View File
@@ -3,7 +3,6 @@ module Dodge.Item.Equipment.Booster
) where
import Dodge.Data
import Dodge.Base
import Dodge.Zone
import Dodge.Default.Weapon
import Geometry
import qualified IntMapHelp as IM
@@ -27,7 +26,7 @@ boostPoint x cr w = case mayp2 of
cpos = _crPos cr
r = 1.5 * _crRad cr
p1 = cpos +.+ x *.* squashNormalizeV (mouseWorldPos w -.- cpos)
mayp2 = reflectPointWalls cpos p1 $ wallsAlongLine cpos p1 w
mayp2 = reflectPointWallsDamp (const True) 1 cpos p1 w
boostSelfL
:: Float -- ^ boost amount
+2 -3
View File
@@ -36,7 +36,7 @@ import Dodge.Default.Weapon
--import Dodge.Item.Attachment
--import Dodge.WorldEvent.HelperParticle
import Dodge.Base
import Dodge.Zone
--import Dodge.Zone
import Geometry
import Picture
import Shape
@@ -447,8 +447,7 @@ aTractorBeam _ cr w = w & plNew props pjID (tractorBeamAt spos outpos dir power)
spos = cpos +.+ (_crRad cr + 10) *.* unitVectorAtAngle dir
xpos = cpos +.+ 400 *.* unitVectorAtAngle dir
dir = _crDir cr
outpos = collidePointWalls' cpos xpos
$ wallsAlongLine cpos xpos w
outpos = fst $ collidePointWallsFilterStream (const True) cpos xpos w
power = _attractionPower . _itParams $ _crInv cr IM.! crSel cr
tractorBeamAt :: Point2 -> Point2 -> Float -> Point2 -> Prop
+4 -5
View File
@@ -6,7 +6,7 @@ import Dodge.Wall.Damage
--import Dodge.SoundLogic
import Dodge.Block.Debris
import Dodge.Base.Collide
import Dodge.Zone
--import Dodge.Zone
import Dodge.Creature.HandPos
--import Dodge.ChainEffect
import Dodge.Default.Weapon
@@ -24,7 +24,7 @@ import Shape
--import Sound.Data
import LensHelp
import qualified Data.IntMap.Strict as IM
--import qualified Data.IntMap.Strict as IM
shatterGun :: Item
shatterGun = defaultWeapon
@@ -46,9 +46,8 @@ shatterGunSPic _ = noPic $ colorSH blue $
xa = 1
xb = 9
shootShatter :: Item -> Creature -> World -> World
shootShatter it cr w = maybe w (uncurry $ shatterWall w sp ep) $ collidePointWallsWall sp ep
$ IM.filter canshatter
$ wallsAlongLine sp ep w
shootShatter it cr w = maybe w (uncurry $ shatterWall w sp ep) $ sequence
$ collidePointWallsFilterStream canshatter sp ep w
where
canshatter wl = case _wlOpacity wl of
Opaque -> True