Separate out bullet effects, allow for tweaking to change these

This commit is contained in:
2021-11-30 13:11:34 +00:00
parent e75cbdf6cb
commit 4d21c0f31a
13 changed files with 207 additions and 81 deletions
+6 -6
View File
@@ -125,17 +125,17 @@ wheelEvent y w = case (_carteDisplay w, _inventoryMode w) of
invKeyDown = ScancodeCapsLock `S.member` _keys w
moveTweakSel :: Int -> World -> World
moveTweakSel i w = case yourItem w ^? itParams . tweakParams of
moveTweakSel i w = case yourItem w ^? itTweaks . tweakParams of
Just l -> w & creatures . ix (_yourID w) . crInv . ix (_crInvSel (you w))
. itParams . tweakSel %~ (`mod` length l) . subtract i
. itTweaks . tweakSel %~ (`mod` length l) . subtract i
_ -> w
changeTweakParam :: Int -> World -> World
changeTweakParam i w = w
& creatures . ix (_yourID w) . crInv . ix (_crInvSel (you w)) %~
( (itParams . tweakParams . ix paramid . curTweak .~ x)
( (itTweaks . tweakParams . ix paramid . curTweak .~ x)
. _doTweak params x)
where
it = yourItem w
params = _tweakParams (_itParams it) IM.! paramid
tweaks = _itTweaks $ yourItem w
params = _tweakParams tweaks IM.! paramid
x = (_curTweak params + i) `mod` _maxTweak params
paramid = _tweakSel $ _itParams $ yourItem w
paramid = _tweakSel tweaks