Add concept of GameRoom, check viewing distance based on rooms
This commit is contained in:
@@ -34,12 +34,12 @@ incCharMode
|
||||
:: Int -- ^ Inventory selection
|
||||
-> World
|
||||
-> World
|
||||
incCharMode i = creatures . ix 0 . crInv . ix i . itAttachment . _Just %~ incCharMode'
|
||||
incCharMode i = creatures . ix 0 . crInv . ix i . itAttachment %~ incCharMode'
|
||||
decCharMode
|
||||
:: Int -- ^ Inventory selection
|
||||
-> World
|
||||
-> World
|
||||
decCharMode i = creatures . ix 0 . crInv . ix i . itAttachment . _Just %~ decCharMode'
|
||||
decCharMode i = creatures . ix 0 . crInv . ix i . itAttachment %~ decCharMode'
|
||||
|
||||
charFiringStrat
|
||||
:: [(Char, Creature -> World -> World)] -- ^ Different firing effects for different characters
|
||||
@@ -47,7 +47,7 @@ charFiringStrat
|
||||
-> World
|
||||
-> World
|
||||
charFiringStrat strats cr w = case w ^? creatures . ix cid . crInv
|
||||
. ix (_crInvSel $ _creatures w IM.! cid) . itAttachment . _Just . itCharMode of
|
||||
. ix (_crInvSel $ _creatures w IM.! cid) . itAttachment . itCharMode of
|
||||
Just (c :<| _) -> fromJust (Prelude.lookup c strats) cr w
|
||||
_ -> w
|
||||
where
|
||||
@@ -60,7 +60,7 @@ charFiringStratI
|
||||
-> World
|
||||
-> World
|
||||
charFiringStratI strats eff item cr w = case w ^? creatures . ix cid . crInv
|
||||
. ix (_crInvSel $ _creatures w IM.! cid) . itAttachment . _Just . itCharMode of
|
||||
. ix (_crInvSel $ _creatures w IM.! cid) . itAttachment . itCharMode of
|
||||
Just (c :<| _) -> fromJust (Prelude.lookup c strats) eff item cr w
|
||||
_ -> w
|
||||
where
|
||||
@@ -75,8 +75,8 @@ increaseFuse fuse itid w = w
|
||||
& creatures . ix 0 . crInv . ix itid %~
|
||||
( itScrollUp .~ decreaseFuse newTime )
|
||||
. (itScrollDown .~ increaseFuse newTime )
|
||||
. ( itAttachment ?~ ItFuse newTime )
|
||||
. ( itZoom .~ defaultItZoom{_itAimZoomMax = zm, _itAimZoomMin = zm} )
|
||||
. ( itAttachment .~ ItFuse newTime )
|
||||
. ( itAimZoom .~ defaultItZoom{_itZoomMax = zm, _itZoomMin = zm} )
|
||||
where
|
||||
newTime = min (fuse + 5) 90
|
||||
zm = 50 / fromIntegral newTime
|
||||
@@ -89,8 +89,8 @@ decreaseFuse fuse itid w = w
|
||||
& creatures . ix 0 . crInv . ix itid %~
|
||||
( itScrollUp .~ decreaseFuse newTime )
|
||||
. ( itScrollDown .~ increaseFuse newTime )
|
||||
. ( itAttachment ?~ ItFuse newTime )
|
||||
. ( itZoom .~ defaultItZoom {_itAimZoomMax = zm, _itAimZoomMin = zm} )
|
||||
. ( itAttachment .~ ItFuse newTime )
|
||||
. ( itAimZoom .~ defaultItZoom {_itZoomMax = zm, _itZoomMin = zm} )
|
||||
where
|
||||
newTime = max (fuse - 5) 20
|
||||
zm = 50 / fromIntegral newTime
|
||||
|
||||
Reference in New Issue
Block a user