Abstract out direction accuracy

This commit is contained in:
2021-03-16 14:16:27 +01:00
parent 875679d25f
commit f18bf2348a
3 changed files with 42 additions and 10 deletions
+9 -6
View File
@@ -61,7 +61,8 @@ pistol = Weapon
, _wpFireRate = 8
, _wpFireState = 0
, _wpFire = shootWithSound 0
$ withAccVelWthHiteff' 0.1 (30,0) 2
. withRandomDir 0.1
. withVelWthHiteff (30,0) 2
$ threeEff' bulHitCr' bulHitWall' bulHitFF'
, _wpSpread = 0.02
, _wpRange = 20
@@ -125,12 +126,14 @@ autoGun = defaultGun
autoFireMode = shootWithSound (fromIntegral autoGunSound)
$ withRecoil 40
$ torqueBefore 0.05
$ withAccVelWthHiteff' (autogunSpread/2) (50,0) 3
$ withRandomDir (autogunSpread/2)
$ withVelWthHiteff (50,0) 3
$ threeEff' bulHitCr' bulHitWall' bulHitFF'
singleFireMode = shootWithSound (fromIntegral autoGunSound)
$ withRecoil 40
$ torqueAfter 0.03
$ withAccVelWthHiteff' (autogunSpread/2) (50,0) 3
$ withRandomDir (autogunSpread/2)
$ withVelWthHiteff (50,0) 3
$ threeEff' bulHitCr' bulHitWall' bulHitFF'
incMode :: Int -> World -> World
@@ -417,7 +420,7 @@ hvAutoGun = defaultAutoGun
}
where mkHvBul = withSound (fromIntegral longGunSound)
$ withThinSmoke
$ withAccVelWthHiteff' 0 (80,0) 6
$ withVelWthHiteff (80,0) 6
$ threeEff'
hvBulHitCr' hvBulHitWall' bulHitFF'
@@ -430,7 +433,7 @@ ltAutoGun = defaultAutoGun
, _wpReloadState = 0
, _wpFireRate = 4
, _wpFireState = 0
, _wpFire = shootWithSound 0 $ withAccVelWthHiteff' 0.3 (30,0) 2 bulletEffect'
, _wpFire = shootWithSound 0 . withRandomDir 0.3 $ withVelWthHiteff (30,0) 2 bulletEffect'
, _wpSpread = 0.5
, _wpRange = 20
, _itFloorPict = onLayer FlItLayer $ color green $ pictures [polygon $ rectNSWE 4 (-4) (-4) 0
@@ -549,7 +552,7 @@ longGun = defaultGun
, _wpFire = shootWithSound (fromIntegral longGunSound)
$ withThickSmoke
$ torqueAfter 0.05
$ withAccVelWthHiteff' 0 (60,0) 6
$ withVelWthHiteff (60,0) 6
$ threeEff'
hvBulHitCr' hvBulHitWall' bulHitFF'