Add alteRifle

This commit is contained in:
2024-12-23 10:53:35 +00:00
parent 34c7186aa1
commit a4e1fcf384
11 changed files with 271 additions and 240 deletions
+2
View File
@@ -253,6 +253,8 @@ inventoryX c = case c of
, zoomScope
, augmentedHUD
, autoRifle
, alteRifle
, megaTinMag 10200
, megaTinMag 10200
] <>
[bulletTargetingModule btt | btt <- [minBound .. maxBound]]
+1
View File
@@ -127,6 +127,7 @@ data HeldItemType
| MINIGUNX {_xNum :: Int}
| VOLLEYGUN {_xNum :: Int}
| RIFLE
| ALTERIFLE
| AUTORIFLE
| BURSTRIFLE
| BANGROD
+1
View File
@@ -52,6 +52,7 @@ data ItemUse
data HeldUseEffect
= NoHeldUseEffect
| RandomiseMuzzleFrames Int
| SwitchAlteRifle
deriving (Eq, Show, Read)
data UseFocus
+4
View File
@@ -99,6 +99,10 @@ doHeldUseEffect t cr w = case t ^? ldtValue . itUse . heldUseEffect of
(is,g') = runState (shuffle [0..x-1]) g
return $ w & cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix i . itUse . heldAim . aimMuzzles %~ zipWith (\j mz -> mz & mzFrame .~ j) is
& randGen .~ g'
Just SwitchAlteRifle -> fromMaybe w $ do
i <- t ^? ldtValue . itLocation . ilInvID
return $ w & cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix i
. itUse . heldAim . aimMuzzles . ix 0 . mzAmmoSlot %~ ((`mod` 2) . (+1))
Just NoHeldUseEffect -> w
Nothing -> w
+10 -1
View File
@@ -15,7 +15,12 @@ import ShortShow
itemDisplay :: Creature -> ComposedItem -> [String]
itemDisplay cr ci =
zipWithDefaults id (leftPad 15 ' ') itemDisplayPad (basicItemDisplay itm) (itemNumberDisplay cr ci)
zipWithDefaults
id
(leftPad 15 ' ')
itemDisplayPad
(basicItemDisplay itm)
(itemNumberDisplay cr ci)
where
itm = ci ^. _1
@@ -78,6 +83,10 @@ itemNumberDisplay :: Creature -> ComposedItem -> [String]
itemNumberDisplay cr ci
| EQUIP WRIST_ECG <- ci ^. _1 . itType =
[displayPulse $ cr ^?! crType . avatarPulse . pulseProgress]
| HELD ALTERIFLE <- ci ^. _1 . itType =
case ci ^? _1 . itUse . heldAim . aimMuzzles . ix 0 . mzAmmoSlot of
Just 0 -> ["/"]
_ -> ["\\"]
| isJust $ ci ^? _1 . itTargeting . itTgPos . _Just =
["!TARG!"]
| Just x <- ci ^? _1 . itConsumables . magLoadStatus . iaLoaded = [shortShow x]
+6 -5
View File
@@ -56,7 +56,7 @@ craftItemSPic = \case
STEELDRUM -> colorSH green
. translateSH (V3 4 0 0) . upperCylinder Small Typical 1 $ polyCirc 4 8
PLANK -> colorSH orange $ upperPrismPolyST 3 $ rectXH 8 2
GLASSSHARD -> colorSH azure $ upperPrismPolyST 1 $ [V2 0 (-1), V2 4 (-0.5), V2 0 1]
GLASSSHARD -> colorSH azure $ upperPrismPolyST 1 [V2 0 (-1), V2 4 (-0.5), V2 0 1]
SCRAPMETAL -> colorSH (greyN 0.3) $ upperPrismPolyST 3 $ square 4
PUMP -> colorSH yellow . translateSH (V3 4 0 0) $
(upperCylinder Small Typical 1 $ polyCirc 4 4)
@@ -64,11 +64,11 @@ craftItemSPic = \case
<> upperPrismPolyST 1 (rectNSWE 4 2 0 (-4))
MOTOR -> colorSH orange $ xCylinderST 5 3 <> xCylinderST 3 5
TRANSFORMER -> colorSH blue $ upperPrismPolyST 3 $ square 4
PRISM -> colorSH azure $ upperPrismPolyST 1 $ [V2 0 (-3), V2 4 0, V2 0 3]
PRISM -> colorSH azure $ upperPrismPolyST 1 [V2 0 (-3), V2 4 0, V2 0 3]
LIGHTER -> colorSH yellow . upperPrismPolyST 3 $ rectXH 2 2
MAGNET -> colorSH red (upperPrismPolyST 1 (rectNSWE (2) (-2) 2 0))
<> colorSH (greyN 0.5) (upperPrismPolyST 1 (rectNSWE (2) (-2) 4 2))
<> colorSH blue (upperPrismPolyST 1 (rectNSWE (2) (-2) 6 4))
MAGNET -> colorSH red (upperPrismPolyST 1 (rectNSWE 2 (-2) 2 0))
<> colorSH (greyN 0.5) (upperPrismPolyST 1 (rectNSWE 2 (-2) 4 2))
<> colorSH blue (upperPrismPolyST 1 (rectNSWE 2 (-2) 6 4))
ANTIMATTER -> colorSH violet $ upperPrismPolyST 3 $ square 4
PLATE -> colorSH green $ upperPrismPolyST 8 $ rectXH 2 5
TRANSMITTER -> colorSH green $
@@ -220,6 +220,7 @@ heldItemSPic ht it = case ht of
MINIGUNX i -> miniGunXPictItem i it
VOLLEYGUN i -> noPic $ volleyGunShape i -- <> addBullets it
RIFLE -> noPic baseRifleShape -- <> addBullets it
ALTERIFLE -> noPic baseRifleShape -- <> addBullets it
AUTORIFLE -> noPic baseRifleShape
BURSTRIFLE -> noPic baseRifleShape
BANGROD -> noPic baseRodShape -- <> addBullets it
+1
View File
@@ -43,6 +43,7 @@ itemFromHeldType ht = case ht of
MINIGUNX i -> miniGunX i
VOLLEYGUN i -> volleyGun i
RIFLE -> rifle
ALTERIFLE -> alteRifle
-- REPEATER -> repeater
AUTORIFLE -> autoRifle
BURSTRIFLE -> burstRifle
+8 -1
View File
@@ -1,5 +1,6 @@
module Dodge.Item.Held.Cane (
volleyGun,
alteRifle,
rifle,
autoRifle,
burstRifle,
@@ -49,7 +50,7 @@ volleyGun i =
& itType .~ HELD (VOLLEYGUN i)
& itAmmoSlots .~ IM.fromList (zip [0..i-1] $ repeat BulletAmmo)
& itUse . heldParams . weaponRepeat .~ [1..i-1]
& itUse . heldUseEffect .~ (RandomiseMuzzleFrames i)
& itUse . heldUseEffect .~ RandomiseMuzzleFrames i
rifle :: Item
rifle =
@@ -61,6 +62,12 @@ rifle =
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 25 0
alteRifle :: Item
alteRifle = rifle
& itType .~ HELD ALTERIFLE
& itUse . heldUseEffect .~ SwitchAlteRifle
& itAmmoSlots .~ IM.fromList (zip [0..1] $ repeat BulletAmmo)
--repeater :: Item
--repeater =
-- rifle
+1
View File
@@ -63,6 +63,7 @@ heldInfo hit = case hit of
RIFLE -> "A firearm with a mid length barrel that requires reloading after each shot."
-- REPEATER -> "A firearm fed by a magazine. The entire magazine must be replaced when reloading the weapon."
AUTORIFLE -> "A firearm automatically fed by a magazine. The entire magazine must be replaced when reloading the weapon."
ALTERIFLE -> "A firearm with a mid length barrel that requires reloading after each shot. Alternates between two magazines."
BURSTRIFLE -> "A firearm that rapidly fires three projectiles from its magazine. The entire magazine must be replaced when reloading the weapon."
BANGROD -> "A firearm with a long barrel that requires reloading after each shot."
ELEPHANTGUN -> "A firearm with a long barrel that requires reloading after each shot. Its stopping power is only nominal."
+2 -2
View File
@@ -231,7 +231,7 @@ scrollTimeBack w = case w ^? pastWorlds . _head of
--i <- w ^? timeFlow . scrollItemID . unNInt
_ <- w ^? timeFlow . scrollItemID . unNInt
-- let pointituse = pointerToItemLocation (w ^?! cWorld . lWorld . itemLocations . ix i) . itUse
return $ id
return id
-- (pointituse . leftConsumption . wpCharge .~ (x -1))
-- . (pointituse . leftHammer .~ HammerDown)
@@ -249,7 +249,7 @@ scrollTimeForward w = case w ^? timeFlow . futureWorlds . _head of
mupdateitem = fromMaybe id $ do
--i <- w ^? timeFlow . scrollItemID . unNInt
_ <- w ^? timeFlow . scrollItemID . unNInt
return $ id -- pointerToItemLocation (w ^?! cWorld . lWorld . itemLocations . ix i) . itUse . leftConsumption . wpCharge .~ ramount
return id -- pointerToItemLocation (w ^?! cWorld . lWorld . itemLocations . ix i) . itUse . leftConsumption . wpCharge .~ ramount
-- | The update step.
functionalUpdate :: Universe -> Universe
+235 -231
View File
File diff suppressed because it is too large Load Diff