Cleanup/remove trigger types code
This commit is contained in:
@@ -5,6 +5,7 @@ module Dodge.HeldUse (
|
||||
mcUseHeld,
|
||||
) where
|
||||
|
||||
import Dodge.ChainEffect
|
||||
import Color
|
||||
import Data.Maybe
|
||||
import Dodge.Base.Collide
|
||||
@@ -33,6 +34,14 @@ import qualified SDL
|
||||
heldEffect :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
|
||||
heldEffect = hammerCheck $ useTimeCheck heldEffectMuzzles
|
||||
|
||||
hammerCheck :: ChainEffect
|
||||
hammerCheck f it cr w = case it ^? ldtValue . itUse . heldTriggerType of
|
||||
Just HammerTrigger -> case w ^? input . mouseButtons . ix SDL.ButtonLeft of
|
||||
Just 0 -> f it cr w
|
||||
_ -> w
|
||||
_ -> f it cr w
|
||||
|
||||
|
||||
heldEffectMuzzles :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
|
||||
heldEffectMuzzles t cr w =
|
||||
uncurry (applyCME (_ldtValue t) cr) cmew
|
||||
|
||||
Reference in New Issue
Block a user