Update default config, general cleanup
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
7114951007332849727
|
8316779345008847591
|
||||||
@@ -152,13 +152,24 @@ collide3Wall sp wl (ep, mo) = maybe (ep, mo) (,Just (n, OWall wl)) $ intersectSe
|
|||||||
|
|
||||||
collide3Creature :: Point3 -> Creature -> (Point3, MPO) -> (Point3, MPO)
|
collide3Creature :: Point3 -> Creature -> (Point3, MPO) -> (Point3, MPO)
|
||||||
collide3Creature sp cr (ep, m) = fromMaybe (ep, m) $ do
|
collide3Creature sp cr (ep, m) = fromMaybe (ep, m) $ do
|
||||||
(sp', ep') <- restrictSeg 0 (V3 0 0 1) (sp, ep) >>= restrictSeg (V3 0 0 25) (V3 0 0 (-1))
|
(sp', ep') <- restrictSeg 0 (V3 0 0 1) (sp, ep)
|
||||||
|
>>= restrictSeg (V3 0 0 25) (V3 0 0 (-1))
|
||||||
|
(zmin,zmax) <- crZBounds cr
|
||||||
p <- listToMaybe $ intersectCircSeg cpos (crRad $ cr ^. crType) (xyV3 sp') (xyV3 ep')
|
p <- listToMaybe $ intersectCircSeg cpos (crRad $ cr ^. crType) (xyV3 sp') (xyV3 ep')
|
||||||
let z = 0
|
let z = 0
|
||||||
return (p `v2z` z, Just (normalize $ (p - cpos) `v2z` 0, OCreature cr))
|
return (p `v2z` z, Just (normalize $ (p - cpos) `v2z` 0, OCreature cr))
|
||||||
where
|
where
|
||||||
cpos = cr ^. crPos
|
cpos = cr ^. crPos
|
||||||
|
|
||||||
|
crZBounds :: Creature -> Maybe (Float,Float)
|
||||||
|
crZBounds cr = f <$> case cr ^. crHP of
|
||||||
|
HP {} -> Just (0,25)
|
||||||
|
CrIsCorpse {} -> Just (0,5)
|
||||||
|
CrIsGibs -> Nothing
|
||||||
|
CrIsPitted -> Nothing
|
||||||
|
where
|
||||||
|
f (a,b) = (a + cr ^. crZ,b + cr ^. crZ)
|
||||||
|
|
||||||
restrictSeg :: Point3 -> Point3 -> (Point3, Point3) -> Maybe (Point3, Point3)
|
restrictSeg :: Point3 -> Point3 -> (Point3, Point3) -> Maybe (Point3, Point3)
|
||||||
restrictSeg p n (sp, ep)
|
restrictSeg p n (sp, ep)
|
||||||
| isNHS p n sp
|
| isNHS p n sp
|
||||||
|
|||||||
+1
-1
@@ -165,7 +165,7 @@ hitEffFromBul w bu = case _buEffect bu of
|
|||||||
DestroyBullet -> expireAndDamage bu hitstream w
|
DestroyBullet -> expireAndDamage bu hitstream w
|
||||||
where
|
where
|
||||||
sp = _buPos bu
|
sp = _buPos bu
|
||||||
hitstream = thingsHitZ sp (sp + _buVel bu) w
|
hitstream = thingsHitZ 20 sp (sp + _buVel bu) w
|
||||||
|
|
||||||
getBulHitDams :: Bullet -> Point2 -> [Damage]
|
getBulHitDams :: Bullet -> Point2 -> [Damage]
|
||||||
getBulHitDams bu p = case _buPayload bu of
|
getBulHitDams bu p = case _buPayload bu of
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ defaultConfig =
|
|||||||
, _graphics_shadow_rendering = GeoObjShads
|
, _graphics_shadow_rendering = GeoObjShads
|
||||||
, _graphics_shadow_size = Typical
|
, _graphics_shadow_size = Typical
|
||||||
, _graphics_distortions = True
|
, _graphics_distortions = True
|
||||||
, _graphics_downsize_resolution = SixteenthRes
|
, _graphics_downsize_resolution = EighthRes
|
||||||
, _graphics_world_resolution = QuarterRes
|
, _graphics_world_resolution = QuarterRes
|
||||||
, _graphics_distortion_resolution = FullRes
|
, _graphics_distortion_resolution = FullRes
|
||||||
, _graphics_num_shadow_casters = toEnum 10
|
, _graphics_num_shadow_casters = toEnum 10
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import Dodge.Payload
|
|||||||
import Dodge.SoundLogic
|
import Dodge.SoundLogic
|
||||||
import Dodge.WorldEvent.Cloud
|
import Dodge.WorldEvent.Cloud
|
||||||
import Dodge.WorldEvent.Sound
|
import Dodge.WorldEvent.Sound
|
||||||
--import Dodge.WorldEvent.ThingsHit
|
|
||||||
import Geometry
|
import Geometry
|
||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|||||||
@@ -197,6 +197,7 @@ tutLight :: State LayoutVars (MetaTree Room String)
|
|||||||
tutLight = do
|
tutLight = do
|
||||||
x <- shuffleRoomPos =<< chasmSimpleMaze
|
x <- shuffleRoomPos =<< chasmSimpleMaze
|
||||||
y <- chasmSimpleMaze
|
y <- chasmSimpleMaze
|
||||||
|
z <- chasmSimpleMaze
|
||||||
return $
|
return $
|
||||||
tToBTree "TutLight" $
|
tToBTree "TutLight" $
|
||||||
treePost
|
treePost
|
||||||
@@ -207,7 +208,8 @@ tutLight = do
|
|||||||
, corridor & rmPmnts .~ mempty
|
, corridor & rmPmnts .~ mempty
|
||||||
, removeLights y
|
, removeLights y
|
||||||
, corridor & rmPmnts .~ mempty
|
, corridor & rmPmnts .~ mempty
|
||||||
, removeLights y
|
, removeLights z
|
||||||
|
, door
|
||||||
, cleatOnward corridor & rmPmnts .~ mempty
|
, cleatOnward corridor & rmPmnts .~ mempty
|
||||||
]
|
]
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -40,11 +40,11 @@ thingsHit sp ep w =
|
|||||||
(map (second Right) (wlsHit sp ep w))
|
(map (second Right) (wlsHit sp ep w))
|
||||||
|
|
||||||
{- Does not hit corpses -}
|
{- Does not hit corpses -}
|
||||||
thingsHitZ :: Point2 -> Point2 -> World -> [(Point2, Either Creature Wall)]
|
thingsHitZ :: Float -> Point2 -> Point2 -> World -> [(Point2, Either Creature Wall)]
|
||||||
thingsHitZ sp ep w =
|
thingsHitZ z sp ep w =
|
||||||
List.mergeOn
|
List.mergeOn
|
||||||
(dist sp . fst)
|
(dist sp . fst)
|
||||||
(map (second Left) (crsHitZ sp ep w))
|
(map (second Left) (crsHitZ z sp ep w))
|
||||||
(map (second Right) (wlsHit sp ep w))
|
(map (second Right) (wlsHit sp ep w))
|
||||||
|
|
||||||
crWlPbHit :: Point2 -> Point2 -> World -> [(Point2, Object)]
|
crWlPbHit :: Point2 -> Point2 -> World -> [(Point2, Object)]
|
||||||
@@ -68,8 +68,8 @@ crsHit sp ep w
|
|||||||
. crixsNearSeg sp ep
|
. crixsNearSeg sp ep
|
||||||
$ w
|
$ w
|
||||||
|
|
||||||
crsHitZ :: Point2 -> Point2 -> World -> [(Point2, Creature)]
|
crsHitZ :: Float -> Point2 -> Point2 -> World -> [(Point2, Creature)]
|
||||||
crsHitZ sp ep w
|
crsHitZ z sp ep w
|
||||||
| sp == ep = mempty
|
| sp == ep = mempty
|
||||||
| otherwise =
|
| otherwise =
|
||||||
sortOn (dist sp . fst)
|
sortOn (dist sp . fst)
|
||||||
@@ -81,6 +81,8 @@ crsHitZ sp ep w
|
|||||||
where
|
where
|
||||||
f cr
|
f cr
|
||||||
| HP{} <- cr ^. crHP = Just cr
|
| HP{} <- cr ^. crHP = Just cr
|
||||||
|
| CrIsCorpse{} <- cr ^. crHP
|
||||||
|
, z < 5 = Just cr
|
||||||
| otherwise = Nothing
|
| otherwise = Nothing
|
||||||
|
|
||||||
pbsHit :: Point2 -> Point2 -> World -> [(Point2, PulseBall)]
|
pbsHit :: Point2 -> Point2 -> World -> [(Point2, PulseBall)]
|
||||||
|
|||||||
@@ -348,6 +348,9 @@ intersectCircSeg c r a b
|
|||||||
z = sqrt y
|
z = sqrt y
|
||||||
v = z *.* normalizeV (b -.- a)
|
v = z *.* normalizeV (b -.- a)
|
||||||
|
|
||||||
|
intersectCylSeg :: Point3 -> Float -> Float -> Point3 -> Point3 -> Maybe Point3
|
||||||
|
intersectCylSeg p r h x y = Nothing
|
||||||
|
|
||||||
intersectCircSegTest :: Point2 -> Float -> Point2 -> Point2 -> Bool
|
intersectCircSegTest :: Point2 -> Float -> Point2 -> Point2 -> Bool
|
||||||
intersectCircSegTest c r x y = intersectSegSegTest (c + z) (c - z) x y
|
intersectCircSegTest c r x y = intersectSegSegTest (c + z) (c - z) x y
|
||||||
|| dist c x <= r
|
|| dist c x <= r
|
||||||
|
|||||||
Reference in New Issue
Block a user