Continue refactor of bullet gun effect chain
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
All good (616 modules, at 19:05:45)
|
All good (617 modules, at 23:34:46)
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+7
-2
@@ -69,13 +69,18 @@ shootBullet itm cr w = fromMaybe (error "cannot find bullet ammo when expected t
|
|||||||
& buPos .~ _crPos cr
|
& buPos .~ _crPos cr
|
||||||
& buTrajectory %~ settrajectory
|
& buTrajectory %~ settrajectory
|
||||||
& buVel %~ (rotateV dir . (muzvel *.*))
|
& buVel %~ (rotateV dir . (muzvel *.*))
|
||||||
& buDrag *~ _rifling (_heldParams $ _itUse it)
|
& buDrag *~ drag
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
it = itm ^. ldtValue
|
it = itm ^. ldtValue
|
||||||
sp = _crPos cr +.+ (muzlength ^?! _head . _x) *.* unitVectorAtAngle dir
|
sp = _crPos cr +.+ (muzlength ^?! _head . _x) *.* unitVectorAtAngle dir
|
||||||
dir = _crDir cr
|
dir = _crDir cr
|
||||||
muzvel = _muzVel $ _heldParams $ _itUse it
|
drag = case _rifling (_heldParams $ _itUse it) of
|
||||||
|
ConstFloat x -> x
|
||||||
|
UniRandFloat x y -> fst . randomR (x,y) $ _randGen w
|
||||||
|
muzvel = case _muzVel $ _heldParams $ _itUse it of
|
||||||
|
ConstFloat x -> x
|
||||||
|
UniRandFloat x y -> fst . randomR (x,y) $ _randGen w
|
||||||
muzlength = aimingMuzzlePos cr it
|
muzlength = aimingMuzzlePos cr it
|
||||||
settrajectory traj = case traj of
|
settrajectory traj = case traj of
|
||||||
BasicBulletTrajectory -> BasicBulletTrajectory
|
BasicBulletTrajectory -> BasicBulletTrajectory
|
||||||
|
|||||||
@@ -269,6 +269,8 @@ testInventory =
|
|||||||
stackedInventory :: [Item]
|
stackedInventory :: [Item]
|
||||||
stackedInventory =
|
stackedInventory =
|
||||||
[ burstRifle
|
[ burstRifle
|
||||||
|
, bangCone
|
||||||
|
, megaTinMag
|
||||||
, volleyGun 3
|
, volleyGun 3
|
||||||
, tinMag
|
, tinMag
|
||||||
, tinMag
|
, tinMag
|
||||||
|
|||||||
@@ -168,7 +168,6 @@ data HeldItemType
|
|||||||
| GRAPECANNON {_xNum :: Int}
|
| GRAPECANNON {_xNum :: Int}
|
||||||
| MINIGUNX {_xNum :: Int}
|
| MINIGUNX {_xNum :: Int}
|
||||||
| VOLLEYGUN {_xNum :: Int}
|
| VOLLEYGUN {_xNum :: Int}
|
||||||
| MULTIGUN {_xNum :: Int}
|
|
||||||
| RIFLE
|
| RIFLE
|
||||||
-- | REPEATER
|
-- | REPEATER
|
||||||
| AUTORIFLE
|
| AUTORIFLE
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ data HeldMod
|
|||||||
-- | AmmoUseCheckMod
|
-- | AmmoUseCheckMod
|
||||||
-- | AmmoHammerTimeUseOneMod
|
-- | AmmoHammerTimeUseOneMod
|
||||||
-- | BangCaneMod
|
-- | BangCaneMod
|
||||||
| VolleyGunMod
|
-- | VolleyGunMod
|
||||||
| MultiGunMod
|
-- | MultiGunMod
|
||||||
-- | AutoRifleMod
|
-- | AutoRifleMod
|
||||||
| BangRodMod
|
| BangRodMod
|
||||||
| ElephantGunMod
|
| ElephantGunMod
|
||||||
@@ -98,7 +98,7 @@ data HeldMod
|
|||||||
| BurstRifleRepeatMod
|
| BurstRifleRepeatMod
|
||||||
| MiniGunMod Int
|
| MiniGunMod Int
|
||||||
-- | SmgMod
|
-- | SmgMod
|
||||||
| BangConeMod
|
-- | BangConeMod
|
||||||
| TractorMod --apply with AmmoCheckMod
|
| TractorMod --apply with AmmoCheckMod
|
||||||
| FireRemoteShellMod
|
| FireRemoteShellMod
|
||||||
| ExplodeRemoteShellMod
|
| ExplodeRemoteShellMod
|
||||||
|
|||||||
@@ -11,8 +11,10 @@ module Dodge.Data.Item.Use (
|
|||||||
module Dodge.Data.Item.Use.Consumption,
|
module Dodge.Data.Item.Use.Consumption,
|
||||||
module Dodge.Data.Hammer,
|
module Dodge.Data.Hammer,
|
||||||
module Dodge.Data.Item.Targeting,
|
module Dodge.Data.Item.Targeting,
|
||||||
|
module Dodge.Data.GenFloat
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Dodge.Data.GenFloat
|
||||||
import Sound.Data
|
import Sound.Data
|
||||||
import qualified Data.IntMap.Strict as IM
|
import qualified Data.IntMap.Strict as IM
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
@@ -74,8 +76,8 @@ data HeldParams
|
|||||||
| GasSprayParams
|
| GasSprayParams
|
||||||
{_gasCreation :: GasCreate}
|
{_gasCreation :: GasCreate}
|
||||||
| BulletShooterParams
|
| BulletShooterParams
|
||||||
{ _muzVel :: Float
|
{ _muzVel :: GenFloat
|
||||||
, _rifling :: Float
|
, _rifling :: GenFloat
|
||||||
, _recoil :: Float
|
, _recoil :: Float
|
||||||
, _torqueAfter :: Float
|
, _torqueAfter :: Float
|
||||||
, _randomOffset :: Float
|
, _randomOffset :: Float
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ data LWorld = LWorld
|
|||||||
, _selLocation :: Int
|
, _selLocation :: Int
|
||||||
, _distortions :: [Distortion]
|
, _distortions :: [Distortion]
|
||||||
, _lClock :: Int
|
, _lClock :: Int
|
||||||
|
, _lTestString :: [String]
|
||||||
}
|
}
|
||||||
data WorldBeams = WorldBeams
|
data WorldBeams = WorldBeams
|
||||||
{ _blockingBeams :: [Beam]
|
{ _blockingBeams :: [Beam]
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ defaultHeldUse =
|
|||||||
, _heldAim = defaultAimParams
|
, _heldAim = defaultAimParams
|
||||||
, _heldAmmoTypes = mempty
|
, _heldAmmoTypes = mempty
|
||||||
, _heldParams = BulletShooterParams
|
, _heldParams = BulletShooterParams
|
||||||
{ _muzVel = 0.8
|
{ _muzVel = ConstFloat 0.8
|
||||||
, _rifling = 0.8
|
, _rifling = ConstFloat 0.8
|
||||||
, _recoil = 10
|
, _recoil = 10
|
||||||
, _torqueAfter = 0.2
|
, _torqueAfter = 0.2
|
||||||
, _randomOffset = 0
|
, _randomOffset = 0
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ defaultLWorld =
|
|||||||
, _foregroundShapes = mempty
|
, _foregroundShapes = mempty
|
||||||
, _distortions = []
|
, _distortions = []
|
||||||
, _lClock = 0
|
, _lClock = 0
|
||||||
|
, _lTestString = []
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultHUD :: HUD
|
defaultHUD :: HUD
|
||||||
|
|||||||
+94
-92
@@ -138,28 +138,28 @@ heldEffect effecttype = case effecttype of
|
|||||||
-- , ammoCheckI
|
-- , ammoCheckI
|
||||||
-- , blCheck
|
-- , blCheck
|
||||||
-- ]
|
-- ]
|
||||||
VolleyGunMod -> bulletGunEffect
|
-- VolleyGunMod -> bulletGunEffect
|
||||||
[ withRecoil
|
-- [ withRecoil
|
||||||
, withFlare
|
-- , withFlare
|
||||||
, duplicateLoadedBarrels
|
-- , duplicateLoadedBarrels
|
||||||
, withTorqueAfter
|
-- , withTorqueAfter
|
||||||
, useAllAmmo
|
-- , useAllAmmo
|
||||||
, withSoundItemChoiceStart caneStickSoundChoice
|
-- , withSoundItemChoiceStart caneStickSoundChoice
|
||||||
, useTimeCheck
|
-- , useTimeCheck
|
||||||
, ammoCheckI
|
-- , ammoCheckI
|
||||||
, blCheck
|
-- , blCheck
|
||||||
]
|
-- ]
|
||||||
MultiGunMod -> bulletGunEffect
|
-- MultiGunMod -> bulletGunEffect
|
||||||
[ withRecoil
|
-- [ withRecoil
|
||||||
, withFlare
|
-- , withFlare
|
||||||
, duplicateLoadedBarrels
|
-- , duplicateLoadedBarrels
|
||||||
, withTorqueAfter
|
-- , withTorqueAfter
|
||||||
, useAllAmmo
|
-- , useAllAmmo
|
||||||
, withSoundItemChoiceStart caneStickSoundChoice
|
-- , withSoundItemChoiceStart caneStickSoundChoice
|
||||||
, useTimeCheck
|
-- , useTimeCheck
|
||||||
, ammoCheckI
|
-- , ammoCheckI
|
||||||
, blCheck
|
-- , blCheck
|
||||||
]
|
-- ]
|
||||||
-- AutoRifleMod -> bulletGunEffect
|
-- AutoRifleMod -> bulletGunEffect
|
||||||
-- -- note this is the same as BangCanemMod with the first changed
|
-- -- note this is the same as BangCanemMod with the first changed
|
||||||
-- [ withFlare
|
-- [ withFlare
|
||||||
@@ -297,21 +297,21 @@ heldEffect effecttype = case effecttype of
|
|||||||
-- , useTimeCheck
|
-- , useTimeCheck
|
||||||
-- , ammoCheckI
|
-- , ammoCheckI
|
||||||
-- ]
|
-- ]
|
||||||
BangConeMod -> bulletGunEffect
|
-- BangConeMod -> bulletGunEffect
|
||||||
[ withRandomItem coneRandItemParams
|
-- [ withRandomItem coneRandItemParams
|
||||||
, withRandomItemUpdate coneRandItemUpdate
|
-- , withRandomItemUpdate coneRandItemUpdate
|
||||||
, withRandomOffset
|
-- , withRandomOffset
|
||||||
, duplicateLoadedBarrels
|
-- , duplicateLoadedBarrels
|
||||||
, duplicateLoaded
|
-- , duplicateLoaded
|
||||||
, withMuzFlare
|
-- , withMuzFlare
|
||||||
, withRecoil
|
-- , withRecoil
|
||||||
, withTorqueAfter
|
-- , withTorqueAfter
|
||||||
, useAllAmmo
|
-- , useAllAmmo
|
||||||
, withSoundStart bangEchoS
|
-- , withSoundStart bangEchoS
|
||||||
, useTimeCheck
|
-- , useTimeCheck
|
||||||
, ammoCheckI
|
-- , ammoCheckI
|
||||||
, blCheck
|
-- , blCheck
|
||||||
]
|
-- ]
|
||||||
TractorMod -> foldl' (&) (aTractorBeam . _ldtValue) [ammoCheckI]
|
TractorMod -> foldl' (&) (aTractorBeam . _ldtValue) [ammoCheckI]
|
||||||
FireRemoteShellMod -> undefined
|
FireRemoteShellMod -> undefined
|
||||||
ExplodeRemoteShellMod -> undefined
|
ExplodeRemoteShellMod -> undefined
|
||||||
@@ -355,11 +355,9 @@ bulGunEffect' :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> Wo
|
|||||||
bulGunEffect' t cr w = fromMaybe (error "error in bulGunEffect") $ do
|
bulGunEffect' t cr w = fromMaybe (error "error in bulGunEffect") $ do
|
||||||
muzzles <- t ^? ldtValue . itUse . heldAim . aimMuzzles
|
muzzles <- t ^? ldtValue . itUse . heldAim . aimMuzzles
|
||||||
let (_,loadedmuzzles) = mapAccumR loadMuzzle t muzzles
|
let (_,loadedmuzzles) = mapAccumR loadMuzzle t muzzles
|
||||||
-- let (_,loadedmuzzles) = ((),[])
|
|
||||||
--cmew = foldl' (useLoadedAmmo (_ldtValue t) cr) (CME 0 0 False,w) loadedmuzzles
|
|
||||||
cmew = foldl' (useLoadedAmmo (_ldtValue t) cr) (CME 0 0 False,w) $ loadedmuzzles
|
cmew = foldl' (useLoadedAmmo (_ldtValue t) cr) (CME 0 0 False,w) $ loadedmuzzles
|
||||||
return $ uncurry (applyCME (_ldtValue t) cr) cmew
|
return $ uncurry (applyCME (_ldtValue t) cr) cmew
|
||||||
-- return $ snd cmew
|
& cWorld . lWorld . lTestString .~ map (show . _mzAmmoSlot) muzzles
|
||||||
|
|
||||||
applyCME :: Item -> Creature -> CumulativeMuzzleEffect -> World -> World
|
applyCME :: Item -> Creature -> CumulativeMuzzleEffect -> World -> World
|
||||||
applyCME itm cr cme
|
applyCME itm cr cme
|
||||||
@@ -416,7 +414,6 @@ applyTorqueCME itm cr w
|
|||||||
-- (Muzzle,Int,Int) = (muzzle, amountloaded, id of mag taken from)
|
-- (Muzzle,Int,Int) = (muzzle, amountloaded, id of mag taken from)
|
||||||
loadMuzzle :: LabelDoubleTree ComposeLinkType Item
|
loadMuzzle :: LabelDoubleTree ComposeLinkType Item
|
||||||
-> Muzzle -> (LabelDoubleTree ComposeLinkType Item,(Muzzle, Int,Maybe Int))
|
-> Muzzle -> (LabelDoubleTree ComposeLinkType Item,(Muzzle, Int,Maybe Int))
|
||||||
--loadMuzzle t@(LDT _ l _) mz = (t,(mz, 0,Nothing))
|
|
||||||
loadMuzzle t@(LDT _ l _) mz = fromMaybe (t,(mz, 0,Nothing)) $ do
|
loadMuzzle t@(LDT _ l _) mz = fromMaybe (t,(mz, 0,Nothing)) $ do
|
||||||
let as = _mzAmmoSlot mz
|
let as = _mzAmmoSlot mz
|
||||||
amamount = 1
|
amamount = 1
|
||||||
@@ -454,9 +451,7 @@ isAmmoIntLink _ _ = False
|
|||||||
|
|
||||||
useLoadedAmmo :: Item -> Creature -> (CumulativeMuzzleEffect,World) -> (Muzzle,Int,Maybe Int)
|
useLoadedAmmo :: Item -> Creature -> (CumulativeMuzzleEffect,World) -> (Muzzle,Int,Maybe Int)
|
||||||
-> (CumulativeMuzzleEffect,World)
|
-> (CumulativeMuzzleEffect,World)
|
||||||
--useLoadedAmmo _ cr (cme,w) (_,0,_) = (cme,failsound w)
|
|
||||||
useLoadedAmmo _ _ (cme,w) (_,0,_) = (cme, w)
|
useLoadedAmmo _ _ (cme,w) (_,0,_) = (cme, w)
|
||||||
--useLoadedAmmo itm cr (cme,w) (mz,x,mid) = (cme,w)
|
|
||||||
useLoadedAmmo itm cr (cme,w) (mz,x,mid) = fromMaybe (cme,w) $ do
|
useLoadedAmmo itm cr (cme,w) (mz,x,mid) = fromMaybe (cme,w) $ do
|
||||||
magid <- mid
|
magid <- mid
|
||||||
-- should be able to pass the magazine in from elsewhere?
|
-- should be able to pass the magazine in from elsewhere?
|
||||||
@@ -470,6 +465,7 @@ useLoadedAmmo itm cr (cme,w) (mz,x,mid) = fromMaybe (cme,w) $ do
|
|||||||
where
|
where
|
||||||
cid = _crID cr
|
cid = _crID cr
|
||||||
|
|
||||||
|
-- the random generator is not updated here, not sure if that is a problem
|
||||||
makeBullet :: Bullet -> Item -> Creature -> Muzzle -> World -> World
|
makeBullet :: Bullet -> Item -> Creature -> Muzzle -> World -> World
|
||||||
makeBullet thebullet itm cr mz w =
|
makeBullet thebullet itm cr mz w =
|
||||||
w & randGen .~ g
|
w & randGen .~ g
|
||||||
@@ -478,14 +474,22 @@ makeBullet thebullet itm cr mz w =
|
|||||||
& buPos .~ bulpos
|
& buPos .~ bulpos
|
||||||
-- & buTrajectory .~ BasicBulletTrajectory
|
-- & buTrajectory .~ BasicBulletTrajectory
|
||||||
& buVel %~ (rotateV dir . (muzvel *.*))
|
& buVel %~ (rotateV dir . (muzvel *.*))
|
||||||
& buDrag *~ _rifling (_heldParams $ _itUse itm)
|
& buDrag *~ drag
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
bulpos = _crPos cr + rotateV (_crDir cr) (_mzPos mz + aimingWeaponZeroPos cr itm)
|
bulpos = _crPos cr + rotateV (_crDir cr) (_mzPos mz + aimingWeaponZeroPos cr itm + V2 0 offset)
|
||||||
(a,g) = randomR (-inacc,inacc) $ _randGen w
|
(a,g) = randomR (-inacc,inacc) $ _randGen w
|
||||||
inacc = _mzInaccuracy mz
|
inacc = _mzInaccuracy mz
|
||||||
muzvel = _muzVel $ _heldParams $ _itUse itm
|
drag = case _rifling (_heldParams $ _itUse itm) of
|
||||||
|
ConstFloat x -> x
|
||||||
|
UniRandFloat x y -> fst . randomR (x,y) $ _randGen w
|
||||||
|
muzvel = case _muzVel $ _heldParams $ _itUse itm of
|
||||||
|
ConstFloat x -> x
|
||||||
|
UniRandFloat x y -> fst . randomR (x,y) $ _randGen w
|
||||||
dir = _crDir cr + _mzRot mz + a
|
dir = _crDir cr + _mzRot mz + a
|
||||||
|
offset = case itm ^? itUse . heldParams . randomOffset of
|
||||||
|
Just x | x /= 0 -> fst . randomR (-x,x) $ _randGen w
|
||||||
|
_ -> 0
|
||||||
|
|
||||||
bulletGunEffect :: [(LabelDoubleTree ComposeLinkType Item
|
bulletGunEffect :: [(LabelDoubleTree ComposeLinkType Item
|
||||||
-> Creature -> World -> World)
|
-> Creature -> World -> World)
|
||||||
@@ -624,28 +628,28 @@ useMod hm = case hm of
|
|||||||
-- , ammoCheckI
|
-- , ammoCheckI
|
||||||
-- , blCheck
|
-- , blCheck
|
||||||
-- ]
|
-- ]
|
||||||
VolleyGunMod ->
|
-- VolleyGunMod ->
|
||||||
[ withRecoil
|
-- [ withRecoil
|
||||||
, withFlare
|
-- , withFlare
|
||||||
, duplicateLoadedBarrels
|
-- , duplicateLoadedBarrels
|
||||||
, withTorqueAfter
|
-- , withTorqueAfter
|
||||||
, useAllAmmo
|
-- , useAllAmmo
|
||||||
, withSoundItemChoiceStart caneStickSoundChoice
|
-- , withSoundItemChoiceStart caneStickSoundChoice
|
||||||
, useTimeCheck
|
-- , useTimeCheck
|
||||||
, ammoCheckI
|
-- , ammoCheckI
|
||||||
, blCheck
|
-- , blCheck
|
||||||
]
|
-- ]
|
||||||
MultiGunMod ->
|
-- MultiGunMod ->
|
||||||
[ withRecoil
|
-- [ withRecoil
|
||||||
, withFlare
|
-- , withFlare
|
||||||
, duplicateLoadedBarrels
|
-- , duplicateLoadedBarrels
|
||||||
, withTorqueAfter
|
-- , withTorqueAfter
|
||||||
, useAllAmmo
|
-- , useAllAmmo
|
||||||
, withSoundItemChoiceStart caneStickSoundChoice
|
-- , withSoundItemChoiceStart caneStickSoundChoice
|
||||||
, useTimeCheck
|
-- , useTimeCheck
|
||||||
, ammoCheckI
|
-- , ammoCheckI
|
||||||
, blCheck
|
-- , blCheck
|
||||||
]
|
-- ]
|
||||||
-- AutoRifleMod ->
|
-- AutoRifleMod ->
|
||||||
-- -- note this is the same as BangCanemMod with the first changed
|
-- -- note this is the same as BangCanemMod with the first changed
|
||||||
-- [ withFlare
|
-- [ withFlare
|
||||||
@@ -785,21 +789,21 @@ useMod hm = case hm of
|
|||||||
-- , useTimeCheck
|
-- , useTimeCheck
|
||||||
-- , ammoCheckI
|
-- , ammoCheckI
|
||||||
-- ]
|
-- ]
|
||||||
BangConeMod ->
|
-- BangConeMod ->
|
||||||
[ withRandomItem coneRandItemParams
|
-- [ withRandomItem coneRandItemParams
|
||||||
, withRandomItemUpdate coneRandItemUpdate
|
-- , withRandomItemUpdate coneRandItemUpdate
|
||||||
, withRandomOffset
|
-- , withRandomOffset
|
||||||
, duplicateLoadedBarrels
|
-- , duplicateLoadedBarrels
|
||||||
, duplicateLoaded
|
-- , duplicateLoaded
|
||||||
, withMuzFlare
|
-- , withMuzFlare
|
||||||
, withRecoil
|
-- , withRecoil
|
||||||
, withTorqueAfter
|
-- , withTorqueAfter
|
||||||
, useAllAmmo
|
-- , useAllAmmo
|
||||||
, withSoundStart bangEchoS
|
-- , withSoundStart bangEchoS
|
||||||
, useTimeCheck
|
-- , useTimeCheck
|
||||||
, ammoCheckI
|
-- , ammoCheckI
|
||||||
, blCheck
|
-- , blCheck
|
||||||
]
|
-- ]
|
||||||
where
|
where
|
||||||
f = do
|
f = do
|
||||||
nzpres <- state $ randomR (3, 4)
|
nzpres <- state $ randomR (3, 4)
|
||||||
@@ -968,19 +972,17 @@ caneStickSoundChoice _ = tap3S
|
|||||||
bangStickSoundChoice :: Item -> SoundID
|
bangStickSoundChoice :: Item -> SoundID
|
||||||
bangStickSoundChoice = caneStickSoundChoice
|
bangStickSoundChoice = caneStickSoundChoice
|
||||||
|
|
||||||
coneRandItemUpdate :: State StdGen (Item -> Item)
|
|
||||||
coneRandItemUpdate = return id
|
|
||||||
-- do
|
-- do
|
||||||
-- wth <- state $ randomR (1, 5)
|
-- wth <- state $ randomR (1, 5)
|
||||||
-- return (itUse . heldConsumption . laAmmoType . amBullet . buWidth .~ wth)
|
-- return (itUse . heldConsumption . laAmmoType . amBullet . buWidth .~ wth)
|
||||||
|
|
||||||
coneRandItemParams :: State StdGen (Item -> Item)
|
--coneRandItemParams :: State StdGen (Item -> Item)
|
||||||
coneRandItemParams = do
|
--coneRandItemParams = do
|
||||||
muzv <- state $ randomR (0.5, 1)
|
-- muzv <- state $ randomR (0.5, 1)
|
||||||
rifl <- state $ randomR (0.3, 0.9)
|
-- rifl <- state $ randomR (0.3, 0.9)
|
||||||
return $ \it ->
|
-- return $ \it ->
|
||||||
it & itUse . heldParams . muzVel .~ muzv
|
-- it & itUse . heldParams . muzVel .~ muzv
|
||||||
& itUse . heldParams . rifling .~ rifl
|
-- & itUse . heldParams . rifling .~ rifl
|
||||||
|
|
||||||
mcShootLaser :: Item -> Machine -> World -> World
|
mcShootLaser :: Item -> Machine -> World -> World
|
||||||
mcShootLaser it mc = cWorld . lWorld . lasers .:~ lasRayAt (_lasColor $ _itParams it) dam phasev pos dir
|
mcShootLaser it mc = cWorld . lWorld . lasers .:~ lasRayAt (_lasColor $ _itParams it) dam phasev pos dir
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ import Dodge.Data.World
|
|||||||
import Dodge.Default.Item
|
import Dodge.Default.Item
|
||||||
import Dodge.Item.Weapon.Bullet
|
import Dodge.Item.Weapon.Bullet
|
||||||
|
|
||||||
|
megaTinMag :: Item
|
||||||
|
megaTinMag = tinMag
|
||||||
|
& itUse . amagLoadStatus . iaMax .~ 150000
|
||||||
|
& itUse . amagLoadStatus . iaLoaded .~ 150000
|
||||||
|
|
||||||
tinMag :: Item
|
tinMag :: Item
|
||||||
tinMag =
|
tinMag =
|
||||||
defaultHeldItem & itType . iyBase .~ AMMOMAG TINMAG
|
defaultHeldItem & itType . iyBase .~ AMMOMAG TINMAG
|
||||||
|
|||||||
@@ -168,7 +168,6 @@ heldItemSPic ht it = case ht of
|
|||||||
GRAPECANNON _ -> noPic $ bangConeShape 20
|
GRAPECANNON _ -> noPic $ bangConeShape 20
|
||||||
MINIGUNX i -> miniGunXPictItem i it
|
MINIGUNX i -> miniGunXPictItem i it
|
||||||
VOLLEYGUN i -> noPic $ volleyGunShape i -- <> addBullets it
|
VOLLEYGUN i -> noPic $ volleyGunShape i -- <> addBullets it
|
||||||
MULTIGUN i -> noPic $ volleyGunShape i -- <> addBullets it
|
|
||||||
RIFLE -> noPic $ baseRifleShape -- <> addBullets it
|
RIFLE -> noPic $ baseRifleShape -- <> addBullets it
|
||||||
-- REPEATER -> noPic $ baseRifleShape <> addTinClip it
|
-- REPEATER -> noPic $ baseRifleShape <> addTinClip it
|
||||||
AUTORIFLE -> noPic $ baseRifleShape <> addTinClip it
|
AUTORIFLE -> noPic $ baseRifleShape <> addTinClip it
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ itemFromHeldType ht = case ht of
|
|||||||
GRAPECANNON i -> grapeCannon i
|
GRAPECANNON i -> grapeCannon i
|
||||||
MINIGUNX i -> miniGunX i
|
MINIGUNX i -> miniGunX i
|
||||||
VOLLEYGUN i -> volleyGun i
|
VOLLEYGUN i -> volleyGun i
|
||||||
MULTIGUN i -> multiGun i
|
|
||||||
RIFLE -> rifle
|
RIFLE -> rifle
|
||||||
-- REPEATER -> repeater
|
-- REPEATER -> repeater
|
||||||
AUTORIFLE -> autoRifle
|
AUTORIFLE -> autoRifle
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
module Dodge.Item.Held.Cane (
|
module Dodge.Item.Held.Cane (
|
||||||
volleyGun,
|
volleyGun,
|
||||||
multiGun,
|
|
||||||
rifle,
|
rifle,
|
||||||
autoRifle,
|
autoRifle,
|
||||||
burstRifle,
|
burstRifle,
|
||||||
@@ -15,14 +14,15 @@ 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
|
||||||
|
|
||||||
defaultBangCane :: Item
|
defaultBangCane :: Item
|
||||||
defaultBangCane =
|
defaultBangCane =
|
||||||
defaultBulletWeapon
|
defaultBulletWeapon
|
||||||
& itUse . heldParams
|
& itUse . heldParams
|
||||||
.~ BulletShooterParams
|
.~ BulletShooterParams
|
||||||
{ _muzVel = 0.8
|
{ _muzVel = ConstFloat 0.8
|
||||||
, _rifling = 0.9
|
, _rifling = ConstFloat 0.9
|
||||||
, _recoil = 50
|
, _recoil = 50
|
||||||
, _torqueAfter = 0.1
|
, _torqueAfter = 0.1
|
||||||
, _randomOffset = 0
|
, _randomOffset = 0
|
||||||
@@ -45,25 +45,16 @@ volleyGun i =
|
|||||||
& itUse . heldAim . aimRange .~ 1
|
& itUse . heldAim . aimRange .~ 1
|
||||||
& itUse . heldAim . aimStance .~ TwoHandFlat
|
& itUse . heldAim . aimStance .~ TwoHandFlat
|
||||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
||||||
& itUse . heldAim . aimMuzzles .~
|
& itUse . heldAim . aimMuzzles .~ getZipList
|
||||||
take i ([Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3] <*> [0..] <*> repeat PistolFlare)
|
(ZipList [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 6]
|
||||||
|
<*> ZipList [0..i-1]
|
||||||
|
<*> pure PistolFlare
|
||||||
|
)
|
||||||
& itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
|
& itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
|
||||||
|
& itUse . heldParams . recoil .~ 10 + 5 * fromIntegral i
|
||||||
& itType . iyBase .~ HELD (VOLLEYGUN i)
|
& itType . iyBase .~ HELD (VOLLEYGUN i)
|
||||||
& itUse . heldAmmoTypes .~ IM.fromList (zip [0..i-1] $ repeat BulletAmmo)
|
& itUse . heldAmmoTypes .~ IM.fromList (zip [0..i-1] $ repeat BulletAmmo)
|
||||||
|
|
||||||
multiGun :: Int -> Item
|
|
||||||
multiGun i =
|
|
||||||
defaultBangCane
|
|
||||||
& itUse . heldMods .~ MultiGunMod
|
|
||||||
& itUse . heldAim . aimWeight .~ 6
|
|
||||||
& itUse . heldAim . aimRange .~ 1
|
|
||||||
& itUse . heldAim . aimStance .~ TwoHandFlat
|
|
||||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
|
||||||
& itUse . heldAim . aimMuzzles .~
|
|
||||||
([Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3] <*> [0..] <*> repeat DefaultFlareType)
|
|
||||||
& itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
|
|
||||||
& itType . iyBase .~ HELD (MULTIGUN i)
|
|
||||||
|
|
||||||
rifle :: Item
|
rifle :: Item
|
||||||
rifle =
|
rifle =
|
||||||
defaultBangCane
|
defaultBangCane
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ bangCone =
|
|||||||
& itDimension . dimRad .~ 8
|
& itDimension . dimRad .~ 8
|
||||||
& itDimension . dimCenter .~ V3 5 0 0
|
& itDimension . dimCenter .~ V3 5 0 0
|
||||||
& itUse . heldDelay . rateMax .~ 20
|
& itUse . heldDelay . rateMax .~ 20
|
||||||
& itUse . heldMods .~ BangConeMod
|
& itUse . heldMods .~ PistolMod
|
||||||
-- & itUse . heldAim . aimHandlePos .~ 5
|
-- & itUse . heldAim . aimHandlePos .~ 5
|
||||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.5 0 DefaultFlareType]
|
& itUse . heldAim . aimMuzzles .~ replicate 15 (Muzzle (V2 15 0) 0 0.5 0 DefaultFlareType)
|
||||||
& itUse . heldParams .~ BulletShooterParams
|
& itUse . heldParams .~ BulletShooterParams
|
||||||
{ _muzVel = 0.7
|
{ _muzVel = UniRandFloat 0.5 0.8
|
||||||
, _rifling = 0.8
|
, _rifling = UniRandFloat 0.3 0.9
|
||||||
, _recoil = 150
|
, _recoil = 150
|
||||||
, _torqueAfter = 0.1
|
, _torqueAfter = 0.1
|
||||||
, _randomOffset = 12
|
, _randomOffset = 12
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ bangRod =
|
|||||||
defaultBulletWeapon
|
defaultBulletWeapon
|
||||||
& itUse . heldParams
|
& itUse . heldParams
|
||||||
.~ BulletShooterParams
|
.~ BulletShooterParams
|
||||||
{ _muzVel = 0.8
|
{ _muzVel = ConstFloat 0.8
|
||||||
, _rifling = 1
|
, _rifling = ConstFloat 1
|
||||||
, _recoil = 50
|
, _recoil = 50
|
||||||
, _torqueAfter = 0.3
|
, _torqueAfter = 0.3
|
||||||
, _randomOffset = 0
|
, _randomOffset = 0
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ bangStick i =
|
|||||||
defaultBulletWeapon
|
defaultBulletWeapon
|
||||||
& itUse . heldParams
|
& itUse . heldParams
|
||||||
.~ BulletShooterParams
|
.~ BulletShooterParams
|
||||||
{ _muzVel = 0.8
|
{ _muzVel = ConstFloat 0.8
|
||||||
, _rifling = 0.8
|
, _rifling = ConstFloat 0.8
|
||||||
, _recoil = 25
|
, _recoil = 25
|
||||||
, _torqueAfter = 0.18 + 0.02 * fromIntegral i
|
, _torqueAfter = 0.18 + 0.02 * fromIntegral i
|
||||||
, _randomOffset = 0
|
, _randomOffset = 0
|
||||||
@@ -49,8 +49,8 @@ pistol =
|
|||||||
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy %~ const 0.05
|
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy %~ const 0.05
|
||||||
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType %~ const PistolFlare
|
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType %~ const PistolFlare
|
||||||
& itUse . heldParams
|
& itUse . heldParams
|
||||||
%~ ( (muzVel .~ 0.8)
|
%~ ( (muzVel .~ ConstFloat 0.8)
|
||||||
. (rifling .~ 0.8)
|
. (rifling .~ ConstFloat 0.8)
|
||||||
. (recoil .~ 10)
|
. (recoil .~ 10)
|
||||||
. (torqueAfter .~ 0.2)
|
. (torqueAfter .~ 0.2)
|
||||||
. (sidePush .~ 50)
|
. (sidePush .~ 50)
|
||||||
|
|||||||
@@ -71,8 +71,7 @@ heldInfo hit = case hit of
|
|||||||
GRAPECANNON 1 -> "A large container for debris on the end of a stick. Explosive action propels the debris away from the user."
|
GRAPECANNON 1 -> "A large container for debris on the end of a stick. Explosive action propels the debris away from the user."
|
||||||
GRAPECANNON i -> "An " ++ replicate (i -1) 'X' ++ "L container for debris on the end of a stick. Explosive action propels the debris away from the user."
|
GRAPECANNON i -> "An " ++ replicate (i -1) 'X' ++ "L container for debris on the end of a stick. Explosive action propels the debris away from the user."
|
||||||
MINIGUNX i -> over _head toUpper (showInt i) ++ " gun barrels that revolve rapidly around a central stick. Requires considerable time to warm up, but has an extremely rapid rate of fire. It is also extremely difficult to stabilise."
|
MINIGUNX i -> over _head toUpper (showInt i) ++ " gun barrels that revolve rapidly around a central stick. Requires considerable time to warm up, but has an extremely rapid rate of fire. It is also extremely difficult to stabilise."
|
||||||
VOLLEYGUN i -> over _head toUpper (showInt i) ++ " gun barrels lined up to be roughly parallel. Draws bullets from a single magazine. All loaded barrels discharge simultaneously."
|
VOLLEYGUN i -> over _head toUpper (showInt i) ++ " gun barrels lined up to be roughly parallel. Each barrel requires a separate magazine. All barrels must be loaded to fire."
|
||||||
MULTIGUN i -> over _head toUpper (showInt i) ++ " gun barrels lined up to be roughly parallel. Each barrel requires a separate magazine. All barrels must be loaded to fire."
|
|
||||||
RIFLE -> "A firearm with a mid length barrel that requires reloading after each shot."
|
RIFLE -> "A firearm with a mid length barrel that requires reloading after each shot."
|
||||||
-- REPEATER -> "A firearm fed by a magazine. The entire magazine must be replaced when reloading the weapon."
|
-- REPEATER -> "A firearm fed by a magazine. The entire magazine must be replaced when reloading the weapon."
|
||||||
AUTORIFLE -> "A firearm automatically fed by a magazine. The entire magazine must be replaced when reloading the weapon."
|
AUTORIFLE -> "A firearm automatically fed by a magazine. The entire magazine must be replaced when reloading the weapon."
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ heldBounds hit = case hit of
|
|||||||
GRAPECANNON _ -> bbs
|
GRAPECANNON _ -> bbs
|
||||||
MINIGUNX _ -> minis
|
MINIGUNX _ -> minis
|
||||||
VOLLEYGUN _ -> undefined
|
VOLLEYGUN _ -> undefined
|
||||||
MULTIGUN _ -> undefined
|
|
||||||
RIFLE -> rs
|
RIFLE -> rs
|
||||||
-- REPEATER -> rs
|
-- REPEATER -> rs
|
||||||
AUTORIFLE -> rs
|
AUTORIFLE -> rs
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ fixedCoordPictures u =
|
|||||||
<> drawConcurrentMessage u
|
<> drawConcurrentMessage u
|
||||||
<> customMouseCursor u
|
<> customMouseCursor u
|
||||||
<> toTopLeft cfig (translate (halfWidth cfig) 0 $ drawList (map text (_uvTestString u u)))
|
<> toTopLeft cfig (translate (halfWidth cfig) 0 $ drawList (map text (_uvTestString u u)))
|
||||||
|
<> toTopLeft cfig (translate (0.5 * halfWidth cfig) (- halfHeight cfig)
|
||||||
|
$ drawList (map text (u ^. uvWorld . cWorld . lWorld . lTestString)))
|
||||||
<> displayFrameTicks u
|
<> displayFrameTicks u
|
||||||
where
|
where
|
||||||
cfig = _uvConfig u
|
cfig = _uvConfig u
|
||||||
|
|||||||
Reference in New Issue
Block a user