diff --git a/shader/lighting/occlude.frag b/shader/lighting/occlude.frag index e8c00f1d4..a75b09b2a 100644 --- a/shader/lighting/occlude.frag +++ b/shader/lighting/occlude.frag @@ -2,5 +2,5 @@ out vec4 fColor; void main() { - fColor = vec4 (0.9,0.5,0,1); + fColor = vec4 (0,0,0,1); } diff --git a/src/Dodge/Creature.hs b/src/Dodge/Creature.hs index 116178fff..5e6b8da0f 100644 --- a/src/Dodge/Creature.hs +++ b/src/Dodge/Creature.hs @@ -159,7 +159,7 @@ startCr = defaultCreature startInventory :: IM.IntMap Item startInventory = IM.fromList (zip [0..20] ( - [longGun + [ltAutoGun ,autoGun ,hvAutoGun ,pistol diff --git a/src/Dodge/Debug.hs b/src/Dodge/Debug.hs index 3764b819e..d1b354515 100644 --- a/src/Dodge/Debug.hs +++ b/src/Dodge/Debug.hs @@ -57,7 +57,7 @@ pjTimerF time i = projectiles . ix i . pjUpdate .~ (\_ -> pjTimerF (time - 1) i) drawDDA :: IM.IntMap IS.IntSet -> Picture drawDDA = setLayer 1 . color (withAlpha 0.5 green) . IM.foldlWithKey' f blank where - f pic x' ys' = (concatMapPic (\y -> polygon (rectNSEW (y+50) y (x+50) x)) ys) `appendPic` pic + f pic x' ys' = concatMapPic (\y -> polygon (rectNSEW (y+50) y (x+50) x)) ys `appendPic` pic where x = 50 * fromIntegral x' ys = map ((50 *) . fromIntegral) $ IS.toList ys' diff --git a/src/Dodge/Item/Weapon.hs b/src/Dodge/Item/Weapon.hs index 270222f63..0ccf93560 100644 --- a/src/Dodge/Item/Weapon.hs +++ b/src/Dodge/Item/Weapon.hs @@ -291,8 +291,12 @@ ltAutoGun = defaultAutoGun , _wpReloadState = 0 , _itUseRate = 3 , _itUseTime = 0 - , _itUse = \_ -> shootWithSound 0 . withRandomDir 0.3 . withSidePush 50 - . withMuzFlare $ withVelWthHiteff (V2 30 0) 2 basicBulletEffect + , _itUse = \_ -> withSidePush 50 $ withVelWthHiteff (V2 30 0) 2 basicBulletEffect + , _itUseModifiers = + [ shootWithSoundI 0 + , withRandomDirI 0.3 + , withMuzFlareI + ] , _wpSpread = 0.5 , _wpRange = 20 , _itFloorPict = onLayer FlItLayer ltAutoGunPic diff --git a/src/Dodge/Item/Weapon/TriggerType.hs b/src/Dodge/Item/Weapon/TriggerType.hs index 1ce6de6fe..7b42dce44 100644 --- a/src/Dodge/Item/Weapon/TriggerType.hs +++ b/src/Dodge/Item/Weapon/TriggerType.hs @@ -131,6 +131,19 @@ withRecoil recoilAmount eff cr = eff cr . over (creatures . ix cid) pushback pushback = over crPos (+.+ rotateV (_crDir cr) (V2 ((-recoilAmount) / _crMass cr ) 0)) {- | Pushes a creature sideways by a random amount. Applied before the underlying effect. -} +withSidePushI + :: Float -- ^ Maximal possible side push amount + -> (Creature -> World -> World) + -- ^ Underlying world effect, takes creature id as input + -> Creature + -> World -> World +withSidePushI maxSide eff cr w = eff cr . over (creatures . ix cid) push $ w + where + cid = _crID cr + push = over crPos (+.+ rotateV (_crDir cr) (V2 0 (pushAmount / _crMass cr))) + (pushAmount, _) = randomR (-maxSide,maxSide) $ _randGen w +{- | Pushes a creature sideways by a random amount. +Applied before the underlying effect. -} withSidePush :: Float -- ^ Maximal possible side push amount -> (Creature -> World -> World) diff --git a/src/Dodge/LevelGen/StaticWalls.hs b/src/Dodge/LevelGen/StaticWalls.hs index ba96d3fe1..1242e0087 100644 --- a/src/Dodge/LevelGen/StaticWalls.hs +++ b/src/Dodge/LevelGen/StaticWalls.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TupleSections #-} +--{-# LANGUAGE TupleSections #-} {-| Module : Dodge.LevelGen.StaticWalls Description : Concerns carving out of static walls to create the general room plan of the level. diff --git a/src/Dodge/Render.hs b/src/Dodge/Render.hs index 113fae493..db088b8e7 100644 --- a/src/Dodge/Render.hs +++ b/src/Dodge/Render.hs @@ -71,15 +71,17 @@ doDrawing pdata w = do clearColor $= Color4 0 0 0 0 clear [ColorBuffer,DepthBuffer] depthFunc $= Just Less - if w ^. config . wall_textured - then renderTextureWalls pdata nWalls - else renderBlankWalls pdata nWalls - + -- draw wall occlusions from your point of view drawShader (_lightingOccludeShader pdata) nWalls -- this might only work because the uniform has been correctly set -- elsewhere, beware + if w ^. config . wall_textured + then renderTextureWalls pdata nWalls + else renderBlankWalls pdata nWalls + + renderFoldable shadV $ polysToPic $ foregroundPics w layerCounts <- UMV.replicate (6*6) 0 diff --git a/src/Dodge/Room.hs b/src/Dodge/Room.hs index 348d10d27..49a29dfb3 100644 --- a/src/Dodge/Room.hs +++ b/src/Dodge/Room.hs @@ -308,8 +308,7 @@ weaponBetweenPillars :: RandomGen g => State g (Tree (Either Room Room)) weaponBetweenPillars = do wpPos <- takeOne [V2 x y | x <- [20,120,220], y <- [20,120,220]] (ps,_) <- takeNMore 2 ([], [V2 x y | x <- [20,220], y <- [20,120,220]]) - let crPos1 = ps !! 0 - crPos2 = ps !! 1 + let crPos1:crPos2:_ = ps d p = argV $ V2 120 120 -.- p plmnts = [sPS wpPos 0 $ RandPS randFirstWeapon diff --git a/src/Framebuffer/Update.hs b/src/Framebuffer/Update.hs index 524841b7f..264eb23a9 100644 --- a/src/Framebuffer/Update.hs +++ b/src/Framebuffer/Update.hs @@ -20,7 +20,7 @@ sizeFBOs -> Int -- ^ Full width -> Int -- ^ Full height -> RenderData - -> IO (RenderData) + -> IO RenderData sizeFBOs xsize ysize xfull yfull rdata = do resizeRBO (_rboBaseBloom rdata) xsize ysize resizeRBO (_rboLighting rdata) xsize ysize @@ -44,10 +44,10 @@ updateFBOTO :: Int -> Int -> ((TextureFilter, Maybe TextureFilter),TextureFilter) - -> GLenum + -> GLenum -- ^ internal color format -> RenderData -> ALens' RenderData (FramebufferObject, TextureObject) - -> IO (RenderData) + -> IO RenderData updateFBOTO xsize ysize mmfilt inFormat pdata target = do newfbo2 <- resizeFBOTO (pdata ^# target) xsize ysize mmfilt inFormat return $ storing target newfbo2 pdata @@ -57,7 +57,7 @@ resizeFBOTO -> Int -> Int -> ((TextureFilter, Maybe TextureFilter),TextureFilter) - -> GLenum + -> GLenum -- ^ internal color format -> IO (FramebufferObject, TextureObject) resizeFBOTO (fboName,toOld) xsize ysize mmfilt inFormat = do bindFramebuffer Framebuffer $= fboName