Make background black, start cleanup of weapons

This commit is contained in:
2021-08-26 21:18:46 +01:00
parent cb39ee3e6b
commit c97c16777a
9 changed files with 34 additions and 16 deletions
+13
View File
@@ -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)