Continue weapon effect chain refactor

This commit is contained in:
2024-09-16 19:27:21 +01:00
parent abc0dd1106
commit 1d1d1527e7
19 changed files with 358 additions and 340 deletions
+4 -4
View File
@@ -67,9 +67,9 @@ itemCombinations =
, po [HELD BLUNDERBUSS, cr STEELDRUM] (grapeCannon 1)
, po [HELD (BANGSTICK 1), cr PLANK] rifle
, po [HELD (BANGSTICK 1), HELD (BANGSTICK 1), HELD (BANGSTICK 1)] (volleyGun 3)
, po [HELD RIFLE, cr TIN] repeater
, po [HELD REPEATER, cr SPRING] autoRifle
, po [HELD REPEATER, cr CAN] burstRifle
-- , po [HELD RIFLE, cr TIN] repeater
, po [HELD RIFLE, cr SPRING] autoRifle
, po [HELD RIFLE, cr CAN] burstRifle
]
++ [ po [cr MOTOR, HELD (VOLLEYGUN i)] $ miniGunX i | i <- [3 .. 10]
]
@@ -255,7 +255,7 @@ bulletWeapons =
, smg
, machinePistol
, rifle
, repeater
-- , repeater
, autoRifle
, burstRifle
, bangCone
+3
View File
@@ -269,6 +269,9 @@ testInventory =
stackedInventory :: [Item]
stackedInventory =
[ burstRifle
, volleyGun 3
, tinMag
, tinMag
, tinMag
, bulletSynthesizer
, drumMag
+1 -1
View File
@@ -170,7 +170,7 @@ data HeldItemType
| VOLLEYGUN {_xNum :: Int}
| MULTIGUN {_xNum :: Int}
| RIFLE
| REPEATER
-- | REPEATER
| AUTORIFLE
| BURSTRIFLE
| BANGROD
+5 -5
View File
@@ -81,10 +81,10 @@ data HeldMod
-- | AmmoCheckMod
-- | AmmoUseCheckMod
-- | AmmoHammerTimeUseOneMod
| BangCaneMod
-- | BangCaneMod
| VolleyGunMod
| MultiGunMod
| AutoRifleMod
-- | AutoRifleMod
| BangRodMod
| ElephantGunMod
| AutoAmrMod
@@ -92,12 +92,12 @@ data HeldMod
-- | ModWithDirectedTeleport HeldMod
| BangStickMod
| PistolMod
| AutoPistolMod
| MachinePistolMod
-- | AutoPistolMod
-- | MachinePistolMod
| BurstRifleMod
| BurstRifleRepeatMod
| MiniGunMod Int
| SmgMod
-- | SmgMod
| BangConeMod
| TractorMod --apply with AmmoCheckMod
| FireRemoteShellMod
+1
View File
@@ -125,6 +125,7 @@ data AimParams = AimParams
data FlareType = DefaultFlareType
| PistolFlare
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data Muzzle = Muzzle
+1
View File
@@ -48,6 +48,7 @@ singleAmmo x = IM.insert 0 x mempty
defaultBulletWeapon :: Item
defaultBulletWeapon =
defaultWeapon
& itUse . heldMods .~ PistolMod
& itUse . heldAmmoTypes .~ singleAmmo BulletAmmo
-- & itUse . heldUse .~ HeldUseAmmoParams -- useAmmoParams
& itType . iyModules . at ModBulletCollision ?~ EMPTYMODULE
+144 -129
View File
@@ -1,5 +1,11 @@
module Dodge.HeldUse where
module Dodge.HeldUse
-- ( heldEffect
-- , mcUseHeld
-- )
where
import Dodge.WorldEvent.Cloud
import Dodge.LightSource
import qualified SDL
import Dodge.Base.You
import Dodge.Data.MuzzleEffect
@@ -120,18 +126,18 @@ heldEffect effecttype = case effecttype of
, ammoCheckI
, blCheck
]
BangCaneMod -> bulletGunEffect
[ withFlare
, withSmoke 1 black 20 200 5
, withRecoil
, duplicateLoadedBarrels
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart tap3S
, useTimeCheck
, ammoCheckI
, blCheck
]
-- BangCaneMod -> bulletGunEffect
-- [ withFlare
-- , withSmoke 1 black 20 200 5
-- , withRecoil
-- , duplicateLoadedBarrels
-- , withTorqueAfter
-- , useAmmoAmount 1
-- , withSoundStart tap3S
-- , useTimeCheck
-- , ammoCheckI
-- , blCheck
-- ]
VolleyGunMod -> bulletGunEffect
[ withRecoil
, withFlare
@@ -154,18 +160,18 @@ heldEffect effecttype = case effecttype of
, ammoCheckI
, blCheck
]
AutoRifleMod -> bulletGunEffect
-- note this is the same as BangCanemMod with the first changed
[ withFlare
, withSmoke 1 black 20 200 5
, withRecoil
, duplicateLoadedBarrels
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart tap3S
, useTimeCheck
, ammoCheckI
]
-- AutoRifleMod -> bulletGunEffect
-- -- note this is the same as BangCanemMod with the first changed
-- [ withFlare
-- , withSmoke 1 black 20 200 5
-- , withRecoil
-- , duplicateLoadedBarrels
-- , withTorqueAfter
-- , useAmmoAmount 1
-- , withSoundStart tap3S
-- , useTimeCheck
-- , ammoCheckI
-- ]
BangRodMod -> bulletGunEffect
[ withRecoil
, withFlare
@@ -220,40 +226,28 @@ heldEffect effecttype = case effecttype of
, blCheck
]
PistolMod -> bulGunEffect
-- bulletGunEffect
-- [ withSidePushI 50
-- AutoPistolMod -> bulletGunEffect
-- [ withFlare
-- , withSidePushI 50
-- , withRecoil
-- , withFlare
-- , withTorqueAfter
-- , duplicateLoadedBarrels
-- , withSoundStart tap3S
-- , useAmmoAmount 1
-- , useTimeCheck
-- , ammoCheckI
-- , blCheck
-- ]
AutoPistolMod -> bulletGunEffect
[ withFlare
, withSidePushI 50
, withRecoil
, withTorqueAfter
, duplicateLoadedBarrels
, withSoundStart tap3S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
]
MachinePistolMod -> bulletGunEffect
[ withFlare
, withRecoil
, withSidePushI 50
, withTorqueAfter
, duplicateLoadedBarrels
, withSoundStart tap1S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
]
-- MachinePistolMod -> bulletGunEffect
-- [ withFlare
-- , withRecoil
-- , withSidePushI 50
-- , withTorqueAfter
-- , duplicateLoadedBarrels
-- , withSoundStart tap1S
-- , useAmmoAmount 1
-- , useTimeCheck
-- , ammoCheckI
-- ]
BurstRifleMod -> bulletGunEffect
[ withRecoil
, withFlare
@@ -292,17 +286,17 @@ heldEffect effecttype = case effecttype of
, withWarmUp crankSlowS
, ammoCheckI
]
SmgMod -> bulletGunEffect
[ withFlare
, withSidePushI 30
, withRecoil
, withTorqueAfter
, duplicateLoadedBarrels
, withSoundStart tap3S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
]
-- SmgMod -> bulletGunEffect
-- [ withFlare
-- , withSidePushI 30
-- , withRecoil
-- , withTorqueAfter
-- , duplicateLoadedBarrels
-- , withSoundStart tap3S
-- , useAmmoAmount 1
-- , useTimeCheck
-- , ammoCheckI
-- ]
BangConeMod -> bulletGunEffect
[ withRandomItem coneRandItemParams
, withRandomItemUpdate coneRandItemUpdate
@@ -361,15 +355,28 @@ bulGunEffect' :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> Wo
bulGunEffect' t cr w = fromMaybe (error "error in bulGunEffect") $ do
muzzles <- t ^? ldtValue . itUse . heldAim . aimMuzzles
let (_,loadedmuzzles) = mapAccumR loadMuzzle t muzzles
cmew = foldl' (useLoadedAmmo (_ldtValue t) cr) (CME 0 0 False,w) loadedmuzzles
-- let (_,loadedmuzzles) = ((),[])
--cmew = foldl' (useLoadedAmmo (_ldtValue t) cr) (CME 0 0 False,w) loadedmuzzles
cmew = foldl' (useLoadedAmmo (_ldtValue t) cr) (CME 0 0 False,w) $ loadedmuzzles
return $ uncurry (applyCME (_ldtValue t) cr) cmew
-- return $ snd cmew
applyCME :: Item -> Creature -> CumulativeMuzzleEffect -> World -> World
applyCME itm cr cme
| _cmeSound cme = applySidePush spush cr . applyTorqueCME itm cr . applyRecoil itm cr
| otherwise = id
| _cmeSound cme = applySoundCME itm cr . applySidePush spush cr . applyTorqueCME itm cr . applyRecoil itm cr
| otherwise = failsound
where
spush = fromMaybe 0 $ itm ^? itUse . heldParams . sidePush
failsound w = case w ^? input . mouseButtons . ix SDL.ButtonLeft of
Just 0 -> soundStart (CrWeaponSound (_crID cr) 0) (_crPos cr) click1S Nothing w
_ -> soundContinue (CrWeaponSound (_crID cr) 0) (_crPos cr) click1S Nothing w
applySoundCME :: Item -> Creature -> World -> World
applySoundCME itm cr = fromMaybe id $ do
soundid <- itm ^? itUse . heldParams . bulGunSound
return $ soundMultiFrom [CrWeaponSound cid j | j <- [0..3]] (_crPos cr) soundid Nothing
where
cid = _crID cr
applyRecoil :: Item -> Creature -> World -> World
applyRecoil itm cr = over (cWorld . lWorld . creatures . ix cid) pushback
@@ -409,6 +416,7 @@ applyTorqueCME itm cr w
-- (Muzzle,Int,Int) = (muzzle, amountloaded, id of mag taken from)
loadMuzzle :: LabelDoubleTree ComposeLinkType Item
-> Muzzle -> (LabelDoubleTree ComposeLinkType Item,(Muzzle, Int,Maybe Int))
--loadMuzzle t@(LDT _ l _) mz = (t,(mz, 0,Nothing))
loadMuzzle t@(LDT _ l _) mz = fromMaybe (t,(mz, 0,Nothing)) $ do
let as = _mzAmmoSlot mz
amamount = 1
@@ -419,8 +427,26 @@ loadMuzzle t@(LDT _ l _) mz = fromMaybe (t,(mz, 0,Nothing)) $ do
, (mz, usedammo, mag ^? ldtValue . itLocation . ipInvID)
)
makeMuzzleFlare :: (Muzzle,Int,Maybe Int) -> Item -> Creature -> World -> World
makeMuzzleFlare _ _ _ = id
makeMuzzleFlare :: Muzzle -> Item -> Creature -> World -> World
makeMuzzleFlare mz itm cr = case mz ^. mzFlareType of
DefaultFlareType -> id
PistolFlare -> makeTlsTimeRadColPos 2 100 (V3 1 1 0.5) (pos `v2z` 20)
. muzFlareAt (V4 10 10 1 3) (pos `v2z` 20) dir
. muzFlareAt (V4 10 10 1 3) (pos `v2z` 20) dir
. muzFlareAt (V4 10 10 1 3) (pos `v2z` 20) dir
where
pos = _crPos cr + rotateV (_crDir cr) (_mzPos mz + aimingWeaponZeroPos cr itm)
dir = _crDir cr + _mzRot mz
makeMuzzleSmoke :: Muzzle -> Item -> Creature -> World -> World
makeMuzzleSmoke mz itm cr w = case mz ^. mzFlareType of
DefaultFlareType -> w
PistolFlare -> foldl' (flip $ smokeCloudAt (greyN 0.5) 20 400 5 . (+.+.+ pos) . (* 8)) w ps
where
ps = replicateM 2 randOnUnitSphere & evalState $ _randGen w
pos = addZ 10 $ _crPos cr + rotateV (_crDir cr) (_mzPos mz + aimingWeaponZeroPos cr itm)
-- , withSmoke 1 black 20 200 5
isAmmoIntLink :: Int -> ComposeLinkType -> Bool
isAmmoIntLink i (AmmoInLink j _) = i == j
@@ -428,11 +454,9 @@ isAmmoIntLink _ _ = False
useLoadedAmmo :: Item -> Creature -> (CumulativeMuzzleEffect,World) -> (Muzzle,Int,Maybe Int)
-> (CumulativeMuzzleEffect,World)
useLoadedAmmo _ cr (cme,w) (_,0,_) = (cme,failsound w)
where
failsound = case w ^? input . mouseButtons . ix SDL.ButtonLeft of
Just 0 -> soundStart (CrWeaponSound (_crID cr) 0) (_crPos cr) click1S Nothing
_ -> soundContinue (CrWeaponSound (_crID cr) 0) (_crPos cr) click1S Nothing
--useLoadedAmmo _ cr (cme,w) (_,0,_) = (cme,failsound w)
useLoadedAmmo _ _ (cme,w) (_,0,_) = (cme, w)
--useLoadedAmmo itm cr (cme,w) (mz,x,mid) = (cme,w)
useLoadedAmmo itm cr (cme,w) (mz,x,mid) = fromMaybe (cme,w) $ do
magid <- mid
-- should be able to pass the magazine in from elsewhere?
@@ -440,6 +464,8 @@ useLoadedAmmo itm cr (cme,w) (mz,x,mid) = fromMaybe (cme,w) $ do
return $ (cme & cmeSound .~ True,
w & cWorld . lWorld . creatures . ix cid . crInv . ix magid . itUse . amagLoadStatus . iaLoaded -~ x
& flip (foldl' (&)) (replicate x (makeBullet thebullet itm cr mz))
& makeMuzzleFlare mz itm cr
& makeMuzzleSmoke mz itm cr
)
where
cid = _crID cr
@@ -586,18 +612,18 @@ useMod hm = case hm of
-- , ammoCheckI
-- , blCheck
-- ]
BangCaneMod ->
[ withFlare
, withSmoke 1 black 20 200 5
, withRecoil
, duplicateLoadedBarrels
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart tap3S
, useTimeCheck
, ammoCheckI
, blCheck
]
-- BangCaneMod ->
-- [ withFlare
-- , withSmoke 1 black 20 200 5
-- , withRecoil
-- , duplicateLoadedBarrels
-- , withTorqueAfter
-- , useAmmoAmount 1
-- , withSoundStart tap3S
-- , useTimeCheck
-- , ammoCheckI
-- , blCheck
-- ]
VolleyGunMod ->
[ withRecoil
, withFlare
@@ -620,18 +646,18 @@ useMod hm = case hm of
, ammoCheckI
, blCheck
]
AutoRifleMod ->
-- note this is the same as BangCanemMod with the first changed
[ withFlare
, withSmoke 1 black 20 200 5
, withRecoil
, duplicateLoadedBarrels
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart tap3S
, useTimeCheck
, ammoCheckI
]
-- AutoRifleMod ->
-- -- note this is the same as BangCanemMod with the first changed
-- [ withFlare
-- , withSmoke 1 black 20 200 5
-- , withRecoil
-- , duplicateLoadedBarrels
-- , withTorqueAfter
-- , useAmmoAmount 1
-- , withSoundStart tap3S
-- , useTimeCheck
-- , ammoCheckI
-- ]
BangRodMod ->
[ withRecoil
, withFlare
@@ -699,28 +725,17 @@ useMod hm = case hm of
, ammoCheckI
, blCheck
]
AutoPistolMod ->
[ withFlare
, withSidePushI 50
, withRecoil
, withTorqueAfter
, duplicateLoadedBarrels
, withSoundStart tap3S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
]
MachinePistolMod ->
[ withFlare
, withRecoil
, withSidePushI 50
, withTorqueAfter
, duplicateLoadedBarrels
, withSoundStart tap1S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
]
-- MachinePistolMod ->
-- [ withFlare
-- , withRecoil
-- , withSidePushI 50
-- , withTorqueAfter
-- , duplicateLoadedBarrels
-- , withSoundStart tap1S
-- , useAmmoAmount 1
-- , useTimeCheck
-- , ammoCheckI
-- ]
BurstRifleMod ->
[ withRecoil
, withFlare
@@ -759,17 +774,17 @@ useMod hm = case hm of
, withWarmUp crankSlowS
, ammoCheckI
]
SmgMod ->
[ withFlare
, withSidePushI 30
, withRecoil
, withTorqueAfter
, duplicateLoadedBarrels
, withSoundStart tap3S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
]
-- SmgMod ->
-- [ withFlare
-- , withSidePushI 30
-- , withRecoil
-- , withTorqueAfter
-- , duplicateLoadedBarrels
-- , withSoundStart tap3S
-- , useAmmoAmount 1
-- , useTimeCheck
-- , ammoCheckI
-- ]
BangConeMod ->
[ withRandomItem coneRandItemParams
, withRandomItemUpdate coneRandItemUpdate
+1 -1
View File
@@ -170,7 +170,7 @@ heldItemSPic ht it = case ht of
VOLLEYGUN i -> noPic $ volleyGunShape i -- <> addBullets it
MULTIGUN i -> noPic $ volleyGunShape i -- <> addBullets it
RIFLE -> noPic $ baseRifleShape -- <> addBullets it
REPEATER -> noPic $ baseRifleShape <> addTinClip it
-- REPEATER -> noPic $ baseRifleShape <> addTinClip it
AUTORIFLE -> noPic $ baseRifleShape <> addTinClip it
BURSTRIFLE -> noPic $ baseRifleShape <> addTinClip it
BANGROD -> noPic $ baseRodShape -- <> addBullets it
+1 -1
View File
@@ -39,7 +39,7 @@ itemFromHeldType ht = case ht of
VOLLEYGUN i -> volleyGun i
MULTIGUN i -> multiGun i
RIFLE -> rifle
REPEATER -> repeater
-- REPEATER -> repeater
AUTORIFLE -> autoRifle
BURSTRIFLE -> burstRifle
BANGROD -> bangRod
+16 -14
View File
@@ -1,7 +1,6 @@
module Dodge.Item.Held.Cane (
volleyGun,
multiGun,
repeater,
rifle,
autoRifle,
burstRifle,
@@ -12,6 +11,7 @@ import Dodge.SoundLogic.ExternallyGeneratedSounds
import Dodge.Base
import Dodge.Data.Item
import Dodge.Default
import qualified Data.IntMap.Strict as IM
--import Dodge.Reloading.Action
import Geometry.Data
import LensHelp
@@ -32,23 +32,24 @@ defaultBangCane =
& itDimension . dimRad .~ 8
& itDimension . dimCenter .~ V3 5 0 0
& itUse . heldDelay . rateMax .~ 6
& itUse . heldMods .~ BangCaneMod
-- & itUse . heldMods .~ BangCaneMod
& itUse . heldAim . aimStance .~ OneHand
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01 0 DefaultFlareType]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01 0 PistolFlare]
volleyGun :: Int -> Item
volleyGun i =
defaultBangCane
& itUse . heldMods .~ VolleyGunMod
-- & itUse . heldMods .~ VolleyGunMod
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandFlat
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles .~
([Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3] <*> [0..] <*> repeat DefaultFlareType)
take i ([Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3] <*> [0..] <*> repeat PistolFlare)
& itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
& itType . iyBase .~ HELD (VOLLEYGUN i)
& itUse . heldAmmoTypes .~ IM.fromList (zip [0..i-1] $ repeat BulletAmmo)
multiGun :: Int -> Item
multiGun i =
@@ -71,26 +72,27 @@ rifle =
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 25 0) 0 0.01 0 DefaultFlareType]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 25 0) 0 0.01 0 PistolFlare]
& itType . iyModules . at ModHeldAttach ?~ EMPTYMODULE
repeater :: Item
repeater =
rifle
& itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
& itType . iyBase .~ HELD REPEATER
--repeater :: Item
--repeater =
-- rifle
-- & itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
-- & itType . iyBase .~ HELD REPEATER
autoRifle :: Item
autoRifle =
repeater
rifle
& itType . iyBase .~ HELD AUTORIFLE
& itUse . heldMods .~ AutoRifleMod
& itUse . heldTriggerType .~ AutoTrigger
-- & itUse . heldMods .~ AutoRifleMod
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
-- & itUse . useDelay . rateMax .~ 6
burstRifle :: Item
burstRifle =
repeater
rifle
& itType . iyBase .~ HELD BURSTRIFLE
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0.05
& itUse . heldDelay . rateMax .~ 18
+11 -5
View File
@@ -45,7 +45,9 @@ pistol =
-- & itUse . heldAmmoTypes .~ [BulletAmmo]
& itUse . heldDelay . rateMax .~ 6
& itUse . heldMods .~ PistolMod
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) 0 0.05 0 DefaultFlareType]
& itUse . heldAim . aimMuzzles . ix 0 . mzPos %~ const (V2 10 0)
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy %~ const 0.05
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType %~ const PistolFlare
& itUse . heldParams
%~ ( (muzVel .~ 0.8)
. (rifling .~ 0.8)
@@ -58,7 +60,9 @@ pistol =
autoPistol :: Item
autoPistol =
pistol
& itUse . heldMods .~ AutoPistolMod
& itUse . heldMods .~ PistolMod
& itUse . heldTriggerType .~ AutoTrigger
& itUse . heldParams . bulGunSound .~ tap1S
& itType . iyBase .~ HELD AUTOPISTOL
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
@@ -66,7 +70,7 @@ machinePistol :: Item
machinePistol =
autoPistol
& itUse . heldDelay . rateMax .~ 2
& itUse . heldMods .~ MachinePistolMod -- (ammoCheckI : machinePistolAfterHamMods)
& itUse . heldMods .~ PistolMod -- (ammoCheckI : machinePistolAfterHamMods)
& itType . iyBase .~ HELD MACHINEPISTOL
& itType . iyModules . at ModAutoMag .~ Nothing
& itUse . heldParams . recoil .~ 20
@@ -74,9 +78,11 @@ machinePistol =
smg :: Item
smg =
autoPistol -- & some parameter affecting stability
& itUse . heldMods .~ SmgMod --(ammoCheckI : smgAfterHamMods)
& itUse . heldMods .~ PistolMod --(ammoCheckI : smgAfterHamMods)
& itType . iyBase .~ HELD SMG
& itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0 0 DefaultFlareType]
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 20 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
-- & itUse . heldAim . aimHandlePos .~ 2
& itUse . heldParams . torqueAfter .~ 0.05
& itUse . heldParams . sidePush .~ 30
+1 -1
View File
@@ -74,7 +74,7 @@ heldInfo hit = case hit of
VOLLEYGUN i -> over _head toUpper (showInt i) ++ " gun barrels lined up to be roughly parallel. Draws bullets from a single magazine. All loaded barrels discharge simultaneously."
MULTIGUN i -> over _head toUpper (showInt i) ++ " gun barrels lined up to be roughly parallel. Each barrel requires a separate magazine. All barrels must be loaded to fire."
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."
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."
+1 -1
View File
@@ -38,7 +38,7 @@ heldBounds hit = case hit of
VOLLEYGUN _ -> undefined
MULTIGUN _ -> undefined
RIFLE -> rs
REPEATER -> rs
-- REPEATER -> rs
AUTORIFLE -> rs
BURSTRIFLE -> rs
BANGROD -> amrs
+3 -1
View File
@@ -1,6 +1,7 @@
{-# OPTIONS_GHC -Wno-unused-imports #-}
module Dodge.TestString where
import Dodge.DoubleTree
import Dodge.Data.DoubleTree
import Dodge.Item.Grammar
import Dodge.Item.Display
@@ -22,7 +23,8 @@ testStringInit :: Universe -> [String]
testStringInit _ = mempty
--testStringInit u = fromMaybe mempty $ do
-- inv <- fmap invLDT $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInv
-- return $ concatMap (prettyLDT (\(x,_,_,_) -> take 5 (show $ x ^. itType . iyBase))) inv
-- invitm <- inv ^? ix 1
-- return $ concatMap (prettyLDT (\(x,_,_,_) -> take 5 (show $ x ^. itType . iyBase))) [invitm]
--testStringInit u = maybe [] invTree (u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInv)
-- [fromMaybe "" $ do