Commit before attempting to allow for non-convex chasm shapes

This commit is contained in:
2025-10-05 15:06:19 +01:00
parent b3924fb8b8
commit 43db5a2ebc
25 changed files with 333 additions and 303 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ heldAimStance = \case
GLAUNCHER -> TwoHandUnder
POISONSPRAYER -> TwoHandUnder
SHATTERGUN -> TwoHandUnder
TORCH -> OneHand
LED -> OneHand
FLATSHIELD -> TwoHandFlat
KEYCARD {} -> OneHand
BLINKER -> OneHand
+1 -1
View File
@@ -47,7 +47,7 @@ heldItemAmmoSlots = \case
SPARKGUN -> singleAmmo ElectricalAmmo
TRACTORGUN -> singleAmmo ElectricalAmmo
SHATTERGUN -> singleAmmo ElectricalAmmo
TORCH -> singleAmmo ElectricalAmmo
LED -> singleAmmo ElectricalAmmo
BLINKERUNSAFE -> singleAmmo ElectricalAmmo
BLINKER -> singleAmmo ElectricalAmmo
RLAUNCHER -> singleAmmo LauncherAmmo
+15 -14
View File
@@ -106,7 +106,6 @@ craftItemSPic = \case
colorSH green $
upperPrismPolyST 1 (square 4)
<> upperPrismPolyST 2 (rectNSWE 4 (-4) 3 4)
LED -> colorSH yellow $ upperPrismPolyST 1 (square 2)
NAILBOX -> colorSH green $ upperPrismPolyST 3 (rectXH 4 3)
IRONBAR -> colorSH (greyN 0.5) $ upperPrismPolyST 3 $ rectXH 8 2
LIGHTSENSOR ->
@@ -250,7 +249,7 @@ backpackShape = upperPrismPolyMT 10 $ rectNSWE 5 (-5) (-4) 4
heldItemSPic :: HeldItemType -> Item -> SPic
heldItemSPic ht it = case ht of
FLATSHIELD -> flatShieldEquipSPic
TORCH -> noPic torchShape
LED -> noPic torchShape
BANGSTICK i -> noPic $ baseStickShapeX it i -- <> addBullets it
PISTOL -> noPic baseStickShape
MACHINEPISTOL -> noPic baseStickShape
@@ -291,18 +290,20 @@ heldItemSPic ht it = case ht of
KEYCARD _ -> noShape (setDepth 0 $ translate (-5) (-5) $ rotate (pi / 2.5) keyPic)
torchShape :: Shape
torchShape =
colorSH blue $
translateSHxy 0 1.5 side
<> translateSHxy 0 (-1.5) side
<> translateSHz 2.5 top
<> translateSHz (-0.5) bot
<> back
where
side = upperPrismPolySE 3 $ rectXH 10 0.5
top = upperPrismPolySE 0.5 $ rectXH 10 2
bot = upperPrismPolySE 0.5 $ rectXH 9 2
back = upperPrismPolySE 3 $ rectXH 1 2
torchShape = colorSH blue $ upperPrismPolySE 3 $ rectWH 3 3
-- side = upperPrismPolySE 3 $ rectXH 10 0.5
-- colorSH blue $
-- translateSHxy 0 1.5 side
-- <> translateSHxy 0 (-1.5) side
-- <> translateSHz 2.5 top
-- <> translateSHz (-0.5) bot
-- <> back
-- where
-- side = upperPrismPolySE 3 $ rectXH 10 0.5
-- top = upperPrismPolySE 0.5 $ rectXH 10 2
-- bot = upperPrismPolySE 0.5 $ rectXH 9 2
-- back = upperPrismPolySE 3 $ rectXH 1 2
baseStickShapeX :: Item -> Int -> Shape
baseStickShapeX _ _ = mempty
+2 -2
View File
@@ -53,7 +53,7 @@ itemBelowAttachables (itm,sf) = case (itm ^. itType, sf) of
(LASER, LaserWeaponSF) -> [PulseBallSF] <> getAmmoLinks itm
(LASER, PulseBallSF) -> [PulseBallSF]
--(HELD LASER, _) -> [PulseBallSF]
(HELD TORCH, _) -> getAmmoLinks itm
(HELD LED, _) -> getAmmoLinks itm
(ATTACH CAPACITOR, _) -> [AmmoMagSF 0 ElectricalAmmo]
(ATTACH UNDERBARRELSLOT, _) -> [UnderBarrelPlatformSF]
(_, HeldPlatformSF) -> getAmmoLinks itm <> extraWeaponLinksBelow itm
@@ -111,7 +111,7 @@ itemToFunction itm = case itm ^. itType of
ITEMSCAN -> ToggleSF
INTROSCAN {} -> IntroScanSF
LASER -> WeaponTargetingSF
HELD TORCH -> TorchSF
HELD LED -> TorchSF
HELD{} -> case itUseCondition itm of
UseableWhenAimed -> HeldPlatformSF
_ -> GadgetPlatformSF
+1 -1
View File
@@ -30,7 +30,7 @@ itemFromHeldType ht = case ht of
BLINKERUNSAFE -> unsafeBlinker
BLINKER -> blinker
KEYCARD i -> keyCard i
TORCH -> torch
LED -> led
SHATTERGUN -> shatterGun
BANGSTICK i -> bangStick i
PISTOL -> pistol
+3 -3
View File
@@ -5,7 +5,7 @@ module Dodge.Item.Held.Utility (
unsafeBlinker,
blinker,
keyCard,
torch,
led,
detector,
flatShield,
) where
@@ -20,8 +20,8 @@ flatShield = defaultHeldItem & itType .~ HELD FLATSHIELD
keyCard :: Int -> Item
keyCard n = defaultHeldItem & itType .~ HELD (KEYCARD n)
torch :: Item
torch = defaultHeldItem & itType .~ HELD TORCH
led :: Item
led = defaultHeldItem & itType .~ HELD LED
-- | Sends out pulses that display walls.
detector :: Detector -> Item
+1 -1
View File
@@ -124,7 +124,7 @@ heldHandlePos = \case
GLAUNCHER -> V2 3 0
POISONSPRAYER -> V2 3 0
SHATTERGUN -> V2 3 0
TORCH -> V2 3 0
LED -> V2 3 0
FLATSHIELD -> V2 3 0
KEYCARD{} -> V2 3 0
BLINKER -> V2 3 0
+1 -2
View File
@@ -131,7 +131,7 @@ heldInfo hit = case hit of
POISONSPRAYER -> "A weapon that releases noxious gases."
SHATTERGUN -> "A seismic device that shatters hard items in its line of fire."
-- FORCEFIELDGUN -> "A device that produces a durable forcefield."
TORCH -> "A stick with a light on the end."
LED -> "A light emitting diode."
FLATSHIELD -> "A panel of metal that blocks unwanted objects from the front of the user."
KEYCARD i -> "A keycard. It is labelled " ++ show i ++ "."
TIMESTOPPER -> "A device that temporarily pauses time."
@@ -196,7 +196,6 @@ craftInfo fit = case fit of
AIUNIT -> "A general purpose artificial intelligence unit."
CAMERA -> "A device designed to capture light signals."
MINIDISPLAY -> "A device designed to display pictures."
LED -> "A light emitting diode."
NAILBOX -> "A box of wood fastenings."
IRONBAR -> "A rigid piece of metal."
LIGHTSENSOR -> "A device that detects photons."
+1 -1
View File
@@ -12,7 +12,7 @@ import qualified Quaternion as Q
orientChild :: Item -> Point3Q
orientChild itm = case _itType itm of
HELD TORCH -> (V3 0 5 0, Q.qID)
HELD LED -> (V3 0 5 0, Q.qID)
--HELD LASER -> (V3 15 (-5) 0, Q.qID)
LASER -> (V3 15 (-5) 0, Q.qID)
ATTACH UNDERBARRELSLOT -> (V3 10 (-8) 0, r)