Add check to cylinder segment collision, break rocket projectiles

This commit is contained in:
2025-10-12 00:26:48 +01:00
parent 8245115763
commit 33de1f79b6
9 changed files with 147 additions and 91 deletions
+12 -1
View File
@@ -732,7 +732,8 @@ useLoadedAmmo loc cr mz m w =
MuzzleRLauncher -> createProjectileR loc magtree mz cr w
MuzzleGLauncher ->
createProjectile
(itmtree ^. dtValue . _3)
pq
-- (itmtree ^. dtValue . _3)
(Grenade (getGrenadeHitEffect itmtree))
magtree
(getPJStabiliser itmtree)
@@ -754,11 +755,21 @@ useLoadedAmmo loc cr mz m w =
MuzzleStopper -> useStopWatch itm cr w
MuzzleScroller -> useTimeScrollGun itm cr w
where
pq = muzzlePos loc cr mz
itmtree = loc ^. locDT
mitid = magtree ^. dtValue . _1 . itID
itm = itmtree ^. dtValue . _1
(x, magtree) = fromJust m
muzzlePos :: LocationDT OItem -> Creature -> Muzzle -> Point3Q
muzzlePos m cr muz = (p1,q1) `Q.comp` pq `Q.comp` (p3,q3)
where
pq = locOrient m cr
p1 = cr ^. crPos
q1 = Q.qz $ cr ^. crDir
p3 = addZ 0 $ muz ^. mzPos
q3 = Q.qz $ muz ^. mzRot
getAttachedSFLink :: ItemSF -> DTree OItem -> Maybe (NewInt ItmInt)
getAttachedSFLink sf = (^? dtRight . folding (find f) . dtValue . _1 . itID)
where