Assorted changes, cleanup menu selection text
This commit is contained in:
@@ -13,6 +13,7 @@ import qualified IntMapHelp as IM
|
||||
import Shape
|
||||
import ShapePicture
|
||||
|
||||
import Data.Maybe
|
||||
--import qualified Data.Map.Strict as M
|
||||
import Control.Lens
|
||||
|
||||
@@ -28,13 +29,14 @@ rewindGun = defaultGun
|
||||
, _itEffect = ItRewindEffect rewindEffect []
|
||||
, _itUse = defaultlUse {_lUse = \cr invid -> useRewindGun (_crInv cr IM.! invid) cr}
|
||||
}
|
||||
rewindEffect :: ItEffect -> Creature -> Int -> World -> World
|
||||
rewindEffect _ cr invid w
|
||||
rewindEffect :: Item -> Creature -> World -> World
|
||||
rewindEffect itm cr w
|
||||
| Just invid == _crLeftInvSel cr = w & rewindWorlds %~ (take maxcharge . (w' : ))
|
||||
& ptrWpCharge .~ length (_rewindWorlds w)
|
||||
| otherwise = w & rewindWorlds .~ []
|
||||
& ptrWpCharge .~ 0
|
||||
where
|
||||
invid = fromJust $ _itInvPos itm
|
||||
ptrWpCharge = creatures . ix (_crID cr) . crInv . ix invid . itConsumption . wpCharge
|
||||
maxcharge = _wpMaxCharge . _itConsumption $ _crInv cr IM.! invid
|
||||
w' = w & rewindWorlds .~ []
|
||||
|
||||
Reference in New Issue
Block a user