Make background black, start cleanup of weapons
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user