Update default config, general cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user