Improve dual lasers
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -8,6 +8,7 @@ module Dodge.Item.Weapon.TriggerType
|
||||
, lockInvFor
|
||||
, withMuzFlareI
|
||||
, withMuzPos
|
||||
, withMuzPosShift
|
||||
, withOldDir
|
||||
, trigDoAlso
|
||||
, withTempLight
|
||||
@@ -389,10 +390,14 @@ withMuzFlareI f it cr w = makeTlsTimeRadColPos 2 100 (V3 1 1 0.5) flashPos
|
||||
cdir = _crDir cr
|
||||
|
||||
withMuzPos :: (Point3 -> World -> World) -> ChainEffect
|
||||
withMuzPos g f it cr w = g (pos `v2z` 20)
|
||||
withMuzPos = withMuzPosShift (V2 0 0)
|
||||
withMuzPosShift :: Point2 -> (Point3 -> World -> World) -> ChainEffect
|
||||
withMuzPosShift p g f it cr w = g (pos `v2z` 20)
|
||||
$ f it cr w
|
||||
where
|
||||
pos = _crPos cr +.+ aimingMuzzlePos cr it *.* unitVectorAtAngle dir
|
||||
pos = _crPos cr
|
||||
+.+ rotateV dir p
|
||||
+.+ aimingMuzzlePos cr it *.* unitVectorAtAngle dir
|
||||
dir = _crDir cr
|
||||
|
||||
{- | Applies the effect to a randomly rotated creature,
|
||||
|
||||
Reference in New Issue
Block a user