Fix shockwave damage radius for walls
This commit is contained in:
+3
-60
@@ -2,12 +2,7 @@
|
||||
|
||||
module Dodge.Debug (debugEvents, drawDebug) where
|
||||
|
||||
import Geometry.Data
|
||||
import Dodge.WorldBool
|
||||
import Dodge.Zoning.Pathing
|
||||
import Dodge.Door.DoorLerp
|
||||
import Dodge.ShiftPoint
|
||||
import Dodge.Zoning.Base
|
||||
import AesonHelp
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
@@ -77,44 +72,8 @@ debugItem = \case
|
||||
Debug_put -> debugPutItems
|
||||
|
||||
debugGet :: Universe -> [String]
|
||||
debugGet u = [fromMaybe "DebugGetFail" $ debugGet1 u
|
||||
, fromMaybe "DebugGetFail" $ debugGet2 u
|
||||
, fromMaybe "DebugGetFail" $ debugGet3 u
|
||||
]
|
||||
debugGet u = foldMap getPretty $ u ^. uvWorld . cWorld . lWorld . shockwaves
|
||||
|
||||
--debugGet1 :: Show a => Universe -> Maybe a
|
||||
debugGet1 :: Universe -> Maybe String
|
||||
debugGet1 u = do
|
||||
dr <- u ^? uvWorld . cWorld . lWorld . doors . ix 2
|
||||
let wlposs x = (dr ^. drFootPrint) & each . each %~ shiftPointBy (doDoorLerp dr x)
|
||||
ps = wlposs (dr ^. drLerp)
|
||||
is = foldMap (S.fromList . uncurry (zoneOfSeg peZoneSize)) ps
|
||||
return $ show $ S.toList is
|
||||
|
||||
debugGet2 :: Universe -> Maybe String
|
||||
debugGet2 u = do
|
||||
let w = u ^. uvWorld
|
||||
dr <- u ^? uvWorld . cWorld . lWorld . doors . ix 2
|
||||
let clerp = dr ^. drLerp
|
||||
speed = dr ^?! drUpdate . drLerpSpeed
|
||||
toOpen = doWdBl (_drTrigger dr) w
|
||||
newlerp
|
||||
| toOpen && clerp < 1 = Just . min 1 $ clerp + speed
|
||||
| clerp > 0 && not toOpen = Just . max 0 $ clerp - speed
|
||||
| otherwise = Nothing
|
||||
x <- newlerp
|
||||
let wlposs y = (dr ^. drFootPrint) & each . each %~ shiftPointBy (doDoorLerp dr y)
|
||||
ps = wlposs x
|
||||
is = foldMap (S.fromList . uncurry (zoneOfSeg peZoneSize)) ps
|
||||
return $ show is
|
||||
|
||||
debugGet3 :: Universe -> Maybe String
|
||||
debugGet3 u = do
|
||||
dr <- u ^? uvWorld . cWorld . lWorld . doors . ix 2
|
||||
let wlposs x = (dr ^. drFootPrint) & each . each %~ shiftPointBy (doDoorLerp dr x)
|
||||
ps = wlposs (dr ^. drLerp)
|
||||
is = foldMap (S.fromList . uncurry (zoneOfSeg peZoneSize)) ps
|
||||
return $ show is
|
||||
|
||||
debugPutItems :: Universe -> Maybe [DebugItem]
|
||||
debugPutItems u = Just $ f <$> [0..debugPutN]
|
||||
@@ -134,23 +93,7 @@ doDebugPut i u
|
||||
| otherwise = u
|
||||
|
||||
debugPutDraw :: IM.IntMap String -> Universe -> Picture
|
||||
debugPutDraw _ u = drawthedoor u <> drawthezones u
|
||||
|
||||
drawthezones :: Universe -> Picture
|
||||
drawthezones u = fold $ do
|
||||
is <- readMaybe =<< u ^? uvDebugPut . ix 0
|
||||
let f :: [Int2] -> [Int2]
|
||||
f = id
|
||||
return $ foldMap (drawZoneCol yellow peZoneSize) $ f is
|
||||
|
||||
drawthedoor :: Universe -> Picture
|
||||
drawthedoor u = fold $ do
|
||||
dr <- u ^? uvWorld . cWorld . lWorld . doors . ix 2
|
||||
let wlposs x = (dr ^. drFootPrint) & each . each %~ shiftPointBy (doDoorLerp dr x)
|
||||
ps = wlposs (dr ^. drLerp)
|
||||
return $ setLayer DebugLayer $ color blue $ foldMap g ps
|
||||
where
|
||||
g (x,y) = line [x,y]
|
||||
debugPutDraw _ _ = mempty
|
||||
|
||||
doDebugGet :: Universe -> Maybe [DebugItem]
|
||||
doDebugGet u =
|
||||
|
||||
Reference in New Issue
Block a user