diff --git a/src/Dodge/Creature.hs b/src/Dodge/Creature.hs index f5c199bae..6f5739ced 100644 --- a/src/Dodge/Creature.hs +++ b/src/Dodge/Creature.hs @@ -160,7 +160,7 @@ inventoryX c = case c of ] "E" -> [alteRifle , tinMag - , tinMag + , drumMag ] <> fold [ makeTypeCraftNum 1 SPRING diff --git a/src/Dodge/Item/Orientation.hs b/src/Dodge/Item/Orientation.hs index d40730dfc..a4bab66fd 100644 --- a/src/Dodge/Item/Orientation.hs +++ b/src/Dodge/Item/Orientation.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE LambdaCase #-} module Dodge.Item.Orientation ( orientAttachment, propagateOrientation, @@ -36,6 +37,7 @@ orientByParentChSF itm lt = case (_itType itm, lt) of (HELD FLAMETHROWER, AmmoMagSF{}) -> (V3 4 (-6) 0, Q.qID) (HELD (VOLLEYGUN n), AmmoMagSF i _) -> (V3 2 (2.5 + fromIntegral i * 5 - (0.5 * 5 * fromIntegral n)) 3, Q.qz (pi/2)) + (HELD ALTERIFLE, AmmoMagSF i _) -> alteRifleAmmoOrient itm i (HELD _, AmmoMagSF{_amsfType = ElectricalAmmo}) -> (V3 0 0 z, Q.qID) (HELD _, AmmoMagSF{}) -> (V3 7 (itemShapeMin _y itm) 0, Q.qID) (HELD _, WeaponScopeSF) -> (V3 5 0 5, Q.qID) @@ -46,6 +48,14 @@ orientByParentChSF itm lt = case (_itType itm, lt) of y = itemShapeMaxY itm z = itemShapeMaxZ itm +alteRifleAmmoOrient :: Item -> Int -> Point3Q +alteRifleAmmoOrient itm = \case + 1 -> (V3 18 (itemShapeMin _y itm + s + 1) 0, Q.qID) + _ -> (V3 18 (itemShapeMax _y itm + s - 1) 0, Q.qz pi) + where + s | itm ^? itParams . alteRifleSwitch == Just 0 = 1 + | otherwise = (-1) + itemShapeMaxX :: Item -> Float itemShapeMaxX = itemShapeMax _1