Cleanup/remove trigger types code

This commit is contained in:
2024-10-03 11:39:12 +01:00
parent 3c9941923d
commit ce2f13ade3
8 changed files with 157 additions and 275 deletions
+9
View File
@@ -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