Tweak bullet magazines

This commit is contained in:
2025-10-03 12:33:28 +01:00
parent 4d1d2f36bc
commit a8348a3515
6 changed files with 12 additions and 11 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -145,7 +145,7 @@ craftItemSPic = \case
ammoMagSPic :: Item -> AmmoMagType -> SPic
ammoMagSPic it = \case
--TINMAG -> noPic $ upperPrismPolyTS 1 (rectNSWE 0 (- (am * 5)) (-1) 1)
TINMAG -> noPic $ colorSH yellow $ upperPrismPolyTS 4 (rectNSWE 0 (-6) (-2) 2)
TINMAG -> noPic $ colorSH yellow $ upperBox Small Typical 4 (rectWH 2 3)
--DRUMMAG -> noPic $ colorSH yellow $ upperPrismPolyTS 1 (rectNSWE 0 (- (am * 15)) (-1) 1)
DRUMMAG -> noPic . colorSH yellow $ upperBox Small Typical 4 (polyCirc 3 4)
--DRUMMAG -> noPic $ colorSH yellow $ upperPrismPolyTS 2 (polyCirc 3 5)
+2 -2
View File
@@ -219,7 +219,7 @@ invDT =
. fmap (singleDT . baseCI)
invDT' :: NewIntMap InvInt Item -> [DTree OItem]
invDT' = fmap propagateOrientation' . invDT
invDT' = fmap propagateOrientation . invDT
-- this assumes the creature inventory is well formed, specifically the
-- location ids
@@ -243,7 +243,7 @@ invAdj = IM.unions . map g . invDT
---- returns an intmap with trees for (only!) root items, indexed by inventory position
invIMDT :: NewIntMap InvInt Item -> IM.IntMap (DTree OItem)
invIMDT = fmap propagateOrientation' . IM.fromDistinctAscList . reverse . map getid . invDT
invIMDT = fmap propagateOrientation . IM.fromDistinctAscList . reverse . map getid . invDT
where
getid :: DTree CItem -> (Int, DTree CItem)
getid t = (t ^?! dtValue . _1 . itLocation . ilInvID . unNInt, t)
+2 -2
View File
@@ -7,8 +7,8 @@ maxAmmo :: Item -> Maybe Int
maxAmmo itm = case itm ^. itType of
EQUIP BATTERYPACK -> Just $ 10 ^ (9 :: Int)
AMMOMAG BATTERY -> Just $ 10 ^ (6 :: Int)
AMMOMAG TINMAG -> Just 15
AMMOMAG DRUMMAG -> Just 30
AMMOMAG TINMAG -> Just 30
AMMOMAG DRUMMAG -> Just 90
AMMOMAG BELTMAG -> Just 90
AMMOMAG CHEMFUELPOUCH -> Just $ 10 ^ (6 :: Int)
AMMOMAG SHELLMAG -> Just 1
+4 -4
View File
@@ -1,6 +1,6 @@
module Dodge.Item.Orientation (
orientAttachment,
propagateOrientation',
propagateOrientation,
) where
import Dodge.Data.ComposedItem
@@ -24,7 +24,7 @@ orientChild itm = case _itType itm of
orientByParentChSF :: Item -> ItemSF -> Point3Q
orientByParentChSF itm lt = case (_itType itm, lt) of
(HELD FLAMETHROWER, AmmoMagSF{}) -> (V3 4 (-6) 0, Q.qID)
(HELD _, AmmoMagSF{}) -> (V3 7 (-2) 0, Q.qID)
(HELD _, AmmoMagSF{}) -> (V3 7 (-4) 0, Q.qID)
(HELD _, WeaponScopeSF) -> (V3 5 0 5, Q.qID)
_ -> (0, Q.qID)
@@ -39,8 +39,8 @@ orientAttachment par (ch,chsf) = case (_itType par, chsf) of
(t1, q1) = orientByParentChSF par chsf
(t2, q2) = orientChild ch
propagateOrientation' :: DTree CItem -> DTree OItem
propagateOrientation' = dtStartPropagate g f
propagateOrientation :: DTree CItem -> DTree OItem
propagateOrientation = dtStartPropagate g f
where
g (x,y) = (x,y,(V3 0 0 0,Q.qID))
f (x,_,pq) (y,y1) = (y,y1,Q.comp pq $ orientAttachment x (y,y1))
+2 -1
View File
@@ -246,7 +246,8 @@ tutHub = do
=<< roomNgon 6 100
bcor <- treeAttachDeep (return door) <$> blockedCorridor
r1 <- r burstRifle <&> rmPmnts .:~ t
r2 <- r (drumMag & itConsumables ?~ 500)
r2 <- r (drumMag & itConsumables ?~ 90)
--r2 <- r (tinMag & itConsumables ?~ 500)
return $
tToBTree "DoorTest" $
Node