Add files

This commit is contained in:
2021-11-28 11:45:53 +00:00
parent d6fb6adc66
commit 2fd2929bdf
6 changed files with 27 additions and 10 deletions
+4 -4
View File
@@ -69,7 +69,7 @@ rmSelectedInvItem
rmSelectedInvItem cid w = rmInvItem cid (_crInvSel (_creatures w IM.! cid)) w
updateCloseObjects :: World -> World
updateCloseObjects w = w & closeActiveObjects .~ unionBy eTest oldCloseFiltered currentClose
updateCloseObjects w = w & closeObjects .~ unionBy eTest oldCloseFiltered currentClose
where
filt = filter $ \obj -> dist ypos (pos obj) < 40 && hasLOS ypos (pos obj) w
ypos = _crPos $ you w
@@ -84,13 +84,13 @@ updateCloseObjects w = w & closeActiveObjects .~ unionBy eTest oldCloseFiltered
eTest (Left x) (Left y) = _flItID x == _flItID y
eTest _ _ = False
currentClose = filt objs
oldClose = filt $ _closeActiveObjects w
oldClose = filt $ _closeObjects w
oldCloseFiltered = intersectBy eTest oldClose currentClose
closeObjScrollDir :: Float -> World -> World
closeObjScrollDir x
| x > 0 = over closeActiveObjects rotU
| x < 0 = over closeActiveObjects rotD
| x > 0 = over closeObjects rotU
| x < 0 = over closeObjects rotD
| otherwise = id
swapInvDir :: Int -> World -> World