Start unifying heldUse and heldMods
This commit is contained in:
@@ -89,7 +89,7 @@ itemCombinations =
|
||||
, p [o $ cr PRISM, o $ cr TRANSFORMER, o $ cr PIPE] lasGun
|
||||
, po [HELD LASGUN, HELD LASGUN, cr HARDWARE] dualBeam
|
||||
, po [HELD LASGUN, cr TRANSFORMER] (lasWide 2)
|
||||
, po [HELD LASGUN, HELD LASGUN, HELD LASGUN, cr HARDWARE] lasCircle
|
||||
-- , po [HELD LASGUN, HELD LASGUN, HELD LASGUN, cr HARDWARE] lasCircle
|
||||
, p [o $ cr TRANSFORMER, p 2 $ cr CAN] sparkGun
|
||||
, p [o (HELD SPARKGUN), p 2 $ cr PIPE] teslaGun
|
||||
, p [o $ cr TELEPORTMODULE, p 2 $ cr MICROCHIP] blinkGun
|
||||
@@ -201,13 +201,13 @@ moduleCombinations =
|
||||
, amod [cr (ENERGYBALLCRAFT TeslaBall)] STATICLAS
|
||||
]
|
||||
)
|
||||
,
|
||||
( ModTeleport
|
||||
, teleportableWeapons
|
||||
,
|
||||
[ amod [cr TELEPORTMODULE, cr MICROCHIP] WEPTELE
|
||||
]
|
||||
)
|
||||
-- ,
|
||||
-- ( ModTeleport
|
||||
-- , teleportableWeapons
|
||||
-- ,
|
||||
-- [ amod [cr TELEPORTMODULE, cr MICROCHIP] WEPTELE
|
||||
-- ]
|
||||
-- )
|
||||
,
|
||||
( ModLauncherHoming
|
||||
, homingLaunchers
|
||||
@@ -224,17 +224,17 @@ moduleCombinations =
|
||||
homingLaunchers :: [Item]
|
||||
homingLaunchers = launcher : [launcherX i | i <- [2 .. 10]]
|
||||
|
||||
batteryGuns :: [Item]
|
||||
batteryGuns =
|
||||
[ teslaGun
|
||||
, sparkGun
|
||||
, lasGun
|
||||
]
|
||||
++ [ lasWide i | i <- [2 .. 10]
|
||||
]
|
||||
--batteryGuns :: [Item]
|
||||
--batteryGuns =
|
||||
-- [ teslaGun
|
||||
-- , sparkGun
|
||||
-- , lasGun
|
||||
-- ]
|
||||
-- ++ [ lasWide i | i <- [2 .. 10]
|
||||
-- ]
|
||||
|
||||
teleportableWeapons :: [Item]
|
||||
teleportableWeapons = bulletWeapons ++ batteryGuns ++ homingLaunchers
|
||||
--teleportableWeapons :: [Item]
|
||||
--teleportableWeapons = bulletWeapons ++ batteryGuns ++ homingLaunchers
|
||||
|
||||
bulletMagazines :: [Item]
|
||||
bulletMagazines =
|
||||
|
||||
@@ -30,18 +30,17 @@ moduleModification imt = case imt of
|
||||
STATICLAS ->
|
||||
(itParams . lasBeam .~ BeamCombine TeslaBeamCombine)
|
||||
. (itParams . subParams ?~ teslaParams)
|
||||
WEPTELE -> makeDirectedTele
|
||||
-- WEPTELE -> makeDirectedTele
|
||||
--LAUNCHHOME -> itUse . heldConsumption . laAmmoType . amPjCreation .~ CreateTrackingShell
|
||||
LAUNCHHOME -> id
|
||||
ATTACHTORCH -> id
|
||||
where
|
||||
makeDirectedTele it =
|
||||
it
|
||||
-- & itUse . useTargeting ?~ TargetRBPress
|
||||
& itUse . heldMods %~ ModWithDirectedTeleport -- .:~ withPosDirWallCheck directedTelPos
|
||||
-- for the camera: the simplest option is to remove all zoom/offset
|
||||
& itUse . heldAim . aimZoom . izFac .~ 1
|
||||
& itUse . heldAim . aimRange .~ 0
|
||||
-- makeDirectedTele it =
|
||||
-- it
|
||||
-- & itUse . heldMods %~ ModWithDirectedTeleport -- .:~ withPosDirWallCheck directedTelPos
|
||||
-- -- for the camera: the simplest option is to remove all zoom/offset
|
||||
-- & itUse . heldAim . aimZoom . izFac .~ 1
|
||||
-- & itUse . heldAim . aimRange .~ 0
|
||||
|
||||
-- a better option would be to involve a "scope" centered on the firing
|
||||
-- position
|
||||
|
||||
@@ -10,7 +10,7 @@ import Dodge.Data.ComposedItem
|
||||
import Dodge.Data.DoubleTree
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import Data.Foldable
|
||||
--import Data.Foldable
|
||||
import Data.Maybe
|
||||
import Dodge.Cuse
|
||||
import Dodge.Data.World
|
||||
@@ -36,8 +36,11 @@ useItemRightClick cr' w = fromMaybe (f w) $ do
|
||||
|
||||
itemEffect :: Creature -> LabelDoubleTree ComposeLinkType Item -> World -> World
|
||||
itemEffect cr it w = case it ^. ldtValue . itUse of
|
||||
HeldUse{_heldUse = eff, _heldMods = usemods} ->
|
||||
foldl' (&) (useHeld eff) (useMod usemods) it cr w
|
||||
-- HeldUse{_heldUse = eff, _heldMods = usemods} ->
|
||||
-- foldl' (&) (useHeld eff) (useMod usemods) it cr w
|
||||
-- & pointerToItem itm . itUse . heldHammer .~ HammerDown
|
||||
HeldUse{ _heldMods = usemods} ->
|
||||
heldEffect usemods it cr w
|
||||
& pointerToItem itm . itUse . heldHammer .~ HammerDown
|
||||
LeftUse{} -> doequipmentchange
|
||||
EquipUse{} -> doequipmentchange
|
||||
|
||||
@@ -187,7 +187,7 @@ data HeldItemType
|
||||
| SPARKGUN
|
||||
| TESLAGUN
|
||||
| LASGUN
|
||||
| LASCIRCLE
|
||||
-- | LASCIRCLE
|
||||
| DUALBEAM
|
||||
| LASWIDE {_xNum :: Int}
|
||||
| TRACTORGUN
|
||||
@@ -214,7 +214,7 @@ data ItemModuleType
|
||||
| INCENDLAS
|
||||
| SPLITLAS
|
||||
| STATICLAS
|
||||
| WEPTELE
|
||||
-- | WEPTELE
|
||||
| LAUNCHHOME
|
||||
| ATTACHTORCH
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
@@ -66,22 +66,21 @@ data Luse
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data HeldMod
|
||||
= HeldModNothing
|
||||
| PoisonSprayerMod
|
||||
= PoisonSprayerMod
|
||||
| FlameSpitterMod
|
||||
| FlameSpitterRepeatMod
|
||||
| FlameThrowerMod
|
||||
| LauncherMod
|
||||
| TeslaMod
|
||||
| CircleLaserMod
|
||||
-- | CircleLaserMod
|
||||
| LasWideMod Int
|
||||
| DualBeamMod
|
||||
| LasMod
|
||||
| LauncherXMod Int
|
||||
| ShatterMod
|
||||
| AmmoCheckMod
|
||||
| AmmoUseCheckMod
|
||||
| AmmoHammerTimeUseOneMod
|
||||
-- | AmmoCheckMod
|
||||
-- | AmmoUseCheckMod
|
||||
-- | AmmoHammerTimeUseOneMod
|
||||
| BangCaneMod
|
||||
| VolleyGunMod
|
||||
| MultiGunMod
|
||||
@@ -90,7 +89,7 @@ data HeldMod
|
||||
| ElephantGunMod
|
||||
| AutoAmrMod
|
||||
| MachineGunMod
|
||||
| ModWithDirectedTeleport HeldMod
|
||||
-- | ModWithDirectedTeleport HeldMod
|
||||
| BangStickMod
|
||||
| PistolMod
|
||||
| AutoPistolMod
|
||||
@@ -100,6 +99,12 @@ data HeldMod
|
||||
| MiniGunMod Int
|
||||
| SmgMod
|
||||
| BangConeMod
|
||||
| TractorMod --apply with AmmoCheckMod
|
||||
| FireRemoteShellMod
|
||||
| ExplodeRemoteShellMod
|
||||
| DoNothingMod
|
||||
| ForceFieldMod
|
||||
| DetectorMod Detector
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
makeLenses ''Euse
|
||||
|
||||
@@ -27,8 +27,8 @@ import Dodge.Data.Item.Targeting
|
||||
|
||||
data ItemUse
|
||||
= HeldUse
|
||||
{ _heldUse :: Huse
|
||||
, _heldDelay :: UseDelay
|
||||
{ -- _heldUse :: Huse
|
||||
_heldDelay :: UseDelay
|
||||
, _heldMods :: HeldMod
|
||||
, _heldHammer :: HammerPosition
|
||||
, _heldAim :: AimParams
|
||||
@@ -118,6 +118,7 @@ data Muzzle = Muzzle
|
||||
{ _mzPos :: V2 Float
|
||||
, _mzRot :: Float
|
||||
, _mzInaccuracy :: Float
|
||||
, _mzAmmoSlot :: Int
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ defaultBulletWeapon :: Item
|
||||
defaultBulletWeapon =
|
||||
defaultWeapon
|
||||
& itUse . heldAmmoTypes .~ [BulletAmmo]
|
||||
& itUse . heldUse .~ HeldUseAmmoParams -- useAmmoParams
|
||||
-- & itUse . heldUse .~ HeldUseAmmoParams -- useAmmoParams
|
||||
& itType . iyModules . at ModBulletCollision ?~ EMPTYMODULE
|
||||
-- & itType . iyModules . at ModBulletPayload ?~ EMPTYMODULE
|
||||
-- & itType . iyModules . at ModBulletTrajectory ?~ EMPTYMODULE
|
||||
|
||||
@@ -29,9 +29,8 @@ defaultEquipUse = EquipUse
|
||||
defaultHeldUse :: ItemUse
|
||||
defaultHeldUse =
|
||||
HeldUse
|
||||
{ _heldUse = HeldDoNothing
|
||||
, _heldDelay = FixedRate{_rateMax = 8, _rateTime = 0}
|
||||
, _heldMods = HeldModNothing
|
||||
{ _heldDelay = FixedRate{_rateMax = 8, _rateTime = 0}
|
||||
, _heldMods = DoNothingMod
|
||||
, _heldHammer = HammerUp
|
||||
, _heldAim = defaultAimParams
|
||||
, _heldAmmoTypes = []
|
||||
|
||||
@@ -13,7 +13,7 @@ defaultAimParams =
|
||||
, _aimStance = OneHand
|
||||
, --, _aimHandlePos = 10
|
||||
_aimHandlePos = V2 3 0
|
||||
, _aimMuzzles = [Muzzle (V2 20 0) 0 0]
|
||||
, _aimMuzzles = [Muzzle (V2 20 0) 0 0 0]
|
||||
-- , _aimMuzPos = 20
|
||||
}
|
||||
|
||||
|
||||
+329
-20
@@ -26,12 +26,321 @@ import qualified IntMapHelp as IM
|
||||
import LensHelp
|
||||
import RandomHelp
|
||||
import Sound.Data
|
||||
import Data.Foldable
|
||||
|
||||
heldEffect :: HeldMod -> LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
|
||||
heldEffect effecttype = case effecttype of
|
||||
-- HeldModNothing -> const $ const id
|
||||
PoisonSprayerMod -> gasEffect
|
||||
[ useAmmoAmount 1
|
||||
, withSoundForI foamSprayLoopS 5
|
||||
, ammoCheckI
|
||||
]
|
||||
FlameSpitterMod -> gasEffect
|
||||
[ withSidePushAfterI 20
|
||||
, withSidePushI 5
|
||||
, useAmmoAmount 1
|
||||
, withRandomItemParams f
|
||||
, repeatOnFrames [1 .. 9] FlameSpitterRepeatMod
|
||||
, lockInvFor 10
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
]
|
||||
FlameSpitterRepeatMod -> gasEffect
|
||||
[ withSidePushAfterI 20
|
||||
, withSidePushI 5
|
||||
, useAmmoAmount 1
|
||||
, withRandomItemParams f
|
||||
, ammoCheckI
|
||||
]
|
||||
FlameThrowerMod -> gasEffect
|
||||
[ withSidePushAfterI 20
|
||||
, --, withTempLight 1 100 (V3 1 0 0)
|
||||
withSidePushI 5
|
||||
, useAmmoAmount 1
|
||||
, ammoCheckI
|
||||
]
|
||||
LauncherMod -> foldl' (&) usePjCreation
|
||||
--[ useAmmoAmount 1
|
||||
-- , withSoundStart tap4S
|
||||
[ useTimeCheck
|
||||
-- , ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
TeslaMod -> foldl' (&) (shootTeslaArc . _ldtValue)
|
||||
[ useAmmoAmount 1
|
||||
, withSoundForI elecCrackleS 1
|
||||
, withTempLight 1 100 (V3 0 0 1)
|
||||
, ammoCheckI
|
||||
]
|
||||
LasWideMod n -> foldl' (&) (shootLaser . _ldtValue)
|
||||
[ useAmmoAmount 1
|
||||
, withItem $ \it ->
|
||||
duplicateNumBarrels
|
||||
-- ( min
|
||||
-- (it ^?! itUse . heldConsumption . laSource . _InternalSource . iaLoaded)
|
||||
(it ^?! itParams . lasCycle `div` lasWideRate)
|
||||
-- )
|
||||
, withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
||||
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
|
||||
, withSoundForI tone440sawtoothquietS 2
|
||||
, withItemUpdateFirst (increasecycleLasWide n)
|
||||
, ammoCheckI
|
||||
]
|
||||
DualBeamMod -> foldl' (&) (shootDualLaser . _ldtValue)
|
||||
[ useAmmoAmount 1
|
||||
, withSoundForI tone440sawtoothquietS 2
|
||||
, withItem $ \it -> withCrPosShift (V2 0 (- thegapDualBeam it)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8
|
||||
, withItem $ \it -> withCrPosShift (V2 0 (thegapDualBeam it)) $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
||||
, ammoCheckI
|
||||
]
|
||||
LasMod -> foldl' (&) (shootLaser . _ldtValue)
|
||||
[ useAmmoAmount 1
|
||||
, withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
||||
, withSoundForI tone440sawtoothquietS 2
|
||||
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
|
||||
, duplicateLoadedBarrels
|
||||
, ammoCheckI
|
||||
]
|
||||
LauncherXMod _ -> foldl' (&) usePjCreationX
|
||||
--[ useAmmoAmount i
|
||||
--, withSoundStart tap4S
|
||||
[ useTimeCheck
|
||||
--, ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
ShatterMod -> foldl' (&) (shootShatter . _ldtValue)
|
||||
[ useAmmoAmount 1
|
||||
, -- , withSoundStart tap3S
|
||||
useTimeCheck
|
||||
, ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
BangCaneMod -> bulletGunEffect
|
||||
[ withFlare
|
||||
, withSmoke 1 black 20 200 5
|
||||
, withRecoil
|
||||
, duplicateLoadedBarrels
|
||||
, withTorqueAfter
|
||||
, useAmmoAmount 1
|
||||
, withSoundStart tap3S
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
VolleyGunMod -> bulletGunEffect
|
||||
[ withRecoil
|
||||
, withFlare
|
||||
, duplicateLoadedBarrels
|
||||
, withTorqueAfter
|
||||
, useAllAmmo
|
||||
, withSoundItemChoiceStart caneStickSoundChoice
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
MultiGunMod -> bulletGunEffect
|
||||
[ withRecoil
|
||||
, withFlare
|
||||
, duplicateLoadedBarrels
|
||||
, withTorqueAfter
|
||||
, useAllAmmo
|
||||
, withSoundItemChoiceStart caneStickSoundChoice
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
AutoRifleMod -> bulletGunEffect
|
||||
-- note this is the same as BangCanemMod with the first changed
|
||||
[ withFlare
|
||||
, withSmoke 1 black 20 200 5
|
||||
, withRecoil
|
||||
, duplicateLoadedBarrels
|
||||
, withTorqueAfter
|
||||
, useAmmoAmount 1
|
||||
, withSoundStart tap3S
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
]
|
||||
BangRodMod -> bulletGunEffect
|
||||
[ withRecoil
|
||||
, withFlare
|
||||
, withThickSmokeI
|
||||
, duplicateLoadedBarrels
|
||||
, withTorqueAfter
|
||||
, useAmmoAmount 1
|
||||
, withSoundStart bangEchoS
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
ElephantGunMod -> bulletGunEffect
|
||||
[ withRecoil
|
||||
, withFlare
|
||||
, withThickSmokeI
|
||||
, duplicateLoadedBarrels
|
||||
, withTorqueAfter
|
||||
, useAmmoAmount 1
|
||||
, withSoundStart bangEchoS
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
AutoAmrMod -> bulletGunEffect
|
||||
[ withRecoil
|
||||
, withFlare
|
||||
, withThickSmokeI
|
||||
, duplicateLoadedBarrels
|
||||
, withTorqueAfter
|
||||
, useAmmoAmount 1
|
||||
, withSoundStart bangEchoS
|
||||
, useTimeCheck
|
||||
, ammoCheckI -- cf ElephantGun
|
||||
]
|
||||
MachineGunMod -> bulletGunEffect
|
||||
[ withFlare
|
||||
, withThinSmokeI
|
||||
, withSoundStart bangEchoS
|
||||
, rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter
|
||||
, ammoCheckI
|
||||
]
|
||||
BangStickMod -> bulletGunEffect
|
||||
[ withRecoil
|
||||
, useAllAmmo
|
||||
, withSoundItemChoiceStart bangStickSoundChoice
|
||||
, duplicateLoadedBarrels
|
||||
, withTorqueAfter
|
||||
, withFlare
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
PistolMod -> bulletGunEffect
|
||||
[ withSidePushI 50
|
||||
, withRecoil
|
||||
, withFlare
|
||||
, withTorqueAfter
|
||||
, duplicateLoadedBarrels
|
||||
, withSoundStart tap3S
|
||||
, useAmmoAmount 1
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
AutoPistolMod -> bulletGunEffect
|
||||
[ withFlare
|
||||
, withSidePushI 50
|
||||
, withRecoil
|
||||
, withTorqueAfter
|
||||
, duplicateLoadedBarrels
|
||||
, withSoundStart tap3S
|
||||
, useAmmoAmount 1
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
]
|
||||
MachinePistolMod -> bulletGunEffect
|
||||
[ withFlare
|
||||
, withRecoil
|
||||
, withSidePushI 50
|
||||
, withTorqueAfter
|
||||
, duplicateLoadedBarrels
|
||||
, withSoundStart tap1S
|
||||
, useAmmoAmount 1
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
]
|
||||
BurstRifleMod -> bulletGunEffect
|
||||
[ withRecoil
|
||||
, withFlare
|
||||
, duplicateLoadedBarrels
|
||||
, useAmmoAmount 1
|
||||
, withSoundStart tap3S
|
||||
, repeatOnFrames [3, 6] BurstRifleRepeatMod
|
||||
, lockInvFor 7
|
||||
, sideEffectOnFrame 7 (\_ cr -> TorqueCr 0.2 (_crID cr)) --(torqueSideEffect 0.2)
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
BurstRifleRepeatMod -> bulletGunEffect
|
||||
[ withRecoil
|
||||
, withFlare
|
||||
, duplicateLoadedBarrels
|
||||
, useAmmoAmount 1
|
||||
, withSoundStart tap3S
|
||||
, sideEffectOnFrame 7 (\_ cr -> TorqueCr 0.2 (_crID cr)) --(torqueSideEffect 0.2)
|
||||
, ammoCheckI
|
||||
]
|
||||
MiniGunMod i -> bulletGunEffect
|
||||
[ duplicateNumBarrels 1
|
||||
, repeatTransformed
|
||||
[ (id, modcrpos x)
|
||||
| x <- map ((/ (fromIntegral i - 1)) . fromIntegral) [0 .. i -1]
|
||||
]
|
||||
, afterRecoil (fromIntegral i * 5)
|
||||
, torqueBefore (fromIntegral i * 0.05)
|
||||
, withSidePushI (fromIntegral i * 25)
|
||||
, withMuzFlare
|
||||
, withSmoke 1 black 20 200 5
|
||||
, useAmmoAmount i
|
||||
, withSoundForI mini1S 2
|
||||
, withWarmUp crankSlowS
|
||||
, ammoCheckI
|
||||
]
|
||||
SmgMod -> bulletGunEffect
|
||||
[ withFlare
|
||||
, withSidePushI 30
|
||||
, withRecoil
|
||||
, withTorqueAfter
|
||||
, duplicateLoadedBarrels
|
||||
, withSoundStart tap3S
|
||||
, useAmmoAmount 1
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
]
|
||||
BangConeMod -> bulletGunEffect
|
||||
[ withRandomItem coneRandItemParams
|
||||
, withRandomItemUpdate coneRandItemUpdate
|
||||
, withRandomOffset
|
||||
, duplicateLoadedBarrels
|
||||
, duplicateLoaded
|
||||
, withMuzFlare
|
||||
, withRecoil
|
||||
, withTorqueAfter
|
||||
, useAllAmmo
|
||||
, withSoundStart bangEchoS
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
TractorMod -> foldl' (&) (aTractorBeam . _ldtValue) [ammoCheckI]
|
||||
where
|
||||
f = do
|
||||
nzpres <- state $ randomR (3, 4)
|
||||
return $ sprayNozzles . ix 0 . nzPressure .~ nzpres
|
||||
increasecycleLasWide n it = case _heldHammer (_itUse it) of
|
||||
HammerUp -> it & itParams . lasCycle .~ 1
|
||||
_ -> it & itParams . lasCycle %~ (min (n * lasWideRate) . (+ 1))
|
||||
thegapDualBeam = _dbGap . _itParams
|
||||
directedTelPos _ cr w = (p, a)
|
||||
where
|
||||
p = fromMaybe (_crPos cr) $ cr ^? crTargeting . ctPos . _Just
|
||||
a = argV (mouseWorldPos (w ^. input) (w ^. wCam) -.- p)
|
||||
modcrpos x cr = fromMaybe cr $ do
|
||||
invid <- cr ^? crManipulation . manObject . inInventory . ispItem
|
||||
return $ cr & crDir %~ tweenAngles x (_crOldDir cr)
|
||||
& crPos %~ alongSegBy x (_crOldPos cr)
|
||||
& crInv . ix (invid + 1) . itUse . amagParams . ampBullet . buDelayFraction .~ x
|
||||
|
||||
gasEffect = foldl' (&) (overNozzles useGasParams)
|
||||
|
||||
bulletGunEffect = foldl' (&) shootBullet
|
||||
|
||||
useMod :: HeldMod ->
|
||||
[(LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World)
|
||||
-> LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World]
|
||||
useMod hm = case hm of
|
||||
HeldModNothing -> []
|
||||
-- HeldModNothing -> []
|
||||
PoisonSprayerMod ->
|
||||
[ useAmmoAmount 1
|
||||
, withSoundForI foamSprayLoopS 5
|
||||
@@ -74,15 +383,15 @@ useMod hm = case hm of
|
||||
, withTempLight 1 100 (V3 0 0 1)
|
||||
, ammoCheckI
|
||||
]
|
||||
CircleLaserMod ->
|
||||
[ duplicateItem fLasCircle
|
||||
, useAmmoAmount 1
|
||||
, withSoundForI tone440sawtoothquietS 2
|
||||
, withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
||||
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
|
||||
, withItemUpdateFirst increasecycleLasCircle
|
||||
, ammoCheckI
|
||||
]
|
||||
-- CircleLaserMod ->
|
||||
-- [ duplicateItem fLasCircle
|
||||
-- , useAmmoAmount 1
|
||||
-- , withSoundForI tone440sawtoothquietS 2
|
||||
-- , withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
||||
-- , withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
|
||||
-- , withItemUpdateFirst increasecycleLasCircle
|
||||
-- , ammoCheckI
|
||||
-- ]
|
||||
LasWideMod n ->
|
||||
[ useAmmoAmount 1
|
||||
, withItem $ \it ->
|
||||
@@ -126,14 +435,14 @@ useMod hm = case hm of
|
||||
, ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
AmmoCheckMod -> [ammoCheckI]
|
||||
AmmoUseCheckMod -> [useAmmoAmount 1, useTimeCheck, ammoCheckI]
|
||||
AmmoHammerTimeUseOneMod ->
|
||||
[ useAmmoAmount 1
|
||||
, useTimeCheck
|
||||
, ammoCheckI
|
||||
, blCheck
|
||||
]
|
||||
-- AmmoCheckMod -> [ammoCheckI]
|
||||
-- AmmoUseCheckMod -> [useAmmoAmount 1, useTimeCheck, ammoCheckI]
|
||||
-- AmmoHammerTimeUseOneMod ->
|
||||
-- [ useAmmoAmount 1
|
||||
-- , useTimeCheck
|
||||
-- , ammoCheckI
|
||||
-- , blCheck
|
||||
-- ]
|
||||
BangCaneMod ->
|
||||
[ withFlare
|
||||
, withSmoke 1 black 20 200 5
|
||||
@@ -222,8 +531,8 @@ useMod hm = case hm of
|
||||
, rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter
|
||||
, ammoCheckI
|
||||
]
|
||||
ModWithDirectedTeleport hm' ->
|
||||
reverse $ withPosDirWallCheck directedTelPos : useMod hm'
|
||||
-- ModWithDirectedTeleport hm' ->
|
||||
-- reverse $ withPosDirWallCheck directedTelPos : useMod hm'
|
||||
BangStickMod ->
|
||||
[ withRecoil
|
||||
, useAllAmmo
|
||||
|
||||
@@ -187,7 +187,7 @@ heldItemSPic ht it = case ht of
|
||||
SPARKGUN -> teslaGunPic
|
||||
TESLAGUN -> teslaGunPic
|
||||
LASGUN -> lasGunPic it
|
||||
LASCIRCLE -> lasGunPic it
|
||||
-- LASCIRCLE -> lasGunPic it
|
||||
DUALBEAM -> dualBeamPic it
|
||||
LASWIDE _ -> lasGunPic it
|
||||
--SONICGUN -> noPic baseSonicShape
|
||||
|
||||
@@ -56,7 +56,7 @@ itemFromHeldType ht = case ht of
|
||||
SPARKGUN -> sparkGun
|
||||
TESLAGUN -> teslaGun
|
||||
LASGUN -> lasGun
|
||||
LASCIRCLE -> lasCircle
|
||||
-- LASCIRCLE -> lasCircle
|
||||
DUALBEAM -> dualBeam
|
||||
LASWIDE i -> lasWide i
|
||||
TRACTORGUN -> tractorGun
|
||||
|
||||
@@ -24,13 +24,13 @@ teslaGun =
|
||||
& itDimension . dimRad .~ 9
|
||||
& itDimension . dimCenter .~ V3 4 0 0
|
||||
& itParams .~ teslaParams
|
||||
& itUse . heldUse .~ HeldTeslaArc --shootTeslaArc
|
||||
-- & itUse . heldUse .~ HeldTeslaArc --shootTeslaArc
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
& itUse . heldMods .~ TeslaMod
|
||||
& itUse . heldAim . aimWeight .~ 6
|
||||
& itUse . heldAim . aimStance .~ TwoHandFlat
|
||||
-- & itUse . heldAim . aimMuzPos .~ 4
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 4 0) 0 0]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 4 0) 0 0 0]
|
||||
& itType . iyBase .~ HELD TESLAGUN
|
||||
|
||||
lasGun :: Item
|
||||
@@ -51,7 +51,7 @@ lasGun =
|
||||
}
|
||||
& itDimension . dimRad .~ 10
|
||||
& itDimension . dimCenter .~ V3 15 0 0
|
||||
& itUse . heldUse .~ HeldLaser --shootLaser
|
||||
-- & itUse . heldUse .~ HeldLaser --shootLaser
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
& itUse . heldMods .~ LasMod
|
||||
& itUse . heldAim . aimWeight .~ 6
|
||||
@@ -59,7 +59,7 @@ lasGun =
|
||||
& itUse . heldAim . aimStance .~ TwoHandUnder
|
||||
-- & itUse . heldAim . aimHandlePos .~ 5
|
||||
-- & itUse . heldAim . aimMuzPos .~ 30
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0 0]
|
||||
& itType . iyBase .~ HELD LASGUN
|
||||
|
||||
lasGunTweak :: TweakParam
|
||||
@@ -78,12 +78,13 @@ tractorGun =
|
||||
.~ Tweakable
|
||||
{ _tweakParams = IM.fromList [(0, tractorGunTweak)]
|
||||
}
|
||||
& itUse . heldUse .~ HeldTractor --aTractorBeam
|
||||
-- & itUse . heldUse .~ HeldTractor --aTractorBeam
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
& itUse . heldMods .~ AmmoCheckMod
|
||||
-- & itUse . heldMods .~ AmmoCheckMod
|
||||
& itUse . heldMods .~ TractorMod
|
||||
& itUse . heldAim . aimWeight .~ 6
|
||||
& itUse . heldAim . aimRange .~ 1
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0 0]
|
||||
& itType . iyBase .~ HELD TRACTORGUN
|
||||
|
||||
tractorGunTweak :: TweakParam
|
||||
@@ -101,7 +102,7 @@ lasWide n =
|
||||
& itParams . lasColor .~ yellow
|
||||
& itParams . lasDamage .~ 2
|
||||
& itUse . heldMods .~ LasWideMod n
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 y) 0 0 | y <- spreadFromCenter n 1]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 y) 0 0 0 | y <- spreadFromCenter n 1]
|
||||
|
||||
defaultBatteryGun :: Item
|
||||
defaultBatteryGun =
|
||||
@@ -120,24 +121,23 @@ defaultAutoBatteryGun =
|
||||
defaultHeldItem
|
||||
& itType . iyModules .~ batteryModules
|
||||
|
||||
lasCircle :: Item
|
||||
lasCircle =
|
||||
lasGun
|
||||
& itType . iyBase .~ HELD LASCIRCLE
|
||||
& itParams . lasColor .~ orange
|
||||
& itParams . lasDamage .~ 2
|
||||
& itUse . heldUse .~ HeldLaser --shootLaser
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
& itUse . heldUse .~ HeldCircleLaser --circleLaser
|
||||
& itUse . heldMods .~ CircleLaserMod
|
||||
& itUse . heldAim . aimWeight .~ 6
|
||||
& itUse . heldAim . aimRange .~ 1
|
||||
--lasCircle :: Item
|
||||
--lasCircle =
|
||||
-- lasGun
|
||||
-- & itType . iyBase .~ HELD LASCIRCLE
|
||||
-- & itParams . lasColor .~ orange
|
||||
-- & itParams . lasDamage .~ 2
|
||||
-- & itUse . heldDelay .~ NoDelay
|
||||
---- & itUse . heldUse .~ HeldCircleLaser --circleLaser
|
||||
-- & itUse . heldMods .~ CircleLaserMod
|
||||
-- & itUse . heldAim . aimWeight .~ 6
|
||||
-- & itUse . heldAim . aimRange .~ 1
|
||||
|
||||
dualBeam :: Item
|
||||
dualBeam =
|
||||
lasGun
|
||||
& itType . iyBase .~ HELD DUALBEAM
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0 0]
|
||||
& itParams
|
||||
.~ DualBeam
|
||||
{ _phaseV = 1
|
||||
@@ -149,7 +149,7 @@ dualBeam =
|
||||
, _subParams = Nothing
|
||||
, _dbGap = 20
|
||||
}
|
||||
& itUse . heldUse .~ HeldDualLaser --shootDualLaser
|
||||
-- & itUse . heldUse .~ HeldDualLaser --shootDualLaser
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
& itUse . heldMods .~ DualBeamMod
|
||||
& itUse . heldAim . aimWeight .~ 6
|
||||
|
||||
@@ -32,7 +32,7 @@ defaultBangCane =
|
||||
& itUse . heldMods .~ BangCaneMod
|
||||
& itUse . heldAim . aimStance .~ OneHand
|
||||
-- & itUse . heldAim . aimHandlePos .~ 5
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01 0]
|
||||
|
||||
volleyGun :: Int -> Item
|
||||
volleyGun i =
|
||||
@@ -42,7 +42,8 @@ volleyGun i =
|
||||
& itUse . heldAim . aimRange .~ 1
|
||||
& itUse . heldAim . aimStance .~ TwoHandFlat
|
||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3]
|
||||
& itUse . heldAim . aimMuzzles .~
|
||||
([Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3] <*> [0..])
|
||||
& itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
|
||||
& itType . iyBase .~ HELD (VOLLEYGUN i)
|
||||
|
||||
@@ -54,7 +55,8 @@ multiGun i =
|
||||
& itUse . heldAim . aimRange .~ 1
|
||||
& itUse . heldAim . aimStance .~ TwoHandFlat
|
||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3]
|
||||
& itUse . heldAim . aimMuzzles .~
|
||||
([Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3] <*> [0..])
|
||||
& itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
|
||||
& itType . iyBase .~ HELD (MULTIGUN i)
|
||||
|
||||
@@ -66,7 +68,7 @@ rifle =
|
||||
& itUse . heldAim . aimWeight .~ 6
|
||||
& itUse . heldAim . aimRange .~ 1
|
||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 25 0) 0 0.01]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 25 0) 0 0.01 0]
|
||||
& itType . iyModules . at ModHeldAttach ?~ EMPTYMODULE
|
||||
|
||||
repeater :: Item
|
||||
@@ -94,7 +96,7 @@ burstRifle =
|
||||
miniGunUse :: Int -> ItemUse
|
||||
miniGunUse i =
|
||||
defaultHeldUse
|
||||
& heldUse .~ HeldUseAmmoParams
|
||||
-- & heldUse .~ HeldUseAmmoParams
|
||||
& heldMods .~ MiniGunMod i
|
||||
& heldDelay .~ WarmUpNoDelay{_warmTime = 0, _warmMax = 100}
|
||||
& heldAim . aimWeight .~ 6
|
||||
@@ -108,7 +110,7 @@ miniGunX i =
|
||||
autoRifle
|
||||
& itUse .~ miniGunUse i
|
||||
& itUse . heldAim . aimTurnSpeed .~ 0.5
|
||||
& itUse . heldAim . aimMuzzles .~ replicate i (Muzzle (V2 30 0) 0 0.05)
|
||||
& itUse . heldAim . aimMuzzles .~ replicate i (Muzzle (V2 30 0) 0 0.05 0)
|
||||
& itUse . heldParams . recoil .~ 10
|
||||
& itUse . heldParams . torqueAfter .~ 0.01
|
||||
& itUse . heldParams . randomOffset .~ 10
|
||||
|
||||
@@ -15,7 +15,7 @@ bangCone =
|
||||
& itUse . heldDelay . rateMax .~ 20
|
||||
& itUse . heldMods .~ BangConeMod
|
||||
-- & itUse . heldAim . aimHandlePos .~ 5
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.5]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.5 0]
|
||||
& itUse . heldParams .~ BulletShooterParams
|
||||
{ _muzVel = 0.7
|
||||
, _rifling = 0.8
|
||||
|
||||
@@ -24,14 +24,14 @@ launcher =
|
||||
& itDimension . dimRad .~ 9
|
||||
& itDimension . dimCenter .~ V3 10 0 0
|
||||
& itUse . heldDelay . rateMax .~ 20
|
||||
& itUse . heldUse .~ HeldPJCreation --usePjCreation
|
||||
-- & itUse . heldUse .~ HeldPJCreation --usePjCreation
|
||||
& itUse . heldMods .~ LauncherMod
|
||||
& itUse . heldAim . aimWeight .~ 8
|
||||
& itUse . heldAim . aimRange .~ 0.5
|
||||
& itUse . heldAim . aimStance .~ TwoHandOver
|
||||
-- & itUse . heldAim . aimHandlePos .~ V2 3 0
|
||||
-- & itUse . heldAim . aimMuzPos .~ 20
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0 0]
|
||||
& itUse . heldAmmoTypes .~ [ProjectileAmmo]
|
||||
& itType . iyBase .~ HELD LAUNCHER
|
||||
& itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
|
||||
@@ -40,9 +40,9 @@ launcherX :: Int -> Item
|
||||
launcherX i =
|
||||
launcher
|
||||
& itType . iyBase .~ HELD (LAUNCHERX i)
|
||||
& itUse . heldUse .~ HeldPJCreationX i
|
||||
-- & itUse . heldUse .~ HeldPJCreationX i
|
||||
& itUse . heldMods .~ LauncherXMod i
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) a 0 | a <- angles]
|
||||
& itUse . heldAim . aimMuzzles .~ ([Muzzle (V2 20 0) a 0 | a <- angles] <*> [0..])
|
||||
where
|
||||
angles = take i [0,2*pi/ fromIntegral i ..]
|
||||
--angles = take i [1,2 ..]
|
||||
@@ -51,7 +51,8 @@ remoteLauncher :: Item
|
||||
remoteLauncher =
|
||||
launcher
|
||||
& itType . iyBase .~ HELD REMOTELAUNCHER
|
||||
& itUse . heldUse .~ HeldFireRemoteShell --fireRemoteShell
|
||||
-- & itUse . heldUse .~ HeldFireRemoteShell --fireRemoteShell
|
||||
& itUse . heldMods .~ FireRemoteShellMod
|
||||
& itScope .~ RemoteScope (V2 0 0) 1
|
||||
-- & itUse . heldConsumption . laAmmoType . amPjDraw .~ DrawRemoteShell
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ bangRod =
|
||||
& itUse . heldAim . aimStance .~ OneHand
|
||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
||||
-- & itUse . heldAim . aimHandlePos .~ 5
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0.1]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0.1 0]
|
||||
-- & itUse . heldConsumption . laAmmoType .~ hvBulletAmmo
|
||||
|
||||
elephantGun :: Item
|
||||
|
||||
@@ -81,14 +81,14 @@ flameThrower =
|
||||
}
|
||||
& itDimension . dimRad .~ 7
|
||||
& itDimension . dimCenter .~ V3 9 0 0
|
||||
& itUse . heldUse .~ HeldOverNozzlesUseGasParams -- overNozzles useGasParams
|
||||
-- & itUse . heldUse .~ HeldOverNozzlesUseGasParams -- overNozzles useGasParams
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
& itUse . heldMods .~ FlameThrowerMod
|
||||
& itUse . heldAim . aimWeight .~ 5
|
||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 5, _izMin = 1.5}
|
||||
& itUse . heldAim . aimStance .~ TwoHandUnder
|
||||
-- & itUse . heldAim . aimHandlePos .~ 0
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 18 0) 0 0]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 18 0) 0 0 0]
|
||||
& itUse . heldAmmoTypes .~ [GasAmmo]
|
||||
& itType . iyBase .~ HELD FLAMETHROWER
|
||||
& itUse . heldParams .~ GasSprayParams CreateFlame --aGasCloud
|
||||
|
||||
@@ -30,7 +30,7 @@ bangStick i =
|
||||
& itDimension . dimCenter .~ V3 5 0 0
|
||||
& itUse . heldDelay . rateMax .~ 8
|
||||
& itUse . heldMods .~ BangStickMod
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) a 0.01 | a <- spreadAroundCenter i baseStickSpread]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) a 0.01 0 | a <- spreadAroundCenter i baseStickSpread]
|
||||
|
||||
baseStickSpread :: Float
|
||||
baseStickSpread = 0.2
|
||||
@@ -41,7 +41,7 @@ pistol =
|
||||
& itUse . heldAmmoTypes .~ [BulletAmmo]
|
||||
& itUse . heldDelay . rateMax .~ 6
|
||||
& itUse . heldMods .~ PistolMod
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) 0 0.05]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) 0 0.05 0]
|
||||
& itUse . heldParams
|
||||
%~ ( (muzVel .~ 0.8)
|
||||
. (rifling .~ 0.8)
|
||||
@@ -72,6 +72,6 @@ smg =
|
||||
& itUse . heldMods .~ SmgMod --(ammoCheckI : smgAfterHamMods)
|
||||
& itType . iyBase .~ HELD SMG
|
||||
& itUse . heldAim . aimStance .~ TwoHandUnder
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0]
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0 0]
|
||||
-- & itUse . heldAim . aimHandlePos .~ 2
|
||||
& itUse . heldParams . torqueAfter .~ 0.05
|
||||
|
||||
@@ -37,9 +37,10 @@ forceFieldGun =
|
||||
-- & itUse . useTargeting ?~ TargetRBLine
|
||||
& itType . iyModules . at ModTarget ?~ TARGET TargetRBLine
|
||||
& itParams .~ ParamMID Nothing
|
||||
& itUse . heldUse .~ HeldForceField --useForceFieldGun
|
||||
-- & itUse . heldUse .~ HeldForceField --useForceFieldGun
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
& itUse . heldMods .~ AmmoHammerTimeUseOneMod -- this is slightly different
|
||||
-- & itUse . heldMods .~ AmmoHammerTimeUseOneMod -- this is slightly different
|
||||
& itUse . heldMods .~ ForceFieldMod -- this is slightly different
|
||||
-- than the list below
|
||||
--[ hammerCheckI , ammoCheckI , useAmmoAmount 1]
|
||||
& itType . iyBase .~ HELD FORCEFIELDGUN
|
||||
@@ -52,8 +53,9 @@ clickDetector :: Detector -> Item
|
||||
clickDetector dt =
|
||||
defaultWeapon
|
||||
& itUse . heldDelay . rateMax .~ 20
|
||||
& itUse . heldUse .~ HeldDetectorEffect dt --detectorEffect dt
|
||||
& itUse . heldMods .~ AmmoUseCheckMod
|
||||
-- & itUse . heldUse .~ HeldDetectorEffect dt --detectorEffect dt
|
||||
-- & itUse . heldMods .~ AmmoUseCheckMod
|
||||
& itUse . heldMods .~ DetectorMod dt --detectorEffect dt
|
||||
& itUse . heldAim . aimRange .~ 1
|
||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1}
|
||||
& itType . iyBase .~ HELD (HELDDETECTOR dt)
|
||||
|
||||
@@ -9,6 +9,6 @@ shatterGun =
|
||||
defaultHeldItem
|
||||
& itType . iyBase .~ HELD SHATTERGUN
|
||||
& itUse . heldDelay . rateMax .~ 10
|
||||
& itUse . heldUse .~ HeldShatter --shootShatter
|
||||
-- & itUse . heldUse .~ HeldShatter --shootShatter
|
||||
& itUse . heldMods .~ ShatterMod
|
||||
& itUse . heldAim . aimStance .~ TwoHandFlat
|
||||
|
||||
@@ -91,7 +91,7 @@ heldInfo hit = case hit of
|
||||
SPARKGUN -> "A weapon that produces an arc of electricity. The arc will attempt to discharge at a nearby object."
|
||||
TESLAGUN -> "A weapon that discharges a sustained arc of electricity. The arc will attempt to discharge at a nearby object."
|
||||
LASGUN -> "A weapon that continuously emits photons in a narrow beam."
|
||||
LASCIRCLE -> "A extensive configuration of prisms and mirrors that produces multiple laser beams around its user."
|
||||
-- LASCIRCLE -> "A extensive configuration of prisms and mirrors that produces multiple laser beams around its user."
|
||||
DUALBEAM -> "A weapon that emits two beams that converge at a selectable point in front of the user."
|
||||
LASWIDE _ -> "A weapon that continuously emits photons in a narrow beam. The beam expands as the weapon heats up."
|
||||
TRACTORGUN -> "An item that produces a beam of gravitons."
|
||||
|
||||
@@ -55,7 +55,7 @@ heldBounds hit = case hit of
|
||||
SPARKGUN -> ts
|
||||
TESLAGUN -> ts
|
||||
LASGUN -> ls
|
||||
LASCIRCLE -> ls
|
||||
-- LASCIRCLE -> ls
|
||||
DUALBEAM -> ls
|
||||
LASWIDE _ -> ls
|
||||
TRACTORGUN -> ls
|
||||
|
||||
@@ -12,7 +12,7 @@ droneLauncher :: Item
|
||||
droneLauncher =
|
||||
defaultHeldItem
|
||||
& itUse . heldDelay . rateMax .~ 20
|
||||
& itUse . heldMods .~ AmmoUseCheckMod
|
||||
-- & itUse . heldMods .~ AmmoUseCheckMod
|
||||
& itUse . heldAim . aimWeight .~ 8
|
||||
& itUse . heldAim . aimRange .~ 0.5
|
||||
& itUse . heldAim . aimStance .~ TwoHandOver
|
||||
|
||||
@@ -18,7 +18,8 @@ explodeRemoteRocket itid pjid w =
|
||||
w
|
||||
& cWorld . lWorld . projectiles . ix pjid . prjUpdates .~ [PJRetireRemote itid 30 pjid]
|
||||
& cWorld . lWorld . projectiles . ix pjid . prjDraw .~ DrawBlankProjectile
|
||||
& itPoint . itUse . heldUse .~ HeldDoNothing
|
||||
-- & itPoint . itUse . heldUse .~ HeldDoNothing
|
||||
& itPoint . itUse . heldMods .~ DoNothingMod
|
||||
& usePayload (_prjPayload thepj) (_prjPos thepj)
|
||||
where
|
||||
itPoint = pointerToItemLocation $ w ^?! cWorld . lWorld . itemLocations . ix itid-- _itemLocations (_cWorld w) IM.! itid
|
||||
|
||||
@@ -13,8 +13,8 @@ spawnGun :: Creature -> Item
|
||||
spawnGun _ =
|
||||
defaultHeldItem
|
||||
& itUse . heldDelay . rateMax .~ 100
|
||||
& itUse . heldUse .~ HeldDoNothing --(\_ -> spawnCrNextTo cr)
|
||||
& itUse . heldMods .~ HeldModNothing
|
||||
-- & itUse . heldUse .~ HeldDoNothing --(\_ -> spawnCrNextTo cr)
|
||||
-- & itUse . heldMods .~ DoNothingMod
|
||||
& itType . iyBase .~ LEFT SPAWNER
|
||||
|
||||
spawnCrNextTo ::
|
||||
|
||||
@@ -342,7 +342,7 @@ withSidePushAfterI maxSide eff item cr w =
|
||||
(pushAmount, g) = randomR (- maxSide, maxSide) $ _randGen w
|
||||
|
||||
useAllAmmo :: ChainEffect
|
||||
useAllAmmo eff item cr w = error "use all ammo"
|
||||
useAllAmmo = error "use all ammo"
|
||||
--useAllAmmo eff ams item cr w = fromMaybe w $ do
|
||||
-- let invids = ams ^.. traverse . itLocation . ipInvID
|
||||
-- return . eff ams item cr $ foldl' f w invids
|
||||
@@ -668,7 +668,7 @@ repeatOnFrames is hm f it cr w =
|
||||
-- return $ f it cr' w'
|
||||
|
||||
duplicateLoaded :: ChainEffect
|
||||
duplicateLoaded eff it cr w = error "duplicateLoaded"
|
||||
duplicateLoaded = error "duplicateLoaded"
|
||||
--duplicateLoaded :: ChainEffect
|
||||
--duplicateLoaded eff ams it cr w = foldr f w (take numbul [1::Int .. ])
|
||||
-- where
|
||||
@@ -678,7 +678,7 @@ duplicateLoaded eff it cr w = error "duplicateLoaded"
|
||||
-- cr ^? crInv . ix i . itUse . amagLoadStatus . iaLoaded
|
||||
|
||||
duplicateNumBarrels :: Int -> ChainEffect
|
||||
duplicateNumBarrels n eff itm cr w = error "duplicateNumBarrels"
|
||||
duplicateNumBarrels = error "duplicateNumBarrels"
|
||||
--duplicateNumBarrels :: Int -> ChainEffect
|
||||
--duplicateNumBarrels n eff ams itm cr w = foldr f w (take n $ itm ^?! itUse . heldAim . aimMuzzles)
|
||||
-- where
|
||||
@@ -694,7 +694,7 @@ duplicateNumBarrels n eff itm cr w = error "duplicateNumBarrels"
|
||||
-- (a,g) = randomR (-inacc,inacc) $ _randGen w'
|
||||
|
||||
duplicateLoadedBarrels :: ChainEffect
|
||||
duplicateLoadedBarrels eff itm cr = error "duplicateLoadedBarrels"
|
||||
duplicateLoadedBarrels eff itm cr = eff itm cr
|
||||
-- = duplicateNumBarrels numbul eff ams itm cr
|
||||
-- where
|
||||
-- numbul :: Int
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ moduleName imt = case imt of
|
||||
INCENDLAS -> Just "+INCENDIARY"
|
||||
SPLITLAS -> Just "+SPLIT"
|
||||
STATICLAS -> Just "+STATIC"
|
||||
WEPTELE -> Just "+DIRECTEDTELE"
|
||||
-- WEPTELE -> Just "+DIRECTEDTELE"
|
||||
LAUNCHHOME -> Just "+TARGET HOMING"
|
||||
ATTACHTORCH -> Just "+TORCH"
|
||||
|
||||
|
||||
@@ -82,7 +82,8 @@ retireRemoteProj itid pjid w =
|
||||
w
|
||||
& pointerToItemLocation (w ^?! cWorld . lWorld . itemLocations . ix itid)
|
||||
%~ ( (itScope . remotePos .~ V2 0 0)
|
||||
. (itUse . heldUse .~ HeldFireRemoteShell)
|
||||
-- . (itUse . heldUse .~ HeldFireRemoteShell)
|
||||
. (itUse . heldMods .~ FireRemoteShellMod)
|
||||
)
|
||||
& cWorld . lWorld . props %~ IM.delete pjid
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import Dodge.Creature.Impulse.UseItem
|
||||
import Dodge.Data.World
|
||||
import Dodge.Default
|
||||
import Dodge.Inventory.Lock
|
||||
import Dodge.Item.Location
|
||||
--import Dodge.Item.Location
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.Terminal
|
||||
import Dodge.WorldEvent.Cloud
|
||||
@@ -35,7 +35,8 @@ doWdWd we = case we of
|
||||
TorqueCr x cid -> torqueCr x cid
|
||||
SoundStart so p sid mi -> soundStart so p sid mi
|
||||
WdWdNegateTrig trid -> cWorld . lWorld . triggers . ix trid %~ not
|
||||
WdWdFromItixCrixWdWd itid crid f -> \w -> fromMaybe w $ do
|
||||
--WdWdFromItixCrixWdWd itid crid f -> \w -> fromMaybe w $ do
|
||||
WdWdFromItixCrixWdWd _ crid f -> \w -> fromMaybe w $ do
|
||||
cr <- w ^? cWorld . lWorld . creatures . ix crid
|
||||
--it <- getItem itid w
|
||||
itRef <- cr ^? crManipulation . manObject . inInventory . ispItem
|
||||
|
||||
Reference in New Issue
Block a user