Push item use delay inside datatype, currently broken
This commit is contained in:
@@ -32,8 +32,8 @@ itemEffect
|
||||
-> World
|
||||
itemEffect cr Consumable{_cnEffect=eff } w = maybe w (rmSelectedInvItem (_crID cr)) (eff (_crID cr) w)
|
||||
itemEffect cr it w = case it ^? itUse of
|
||||
Just (RightUse eff) -> foldr ($) eff (_itUseModifiers it) it cr w
|
||||
Just (LeftUse _ ) -> w & creatures . ix (_crID cr) . crLeftInvSel ?~ _crInvSel cr
|
||||
Just (RightUse {_rUse = eff,_useMods = usemods}) -> foldr ($) eff usemods it cr w
|
||||
Just (LeftUse {}) -> w & creatures . ix (_crID cr) . crLeftInvSel ?~ _crInvSel cr
|
||||
_ -> w
|
||||
|
||||
--this is ugly
|
||||
@@ -42,7 +42,7 @@ useLeftItem cid w = case _crInv cr IM.! crinvsel ^? itUse . lUse of
|
||||
Just f -> f cr crinvsel w & creatures . ix cid . crLeftInvSel ?~ crinvsel
|
||||
Nothing -> case _crLeftInvSel cr of
|
||||
Just invid -> case _itUse $ _crInv cr IM.! invid of
|
||||
LeftUse f -> f cr invid w
|
||||
LeftUse {_lUse = f} -> f cr invid w
|
||||
_ -> w & creatures . ix cid . crLeftInvSel .~ Nothing
|
||||
Nothing -> case luse of
|
||||
Nothing -> w
|
||||
|
||||
Reference in New Issue
Block a user