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
+1 -2
View File
@@ -204,8 +204,7 @@ useGasParams nz it cr = _amCreateGas (_aoType (_itConsumption it)) (_nzPressure
pos = _crPos cr +.+ (_nzLength nz *.* unitVectorAtAngle (_crDir cr))
aFlame :: Float -> Point2 -> Float -> Creature -> World -> World
aFlame pressure pos dir cr w = w & particles .:~ aFlameParticle t pos vel (Just cid)
aFlame pressure pos dir cr w = w & instantParticles .:~ aFlameParticle t pos vel (Just $ _crID cr)
where
(t,_) = randomR (99,101) (_randGen w)
cid = _crID cr
vel = (_crPos cr -.- _crOldPos cr) +.+ pressure *.* unitVectorAtAngle dir
+4 -6
View File
@@ -3,20 +3,18 @@ Effects centered on creatures.
These are typically item effects, and typical occur when an item is explictly used. -}
module Dodge.Item.Weapon.UseEffect where
import Dodge.Data
--import Dodge.Zone
--import Dodge.Picture.Layer
import Picture
import Geometry
import LensHelp
import Data.Maybe
import Control.Lens
import qualified Data.IntMap.Strict as IM
{- | Creates an outwardly increasing circle that draws creatures, even those behind walls. -}
aSonarPulse :: Creature -> World -> World
aSonarPulse cr = over particles (sonarPulseAt (_crPos cr) :)
aSonarPulse cr = instantParticles .:~ sonarPulseAt (_crPos cr)
{- | Creates an outwardly increasing circle that displays walls, even those behind other walls. -}
aRadarPulse :: Creature -> World -> World
aRadarPulse cr = over particles (radarPulseAt (_crPos cr) :)
aRadarPulse cr = instantParticles .:~ radarPulseAt (_crPos cr)
{- | Radar blip at a point. -}
blipAt :: Point2 -> Color -> Int -> Particle
blipAt p col i = Particle
@@ -84,7 +82,7 @@ mvRadar _ _ w _ = (w, Nothing)
-- )
-- where
-- pic = onLayerL [levLayer ShadowLayer, 1] $ pictures sweepPics
-- putBlips = over worldEvents ( over particles (blips ++) . )
-- putBlips = over worldEvents ( over instantParticles (blips ++) . )
-- blips = map (\bp -> blipAt bp (withAlpha (0.5*globalAlpha) red) 50) circPoints
-- circPoints = mapMaybe (\wl -> uncurry collidePointCircCorrect (_wlLine wl) r p)
-- $ map (over wlLine swp) (IM.elems $ wallsAlongCirc p r w)