Check wall collisions when expanding

This commit is contained in:
2021-11-18 21:15:50 +00:00
parent a546d070f0
commit 15f2c419d2
7 changed files with 58 additions and 36 deletions
+4 -6
View File
@@ -38,13 +38,11 @@ shrinkGun = defaultGun
}
useShrinkGun :: Item -> Creature -> World -> World
useShrinkGun it cr = case _itBool $ _itAttachment it of
True -> sizeSelf 0.5 cr . f False UndroppableIdentified
. stripNoItems cr
. dropUnselected cr
False -> sizeSelf 1 cr . f True Uncursed
. setMinInvSize defaultInvSize cr
useShrinkGun it cr w = if _itBool $ _itAttachment it
then tryResize 0.5 $ f False UndroppableIdentified . stripNoItems cr . dropUnselected cr
else tryResize 1 $ f True Uncursed . setMinInvSize defaultInvSize cr
where
tryResize x g = maybe w g $ maybeSizeSelf x cr w
f isInUse cstatus = creatures . ix (_crID cr) . crInv . ix (_crInvSel cr) %~
( (itAttachment . itBool .~ isInUse) . (itCurseStatus .~ cstatus) )