Improve item use hammer, improve wide laser
This commit is contained in:
@@ -65,7 +65,7 @@ itemCombinations =
|
|||||||
-- , p [o LASGUN,o PIPE] lasGunPulse
|
-- , p [o LASGUN,o PIPE] lasGunPulse
|
||||||
, p [p 2 LASGUN,p 1 $ cr HARDWARE] dualBeam
|
, p [p 2 LASGUN,p 1 $ cr HARDWARE] dualBeam
|
||||||
-- , p [o LASGUN,o $ cr PIPE, o $ cr PRISM] lasWidePulse
|
-- , p [o LASGUN,o $ cr PIPE, o $ cr PRISM] lasWidePulse
|
||||||
, p [o LASGUN,o $ cr TRANSFORMER] (lasGunWide 2)
|
, p [o LASGUN,o $ cr TRANSFORMER] (lasWide 2)
|
||||||
|
|
||||||
, p [o $ cr TRANSFORMER,p 2 $ cr CAN] sparkGun
|
, p [o $ cr TRANSFORMER,p 2 $ cr CAN] sparkGun
|
||||||
, p [o SPARKGUN,p 2 $ cr PIPE] teslaGun
|
, p [o SPARKGUN,p 2 $ cr PIPE] teslaGun
|
||||||
@@ -83,7 +83,7 @@ itemCombinations =
|
|||||||
|
|
||||||
, p [p 2 $ cr PLATE] flatShield
|
, p [p 2 $ cr PLATE] flatShield
|
||||||
]
|
]
|
||||||
++ map (\i -> po [LASGUNWIDE i,cr TRANSFORMER] $ lasGunWide (i+1)) [2..9]
|
++ map (\i -> po [LASWIDE i,cr TRANSFORMER] $ lasWide (i+1)) [2..9]
|
||||||
-- ++ map (\i -> po [LASGUNWIDE i,cr HARDWARE] $ lasFocus i) [2..10]
|
-- ++ map (\i -> po [LASGUNWIDE i,cr HARDWARE] $ lasFocus i) [2..10]
|
||||||
++ map (\i -> po [cr PIPE,BANGSTICK i] $ bangStick (i+1)) [1..8]
|
++ map (\i -> po [cr PIPE,BANGSTICK i] $ bangStick (i+1)) [1..8]
|
||||||
++ map (\i -> po [REVOLVERX i,cr CAN] $ revolverX (i+1)) [1..5]
|
++ map (\i -> po [REVOLVERX i,cr CAN] $ revolverX (i+1)) [1..5]
|
||||||
@@ -182,7 +182,7 @@ batteryGuns =
|
|||||||
-- , lasSway
|
-- , lasSway
|
||||||
, lasSwing
|
, lasSwing
|
||||||
] ++
|
] ++
|
||||||
[ lasGunWide i | i <- [2..10]
|
[ lasWide i | i <- [2..10]
|
||||||
]
|
]
|
||||||
-- ++
|
-- ++
|
||||||
-- [ lasFocus i | i <- [1..10]]
|
-- [ lasFocus i | i <- [1..10]]
|
||||||
|
|||||||
@@ -112,8 +112,8 @@ data ItemBaseType
|
|||||||
| DUALBEAM
|
| DUALBEAM
|
||||||
| LASGUNSWING
|
| LASGUNSWING
|
||||||
-- | LASGUNSWAY
|
-- | LASGUNSWAY
|
||||||
| LASGUNWIDEPULSE
|
-- | LASGUNWIDEPULSE
|
||||||
| LASGUNWIDE {_xNum :: Int}
|
| LASWIDE {_xNum :: Int}
|
||||||
-- | LASGUNFOCUS Int
|
-- | LASGUNFOCUS Int
|
||||||
| SONICGUN
|
| SONICGUN
|
||||||
| TRACTORGUN
|
| TRACTORGUN
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ maxShowX bt = case bt of
|
|||||||
MINIGUNX _ -> Just 3
|
MINIGUNX _ -> Just 3
|
||||||
GRAPECANNON _ -> Just 1
|
GRAPECANNON _ -> Just 1
|
||||||
LAUNCHERX _ -> Just 2
|
LAUNCHERX _ -> Just 2
|
||||||
LASGUNWIDE _ -> Just 2
|
LASWIDE _ -> Just 2
|
||||||
-- LASGUNFOCUS _ -> Just 2
|
-- LASGUNFOCUS _ -> Just 2
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ inventoryX c = case c of
|
|||||||
'J' -> [ lasGun
|
'J' -> [ lasGun
|
||||||
, lasGun
|
, lasGun
|
||||||
, dualBeam
|
, dualBeam
|
||||||
, lasWidePulse
|
-- , lasWidePulse
|
||||||
, makeTypeCraftNum 10 TRANSFORMER
|
, makeTypeCraftNum 10 TRANSFORMER
|
||||||
]
|
]
|
||||||
_ -> []
|
_ -> []
|
||||||
|
|||||||
@@ -281,7 +281,6 @@ youDropItem' w = case yourItem w ^? _Just . itCurseStatus of
|
|||||||
copyInvItemToFloor :: Creature -> Int -> World -> World
|
copyInvItemToFloor :: Creature -> Int -> World -> World
|
||||||
copyInvItemToFloor cr i = copyItemToFloor (_crPos cr)
|
copyInvItemToFloor cr i = copyItemToFloor (_crPos cr)
|
||||||
$ _crInv cr IM.! i
|
$ _crInv cr IM.! i
|
||||||
& itPos .~ VoidItm
|
|
||||||
& itIsHeld .~ False
|
& itIsHeld .~ False
|
||||||
|
|
||||||
sizeSelf :: Float -> Creature -> World -> Maybe World
|
sizeSelf :: Float -> Creature -> World -> Maybe World
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ tryClickReload :: Creature -> Item -> World -> (World -> World) -> World -> Worl
|
|||||||
tryClickReload cr it w f
|
tryClickReload cr it w f
|
||||||
| _crID cr == _yourID w && itNeedsLoading it && _mouseButtons w M.!? SDL.ButtonLeft == Just False
|
| _crID cr == _yourID w && itNeedsLoading it && _mouseButtons w M.!? SDL.ButtonLeft == Just False
|
||||||
= crToggleReloading cr
|
= crToggleReloading cr
|
||||||
| otherwise =
|
| otherwise
|
||||||
(runIdentity . pointToItem (_itPos it) (return . (itUse . useHammer' .~ HammerDown)))
|
= (runIdentity . pointToItem (_itPos it) (return . (itUse . useHammer .~ HammerDown)))
|
||||||
. f
|
. f
|
||||||
|
|
||||||
itNeedsLoading :: Item -> Bool
|
itNeedsLoading :: Item -> Bool
|
||||||
@@ -96,12 +96,15 @@ toggleEquipmentAt rbops invid cr w = case rbops ^? opAllocateEquipment of
|
|||||||
useLeftItem :: Int -> World -> World
|
useLeftItem :: Int -> World -> World
|
||||||
useLeftItem cid w
|
useLeftItem cid w
|
||||||
| _crInvLock cr = w
|
| _crInvLock cr = w
|
||||||
| itmShouldBeUsed = useItem cr w
|
| itmShouldBeUsed = useItem cr w -- I believe this ONLY sets equipment options
|
||||||
| otherwise = fromMaybe w $ do
|
| otherwise = fromMaybe w $ do
|
||||||
invid <- _crLeftInvSel cr
|
invid <- _crLeftInvSel cr
|
||||||
itm <- cr ^? crInv . ix invid
|
itm <- cr ^? crInv . ix invid
|
||||||
f <- cr ^? crInv . ix invid . itUse . lUse
|
f <- cr ^? crInv . ix invid . itUse . lUse
|
||||||
return $ f itm cr w
|
return
|
||||||
|
. (runIdentity . pointToItem (_itPos itm) (return . (itUse . useHammer .~ HammerDown)))
|
||||||
|
. f itm cr
|
||||||
|
$ w
|
||||||
where
|
where
|
||||||
cr = _creatures w IM.! cid
|
cr = _creatures w IM.! cid
|
||||||
itmShouldBeUsed = isJust (cr ^? crInv . ix (crSel cr) . itUse . cUse)
|
itmShouldBeUsed = isJust (cr ^? crInv . ix (crSel cr) . itUse . cUse)
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ movementSideEff cr w
|
|||||||
(randAng,_) = randomR (0,2*pi) $ _randGen w
|
(randAng,_) = randomR (0,2*pi) $ _randGen w
|
||||||
|
|
||||||
useUpdate :: ItemUse -> ItemUse
|
useUpdate :: ItemUse -> ItemUse
|
||||||
useUpdate = (useHammer' %~ moveHammerUp)
|
useUpdate = (useHammer %~ moveHammerUp)
|
||||||
. (useDelay . warmTime %~ decreaseToZero)
|
. (useDelay . warmTime %~ decreaseToZero)
|
||||||
. (useDelay . rateTime %~ decreaseToZero)
|
. (useDelay . rateTime %~ decreaseToZero)
|
||||||
|
|
||||||
|
|||||||
+30
-28
@@ -1,6 +1,7 @@
|
|||||||
module Dodge.Default.Weapon
|
module Dodge.Default.Weapon
|
||||||
where
|
where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
|
import Dodge.Item.Weapon.AmmoParams
|
||||||
import Dodge.Reloading.Action
|
import Dodge.Reloading.Action
|
||||||
import Dodge.Item.Weapon.Bullet
|
import Dodge.Item.Weapon.Bullet
|
||||||
import Dodge.Default.Item
|
import Dodge.Default.Item
|
||||||
@@ -32,41 +33,41 @@ defaultBulletLoadable = defaultLoadable & laAmmoType .~ basicBullet
|
|||||||
defaultChargeable :: ItemConsumption
|
defaultChargeable :: ItemConsumption
|
||||||
defaultChargeable = ChargeableAmmo 100 100
|
defaultChargeable = ChargeableAmmo 100 100
|
||||||
|
|
||||||
ruseRate :: Int
|
--ruseRate :: Int
|
||||||
-> (Item -> Creature -> World -> World)
|
-- -> (Item -> Creature -> World -> World)
|
||||||
-> [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
|
-- -> [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
|
||||||
-> ItemUse
|
-- -> ItemUse
|
||||||
ruseRate i f usemods = RightUse
|
--ruseRate i f usemods = RightUse
|
||||||
{ _rUse = f
|
-- { _rUse = f
|
||||||
, _useDelay = FixedRate
|
-- , _useDelay = FixedRate
|
||||||
{ _rateMax = i
|
-- { _rateMax = i
|
||||||
, _rateTime = 0
|
-- , _rateTime = 0
|
||||||
}
|
-- }
|
||||||
, _useMods = usemods
|
-- , _useMods = usemods
|
||||||
, _useHammer' = HammerUp
|
-- , _useHammer = HammerUp
|
||||||
, _useAim = defaultAimParams
|
-- , _useAim = defaultAimParams
|
||||||
, _heldScroll = \_ _ -> id
|
-- , _heldScroll = \_ _ -> id
|
||||||
}
|
-- }
|
||||||
|
|
||||||
ruseInstant
|
--ruseInstant
|
||||||
:: (Item -> Creature -> World -> World)
|
-- :: (Item -> Creature -> World -> World)
|
||||||
-> [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
|
-- -> [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
|
||||||
-> ItemUse
|
-- -> ItemUse
|
||||||
ruseInstant f usemods = RightUse
|
--ruseInstant f usemods = RightUse
|
||||||
{ _rUse = f
|
-- { _rUse = f
|
||||||
, _useDelay = NoDelay
|
-- , _useDelay = NoDelay
|
||||||
, _useMods = usemods
|
-- , _useMods = usemods
|
||||||
, _useHammer' = HammerUp
|
-- , _useHammer = HammerUp
|
||||||
, _useAim = defaultAimParams
|
-- , _useAim = defaultAimParams
|
||||||
, _heldScroll = \_ _ -> id
|
-- , _heldScroll = \_ _ -> id
|
||||||
}
|
-- }
|
||||||
|
|
||||||
defaultrUse :: ItemUse
|
defaultrUse :: ItemUse
|
||||||
defaultrUse = RightUse
|
defaultrUse = RightUse
|
||||||
{ _rUse = \_ _ -> id
|
{ _rUse = \_ _ -> id
|
||||||
, _useDelay = FixedRate {_rateMax = 8, _rateTime = 0}
|
, _useDelay = FixedRate {_rateMax = 8, _rateTime = 0}
|
||||||
, _useMods = []
|
, _useMods = []
|
||||||
, _useHammer' = HammerUp
|
, _useHammer = HammerUp
|
||||||
, _useAim = defaultAimParams
|
, _useAim = defaultAimParams
|
||||||
, _heldScroll = \_ _ -> id
|
, _heldScroll = \_ _ -> id
|
||||||
}
|
}
|
||||||
@@ -120,6 +121,7 @@ defaultWeapon = defaultItem
|
|||||||
|
|
||||||
defaultBulletWeapon :: Item
|
defaultBulletWeapon :: Item
|
||||||
defaultBulletWeapon = defaultWeapon & itConsumption .~ defaultBulletLoadable
|
defaultBulletWeapon = defaultWeapon & itConsumption .~ defaultBulletLoadable
|
||||||
|
& itUse .~ ruseAmmoParams
|
||||||
|
|
||||||
defaultItemValue :: ItemValue
|
defaultItemValue :: ItemValue
|
||||||
defaultItemValue = ItemValue 10 MundaneItem
|
defaultItemValue = ItemValue 10 MundaneItem
|
||||||
|
|||||||
+4
-4
@@ -63,8 +63,8 @@ itemFromBase ibt = case ibt of
|
|||||||
DUALBEAM -> dualBeam
|
DUALBEAM -> dualBeam
|
||||||
LASGUNSWING -> lasSwing
|
LASGUNSWING -> lasSwing
|
||||||
--LASGUNSWAY -> lasSway
|
--LASGUNSWAY -> lasSway
|
||||||
LASGUNWIDEPULSE -> lasWidePulse
|
-- LASGUNWIDEPULSE -> lasWidePulse
|
||||||
LASGUNWIDE i -> lasGunWide i
|
LASWIDE i -> lasWide i
|
||||||
--LASGUNFOCUS i -> lasFocus i
|
--LASGUNFOCUS i -> lasFocus i
|
||||||
SONICGUN -> sonicGun
|
SONICGUN -> sonicGun
|
||||||
TRACTORGUN -> tractorGun
|
TRACTORGUN -> tractorGun
|
||||||
@@ -204,8 +204,8 @@ baseToFamily ibt = case ibt of
|
|||||||
DUALBEAM -> HeldFamily
|
DUALBEAM -> HeldFamily
|
||||||
LASGUNSWING -> HeldFamily
|
LASGUNSWING -> HeldFamily
|
||||||
-- LASGUNSWAY -> HeldFamily
|
-- LASGUNSWAY -> HeldFamily
|
||||||
LASGUNWIDEPULSE -> HeldFamily
|
-- LASGUNWIDEPULSE -> HeldFamily
|
||||||
LASGUNWIDE _ -> HeldFamily
|
LASWIDE _ -> HeldFamily
|
||||||
--LASGUNFOCUS _ -> HeldFamily
|
--LASGUNFOCUS _ -> HeldFamily
|
||||||
SONICGUN -> HeldFamily
|
SONICGUN -> HeldFamily
|
||||||
TRACTORGUN -> HeldFamily
|
TRACTORGUN -> HeldFamily
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ flatShield = defaultEquipment
|
|||||||
{ _rUse = \_ _ -> id
|
{ _rUse = \_ _ -> id
|
||||||
, _useDelay = NoDelay
|
, _useDelay = NoDelay
|
||||||
, _useMods = []
|
, _useMods = []
|
||||||
, _useHammer' = HammerUp
|
, _useHammer = HammerUp
|
||||||
, _useAim = AimParams
|
, _useAim = AimParams
|
||||||
{ _aimWeight = 5
|
{ _aimWeight = 5
|
||||||
, _aimRange = 0
|
, _aimRange = 0
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
module Dodge.Item.Weapon.AmmoParams
|
module Dodge.Item.Weapon.AmmoParams
|
||||||
( useAmmoParams
|
( ruseAmmoParams
|
||||||
, ruseAmmoParamsRate
|
, useAmmoParams
|
||||||
, fractionLoadedAmmo
|
, fractionLoadedAmmo
|
||||||
, fractionLoadedAmmo2
|
, fractionLoadedAmmo2
|
||||||
) where
|
) where
|
||||||
@@ -15,17 +15,16 @@ import LensHelp
|
|||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
--import Control.Lens
|
--import Control.Lens
|
||||||
|
|
||||||
ruseAmmoParamsRate :: Int
|
ruseAmmoParams :: ItemUse
|
||||||
-> [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
|
ruseAmmoParams = RightUse
|
||||||
-> ItemUse
|
|
||||||
ruseAmmoParamsRate rate usemods = RightUse
|
|
||||||
{ _rUse = useAmmoParams Nothing
|
{ _rUse = useAmmoParams Nothing
|
||||||
, _useDelay = FixedRate {_rateMax = rate,_rateTime = 0}
|
, _useDelay = FixedRate {_rateMax = 10, _rateTime = 0}
|
||||||
, _useMods = usemods
|
, _useMods = []
|
||||||
, _useHammer' = HammerUp
|
, _useHammer = HammerUp
|
||||||
, _useAim = defaultAimParams
|
, _useAim = defaultAimParams
|
||||||
, _heldScroll = \_ _ -> id
|
, _heldScroll = \_ _ -> id
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultAimParams :: AimParams
|
defaultAimParams :: AimParams
|
||||||
defaultAimParams = AimParams
|
defaultAimParams = AimParams
|
||||||
{ _aimWeight = 0
|
{ _aimWeight = 0
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
module Dodge.Item.Weapon.BatteryGuns
|
module Dodge.Item.Weapon.BatteryGuns
|
||||||
( lasGun
|
( lasGun
|
||||||
, dualBeam
|
, dualBeam
|
||||||
, lasGunWide
|
, lasWide
|
||||||
, lasWidePulse
|
-- , lasWidePulse
|
||||||
--, lasSway
|
--, lasSway
|
||||||
, lasSwing
|
, lasSwing
|
||||||
--, lasFocus
|
--, lasFocus
|
||||||
@@ -76,14 +76,6 @@ teslaGun = defaultBatteryGun
|
|||||||
{ _itConsumption = defaultLoadable
|
{ _itConsumption = defaultLoadable
|
||||||
& laMax .~ 200
|
& laMax .~ 200
|
||||||
& laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60]
|
& laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60]
|
||||||
, _itUse = ruseInstant shootTeslaArc
|
|
||||||
[ ammoCheckI
|
|
||||||
, withTempLight 1 100 (V3 0 0 1)
|
|
||||||
, withSoundForI elecCrackleS 1
|
|
||||||
, useAmmoAmount 1
|
|
||||||
]
|
|
||||||
& useAim . aimWeight .~ 6
|
|
||||||
& useAim . aimStance .~ TwoHandFlat
|
|
||||||
, _itDimension = ItemDimension
|
, _itDimension = ItemDimension
|
||||||
{ _dimRad = 9
|
{ _dimRad = 9
|
||||||
, _dimCenter = V3 4 0 0
|
, _dimCenter = V3 4 0 0
|
||||||
@@ -95,6 +87,16 @@ teslaGun = defaultBatteryGun
|
|||||||
}
|
}
|
||||||
, _itParams = teslaParams
|
, _itParams = teslaParams
|
||||||
}
|
}
|
||||||
|
& itUse . rUse .~ shootTeslaArc
|
||||||
|
& itUse . useDelay .~ NoDelay
|
||||||
|
& itUse . useMods .~
|
||||||
|
[ ammoCheckI
|
||||||
|
, withTempLight 1 100 (V3 0 0 1)
|
||||||
|
, withSoundForI elecCrackleS 1
|
||||||
|
, useAmmoAmount 1
|
||||||
|
]
|
||||||
|
& itUse . useAim . aimWeight .~ 6
|
||||||
|
& itUse . useAim . aimStance .~ TwoHandFlat
|
||||||
& itType . iyBase .~ TESLAGUN
|
& itType . iyBase .~ TESLAGUN
|
||||||
teslaGunPic :: Item -> SPic
|
teslaGunPic :: Item -> SPic
|
||||||
teslaGunPic _ = noPic $ colorSH blue $
|
teslaGunPic _ = noPic $ colorSH blue $
|
||||||
@@ -121,54 +123,60 @@ lasPulse = lasGun
|
|||||||
& itParams . lasColor .~ frac it * orange
|
& itParams . lasColor .~ frac it * orange
|
||||||
frac it = 0.5 * (1 + sin (pi * fromIntegral (_lasCycle $ _itParams it) * 0.1))
|
frac it = 0.5 * (1 + sin (pi * fromIntegral (_lasCycle $ _itParams it) * 0.1))
|
||||||
|
|
||||||
|
lasWide :: Int -> Item
|
||||||
lasGunWide :: Int -> Item
|
lasWide n = lasGun
|
||||||
lasGunWide n = lasGun
|
& itType . iyBase .~ LASWIDE n
|
||||||
& itType . iyBase .~ LASGUNWIDE n
|
|
||||||
& itParams . lasColor .~ orange
|
& itParams . lasColor .~ orange
|
||||||
& itParams . lasDamage .~ 2
|
& itParams . lasDamage .~ 2
|
||||||
& itUse .~ ( ruseInstant shootLaser
|
& itUse . rUse .~ shootLaser
|
||||||
|
& itUse . useDelay .~ NoDelay
|
||||||
|
& itUse . useMods .~
|
||||||
[ ammoCheckI
|
[ ammoCheckI
|
||||||
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
|
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
|
||||||
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
||||||
, withSoundForI tone440sawtoothquietS 2
|
, withSoundForI tone440sawtoothquietS 2
|
||||||
, useAmmoAmount 1
|
, useAmmoAmount 1
|
||||||
, duplicateOffsets xs
|
, withItemUpdate' increasecycle
|
||||||
|
, withItem $ \it -> duplicateOffsetsV2 (xs it)
|
||||||
]
|
]
|
||||||
& useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
)
|
|
||||||
where
|
where
|
||||||
n' = 9 * n
|
increasecycle it = case _useHammer (_itUse it) of
|
||||||
xs = [ 0.5 * (fromIntegral x - fromIntegral (n'-1) /2) | x <- [0..n'-1] ]
|
HammerUp -> it & itParams . lasCycle .~ 1
|
||||||
lasWidePulse :: Item
|
_ -> it & itParams . lasCycle %~ (min (n * 5) . (+ 1))
|
||||||
lasWidePulse = lasGun
|
xs it = [ V2 ((0.2*yoff x) ^ (2::Int)) (yoff x) | x <- [(0::Int)..n'-1] ]
|
||||||
& itType . iyBase .~ LASGUNWIDEPULSE
|
|
||||||
& itParams . lasColor .~ orange
|
|
||||||
& itParams . lasDamage .~ 2
|
|
||||||
& itUse .~ ( ruseInstant shootLaser
|
|
||||||
[ ammoCheckI
|
|
||||||
, withItem $ \it -> withTempLight 1 (100 * frac it) (xyzV4 (_lasColor $ _itParams it))
|
|
||||||
, withItem $ \it -> withSoundForVol (frac it) tone440sawtoothquietS 2
|
|
||||||
, withItemUpdate itup
|
|
||||||
$ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) (frac it * 0.8)
|
|
||||||
, useAmmoAmount 1
|
|
||||||
, withItemUpdate itup $ \it -> duplicateOffsets (xs it)
|
|
||||||
]
|
|
||||||
& useAim . aimWeight .~ 6
|
|
||||||
& useAim . aimRange .~ 1
|
|
||||||
& useAim . aimStance .~ TwoHandTwist
|
|
||||||
)
|
|
||||||
where
|
where
|
||||||
itup it = it
|
yoff x = fromIntegral x - fromIntegral (n'-1) / 2
|
||||||
& itParams . lasCycle %~ (\i -> (i+1) `mod` 40)
|
n' = _lasCycle (_itParams it)
|
||||||
& itParams . lasDamage .~ ceiling ((22 :: Float) * frac it)
|
--lasWidePulse :: Item
|
||||||
& itParams . lasColor .~ frac it * orange
|
--lasWidePulse = lasGun
|
||||||
frac it = 0.5 * (1 + sin (pi * fromIntegral (_lasCycle $ _itParams it) * 0.05))
|
-- & itType . iyBase .~ LASGUNWIDEPULSE
|
||||||
xs it = [ 0.25 * (fromIntegral x - fromIntegral (n'-1) /2) | x <- [0..n'-1] ]
|
-- & itParams . lasColor .~ orange
|
||||||
where
|
-- & itParams . lasDamage .~ 2
|
||||||
n' = (ceiling $ (150 :: Float) * frac it) :: Int
|
-- & itUse .~ ( ruseInstant shootLaser
|
||||||
|
-- [ ammoCheckI
|
||||||
|
-- , withItem $ \it -> withTempLight 1 (100 * frac it) (xyzV4 (_lasColor $ _itParams it))
|
||||||
|
-- , withItem $ \it -> withSoundForVol (frac it) tone440sawtoothquietS 2
|
||||||
|
-- , withItemUpdate itup
|
||||||
|
-- $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) (frac it * 0.8)
|
||||||
|
-- , useAmmoAmount 1
|
||||||
|
-- , withItemUpdate itup $ \it -> duplicateOffsets (xs it)
|
||||||
|
-- ]
|
||||||
|
-- & useAim . aimWeight .~ 6
|
||||||
|
-- & useAim . aimRange .~ 1
|
||||||
|
-- & useAim . aimStance .~ TwoHandTwist
|
||||||
|
-- )
|
||||||
|
-- where
|
||||||
|
-- itup it = it
|
||||||
|
-- & itParams . lasCycle %~ (\i -> (i+1) `mod` 40)
|
||||||
|
-- & itParams . lasDamage .~ ceiling ((22 :: Float) * frac it)
|
||||||
|
-- & itParams . lasColor .~ frac it * orange
|
||||||
|
-- frac it = 0.5 * (1 + sin (pi * fromIntegral (_lasCycle $ _itParams it) * 0.05))
|
||||||
|
-- xs it = [ 0.25 * (fromIntegral x - fromIntegral (n'-1) /2) | x <- [0..n'-1] ]
|
||||||
|
-- where
|
||||||
|
-- n' = (ceiling $ (150 :: Float) * frac it) :: Int
|
||||||
--lasSway :: Item
|
--lasSway :: Item
|
||||||
--lasSway = lasGun
|
--lasSway = lasGun
|
||||||
-- & itType . iyBase .~ LASGUNSWAY
|
-- & itType . iyBase .~ LASGUNSWAY
|
||||||
@@ -222,17 +230,18 @@ dualBeam = lasGun
|
|||||||
, _subParams = Nothing
|
, _subParams = Nothing
|
||||||
, _dbGap = 20
|
, _dbGap = 20
|
||||||
}
|
}
|
||||||
& itUse .~ (ruseInstant shootDualLaser
|
& itUse . rUse .~ shootDualLaser
|
||||||
|
& itUse . useDelay .~ NoDelay
|
||||||
|
& itUse . useMods .~
|
||||||
[ ammoCheckI
|
[ ammoCheckI
|
||||||
, withItem $ \it -> withMuzPosShift (V2 0 (thegap it)) $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
, 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
|
, withItem $ \it -> withMuzPosShift (V2 0 (-thegap it)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8
|
||||||
, withSoundForI tone440sawtoothquietS 2
|
, withSoundForI tone440sawtoothquietS 2
|
||||||
, useAmmoAmount 1
|
, useAmmoAmount 1
|
||||||
]
|
]
|
||||||
& useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& useAim . aimStance .~ TwoHandFlat
|
& itUse . useAim . aimStance .~ TwoHandFlat
|
||||||
)
|
|
||||||
& itType . iyModules . at ModDualBeam ?~ EMPTYMODULE
|
& itType . iyModules . at ModDualBeam ?~ EMPTYMODULE
|
||||||
where
|
where
|
||||||
thegap = _dbGap . _itParams
|
thegap = _dbGap . _itParams
|
||||||
@@ -259,16 +268,6 @@ lasGun = defaultAutoBatteryGun
|
|||||||
{ _itConsumption = defaultLoadable
|
{ _itConsumption = defaultLoadable
|
||||||
& laMax .~ 200
|
& laMax .~ 200
|
||||||
& laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60]
|
& laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60]
|
||||||
, _itUse = ruseInstant shootLaser
|
|
||||||
[ ammoCheckI
|
|
||||||
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
|
|
||||||
, withSoundForI tone440sawtoothquietS 2
|
|
||||||
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
|
||||||
, useAmmoAmount 1
|
|
||||||
]
|
|
||||||
& useAim . aimWeight .~ 6
|
|
||||||
& useAim . aimRange .~ 1
|
|
||||||
& useAim . aimStance .~ TwoHandTwist
|
|
||||||
, _itParams = Refracting
|
, _itParams = Refracting
|
||||||
{ _phaseV = 1
|
{ _phaseV = 1
|
||||||
, _lasColor = yellow
|
, _lasColor = yellow
|
||||||
@@ -287,6 +286,18 @@ lasGun = defaultAutoBatteryGun
|
|||||||
, _dimSPic = lasGunPic
|
, _dimSPic = lasGunPic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
& itUse . rUse .~ shootLaser
|
||||||
|
& itUse . useDelay .~ NoDelay
|
||||||
|
& itUse . useMods .~
|
||||||
|
[ ammoCheckI
|
||||||
|
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
|
||||||
|
, withSoundForI tone440sawtoothquietS 2
|
||||||
|
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
||||||
|
, useAmmoAmount 1
|
||||||
|
]
|
||||||
|
& itUse . useAim . aimWeight .~ 6
|
||||||
|
& itUse . useAim . aimRange .~ 1
|
||||||
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
& itType . iyBase .~ LASGUN
|
& itType . iyBase .~ LASGUN
|
||||||
|
|
||||||
lasGunPic :: Item -> SPic
|
lasGunPic :: Item -> SPic
|
||||||
@@ -337,12 +348,6 @@ tractorGun = lasGun
|
|||||||
{ _itConsumption = defaultLoadable
|
{ _itConsumption = defaultLoadable
|
||||||
& laMax .~ 10000
|
& laMax .~ 10000
|
||||||
& laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60]
|
& laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60]
|
||||||
, _itUse = ruseInstant aTractorBeam
|
|
||||||
[ ammoCheckI
|
|
||||||
]
|
|
||||||
& useAim . aimWeight .~ 6
|
|
||||||
& useAim . aimRange .~ 1
|
|
||||||
& useAim . aimStance .~ TwoHandTwist
|
|
||||||
, _itDimension = ItemDimension
|
, _itDimension = ItemDimension
|
||||||
{ _dimRad = 10
|
{ _dimRad = 10
|
||||||
, _dimCenter = V3 15 0 0
|
, _dimCenter = V3 15 0 0
|
||||||
@@ -355,6 +360,14 @@ tractorGun = lasGun
|
|||||||
, _tweakSel = 0
|
, _tweakSel = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
& itUse . rUse .~ aTractorBeam
|
||||||
|
& itUse . useDelay .~ NoDelay
|
||||||
|
& itUse . useMods .~
|
||||||
|
[ ammoCheckI
|
||||||
|
]
|
||||||
|
& itUse . useAim . aimWeight .~ 6
|
||||||
|
& itUse . useAim . aimRange .~ 1
|
||||||
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
& itType . iyBase .~ TRACTORGUN
|
& itType . iyBase .~ TRACTORGUN
|
||||||
|
|
||||||
tractorGunTweak :: TweakParam
|
tractorGunTweak :: TweakParam
|
||||||
|
|||||||
@@ -43,17 +43,6 @@ defaultBangCane = defaultBulletWeapon
|
|||||||
, _torqueAfter = 0.1
|
, _torqueAfter = 0.1
|
||||||
, _randomOffset = 0
|
, _randomOffset = 0
|
||||||
}
|
}
|
||||||
, _itUse = ruseAmmoParamsRate 6
|
|
||||||
[ ammoHammerCheck
|
|
||||||
, useTimeCheck
|
|
||||||
, withSoundStart tap3S
|
|
||||||
, useAmmoAmount 1
|
|
||||||
, withTorqueAfter
|
|
||||||
, applyInaccuracy
|
|
||||||
, withRecoil
|
|
||||||
, withSmoke 1 black 20 200 5
|
|
||||||
, withMuzFlareI
|
|
||||||
]
|
|
||||||
, _itDimension = ItemDimension
|
, _itDimension = ItemDimension
|
||||||
{ _dimRad = 8
|
{ _dimRad = 8
|
||||||
, _dimCenter = V3 5 0 0
|
, _dimCenter = V3 5 0 0
|
||||||
@@ -64,13 +53,27 @@ defaultBangCane = defaultBulletWeapon
|
|||||||
, _dimSPic = \it -> noPic $ baseCaneShape
|
, _dimSPic = \it -> noPic $ baseCaneShape
|
||||||
<> makeSingleClipAt (V3 5 0 3) it
|
<> makeSingleClipAt (V3 5 0 3) it
|
||||||
}
|
}
|
||||||
} & itUse . useAim . aimStance .~ OneHand
|
}
|
||||||
|
& itUse . useDelay . rateMax .~ 6
|
||||||
|
& itUse . useMods .~
|
||||||
|
[ ammoHammerCheck
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundStart tap3S
|
||||||
|
, useAmmoAmount 1
|
||||||
|
, withTorqueAfter
|
||||||
|
, applyInaccuracy
|
||||||
|
, withRecoil
|
||||||
|
, withSmoke 1 black 20 200 5
|
||||||
|
, withMuzFlareI
|
||||||
|
]
|
||||||
|
& itUse . useAim . aimStance .~ OneHand
|
||||||
& itType . iyBase .~ error "undefined bangCane baseitemtype"
|
& itType . iyBase .~ error "undefined bangCane baseitemtype"
|
||||||
& itConsumption . laMax .~ 1
|
& itConsumption . laMax .~ 1
|
||||||
& itConsumption . laCycle .~ [loadPartialInsert 10 1]
|
& itConsumption . laCycle .~ [loadPartialInsert 10 1]
|
||||||
volleyGun :: Int -> Item
|
volleyGun :: Int -> Item
|
||||||
volleyGun i = defaultBulletWeapon
|
volleyGun i = defaultBulletWeapon
|
||||||
& itUse .~ ruseAmmoParamsRate 6
|
& itUse . useDelay . rateMax .~ 6
|
||||||
|
& itUse . useMods .~
|
||||||
[ ammoHammerCheck
|
[ ammoHammerCheck
|
||||||
, useTimeCheck
|
, useTimeCheck
|
||||||
, withSoundItemChoiceStart caneStickSoundChoice
|
, withSoundItemChoiceStart caneStickSoundChoice
|
||||||
@@ -224,7 +227,10 @@ burstRifle = repeater
|
|||||||
-- , withRecoil
|
-- , withRecoil
|
||||||
-- ]
|
-- ]
|
||||||
miniGunUse :: Int -> ItemUse
|
miniGunUse :: Int -> ItemUse
|
||||||
miniGunUse i = ruseInstant (useAmmoParams $ Just 1) $
|
miniGunUse i = ruseAmmoParams
|
||||||
|
& rUse .~ useAmmoParams (Just 1)
|
||||||
|
& useDelay .~ NoDelay
|
||||||
|
& useMods .~
|
||||||
[ ammoCheckI
|
[ ammoCheckI
|
||||||
, withWarmUp crankSlowS
|
, withWarmUp crankSlowS
|
||||||
, withSoundForI mini1S 2
|
, withSoundForI mini1S 2
|
||||||
|
|||||||
@@ -20,9 +20,6 @@ import Dodge.Item.Weapon.ZoomScope
|
|||||||
--import Dodge.Particle.HitEffect.ExpireAndDamage
|
--import Dodge.Particle.HitEffect.ExpireAndDamage
|
||||||
--import Dodge.Particle.Damage
|
--import Dodge.Particle.Damage
|
||||||
import Dodge.Item.Weapon.ExtraEffect
|
import Dodge.Item.Weapon.ExtraEffect
|
||||||
--import Dodge.Item.Weapon.InventoryDisplay
|
|
||||||
import Dodge.Item.Weapon.AmmoParams
|
|
||||||
--import Dodge.Item.Draw
|
|
||||||
import Dodge.Item.Weapon.TriggerType
|
import Dodge.Item.Weapon.TriggerType
|
||||||
import Dodge.SoundLogic.LoadSound
|
import Dodge.SoundLogic.LoadSound
|
||||||
import Picture
|
import Picture
|
||||||
@@ -39,7 +36,7 @@ import LensHelp
|
|||||||
|
|
||||||
bangRod :: Item
|
bangRod :: Item
|
||||||
bangRod = defaultBulletWeapon
|
bangRod = defaultBulletWeapon
|
||||||
{ _itParams = BulletShooter
|
& itParams .~ BulletShooter
|
||||||
{ _muzVel = 0.8
|
{ _muzVel = 0.8
|
||||||
, _rifling = 1
|
, _rifling = 1
|
||||||
, _bore = 2
|
, _bore = 2
|
||||||
@@ -48,7 +45,8 @@ bangRod = defaultBulletWeapon
|
|||||||
, _torqueAfter = 0.3
|
, _torqueAfter = 0.3
|
||||||
, _randomOffset = 0
|
, _randomOffset = 0
|
||||||
}
|
}
|
||||||
, _itUse = ruseAmmoParamsRate 12
|
& itUse . useDelay . rateMax .~ 12
|
||||||
|
& itUse . useMods .~
|
||||||
[ ammoHammerCheck
|
[ ammoHammerCheck
|
||||||
, useTimeCheck
|
, useTimeCheck
|
||||||
, withSoundStart bangEchoS
|
, withSoundStart bangEchoS
|
||||||
@@ -59,7 +57,7 @@ bangRod = defaultBulletWeapon
|
|||||||
, withMuzFlareI
|
, withMuzFlareI
|
||||||
, withRecoil
|
, withRecoil
|
||||||
]
|
]
|
||||||
, _itDimension = ItemDimension
|
& itDimension .~ ItemDimension
|
||||||
{ _dimRad = 12
|
{ _dimRad = 12
|
||||||
, _dimCenter = V3 5 0 0
|
, _dimCenter = V3 5 0 0
|
||||||
, _dimPortage = HeldItem
|
, _dimPortage = HeldItem
|
||||||
@@ -69,7 +67,6 @@ bangRod = defaultBulletWeapon
|
|||||||
, _dimSPic = \it -> noPic $ baseRodShape
|
, _dimSPic = \it -> noPic $ baseRodShape
|
||||||
<> makeSingleClipAt (V3 5 0 3) it
|
<> makeSingleClipAt (V3 5 0 3) it
|
||||||
}
|
}
|
||||||
}
|
|
||||||
& itConsumption . laMax .~ 1
|
& itConsumption . laMax .~ 1
|
||||||
& itConsumption . laCycle .~ [loadEject 5, loadInsert 10 , loadPrime 5]
|
& itConsumption . laCycle .~ [loadEject 5, loadInsert 10 , loadPrime 5]
|
||||||
& itType . iyBase .~ BANGROD
|
& itType . iyBase .~ BANGROD
|
||||||
@@ -128,19 +125,19 @@ sniperRifle = elephantGun
|
|||||||
machineGun :: Item
|
machineGun :: Item
|
||||||
machineGun = bangRod
|
machineGun = bangRod
|
||||||
& itType . iyBase .~ MACHINEGUN
|
& itType . iyBase .~ MACHINEGUN
|
||||||
& itUse .~ (ruseAmmoParamsRate 25
|
& itUse . useDelay . rateMax .~ 25
|
||||||
|
& itUse . useMods .~
|
||||||
[ ammoCheckI
|
[ ammoCheckI
|
||||||
, rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter
|
, rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter
|
||||||
, withSoundStart bangEchoS
|
, withSoundStart bangEchoS
|
||||||
, withThinSmokeI
|
, withThinSmokeI
|
||||||
, withMuzFlareI
|
, withMuzFlareI
|
||||||
]
|
]
|
||||||
& useAim . aimWeight .~ 8
|
& itUse . useAim . aimWeight .~ 8
|
||||||
& useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
||||||
& useDelay .~ VariableRate {_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0}
|
& itUse . useDelay .~ VariableRate {_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0}
|
||||||
)
|
|
||||||
& itConsumption . laMax .~ 100
|
& itConsumption . laMax .~ 100
|
||||||
& itConsumption . laCycle .~ [loadEject 10, loadInsert 40 , loadPrime 10]
|
& itConsumption . laCycle .~ [loadEject 10, loadInsert 40 , loadPrime 10]
|
||||||
& itInvSize .~ 3
|
& itInvSize .~ 3
|
||||||
|
|||||||
@@ -41,7 +41,9 @@ bangStickSoundChoice it
|
|||||||
|
|
||||||
bangStick :: Int -> Item
|
bangStick :: Int -> Item
|
||||||
bangStick i = defaultBulletWeapon
|
bangStick i = defaultBulletWeapon
|
||||||
{ _itUse = ruseAmmoParamsRate 8
|
{ _itUse = ruseAmmoParams
|
||||||
|
& useDelay . rateMax .~ 8
|
||||||
|
& useMods .~
|
||||||
[ ammoHammerCheck
|
[ ammoHammerCheck
|
||||||
, useTimeCheck
|
, useTimeCheck
|
||||||
, withSoundItemChoiceStart bangStickSoundChoice
|
, withSoundItemChoiceStart bangStickSoundChoice
|
||||||
@@ -159,7 +161,8 @@ pistol = bangStick 1
|
|||||||
& itConsumption .~ ( defaultBulletLoadable
|
& itConsumption .~ ( defaultBulletLoadable
|
||||||
& laMax .~ 15
|
& laMax .~ 15
|
||||||
& laCycle .~ [loadEject 5, loadInsert 5 , loadPrime 5] )
|
& laCycle .~ [loadEject 5, loadInsert 5 , loadPrime 5] )
|
||||||
& itUse .~ ruseAmmoParamsRate 6 (ammoHammerCheck : pistolAfterHamMods)
|
& itUse . useDelay . rateMax .~ 6
|
||||||
|
& itUse . useMods .~ (ammoHammerCheck : pistolAfterHamMods)
|
||||||
& itDimension . dimSPic .~ (\it -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it)
|
& itDimension . dimSPic .~ (\it -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it)
|
||||||
& itParams %~
|
& itParams %~
|
||||||
( ( muzVel .~ 0.8 )
|
( ( muzVel .~ 0.8 )
|
||||||
@@ -193,7 +196,8 @@ smg = autoPistol -- & some parameter affecting stability
|
|||||||
<> makeTinClipAt 0 (V3 7 (-2) 0) it)
|
<> makeTinClipAt 0 (V3 7 (-2) 0) it)
|
||||||
revolverX :: Int -> Item
|
revolverX :: Int -> Item
|
||||||
revolverX i = revolver
|
revolverX i = revolver
|
||||||
{ _itUse = ruseAmmoParamsRate 8
|
& itUse . useDelay . rateMax .~ 8
|
||||||
|
& itUse . useMods .~
|
||||||
[ ammoHammerCheck
|
[ ammoHammerCheck
|
||||||
, useTimeCheck
|
, useTimeCheck
|
||||||
-- rather than locking the inventory, a better solution may be to check
|
-- rather than locking the inventory, a better solution may be to check
|
||||||
@@ -208,5 +212,5 @@ revolverX i = revolver
|
|||||||
, withTorqueAfter
|
, withTorqueAfter
|
||||||
, withRecoil
|
, withRecoil
|
||||||
]
|
]
|
||||||
} & itConsumption . laMax .~ i * 6
|
& itConsumption . laMax .~ i * 6
|
||||||
& itType . iyBase .~ REVOLVERX i
|
& itType . iyBase .~ REVOLVERX i
|
||||||
|
|||||||
@@ -20,8 +20,6 @@ import Dodge.Data
|
|||||||
import Dodge.Default.Weapon
|
import Dodge.Default.Weapon
|
||||||
import Dodge.Default
|
import Dodge.Default
|
||||||
import Dodge.Item.Attachment
|
import Dodge.Item.Attachment
|
||||||
--import Dodge.Item.Weapon.InventoryDisplay
|
|
||||||
import Dodge.Item.Weapon.AmmoParams
|
|
||||||
import Dodge.Item.Draw
|
import Dodge.Item.Draw
|
||||||
import Dodge.Item.Weapon.TriggerType
|
import Dodge.Item.Weapon.TriggerType
|
||||||
import Dodge.SoundLogic.LoadSound
|
import Dodge.SoundLogic.LoadSound
|
||||||
@@ -44,7 +42,22 @@ autoGun = defaultAutoGun
|
|||||||
, _laLoaded = 30
|
, _laLoaded = 30
|
||||||
}
|
}
|
||||||
& laCycle .~ [loadEject 30, loadInsert 30 , loadPrime 10]
|
& laCycle .~ [loadEject 30, loadInsert 30 , loadPrime 10]
|
||||||
, _itUse = ruseAmmoParamsRate 4
|
-- , _itFloorPict = autoGunPic
|
||||||
|
-- , _itZoom = defaultItZoom
|
||||||
|
, _itEquipPict = pictureWeaponOnAim
|
||||||
|
, _itAttachment = AttachCharMode $ Seq.fromList "MS"
|
||||||
|
, _itParams = BulletShooter
|
||||||
|
{ _muzVel = 1
|
||||||
|
, _rifling = 0.9
|
||||||
|
, _bore = 2
|
||||||
|
, _gunBarrels = SingleBarrel 0.1
|
||||||
|
, _recoil = 0
|
||||||
|
, _torqueAfter = 0
|
||||||
|
, _randomOffset = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
& itUse . useDelay . rateMax .~ 4
|
||||||
|
& itUse . useMods .~
|
||||||
[ ammoCheckI
|
[ ammoCheckI
|
||||||
, charFiringStratI
|
, charFiringStratI
|
||||||
[('S', hammerCheckI)
|
[('S', hammerCheckI)
|
||||||
@@ -61,24 +74,10 @@ autoGun = defaultAutoGun
|
|||||||
, withMuzFlareI
|
, withMuzFlareI
|
||||||
, withSmoke 1 black 20 200 5
|
, withSmoke 1 black 20 200 5
|
||||||
]
|
]
|
||||||
& useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
||||||
-- , _itFloorPict = autoGunPic
|
|
||||||
-- , _itZoom = defaultItZoom
|
|
||||||
, _itEquipPict = pictureWeaponOnAim
|
|
||||||
, _itAttachment = AttachCharMode $ Seq.fromList "MS"
|
|
||||||
, _itParams = BulletShooter
|
|
||||||
{ _muzVel = 1
|
|
||||||
, _rifling = 0.9
|
|
||||||
, _bore = 2
|
|
||||||
, _gunBarrels = SingleBarrel 0.1
|
|
||||||
, _recoil = 0
|
|
||||||
, _torqueAfter = 0
|
|
||||||
, _randomOffset = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
& itUse . heldScroll .~ scrollCharMode
|
& itUse . heldScroll .~ scrollCharMode
|
||||||
& itType . iyBase .~ AUTOGUN
|
& itType . iyBase .~ AUTOGUN
|
||||||
autoGunPic :: Item -> SPic
|
autoGunPic :: Item -> SPic
|
||||||
@@ -93,22 +92,7 @@ autoGunPic it = noPic $
|
|||||||
|
|
||||||
bangCone :: Item
|
bangCone :: Item
|
||||||
bangCone = defaultBulletWeapon
|
bangCone = defaultBulletWeapon
|
||||||
{ _itUse = ruseAmmoParamsRate 20
|
{ _itParams = BulletShooter
|
||||||
[ ammoCheckI
|
|
||||||
, hammerCheckI
|
|
||||||
, useTimeCheck
|
|
||||||
, withSoundStart bangEchoS
|
|
||||||
, useAllAmmo
|
|
||||||
, withTorqueAfter
|
|
||||||
, withRecoil
|
|
||||||
, duplicateLoaded
|
|
||||||
, withMuzFlareI
|
|
||||||
, applyInaccuracy
|
|
||||||
, withRandomOffset
|
|
||||||
, withRandomItemUpdate coneRandItemUpdate
|
|
||||||
, withRandomItemParams coneRandItemParams
|
|
||||||
]
|
|
||||||
, _itParams = BulletShooter
|
|
||||||
{ _muzVel = 0.7
|
{ _muzVel = 0.7
|
||||||
, _rifling = 0.8
|
, _rifling = 0.8
|
||||||
, _bore = 5
|
, _bore = 5
|
||||||
@@ -128,6 +112,22 @@ bangCone = defaultBulletWeapon
|
|||||||
<> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 5 15)
|
<> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 5 15)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
& itUse . useDelay . rateMax .~ 20
|
||||||
|
& itUse . useMods .~
|
||||||
|
[ ammoCheckI
|
||||||
|
, hammerCheckI
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundStart bangEchoS
|
||||||
|
, useAllAmmo
|
||||||
|
, withTorqueAfter
|
||||||
|
, withRecoil
|
||||||
|
, duplicateLoaded
|
||||||
|
, withMuzFlareI
|
||||||
|
, applyInaccuracy
|
||||||
|
, withRandomOffset
|
||||||
|
, withRandomItemUpdate coneRandItemUpdate
|
||||||
|
, withRandomItemParams coneRandItemParams
|
||||||
|
]
|
||||||
& itType . iyBase .~ BANGCONE
|
& itType . iyBase .~ BANGCONE
|
||||||
& itConsumption . laMax .~ 5
|
& itConsumption . laMax .~ 5
|
||||||
& itConsumption . laCycle .~ [loadEject 5, loadInsert 20 , loadPrime 5]
|
& itConsumption . laCycle .~ [loadEject 5, loadInsert 20 , loadPrime 5]
|
||||||
|
|||||||
@@ -20,17 +20,17 @@ import Control.Lens
|
|||||||
|
|
||||||
droneLauncher :: Item
|
droneLauncher :: Item
|
||||||
droneLauncher = defaultWeapon
|
droneLauncher = defaultWeapon
|
||||||
{ _itUse = ruseRate 20 aDroneWithItemParams
|
& itUse . useDelay . rateMax .~ 20
|
||||||
|
& itUse . rUse .~ aDroneWithItemParams
|
||||||
|
& itUse . useMods .~
|
||||||
[ ammoCheckI
|
[ ammoCheckI
|
||||||
, useTimeCheck
|
, useTimeCheck
|
||||||
, withSoundStart tap4S
|
, withSoundStart tap4S
|
||||||
, useAmmoAmount 1
|
, useAmmoAmount 1
|
||||||
]
|
]
|
||||||
& useAim . aimWeight .~ 8
|
& itUse . useAim . aimWeight .~ 8
|
||||||
& useAim . aimRange .~ 0.5
|
& itUse . useAim . aimRange .~ 0.5
|
||||||
& useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
, _itEffect = NoItEffect
|
|
||||||
}
|
|
||||||
& itConsumption . laAmmoType .~ DroneAmmo { _amString = "LASDRONE" }
|
& itConsumption . laAmmoType .~ DroneAmmo { _amString = "LASDRONE" }
|
||||||
& itConsumption . laMax .~ 2
|
& itConsumption . laMax .~ 2
|
||||||
& itType . iyBase .~ DRONELAUNCHER
|
& itType . iyBase .~ DRONELAUNCHER
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ throwArmReset x = ItInvEffect {_ieInv = f ,_ieCounter = x }
|
|||||||
i = _ipInvID $ _itPos itm
|
i = _ipInvID $ _itPos itm
|
||||||
counterDown it
|
counterDown it
|
||||||
| _ieCounter (_itEffect it) == 0 = it
|
| _ieCounter (_itEffect it) == 0 = it
|
||||||
& itUse . useHammer' .~ HammerUp
|
& itUse . useHammer .~ HammerUp
|
||||||
& itEquipPict .~ pictureWeaponAim (\_ -> grenadePic 50)
|
& itEquipPict .~ pictureWeaponAim (\_ -> grenadePic 50)
|
||||||
| otherwise = it & itEffect . ieCounter -~ 1
|
| otherwise = it & itEffect . ieCounter -~ 1
|
||||||
|
|
||||||
|
|||||||
@@ -47,16 +47,6 @@ launcher = defaultWeapon
|
|||||||
& laMax .~ 1
|
& laMax .~ 1
|
||||||
& laLoaded .~ 1
|
& laLoaded .~ 1
|
||||||
& laCycle .~ [loadEject 30, loadInsert 30, loadPrime 10]
|
& laCycle .~ [loadEject 30, loadInsert 30, loadPrime 10]
|
||||||
, _itUse = ruseRate 20 usePjCreation
|
|
||||||
[ hammerCheckI
|
|
||||||
, ammoCheckI
|
|
||||||
, useTimeCheck
|
|
||||||
, withSoundStart tap4S
|
|
||||||
, useAmmoAmount 1
|
|
||||||
]
|
|
||||||
& useAim . aimWeight .~ 8
|
|
||||||
& useAim . aimRange .~ 0.5
|
|
||||||
& useAim . aimStance .~ TwoHandTwist
|
|
||||||
, _itParams = ShellLauncher
|
, _itParams = ShellLauncher
|
||||||
{ _shellSpinDrag = 1
|
{ _shellSpinDrag = 1
|
||||||
, _shellSpinAmount = 2
|
, _shellSpinAmount = 2
|
||||||
@@ -77,6 +67,18 @@ launcher = defaultWeapon
|
|||||||
, _dimSPic = launcherPic
|
, _dimSPic = launcherPic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
& itUse . useDelay . rateMax .~ 20
|
||||||
|
& itUse . rUse .~ usePjCreation
|
||||||
|
& itUse . useMods .~
|
||||||
|
[ hammerCheckI
|
||||||
|
, ammoCheckI
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundStart tap4S
|
||||||
|
, useAmmoAmount 1
|
||||||
|
]
|
||||||
|
& itUse . useAim . aimWeight .~ 8
|
||||||
|
& itUse . useAim . aimRange .~ 0.5
|
||||||
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
& itType . iyBase .~ LAUNCHER
|
& itType . iyBase .~ LAUNCHER
|
||||||
& itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
|
& itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
|
||||||
|
|
||||||
|
|||||||
@@ -23,14 +23,14 @@ import Control.Lens
|
|||||||
Sends out pulses that display walls. -}
|
Sends out pulses that display walls. -}
|
||||||
clickDetector :: Detector -> Item
|
clickDetector :: Detector -> Item
|
||||||
clickDetector dt = defaultWeapon
|
clickDetector dt = defaultWeapon
|
||||||
{ _itUse = ruseRate 20 (detectorEffect dt)
|
& itUse . useDelay . rateMax .~ 20
|
||||||
|
& itUse . rUse .~ detectorEffect dt
|
||||||
|
& itUse . useMods .~
|
||||||
[ ammoUseCheck
|
[ ammoUseCheck
|
||||||
]
|
]
|
||||||
& useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
|
||||||
-- , _itZoom = defaultItZoom { _itZoomMax = 1}
|
& itEquipPict .~ pictureWeaponAim (\_ -> (,) emptySH $ color blue $ polygon $ rectNESW 5 5 (-5) (-5))
|
||||||
, _itEquipPict = pictureWeaponAim $ \_ -> (,) emptySH $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
|
|
||||||
}
|
|
||||||
& itType . iyBase .~ CLICKDETECTOR dt
|
& itType . iyBase .~ CLICKDETECTOR dt
|
||||||
|
|
||||||
autoDetector :: Detector -> Item
|
autoDetector :: Detector -> Item
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ import LensHelp
|
|||||||
shatterGun :: Item
|
shatterGun :: Item
|
||||||
shatterGun = defaultWeapon
|
shatterGun = defaultWeapon
|
||||||
& itType . iyBase .~ SHATTERGUN
|
& itType . iyBase .~ SHATTERGUN
|
||||||
& itUse .~ ruseRate 10 shootShatter
|
& itUse . useDelay . rateMax .~ 10
|
||||||
|
& itUse . rUse .~ shootShatter
|
||||||
|
& itUse . useMods .~
|
||||||
[ ammoHammerCheck
|
[ ammoHammerCheck
|
||||||
, useTimeCheck
|
, useTimeCheck
|
||||||
-- , withSoundStart tap3S
|
-- , withSoundStart tap3S
|
||||||
|
|||||||
@@ -34,14 +34,6 @@ sonicGun = defaultAutoGun
|
|||||||
{ _itConsumption = defaultLoadable
|
{ _itConsumption = defaultLoadable
|
||||||
& laMax .~ 10
|
& laMax .~ 10
|
||||||
& laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60]
|
& laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60]
|
||||||
, _itUse = ruseRate 8 aSonicWave
|
|
||||||
[ ammoHammerCheck
|
|
||||||
, useTimeCheck
|
|
||||||
, useAmmoAmount 1
|
|
||||||
]
|
|
||||||
& useAim . aimWeight .~ 6
|
|
||||||
& useAim . aimRange .~ 1
|
|
||||||
& useAim . aimStance .~ TwoHandTwist
|
|
||||||
, _itParams = NoParams
|
, _itParams = NoParams
|
||||||
, _itTweaks = NoTweaks
|
, _itTweaks = NoTweaks
|
||||||
, _itDimension = ItemDimension
|
, _itDimension = ItemDimension
|
||||||
@@ -51,6 +43,16 @@ sonicGun = defaultAutoGun
|
|||||||
, _dimSPic = const $ noPic baseSonicShape
|
, _dimSPic = const $ noPic baseSonicShape
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
& itUse . useDelay . rateMax .~ 8
|
||||||
|
& itUse . rUse .~ aSonicWave
|
||||||
|
& itUse . useMods .~
|
||||||
|
[ ammoHammerCheck
|
||||||
|
, useTimeCheck
|
||||||
|
, useAmmoAmount 1
|
||||||
|
]
|
||||||
|
& itUse . useAim . aimWeight .~ 6
|
||||||
|
& itUse . useAim . aimRange .~ 1
|
||||||
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
& itType . iyBase .~ SONICGUN
|
& itType . iyBase .~ SONICGUN
|
||||||
baseSonicShape :: Shape
|
baseSonicShape :: Shape
|
||||||
baseSonicShape = colorSH rose $ upperPrismPoly 3 $ rectXH 25 2
|
baseSonicShape = colorSH rose $ upperPrismPoly 3 $ rectXH 25 2
|
||||||
|
|||||||
@@ -16,13 +16,12 @@ import Control.Lens
|
|||||||
Creates a creature next to the creature using the item. -}
|
Creates a creature next to the creature using the item. -}
|
||||||
spawnGun :: Creature -> Item
|
spawnGun :: Creature -> Item
|
||||||
spawnGun cr = defaultWeapon
|
spawnGun cr = defaultWeapon
|
||||||
{ _itConsumption = defaultLoadable
|
& itUse . useDelay . rateMax .~ 100
|
||||||
, _itUse = ruseRate 100
|
& itUse . rUse .~ (\_ -> spawnCrNextTo cr)
|
||||||
(\_ -> spawnCrNextTo cr)
|
& itUse . useMods .~
|
||||||
[ ammoCheckI
|
[ ammoCheckI
|
||||||
, hammerCheckI
|
, hammerCheckI
|
||||||
]
|
]
|
||||||
}
|
|
||||||
& itType . iyBase .~ SPAWNER
|
& itType . iyBase .~ SPAWNER
|
||||||
spawnCrNextTo
|
spawnCrNextTo
|
||||||
:: Creature -- ^ Creature to spawn
|
:: Creature -- ^ Creature to spawn
|
||||||
|
|||||||
@@ -124,18 +124,6 @@ flameThrower = defaultAutoGun
|
|||||||
,_amCreateGas = aFlame
|
,_amCreateGas = aFlame
|
||||||
}
|
}
|
||||||
& laCycle .~ [loadEject 5, loadInsert 10 , loadPrime 20]
|
& laCycle .~ [loadEject 5, loadInsert 10 , loadPrime 20]
|
||||||
, _itUse = ruseInstant (overNozzles useGasParams)
|
|
||||||
[ ammoCheckI
|
|
||||||
, useAmmoAmount 1
|
|
||||||
, withSidePushI 5
|
|
||||||
--, withTempLight 1 100 (V3 1 0 0)
|
|
||||||
, withSidePushAfterI 20
|
|
||||||
]
|
|
||||||
& useAim . aimWeight .~ 5
|
|
||||||
& useAim . aimZoom .~ defaultItZoom {_itZoomMax = 5, _itZoomMin = 1.5}
|
|
||||||
& useAim . aimStance .~ TwoHandTwist
|
|
||||||
-- , _itFloorPict = flamerPic
|
|
||||||
-- , _itZoom = defaultItZoom
|
|
||||||
, _itParams = Sprayer
|
, _itParams = Sprayer
|
||||||
{ _sprayNozzles =
|
{ _sprayNozzles =
|
||||||
[ Nozzle
|
[ Nozzle
|
||||||
@@ -159,6 +147,18 @@ flameThrower = defaultAutoGun
|
|||||||
}
|
}
|
||||||
-- , _itFloorPict = flamerPic
|
-- , _itFloorPict = flamerPic
|
||||||
}
|
}
|
||||||
|
& itUse . rUse .~ overNozzles useGasParams
|
||||||
|
& itUse . useDelay .~ NoDelay
|
||||||
|
& itUse . useMods .~
|
||||||
|
[ ammoCheckI
|
||||||
|
, useAmmoAmount 1
|
||||||
|
, withSidePushI 5
|
||||||
|
--, withTempLight 1 100 (V3 1 0 0)
|
||||||
|
, withSidePushAfterI 20
|
||||||
|
]
|
||||||
|
& itUse . useAim . aimWeight .~ 5
|
||||||
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomMax = 5, _itZoomMin = 1.5}
|
||||||
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
& itType . iyBase .~ FLAMETHROWER
|
& itType . iyBase .~ FLAMETHROWER
|
||||||
|
|
||||||
aGasCloud :: Float -> Point2 -> Float -> Creature -> World -> World
|
aGasCloud :: Float -> Point2 -> Float -> Creature -> World -> World
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ module Dodge.Item.Weapon.TriggerType
|
|||||||
, duplicateLoadedBarrels
|
, duplicateLoadedBarrels
|
||||||
, duplicateLoaded
|
, duplicateLoaded
|
||||||
, duplicateOffsets
|
, duplicateOffsets
|
||||||
|
, duplicateOffsetsV2
|
||||||
, duplicateOffsetsFocus
|
, duplicateOffsetsFocus
|
||||||
, hammerCheckI
|
, hammerCheckI
|
||||||
, hammerCheckL
|
, hammerCheckL
|
||||||
@@ -136,15 +137,11 @@ ammoCheckI eff itm cr w
|
|||||||
ammoHammerCheck :: ChainEffect
|
ammoHammerCheck :: ChainEffect
|
||||||
ammoHammerCheck eff it cr w
|
ammoHammerCheck eff it cr w
|
||||||
| _laLoaded ic <= 0 || not (_laPrimed ic) = w -- fromMaybe w (startReloadingWeapon cr w)
|
| _laLoaded ic <= 0 || not (_laPrimed ic) = w -- fromMaybe w (startReloadingWeapon cr w)
|
||||||
& setHammerDown
|
| otherwise = case it ^? itUse . useHammer of
|
||||||
| otherwise = case it ^? itUse . useHammer' of
|
Just HammerUp -> eff it cr $ w & creatures . ix (_crID cr) %~ crCancelReloading
|
||||||
Just HammerUp -> eff it cr $ setHammerDown w & creatures . ix (_crID cr) %~ crCancelReloading
|
_ -> w
|
||||||
_ -> setHammerDown w
|
|
||||||
where
|
where
|
||||||
ic = _itConsumption it
|
ic = _itConsumption it
|
||||||
cid = _crID cr
|
|
||||||
setHammerDown = creatures . ix cid . crInv . ix (crSel cr) . itUse
|
|
||||||
. useHammer' .~ HammerDown
|
|
||||||
|
|
||||||
itUseCharge :: Int -> Item -> Item
|
itUseCharge :: Int -> Item -> Item
|
||||||
itUseCharge x = itConsumption . arLoaded %~ (max 0 . subtract x)
|
itUseCharge x = itConsumption . arLoaded %~ (max 0 . subtract x)
|
||||||
@@ -307,13 +304,11 @@ useTimeCheck f item cr w = case item ^? itUse . useDelay . rateTime of
|
|||||||
userate = fromMaybe 0 $ item ^? itUse . useDelay . rateMax
|
userate = fromMaybe 0 $ item ^? itUse . useDelay . rateMax
|
||||||
{- | Applies a world effect after a hammer position check. -}
|
{- | Applies a world effect after a hammer position check. -}
|
||||||
hammerCheckI :: ChainEffect
|
hammerCheckI :: ChainEffect
|
||||||
hammerCheckI f it cr w = case it ^? itUse . useHammer' of
|
hammerCheckI f it cr w = case it ^? itUse . useHammer of
|
||||||
Just HammerUp | _laPrimed (_itConsumption it) -> f it cr $ setHammerDown w
|
Just HammerUp | _laPrimed (_itConsumption it)
|
||||||
_ -> setHammerDown w
|
-> f it cr w
|
||||||
where
|
_ -> w
|
||||||
cid = _crID cr
|
|
||||||
setHammerDown = creatures . ix cid . crInv . ix (crSel cr) . itUse
|
|
||||||
. useHammer' .~ HammerDown
|
|
||||||
{- | Applies a world effect after an ammo check. -}
|
{- | Applies a world effect after an ammo check. -}
|
||||||
-- this should be made "safe" incase there is no _rateTime
|
-- this should be made "safe" incase there is no _rateTime
|
||||||
ammoUseCheck :: ChainEffect
|
ammoUseCheck :: ChainEffect
|
||||||
@@ -336,14 +331,10 @@ Arbitrary inventory position. -}
|
|||||||
hammerCheckL
|
hammerCheckL
|
||||||
:: (Item -> Creature -> World -> World) -- ^ Underlying effect
|
:: (Item -> Creature -> World -> World) -- ^ Underlying effect
|
||||||
-> Item -> Creature -> World -> World
|
-> Item -> Creature -> World -> World
|
||||||
hammerCheckL f itm cr w = case itm ^? itUse . useHammer' of
|
hammerCheckL f itm cr w = case itm ^? itUse . useHammer of
|
||||||
Just HammerUp -> f itm cr $ setHammerDown w
|
Just HammerUp -> f itm cr w
|
||||||
_ -> setHammerDown w
|
_ -> w
|
||||||
where
|
|
||||||
cid = _crID cr
|
|
||||||
invid = _ipInvID $ _itPos itm
|
|
||||||
setHammerDown = creatures . ix cid . crInv . ix invid
|
|
||||||
. itUse . useHammer' .~ HammerDown
|
|
||||||
{- | Applies a world effect after an ammo check.
|
{- | Applies a world effect after an ammo check.
|
||||||
Arbitrary inventory position -- cannot be replaced with ammoUseCheck. -}
|
Arbitrary inventory position -- cannot be replaced with ammoUseCheck. -}
|
||||||
shootL
|
shootL
|
||||||
@@ -369,8 +360,9 @@ shootL f item cr w
|
|||||||
withItem :: (Item -> ChainEffect) -> ChainEffect
|
withItem :: (Item -> ChainEffect) -> ChainEffect
|
||||||
withItem g f it = g it f it
|
withItem g f it = g it f it
|
||||||
|
|
||||||
|
-- not ideal
|
||||||
withItemUpdate' :: (Item -> Item) -> ChainEffect
|
withItemUpdate' :: (Item -> Item) -> ChainEffect
|
||||||
withItemUpdate' up f it cr = f it cr . (creatures . ix (_crID cr) . crInv . ix (crSel cr) %~ up)
|
withItemUpdate' up f it cr = f (up it) cr . (creatures . ix (_crID cr) . crInv . ix (crSel cr) %~ up)
|
||||||
|
|
||||||
withItemUpdate :: (Item -> Item) -> (Item -> ChainEffect) -> ChainEffect
|
withItemUpdate :: (Item -> Item) -> (Item -> ChainEffect) -> ChainEffect
|
||||||
withItemUpdate up g f it cr = g it f it cr . (creatures . ix (_crID cr) . crInv . ix (crSel cr) %~ up)
|
withItemUpdate up g f it cr = g it f it cr . (creatures . ix (_crID cr) . crInv . ix (crSel cr) %~ up)
|
||||||
@@ -595,6 +587,12 @@ duplicateOffsetsFocus xs eff item cr w = foldr f w poss
|
|||||||
-.- (_crPos cr +.+ pos))
|
-.- (_crPos cr +.+ pos))
|
||||||
| otherwise = argV (mouseWorldPos w -.- (_crPos cr +.+ pos))
|
| otherwise = argV (mouseWorldPos w -.- (_crPos cr +.+ pos))
|
||||||
|
|
||||||
|
duplicateOffsetsV2 :: [Point2] -> ChainEffect
|
||||||
|
duplicateOffsetsV2 xs eff item cr w = foldr f w poss
|
||||||
|
where
|
||||||
|
poss = map (rotateV (_crDir cr)) xs
|
||||||
|
f pos = eff item (cr & crPos +.+.~ pos)
|
||||||
|
|
||||||
duplicateOffsets :: [Float] -> ChainEffect
|
duplicateOffsets :: [Float] -> ChainEffect
|
||||||
duplicateOffsets xs eff item cr w = foldr f w poss
|
duplicateOffsets xs eff item cr w = foldr f w poss
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -117,12 +117,13 @@ autoEffectGun name eff = defaultWeapon
|
|||||||
forceFieldGun :: Item
|
forceFieldGun :: Item
|
||||||
forceFieldGun = defaultWeapon
|
forceFieldGun = defaultWeapon
|
||||||
{ _itConsumption = defaultLoadable & laAmmoType .~ ForceFieldAmmo forceField
|
{ _itConsumption = defaultLoadable & laAmmoType .~ ForceFieldAmmo forceField
|
||||||
, _itUse = ruseInstant useForceFieldGun
|
|
||||||
[ hammerCheckI , ammoCheckI , useAmmoAmount 1]
|
|
||||||
-- , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-4,-4),(-4,4),(4,4),(4,0),(0,0),(0,-4)]
|
|
||||||
, _itTargeting = targetRBPress & tgDraw .~ targetDistanceDraw
|
, _itTargeting = targetRBPress & tgDraw .~ targetDistanceDraw
|
||||||
, _itParams = ParamMID Nothing
|
, _itParams = ParamMID Nothing
|
||||||
}
|
}
|
||||||
|
& itUse . rUse .~ useForceFieldGun
|
||||||
|
& itUse . useDelay .~ NoDelay
|
||||||
|
& itUse . useMods .~
|
||||||
|
[ hammerCheckI , ammoCheckI , useAmmoAmount 1]
|
||||||
& itType . iyBase .~ FORCEFIELDGUN
|
& itType . iyBase .~ FORCEFIELDGUN
|
||||||
-- I believe because the targeting returns to nothing straight after you release
|
-- I believe because the targeting returns to nothing straight after you release
|
||||||
-- the rmb, it is possible for this to do nothing
|
-- the rmb, it is possible for this to do nothing
|
||||||
|
|||||||
Reference in New Issue
Block a user