246 lines
7.5 KiB
Haskell
246 lines
7.5 KiB
Haskell
module Dodge.Item.Weapon.BulletGun.Cane
|
|
( volleyGun
|
|
, repeater
|
|
, rifle
|
|
, autoRifle
|
|
, burstRifle
|
|
-- , completeBurstRifle
|
|
-- , fastBurstRifle
|
|
, miniGunX
|
|
) where
|
|
--import Dodge.Particle.Bullet.HitEffect
|
|
import Dodge.Reloading.Action
|
|
import Dodge.Data
|
|
--import Dodge.ChainEffect
|
|
import Dodge.Default.Weapon
|
|
import Dodge.Default
|
|
--import Dodge.Item.Attachment
|
|
--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.SoundLogic.LoadSound
|
|
import Picture
|
|
import Geometry
|
|
import Sound.Data
|
|
import LensHelp
|
|
|
|
defaultBangCane :: Item
|
|
defaultBangCane = defaultBulletWeapon
|
|
& itParams .~ BulletShooter
|
|
{ _muzVel = 0.8
|
|
, _rifling = 0.9
|
|
, _bore = 2
|
|
, _gunBarrels = SingleBarrel
|
|
{ _brlInaccuracy = 0.01
|
|
}
|
|
, _recoil = 50
|
|
, _torqueAfter = 0.1
|
|
, _randomOffset = 0
|
|
}
|
|
& itDimension . dimRad .~ 8
|
|
& itDimension . dimCenter .~ V3 5 0 0
|
|
& 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
|
|
& itUse . useAim . aimHandlePos .~ 5
|
|
& itUse . useAim . aimMuzPos .~ 15
|
|
& itType . iyBase .~ error "undefined bangCane baseitemtype"
|
|
& itConsumption . laMax .~ 1
|
|
& itConsumption . laCycle .~ [loadPartialInsert 10 1]
|
|
volleyGun :: Int -> Item
|
|
volleyGun i = defaultBangCane
|
|
& itUse . useDelay . rateMax .~ 6
|
|
& itUse . useMods .~
|
|
[ ammoHammerCheck
|
|
, useTimeCheck
|
|
, withSoundItemChoiceStart caneStickSoundChoice
|
|
, useAllAmmo
|
|
, withTorqueAfter
|
|
, duplicateLoadedBarrels
|
|
, applyInaccuracy
|
|
, withMuzFlareI
|
|
, withRecoil
|
|
]
|
|
& itUse . useAim . aimWeight .~ 6
|
|
& itUse . useAim . aimRange .~ 1
|
|
& itUse . useAim . aimStance .~ TwoHandFlat
|
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
|
& itUse . useAim . aimHandlePos .~ 5
|
|
& itUse . useAim . aimMuzPos .~ 15
|
|
& itConsumption . laMax .~ i
|
|
& itParams .~ BulletShooter
|
|
{ _muzVel = 0.8
|
|
, _rifling = 0.9
|
|
, _bore = 2
|
|
, _gunBarrels = SingleBarrel
|
|
{ _brlInaccuracy = 0.01
|
|
}
|
|
, _recoil = 50
|
|
, _torqueAfter = 0.1
|
|
, _randomOffset = 0
|
|
}
|
|
& itParams . gunBarrels .~ MultiBarrel
|
|
{_brlSpread = AlignedBarrels
|
|
,_brlNum = i
|
|
,_brlInaccuracy = 0.1
|
|
}
|
|
& itParams . torqueAfter .~ 0.48 + 0.2 * fromIntegral i
|
|
& itType . iyBase .~ HELD (VOLLEYGUN i)
|
|
caneStickSoundChoice :: Item -> SoundID
|
|
caneStickSoundChoice it
|
|
| _laLoaded (_itConsumption it) < 2 = tap3S
|
|
| otherwise = shotgunS
|
|
rifle :: Item
|
|
rifle = defaultBangCane
|
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
|
& itType . iyBase .~ HELD RIFLE
|
|
& itConsumption . laMax .~ 1
|
|
& itConsumption . laCycle .~ [loadEject 5, loadInsert 5 ,loadPrime 5]
|
|
& itUse . useAim . aimWeight .~ 6
|
|
& itUse . useAim . aimRange .~ 1
|
|
-- & itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 2}
|
|
& itType . iyModules . at ModHeldAttach ?~ EMPTYMODULE
|
|
repeater :: Item
|
|
repeater = rifle
|
|
& itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
|
|
& itType . iyBase .~ HELD REPEATER
|
|
& itConsumption . laCycle .~ [loadEject 50, loadInsert 40 ,loadPrime 20]
|
|
& itConsumption . laMax .~ 15
|
|
|
|
|
|
autoRifle :: Item
|
|
autoRifle = repeater
|
|
& itType . iyBase .~ HELD AUTORIFLE
|
|
& itUse . useMods %~ ((ammoCheckI :) . tail)
|
|
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
|
|
-- & itUse . useDelay . rateMax .~ 6
|
|
burstRifle :: Item
|
|
burstRifle = repeater
|
|
& itType . iyBase .~ HELD BURSTRIFLE
|
|
& itParams . gunBarrels . brlInaccuracy .~ 0.05
|
|
& itUse . useDelay . rateMax .~ 18
|
|
& itUse . useMods .~
|
|
[ ammoHammerCheck
|
|
, useTimeCheck
|
|
, sideEffectOnFrame 7 (torqueSideEffect 0.2)
|
|
, lockInvFor 7
|
|
, \f it -> repeatOnFrames (take (_laLoaded (_itConsumption it) - 1) [3,6]) f it
|
|
, withSoundStart tap3S
|
|
, useAmmoAmount 1
|
|
, applyInaccuracy
|
|
, withMuzFlareI
|
|
, withRecoil
|
|
]
|
|
--fastBurstRifle :: Item
|
|
--fastBurstRifle = repeater
|
|
-- & itType . iyBase .~ FASTBURSTRIFLE
|
|
-- & itParams . gunBarrels . brlInaccuracy .~ 0.06
|
|
-- & itUse . useDelay . rateMax .~ 18
|
|
-- & itUse . useMods .~
|
|
-- [ ammoHammerCheck
|
|
-- , useTimeCheck
|
|
-- , sideEffectOnFrame 9 (torqueSideEffect 0.4)
|
|
-- , lockInvFor 9
|
|
-- , \f it -> repeatOnFrames (take (_laLoaded (_itConsumption it) - 1) [2,4,6,8]) f it
|
|
-- , withSoundStart tap3S
|
|
-- , useAmmoAmount 1
|
|
-- , applyInaccuracy
|
|
-- , withMuzFlareI
|
|
-- , withRecoil
|
|
-- ]
|
|
--completeBurstRifle :: Item
|
|
--completeBurstRifle = repeater
|
|
-- & itType . iyBase .~ COMPLETEBURSTRIFLE
|
|
-- & itType . iyModules . at ModRifleMag .~ Nothing
|
|
-- & itParams . gunBarrels . brlInaccuracy .~ 0.1
|
|
-- & itUse . useDelay . rateMax .~ 28
|
|
-- & itUse . useMods .~
|
|
-- [ ammoHammerCheck
|
|
-- , useTimeCheck
|
|
-- , sideEffectOnFrame 15 (torqueSideEffect 0.8)
|
|
-- , lockInvFor 15
|
|
-- , \f it -> repeatOnFrames (take (_laLoaded (_itConsumption it) - 1) [1..14]) f it
|
|
-- , withSoundStart tap3S
|
|
-- , useAmmoAmount 1
|
|
-- , applyInaccuracy
|
|
-- , withMuzFlareI
|
|
-- , withRecoil
|
|
-- ]
|
|
miniGunUse :: Int -> ItemUse
|
|
miniGunUse i = defaultrUse
|
|
& rUse .~ useAmmoParams (Just 1)
|
|
& useDelay .~ NoDelay
|
|
& useMods .~
|
|
[ ammoCheckI
|
|
, withWarmUp crankSlowS
|
|
, withSoundForI mini1S 2
|
|
--, withThinSmokeI
|
|
, withSmoke 1 black 20 200 5
|
|
, withMuzFlareI
|
|
, useAmmoAmount i
|
|
] <>
|
|
concat [
|
|
[ withSidePushI 50
|
|
, torqueBefore 0.05
|
|
, afterRecoil recoilAmount
|
|
, withRandomOffset
|
|
, withOldDir x
|
|
, trigDoAlso (useAmmoParams $ Just x)
|
|
] | x <- map ((/fromIntegral i) . fromIntegral) [1..i-1]
|
|
]
|
|
<>
|
|
[ withSidePushI 50
|
|
, afterRecoil recoilAmount
|
|
, withRandomOffset
|
|
]
|
|
where
|
|
recoilAmount = 5
|
|
|
|
miniGunX :: Int -> Item
|
|
miniGunX i = defaultAutoGun
|
|
{ _itConsumption = defaultBulletLoadable
|
|
{ _laMax = 1500
|
|
, _laLoaded = 1500
|
|
}
|
|
& laCycle .~ [loadEject 40, loadInsert 40 ,loadPrime 40]
|
|
, _itUse = miniGunUse i
|
|
& useDelay .~ WarmUpNoDelay {_warmTime = 0,_warmMax = 100}
|
|
& useAim . aimWeight .~ 6
|
|
& useAim . aimRange .~ 1
|
|
& useAim . aimStance .~ TwoHandTwist
|
|
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
|
-- , _itFloorPict = miniGunPictItem
|
|
, _itParams = BulletShooter
|
|
{ _muzVel = 1
|
|
, _rifling = 0.9
|
|
, _bore = 2
|
|
, _gunBarrels = MultiBarrel
|
|
{_brlSpread = RotatingBarrels 0.01
|
|
,_brlNum = i
|
|
,_brlInaccuracy = 0
|
|
}
|
|
, _recoil = 10
|
|
, _torqueAfter = 0
|
|
, _randomOffset = 10
|
|
}
|
|
, _itInvSize = 4
|
|
}
|
|
& itDimension . dimRad .~ 20
|
|
& itDimension . dimCenter .~ V3 5 0 0
|
|
& itDimension . dimAttachPos .~ V3 5 (-5) 0
|
|
& itType . iyBase .~ HELD (MINIGUNX i)
|
|
& itUse . useAim . aimMuzPos .~ 40
|