Remove more LDTs
This commit is contained in:
@@ -12,7 +12,7 @@ import Linear
|
||||
import qualified Linear.Quaternion as Q
|
||||
|
||||
data ItemLink
|
||||
= TriggerLink
|
||||
--TriggerLink
|
||||
-- | AmmoInLink Int AmmoType
|
||||
-- | AmmoModLink
|
||||
-- | AmmoTargetingLink
|
||||
@@ -31,7 +31,7 @@ data ItemLink
|
||||
-- | UnderBarrelSlotLink
|
||||
-- | UnderBarrelPlatformLink
|
||||
-- | GrenadeHitEffectLink
|
||||
| SFLink {_sfLink :: ItemStructuralFunction}
|
||||
= SFLink {_sfLink :: ItemStructuralFunction}
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data ItemStructuralFunction
|
||||
|
||||
+10
-10
@@ -688,7 +688,7 @@ loadMuzzle t@(LDT _ l _) mz = fromMaybe (t, Nothing) $ do
|
||||
, Just (mz, usedammo, mag)
|
||||
)
|
||||
|
||||
makeMuzzleFlare :: Muzzle -> LocationLDT ItemLink OItem -> Creature -> World -> World
|
||||
makeMuzzleFlare :: Muzzle -> LocationDT OItem -> Creature -> World -> World
|
||||
makeMuzzleFlare mz loc cr = case mz ^. mzFlareType of
|
||||
NoFlare -> id
|
||||
BasicFlare -> basicMuzFlare pos dir
|
||||
@@ -705,7 +705,7 @@ makeMuzzleFlare mz loc cr = case mz ^. mzFlareType of
|
||||
TeslaGunFlare -> cWorld . lWorld . lights .:~ LSParam (pos `v2z` 10) 100 (V3 0 0 1)
|
||||
where
|
||||
(V3 x y _, q) =
|
||||
locOrient (locLDTToLocDT loc) cr
|
||||
locOrient loc cr
|
||||
`Q.comp` (_mzPos mz `v2z` 0, Q.axisAngle (V3 0 0 1) (_mzRot mz))
|
||||
pos = _crPos cr + rotateV (_crDir cr) (V2 x y)
|
||||
dir = _crDir cr + Q.qToAng q
|
||||
@@ -738,13 +738,13 @@ flareCircleAt col alphax tranv =
|
||||
)
|
||||
|
||||
-- previous phaseV parameters: 0.2, 1, 5
|
||||
getLaserPhaseV :: LDTree ItemLink Item -> Float
|
||||
getLaserPhaseV :: DTree Item -> Float
|
||||
getLaserPhaseV = const 1
|
||||
|
||||
getLaserDamage :: LDTree ItemLink Item -> LaserType
|
||||
getLaserDamage :: DTree Item -> LaserType
|
||||
getLaserDamage = const (DamageLaser 11)
|
||||
|
||||
getLaserColor :: LocationLDT ItemLink OItem -> Color
|
||||
getLaserColor :: LocationDT OItem -> Color
|
||||
getLaserColor = const yellow
|
||||
|
||||
basicMuzFlare :: Point2 -> Float -> World -> World
|
||||
@@ -766,9 +766,9 @@ useLoadedAmmo ::
|
||||
(Bool, World)
|
||||
useLoadedAmmo _ _ (cme, w) Nothing = (cme, w)
|
||||
useLoadedAmmo loc cr (_, w) (Just (mz, x, magtree)) = (,) True $
|
||||
removeAmmoFromMag x mid cr . makeMuzzleFlare mz loc cr $ case _mzEffect mz of
|
||||
removeAmmoFromMag x mid cr . makeMuzzleFlare mz (locLDTToLocDT loc) cr $ case _mzEffect mz of
|
||||
MuzzleShootBullet -> shootBullets loc cr (mz, x, magtree) w
|
||||
MuzzleLaser -> creatureShootLaser loc cr mz w
|
||||
MuzzleLaser -> creatureShootLaser (locLDTToLocDT loc) cr mz w
|
||||
MuzzleTesla -> shootTeslaArc loc cr mz w
|
||||
MuzzleTractor -> shootTractorBeam cr w
|
||||
MuzzleRLauncher -> createProjectileR loc magtree mz cr w
|
||||
@@ -863,7 +863,7 @@ tractorBeamAt pos outpos dir power =
|
||||
d = unitVectorAtAngle dir * power
|
||||
|
||||
creatureShootLaser ::
|
||||
LocationLDT ItemLink OItem ->
|
||||
LocationDT OItem ->
|
||||
Creature ->
|
||||
Muzzle ->
|
||||
World ->
|
||||
@@ -879,10 +879,10 @@ creatureShootLaser loc cr mz w =
|
||||
dir
|
||||
(getLaserColor loc)
|
||||
where
|
||||
itmtree = loc ^. locLDT
|
||||
itmtree = loc ^. locDT
|
||||
istree = fmap (\(i, _, _) -> i) itmtree
|
||||
(V3 x y _, q) =
|
||||
locOrient (locLDTToLocDT loc) cr
|
||||
locOrient loc cr
|
||||
`Q.comp` ((_mzPos mz + V2 0 offset) `v2z` 0, Q.axisAngle (V3 0 0 1) (_mzRot mz))
|
||||
pos = _crPos cr + rotateV (_crDir cr) (V2 x y)
|
||||
dir = _crDir cr + Q.qToAng q + a
|
||||
|
||||
Reference in New Issue
Block a user