Remove more LDTs

This commit is contained in:
2025-07-11 00:02:26 +01:00
parent ba352e7191
commit 8597f2bcc0
2 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ import Linear
import qualified Linear.Quaternion as Q import qualified Linear.Quaternion as Q
data ItemLink data ItemLink
= TriggerLink --TriggerLink
-- | AmmoInLink Int AmmoType -- | AmmoInLink Int AmmoType
-- | AmmoModLink -- | AmmoModLink
-- | AmmoTargetingLink -- | AmmoTargetingLink
@@ -31,7 +31,7 @@ data ItemLink
-- | UnderBarrelSlotLink -- | UnderBarrelSlotLink
-- | UnderBarrelPlatformLink -- | UnderBarrelPlatformLink
-- | GrenadeHitEffectLink -- | GrenadeHitEffectLink
| SFLink {_sfLink :: ItemStructuralFunction} = SFLink {_sfLink :: ItemStructuralFunction}
deriving (Eq, Ord, Show, Read) deriving (Eq, Ord, Show, Read)
data ItemStructuralFunction data ItemStructuralFunction
+10 -10
View File
@@ -688,7 +688,7 @@ loadMuzzle t@(LDT _ l _) mz = fromMaybe (t, Nothing) $ do
, Just (mz, usedammo, mag) , 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 makeMuzzleFlare mz loc cr = case mz ^. mzFlareType of
NoFlare -> id NoFlare -> id
BasicFlare -> basicMuzFlare pos dir 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) TeslaGunFlare -> cWorld . lWorld . lights .:~ LSParam (pos `v2z` 10) 100 (V3 0 0 1)
where where
(V3 x y _, q) = (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)) `Q.comp` (_mzPos mz `v2z` 0, Q.axisAngle (V3 0 0 1) (_mzRot mz))
pos = _crPos cr + rotateV (_crDir cr) (V2 x y) pos = _crPos cr + rotateV (_crDir cr) (V2 x y)
dir = _crDir cr + Q.qToAng q dir = _crDir cr + Q.qToAng q
@@ -738,13 +738,13 @@ flareCircleAt col alphax tranv =
) )
-- previous phaseV parameters: 0.2, 1, 5 -- previous phaseV parameters: 0.2, 1, 5
getLaserPhaseV :: LDTree ItemLink Item -> Float getLaserPhaseV :: DTree Item -> Float
getLaserPhaseV = const 1 getLaserPhaseV = const 1
getLaserDamage :: LDTree ItemLink Item -> LaserType getLaserDamage :: DTree Item -> LaserType
getLaserDamage = const (DamageLaser 11) getLaserDamage = const (DamageLaser 11)
getLaserColor :: LocationLDT ItemLink OItem -> Color getLaserColor :: LocationDT OItem -> Color
getLaserColor = const yellow getLaserColor = const yellow
basicMuzFlare :: Point2 -> Float -> World -> World basicMuzFlare :: Point2 -> Float -> World -> World
@@ -766,9 +766,9 @@ useLoadedAmmo ::
(Bool, World) (Bool, World)
useLoadedAmmo _ _ (cme, w) Nothing = (cme, w) useLoadedAmmo _ _ (cme, w) Nothing = (cme, w)
useLoadedAmmo loc cr (_, w) (Just (mz, x, magtree)) = (,) True $ 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 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 MuzzleTesla -> shootTeslaArc loc cr mz w
MuzzleTractor -> shootTractorBeam cr w MuzzleTractor -> shootTractorBeam cr w
MuzzleRLauncher -> createProjectileR loc magtree mz cr w MuzzleRLauncher -> createProjectileR loc magtree mz cr w
@@ -863,7 +863,7 @@ tractorBeamAt pos outpos dir power =
d = unitVectorAtAngle dir * power d = unitVectorAtAngle dir * power
creatureShootLaser :: creatureShootLaser ::
LocationLDT ItemLink OItem -> LocationDT OItem ->
Creature -> Creature ->
Muzzle -> Muzzle ->
World -> World ->
@@ -879,10 +879,10 @@ creatureShootLaser loc cr mz w =
dir dir
(getLaserColor loc) (getLaserColor loc)
where where
itmtree = loc ^. locLDT itmtree = loc ^. locDT
istree = fmap (\(i, _, _) -> i) itmtree istree = fmap (\(i, _, _) -> i) itmtree
(V3 x y _, q) = (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)) `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) pos = _crPos cr + rotateV (_crDir cr) (V2 x y)
dir = _crDir cr + Q.qToAng q + a dir = _crDir cr + Q.qToAng q + a