Add extra flare to laser

This commit is contained in:
2022-03-25 19:04:13 +00:00
parent bd46d3f110
commit ae7fbe29c2
6 changed files with 16 additions and 28 deletions
+5 -4
View File
@@ -10,7 +10,7 @@ import Dodge.Item.Weapon.LaserPath
import Dodge.Creature.HandPos
import Dodge.Particle.TeslaArc
import Dodge.SoundLogic.LoadSound
--import Dodge.WorldEvent
import Dodge.WorldEvent.Flash
import Dodge.WorldEvent.Damage
--import Dodge.Default
--import Dodge.Item.Weapon.InventoryDisplay
@@ -122,6 +122,7 @@ lasGunPic it =
where
amFrac = fractionLoadedAmmo it
col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red
lasGunTweak :: TweakParam
lasGunTweak = TweakParam
{ _doTweak = thetweak
@@ -203,7 +204,7 @@ tractorGunPic it =
-- | assumes that the item is held
shootTeslaArc :: Item -> Creature -> World -> World
shootTeslaArc it cr w = w & randGen .~ g
& particles .:~ aTeslaArcAt col newarc
& instantParticles .:~ aTeslaArcAt col newarc
& creatures . ix (_crID cr) . crInv . ix (_crInvSel cr) . itParams . currentArc ?~ newarc
where
pos = _crPos cr +.+ aimingMuzzlePos cr it *.* unitVectorAtAngle dir
@@ -255,7 +256,8 @@ updateArc :: ItemParams
updateArc = createNewArc
shootLaser :: Item -> Creature -> World -> World
shootLaser it cr = instantParticles .:~ lasRayAt phasev pos dir
shootLaser it cr = (instantParticles .:~ lasRayAt phasev pos dir)
. flareCircleAt yellow 0.8 (pos `v2z` 25)
where
pos = _crPos cr +.+ aimingMuzzlePos cr it *.* unitVectorAtAngle dir
dir = _crDir cr
@@ -283,7 +285,6 @@ mvLaser phasev pos dir w pt
[ setDepth 19 . color (brightX 0 0.5 yellow) $ thickLine 20 (pos:ps)
, setDepth 19.5 . color (brightX 10 1 yellow) $ thickLine 3 (pos:ps)
]
aTractorBeam :: Item -> Creature -> World -> World
aTractorBeam _ cr w = w & props . at i ?~ tractorBeamAt i spos outpos dir power
where