Broken commit (removed loadKeyConfig)

This commit is contained in:
2021-08-27 11:58:11 +01:00
parent c4df048d31
commit 3ff04576ab
25 changed files with 122 additions and 200 deletions
+17 -14
View File
@@ -275,7 +275,7 @@ hvAutoGun = defaultAutoGun
, _wpAmmo = hvBullet
}
where
mkHvBul it = withSound (fromIntegral longGunSound)
mkHvBul it = withSound longGunSound
. withThinSmoke
. withMuzFlare
$ useAmmoParams it
@@ -322,21 +322,24 @@ miniGun = defaultAutoGun
, _wpReloadTime = 200
, _wpReloadState = 0
, _wpMaxWarmUp = 100
, _itUseRate = 2
, _itUseRate = 1
, _itUseTime = 0
, _itUse = \_ -> withWarmUp 50
, _itUse = \it -> withWarmUp 26
. shootWithSoundFor 28 2
. torqueBefore 0.03 . withSidePush 50 . withRecoil 15
. withRandomDir 0.1
. torqueBefore 0.1
-- . torqueBefore 0.03
. withSidePush 50
. withRecoil 15
-- . withRandomDir 0.1
. withRandomOffset 9
. withMuzFlare
. withVelWthHiteff (V2 30 0) 2
$ destroyOnImpact bulBounceArmCr' bulHitWall' bulHitFF'
$ useAmmoParams it
, _wpRange = 20
, _itFloorPict = onLayer FlItLayer miniGunPict
, _itAimingSpeed = 0.4
, _itAimingRange = 1
, _itEquipPict = pictureWeaponOnAim miniGunPict
, _wpAmmo = basicBullet
}
miniGunPict :: Picture
miniGunPict = pictures
@@ -354,7 +357,7 @@ spreadGun = defaultGun
, _wpReloadState = 0
, _itUseRate = 20
, _itUseTime = 0
, _itUse = \_ -> shootWithSound (fromIntegral shotgunSound)
, _itUse = \_ -> shootWithSound shotgunSound
. withRecoil 100
. withMuzFlare
$ spreadNumVelWthHiteff spreadGunSpread 9 (V2 30 0) 2 basicBulletEffect
@@ -375,7 +378,7 @@ multGun = defaultGun
, _wpReloadState = 0
, _itUseRate = 20
, _itUseTime = 0
, _itUse = \_ -> shootWithSound (fromIntegral shotgunSound)
, _itUse = \_ -> shootWithSound shotgunSound
. withRecoil 200
. withMuzFlare
$ numVelWthHitEff 5 (V2 50 0) 5 basicBulletEffect
@@ -411,7 +414,7 @@ longGun = defaultGun
, _wpReloadType = PassiveReload skwareFadeTwoSecSound
, _itUseRate = 100
, _itUseTime = 0
, _itUse = shootWithSound (fromIntegral longGunSound)
, _itUse = shootWithSound longGunSound
. withThickSmoke
. torqueAfter 0.05
. withMuzFlare
@@ -640,10 +643,10 @@ moveRemoteBomb itid time pID w
$ set (projectiles .ix pID.pjUpdate) (\_ -> moveRemoteBomb itid (f time) pID)
w
| time < 2 = case hitWl of
Just _ -> soundOnce (fromIntegral tapQuiet) $ halfV updatedWorld
Just _ -> soundOnce tapQuiet $ halfV updatedWorld
_ -> halfV updatedWorld
| otherwise = case hitWl of
Just _ -> soundOnce (fromIntegral tapQuiet) updatedWorld
Just _ -> soundOnce tapQuiet updatedWorld
_ -> updatedWorld
where
updatedWorld
@@ -757,7 +760,7 @@ fireRemoteLauncher :: Creature -> World -> World
fireRemoteLauncher cr w = setLocation
$ resetFire
$ resetName
$ soundOnce (fromIntegral launcherSound)
$ soundOnce launcherSound
$ over projectiles remRocket w
where
i = IM.newKey $ _projectiles w
@@ -805,7 +808,7 @@ moveRemoteShell cid itid pj w
( ( pjVel %~ ( (accel +.+) . (frict *.*) ) )
. ( pjDir .~ newdir )
)
& soundFromPos (ShellSound i) newPos (fromIntegral smokeTrailSound) 1 250
& soundFromPos (ShellSound i) newPos smokeTrailSound 1 250
& smokeGen
& makeFlameletTimed oldPos 20 (0.5 *.* rotateV (pi+sparkD) accel) Nothing 3 10
| time > -200 = case thingHit of
+2 -2
View File
@@ -49,10 +49,10 @@ autoGun = defaultAutoGun
, _wpAmmo = basicBullet
}
autoFireMode, singleFireMode, autoGunNonTwistEff :: Creature -> World -> World
autoFireMode = shootWithSound (fromIntegral autoGunSound)
autoFireMode = shootWithSound autoGunSound
. torqueBefore 0.05
$ autoGunNonTwistEff
singleFireMode = hammerCheck $ shootWithSound (fromIntegral autoGunSound) autoGunNonTwistEff
singleFireMode = hammerCheck $ shootWithSound autoGunSound autoGunNonTwistEff
autoGunNonTwistEff = withRecoil 40
. withRandomDir (autogunSpread/2)
. withMuzFlare
+1 -1
View File
@@ -32,7 +32,7 @@ moveGrenade 0 _ pID w = over projectiles (IM.delete pID)
pj = _projectiles w IM.! pID
explosion = _pjPayload pj
moveGrenade time dir pID w = case hitWl of
Just _ -> soundOnce (fromIntegral tapQuiet) updatedWorld
Just _ -> soundOnce tapQuiet updatedWorld
_ -> updatedWorld
where
updatedWorld = updateV $ set (projectiles . ix pID . pjPos) finalPos
+3 -3
View File
@@ -37,7 +37,7 @@ launcher = defaultGun
, _wpReloadState = 0
, _itUseRate = 20
, _itUseTime = 0
, _itUse = shootWithSound (fromIntegral launcherSound) . aRocketWithItemParams
, _itUse = shootWithSound launcherSound . aRocketWithItemParams
, _wpSpread = 0.02
, _wpRange = 20
, _itFloorPict = onLayer FlItLayer launcherPic
@@ -92,14 +92,14 @@ pjThrust :: Int -> Projectile -> World -> World
pjThrust i = pjEffTimeRange (st,et) doThrust
where
et | i == 0 = 36
| otherwise = 40 - (fromIntegral i * 20)
| otherwise = 40 - (i * 20)
st = et - 100
doThrust :: Projectile -> World -> World
doThrust pj w = w
& randGen .~ g
& projectiles . ix i . pjVel %~ (\v -> accel +.+ frict *.* v)
& soundFromPos (ShellSound i) newPos (fromIntegral smokeTrailSound) 1 250
& soundFromPos (ShellSound i) newPos smokeTrailSound 1 250
& makeFlameletTimed (oldPos -.- vel) 0 (vel +.+ rotateV (pi+sparkD) accel) Nothing 3 10
& smokeGen
where
+4 -6
View File
@@ -83,22 +83,21 @@ rateIncAB startRate fastRate shooteff1 shooteff2 cr w
Shoot a weapon rapidly after a warm up.
Applies ammo check as well. -}
withWarmUp
:: Int -- ^ Warm up time (in frames)
:: Int -- ^ warm up sound id
-> (Creature -> World -> World)
-- ^ Shoot effect
-- ^ underlying effect
-> Creature
-> World
-> World
withWarmUp t f cr w
withWarmUp soundID f cr w
| reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| _wpReloadState item /= 0 = w
| curWarmUp < maxWarmUp = w
& pointerToItem . wpCurWarmUp +~ 2
& soundFrom (CrWeaponSound cid) 26 2 0
& soundFrom (CrWeaponSound cid) soundID 2 0
| otherwise = w
& pointerToItem . wpCurWarmUp .~ maxWarmUp
& f cr
-- & soundFrom (CrWeaponSound cid) 28 2 0
where
cid = _crID cr
itRef = _crInvSel cr
@@ -106,7 +105,6 @@ withWarmUp t f cr w
pointerToItem = creatures . ix cid . crInv . ix itRef
curWarmUp = _wpCurWarmUp item
maxWarmUp = _wpMaxWarmUp item
fState = _itUseTime item
reloadCondition = _wpLoadedAmmo item == 0
{- | Adds a sound to a creature based world effect.
The sound is emitted from the creature's position. -}