Partially refactor ammo extraction, work on pulse rifle

This commit is contained in:
2025-07-26 23:17:14 +01:00
parent 190068737d
commit 68a4bc7aab
16 changed files with 753 additions and 733 deletions
+7
View File
@@ -10,6 +10,7 @@ module Dodge.Item.Ammo (
megaShellMag,
megaTinMag,
megaBattery,
capacitor,
) where
import Control.Lens
@@ -65,6 +66,12 @@ battery =
& itUse .~ UseNothing
& itConsumables ?~ 10 ^ (9 :: Int)
capacitor :: Item
capacitor =
defaultHeldItem & itType .~ ATTACH CAPACITOR
& itUse .~ UseNothing
& itConsumables ?~ 0
chemFuelPouch :: Item
chemFuelPouch =
defaultHeldItem & itType .~ AMMOMAG CHEMFUELPOUCH
+2 -1
View File
@@ -89,7 +89,7 @@ showInventoryPathing = \case
RELITEM -> "HERE"
showAttachItem :: AttachType -> String
showAttachItem t = case t of
showAttachItem = \case
UNDERBARRELSLOT -> "UNDERBARRELSLOT"
ZOOMSCOPE -> "ZOOMSCOPE"
BULLETSYNTH -> "BSYNTH"
@@ -101,6 +101,7 @@ showAttachItem t = case t of
SHELLPAYLOAD x -> show x
GIMBAL -> "GIMBAL"
GYROSCOPE -> "GYROSCOPE"
CAPACITOR -> "CAPACITOR"
showEquipItem :: EquipItemType -> String
showEquipItem eit = case eit of
-1
View File
@@ -70,7 +70,6 @@ craftItemSPic = \case
. upperCylinder Small Typical 1
$ polyCirc 3 4
TIN -> colorSH green . upperPrismPolyST 3 $ rectXH 2 2
CAPACITOR -> colorSH cyan . upperPrismPolyST 3 $ rectXH 2 2
STEELDRUM ->
colorSH green
. translateSH (V3 4 0 0)
+3 -2
View File
@@ -49,6 +49,7 @@ itemBelowAttachables :: CItem -> [ItemSF]
itemBelowAttachables (itm,sf) = case (itm ^. itType, sf) of
(HELD LASER, _) -> getAmmoLinks itm <> [PulseBallSF]
(HELD TORCH, _) -> getAmmoLinks itm
(ATTACH CAPACITOR, _) -> [AmmoMagSF 0 ElectricalAmmo]
(ATTACH UNDERBARRELSLOT, _) -> [UnderBarrelPlatformSF]
(_, HeldPlatformSF) -> getAmmoLinks itm <> extraWeaponLinksBelow itm
(_, UnderBarrelPlatformSF) -> getAmmoLinks itm
@@ -129,7 +130,7 @@ itemToFunction itm = case itm ^. itType of
ATTACH SHELLPAYLOAD{} -> AmmoPayloadSF LauncherAmmo
DROPPER{} -> GadgetPlatformSF
CLICKER{} -> GadgetPlatformSF
CRAFT CAPACITOR -> CapacitorSF
ATTACH CAPACITOR -> CapacitorSF
_ -> NoSF
treeToPotentialFunction :: DTree CItem -> S.Set ItemSF
@@ -142,7 +143,7 @@ treeToPotentialFunction ldt = case ldt ^. dtValue . _1 . itType of
HELD LASER -> S.fromList [WeaponTargetingSF,LaserWeaponSF]
-- following limits items to ten ammo slots
_ | AmmoMagSF _ x <- ldt ^. dtValue . _2 -> S.fromList [AmmoMagSF i x | i <- [0..9]]
CRAFT CAPACITOR -> S.fromList [CapacitorSF,PulseBallSF]
ATTACH CAPACITOR -> S.fromList [CapacitorSF,PulseBallSF]
_ -> S.singleton (ldt ^. dtValue . _2)
baseCI :: Item -> CItem
-1
View File
@@ -182,7 +182,6 @@ craftInfo fit = case fit of
PUMP -> "A device that can create pressure."
MOTOR -> "A device that can create rotational force."
TRANSFORMER -> "A device that can step up or down voltage and current."
CAPACITOR -> "A device that stores electrical energy."
PRISM -> "An object that refracts light."
THERMOMETER -> "An object that measures temperature."
LIGHTER -> "A device that can create a small flame."