Move towards being able to orient positions on attached items

This commit is contained in:
2024-10-01 20:13:08 +01:00
parent fa4e117f93
commit 8df6b31062
9 changed files with 61 additions and 199 deletions
+6 -9
View File
@@ -17,6 +17,7 @@ doInvEffect iie = case iie of
CreateShieldWall -> createShieldWall
RemoveShieldWall -> removeShieldWall
EffectWhileRoot f -> rootNotrootEff f NoInvEffect
EffectWhileAttached f -> effectWhileAttached f
doFloorEffect :: ItFloorEffect -> Int -> World -> World
doFloorEffect NoFloorEffect = const id
@@ -26,6 +27,11 @@ rootNotrootEff f g it
| it ^? itLocation . ilIsRoot == Just True = doInvEffect f it
| otherwise = doInvEffect g it
effectWhileAttached :: ItInvEffect -> Item -> Creature -> World -> World
effectWhileAttached f it
| it ^? itLocation . ilIsAttached == Just True = doInvEffect f it
| otherwise = const id
--timeScrollEffect :: Item -> Creature -> World -> World
--timeScrollEffect itm _ w = w & timeFlow .~ ScrollTimeFlow
-- { _scrollSmoothing = 0
@@ -58,14 +64,5 @@ chargeIfEquipped itm cr
ptrWpCharge = cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix invid . itUse . leftConsumption . wpCharge
maxcharge = itm ^?! itUse . leftConsumption . wpMaxCharge
--resetAttachmentEffect :: Item -> Creature -> World -> World
--resetAttachmentEffect itm cr w
-- | _ieCounter iteff < 0 = w & pointToIt . itAttachment .~ NoItAttachment
-- | otherwise = w & pointToIt . itEffect . ieCounter -~ 1
-- where
-- iteff = _itEffect itm
-- invid = _ipInvID $ _itLocation itm
-- pointToIt = cWorld . creatures . ix (_crID cr) . crInv . ix invid
createHeldLight :: Item -> Creature -> World -> World
createHeldLight itm cr = createTorchLightOffset cr itm 0