Move TriggerType out of item record
This commit is contained in:
@@ -7,6 +7,8 @@ module Dodge.Item.Grammar (
|
||||
allInvLocs,
|
||||
) where
|
||||
|
||||
import Dodge.Data.TriggerType
|
||||
import Dodge.BaseTriggerType
|
||||
import Dodge.Data.AimStance
|
||||
import Dodge.Item.AimStance
|
||||
import Control.Applicative
|
||||
@@ -112,8 +114,8 @@ itemToBreakLists itm itmf = case (itm ^. itType, itmf) of
|
||||
_ -> ([], [])
|
||||
|
||||
getAutoSpringLinks :: Item -> [(ItemStructuralFunction, ComposeLinkType)]
|
||||
getAutoSpringLinks itm = case itm ^? itUse . heldTriggerType of
|
||||
Just HammerTrigger -> [(MakeAutoSF, MakeAutoLink)]
|
||||
getAutoSpringLinks itm = case baseTriggerType itm of
|
||||
HammerTrigger -> [(MakeAutoSF, MakeAutoLink)]
|
||||
_ -> []
|
||||
|
||||
extraWeaponLinks :: Item -> [(ItemStructuralFunction, ComposeLinkType)]
|
||||
|
||||
@@ -29,7 +29,6 @@ teslaGun =
|
||||
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleTesla
|
||||
& itType .~ HELD TESLAGUN
|
||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||
& itUse . heldTriggerType .~ AutoTrigger
|
||||
|
||||
teslaParams :: ItemParams
|
||||
teslaParams =
|
||||
@@ -47,7 +46,6 @@ laser =
|
||||
& itUse . heldParams .~ BeamShooterParams-- Nothing
|
||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
& itUse . heldTriggerType .~ AutoTrigger
|
||||
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 6 0
|
||||
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ LasGunFlare
|
||||
@@ -67,7 +65,6 @@ tractorGun =
|
||||
defaultHeldItem
|
||||
& itUse . heldParams .~ BeamShooterParams
|
||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||
& itUse . heldTriggerType .~ AutoTrigger
|
||||
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 30 0
|
||||
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||
& itUse . heldAim . aimWeight .~ 6
|
||||
|
||||
@@ -72,7 +72,6 @@ autoRifle :: Item
|
||||
autoRifle =
|
||||
rifle
|
||||
& itType .~ HELD AUTORIFLE
|
||||
& itUse . heldTriggerType .~ AutoTrigger
|
||||
|
||||
burstRifle :: Item
|
||||
burstRifle =
|
||||
|
||||
@@ -34,7 +34,6 @@ flameSpitter =
|
||||
& itUse . heldParams . weaponInvLock .~ 10
|
||||
& itUse . heldParams . weaponRepeat .~ [1..9]
|
||||
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect . nzPressure .~ UniRandFloat 3 4
|
||||
& itUse . heldTriggerType .~ HammerTrigger
|
||||
|
||||
flameTorrent :: Item
|
||||
flameTorrent =
|
||||
@@ -97,4 +96,3 @@ flameThrower =
|
||||
, _weaponInvLock = 0
|
||||
, _weaponRepeat = mempty
|
||||
}
|
||||
& itUse . heldTriggerType .~ AutoTrigger
|
||||
|
||||
@@ -56,11 +56,7 @@ pistol =
|
||||
& itType .~ HELD PISTOL
|
||||
|
||||
autoPistol :: Item
|
||||
autoPistol =
|
||||
pistol
|
||||
& itUse . heldTriggerType .~ AutoTrigger
|
||||
-- & itUse . heldParams . bulGunSound ?~ (tap1S, 0)
|
||||
& itType .~ HELD AUTOPISTOL
|
||||
autoPistol = pistol & itType .~ HELD AUTOPISTOL
|
||||
|
||||
machinePistol :: Item
|
||||
machinePistol =
|
||||
|
||||
Reference in New Issue
Block a user