Separate out concrete part of world

This commit is contained in:
2022-07-25 12:10:50 +01:00
parent 3354d108be
commit b2efbd2b3e
134 changed files with 933 additions and 930 deletions
+5 -5
View File
@@ -16,18 +16,18 @@ useL lu = case lu of
LBoost -> boostSelfL 10
useRewindGun :: Item -> Creature -> World -> World
useRewindGun _ _ w = case _rewindWorlds w of
useRewindGun _ _ w = case _rewindWorlds (_cWorld w) of
[w'] -> rewindusing w' [w']
(w':ws) -> rewindusing w' ws
_ -> w
where
rewindusing w' ws = w
& maybeWorld .~ Just' ( w'
& cWorld . maybeWorld .~ Just' ( w'
-- & creatures . ix (_crID cr) .~ cr
& upbuts
& rewindWorlds .~ ws
& cWorld . rewindWorlds .~ ws
)
upbuts = (keys .~ _keys w) . (mouseButtons .~ _mouseButtons w)
upbuts = (cWorld . keys .~ _keys (_cWorld w)) . (cWorld . mouseButtons .~ _mouseButtons (_cWorld w))
-- be careful changing this around; potential problems include updating the
-- creature but using the old crInvSel value
@@ -39,5 +39,5 @@ useShrinkGun it cr w = if _atBool $ _itAttachment it
where
invid = _ipInvID $ _itPos it
tryResize x g = maybe w g $ sizeSelf x cr w
f isInUse cstatus = creatures . ix (_crID cr) . crInv . ix invid %~
f isInUse cstatus = cWorld . creatures . ix (_crID cr) . crInv . ix invid %~
( (itAttachment . atBool .~ isInUse) . (itCurseStatus .~ cstatus) )