Add dust on bullet wall hit
This commit is contained in:
@@ -44,6 +44,7 @@ autoGun = defaultAutoGun
|
||||
, useAmmo 1
|
||||
, withRandomDirI (autogunSpread/2)
|
||||
, withMuzFlareI
|
||||
, withSmoke 1 black 20 200 5
|
||||
]
|
||||
, _wpSpread = autogunSpread
|
||||
, _wpRange = 20
|
||||
|
||||
@@ -119,7 +119,7 @@ doThrust pj w = w
|
||||
(frict,g) = randomR (0.6,0.9) $ _randGen w
|
||||
(sparkD,_) = randomR (-0.2,0.2) $ _randGen w
|
||||
r1 = randInCirc 10 & evalState $ _randGen w
|
||||
smokeGen = makeSmokeCloudAt $ addZ 20 (oldPos +.+ r1 +.+ 30 *.* normalizeV (oldPos -.- newPos))
|
||||
smokeGen = shellTrailCloud $ addZ 20 (oldPos +.+ r1 +.+ 30 *.* normalizeV (oldPos -.- newPos))
|
||||
|
||||
flameLauncher :: Item
|
||||
flameLauncher = launcher & wpAmmo . amPayload .~ makeFlameExplosionAt
|
||||
|
||||
@@ -15,6 +15,7 @@ module Dodge.Item.Weapon.TriggerType
|
||||
, withSoundStart
|
||||
, withSoundContinue
|
||||
, withSoundForI
|
||||
, withSmoke
|
||||
, withThickSmokeI
|
||||
, withThinSmokeI
|
||||
, withRandomOffsetI
|
||||
@@ -33,14 +34,15 @@ module Dodge.Item.Weapon.TriggerType
|
||||
, useTimeCheckI
|
||||
, ammoCheckI
|
||||
, randSpreadDir
|
||||
, modClock
|
||||
)
|
||||
where
|
||||
import Dodge.Data
|
||||
import Dodge.Data.SoundOrigin
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.Creature.Action (startReloadingWeapon)
|
||||
import Dodge.WorldEvent (tempLightForAt)
|
||||
import Dodge.WorldEvent.Cloud
|
||||
import Dodge.WorldEvent
|
||||
--import Dodge.WorldEvent.Cloud
|
||||
import Dodge.RandomHelp
|
||||
import Dodge.Item.Attachment.Data
|
||||
import Dodge.Item.Data
|
||||
@@ -69,6 +71,15 @@ trigDoAlso
|
||||
-> ChainEffect
|
||||
trigDoAlso afterEff eff item cr = afterEff item cr . eff item cr
|
||||
|
||||
withSmoke :: Int -> Point4 -> Float -> Int -> Float -> ChainEffect
|
||||
withSmoke num col rad t alt eff item cr w
|
||||
= eff item cr
|
||||
$ foldl' (flip $ smokeCloudAt col rad t alt . (+.+.+ pos) . (*8)) w ps
|
||||
where
|
||||
dir = _crDir cr
|
||||
pos = addZ 0 $ _crPos cr +.+ (_crRad cr + 15) *.* unitVectorAtAngle dir
|
||||
ps = replicateM num randOnUnitSphere & evalState $ _randGen w
|
||||
|
||||
withThinSmokeI :: ChainEffect
|
||||
withThinSmokeI eff item cr w = eff item cr $ foldl' (flip $ makeThinSmokeAt . (+.+.+ pos) . (* 8)) w ps
|
||||
where
|
||||
@@ -295,8 +306,14 @@ withTempLight time rad col eff item cr = eff item cr
|
||||
}
|
||||
V2 x y = _crPos cr +.+ 15 *.* unitVectorAtAngle (_crDir cr)
|
||||
|
||||
modClock :: Int -> ChainEffect -> ChainEffect
|
||||
modClock n chainEff eff it cr w
|
||||
| _frameClock w `mod` n == 0 = (chainEff eff) it cr w
|
||||
| otherwise = eff it cr w
|
||||
|
||||
withMuzFlareI :: ChainEffect
|
||||
withMuzFlareI f it cr w = tempLightForAt 3 pos2 -- . muzzleFlashAt pos2
|
||||
withMuzFlareI f it cr w =
|
||||
makeTLight 3 100 (V3 1 1 0.5) pos2 -- . muzzleFlashAt pos2
|
||||
$ f it cr w
|
||||
where
|
||||
--pos = _crPos cr +.+ _crRad cr *.* unitVectorAtAngle (_crDir cr)
|
||||
|
||||
Reference in New Issue
Block a user