Move muzzles out of records
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -18,6 +18,7 @@ data ItemParams
|
|||||||
{ _currentArc :: [ArcStep]}
|
{ _currentArc :: [ArcStep]}
|
||||||
| NozzleAngle {_nzAngle :: Float}
|
| NozzleAngle {_nzAngle :: Float}
|
||||||
| VolleyUnfiredBarrels {_unfiredBarrels :: [Int]}
|
| VolleyUnfiredBarrels {_unfiredBarrels :: [Int]}
|
||||||
|
| AlteRifleSwitch {_alteRifleSwitch :: Int}
|
||||||
|
|
||||||
data ShrinkGunStatus = FullSize | Shrunk
|
data ShrinkGunStatus = FullSize | Shrunk
|
||||||
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import Geometry.Data
|
|||||||
data ItemUse
|
data ItemUse
|
||||||
= UseHeld
|
= UseHeld
|
||||||
{ _heldDelay :: UseDelay
|
{ _heldDelay :: UseDelay
|
||||||
, _heldMuzzles :: [Muzzle]
|
-- , _heldMuzzles :: [Muzzle]
|
||||||
, _heldFrame :: Int
|
, _heldFrame :: Int
|
||||||
}
|
}
|
||||||
| UseEquip {_uequipEffect :: EquipEffect}
|
| UseEquip {_uequipEffect :: EquipEffect}
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
{-# LANGUAGE DeriveAnyClass #-}
|
|
||||||
{-# LANGUAGE DeriveGeneric #-}
|
|
||||||
{-# LANGUAGE StrictData #-}
|
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
|
||||||
|
|
||||||
module Dodge.Data.MuzzleEffect where
|
|
||||||
|
|
||||||
import Control.Lens
|
|
||||||
|
|
||||||
--import Data.Aeson
|
|
||||||
--import Data.Aeson.TH
|
|
||||||
--import Dodge.Data.Item.Use.Consumption.Ammo
|
|
||||||
|
|
||||||
data CumulativeMuzzleEffect = CME
|
|
||||||
{ _cmeSound :: Bool
|
|
||||||
}
|
|
||||||
deriving (Eq, Ord, Show, Read)
|
|
||||||
|
|
||||||
makeLenses ''CumulativeMuzzleEffect
|
|
||||||
@@ -11,7 +11,7 @@ import Control.Lens
|
|||||||
import qualified Data.IntMap.Strict as IM
|
import qualified Data.IntMap.Strict as IM
|
||||||
import Dodge.Data.Item
|
import Dodge.Data.Item
|
||||||
import Dodge.Default.Item.Use
|
import Dodge.Default.Item.Use
|
||||||
import Geometry.Data
|
--import Geometry.Data
|
||||||
|
|
||||||
defaultHeldItem :: Item
|
defaultHeldItem :: Item
|
||||||
defaultHeldItem =
|
defaultHeldItem =
|
||||||
@@ -42,8 +42,8 @@ defaultBulletWeapon :: Item
|
|||||||
defaultBulletWeapon =
|
defaultBulletWeapon =
|
||||||
defaultHeldItem
|
defaultHeldItem
|
||||||
& itAmmoSlots .~ singleAmmo BulletAmmo
|
& itAmmoSlots .~ singleAmmo BulletAmmo
|
||||||
& itUse . heldMuzzles .~
|
-- & itUse . heldMuzzles .~
|
||||||
[Muzzle (V2 15 0) 0 0.01 0 BasicFlare MuzzleShootBullet (UseExactly 1) 0]
|
-- [Muzzle (V2 15 0) 0 0.01 0 BasicFlare MuzzleShootBullet (UseExactly 1) 0]
|
||||||
|
|
||||||
defaultItEffect :: ItEffect
|
defaultItEffect :: ItEffect
|
||||||
defaultItEffect =
|
defaultItEffect =
|
||||||
|
|||||||
@@ -1,35 +1,20 @@
|
|||||||
module Dodge.Default.Item.Use (
|
module Dodge.Default.Item.Use (
|
||||||
module Dodge.Default.Item.Use,
|
module Dodge.Default.Item.Use,
|
||||||
module Dodge.Default.Item.Use.AimParams,
|
|
||||||
module Dodge.Default.Item.Use.Equipment,
|
module Dodge.Default.Item.Use.Equipment,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
--import Dodge.SoundLogic.ExternallyGeneratedSounds
|
|
||||||
import Dodge.Data.Item.Use
|
import Dodge.Data.Item.Use
|
||||||
import Dodge.Default.Item.Use.AimParams
|
|
||||||
import Dodge.Default.Item.Use.Equipment
|
import Dodge.Default.Item.Use.Equipment
|
||||||
|
|
||||||
--defaultLeftUse :: ItemUse
|
|
||||||
--defaultLeftUse = UseHotkey
|
|
||||||
-- { _leftUse = LDoNothing
|
|
||||||
-- , _leftDelay = FixedRate{_rateMax = 8, _rateTime = 0}
|
|
||||||
-- , _leftHammer = HammerUp
|
|
||||||
-- , _uequipEffect = defaultEquip
|
|
||||||
-- , _leftConsumption = defaultLeftLoadable
|
|
||||||
-- }
|
|
||||||
|
|
||||||
defaultEquipUse :: ItemUse
|
defaultEquipUse :: ItemUse
|
||||||
defaultEquipUse = UseEquip
|
defaultEquipUse =
|
||||||
{ _uequipEffect = defaultEquip
|
UseEquip
|
||||||
}
|
{ _uequipEffect = defaultEquip
|
||||||
|
}
|
||||||
|
|
||||||
defaultHeldUse :: ItemUse
|
defaultHeldUse :: ItemUse
|
||||||
defaultHeldUse = UseHeld
|
defaultHeldUse =
|
||||||
{ _heldDelay = FixedRate{_rateMax = 8, _rateTimeLastUsed = 0}
|
UseHeld
|
||||||
, _heldMuzzles = defaultMuzzles
|
{ _heldDelay = FixedRate{_rateMax = 8, _rateTimeLastUsed = 0}
|
||||||
-- , _heldParams = BulletShooterParams
|
, _heldFrame = 0
|
||||||
-- { _weaponInvLock = 0
|
}
|
||||||
-- }
|
|
||||||
, _heldFrame = 0
|
|
||||||
-- , _heldUseEffect = NoHeldUseEffect
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
module Dodge.Default.Item.Use.AimParams (
|
|
||||||
defaultMuzzles,
|
|
||||||
) where
|
|
||||||
|
|
||||||
import Dodge.Data.Item.Use
|
|
||||||
import Linear
|
|
||||||
|
|
||||||
defaultMuzzles :: [Muzzle]
|
|
||||||
defaultMuzzles =
|
|
||||||
[ Muzzle
|
|
||||||
{ _mzPos = V2 20 0
|
|
||||||
, _mzRot = 0
|
|
||||||
, _mzInaccuracy = 0.05
|
|
||||||
, _mzAmmoSlot = 0
|
|
||||||
, _mzFlareType = NoFlare
|
|
||||||
, _mzEffect = MuzzleShootBullet
|
|
||||||
, _mzAmmoPerShot = UseExactly 1
|
|
||||||
, _mzFrame = 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
+190
-34
@@ -10,17 +10,16 @@ module Dodge.HeldUse (
|
|||||||
heldEffectMuzzles,
|
heldEffectMuzzles,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Dodge.Base
|
||||||
import Color
|
import Color
|
||||||
import Control.Applicative
|
import Control.Applicative
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import qualified Data.IntMap.Strict as IM
|
import qualified Data.IntMap.Strict as IM
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Dodge.Base.Collide
|
|
||||||
import Dodge.BaseTriggerType
|
import Dodge.BaseTriggerType
|
||||||
import Dodge.Creature.Action
|
import Dodge.Creature.Action
|
||||||
import Dodge.Data.ComposedItem
|
import Dodge.Data.ComposedItem
|
||||||
import Dodge.Data.DoubleTree
|
import Dodge.Data.DoubleTree
|
||||||
import Dodge.Data.MuzzleEffect
|
|
||||||
import Dodge.Data.World
|
import Dodge.Data.World
|
||||||
import Dodge.Gas
|
import Dodge.Gas
|
||||||
import Dodge.Inventory.Lock
|
import Dodge.Inventory.Lock
|
||||||
@@ -102,10 +101,10 @@ hammerCheck f pt it cr
|
|||||||
id
|
id
|
||||||
| otherwise = f it cr
|
| otherwise = f it cr
|
||||||
where
|
where
|
||||||
-- g x = (x, WdWdFromItCrixWdWd (upitm x) (_crID cr) ItCrWdItemHeldEffectNoHammer)
|
-- g x = (x, WdWdFromItCrixWdWd (upitm x) (_crID cr) ItCrWdItemHeldEffectNoHammer)
|
||||||
-- upitm x =
|
-- upitm x =
|
||||||
-- it -- & ldtValue . itUse . heldParams . weaponRepeat .~ []
|
-- it -- & ldtValue . itUse . heldParams . weaponRepeat .~ []
|
||||||
-- & ldtValue . itUse . heldFrame .~ x
|
-- & ldtValue . itUse . heldFrame .~ x
|
||||||
|
|
||||||
g x = (x, WdWdBurstFireRepetition (_crID cr) (it ^?! ldtValue . itLocation . ilInvID))
|
g x = (x, WdWdBurstFireRepetition (_crID cr) (it ^?! ldtValue . itLocation . ilInvID))
|
||||||
|
|
||||||
@@ -136,36 +135,191 @@ useTimeCheck f item cr w = case item ^? ldtValue . itUse . heldDelay of
|
|||||||
|
|
||||||
heldEffectMuzzles :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
|
heldEffectMuzzles :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
|
||||||
heldEffectMuzzles t cr w =
|
heldEffectMuzzles t cr w =
|
||||||
doHeldUseEffect t cr .
|
doHeldUseEffect t cr
|
||||||
uncurry (applyCME (_ldtValue t) cr) .
|
. uncurry (applyCME (_ldtValue t) cr)
|
||||||
foldl' (useLoadedAmmo t cr) (CME False, w) $ loadedmuzzles
|
. foldl' (useLoadedAmmo t cr) (False, w)
|
||||||
|
$ loadedmuzzles
|
||||||
where
|
where
|
||||||
-- & doWeaponRepetitions upitm cr
|
-- & doWeaponRepetitions upitm cr
|
||||||
|
|
||||||
muzzles = t ^. ldtValue . itUse . heldMuzzles
|
--muzzles = t ^. ldtValue . itUse . heldMuzzles
|
||||||
|
muzzles = itemMuzzles $ t ^. ldtValue
|
||||||
--(upitm, loadedmuzzles) = mapAccumR loadMuzzle t muzzles
|
--(upitm, loadedmuzzles) = mapAccumR loadMuzzle t muzzles
|
||||||
(_, loadedmuzzles) = mapAccumR loadMuzzle t muzzles
|
(_, loadedmuzzles) = mapAccumR loadMuzzle t muzzles
|
||||||
|
|
||||||
|
itemMuzzles :: Item -> [Muzzle]
|
||||||
|
itemMuzzles itm = case itm ^. itType of
|
||||||
|
HELD ALTERIFLE -> dbwMuzzles & ix 0 . mzPos .~ V2 25 0
|
||||||
|
& ix 0 . mzAmmoSlot .~ _alteRifleSwitch (_itParams itm)
|
||||||
|
HELD hit -> heldItemMuzzles hit
|
||||||
|
DETECTOR {} -> dbwMuzzles & ix 0 . mzEffect .~ MuzzleDetector
|
||||||
|
& ix 0 . mzAmmoPerShot .~ UseExactly 100
|
||||||
|
_ -> []
|
||||||
|
|
||||||
|
heldItemMuzzles :: HeldItemType -> [Muzzle]
|
||||||
|
heldItemMuzzles = \case
|
||||||
|
BANGSTICK i -> [ Muzzle
|
||||||
|
(V2 10 0)
|
||||||
|
a
|
||||||
|
0.01
|
||||||
|
0
|
||||||
|
NoFlare
|
||||||
|
MuzzleShootBullet
|
||||||
|
(UseExactly 1)
|
||||||
|
0
|
||||||
|
| a <- spreadAroundCenter i baseStickSpread
|
||||||
|
]
|
||||||
|
& ix 0 . mzFlareType .~ NoLightFlare
|
||||||
|
& ix (i `div` 2) . mzFlareType .~ MiniGunFlare
|
||||||
|
& ix (i-1) . mzFlareType .~ NoLightFlare
|
||||||
|
PISTOL -> [Muzzle (V2 10 0) 0 0.05 0 BasicFlare MuzzleShootBullet (UseExactly 1) 0]
|
||||||
|
AUTOPISTOL -> [Muzzle (V2 20 0) 0 0 0 BasicFlare MuzzleShootBullet (UseExactly 1) 0]
|
||||||
|
SMG -> [Muzzle (V2 10 0) 0 0.05 0 BasicFlare MuzzleShootBullet (UseExactly 1) 0]
|
||||||
|
RIFLE -> dbwMuzzles & ix 0 . mzPos .~ V2 25 0
|
||||||
|
BURSTRIFLE -> dbwMuzzles & ix 0 . mzPos .~ V2 25 0
|
||||||
|
& ix 0 . mzInaccuracy .~ 0.05
|
||||||
|
MINIGUNX i ->
|
||||||
|
replicate i
|
||||||
|
(Muzzle (V2 30 0) 0 0.05 0 MiniGunFlare MuzzleShootBullet (UseExactly 1) 0)
|
||||||
|
BANGROD -> dbwMuzzles
|
||||||
|
& ix 0 . mzPos .~ V2 30 0
|
||||||
|
& ix 0 . mzFlareType .~ HeavySmokeFlare
|
||||||
|
ELEPHANTGUN -> dbwMuzzles
|
||||||
|
& ix 0 . mzPos .~ V2 30 0
|
||||||
|
& ix 0 . mzFlareType .~ HeavySmokeFlare
|
||||||
|
& ix 0 . mzInaccuracy .~ 0.05
|
||||||
|
AMR -> dbwMuzzles
|
||||||
|
& ix 0 . mzPos .~ V2 30 0
|
||||||
|
& ix 0 . mzFlareType .~ HeavySmokeFlare
|
||||||
|
& ix 0 . mzInaccuracy .~ 0.05
|
||||||
|
AUTOAMR -> dbwMuzzles
|
||||||
|
& ix 0 . mzPos .~ V2 30 0
|
||||||
|
& ix 0 . mzFlareType .~ HeavySmokeFlare
|
||||||
|
& ix 0 . mzInaccuracy .~ 0.05
|
||||||
|
SNIPERRIFLE -> dbwMuzzles
|
||||||
|
& ix 0 . mzPos .~ V2 30 0
|
||||||
|
& ix 0 . mzFlareType .~ HeavySmokeFlare
|
||||||
|
& ix 0 . mzInaccuracy .~ 0
|
||||||
|
BANGCONE -> [Muzzle (V2 15 0) 0 0.5 0 BasicFlare MuzzleShootBullet (UseUpTo 15) 0]
|
||||||
|
BLUNDERBUSS -> [Muzzle (V2 30 0) 0 0.5 0 BasicFlare MuzzleShootBullet (UseUpTo 15) 0]
|
||||||
|
GRAPECANNON _ -> [Muzzle (V2 30 0) 0 0.5 0 BasicFlare MuzzleShootBullet (UseUpTo 15) 0]
|
||||||
|
TORCH -> dbwMuzzles & ix 0 . mzPos .~ V2 10 0
|
||||||
|
VOLLEYGUN i -> vgunMuzzles i
|
||||||
|
FLAMETHROWER -> flameMuzzles
|
||||||
|
FLAMESPITTER -> flameMuzzles & ix 0 . mzEffect . nzPressure .~ UniRandFloat 3 4
|
||||||
|
RLAUNCHER -> dbwMuzzles
|
||||||
|
& ix 0 . mzInaccuracy .~ 0
|
||||||
|
& ix 0 . mzEffect .~ MuzzleRLauncher
|
||||||
|
& ix 0 . mzPos .~ V2 20 0
|
||||||
|
GLAUNCHER -> dbwMuzzles
|
||||||
|
& ix 0 . mzInaccuracy .~ 0
|
||||||
|
& ix 0 . mzEffect .~ MuzzleGLauncher
|
||||||
|
& ix 0 . mzPos .~ V2 20 0
|
||||||
|
RLAUNCHERX i ->
|
||||||
|
getZipList
|
||||||
|
( ZipList [Muzzle (V2 20 0) a 0 | a <- take i [0, 2 * pi / fromIntegral i ..]]
|
||||||
|
<*> ZipList [0 ..]
|
||||||
|
<*> pure NoFlare
|
||||||
|
<*> pure MuzzleRLauncher
|
||||||
|
<*> pure (UseExactly 1)
|
||||||
|
<*> pure 0
|
||||||
|
)
|
||||||
|
LASER -> dbwMuzzles
|
||||||
|
& ix 0 . mzPos .~ V2 6 0
|
||||||
|
& ix 0 . mzInaccuracy .~ 0
|
||||||
|
& ix 0 . mzFlareType .~ LasGunFlare
|
||||||
|
& ix 0 . mzEffect .~ MuzzleLaser
|
||||||
|
TESLAGUN -> dbwMuzzles
|
||||||
|
& ix 0 . mzPos .~ V2 10 0
|
||||||
|
& ix 0 . mzInaccuracy .~ 0
|
||||||
|
& ix 0 . mzFlareType .~ TeslaGunFlare
|
||||||
|
& ix 0 . mzEffect .~ MuzzleTesla
|
||||||
|
TRACTORGUN -> dbwMuzzles
|
||||||
|
& ix 0 . mzPos .~ V2 30 0
|
||||||
|
& ix 0 . mzInaccuracy .~ 0
|
||||||
|
& ix 0 . mzFlareType .~ NoFlare
|
||||||
|
& ix 0 . mzEffect .~ MuzzleTractor
|
||||||
|
SHATTERGUN -> dbwMuzzles
|
||||||
|
& ix 0 . mzPos .~ V2 30 0
|
||||||
|
& ix 0 . mzInaccuracy .~ 0
|
||||||
|
& ix 0 . mzEffect .~ MuzzleShatter
|
||||||
|
BLINKER -> dbwMuzzles
|
||||||
|
& ix 0 . mzEffect .~ MuzzleBlink
|
||||||
|
& ix 0 . mzAmmoPerShot .~ UseExactly 10000000
|
||||||
|
BLINKERUNSAFE -> dbwMuzzles
|
||||||
|
& ix 0 . mzEffect .~ MuzzleUnsafeBlink
|
||||||
|
& ix 0 . mzAmmoPerShot .~ UseExactly 10000000
|
||||||
|
REWINDER -> dbwMuzzles
|
||||||
|
& ix 0 . mzEffect .~ MuzzleRewind
|
||||||
|
& ix 0 . mzAmmoPerShot .~ UseExactly 100000
|
||||||
|
TIMESTOPPER -> dbwMuzzles
|
||||||
|
& ix 0 . mzEffect .~ MuzzleStopper
|
||||||
|
& ix 0 . mzAmmoPerShot .~ UseExactly 100000
|
||||||
|
TIMESCROLLER -> dbwMuzzles
|
||||||
|
& ix 0 . mzEffect .~ MuzzleScroller
|
||||||
|
& ix 0 . mzAmmoPerShot .~ UseExactly 100000
|
||||||
|
_ -> [ Muzzle
|
||||||
|
{ _mzPos = V2 20 0
|
||||||
|
, _mzRot = 0
|
||||||
|
, _mzInaccuracy = 0.05
|
||||||
|
, _mzAmmoSlot = 0
|
||||||
|
, _mzFlareType = NoFlare
|
||||||
|
, _mzEffect = MuzzleShootBullet
|
||||||
|
, _mzAmmoPerShot = UseExactly 1
|
||||||
|
, _mzFrame = 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
baseStickSpread :: Float
|
||||||
|
baseStickSpread = 0.2
|
||||||
|
|
||||||
|
dbwMuzzles :: [Muzzle]
|
||||||
|
dbwMuzzles = [Muzzle (V2 15 0) 0 0.01 0 BasicFlare MuzzleShootBullet (UseExactly 1) 0]
|
||||||
|
|
||||||
|
flameMuzzles :: [Muzzle]
|
||||||
|
flameMuzzles =
|
||||||
|
[ Muzzle (V2 18 0) 0 0 0 NoFlare MuzzleNozzle
|
||||||
|
{ _nzPressure = ConstFloat 4
|
||||||
|
, _nzMaxWalkAngle = 0.2
|
||||||
|
, _nzWalkSpeed = 0.01
|
||||||
|
}
|
||||||
|
(UseExactly 1)
|
||||||
|
0
|
||||||
|
]
|
||||||
|
|
||||||
|
vgunMuzzles :: Int -> [Muzzle]
|
||||||
|
vgunMuzzles i =
|
||||||
|
getZipList
|
||||||
|
(ZipList [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 6]
|
||||||
|
<*> ZipList [0..i-1]
|
||||||
|
<*> pure MiniGunFlare
|
||||||
|
<*> pure MuzzleShootBullet
|
||||||
|
<*> pure (UseExactly 1)
|
||||||
|
<*> ZipList [0..i-1]
|
||||||
|
)
|
||||||
|
|
||||||
doHeldUseEffect :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
|
doHeldUseEffect :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
|
||||||
doHeldUseEffect t cr w = case t ^. ldtValue . itType of
|
doHeldUseEffect t cr w = case t ^. ldtValue . itType of
|
||||||
HELD (VOLLEYGUN x) -> fromMaybe w $ do
|
-- HELD (VOLLEYGUN x) -> fromMaybe w $ do
|
||||||
i <- t ^? ldtValue . itLocation . ilInvID
|
-- i <- t ^? ldtValue . itLocation . ilInvID
|
||||||
let g = w ^. randGen
|
-- let g = w ^. randGen
|
||||||
(is, g') = runState (shuffle [0 .. x -1]) g
|
-- (is, g') = runState (shuffle [0 .. x -1]) g
|
||||||
return $
|
-- return $
|
||||||
w & cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix i . itUse . heldMuzzles %~ zipWith (\j mz -> mz & mzFrame .~ j) is
|
-- w & cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix i . itUse . heldMuzzles %~ zipWith (\j mz -> mz & mzFrame .~ j) is
|
||||||
& randGen .~ g'
|
-- & randGen .~ g'
|
||||||
HELD ALTERIFLE -> fromMaybe w $ do
|
HELD ALTERIFLE -> fromMaybe w $ do
|
||||||
i <- t ^? ldtValue . itLocation . ilInvID
|
i <- t ^? ldtValue . itLocation . ilInvID
|
||||||
return $
|
return $
|
||||||
w
|
w
|
||||||
& cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix i
|
& cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix i
|
||||||
. itUse
|
. itParams . alteRifleSwitch
|
||||||
. heldMuzzles
|
-- . itUse
|
||||||
. ix 0
|
-- . heldMuzzles
|
||||||
. mzAmmoSlot
|
-- . ix 0
|
||||||
|
-- . mzAmmoSlot
|
||||||
%~ ((`mod` 2) . (+ 1))
|
%~ ((`mod` 2) . (+ 1))
|
||||||
_ -> w
|
_ -> w
|
||||||
|
|
||||||
--doHeldUseEffect t cr w = case t ^? ldtValue . itUse . heldUseEffect of
|
--doHeldUseEffect t cr w = case t ^? ldtValue . itUse . heldUseEffect of
|
||||||
-- Just (RandomiseMuzzleFrames x) -> fromMaybe w $ do
|
-- Just (RandomiseMuzzleFrames x) -> fromMaybe w $ do
|
||||||
-- i <- t ^? ldtValue . itLocation . ilInvID
|
-- i <- t ^? ldtValue . itLocation . ilInvID
|
||||||
@@ -198,9 +352,9 @@ doHeldUseEffect t cr w = case t ^. ldtValue . itType of
|
|||||||
-- itm & ldtValue . itUse . heldParams . weaponRepeat .~ []
|
-- itm & ldtValue . itUse . heldParams . weaponRepeat .~ []
|
||||||
-- & ldtValue . itUse . heldFrame .~ x
|
-- & ldtValue . itUse . heldFrame .~ x
|
||||||
|
|
||||||
applyCME :: Item -> Creature -> CumulativeMuzzleEffect -> World -> World
|
applyCME :: Item -> Creature -> Bool -> World -> World
|
||||||
applyCME itm cr cme
|
applyCME itm cr cme
|
||||||
| _cmeSound cme =
|
| cme =
|
||||||
applyInvLock itm cr
|
applyInvLock itm cr
|
||||||
. applySoundCME itm cr
|
. applySoundCME itm cr
|
||||||
. applySidePush spush cr
|
. applySidePush spush cr
|
||||||
@@ -258,12 +412,12 @@ itemSidePush = \case
|
|||||||
BLINKERUNSAFE -> 0
|
BLINKERUNSAFE -> 0
|
||||||
|
|
||||||
applyInvLock :: Item -> Creature -> World -> World
|
applyInvLock :: Item -> Creature -> World -> World
|
||||||
applyInvLock itm cr
|
applyInvLock itm cr = case itemInvLock itm of
|
||||||
| i <- itemInvLock itm
|
i
|
||||||
, i > 0 =
|
| i > 0 ->
|
||||||
(cWorld . lWorld . delayedEvents .:~ (i, UnlockInv cid))
|
(cWorld . lWorld . delayedEvents .:~ (i, UnlockInv cid))
|
||||||
. lockInv cid
|
. lockInv cid
|
||||||
| otherwise = id
|
_ -> id
|
||||||
where
|
where
|
||||||
cid = _crID cr
|
cid = _crID cr
|
||||||
|
|
||||||
@@ -445,7 +599,7 @@ heldTorqueAmount = \case
|
|||||||
FLAMEWALL -> 0
|
FLAMEWALL -> 0
|
||||||
BLOWTORCH -> 0
|
BLOWTORCH -> 0
|
||||||
SPARKGUN -> 0
|
SPARKGUN -> 0
|
||||||
TESLAGUN -> 0
|
TESLAGUN -> 0.01
|
||||||
LASER -> 0
|
LASER -> 0
|
||||||
TRACTORGUN -> 0
|
TRACTORGUN -> 0
|
||||||
RLAUNCHER -> 0
|
RLAUNCHER -> 0
|
||||||
@@ -557,11 +711,11 @@ isAmmoIntLink _ _ = False
|
|||||||
useLoadedAmmo ::
|
useLoadedAmmo ::
|
||||||
LabelDoubleTree ComposeLinkType Item ->
|
LabelDoubleTree ComposeLinkType Item ->
|
||||||
Creature ->
|
Creature ->
|
||||||
(CumulativeMuzzleEffect, World) ->
|
(Bool, World) ->
|
||||||
Maybe (Muzzle, Int, LabelDoubleTree ComposeLinkType Item) ->
|
Maybe (Muzzle, Int, LabelDoubleTree ComposeLinkType Item) ->
|
||||||
(CumulativeMuzzleEffect, World)
|
(Bool, World)
|
||||||
useLoadedAmmo _ _ (cme, w) Nothing = (cme, w)
|
useLoadedAmmo _ _ (cme, w) Nothing = (cme, w)
|
||||||
useLoadedAmmo itmtree cr (cme, w) (Just (mz, x, magtree)) = (,) (cme & cmeSound .~ True) $
|
useLoadedAmmo itmtree cr (_, w) (Just (mz, x, magtree)) = (,) True $
|
||||||
removeAmmoFromMag x mid cr . makeMuzzleFlare mz itmtree cr $ case _mzEffect mz of
|
removeAmmoFromMag x mid cr . makeMuzzleFlare mz itmtree cr $ case _mzEffect mz of
|
||||||
MuzzleShootBullet -> shootBullet itmtree cr (mz, x, magtree) w
|
MuzzleShootBullet -> shootBullet itmtree cr (mz, x, magtree) w
|
||||||
MuzzleLaser -> creatureShootLaser itmtree cr mz w
|
MuzzleLaser -> creatureShootLaser itmtree cr mz w
|
||||||
@@ -622,7 +776,9 @@ walkNozzle mz itm cr w = fromMaybe w $ do
|
|||||||
w
|
w
|
||||||
& cWorld . lWorld . creatures . ix (_crID cr) . crInv
|
& cWorld . lWorld . creatures . ix (_crID cr) . crInv
|
||||||
. ix invid
|
. ix invid
|
||||||
. itParams . nzAngle %~ f
|
. itParams
|
||||||
|
. nzAngle
|
||||||
|
%~ f
|
||||||
& randGen .~ g
|
& randGen .~ g
|
||||||
where
|
where
|
||||||
nz = _mzEffect mz
|
nz = _mzEffect mz
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ bgateCalc x l r = (x `div` ((2::Int) ^ ((2::Int)*f l + f r))) `mod` 2
|
|||||||
itemScrollDisplay :: Item -> Maybe String
|
itemScrollDisplay :: Item -> Maybe String
|
||||||
itemScrollDisplay itm
|
itemScrollDisplay itm
|
||||||
| HELD ALTERIFLE <- itm ^. itType = Just $
|
| HELD ALTERIFLE <- itm ^. itType = Just $
|
||||||
case itm ^? itUse . heldMuzzles . ix 0 . mzAmmoSlot of
|
case itm ^? itParams . alteRifleSwitch of
|
||||||
Just 0 -> "L"
|
Just 0 -> "L"
|
||||||
_ -> "R"
|
_ -> "R"
|
||||||
| UseScope OpticScope{_opticZoom = x} <- itm ^. itUse = Just $ shortShow x
|
| UseScope OpticScope{_opticZoom = x} <- itm ^. itUse = Just $ shortShow x
|
||||||
|
|||||||
@@ -276,9 +276,11 @@ torchShape =
|
|||||||
back = upperPrismPolySE 3 $ rectXH 1 2
|
back = upperPrismPolySE 3 $ rectXH 1 2
|
||||||
|
|
||||||
baseStickShapeX :: Item -> Int -> Shape
|
baseStickShapeX :: Item -> Int -> Shape
|
||||||
baseStickShapeX it _ = foldMap f (it ^?! itUse . heldMuzzles)
|
baseStickShapeX _ _ = mempty
|
||||||
where
|
--baseStickShapeX it _ = mempty
|
||||||
f brl = rotateSH (_mzRot brl) baseStickShape
|
-- foldMap f (it ^?! itUse . heldMuzzles)
|
||||||
|
-- where
|
||||||
|
-- f brl = rotateSH (_mzRot brl) baseStickShape
|
||||||
|
|
||||||
baseStickShape :: Shape
|
baseStickShape :: Shape
|
||||||
baseStickShape = colorSH green $ xCylinderST 3 10
|
baseStickShape = colorSH green $ xCylinderST 3 10
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ module Dodge.Item.Held.BatteryGuns (
|
|||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Dodge.Data.Item
|
import Dodge.Data.Item
|
||||||
import Dodge.Default.Item
|
import Dodge.Default.Item
|
||||||
import Geometry.Data
|
--import Geometry.Data
|
||||||
|
|
||||||
sparkGun :: Item
|
sparkGun :: Item
|
||||||
sparkGun =
|
sparkGun =
|
||||||
@@ -22,10 +22,10 @@ teslaGun =
|
|||||||
-- & itUse . heldParams .~ BeamShooterParams-- (Just (elecCrackleS, 2))
|
-- & itUse . heldParams .~ BeamShooterParams-- (Just (elecCrackleS, 2))
|
||||||
& itParams .~ teslaParams
|
& itParams .~ teslaParams
|
||||||
& itUse . heldDelay .~ NoDelay
|
& itUse . heldDelay .~ NoDelay
|
||||||
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 10 0
|
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 10 0
|
||||||
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||||
& itUse . heldMuzzles . ix 0 . mzFlareType .~ TeslaGunFlare
|
-- & itUse . heldMuzzles . ix 0 . mzFlareType .~ TeslaGunFlare
|
||||||
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleTesla
|
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleTesla
|
||||||
& itType .~ HELD TESLAGUN
|
& itType .~ HELD TESLAGUN
|
||||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||||
|
|
||||||
@@ -44,10 +44,10 @@ laser =
|
|||||||
-- & itUse . heldParams .~ BeamShooterParams-- Nothing
|
-- & itUse . heldParams .~ BeamShooterParams-- Nothing
|
||||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||||
& itUse . heldDelay .~ NoDelay
|
& itUse . heldDelay .~ NoDelay
|
||||||
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 6 0
|
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 6 0
|
||||||
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||||
& itUse . heldMuzzles . ix 0 . mzFlareType .~ LasGunFlare
|
-- & itUse . heldMuzzles . ix 0 . mzFlareType .~ LasGunFlare
|
||||||
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleLaser
|
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleLaser
|
||||||
& itTargeting
|
& itTargeting
|
||||||
.~ ItTargeting
|
.~ ItTargeting
|
||||||
{ _itTgPos = Nothing
|
{ _itTgPos = Nothing
|
||||||
@@ -62,8 +62,8 @@ tractorGun =
|
|||||||
defaultHeldItem
|
defaultHeldItem
|
||||||
-- & itUse . heldParams .~ BeamShooterParams
|
-- & itUse . heldParams .~ BeamShooterParams
|
||||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||||
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 30 0
|
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 30 0
|
||||||
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||||
& itUse . heldMuzzles . ix 0 . mzFlareType .~ NoFlare
|
-- & itUse . heldMuzzles . ix 0 . mzFlareType .~ NoFlare
|
||||||
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleTractor
|
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleTractor
|
||||||
& itType .~ HELD TRACTORGUN
|
& itType .~ HELD TRACTORGUN
|
||||||
|
|||||||
+17
-16
@@ -8,14 +8,14 @@ module Dodge.Item.Held.Cane (
|
|||||||
) where
|
) where
|
||||||
|
|
||||||
import Dodge.SoundLogic.ExternallyGeneratedSounds
|
import Dodge.SoundLogic.ExternallyGeneratedSounds
|
||||||
import Dodge.Base
|
--import Dodge.Base
|
||||||
import Dodge.Data.Item
|
import Dodge.Data.Item
|
||||||
import Dodge.Default
|
import Dodge.Default
|
||||||
import qualified Data.IntMap.Strict as IM
|
import qualified Data.IntMap.Strict as IM
|
||||||
--import Dodge.Reloading.Action
|
--import Dodge.Reloading.Action
|
||||||
import Geometry.Data
|
--import Geometry.Data
|
||||||
import LensHelp
|
import LensHelp
|
||||||
import Control.Applicative
|
--import Control.Applicative
|
||||||
|
|
||||||
defaultBangCane :: Item
|
defaultBangCane :: Item
|
||||||
defaultBangCane =
|
defaultBangCane =
|
||||||
@@ -28,14 +28,14 @@ defaultBangCane =
|
|||||||
volleyGun :: Int -> Item
|
volleyGun :: Int -> Item
|
||||||
volleyGun i =
|
volleyGun i =
|
||||||
defaultBangCane
|
defaultBangCane
|
||||||
& itUse . heldMuzzles .~ getZipList
|
-- & itUse . heldMuzzles .~ getZipList
|
||||||
(ZipList [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 6]
|
-- (ZipList [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 6]
|
||||||
<*> ZipList [0..i-1]
|
-- <*> ZipList [0..i-1]
|
||||||
<*> pure MiniGunFlare
|
-- <*> pure MiniGunFlare
|
||||||
<*> pure MuzzleShootBullet
|
-- <*> pure MuzzleShootBullet
|
||||||
<*> pure (UseExactly 1)
|
-- <*> pure (UseExactly 1)
|
||||||
<*> ZipList [0..i-1]
|
-- <*> ZipList [0..i-1]
|
||||||
)
|
-- )
|
||||||
& itType .~ HELD (VOLLEYGUN i)
|
& itType .~ HELD (VOLLEYGUN i)
|
||||||
& itAmmoSlots .~ IM.fromList (zip [0..i-1] $ repeat BulletAmmo)
|
& itAmmoSlots .~ IM.fromList (zip [0..i-1] $ repeat BulletAmmo)
|
||||||
-- & itUse . heldUseEffect .~ RandomiseMuzzleFrames i
|
-- & itUse . heldUseEffect .~ RandomiseMuzzleFrames i
|
||||||
@@ -44,12 +44,13 @@ rifle :: Item
|
|||||||
rifle =
|
rifle =
|
||||||
defaultBangCane
|
defaultBangCane
|
||||||
& itType .~ HELD RIFLE
|
& itType .~ HELD RIFLE
|
||||||
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 25 0
|
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 25 0
|
||||||
|
|
||||||
alteRifle :: Item
|
alteRifle :: Item
|
||||||
alteRifle = rifle
|
alteRifle = rifle
|
||||||
& itType .~ HELD ALTERIFLE
|
& itType .~ HELD ALTERIFLE
|
||||||
& itAmmoSlots .~ IM.fromList (zip [0..1] $ repeat BulletAmmo)
|
& itAmmoSlots .~ IM.fromList (zip [0..1] $ repeat BulletAmmo)
|
||||||
|
& itParams .~ AlteRifleSwitch 0
|
||||||
|
|
||||||
--repeater :: Item
|
--repeater :: Item
|
||||||
--repeater =
|
--repeater =
|
||||||
@@ -66,7 +67,7 @@ burstRifle :: Item
|
|||||||
burstRifle =
|
burstRifle =
|
||||||
rifle
|
rifle
|
||||||
& itType .~ HELD BURSTRIFLE
|
& itType .~ HELD BURSTRIFLE
|
||||||
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0.05
|
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0.05
|
||||||
& itUse . heldDelay . rateMax .~ 6
|
& itUse . heldDelay . rateMax .~ 6
|
||||||
|
|
||||||
miniGunX :: Int -> Item
|
miniGunX :: Int -> Item
|
||||||
@@ -74,9 +75,9 @@ miniGunX i =
|
|||||||
autoRifle
|
autoRifle
|
||||||
& itUse . heldDelay .~ WarmUpNoDelay{_warmTime = 0, _warmMax = 100, _warmSound = crankSlowS}
|
& itUse . heldDelay .~ WarmUpNoDelay{_warmTime = 0, _warmMax = 100, _warmSound = crankSlowS}
|
||||||
& itAmmoSlots .~ singleAmmo BeltBulletAmmo
|
& itAmmoSlots .~ singleAmmo BeltBulletAmmo
|
||||||
& itUse . heldMuzzles
|
-- & itUse . heldMuzzles
|
||||||
.~ replicate i
|
-- .~ replicate i
|
||||||
(Muzzle (V2 30 0) 0 0.05 0 MiniGunFlare MuzzleShootBullet (UseExactly 1) 0)
|
-- (Muzzle (V2 30 0) 0 0.05 0 MiniGunFlare MuzzleShootBullet (UseExactly 1) 0)
|
||||||
& itType .~ HELD (MINIGUNX i)
|
& itType .~ HELD (MINIGUNX i)
|
||||||
& itEffect . ieInv .~ ItemReduceWarmTime
|
& itEffect . ieInv .~ ItemReduceWarmTime
|
||||||
& itEffect . ieOnDrop .~ ItemSetWarmTime 0
|
& itEffect . ieOnDrop .~ ItemSetWarmTime 0
|
||||||
|
|||||||
@@ -7,21 +7,21 @@ module Dodge.Item.Held.Cone (
|
|||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Dodge.Data.Item
|
import Dodge.Data.Item
|
||||||
import Dodge.Default.Item
|
import Dodge.Default.Item
|
||||||
import Geometry.Data
|
--import Geometry.Data
|
||||||
import Linear
|
--import Linear
|
||||||
|
|
||||||
bangCone :: Item
|
bangCone :: Item
|
||||||
bangCone =
|
bangCone =
|
||||||
defaultBulletWeapon
|
defaultBulletWeapon
|
||||||
& itUse . heldDelay . rateMax .~ 20
|
& itUse . heldDelay . rateMax .~ 20
|
||||||
& itUse . heldMuzzles
|
-- & itUse . heldMuzzles
|
||||||
.~ [Muzzle (V2 15 0) 0 0.5 0 BasicFlare MuzzleShootBullet (UseUpTo 15) 0]
|
-- .~ [Muzzle (V2 15 0) 0 0.5 0 BasicFlare MuzzleShootBullet (UseUpTo 15) 0]
|
||||||
& itType .~ HELD BANGCONE
|
& itType .~ HELD BANGCONE
|
||||||
|
|
||||||
blunderbuss :: Item
|
blunderbuss :: Item
|
||||||
blunderbuss =
|
blunderbuss =
|
||||||
bangCone
|
bangCone
|
||||||
& itUse . heldMuzzles . ix 0 . mzPos . _x .~ 30
|
-- & itUse . heldMuzzles . ix 0 . mzPos . _x .~ 30
|
||||||
& itType .~ HELD BLUNDERBUSS
|
& itType .~ HELD BLUNDERBUSS
|
||||||
|
|
||||||
grapeCannon :: Int -> Item
|
grapeCannon :: Int -> Item
|
||||||
|
|||||||
@@ -4,20 +4,20 @@ module Dodge.Item.Held.Launcher (
|
|||||||
gLauncher,
|
gLauncher,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Applicative
|
--import Control.Applicative
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Dodge.Data.Item
|
import Dodge.Data.Item
|
||||||
import Dodge.Default.Item
|
import Dodge.Default.Item
|
||||||
import Geometry.Data
|
--import Geometry.Data
|
||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
|
|
||||||
rLauncher :: Item
|
rLauncher :: Item
|
||||||
rLauncher =
|
rLauncher =
|
||||||
defaultHeldItem
|
defaultHeldItem
|
||||||
& itUse . heldDelay . rateMax .~ 20
|
& itUse . heldDelay . rateMax .~ 20
|
||||||
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||||
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleRLauncher
|
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleRLauncher
|
||||||
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 20 0
|
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 20 0
|
||||||
& itAmmoSlots .~ singleAmmo LauncherAmmo
|
& itAmmoSlots .~ singleAmmo LauncherAmmo
|
||||||
& itType .~ HELD RLAUNCHER
|
& itType .~ HELD RLAUNCHER
|
||||||
|
|
||||||
@@ -25,21 +25,21 @@ gLauncher :: Item
|
|||||||
gLauncher =
|
gLauncher =
|
||||||
rLauncher
|
rLauncher
|
||||||
& itType .~ HELD GLAUNCHER
|
& itType .~ HELD GLAUNCHER
|
||||||
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleGLauncher
|
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleGLauncher
|
||||||
|
|
||||||
rLauncherX :: Int -> Item
|
rLauncherX :: Int -> Item
|
||||||
rLauncherX i =
|
rLauncherX i =
|
||||||
rLauncher
|
rLauncher
|
||||||
& itType .~ HELD (RLAUNCHERX i)
|
& itType .~ HELD (RLAUNCHERX i)
|
||||||
& itUse . heldMuzzles
|
-- & itUse . heldMuzzles
|
||||||
.~ getZipList
|
-- .~ getZipList
|
||||||
( ZipList [Muzzle (V2 20 0) a 0 | a <- angles]
|
-- ( ZipList [Muzzle (V2 20 0) a 0 | a <- angles]
|
||||||
<*> ZipList [0 ..]
|
-- <*> ZipList [0 ..]
|
||||||
<*> pure NoFlare
|
-- <*> pure NoFlare
|
||||||
<*> pure MuzzleRLauncher
|
-- <*> pure MuzzleRLauncher
|
||||||
<*> pure (UseExactly 1)
|
-- <*> pure (UseExactly 1)
|
||||||
<*> pure 0
|
-- <*> pure 0
|
||||||
)
|
-- )
|
||||||
& itAmmoSlots .~ IM.fromList [(j, LauncherAmmo) | j <- [0 .. i -1]]
|
& itAmmoSlots .~ IM.fromList [(j, LauncherAmmo) | j <- [0 .. i -1]]
|
||||||
where
|
where
|
||||||
angles = take i [0, 2 * pi / fromIntegral i ..]
|
-- angles = take i [0, 2 * pi / fromIntegral i ..]
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import Dodge.Data.Item
|
|||||||
import Dodge.Default
|
import Dodge.Default
|
||||||
--import Dodge.Item.Weapon.Bullet
|
--import Dodge.Item.Weapon.Bullet
|
||||||
--import Dodge.Reloading.Action
|
--import Dodge.Reloading.Action
|
||||||
import Geometry
|
--import Geometry
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
bangRod :: Item
|
bangRod :: Item
|
||||||
@@ -20,15 +20,15 @@ bangRod =
|
|||||||
defaultBulletWeapon
|
defaultBulletWeapon
|
||||||
& itUse . heldDelay . rateMax .~ 12
|
& itUse . heldDelay . rateMax .~ 12
|
||||||
& itType .~ HELD BANGROD
|
& itType .~ HELD BANGROD
|
||||||
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 30 0
|
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 30 0
|
||||||
& itUse . heldMuzzles . ix 0 . mzFlareType .~ HeavySmokeFlare
|
-- & itUse . heldMuzzles . ix 0 . mzFlareType .~ HeavySmokeFlare
|
||||||
-- & itUse . heldConsumption . laAmmoType .~ hvBulletAmmo
|
-- & itUse . heldConsumption . laAmmoType .~ hvBulletAmmo
|
||||||
|
|
||||||
elephantGun :: Item
|
elephantGun :: Item
|
||||||
elephantGun =
|
elephantGun =
|
||||||
bangRod
|
bangRod
|
||||||
& itType .~ HELD ELEPHANTGUN
|
& itType .~ HELD ELEPHANTGUN
|
||||||
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0.05
|
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0.05
|
||||||
-- & itUse . heldParams . recoil .~ 50
|
-- & itUse . heldParams . recoil .~ 50
|
||||||
|
|
||||||
amr :: Item
|
amr :: Item
|
||||||
@@ -45,7 +45,7 @@ sniperRifle :: Item
|
|||||||
sniperRifle =
|
sniperRifle =
|
||||||
elephantGun
|
elephantGun
|
||||||
& itType .~ HELD SNIPERRIFLE
|
& itType .~ HELD SNIPERRIFLE
|
||||||
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||||
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 0.5, _izMin = 0.5,_izFac = 1}
|
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 0.5, _izMin = 0.5,_izFac = 1}
|
||||||
|
|
||||||
--machineGun :: Item
|
--machineGun :: Item
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module Dodge.Item.Held.SprayGuns (
|
|||||||
import Dodge.Data.Item
|
import Dodge.Data.Item
|
||||||
import Dodge.Default.Item
|
import Dodge.Default.Item
|
||||||
--import Dodge.Reloading.Action
|
--import Dodge.Reloading.Action
|
||||||
import Geometry
|
--import Geometry
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
poisonSprayer :: Item
|
poisonSprayer :: Item
|
||||||
@@ -27,7 +27,7 @@ flameSpitter =
|
|||||||
& itUse . heldDelay .~ FixedRate{_rateMax = 3, _rateTimeLastUsed = 0}
|
& itUse . heldDelay .~ FixedRate{_rateMax = 3, _rateTimeLastUsed = 0}
|
||||||
-- & itUse . heldParams . weaponInvLock .~ 10
|
-- & itUse . heldParams . weaponInvLock .~ 10
|
||||||
-- & itUse . heldParams . weaponRepeat .~ [1..9]
|
-- & itUse . heldParams . weaponRepeat .~ [1..9]
|
||||||
& itUse . heldMuzzles . ix 0 . mzEffect . nzPressure .~ UniRandFloat 3 4
|
-- & itUse . heldMuzzles . ix 0 . mzEffect . nzPressure .~ UniRandFloat 3 4
|
||||||
|
|
||||||
flameTorrent :: Item
|
flameTorrent :: Item
|
||||||
flameTorrent =
|
flameTorrent =
|
||||||
@@ -67,16 +67,16 @@ flameThrower =
|
|||||||
& itParams .~ NozzleAngle 0
|
& itParams .~ NozzleAngle 0
|
||||||
& itUse . heldDelay .~ NoDelay
|
& itUse . heldDelay .~ NoDelay
|
||||||
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 5, _izMin = 1.5}
|
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 5, _izMin = 1.5}
|
||||||
& itUse . heldMuzzles .~ [Muzzle (V2 18 0) 0 0 0 NoFlare
|
-- & itUse . heldMuzzles .~ [Muzzle (V2 18 0) 0 0 0 NoFlare
|
||||||
MuzzleNozzle
|
-- MuzzleNozzle
|
||||||
{ _nzPressure = ConstFloat 4
|
-- { _nzPressure = ConstFloat 4
|
||||||
, _nzMaxWalkAngle = 0.2
|
-- , _nzMaxWalkAngle = 0.2
|
||||||
, _nzWalkSpeed = 0.01
|
-- , _nzWalkSpeed = 0.01
|
||||||
-- , _nzCurrentWalkAngle = 0
|
---- , _nzCurrentWalkAngle = 0
|
||||||
}
|
-- }
|
||||||
(UseExactly 1)
|
-- (UseExactly 1)
|
||||||
0
|
-- 0
|
||||||
]
|
-- ]
|
||||||
& itAmmoSlots .~ singleAmmo GasAmmo
|
& itAmmoSlots .~ singleAmmo GasAmmo
|
||||||
& itType .~ HELD FLAMETHROWER
|
& itType .~ HELD FLAMETHROWER
|
||||||
-- & itUse . heldParams .~ GasSprayParams
|
-- & itUse . heldParams .~ GasSprayParams
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ module Dodge.Item.Held.Stick (
|
|||||||
smg,
|
smg,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Dodge.Base
|
--import Dodge.Base
|
||||||
import Dodge.Data.Item
|
import Dodge.Data.Item
|
||||||
import Dodge.Default.Item
|
import Dodge.Default.Item
|
||||||
import Dodge.SoundLogic.ExternallyGeneratedSounds
|
import Dodge.SoundLogic.ExternallyGeneratedSounds
|
||||||
import Geometry
|
--import Geometry
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
bangStick :: Int -> Item
|
bangStick :: Int -> Item
|
||||||
@@ -19,32 +19,32 @@ bangStick i =
|
|||||||
-- & itUse . heldParams . recoil .~ 25
|
-- & itUse . heldParams . recoil .~ 25
|
||||||
& itType .~ HELD (BANGSTICK i)
|
& itType .~ HELD (BANGSTICK i)
|
||||||
& itUse . heldDelay . rateMax .~ 8
|
& itUse . heldDelay . rateMax .~ 8
|
||||||
& itUse . heldMuzzles
|
-- & itUse . heldMuzzles
|
||||||
.~ [ Muzzle
|
-- .~ [ Muzzle
|
||||||
(V2 10 0)
|
-- (V2 10 0)
|
||||||
a
|
-- a
|
||||||
0.01
|
-- 0.01
|
||||||
0
|
-- 0
|
||||||
NoFlare
|
-- NoFlare
|
||||||
MuzzleShootBullet
|
-- MuzzleShootBullet
|
||||||
(UseExactly 1)
|
-- (UseExactly 1)
|
||||||
0
|
-- 0
|
||||||
| a <- spreadAroundCenter i baseStickSpread
|
-- | a <- spreadAroundCenter i baseStickSpread
|
||||||
]
|
-- ]
|
||||||
& itUse . heldMuzzles . ix 0 . mzFlareType .~ NoLightFlare
|
-- & itUse . heldMuzzles . ix 0 . mzFlareType .~ NoLightFlare
|
||||||
& itUse . heldMuzzles . ix (i `div` 2) . mzFlareType .~ MiniGunFlare
|
-- & itUse . heldMuzzles . ix (i `div` 2) . mzFlareType .~ MiniGunFlare
|
||||||
& itUse . heldMuzzles . ix (i-1) . mzFlareType .~ NoLightFlare
|
-- & itUse . heldMuzzles . ix (i-1) . mzFlareType .~ NoLightFlare
|
||||||
|
|
||||||
baseStickSpread :: Float
|
--baseStickSpread :: Float
|
||||||
baseStickSpread = 0.2
|
--baseStickSpread = 0.2
|
||||||
|
|
||||||
pistol :: Item
|
pistol :: Item
|
||||||
pistol =
|
pistol =
|
||||||
bangStick 1
|
bangStick 1
|
||||||
& itUse . heldDelay . rateMax .~ 6
|
& itUse . heldDelay . rateMax .~ 6
|
||||||
& itUse . heldMuzzles . ix 0 . mzPos %~ const (V2 10 0)
|
-- & itUse . heldMuzzles . ix 0 . mzPos %~ const (V2 10 0)
|
||||||
& itUse . heldMuzzles . ix 0 . mzInaccuracy %~ const 0.05
|
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy %~ const 0.05
|
||||||
& itUse . heldMuzzles . ix 0 . mzFlareType %~ const BasicFlare
|
-- & itUse . heldMuzzles . ix 0 . mzFlareType %~ const BasicFlare
|
||||||
& itType .~ HELD PISTOL
|
& itType .~ HELD PISTOL
|
||||||
|
|
||||||
autoPistol :: Item
|
autoPistol :: Item
|
||||||
@@ -60,5 +60,5 @@ smg :: Item
|
|||||||
smg =
|
smg =
|
||||||
autoPistol
|
autoPistol
|
||||||
& itType .~ HELD SMG
|
& itType .~ HELD SMG
|
||||||
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 20 0
|
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 20 0
|
||||||
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ module Dodge.Item.Held.Utility (
|
|||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Dodge.Data.Item
|
import Dodge.Data.Item
|
||||||
import Dodge.Default.Item
|
import Dodge.Default.Item
|
||||||
import Linear
|
--import Linear
|
||||||
|
|
||||||
flatShield :: Item
|
flatShield :: Item
|
||||||
flatShield =
|
flatShield =
|
||||||
@@ -28,7 +28,7 @@ torch :: Item
|
|||||||
torch =
|
torch =
|
||||||
defaultHeldItem
|
defaultHeldItem
|
||||||
& itType .~ HELD TORCH
|
& itType .~ HELD TORCH
|
||||||
& itUse . heldMuzzles . ix 0 . mzPos . _x .~ 10
|
-- & itUse . heldMuzzles . ix 0 . mzPos . _x .~ 10
|
||||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||||
|
|
||||||
-- | Sends out pulses that display walls.
|
-- | Sends out pulses that display walls.
|
||||||
@@ -39,8 +39,8 @@ detector dt =
|
|||||||
& itUse . heldDelay . rateMax .~ 20
|
& itUse . heldDelay . rateMax .~ 20
|
||||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||||
& itType .~ DETECTOR dt
|
& itType .~ DETECTOR dt
|
||||||
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleDetector
|
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleDetector
|
||||||
& itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 100
|
-- & itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 100
|
||||||
|
|
||||||
blinker :: Item
|
blinker :: Item
|
||||||
blinker =
|
blinker =
|
||||||
@@ -48,31 +48,31 @@ blinker =
|
|||||||
& itUseCondition .~ UseableAnytime
|
& itUseCondition .~ UseableAnytime
|
||||||
& itUse . heldDelay . rateMax .~ 20
|
& itUse . heldDelay . rateMax .~ 20
|
||||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||||
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleBlink
|
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleBlink
|
||||||
& itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 10000000
|
-- & itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 10000000
|
||||||
& itType .~ HELD BLINKER
|
& itType .~ HELD BLINKER
|
||||||
|
|
||||||
unsafeBlinker :: Item
|
unsafeBlinker :: Item
|
||||||
unsafeBlinker =
|
unsafeBlinker =
|
||||||
blinker
|
blinker
|
||||||
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleUnsafeBlink
|
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleUnsafeBlink
|
||||||
& itType .~ HELD BLINKERUNSAFE
|
& itType .~ HELD BLINKERUNSAFE
|
||||||
|
|
||||||
rewinder :: Item
|
rewinder :: Item
|
||||||
rewinder =
|
rewinder =
|
||||||
blinker
|
blinker
|
||||||
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleRewind
|
|
||||||
& itType .~ HELD REWINDER
|
& itType .~ HELD REWINDER
|
||||||
& itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 100000
|
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleRewind
|
||||||
|
-- & itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 100000
|
||||||
|
|
||||||
timeStopper :: Item
|
timeStopper :: Item
|
||||||
timeStopper =
|
timeStopper =
|
||||||
blinker
|
blinker
|
||||||
& itType .~ HELD TIMESTOPPER
|
& itType .~ HELD TIMESTOPPER
|
||||||
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleStopper
|
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleStopper
|
||||||
|
|
||||||
timeScroller :: Item
|
timeScroller :: Item
|
||||||
timeScroller =
|
timeScroller =
|
||||||
timeStopper
|
timeStopper
|
||||||
& itType .~ HELD TIMESCROLLER
|
& itType .~ HELD TIMESCROLLER
|
||||||
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleScroller
|
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleScroller
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module Dodge.Item.Held.Weapons where
|
|||||||
import Dodge.Default.Item
|
import Dodge.Default.Item
|
||||||
import Dodge.Data.Item
|
import Dodge.Data.Item
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Linear.V2
|
--import Linear.V2
|
||||||
|
|
||||||
shatterGun :: Item
|
shatterGun :: Item
|
||||||
shatterGun =
|
shatterGun =
|
||||||
@@ -11,6 +11,6 @@ shatterGun =
|
|||||||
& itType .~ HELD SHATTERGUN
|
& itType .~ HELD SHATTERGUN
|
||||||
& itUse . heldDelay . rateMax .~ 10
|
& itUse . heldDelay . rateMax .~ 10
|
||||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||||
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 30 0
|
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 30 0
|
||||||
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
-- & itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||||
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleShatter
|
-- & itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleShatter
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ itemScroll yi invid itm w
|
|||||||
| HELD ALTERIFLE <- itm ^. itType
|
| HELD ALTERIFLE <- itm ^. itType
|
||||||
, yi /= 0 =
|
, yi /= 0 =
|
||||||
w
|
w
|
||||||
& itmlens . itUse . heldMuzzles . ix 0 . mzAmmoSlot
|
-- & itmlens . itUse . heldMuzzles . ix 0 . mzAmmoSlot
|
||||||
|
& itmlens . itParams . alteRifleSwitch
|
||||||
%~ ((`mod` 2) . (+ 1))
|
%~ ((`mod` 2) . (+ 1))
|
||||||
| isJust $ itm ^? itScroll . itsInt = w & itmlens . itScroll . itsInt +~ yi
|
| isJust $ itm ^? itScroll . itsInt = w & itmlens . itScroll . itsInt +~ yi
|
||||||
| Just y <- itm ^? itScroll . itsMax = w & itmlens . itScroll . itsRangeInt
|
| Just y <- itm ^? itScroll . itsMax = w & itmlens . itScroll . itsRangeInt
|
||||||
|
|||||||
Reference in New Issue
Block a user