Fix blink bug

This commit is contained in:
2022-10-19 23:17:26 +01:00
parent 4ad19aa19d
commit 21dc670c9f
13 changed files with 353 additions and 312 deletions
+207 -209
View File
@@ -28,309 +28,307 @@ useMod :: HeldMod -> [(Item -> Creature -> World -> World) -> Item -> Creature -
useMod hm = case hm of
HeldModNothing -> []
PoisonSprayerMod ->
[ ammoCheckI
[ useAmmoAmount 1
, withSoundForI foamSprayLoopS 5
, useAmmoAmount 1
, ammoCheckI
]
FlameSpitterMod ->
[ ammoCheckI
, useTimeCheck
, lockInvFor 10
, repeatOnFrames [1 .. 9] FlameSpitterRepeatMod
, withRandomItemParams f
, useAmmoAmount 1
[ withSidePushAfterI 20
, withSidePushI 5
, withSidePushAfterI 20
, useAmmoAmount 1
, withRandomItemParams f
, repeatOnFrames [1 .. 9] FlameSpitterRepeatMod
, lockInvFor 10
, useTimeCheck
, ammoCheckI
]
FlameSpitterRepeatMod ->
[ ammoCheckI
, withRandomItemParams f
, useAmmoAmount 1
[ withSidePushAfterI 20
, withSidePushI 5
, withSidePushAfterI 20
, useAmmoAmount 1
, withRandomItemParams f
, ammoCheckI
]
FlameThrowerMod ->
[ ammoCheckI
, useAmmoAmount 1
[ withSidePushAfterI 20
--, withTempLight 1 100 (V3 1 0 0)
, withSidePushI 5
, --, withTempLight 1 100 (V3 1 0 0)
withSidePushAfterI 20
, useAmmoAmount 1
, ammoCheckI
]
LauncherMod ->
[ hammerCheckI
, ammoCheckI
, useTimeCheck
[ useAmmoAmount 1
, withSoundStart tap4S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
, hammerCheckI
]
TeslaMod ->
[ ammoCheckI
, withTempLight 1 100 (V3 0 0 1)
[ useAmmoAmount 1
, withSoundForI elecCrackleS 1
, useAmmoAmount 1
, withTempLight 1 100 (V3 0 0 1)
, ammoCheckI
]
CircleLaserMod ->
[ ammoCheckI
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withSoundForI tone440sawtoothquietS 2
, useAmmoAmount 1
[ duplicateItem fLasCircle
, withItemUpdate' increasecycleLasCircle
, duplicateItem fLasCircle
, useAmmoAmount 1
, withSoundForI tone440sawtoothquietS 2
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, ammoCheckI
]
LasWideMod n ->
[ ammoCheckI
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withSoundForI tone440sawtoothquietS 2
, useAmmoAmount 1
, crAtMuzPos
[ withItem $ \it -> duplicateOffsetsV2 (xsLasWide it)
, withItemUpdate' (increasecycleLasWide n)
, withItem $ \it -> duplicateOffsetsV2 (xsLasWide it)
, crAtMuzPos
, useAmmoAmount 1
, withSoundForI tone440sawtoothquietS 2
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, ammoCheckI
]
DualBeamMod ->
[ ammoCheckI
, withItem $ \it -> withMuzPosShift (V2 0 (thegapDualBeam it)) $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withItem $ \it -> withMuzPosShift (V2 0 (- thegapDualBeam it)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8
[ useAmmoAmount 1
, withSoundForI tone440sawtoothquietS 2
, useAmmoAmount 1
, withItem $ \it -> withMuzPosShift (V2 0 (- thegapDualBeam it)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8
, withItem $ \it -> withMuzPosShift (V2 0 (thegapDualBeam it)) $ flareCircleAt (_lasColor $ _itParams it) 0.8
, ammoCheckI
]
LasMod ->
[ ammoCheckI
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, withSoundForI tone440sawtoothquietS 2
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
[ crAtMuzPos
, useAmmoAmount 1
, crAtMuzPos
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withSoundForI tone440sawtoothquietS 2
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, ammoCheckI
]
LauncherXMod i ->
[ hammerCheckI
, ammoCheckI
, useTimeCheck
[ useAmmoAmount i
, withSoundStart tap4S
, useAmmoAmount i
, useTimeCheck
, ammoCheckI
, hammerCheckI
]
ShatterMod ->
[ ammoHammerCheck
[ useAmmoAmount 1
-- , withSoundStart tap3S
, useTimeCheck
, -- , withSoundStart tap3S
useAmmoAmount 1
, ammoHammerCheck
]
AmmoCheckMod -> [ammoCheckI]
AmmoUseCheckMod -> [ammoUseCheck]
AmmoHammerTimeUseOneMod ->
[ ammoHammerCheck
[ useAmmoAmount 1
, useTimeCheck
, useAmmoAmount 1
, ammoHammerCheck
]
BangCaneMod ->
[ ammoHammerCheck
, useTimeCheck
, withSoundStart tap3S
, useAmmoAmount 1
, withTorqueAfter
, applyInaccuracy
, withRecoil
[ withMuzFlareI
, withSmoke 1 black 20 200 5
, withMuzFlareI
, withRecoil
, applyInaccuracy
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart tap3S
, useTimeCheck
, ammoHammerCheck
]
VolleyGunMod ->
[ ammoHammerCheck
, useTimeCheck
, withSoundItemChoiceStart caneStickSoundChoice
, useAllAmmo
, withTorqueAfter
, duplicateLoadedBarrels
, applyInaccuracy
[ withRecoil
, withMuzFlareI
, withRecoil
, applyInaccuracy
, duplicateLoadedBarrels
, withTorqueAfter
, useAllAmmo
, withSoundItemChoiceStart caneStickSoundChoice
, useTimeCheck
, ammoHammerCheck
]
AutoRifleMod ->
-- note this is the same as BangCanemMod with the first changed
[ ammoCheckI
, useTimeCheck
, withSoundStart tap3S
, useAmmoAmount 1
, withTorqueAfter
, applyInaccuracy
, withRecoil
[ withMuzFlareI
, withSmoke 1 black 20 200 5
, withMuzFlareI
, withRecoil
, applyInaccuracy
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart tap3S
, useTimeCheck
, ammoCheckI
]
BangRodMod ->
[ ammoHammerCheck
, useTimeCheck
, withSoundStart bangEchoS
, useAmmoAmount 1
, withTorqueAfter
, applyInaccuracy
, withThickSmokeI
[ withRecoil
, withMuzFlareI
, withRecoil
, withThickSmokeI
, applyInaccuracy
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart bangEchoS
, useTimeCheck
, ammoHammerCheck
]
ElephantGunMod ->
[ ammoHammerCheck
, useTimeCheck
, withSoundStart bangEchoS
, useAmmoAmount 1
, withTorqueAfter
, applyInaccuracy
, withThickSmokeI
[ withRecoil
, withMuzFlareI
, withRecoil
, withThickSmokeI
, applyInaccuracy
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart bangEchoS
, useTimeCheck
, ammoHammerCheck
]
AutoAmrMod ->
[ ammoCheckI -- cf ElephantGun
, useTimeCheck
, withSoundStart bangEchoS
, useAmmoAmount 1
, withTorqueAfter
, applyInaccuracy
, withThickSmokeI
[ withRecoil
, withMuzFlareI
, withRecoil
, withThickSmokeI
, applyInaccuracy
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart bangEchoS
, useTimeCheck
, ammoCheckI -- cf ElephantGun
]
MachineGunMod ->
[ ammoCheckI
, rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter
, withSoundStart bangEchoS
[ withMuzFlareI
, withThinSmokeI
, withMuzFlareI
, withSoundStart bangEchoS
, rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter
, ammoCheckI
]
ModWithDirectedTeleport hm' ->
withPosDirWallCheck directedTelPos : useMod hm'
reverse $ withPosDirWallCheck directedTelPos : useMod hm'
BangStickMod ->
[ ammoHammerCheck
, useTimeCheck
, withSoundItemChoiceStart bangStickSoundChoice
, useAllAmmo
, withMuzFlareI
, withTorqueAfter
[ withRecoil
-- , applyInaccuracy
, spreadLoaded
, -- , applyInaccuracy
withRecoil
, withTorqueAfter
, withMuzFlareI
, useAllAmmo
, withSoundItemChoiceStart bangStickSoundChoice
, useTimeCheck
, ammoHammerCheck
]
PistolMod ->
[ ammoHammerCheck
, useTimeCheck
, useAmmoAmount 1
, withSoundStart tap3S
, applyInaccuracy
, withTorqueAfter
, withRecoil
[ withMuzFlareI
, withSidePushI 50
, withMuzFlareI
, withRecoil
, withTorqueAfter
, applyInaccuracy
, withSoundStart tap3S
, useAmmoAmount 1
, useTimeCheck
, ammoHammerCheck
]
AutoPistolMod ->
[ ammoCheckI
, useTimeCheck
, useAmmoAmount 1
, withSoundStart tap3S
, applyInaccuracy
, withTorqueAfter
, withRecoil
[ withMuzFlareI
, withSidePushI 50
, withMuzFlareI
, withRecoil
, withTorqueAfter
, applyInaccuracy
, withSoundStart tap3S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
]
MachinePistolMod ->
[ ammoCheckI
, useTimeCheck
, useAmmoAmount 1
, withSoundStart tap1S
, applyInaccuracy
, withTorqueAfter
, withSidePushI 50
[ withMuzFlareI
, withRecoil
, withMuzFlareI
, withSidePushI 50
, withTorqueAfter
, applyInaccuracy
, withSoundStart tap1S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
]
BurstRifleMod ->
[ ammoHammerCheck
, useTimeCheck
, sideEffectOnFrame 7 (\_ cr -> TorqueCr 0.2 (_crID cr)) --(torqueSideEffect 0.2)
, lockInvFor 7
, repeatOnFrames [3, 6] BurstRifleRepeatMod
, withSoundStart tap3S
, useAmmoAmount 1
, applyInaccuracy
[ withRecoil
, withMuzFlareI
, withRecoil
, applyInaccuracy
, useAmmoAmount 1
, withSoundStart tap3S
, repeatOnFrames [3, 6] BurstRifleRepeatMod
, lockInvFor 7
, sideEffectOnFrame 7 (\_ cr -> TorqueCr 0.2 (_crID cr)) --(torqueSideEffect 0.2)
, useTimeCheck
, ammoHammerCheck
]
BurstRifleRepeatMod ->
[ ammoCheckI
, sideEffectOnFrame 7 (\_ cr -> TorqueCr 0.2 (_crID cr)) --(torqueSideEffect 0.2)
, withSoundStart tap3S
, useAmmoAmount 1
, applyInaccuracy
[ withRecoil
, withMuzFlareI
, withRecoil
, applyInaccuracy
, useAmmoAmount 1
, withSoundStart tap3S
, sideEffectOnFrame 7 (\_ cr -> TorqueCr 0.2 (_crID cr)) --(torqueSideEffect 0.2)
, ammoCheckI
]
MiniGunMod i ->
[ ammoCheckI
, withWarmUp crankSlowS
, withSoundForI mini1S 2
, --, withThinSmokeI
withSmoke 1 black 20 200 5
, withMuzFlareI
, useAmmoAmount i
, withSidePushI (fromIntegral i * 50)
, torqueBefore (fromIntegral i * 0.05)
, afterRecoil (fromIntegral i * 5)
]
<> [ trigDoAlso' (moddelay x) (modcrpos x) useAmmoParams
reverse [ trigDoAlso' (moddelay x) (modcrpos x) useAmmoParams
| x <- map ((/ fromIntegral i) . fromIntegral) [1 .. i -1]
]
SmgMod ->
[ ammoCheckI
, useTimeCheck
, useAmmoAmount 1
, withSoundStart tap3S
, applyInaccuracy
, withTorqueAfter
, withRecoil
, withSidePushI 30
<>
[ afterRecoil (fromIntegral i * 5)
, torqueBefore (fromIntegral i * 0.05)
, withSidePushI (fromIntegral i * 50)
, useAmmoAmount i
, withMuzFlareI
, withSmoke 1 black 20 200 5
--, withThinSmokeI
, withSoundForI mini1S 2
, withWarmUp crankSlowS
, ammoCheckI
]
SmgMod ->
[ withMuzFlareI
, withSidePushI 30
, withRecoil
, withTorqueAfter
, applyInaccuracy
, withSoundStart tap3S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
]
RevolverXMod ->
[ ammoHammerCheck
, useTimeCheck
, -- rather than locking the inventory, a better solution may be to check
-- that the weapon is still in your hands in the repeated frames
lockInvFor 10
, repeatOnFrames [2, 4, 6, 8, 10] RevolverXRepeatMod
, withSoundStart tap3S
, useAmmoUpTo 1
, applyInaccuracy
[ withRecoil
, withTorqueAfter
-- , spreadLoaded
, withMuzFlareI
, -- , spreadLoaded
withTorqueAfter
, withRecoil
, applyInaccuracy
, useAmmoUpTo 1
, withSoundStart tap3S
, repeatOnFrames [2, 4, 6, 8, 10] RevolverXRepeatMod
, lockInvFor 10
-- rather than locking the inventory, a better solution may be to check
-- that the weapon is still in your hands in the repeated frames
, useTimeCheck
, ammoHammerCheck
]
RevolverXRepeatMod ->
[ ammoCheckI
, -- rather than locking the inventory, a better solution may be to check
-- that the weapon is still in your hands in the repeated frames
withSoundStart tap3S
, useAmmoUpTo 1
, applyInaccuracy
[ withRecoil
, withTorqueAfter
, withMuzFlareI
, -- , spreadLoaded
withTorqueAfter
, withRecoil
, applyInaccuracy
, useAmmoUpTo 1
, withSoundStart tap3S
, ammoCheckI
]
BangConeMod ->
[ ammoCheckI
, hammerCheckI
, useTimeCheck
, withSoundStart bangEchoS
, useAllAmmo
, withTorqueAfter
, withRecoil
, duplicateLoaded
, withMuzFlareI
, applyInaccuracy
, withRandomOffset
[ withRandomItemParams coneRandItemParams
, withRandomItemUpdate coneRandItemUpdate
, withRandomItemParams coneRandItemParams
, withRandomOffset
, applyInaccuracy
, withMuzFlareI
, duplicateLoaded
, withRecoil
, withTorqueAfter
, useAllAmmo
, withSoundStart bangEchoS
, useTimeCheck
, hammerCheckI
, ammoCheckI
]
where
f = do