Improve dual lasers

This commit is contained in:
2022-04-06 13:42:35 +01:00
parent 396146f3b4
commit bd255d2e54
5 changed files with 25 additions and 15 deletions
+9 -8
View File
@@ -212,11 +212,13 @@ lasGunDual :: Item
lasGunDual = lasGun
& itName .~ "DUALAS"
& itType .~ LASGUNDUAL
& itParams . lasColor .~ red
& itParams . lasColor .~ orange
& itParams . lasColor2 .~ blue
& itUse .~ (ruseInstant shootDualLaser NoHammer
[ ammoCheckI
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
-- , withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, withItem $ \it -> withMuzPosShift (V2 0 10) $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withItem $ \it -> withMuzPosShift (V2 0 (-10)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8
, withSoundForI tone440sawtoothquietS 2
, useAmmoAmount 1
]
@@ -266,6 +268,7 @@ lasGun = defaultAutoBatteryGun
, _itParams = Refracting
{ _phaseV = 1
, _lasColor = yellow
, _lasColor2 = yellow
, _lasCycle = 0
, _lasDamage = 11
}
@@ -434,8 +437,8 @@ shootLaser it cr = instantParticles .:~ lasRayAt (_lasColor $ _itParams it) dam
shootDualLaser :: Item -> Creature -> World -> World
shootDualLaser it cr w = w
& newBeams . positronBeams .:~ dualRayAt w orange dam phasev posl dirl
& newBeams . electronBeams .:~ dualRayAtNoFlame w blue dam phasev posr dirr
& newBeams . positronBeams .:~ dualRayAt w (_lasColor $ _itParams it) dam phasev posl dirl
& newBeams . electronBeams .:~ dualRayAtNoFlame w (_lasColor2 $ _itParams it) dam phasev posr dirr
where
dir = _crDir cr
pos = _crPos cr +.+ aimlength *.* unitVectorAtAngle dir
@@ -474,7 +477,6 @@ dualRayAt w col dam phasev pos dir = Beam
, _bmFirstPoints = []
, _bmType = BeamCombine
$ \(p,(a,b,_),(x,y,_)) -> makeFlame p (2 *.* normalizeV (normalizeV (b-.-a)+.+normalizeV (y-.-x)))
-- $ \(p,(a,b,_),(x,y,_)) -> makeFlame p (V2 5 0)
}
where
(_,ps) = reflectLaserAlong phasev [] pos (pos +.+ 800 *.* unitVectorAtAngle dir) w
@@ -493,8 +495,7 @@ dualRayAtNoFlame w col dam phasev pos dir = Beam
, _bmPoints = pos:ps
, _bmFirstPoints = []
, _bmType = BeamCombine
$ \_ -> id
-- $ \(p,(a,b,_),(x,y,_)) -> makeFlame p (V2 5 0)
$ const id
}
where
(_,ps) = reflectLaserAlong phasev [] pos (pos +.+ 800 *.* unitVectorAtAngle dir) w