Move UseCondition out of record
This commit is contained in:
@@ -7,6 +7,8 @@ module Dodge.Item.Grammar (
|
||||
allInvLocs,
|
||||
) where
|
||||
|
||||
import Dodge.ItemUseCondition
|
||||
import Dodge.Data.UseCondition
|
||||
import Dodge.Item.MagAmmoType
|
||||
import Dodge.Data.AmmoType
|
||||
import Dodge.Item.AmmoSlots
|
||||
@@ -150,8 +152,8 @@ itemToFunction itm = case itm ^. itType of
|
||||
ITEMSCAN -> ToggleSF
|
||||
INTROSCAN {} -> IntroScanSF
|
||||
HELD LASER -> WeaponTargetingSF
|
||||
HELD{} -> case itm ^? itUseCondition of
|
||||
Just UseableWhenAimed -> HeldPlatformSF
|
||||
HELD{} -> case itUseCondition itm of
|
||||
UseableWhenAimed -> HeldPlatformSF
|
||||
--Just MustBeHeld -> UnloadedWeaponSF
|
||||
_ -> GadgetPlatformSF
|
||||
_
|
||||
|
||||
@@ -33,30 +33,13 @@ torch =
|
||||
|
||||
-- | Sends out pulses that display walls.
|
||||
detector :: Detector -> Item
|
||||
detector dt =
|
||||
defaultHeldItem
|
||||
& itUseCondition .~ UseableAnytime
|
||||
-- & itUse . heldDelay . rateMax .~ 20
|
||||
-- & itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||
& itType .~ DETECTOR dt
|
||||
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleDetector
|
||||
-- & itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 100
|
||||
detector dt = defaultHeldItem & itType .~ DETECTOR dt
|
||||
|
||||
blinker :: Item
|
||||
blinker =
|
||||
defaultHeldItem
|
||||
& itUseCondition .~ UseableAnytime
|
||||
-- & itUse . heldDelay . rateMax .~ 20
|
||||
-- & itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleBlink
|
||||
-- & itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 10000000
|
||||
& itType .~ HELD BLINKER
|
||||
blinker = defaultHeldItem & itType .~ HELD BLINKER
|
||||
|
||||
unsafeBlinker :: Item
|
||||
unsafeBlinker =
|
||||
blinker
|
||||
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleUnsafeBlink
|
||||
& itType .~ HELD BLINKERUNSAFE
|
||||
unsafeBlinker = blinker & itType .~ HELD BLINKERUNSAFE
|
||||
|
||||
rewinder :: Item
|
||||
rewinder =
|
||||
|
||||
Reference in New Issue
Block a user