Implement wall penetrating bullets

This commit is contained in:
2021-03-23 12:06:46 +01:00
parent 63a50f0e05
commit 941fef134d
7 changed files with 67 additions and 90 deletions
+7 -7
View File
@@ -64,7 +64,7 @@ pistol = Weapon
. withRandomDir 0.1
. withMuzFlare
. withVelWthHiteff (30,0) 2
$ threeEff' bulHitCr' bulHitWall' bulHitFF'
$ destroyOnImpact bulHitCr' bulHitWall' bulHitFF'
, _wpSpread = 0.02
, _wpRange = 20
, _itHammer = HammerUp
@@ -130,14 +130,14 @@ autoFireMode = shootWithSound (fromIntegral autoGunSound)
. withRandomDir (autogunSpread/2)
. withMuzFlare
. withVelWthHiteff (50,0) 3
$ threeEff' bulHitCr' bulHitWall' bulHitFF'
$ destroyOnImpact bulHitCr' bulHitWall' bulHitFF'
singleFireMode = shootWithSound (fromIntegral autoGunSound)
. withRecoil 40
. torqueAfter 0.03
. withRandomDir (autogunSpread/2)
. withMuzFlare
. withVelWthHiteff (50,0) 3
$ threeEff' bulHitCr' bulHitWall' bulHitFF'
$ destroyOnImpact bulHitCr' bulHitWall' bulHitFF'
incMode :: Int -> World -> World
incMode _ w
@@ -373,7 +373,7 @@ mkBezierBul :: Point2 -> Point2 -> Point2 -> Int -> World -> World
mkBezierBul startp controlp targetp cid w = over particles' (bbul :) w
where
bbul = aCurveBulAt (Just cid) white startp (controlp +.+ randPos) (targetp +.+ randPos')
(threeEff' bulHitCr' bulHitWall' bulHitFF') 5
(destroyOnImpact bulHitCr' bulHitWall' bulHitFF') 5
(randPos,randPos') = flip evalState (_randGen w)
$ do a <- randInCirc 10
b <- randInCirc 20
@@ -428,7 +428,7 @@ hvAutoGun = defaultAutoGun
. withThinSmoke
. withMuzFlare
. withVelWthHiteff (80,0) 6
$ threeEff'
$ penWalls
hvBulHitCr' hvBulHitWall' bulHitFF'
ltAutoGun = defaultAutoGun
@@ -567,7 +567,7 @@ longGun = defaultGun
. torqueAfter 0.05
. withMuzFlare
. withVelWthHiteff (60,0) 6
$ threeEff' hvBulHitCr' hvBulHitWall' bulHitFF'
$ penWalls hvBulHitCr' hvBulHitWall' bulHitFF'
, _wpSpread = 0.0
, _wpRange = 200
@@ -895,7 +895,7 @@ makeFlame pos vel maycid = over particles' ((:) theFlame)
, _btPassThrough' = maycid
, _btWidth' = 4
, _btTimer' = 100
, _btHitEffect' = threeEff' (doFlameDam 1) noEff noEff
, _btHitEffect' = destroyOnImpact (doFlameDam 1) noEff noEff
}
moveFlame :: Point2 -> World -> Particle' -> (World, Maybe Particle')
+2 -2
View File
@@ -218,10 +218,10 @@ bulHitFF' :: Particle' -> Point2 -> ForceField -> World -> World
bulHitFF' _ _ _ = id
bulletEffect' :: HitEffect
bulletEffect' = threeEff' bulHitCr' bulHitWall' bulHitFF'
bulletEffect' = destroyOnImpact bulHitCr' bulHitWall' bulHitFF'
bulletParticleSideEffect :: Particle' -> HitEffect
bulletParticleSideEffect pt = threeEff' mkPt mkPt noEff
bulletParticleSideEffect pt = destroyOnImpact mkPt mkPt noEff
where mkPt _ p _ = over particles' ((:) pt {_btTrail' = [p]})
aGenBulAt' :: Maybe Int -> Color -> Point2 -> Point2 -> HitEffect -> Float -> Particle'