Mid refactor of item ruse--broken
This commit is contained in:
@@ -39,7 +39,7 @@ moduleModification imt = case imt of
|
|||||||
where
|
where
|
||||||
makeDirectedTele it = it
|
makeDirectedTele it = it
|
||||||
& itTargeting .~ targetRBPress
|
& itTargeting .~ targetRBPress
|
||||||
& itUse . useMods .:~ withPosDirWallCheck directedTelPos
|
& itUse . useMods %~ ModWithDirectedTeleport -- .:~ withPosDirWallCheck directedTelPos
|
||||||
-- for the camera: the simplest option is to remove all zoom/offset
|
-- for the camera: the simplest option is to remove all zoom/offset
|
||||||
& itUse . useAim . aimZoom . itZoomFac .~ 1
|
& itUse . useAim . aimZoom . itZoomFac .~ 1
|
||||||
& itUse . useAim . aimRange .~ 0
|
& itUse . useAim . aimRange .~ 0
|
||||||
|
|||||||
+1
-1
@@ -404,7 +404,7 @@ data ItemUse
|
|||||||
= RightUse
|
= RightUse
|
||||||
{ _rUse :: HeldUse -- Item -> Creature -> World -> World
|
{ _rUse :: HeldUse -- Item -> Creature -> World -> World
|
||||||
, _useDelay :: UseDelay
|
, _useDelay :: UseDelay
|
||||||
, _useMods :: [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
|
, _useMods :: HeldMod --[(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
|
||||||
, _useHammer :: HammerPosition
|
, _useHammer :: HammerPosition
|
||||||
, _useAim :: AimParams
|
, _useAim :: AimParams
|
||||||
, _heldScroll :: HeldScroll --Float -> Creature -> Item -> Item
|
, _heldScroll :: HeldScroll --Float -> Creature -> Item -> Item
|
||||||
|
|||||||
@@ -18,4 +18,27 @@ data HeldUse = HeldDoNothing
|
|||||||
| HeldForceField
|
| HeldForceField
|
||||||
| HeldShatter
|
| HeldShatter
|
||||||
|
|
||||||
data HeldUseMods = HeldModsDoNothing
|
data HeldMod = HeldModNothing
|
||||||
|
| PoisonSprayerMod
|
||||||
|
| FlameSpitterMod
|
||||||
|
| FlameThrowerMod
|
||||||
|
| LauncherMod
|
||||||
|
| TeslaMod
|
||||||
|
| CircleLaserMod
|
||||||
|
| LasWideMod
|
||||||
|
| DualBeamMod
|
||||||
|
| LasMod
|
||||||
|
| LauncherXMod
|
||||||
|
| ShatterMod
|
||||||
|
| AmmoCheckMod
|
||||||
|
| AmmoUseCheckMod
|
||||||
|
| AmmoHammerTimeUseOneMod
|
||||||
|
| BangCaneMod
|
||||||
|
| VolleyGunMod
|
||||||
|
| AutoRifleMod
|
||||||
|
| BangRodMod
|
||||||
|
| ElephantGunMod
|
||||||
|
| AutoAmrMod
|
||||||
|
| MachineGunMod
|
||||||
|
| ModWithDirectedTeleport HeldMod
|
||||||
|
| BangStickMod
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ defaultrUse :: ItemUse
|
|||||||
defaultrUse = RightUse
|
defaultrUse = RightUse
|
||||||
{ _rUse = HeldDoNothing
|
{ _rUse = HeldDoNothing
|
||||||
, _useDelay = FixedRate {_rateMax = 8, _rateTime = 0}
|
, _useDelay = FixedRate {_rateMax = 8, _rateTime = 0}
|
||||||
, _useMods = []
|
, _useMods = HeldModNothing
|
||||||
, _useHammer = HammerUp
|
, _useHammer = HammerUp
|
||||||
, _useAim = defaultAimParams
|
, _useAim = defaultAimParams
|
||||||
, _heldScroll = HeldScrollDoNothing
|
, _heldScroll = HeldScrollDoNothing
|
||||||
|
|||||||
@@ -17,6 +17,189 @@ import RandomHelp
|
|||||||
|
|
||||||
import Data.Traversable
|
import Data.Traversable
|
||||||
|
|
||||||
|
useMod :: HeldMod -> [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
|
||||||
|
useMod hm = case hm of
|
||||||
|
HeldModNothing -> []
|
||||||
|
PoisonSprayerMod ->
|
||||||
|
[ ammoCheckI
|
||||||
|
, withSoundForI foamSprayLoopS 5
|
||||||
|
, useAmmoAmount 1
|
||||||
|
]
|
||||||
|
FlameSpitterMod ->
|
||||||
|
[ ammoCheckI
|
||||||
|
, useTimeCheck
|
||||||
|
, lockInvFor 10
|
||||||
|
, repeatOnFrames [1..9]
|
||||||
|
, withRandomItemParams f
|
||||||
|
, useAmmoAmount 1
|
||||||
|
, withSidePushI 5
|
||||||
|
, withSidePushAfterI 20
|
||||||
|
]
|
||||||
|
FlameThrowerMod ->
|
||||||
|
[ ammoCheckI
|
||||||
|
, useAmmoAmount 1
|
||||||
|
, withSidePushI 5
|
||||||
|
--, withTempLight 1 100 (V3 1 0 0)
|
||||||
|
, withSidePushAfterI 20
|
||||||
|
]
|
||||||
|
LauncherMod ->
|
||||||
|
[ hammerCheckI
|
||||||
|
, ammoCheckI
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundStart tap4S
|
||||||
|
, useAmmoAmount 1
|
||||||
|
]
|
||||||
|
TeslaMod ->
|
||||||
|
[ ammoCheckI
|
||||||
|
, withTempLight 1 100 (V3 0 0 1)
|
||||||
|
, withSoundForI elecCrackleS 1
|
||||||
|
, useAmmoAmount 1
|
||||||
|
]
|
||||||
|
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
|
||||||
|
, withItemUpdate' increasecycle
|
||||||
|
, duplicateItem f
|
||||||
|
]
|
||||||
|
LasWideMod ->
|
||||||
|
[ 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
|
||||||
|
, withItemUpdate' increasecycle
|
||||||
|
, withItem $ \it -> duplicateOffsetsV2 (xs it)
|
||||||
|
]
|
||||||
|
DualBeamMod ->
|
||||||
|
[ ammoCheckI
|
||||||
|
, withItem $ \it -> withMuzPosShift (V2 0 (thegap it)) $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
||||||
|
, withItem $ \it -> withMuzPosShift (V2 0 (-thegap it)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8
|
||||||
|
, withSoundForI tone440sawtoothquietS 2
|
||||||
|
, useAmmoAmount 1
|
||||||
|
]
|
||||||
|
LasMod ->
|
||||||
|
[ ammoCheckI
|
||||||
|
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
|
||||||
|
, withSoundForI tone440sawtoothquietS 2
|
||||||
|
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
||||||
|
, useAmmoAmount 1
|
||||||
|
, crAtMuzPos
|
||||||
|
]
|
||||||
|
LauncherXMod ->
|
||||||
|
[ hammerCheckI
|
||||||
|
, ammoCheckI
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundStart tap4S
|
||||||
|
, useAmmoAmount i
|
||||||
|
]
|
||||||
|
ShatterMod ->
|
||||||
|
[ ammoHammerCheck
|
||||||
|
, useTimeCheck
|
||||||
|
-- , withSoundStart tap3S
|
||||||
|
, useAmmoAmount 1
|
||||||
|
]
|
||||||
|
AmmoCheckMod -> [ ammoCheckI ]
|
||||||
|
AmmoUseCheckMod -> [ ammoUseCheck ]
|
||||||
|
AmmoHammerTimeUseOneMod ->
|
||||||
|
[ ammoHammerCheck
|
||||||
|
, useTimeCheck
|
||||||
|
, useAmmoAmount 1
|
||||||
|
]
|
||||||
|
BangCaneMod ->
|
||||||
|
[ ammoHammerCheck
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundStart tap3S
|
||||||
|
, useAmmoAmount 1
|
||||||
|
, withTorqueAfter
|
||||||
|
, applyInaccuracy
|
||||||
|
, withRecoil
|
||||||
|
, withSmoke 1 black 20 200 5
|
||||||
|
, withMuzFlareI
|
||||||
|
]
|
||||||
|
VolleyGunMod ->
|
||||||
|
[ ammoHammerCheck
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundItemChoiceStart caneStickSoundChoice
|
||||||
|
, useAllAmmo
|
||||||
|
, withTorqueAfter
|
||||||
|
, duplicateLoadedBarrels
|
||||||
|
, applyInaccuracy
|
||||||
|
, withMuzFlareI
|
||||||
|
, withRecoil
|
||||||
|
]
|
||||||
|
AutoRifleMod -> -- note this is the same as BangCanemMod with the first changed
|
||||||
|
[ ammoCheckI
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundStart tap3S
|
||||||
|
, useAmmoAmount 1
|
||||||
|
, withTorqueAfter
|
||||||
|
, applyInaccuracy
|
||||||
|
, withRecoil
|
||||||
|
, withSmoke 1 black 20 200 5
|
||||||
|
, withMuzFlareI
|
||||||
|
]
|
||||||
|
BangRodMod ->
|
||||||
|
[ ammoHammerCheck
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundStart bangEchoS
|
||||||
|
, useAmmoAmount 1
|
||||||
|
, withTorqueAfter
|
||||||
|
, applyInaccuracy
|
||||||
|
, withThickSmokeI
|
||||||
|
, withMuzFlareI
|
||||||
|
, withRecoil
|
||||||
|
]
|
||||||
|
ElephantGunMod ->
|
||||||
|
[ ammoHammerCheck
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundStart bangEchoS
|
||||||
|
, useAmmoAmount 1
|
||||||
|
, withTorqueAfter
|
||||||
|
, applyInaccuracy
|
||||||
|
, withThickSmokeI
|
||||||
|
, withMuzFlareI
|
||||||
|
, withRecoil
|
||||||
|
]
|
||||||
|
AutoAmrMod ->
|
||||||
|
[ ammoCheckI -- cf ElephantGun
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundStart bangEchoS
|
||||||
|
, useAmmoAmount 1
|
||||||
|
, withTorqueAfter
|
||||||
|
, applyInaccuracy
|
||||||
|
, withThickSmokeI
|
||||||
|
, withMuzFlareI
|
||||||
|
, withRecoil
|
||||||
|
]
|
||||||
|
MachineGunMod ->
|
||||||
|
[ ammoCheckI
|
||||||
|
, rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter
|
||||||
|
, withSoundStart bangEchoS
|
||||||
|
, withThinSmokeI
|
||||||
|
, withMuzFlareI
|
||||||
|
]
|
||||||
|
ModWithDirectedTeleport hm' ->
|
||||||
|
withPosDirWallCheck directedTelPos : useMod hm'
|
||||||
|
BangStickMod ->
|
||||||
|
[ ammoHammerCheck
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundItemChoiceStart bangStickSoundChoice
|
||||||
|
, useAllAmmo
|
||||||
|
, withMuzFlareI
|
||||||
|
, withTorqueAfter
|
||||||
|
, spreadLoaded
|
||||||
|
-- , applyInaccuracy
|
||||||
|
, withRecoil
|
||||||
|
]
|
||||||
|
where
|
||||||
|
f = do
|
||||||
|
nzpres <- state $ randomR (3,4)
|
||||||
|
return $ sprayNozzles . ix 0 . nzPressure .~ nzpres
|
||||||
|
|
||||||
useHeld :: HeldUse -> Item -> Creature -> World -> World
|
useHeld :: HeldUse -> Item -> Creature -> World -> World
|
||||||
useHeld hu = case hu of
|
useHeld hu = case hu of
|
||||||
HeldDoNothing -> const $ const id
|
HeldDoNothing -> const $ const id
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ flatShield = defaultWeapon
|
|||||||
& itUse .~ defaultrUse
|
& itUse .~ defaultrUse
|
||||||
{ _rUse = HeldDoNothing
|
{ _rUse = HeldDoNothing
|
||||||
, _useDelay = NoDelay
|
, _useDelay = NoDelay
|
||||||
, _useMods = []
|
, _useMods = HeldModNothing
|
||||||
, _useHammer = HammerUp
|
, _useHammer = HammerUp
|
||||||
, _useAim = AimParams
|
, _useAim = AimParams
|
||||||
{ _aimWeight = 5
|
{ _aimWeight = 5
|
||||||
|
|||||||
@@ -77,12 +77,7 @@ teslaGun = defaultBatteryGun
|
|||||||
& itParams .~ teslaParams
|
& itParams .~ teslaParams
|
||||||
& itUse . rUse .~ HeldTeslaArc --shootTeslaArc
|
& itUse . rUse .~ HeldTeslaArc --shootTeslaArc
|
||||||
& itUse . useDelay .~ NoDelay
|
& itUse . useDelay .~ NoDelay
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ TeslaMod
|
||||||
[ ammoCheckI
|
|
||||||
, withTempLight 1 100 (V3 0 0 1)
|
|
||||||
, withSoundForI elecCrackleS 1
|
|
||||||
, useAmmoAmount 1
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& itUse . useAim . aimStance .~ TwoHandFlat
|
& itUse . useAim . aimStance .~ TwoHandFlat
|
||||||
& itUse . useAim . aimHandlePos .~ 4
|
& itUse . useAim . aimHandlePos .~ 4
|
||||||
@@ -115,15 +110,7 @@ lasCircle = lasGun
|
|||||||
& itUse . rUse .~ HeldLaser --shootLaser
|
& itUse . rUse .~ HeldLaser --shootLaser
|
||||||
& itUse . useDelay .~ NoDelay
|
& itUse . useDelay .~ NoDelay
|
||||||
& itUse . rUse .~ HeldCircleLaser --circleLaser
|
& itUse . rUse .~ HeldCircleLaser --circleLaser
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ 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
|
|
||||||
, withItemUpdate' increasecycle
|
|
||||||
, duplicateItem f
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
@@ -137,16 +124,7 @@ lasWide n = lasGun
|
|||||||
& itType . iyBase .~ HELD (LASWIDE n)
|
& itType . iyBase .~ HELD (LASWIDE n)
|
||||||
& itParams . lasColor .~ yellow
|
& itParams . lasColor .~ yellow
|
||||||
& itParams . lasDamage .~ 2
|
& itParams . lasDamage .~ 2
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ LasWideMod
|
||||||
[ 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
|
|
||||||
, withItemUpdate' increasecycle
|
|
||||||
, withItem $ \it -> duplicateOffsetsV2 (xs it)
|
|
||||||
]
|
|
||||||
where
|
where
|
||||||
increasecycle it = case _useHammer (_itUse it) of
|
increasecycle it = case _useHammer (_itUse it) of
|
||||||
HammerUp -> it & itParams . lasCycle .~ 1
|
HammerUp -> it & itParams . lasCycle .~ 1
|
||||||
@@ -236,13 +214,7 @@ dualBeam = lasGun
|
|||||||
}
|
}
|
||||||
& itUse . rUse .~ HeldDualLaser --shootDualLaser
|
& itUse . rUse .~ HeldDualLaser --shootDualLaser
|
||||||
& itUse . useDelay .~ NoDelay
|
& itUse . useDelay .~ NoDelay
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ DualBeamMod
|
||||||
[ ammoCheckI
|
|
||||||
, withItem $ \it -> withMuzPosShift (V2 0 (thegap it)) $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
|
||||||
, withItem $ \it -> withMuzPosShift (V2 0 (-thegap it)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8
|
|
||||||
, withSoundForI tone440sawtoothquietS 2
|
|
||||||
, useAmmoAmount 1
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ TwoHandFlat
|
& itUse . useAim . aimStance .~ TwoHandFlat
|
||||||
@@ -288,14 +260,7 @@ lasGun = defaultAutoBatteryGun
|
|||||||
& itDimension . dimCenter .~ V3 15 0 0
|
& itDimension . dimCenter .~ V3 15 0 0
|
||||||
& itUse . rUse .~ HeldLaser --shootLaser
|
& itUse . rUse .~ HeldLaser --shootLaser
|
||||||
& itUse . useDelay .~ NoDelay
|
& itUse . useDelay .~ NoDelay
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ LasMod
|
||||||
[ ammoCheckI
|
|
||||||
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
|
|
||||||
, withSoundForI tone440sawtoothquietS 2
|
|
||||||
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
|
||||||
, useAmmoAmount 1
|
|
||||||
, crAtMuzPos
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
@@ -334,9 +299,7 @@ tractorGun = lasGun
|
|||||||
}
|
}
|
||||||
& itUse . rUse .~ HeldTractor --aTractorBeam
|
& itUse . rUse .~ HeldTractor --aTractorBeam
|
||||||
& itUse . useDelay .~ NoDelay
|
& itUse . useDelay .~ NoDelay
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ AmmoCheckMod
|
||||||
[ ammoCheckI
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
|
|||||||
@@ -37,17 +37,7 @@ defaultBangCane = defaultBulletWeapon
|
|||||||
& itDimension . dimRad .~ 8
|
& itDimension . dimRad .~ 8
|
||||||
& itDimension . dimCenter .~ V3 5 0 0
|
& itDimension . dimCenter .~ V3 5 0 0
|
||||||
& itUse . useDelay . rateMax .~ 6
|
& itUse . useDelay . rateMax .~ 6
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ BangCaneMod
|
||||||
[ ammoHammerCheck
|
|
||||||
, useTimeCheck
|
|
||||||
, withSoundStart tap3S
|
|
||||||
, useAmmoAmount 1
|
|
||||||
, withTorqueAfter
|
|
||||||
, applyInaccuracy
|
|
||||||
, withRecoil
|
|
||||||
, withSmoke 1 black 20 200 5
|
|
||||||
, withMuzFlareI
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimStance .~ OneHand
|
& itUse . useAim . aimStance .~ OneHand
|
||||||
& itUse . useAim . aimHandlePos .~ 5
|
& itUse . useAim . aimHandlePos .~ 5
|
||||||
& itUse . useAim . aimMuzPos .~ 15
|
& itUse . useAim . aimMuzPos .~ 15
|
||||||
@@ -57,17 +47,7 @@ defaultBangCane = defaultBulletWeapon
|
|||||||
volleyGun :: Int -> Item
|
volleyGun :: Int -> Item
|
||||||
volleyGun i = defaultBangCane
|
volleyGun i = defaultBangCane
|
||||||
& itUse . useDelay . rateMax .~ 6
|
& itUse . useDelay . rateMax .~ 6
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ VolleyGunMod
|
||||||
[ ammoHammerCheck
|
|
||||||
, useTimeCheck
|
|
||||||
, withSoundItemChoiceStart caneStickSoundChoice
|
|
||||||
, useAllAmmo
|
|
||||||
, withTorqueAfter
|
|
||||||
, duplicateLoadedBarrels
|
|
||||||
, applyInaccuracy
|
|
||||||
, withMuzFlareI
|
|
||||||
, withRecoil
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ TwoHandFlat
|
& itUse . useAim . aimStance .~ TwoHandFlat
|
||||||
@@ -119,7 +99,7 @@ repeater = rifle
|
|||||||
autoRifle :: Item
|
autoRifle :: Item
|
||||||
autoRifle = repeater
|
autoRifle = repeater
|
||||||
& itType . iyBase .~ HELD AUTORIFLE
|
& itType . iyBase .~ HELD AUTORIFLE
|
||||||
& itUse . useMods %~ ((ammoCheckI :) . tail)
|
& itUse . useMods .~ AutoRifleMod
|
||||||
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
|
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
|
||||||
-- & itUse . useDelay . rateMax .~ 6
|
-- & itUse . useDelay . rateMax .~ 6
|
||||||
burstRifle :: Item
|
burstRifle :: Item
|
||||||
|
|||||||
@@ -35,17 +35,7 @@ bangRod = defaultBulletWeapon
|
|||||||
, _randomOffset = 0
|
, _randomOffset = 0
|
||||||
}
|
}
|
||||||
& itUse . useDelay . rateMax .~ 12
|
& itUse . useDelay . rateMax .~ 12
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ BangRodMod
|
||||||
[ ammoHammerCheck
|
|
||||||
, useTimeCheck
|
|
||||||
, withSoundStart bangEchoS
|
|
||||||
, useAmmoAmount 1
|
|
||||||
, withTorqueAfter
|
|
||||||
, applyInaccuracy
|
|
||||||
, withThickSmokeI
|
|
||||||
, withMuzFlareI
|
|
||||||
, withRecoil
|
|
||||||
]
|
|
||||||
& itDimension . dimRad .~ 12
|
& itDimension . dimRad .~ 12
|
||||||
& itDimension . dimCenter .~ V3 5 0 0
|
& itDimension . dimCenter .~ V3 5 0 0
|
||||||
& itConsumption . laMax .~ 1
|
& itConsumption . laMax .~ 1
|
||||||
@@ -63,17 +53,7 @@ elephantGun = bangRod
|
|||||||
& itType . iyBase .~ HELD ELEPHANTGUN
|
& itType . iyBase .~ HELD ELEPHANTGUN
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
& itParams . gunBarrels .~ SingleBarrel 0.05
|
& itParams . gunBarrels .~ SingleBarrel 0.05
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ ElephantGunMod
|
||||||
[ ammoHammerCheck
|
|
||||||
, useTimeCheck
|
|
||||||
, withSoundStart bangEchoS
|
|
||||||
, useAmmoAmount 1
|
|
||||||
, withTorqueAfter
|
|
||||||
, applyInaccuracy
|
|
||||||
, withThickSmokeI
|
|
||||||
, withMuzFlareI
|
|
||||||
, withRecoil
|
|
||||||
]
|
|
||||||
& itParams . recoil .~ 50
|
& itParams . recoil .~ 50
|
||||||
& itParams . torqueAfter .~ 0.1
|
& itParams . torqueAfter .~ 0.1
|
||||||
amr :: Item
|
amr :: Item
|
||||||
@@ -84,7 +64,7 @@ amr = elephantGun
|
|||||||
autoAmr :: Item
|
autoAmr :: Item
|
||||||
autoAmr = amr
|
autoAmr = amr
|
||||||
& itType . iyBase .~ HELD AUTOAMR
|
& itType . iyBase .~ HELD AUTOAMR
|
||||||
& itUse . useMods %~ ((ammoCheckI :) . tail)
|
& itUse . useMods .~ AutoAmrMod
|
||||||
|
|
||||||
sniperRifle :: Item
|
sniperRifle :: Item
|
||||||
sniperRifle = elephantGun
|
sniperRifle = elephantGun
|
||||||
@@ -99,13 +79,7 @@ machineGun :: Item
|
|||||||
machineGun = bangRod
|
machineGun = bangRod
|
||||||
& itType . iyBase .~ HELD MACHINEGUN
|
& itType . iyBase .~ HELD MACHINEGUN
|
||||||
& itUse . useDelay . rateMax .~ 25
|
& itUse . useDelay . rateMax .~ 25
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ MachineGunMod
|
||||||
[ ammoCheckI
|
|
||||||
, rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter
|
|
||||||
, withSoundStart bangEchoS
|
|
||||||
, withThinSmokeI
|
|
||||||
, withMuzFlareI
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimWeight .~ 8
|
& itUse . useAim . aimWeight .~ 8
|
||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
|
|||||||
@@ -47,17 +47,7 @@ bangStick i = defaultBulletWeapon
|
|||||||
& itDimension . dimRad .~ 5
|
& itDimension . dimRad .~ 5
|
||||||
& itDimension . dimCenter .~ V3 5 0 0
|
& itDimension . dimCenter .~ V3 5 0 0
|
||||||
& itUse . useDelay . rateMax .~ 8
|
& itUse . useDelay . rateMax .~ 8
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ BangStickMod
|
||||||
[ ammoHammerCheck
|
|
||||||
, useTimeCheck
|
|
||||||
, withSoundItemChoiceStart bangStickSoundChoice
|
|
||||||
, useAllAmmo
|
|
||||||
, withMuzFlareI
|
|
||||||
, withTorqueAfter
|
|
||||||
, spreadLoaded
|
|
||||||
-- , applyInaccuracy
|
|
||||||
, withRecoil
|
|
||||||
]
|
|
||||||
& itType . iyBase .~ HELD (BANGSTICK i)
|
& itType . iyBase .~ HELD (BANGSTICK i)
|
||||||
& itUse . useAim . aimHandlePos .~ 5
|
& itUse . useAim . aimHandlePos .~ 5
|
||||||
& itUse . useAim . aimMuzPos .~ 10
|
& itUse . useAim . aimMuzPos .~ 10
|
||||||
|
|||||||
@@ -16,12 +16,7 @@ droneLauncher :: Item
|
|||||||
droneLauncher = defaultWeapon
|
droneLauncher = defaultWeapon
|
||||||
& itUse . useDelay . rateMax .~ 20
|
& itUse . useDelay . rateMax .~ 20
|
||||||
-- & itUse . rUse .~ aDroneWithItemParams
|
-- & itUse . rUse .~ aDroneWithItemParams
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ AmmoUseCheckMod
|
||||||
[ ammoCheckI
|
|
||||||
, useTimeCheck
|
|
||||||
, withSoundStart tap4S
|
|
||||||
, useAmmoAmount 1
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimWeight .~ 8
|
& itUse . useAim . aimWeight .~ 8
|
||||||
& itUse . useAim . aimRange .~ 0.5
|
& itUse . useAim . aimRange .~ 0.5
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
|
|||||||
@@ -45,13 +45,7 @@ launcher = defaultWeapon
|
|||||||
& itDimension . dimCenter .~ V3 10 0 0
|
& itDimension . dimCenter .~ V3 10 0 0
|
||||||
& itUse . useDelay . rateMax .~ 20
|
& itUse . useDelay . rateMax .~ 20
|
||||||
& itUse . rUse .~ HeldPJCreation --usePjCreation
|
& itUse . rUse .~ HeldPJCreation --usePjCreation
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ LauncherMod
|
||||||
[ hammerCheckI
|
|
||||||
, ammoCheckI
|
|
||||||
, useTimeCheck
|
|
||||||
, withSoundStart tap4S
|
|
||||||
, useAmmoAmount 1
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimWeight .~ 8
|
& itUse . useAim . aimWeight .~ 8
|
||||||
& itUse . useAim . aimRange .~ 0.5
|
& itUse . useAim . aimRange .~ 0.5
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
@@ -66,13 +60,7 @@ launcherX i = launcher
|
|||||||
& itConsumption . laMax .~ i
|
& itConsumption . laMax .~ i
|
||||||
& itConsumption . laLoaded .~ i
|
& itConsumption . laLoaded .~ i
|
||||||
& itUse . rUse .~ HeldPJCreationX i
|
& itUse . rUse .~ HeldPJCreationX i
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ LauncherXMod
|
||||||
[ hammerCheckI
|
|
||||||
, ammoCheckI
|
|
||||||
, useTimeCheck
|
|
||||||
, withSoundStart tap4S
|
|
||||||
, useAmmoAmount i
|
|
||||||
]
|
|
||||||
|
|
||||||
basicAmPjMoves :: IM.IntMap TweakParam
|
basicAmPjMoves :: IM.IntMap TweakParam
|
||||||
basicAmPjMoves = IM.fromList . zip [0..] $
|
basicAmPjMoves = IM.fromList . zip [0..] $
|
||||||
|
|||||||
@@ -14,9 +14,7 @@ clickDetector :: Detector -> Item
|
|||||||
clickDetector dt = defaultWeapon
|
clickDetector dt = defaultWeapon
|
||||||
& itUse . useDelay . rateMax .~ 20
|
& itUse . useDelay . rateMax .~ 20
|
||||||
& itUse . rUse .~ HeldDetectorEffect dt --detectorEffect dt
|
& itUse . rUse .~ HeldDetectorEffect dt --detectorEffect dt
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ AmmoUseCheckMod
|
||||||
[ ammoUseCheck
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
|
||||||
& itType . iyBase .~ HELD (HELDDETECTOR dt)
|
& itType . iyBase .~ HELD (HELDDETECTOR dt)
|
||||||
|
|||||||
@@ -27,12 +27,7 @@ shatterGun = defaultWeapon
|
|||||||
& itType . iyBase .~ HELD SHATTERGUN
|
& itType . iyBase .~ HELD SHATTERGUN
|
||||||
& itUse . useDelay . rateMax .~ 10
|
& itUse . useDelay . rateMax .~ 10
|
||||||
& itUse . rUse .~ HeldShatter --shootShatter
|
& itUse . rUse .~ HeldShatter --shootShatter
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ ShatterMod
|
||||||
[ ammoHammerCheck
|
|
||||||
, useTimeCheck
|
|
||||||
-- , withSoundStart tap3S
|
|
||||||
, useAmmoAmount 1
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimStance .~ TwoHandFlat
|
& itUse . useAim . aimStance .~ TwoHandFlat
|
||||||
|
|
||||||
shootShatter :: Item -> Creature -> World -> World
|
shootShatter :: Item -> Creature -> World -> World
|
||||||
|
|||||||
@@ -38,11 +38,7 @@ sonicGun = defaultAutoGun
|
|||||||
& itDimension . dimCenter .~ V3 15 0 0
|
& itDimension . dimCenter .~ V3 15 0 0
|
||||||
& itUse . useDelay . rateMax .~ 8
|
& itUse . useDelay . rateMax .~ 8
|
||||||
& itUse . rUse .~ HeldSonicWave --aSonicWave
|
& itUse . rUse .~ HeldSonicWave --aSonicWave
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ AmmoHammerTimeUseOneMod
|
||||||
[ ammoHammerCheck
|
|
||||||
, useTimeCheck
|
|
||||||
, useAmmoAmount 1
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ spawnGun :: Creature -> Item
|
|||||||
spawnGun _ = defaultWeapon
|
spawnGun _ = defaultWeapon
|
||||||
& itUse . useDelay . rateMax .~ 100
|
& itUse . useDelay . rateMax .~ 100
|
||||||
& itUse . rUse .~ HeldDoNothing --(\_ -> spawnCrNextTo cr)
|
& itUse . rUse .~ HeldDoNothing --(\_ -> spawnCrNextTo cr)
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ HeldModNothing
|
||||||
[ ammoCheckI
|
-- [ ammoCheckI
|
||||||
, hammerCheckI
|
-- , hammerCheckI
|
||||||
]
|
-- ]
|
||||||
& itType . iyBase .~ LEFT SPAWNER
|
& itType . iyBase .~ LEFT SPAWNER
|
||||||
spawnCrNextTo
|
spawnCrNextTo
|
||||||
:: Creature -- ^ Creature to spawn
|
:: Creature -- ^ Creature to spawn
|
||||||
|
|||||||
@@ -23,12 +23,7 @@ poisonSprayer = flameThrower
|
|||||||
{ _amString = "POISONGAS"
|
{ _amString = "POISONGAS"
|
||||||
, _amCreateGas = CreatePoisonGas --aGasCloud
|
, _amCreateGas = CreatePoisonGas --aGasCloud
|
||||||
}
|
}
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ PoisonSprayerMod
|
||||||
[ ammoCheckI
|
|
||||||
, withSoundForI foamSprayLoopS 5
|
|
||||||
, useAmmoAmount 1
|
|
||||||
-- , spreadNumI
|
|
||||||
]
|
|
||||||
|
|
||||||
flameSpitter :: Item
|
flameSpitter :: Item
|
||||||
flameSpitter = flameThrower
|
flameSpitter = flameThrower
|
||||||
@@ -38,20 +33,7 @@ flameSpitter = flameThrower
|
|||||||
& itParams . sprayNozzles . ix 0 . nzPressure .~ 4
|
& itParams . sprayNozzles . ix 0 . nzPressure .~ 4
|
||||||
& itUse . useAim . aimStance .~ OneHand
|
& itUse . useAim . aimStance .~ OneHand
|
||||||
& itUse . useDelay .~ FixedRate {_rateMax =12,_rateTime = 0}
|
& itUse . useDelay .~ FixedRate {_rateMax =12,_rateTime = 0}
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ FlameSpitterMod
|
||||||
[ ammoCheckI
|
|
||||||
, useTimeCheck
|
|
||||||
, lockInvFor 10
|
|
||||||
, repeatOnFrames [1..9]
|
|
||||||
, withRandomItemParams f
|
|
||||||
, useAmmoAmount 1
|
|
||||||
, withSidePushI 5
|
|
||||||
, withSidePushAfterI 20
|
|
||||||
]
|
|
||||||
where
|
|
||||||
f = do
|
|
||||||
nzpres <- state $ randomR (3,4)
|
|
||||||
return $ sprayNozzles . ix 0 . nzPressure .~ nzpres
|
|
||||||
|
|
||||||
flameTorrent :: Item
|
flameTorrent :: Item
|
||||||
flameTorrent = flameThrower
|
flameTorrent = flameThrower
|
||||||
@@ -106,13 +88,7 @@ flameThrower = defaultAutoGun
|
|||||||
& itDimension . dimCenter .~ V3 9 0 0
|
& itDimension . dimCenter .~ V3 9 0 0
|
||||||
& itUse . rUse .~ HeldOverNozzlesUseGasParams -- overNozzles useGasParams
|
& itUse . rUse .~ HeldOverNozzlesUseGasParams -- overNozzles useGasParams
|
||||||
& itUse . useDelay .~ NoDelay
|
& itUse . useDelay .~ NoDelay
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~ FlameThrowerMod
|
||||||
[ ammoCheckI
|
|
||||||
, useAmmoAmount 1
|
|
||||||
, withSidePushI 5
|
|
||||||
--, withTempLight 1 100 (V3 1 0 0)
|
|
||||||
, withSidePushAfterI 20
|
|
||||||
]
|
|
||||||
& itUse . useAim . aimWeight .~ 5
|
& itUse . useAim . aimWeight .~ 5
|
||||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomMax = 5, _itZoomMin = 1.5}
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomMax = 5, _itZoomMin = 1.5}
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
|
|||||||
@@ -1,17 +1,9 @@
|
|||||||
module Dodge.Projectile.Create where
|
module Dodge.Projectile.Create where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
--import Dodge.Payload
|
|
||||||
--import Dodge.SoundLogic
|
|
||||||
--import Dodge.Movement.Turn
|
|
||||||
import Dodge.Item.Location
|
import Dodge.Item.Location
|
||||||
--import Dodge.EnergyBall
|
|
||||||
--import Dodge.WorldEvent.Cloud
|
|
||||||
import LensHelp
|
import LensHelp
|
||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
import Geometry
|
import Geometry
|
||||||
--import RandomHelp
|
|
||||||
|
|
||||||
--import Data.Maybe
|
|
||||||
|
|
||||||
createProjectile :: ProjectileCreate -> Item -> Creature -> World -> World
|
createProjectile :: ProjectileCreate -> Item -> Creature -> World -> World
|
||||||
createProjectile pt = case pt of
|
createProjectile pt = case pt of
|
||||||
|
|||||||
Reference in New Issue
Block a user