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