Remove unnecessary item held/worn field type

This commit is contained in:
2022-07-11 10:20:40 +01:00
parent 96ebb7a1a2
commit 75d597f774
21 changed files with 66 additions and 96 deletions
+6 -5
View File
@@ -18,10 +18,11 @@ import Control.Lens
import Data.Maybe
itemEquipPict :: Creature -> Item -> SPic
itemEquipPict cr it = case _dimPortage (_itDimension it) of
HeldItem {} -> pictureWeaponOnAim cr it
WornItem -> pictureOnEquip (itSPic it) cr it
NoPortage -> mempty
itemEquipPict cr it = case it ^?! itUse of
RightUse {} -> pictureWeaponOnAim cr it
ituse -> case ituse ^? eqEq of
Just _ -> pictureOnEquip (itSPic it) cr it
Nothing -> mempty
pictureWeaponOnAim
:: Creature
@@ -72,7 +73,7 @@ pictureWeaponOnAimItem p' cr posInInv
_ -> 0
theIt = _crInv cr IM.! posInInv
p = fromMaybe p' $ do
x <- theIt ^? itDimension . dimPortage . handlePos
x <- theIt ^? itUse . useAim . aimHandlePos
return $translateSPf (-x) 0 p'
isOneHand = theIt ^? itUseAimStance == Just OneHand
|| isNothing (theIt ^? itUseAimStance)