diff --git a/saveSlot/seed b/saveSlot/seed index 2f0d3ff35..537905607 100644 --- a/saveSlot/seed +++ b/saveSlot/seed @@ -1 +1 @@ -7114951007332849727 \ No newline at end of file +8316779345008847591 \ No newline at end of file diff --git a/src/Dodge/Base/Collide.hs b/src/Dodge/Base/Collide.hs index 393374d08..6e9474c8c 100644 --- a/src/Dodge/Base/Collide.hs +++ b/src/Dodge/Base/Collide.hs @@ -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 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') let z = 0 return (p `v2z` z, Just (normalize $ (p - cpos) `v2z` 0, OCreature cr)) where 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 p n (sp, ep) | isNHS p n sp diff --git a/src/Dodge/Bullet.hs b/src/Dodge/Bullet.hs index 4490b0933..372c30a6a 100644 --- a/src/Dodge/Bullet.hs +++ b/src/Dodge/Bullet.hs @@ -165,7 +165,7 @@ hitEffFromBul w bu = case _buEffect bu of DestroyBullet -> expireAndDamage bu hitstream w where sp = _buPos bu - hitstream = thingsHitZ sp (sp + _buVel bu) w + hitstream = thingsHitZ 20 sp (sp + _buVel bu) w getBulHitDams :: Bullet -> Point2 -> [Damage] getBulHitDams bu p = case _buPayload bu of diff --git a/src/Dodge/Data/Config.hs b/src/Dodge/Data/Config.hs index 6db248a3d..2d1253f3e 100644 --- a/src/Dodge/Data/Config.hs +++ b/src/Dodge/Data/Config.hs @@ -135,7 +135,7 @@ defaultConfig = , _graphics_shadow_rendering = GeoObjShads , _graphics_shadow_size = Typical , _graphics_distortions = True - , _graphics_downsize_resolution = SixteenthRes + , _graphics_downsize_resolution = EighthRes , _graphics_world_resolution = QuarterRes , _graphics_distortion_resolution = FullRes , _graphics_num_shadow_casters = toEnum 10 diff --git a/src/Dodge/Projectile/Update.hs b/src/Dodge/Projectile/Update.hs index 05fe0454c..0e6d3ab10 100644 --- a/src/Dodge/Projectile/Update.hs +++ b/src/Dodge/Projectile/Update.hs @@ -15,7 +15,6 @@ import Dodge.Payload import Dodge.SoundLogic import Dodge.WorldEvent.Cloud import Dodge.WorldEvent.Sound ---import Dodge.WorldEvent.ThingsHit import Geometry import qualified IntMapHelp as IM import LensHelp diff --git a/src/Dodge/Room/Tutorial.hs b/src/Dodge/Room/Tutorial.hs index 82b804838..0c00cda33 100644 --- a/src/Dodge/Room/Tutorial.hs +++ b/src/Dodge/Room/Tutorial.hs @@ -197,6 +197,7 @@ tutLight :: State LayoutVars (MetaTree Room String) tutLight = do x <- shuffleRoomPos =<< chasmSimpleMaze y <- chasmSimpleMaze + z <- chasmSimpleMaze return $ tToBTree "TutLight" $ treePost @@ -207,7 +208,8 @@ tutLight = do , corridor & rmPmnts .~ mempty , removeLights y , corridor & rmPmnts .~ mempty - , removeLights y + , removeLights z + , door , cleatOnward corridor & rmPmnts .~ mempty ] where diff --git a/src/Dodge/WorldEvent/ThingsHit.hs b/src/Dodge/WorldEvent/ThingsHit.hs index 7413d6c0f..ef4b8698b 100644 --- a/src/Dodge/WorldEvent/ThingsHit.hs +++ b/src/Dodge/WorldEvent/ThingsHit.hs @@ -40,11 +40,11 @@ thingsHit sp ep w = (map (second Right) (wlsHit sp ep w)) {- Does not hit corpses -} -thingsHitZ :: Point2 -> Point2 -> World -> [(Point2, Either Creature Wall)] -thingsHitZ sp ep w = +thingsHitZ :: Float -> Point2 -> Point2 -> World -> [(Point2, Either Creature Wall)] +thingsHitZ z sp ep w = List.mergeOn (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)) crWlPbHit :: Point2 -> Point2 -> World -> [(Point2, Object)] @@ -68,8 +68,8 @@ crsHit sp ep w . crixsNearSeg sp ep $ w -crsHitZ :: Point2 -> Point2 -> World -> [(Point2, Creature)] -crsHitZ sp ep w +crsHitZ :: Float -> Point2 -> Point2 -> World -> [(Point2, Creature)] +crsHitZ z sp ep w | sp == ep = mempty | otherwise = sortOn (dist sp . fst) @@ -79,8 +79,10 @@ crsHitZ sp ep w . crixsNearSeg sp ep $ w where - f cr + f cr | HP{} <- cr ^. crHP = Just cr + | CrIsCorpse{} <- cr ^. crHP + , z < 5 = Just cr | otherwise = Nothing pbsHit :: Point2 -> Point2 -> World -> [(Point2, PulseBall)] diff --git a/src/Geometry/Intersect.hs b/src/Geometry/Intersect.hs index 91a4dd6d3..fb739f128 100644 --- a/src/Geometry/Intersect.hs +++ b/src/Geometry/Intersect.hs @@ -348,6 +348,9 @@ intersectCircSeg c r a b z = sqrt y 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 c r x y = intersectSegSegTest (c + z) (c - z) x y || dist c x <= r