Replace buggy circle seg intersection with a simpler test

This commit is contained in:
2024-12-26 21:53:18 +00:00
parent 91ba6ee148
commit 0ef28c132e
29 changed files with 528 additions and 332 deletions
+8 -4
View File
@@ -237,8 +237,9 @@ heldItemSPic ht it = case ht of
TESLAGUN -> teslaGunPic
LASER -> lasGunPic it
TRACTORGUN -> tractorGunPic it
LAUNCHER -> launcherPic it
LAUNCHERX _ -> launcherPic it
RLAUNCHER -> rlauncherPic it
RLAUNCHERX _ -> rlauncherPic it
GLAUNCHER -> glauncherPic it
POISONSPRAYER -> flamerPic it
BLINKER -> defSPic
BLINKERUNSAFE -> defSPic
@@ -367,8 +368,11 @@ baseSMGShape = colorSH green $ xCylinderST 3 20
flamerPic :: Item -> SPic
flamerPic _ = noPic . colorSH yellow $ xCylinderST 5 18
launcherPic :: Item -> SPic
launcherPic _ = noPic . colorSH cyan $ xCylinderST 5 20
rlauncherPic :: Item -> SPic
rlauncherPic _ = noPic . colorSH cyan $ xCylinderST 5 20
glauncherPic :: Item -> SPic
glauncherPic _ = noPic . colorSH green $ xCylinderST 5 20
--launcherPic _ = noPic . colorSH cyan $ xCylinder 4 5 20
-- ( colorSH cyan $
+3 -3
View File
@@ -65,9 +65,9 @@ itemFromHeldType ht = case ht of
-- DUALBEAM -> dualBeam
-- LASWIDE i -> lasWide i
TRACTORGUN -> tractorGun
LAUNCHER -> launcher
LAUNCHERX i -> launcherX i
-- REMOTELAUNCHER -> remoteLauncher
RLAUNCHER -> rLauncher
GLAUNCHER -> gLauncher
RLAUNCHERX i -> rLauncherX i
POISONSPRAYER -> poisonSprayer
DETECTOR d -> detector d
FLATSHIELD -> flatShield
+15 -9
View File
@@ -9,32 +9,38 @@ import Dodge.Data.Item
import qualified IntMapHelp as IM
import Geometry.Data
launcher :: Item
launcher =
rLauncher :: Item
rLauncher =
defaultHeldItem
& itUse . heldDelay . rateMax .~ 20
& itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 0.5
& itUse . heldAim . aimStance .~ TwoHandOver
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleLauncher
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleRLauncher
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 20 0
& itAmmoSlots .~ singleAmmo LauncherAmmo
& itType .~ HELD LAUNCHER
& itType .~ HELD RLAUNCHER
& itUse . heldParams . muzVel .~ ConstFloat 0
& itUse . heldParams . rifling .~ ConstFloat 0
& itUse . heldParams . recoil .~ 0
& itUse . heldParams . torqueAfter .~ 0
& itUse . heldParams . bulGunSound ?~ (tap4S, 0)
launcherX :: Int -> Item
launcherX i =
launcher
& itType .~ HELD (LAUNCHERX i)
gLauncher :: Item
gLauncher = rLauncher
& itType .~ HELD GLAUNCHER
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleGLauncher
rLauncherX :: Int -> Item
rLauncherX i =
rLauncher
& itType .~ HELD (RLAUNCHERX i)
& itUse . heldAim . aimMuzzles .~ getZipList
(ZipList [Muzzle (V2 20 0) a 0 | a <- angles]
<*> ZipList [0..]
<*> pure NoFlare
<*> pure MuzzleLauncher
<*> pure MuzzleRLauncher
<*> pure (UseExactly 1)
<*> pure 0
)
+3 -2
View File
@@ -80,8 +80,9 @@ heldInfo hit = case hit of
TESLAGUN -> "A weapon that discharges a sustained arc of electricity. The arc will attempt to discharge at a nearby object."
LASER -> "A device that, when electrically powered, continuously emits photons in a narrow beam."
TRACTORGUN -> "An item that produces a beam of gravitons."
LAUNCHER -> "A large tube that can launch self propelled projectiles. Moving the tube after launch will cause the projectile to spin."
LAUNCHERX i -> over _head toUpper (showInt i) ++ " tubes that can launch self propelled projectiles. Tubes that do not face forward launch their projecitles at an angle."
GLAUNCHER -> "A large tube that can launch projectiles."
RLAUNCHER -> "A large tube that can launch self propelled projectiles. Moving the tube after launch will cause the projectile to spin."
RLAUNCHERX i -> over _head toUpper (showInt i) ++ " tubes that can launch self propelled projectiles. Tubes that do not face forward launch their projecitles at an angle."
-- REMOTELAUNCHER -> "A large tube that can launch self propelled projectiles. Contains a transmitter allowing for remote control of launched projectiles."
POISONSPRAYER -> "A weapon that releases noxious gases."
SHATTERGUN -> "A seismic device that shatters hard items in its line of fire."
+4 -3
View File
@@ -11,8 +11,9 @@ import Linear.V3
itInvHeight :: Item -> Int
itInvHeight x = case x ^. itType of
HELD (MINIGUNX i) -> (i + 3) `div` 2
HELD LAUNCHER -> 3
HELD LAUNCHERX{} -> 3
HELD GLAUNCHER -> 2
HELD RLAUNCHER -> 3
HELD RLAUNCHERX{} -> 3
HELD FLATSHIELD -> 3
HELD (BANGSTICK i) -> max 1 (i `div` 2)
_ -> 1
@@ -31,7 +32,7 @@ itDim x = case x ^. itType of
HELD MINIGUNX {} -> did & dimRad .~ 20
& dimCenter .~ V3 5 0 0
& dimAttachPos .~ V3 5 (-5) 0
HELD LAUNCHER -> did & dimRad .~ 9
HELD RLAUNCHER -> did & dimRad .~ 9
& dimCenter .~ V3 10 0 0
HELD BANGSTICK{} -> did
& dimRad .~ 5