Move TriggerType out of item record

This commit is contained in:
2025-06-04 08:18:05 +01:00
parent e6bb7ac753
commit a1a35745d6
11 changed files with 221 additions and 224 deletions
+4 -2
View File
@@ -8,6 +8,7 @@ module Dodge.HeldUse (
mcUseHeld,
) where
import Dodge.BaseTriggerType
import Sound.Data
import Color
import Control.Applicative
@@ -85,7 +86,8 @@ hammerCheck ::
t2 ->
t2
hammerCheck f pt it cr
| Just HammerTrigger <- it ^? ldtValue . itUse . heldTriggerType
| t <- baseTriggerType (it ^. ldtValue)
, t == HammerTrigger || t == AlwaysSingleTrigger
, isNothing $ lookup MakeAutoLink (it ^. ldtRight)
, pt /= InitialPress =
id
@@ -158,7 +160,7 @@ doWeaponRepetitions itm cr = case itm ^? ldtValue . itUse . heldParams . weaponR
f x = (x, WdWdFromItCrixWdWd (upitm x) (_crID cr) ItCrWdItemHeldEffect)
upitm x =
itm & ldtValue . itUse . heldParams . weaponRepeat .~ []
& ldtValue . itUse . heldTriggerType .~ AutoTrigger
-- & ldtValue . itUse . heldTriggerType .~ AutoTrigger
& ldtValue . itUse . heldFrame .~ x
applyCME :: Item -> Creature -> CumulativeMuzzleEffect -> World -> World