Extend inv item location information to include "attached" items
This commit is contained in:
@@ -12,17 +12,17 @@ doInvEffect iie = case iie of
|
||||
ChargeIfEquipped -> chargeIfEquipped
|
||||
ChargeIfInInventory -> chargeIfInInventory
|
||||
SetCharge i -> setItemCharge i
|
||||
EffectIfHeld f g -> onOffEff f g
|
||||
EffectRootNotroot f g -> rootNotrootEff f g
|
||||
CreateHeldLight -> createHeldLight
|
||||
CreateShieldWall -> createShieldWall
|
||||
RemoveShieldWall -> removeShieldWall
|
||||
EffectWhileHeld f -> onOffEff f NoInvEffect
|
||||
EffectWhileRoot f -> rootNotrootEff f NoInvEffect
|
||||
|
||||
doFloorEffect :: ItFloorEffect -> Int -> World -> World
|
||||
doFloorEffect NoFloorEffect = const id
|
||||
|
||||
onOffEff :: ItInvEffect -> ItInvEffect -> Item -> Creature -> World -> World
|
||||
onOffEff f g it
|
||||
rootNotrootEff :: ItInvEffect -> ItInvEffect -> Item -> Creature -> World -> World
|
||||
rootNotrootEff f g it
|
||||
| it ^? itLocation . ilIsRoot == Just True = doInvEffect f it
|
||||
| otherwise = doInvEffect g it
|
||||
|
||||
|
||||
Reference in New Issue
Block a user