117 lines
4.1 KiB
Haskell
117 lines
4.1 KiB
Haskell
module Dodge.Item.Held.Cane (
|
|
volleyGun,
|
|
alteRifle,
|
|
rifle,
|
|
autoRifle,
|
|
burstRifle,
|
|
miniGunX,
|
|
) where
|
|
|
|
import Dodge.SoundLogic.ExternallyGeneratedSounds
|
|
import Dodge.Base
|
|
import Dodge.Data.Item
|
|
import Dodge.Default
|
|
import qualified Data.IntMap.Strict as IM
|
|
--import Dodge.Reloading.Action
|
|
import Geometry.Data
|
|
import LensHelp
|
|
import Control.Applicative
|
|
|
|
defaultBangCane :: Item
|
|
defaultBangCane =
|
|
defaultBulletWeapon
|
|
& itUse . heldParams . rifling .~ ConstFloat 0.9
|
|
& itUse . heldParams . recoil .~ 50
|
|
& itUse . heldParams . torqueAfter .~ 0.1
|
|
& itUse . heldDelay . rateMax .~ 6
|
|
-- & itUse . heldMods .~ BangCaneMod
|
|
& itUse . heldAim . aimStance .~ OneHand
|
|
-- & itUse . heldAim . aimHandlePos .~ 5
|
|
|
|
volleyGun :: Int -> Item
|
|
volleyGun i =
|
|
defaultBangCane
|
|
-- & itUse . heldMods .~ VolleyGunMod
|
|
& itUse . heldAim . aimWeight .~ 6
|
|
& itUse . heldAim . aimRange .~ 1
|
|
& itUse . heldAim . aimStance .~ TwoHandFlat
|
|
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
|
& itUse . heldAim . aimMuzzles .~ 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]
|
|
)
|
|
& itUse . heldParams . weaponInvLock .~ i + 1
|
|
& itUse . heldParams . torqueAfter .~ 0.1
|
|
& itUse . heldParams . recoil .~ 30
|
|
& itType .~ HELD (VOLLEYGUN i)
|
|
& itAmmoSlots .~ IM.fromList (zip [0..i-1] $ repeat BulletAmmo)
|
|
& itUse . heldParams . weaponRepeat .~ [1..i-1]
|
|
& itUse . heldUseEffect .~ RandomiseMuzzleFrames i
|
|
|
|
rifle :: Item
|
|
rifle =
|
|
defaultBangCane
|
|
& itUse . heldAim . aimStance .~ TwoHandUnder
|
|
& itType .~ HELD RIFLE
|
|
& itUse . heldAim . aimWeight .~ 6
|
|
& itUse . heldAim . aimRange .~ 1
|
|
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
|
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 25 0
|
|
|
|
alteRifle :: Item
|
|
alteRifle = rifle
|
|
& itType .~ HELD ALTERIFLE
|
|
& itUse . heldUseEffect .~ SwitchAlteRifle
|
|
& itAmmoSlots .~ IM.fromList (zip [0..1] $ repeat BulletAmmo)
|
|
|
|
--repeater :: Item
|
|
--repeater =
|
|
-- rifle
|
|
-- & itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
|
|
-- & itType . iyBase .~ HELD REPEATER
|
|
|
|
autoRifle :: Item
|
|
autoRifle =
|
|
rifle
|
|
& itType .~ HELD AUTORIFLE
|
|
& itUse . heldTriggerType .~ AutoTrigger
|
|
|
|
burstRifle :: Item
|
|
burstRifle =
|
|
rifle
|
|
& itType .~ HELD BURSTRIFLE
|
|
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0.05
|
|
& itUse . heldDelay . rateMax .~ 6
|
|
& itUse . heldParams . weaponInvLock .~ 7
|
|
& itUse . heldParams . weaponRepeat .~ [3,6]
|
|
& itUse . heldAim . aimMuzzles %~ doreplicate
|
|
where
|
|
doreplicate (x:_) = [x,x & mzFrame .~ 3,x & mzFrame .~ 6]
|
|
doreplicate [] = error "tried to replicate non-existing burstRifle muzzle"
|
|
|
|
miniGunX :: Int -> Item
|
|
miniGunX i =
|
|
autoRifle
|
|
& itUse . heldDelay .~ WarmUpNoDelay{_warmTime = 0, _warmMax = 100, _warmSound = crankSlowS}
|
|
& itUse . heldAim . aimWeight .~ 6
|
|
& itUse . heldAim . aimRange .~ 1
|
|
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
|
& itAmmoSlots .~ singleAmmo BeltBulletAmmo
|
|
& itUse . heldParams . bulGunSound ?~ (mini1S,2)
|
|
& itUse . heldAim . aimTurnSpeed .~ 0.5
|
|
& itUse . heldAim . aimMuzzles
|
|
.~ replicate i
|
|
(Muzzle (V2 30 0) 0 0.05 0 MiniGunFlare MuzzleShootBullet (UseExactly 1) 0)
|
|
& itUse . heldParams . recoil .~ 10 * fromIntegral i
|
|
& itUse . heldParams . torqueAfter .~ 0.04 + 0.02 * fromIntegral i
|
|
& itUse . heldParams . sidePush .~ 10 * fromIntegral i
|
|
& itUse . heldParams . randomOffset .~ 10
|
|
& itUse . heldParams . rifling .~ UniRandFloat 0.8 0.9
|
|
& itType .~ HELD (MINIGUNX i)
|
|
& itEffect . ieInv .~ ItemReduceWarmTime
|
|
& itEffect . ieOnDrop .~ ItemSetWarmTime 0
|