Start moving bullet ammo parameters to more sensible places

This commit is contained in:
2024-06-22 00:08:42 +01:00
parent 944b40cb56
commit a3eca3a674
15 changed files with 271 additions and 248 deletions
+5 -7
View File
@@ -339,7 +339,7 @@ useMod hm = case hm of
, ammoCheckI
]
BangConeMod ->
[ withRandomItemParams coneRandItemParams
[ withRandomItem coneRandItemParams
, withRandomItemUpdate coneRandItemUpdate
, withRandomOffset
, duplicateLoadedBarrels
@@ -497,15 +497,13 @@ coneRandItemUpdate = do
wth <- state $ randomR (1, 5)
return (itUse . heldConsumption . laAmmoType . amBullet . buWidth .~ wth)
coneRandItemParams :: State StdGen (ItemParams -> ItemParams)
coneRandItemParams :: State StdGen (Item -> Item)
coneRandItemParams = do
muzv <- state $ randomR (0.5, 1)
rifl <- state $ randomR (0.3, 0.9)
return $ \itparams ->
itparams
{ _muzVel = muzv
, _rifling = rifl
}
return $ \it ->
it & itUse . heldParams . muzVel .~ muzv
& itUse . heldParams . rifling .~ rifl
mcShootLaser :: Item -> Machine -> World -> World
mcShootLaser it mc = cWorld . lWorld . lasers .:~ lasRayAt (_lasColor $ _itParams it) dam phasev pos dir