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
+6 -2
View File
@@ -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
+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)