Rename ItemAttachments

This commit is contained in:
2022-06-15 08:21:53 +01:00
parent 485c42eb24
commit bf1bfa5453
15 changed files with 98 additions and 80 deletions
+3 -3
View File
@@ -68,7 +68,7 @@ shrinkGun = defaultGun
, _itUse = defaultlUse {_lUse = hammerCheckL useShrinkGun}
& useHammer .~ upHammer
-- , _itFloorPict = shrinkGunPic
, _itAttachment = ItBool True
, _itAttachment = AttachBool True
}
& itType . iyBase .~ SHRINKER
@@ -79,14 +79,14 @@ shrinkGunPic _ = noPic $ colorSH violet $ upperPrismPoly 5 $ square 5
-- creature but using the old crInvSel value
-- 22.05.23 this has been changed from using invids to items
useShrinkGun :: Item -> Creature -> World -> World
useShrinkGun it cr w = if _itBool $ _itAttachment it
useShrinkGun it cr w = if _atBool $ _itAttachment it
then tryResize 0.5 $ stripNoItems cr . f False UndroppableIdentified . dropExcept cr invid
else tryResize 1 $ f True Uncursed . setMinInvSize defaultInvSize cr
where
invid = fromJust $ _itInvPos it
tryResize x g = maybe w g $ sizeSelf x cr w
f isInUse cstatus = creatures . ix (_crID cr) . crInv . ix invid %~
( (itAttachment . itBool .~ isInUse) . (itCurseStatus .~ cstatus) )
( (itAttachment . atBool .~ isInUse) . (itCurseStatus .~ cstatus) )
blinkGun :: Item
blinkGun = defaultGun