Move UseDelay out of records
This commit is contained in:
@@ -7,6 +7,7 @@ module Dodge.Item.Display (
|
||||
itemInternalValue,
|
||||
) where
|
||||
|
||||
import Dodge.Item.UseDelay
|
||||
import ShortShow
|
||||
import Data.Maybe
|
||||
import Dodge.Data.World
|
||||
@@ -41,7 +42,7 @@ itemInternalValue itm
|
||||
|
||||
|
||||
maybeWarmupStatus :: Item -> Maybe String
|
||||
maybeWarmupStatus it = case it ^? itUse . heldDelay . warmMax of
|
||||
maybeWarmupStatus it = case useDelay it ^? warmMax of
|
||||
Nothing -> Nothing
|
||||
--Just m -> case m - (_warmTime . _heldDelay $ _itUse it) of
|
||||
Just m -> case m - (_wTime $ _itParams it) of
|
||||
|
||||
@@ -21,7 +21,7 @@ teslaGun =
|
||||
defaultHeldItem
|
||||
-- & itUse . heldParams .~ BeamShooterParams-- (Just (elecCrackleS, 2))
|
||||
& itParams .~ teslaParams
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
-- & itUse . heldDelay .~ NoDelay
|
||||
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 10 0
|
||||
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||
-- & itUse . heldMuzzles . ix 0 . mzFlareType .~ TeslaGunFlare
|
||||
@@ -43,7 +43,7 @@ laser =
|
||||
defaultHeldItem
|
||||
-- & itUse . heldParams .~ BeamShooterParams-- Nothing
|
||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
-- & itUse . heldDelay .~ NoDelay
|
||||
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 6 0
|
||||
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||
-- & itUse . heldMuzzles . ix 0 . mzFlareType .~ LasGunFlare
|
||||
|
||||
@@ -7,7 +7,6 @@ module Dodge.Item.Held.Cane (
|
||||
miniGunX,
|
||||
) where
|
||||
|
||||
import Dodge.SoundLogic.ExternallyGeneratedSounds
|
||||
import Dodge.Data.Item
|
||||
import Dodge.Default
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
@@ -17,7 +16,7 @@ defaultBangCane :: Item
|
||||
defaultBangCane =
|
||||
defaultBulletWeapon
|
||||
-- & itUse . heldParams . recoil .~ 50
|
||||
& itUse . heldDelay . rateMax .~ 6
|
||||
-- & itUse . heldDelay . rateMax .~ 6
|
||||
-- & itUse . heldMods .~ BangCaneMod
|
||||
-- & itUse . heldAim . aimHandlePos .~ 5
|
||||
|
||||
@@ -56,14 +55,14 @@ burstRifle =
|
||||
rifle
|
||||
& itType .~ HELD BURSTRIFLE
|
||||
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0.05
|
||||
& itUse . heldDelay . rateMax .~ 6
|
||||
-- & itUse . heldDelay . rateMax .~ 6
|
||||
|
||||
miniGunX :: Int -> Item
|
||||
miniGunX i =
|
||||
autoRifle
|
||||
& itUse . heldDelay .~ WarmUpNoDelay{
|
||||
--_warmTime = 0,
|
||||
_warmMax = 100, _warmSound = crankSlowS}
|
||||
-- & itUse . heldDelay .~ WarmUpNoDelay{
|
||||
-- --_warmTime = 0,
|
||||
-- _warmMax = 100, _warmSound = crankSlowS}
|
||||
& itAmmoSlots .~ singleAmmo BeltBulletAmmo
|
||||
-- & itUse . heldMuzzles
|
||||
-- .~ replicate i
|
||||
|
||||
@@ -13,7 +13,7 @@ import Dodge.Default.Item
|
||||
bangCone :: Item
|
||||
bangCone =
|
||||
defaultBulletWeapon
|
||||
& itUse . heldDelay . rateMax .~ 20
|
||||
-- & itUse . heldDelay . rateMax .~ 20
|
||||
-- & itUse . heldMuzzles
|
||||
-- .~ [Muzzle (V2 15 0) 0 0.5 0 BasicFlare MuzzleShootBullet (UseUpTo 15) 0]
|
||||
& itType .~ HELD BANGCONE
|
||||
|
||||
@@ -14,7 +14,7 @@ import qualified IntMapHelp as IM
|
||||
rLauncher :: Item
|
||||
rLauncher =
|
||||
defaultHeldItem
|
||||
& itUse . heldDelay . rateMax .~ 20
|
||||
-- & itUse . heldDelay . rateMax .~ 20
|
||||
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleRLauncher
|
||||
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 20 0
|
||||
|
||||
@@ -18,7 +18,7 @@ import LensHelp
|
||||
bangRod :: Item
|
||||
bangRod =
|
||||
defaultBulletWeapon
|
||||
& itUse . heldDelay . rateMax .~ 12
|
||||
-- & itUse . heldDelay . rateMax .~ 12
|
||||
& itType .~ HELD BANGROD
|
||||
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 30 0
|
||||
-- & itUse . heldMuzzles . ix 0 . mzFlareType .~ HeavySmokeFlare
|
||||
|
||||
@@ -24,7 +24,7 @@ flameSpitter :: Item
|
||||
flameSpitter =
|
||||
flameThrower
|
||||
& itType .~ HELD FLAMESPITTER
|
||||
& itUse . heldDelay .~ FixedRate{_rateMax = 3} --, _rateTimeLastUsed = 0}
|
||||
-- & itUse . heldDelay .~ FixedRate{_rateMax = 3} --, _rateTimeLastUsed = 0}
|
||||
-- & itUse . heldParams . weaponInvLock .~ 10
|
||||
-- & itUse . heldParams . weaponRepeat .~ [1..9]
|
||||
-- & itUse . heldMuzzles . ix 0 . mzEffect . nzPressure .~ UniRandFloat 3 4
|
||||
@@ -65,7 +65,7 @@ flameThrower :: Item
|
||||
flameThrower =
|
||||
defaultHeldItem
|
||||
& itParams .~ NozzleAngle 0
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
-- & itUse . heldDelay .~ NoDelay
|
||||
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 5, _izMin = 1.5}
|
||||
-- & itUse . heldMuzzles .~ [Muzzle (V2 18 0) 0 0 0 NoFlare
|
||||
-- MuzzleNozzle
|
||||
|
||||
@@ -9,7 +9,6 @@ module Dodge.Item.Held.Stick (
|
||||
--import Dodge.Base
|
||||
import Dodge.Data.Item
|
||||
import Dodge.Default.Item
|
||||
import Dodge.SoundLogic.ExternallyGeneratedSounds
|
||||
--import Geometry
|
||||
import LensHelp
|
||||
|
||||
@@ -18,7 +17,7 @@ bangStick i =
|
||||
defaultBulletWeapon
|
||||
-- & itUse . heldParams . recoil .~ 25
|
||||
& itType .~ HELD (BANGSTICK i)
|
||||
& itUse . heldDelay . rateMax .~ 8
|
||||
-- & itUse . heldDelay . rateMax .~ 8
|
||||
-- & itUse . heldMuzzles
|
||||
-- .~ [ Muzzle
|
||||
-- (V2 10 0)
|
||||
@@ -41,7 +40,7 @@ bangStick i =
|
||||
pistol :: Item
|
||||
pistol =
|
||||
bangStick 1
|
||||
& itUse . heldDelay . rateMax .~ 6
|
||||
-- & itUse . heldDelay . rateMax .~ 6
|
||||
-- & itUse . heldMuzzles . ix 0 . mzPos %~ const (V2 10 0)
|
||||
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy %~ const 0.05
|
||||
-- & itUse . heldMuzzles . ix 0 . mzFlareType %~ const BasicFlare
|
||||
@@ -53,9 +52,9 @@ autoPistol = pistol & itType .~ HELD AUTOPISTOL
|
||||
machinePistol :: Item
|
||||
machinePistol =
|
||||
autoPistol
|
||||
& itUse . heldDelay .~ WarmUpNoDelay{
|
||||
--_warmTime = 0,
|
||||
_warmMax = 50, _warmSound = crankSlowS}
|
||||
-- & itUse . heldDelay .~ WarmUpNoDelay{
|
||||
-- --_warmTime = 0,
|
||||
-- _warmMax = 50, _warmSound = crankSlowS}
|
||||
& itType .~ HELD MACHINEPISTOL
|
||||
& itParams .~ WarmTime 0
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ detector :: Detector -> Item
|
||||
detector dt =
|
||||
defaultHeldItem
|
||||
& itUseCondition .~ UseableAnytime
|
||||
& itUse . heldDelay . rateMax .~ 20
|
||||
-- & itUse . heldDelay . rateMax .~ 20
|
||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||
& itType .~ DETECTOR dt
|
||||
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleDetector
|
||||
@@ -46,7 +46,7 @@ blinker :: Item
|
||||
blinker =
|
||||
defaultHeldItem
|
||||
& itUseCondition .~ UseableAnytime
|
||||
& itUse . heldDelay . rateMax .~ 20
|
||||
-- & itUse . heldDelay . rateMax .~ 20
|
||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleBlink
|
||||
-- & itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 10000000
|
||||
|
||||
@@ -9,7 +9,7 @@ shatterGun :: Item
|
||||
shatterGun =
|
||||
defaultHeldItem
|
||||
& itType .~ HELD SHATTERGUN
|
||||
& itUse . heldDelay . rateMax .~ 10
|
||||
-- & itUse . heldDelay . rateMax .~ 10
|
||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 30 0
|
||||
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||
|
||||
Reference in New Issue
Block a user