Refactor bullet hit effect towards penetrating bullets

This commit is contained in:
2021-03-22 13:11:08 +01:00
parent 3bee30895d
commit b50dd8605a
6 changed files with 57 additions and 40 deletions
+4 -4
View File
@@ -217,14 +217,14 @@ hvBulHitWall' bt p x w = damageBlocks x
bulHitFF' :: Particle' -> Point2 -> ForceField -> World -> World
bulHitFF' _ _ _ = id
bulletEffect' :: HitEffect'
bulletEffect' :: HitEffect
bulletEffect' = threeEff' bulHitCr' bulHitWall' bulHitFF'
bulletParticleSideEffect :: Particle' -> HitEffect'
bulletParticleSideEffect :: Particle' -> HitEffect
bulletParticleSideEffect pt = threeEff' mkPt mkPt noEff
where mkPt _ p _ = over particles' ((:) pt {_btTrail' = [p]})
aGenBulAt' :: Maybe Int -> Color -> Point2 -> Point2 -> HitEffect' -> Float -> Particle'
aGenBulAt' :: Maybe Int -> Color -> Point2 -> Point2 -> HitEffect -> Float -> Particle'
aGenBulAt' maycid col pos vel hiteff width = Bul'
{ _ptPict' = blank
, _ptUpdate' = mvGenBullet'
@@ -237,7 +237,7 @@ aGenBulAt' maycid col pos vel hiteff width = Bul'
, _btHitEffect' = hiteff
}
aCurveBulAt :: Maybe Int -> Color -> Point2 -> Point2 -> Point2 -> HitEffect' -> Float -> Particle'
aCurveBulAt :: Maybe Int -> Color -> Point2 -> Point2 -> Point2 -> HitEffect -> Float -> Particle'
aCurveBulAt maycid col pos control targ hiteff width = Bul'
{ _ptPict' = blank
, _ptUpdate' = mvBulletTrajectory f
+3 -3
View File
@@ -109,7 +109,7 @@ withRandomDir acc f cid w = over (creatures . ix cid . crDir) (\d -> d - a)
w
where (a, g) = randomR (-acc,acc) $ _randGen w
withVelWthHiteff :: Point2 -> Float -> HitEffect' -> Int -> World -> World
withVelWthHiteff :: Point2 -> Float -> HitEffect -> Int -> World -> World
withVelWthHiteff vel width hiteff cid w
= over particles' ((:) newbul)
-- . over tempLightSources ((:) (tLightAt 4 pos))
@@ -157,7 +157,7 @@ torqueAfter torque feff cid w
rotateScope w = w & creatures . ix 0 . crInv . ix (_crInvSel (_creatures w IM.! 0))
. itAttachment . _Just . scopePos %~ rotateV rot
spreadNumVelWthHiteff' :: Float -> Int -> Point2 -> Float -> HitEffect' -> Int -> World -> World
spreadNumVelWthHiteff' :: Float -> Int -> Point2 -> Float -> HitEffect -> Int -> World -> World
spreadNumVelWthHiteff' spread num vel wth eff cid w
= over particles' (newbuls ++)
$ flip (foldr muzFlareAt) poss
@@ -175,7 +175,7 @@ spreadNumVelWthHiteff' spread num vel wth eff cid w
-- $ randomRs (0,spreadGunSpread/5) (_randGen w)
colids = take num $ randomRs (0,11) (_randGen w)
numVelWthHitEff' :: Int -> Point2 -> Float -> HitEffect' -> Int -> World -> World
numVelWthHitEff' :: Int -> Point2 -> Float -> HitEffect -> Int -> World -> World
numVelWthHitEff' num vel wth eff cid w
= over particles' (newbuls ++)
$ flip (foldr muzFlareAt) (take num poss)