This commit is contained in:
2022-07-11 10:26:33 +01:00
parent 75d597f774
commit 3447b9b0bb
15 changed files with 28 additions and 28 deletions
+2 -2
View File
@@ -33,8 +33,8 @@ splinterBlock bl w = foldr unshadowBlock w (_blShadows bl) -- foldr shiftTowardC
unshadowBlock :: Int -> World -> World
unshadowBlock wlid w = case w ^? walls . ix wlid of
Just wl -> w
& walls . ix wlid . wlDraw .~ True
& wlZoning . znObjects . ix x . ix y . ix wlid . wlDraw .~ True
& walls . ix wlid . wlUnshadowed .~ True
& wlZoning . znObjects . ix x . ix y . ix wlid . wlUnshadowed .~ True
where
V2 x y = wlZoneOfPoint $ uncurry midPoint (_wlLine wl)
Nothing -> w
+4 -4
View File
@@ -543,7 +543,7 @@ data Wall
= Wall
{ _wlLine :: [Point2] , _wlID :: Int
, _wlColor :: Color
, _wlDraw :: Maybe (Wall -> Picture)
, _wlUnshadowed :: Maybe (Wall -> Picture)
, _wlSeen :: Bool
, _wlIsSeeThrough :: Bool
}
@@ -552,7 +552,7 @@ data Wall
, _wlID :: Int
, _doorMech :: World -> World
, _wlColor :: Color
, _wlDraw :: Maybe (Wall -> Picture)
, _wlUnshadowed :: Maybe (Wall -> Picture)
, _wlSeen :: Bool
, _blIDs :: [Int]
, _blHP :: Int
@@ -562,7 +562,7 @@ data Wall
{ _wlLine :: [Point2] , _wlID :: Int
, _doorMech :: World -> World
, _wlColor :: Color
, _wlDraw :: Maybe (Wall -> Picture)
, _wlUnshadowed :: Maybe (Wall -> Picture)
, _wlSeen :: Bool
, _wlIsSeeThrough :: Bool
, _doorPathable :: Bool
@@ -571,7 +571,7 @@ data Wall
{ _wlLine :: [Point2]
, _wlID :: Int
, _wlColor :: Color
, _wlDraw :: Maybe (Wall -> Picture)
, _wlUnshadowed :: Maybe (Wall -> Picture)
, _wlSeen :: Bool
, _blIDs :: [Int]
, _blHP :: Int
+1 -1
View File
@@ -19,7 +19,7 @@ data Wall = Wall
, _wlTouchThrough :: Bool
, _wlFireThrough :: Bool
, _wlReflect :: Bool
, _wlDraw :: Bool
, _wlUnshadowed :: Bool
, _wlRotateTo :: Bool
, _wlStructure :: WallStructure
, _wlHeight :: Float
+4 -4
View File
@@ -16,7 +16,7 @@ defaultWall = Wall
, _wlFireThrough = False
, _wlTouchThrough = False
, _wlReflect = False
, _wlDraw = True
, _wlUnshadowed = True
, _wlRotateTo = True
, _wlStructure = StandaloneWall
, _wlWalkable = False
@@ -38,7 +38,7 @@ defaultCrystalWall = defaultWall
defaultMachineWall :: Wall
defaultMachineWall = defaultWall
{ _wlOpacity = SeeAbove
, _wlDraw = False
, _wlUnshadowed = False
, _wlRotateTo = False
, _wlStructure = MachinePart 0
, _wlMaterial = Metal
@@ -51,7 +51,7 @@ defaultDirtWall = defaultWall
, _wlSeen = False
, _wlOpacity = Opaque
, _wlRotateTo = False
, _wlDraw = True
, _wlUnshadowed = True
, _wlFireThrough = True
, _wlMaterial = Dirt
}
@@ -62,7 +62,7 @@ defaultWindow = defaultWall
, _wlColor = withAlpha 0.5 cyan
, _wlSeen = False
, _wlOpacity = SeeThrough
, _wlDraw = True
, _wlUnshadowed = True
, _wlFireThrough = True
, _wlMaterial = Glass
}
+3 -3
View File
@@ -130,8 +130,8 @@ flatShield = defaultEquipment
, _aimRange = 0
, _aimZoom = ItZoom 20 0.2 1
, _aimStance = TwoHandFlat
, _aimHandlePos = 10
, _aimMuzPos = 10
, _aimHandlePos = 0
, _aimMuzPos = 0
}
, _heldScroll = \_ _ -> id
}
@@ -153,7 +153,7 @@ shieldWall crid = defaultWall
,_wlWalkable = True
,_wlFireThrough = True
,_wlReflect = True
,_wlDraw = False
,_wlUnshadowed = False
,_wlRotateTo = False
,_wlStructure = CreaturePart crid -- shieldWallDamage
}
+1 -1
View File
@@ -18,7 +18,7 @@ import Data.Tuple
reflectLaserAlong :: Float -> Point2 -> Point2 -> World
-> (Maybe (Point2,Either Creature Wall),[Point2])
{-# INLINE reflectLaserAlong #-}
reflectLaserAlong phasev sp ep w = case thingHitFilt (const True) _wlDraw sp ep w of
reflectLaserAlong phasev sp ep w = case thingHitFilt (const True) _wlUnshadowed sp ep w of
Just (p,Right wl)
| _wlReflect wl -> second (p:) $ reflectLaserAlong phasev
(p +.+ unitVectorAtAngle (reflDirWall sp p wl))
+1 -1
View File
@@ -15,7 +15,7 @@ lowBlock mat col h ps = PutBlock bl wl $ reverse ps
& blDraw .~ const (noPic $ colorSH col (upperPrismPoly h $ reverse ps))
& blDeath .~ const id
wl = defaultWall
& wlDraw .~ False
& wlUnshadowed .~ False
& wlColor .~ col
& wlRotateTo .~ False
& wlOpacity .~ SeeAbove
+2 -2
View File
@@ -29,7 +29,7 @@ tankShape baseshape facade col col'
& blDraw .~ const (noPic $ colorSH col (upperPrismPoly 31 $ reverse baseshape) <> facade col col')
& blDeath .~ const id
wl = defaultWall
& wlDraw .~ False
& wlUnshadowed .~ False
& wlColor .~ col
& wlRotateTo .~ False
& wlOpacity .~ SeeAbove
@@ -38,7 +38,7 @@ tankShape baseshape facade col col'
-- = ps0jPushPS
-- (PutShape $ colorSH col (upperPrismPoly 31 baseshape) <> facade col col')
-- $ sps0 $ PutWall baseshape defaultWall
-- {_wlDraw = False, _wlColor = col, _wlRotateTo = False, _wlOpacity = SeeAbove}
-- {_wlUnshadowed = False, _wlColor = col, _wlRotateTo = False, _wlOpacity = SeeAbove}
roundTank :: Color -> Color -> Placement
roundTank = tankShape (polyCirc 4 20)
+2 -2
View File
@@ -18,7 +18,7 @@ heightWallPS spot h ps = spNoID spot $ lowBlock Stone (_wlColor defaultWall) h p
invisibleWall :: [Point2] -> Placement
invisibleWall ps = sps0 $ PutWall ps $ defaultWall
{ _wlOpacity = SeeAbove
, _wlDraw = False
, _wlUnshadowed = False
, _wlHeight = 0
, _wlTouchThrough = True
}
@@ -85,7 +85,7 @@ baseBlockPane = defaultWall
, _wlColor = greyN 0.5
, _wlSeen = False
, _wlOpacity = Opaque
, _wlDraw = True
, _wlUnshadowed = True
, _wlFireThrough = True
}
-- TODO find home for this
+1 -1
View File
@@ -91,7 +91,7 @@ plLineBlock basePane blwidth a b gw = ( 0
{_wlID = k
,_wlStructure = BlockPart $ i + blid
,_wlLine = ps
,_wlDraw = visStatus
,_wlUnshadowed = visStatus
}
-- | Must be done after inserting the block
+1 -1
View File
@@ -105,7 +105,7 @@ plLineBlock basePane blwidth a b gw = ( 0
{_wlID = k
,_wlStructure = BlockPart $ i + blid
,_wlLine = ps
,_wlDraw = visStatus
,_wlUnshadowed = visStatus
}
listWalls = concat $ zipWith makeWallAt blockCenPs is
+1 -1
View File
@@ -388,7 +388,7 @@ viewClipBounds cfig w
-- where
-- onScreen wall = uncurry (lineOnScreen w) $ _wlLine wall
-- isVisible wl
-- | wl ^? wlDraw == Just False = False
-- | wl ^? wlUnshadowed == Just False = False
-- | otherwise = onScreen wl
--
--lineOnScreen :: World -> Point2 -> Point2 -> Bool
+1 -1
View File
@@ -367,7 +367,7 @@ viewClipBounds cfig w
-- where
-- onScreen wall = uncurry (lineOnScreen w) $ _wlLine wall
-- isVisible wl
-- | wl ^? wlDraw == Just False = False
-- | wl ^? wlUnshadowed == Just False = False
-- | otherwise = onScreen wl
--
--lineOnScreen :: World -> Point2 -> Point2 -> Bool
+3 -3
View File
@@ -29,16 +29,16 @@ wallsToDraw w
g (V2 i j) = w ^? wlZoning . znObjects . ix i . ix j
wlOpaqueDraw :: Wall -> Bool
wlOpaqueDraw wl = wlIsOpaque wl && _wlDraw wl
wlOpaqueDraw wl = wlIsOpaque wl && _wlUnshadowed wl
wlSeeThroughDraw :: Wall -> Bool
wlSeeThroughDraw wl = wlIsSeeThrough wl && _wlDraw wl
wlSeeThroughDraw wl = wlIsSeeThrough wl && _wlUnshadowed wl
getWallSPic :: Wall -> SPic
getWallSPic wl = case wl ^? wlOpacity . opDraw of
Nothing -> mempty
Just f -> f wl
-- (wins,wls) = partition theTest . IM.elems . IM.filter _wlDraw $ wallsDoubleScreen cfig w
-- (wins,wls) = partition theTest . IM.elems . IM.filter _wlUnshadowed $ wallsDoubleScreen cfig w
-- theTest wl = case _wlOpacity wl of
-- Opaque -> False
-- _ -> True
+1 -1
View File
@@ -13,7 +13,7 @@ forceField = defaultWall
,_wlWalkable = True
,_wlFireThrough = True
,_wlReflect = True
,_wlDraw = True
,_wlUnshadowed = True
,_wlRotateTo = False
,_wlStructure = StandaloneWall
}