Check wall collisions when expanding
This commit is contained in:
@@ -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) )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user