module Dodge.Item.Weapon.AutoGun
    where
import Dodge.Data
import Dodge.Default.Weapon
import Dodge.Default
import Dodge.Item.Attachment
import Dodge.Item.Attachment.Data
import Dodge.Item.Weapon.ExtraEffect
import Dodge.Item.Weapon.InventoryDisplay
import Dodge.Item.Weapon.AmmoParams
import Dodge.Item.Data
import Dodge.Item.Draw
import Dodge.Item.Weapon.Bullet
import Dodge.Item.Weapon.TriggerType
import Dodge.SoundLogic.LoadSound
import Picture
import Geometry
import ShapePicture
import Shape

import qualified Data.Sequence as Seq

autoGun :: Item
autoGun = defaultAutoGun 
    { _itName = "AUTOGUN"
    , _itIdentity = AutoGun
    , _wpMaxAmmo = 30
    , _wpLoadedAmmo = 30
    , _wpReloadTime = 80
    , _wpReloadState = 0
    , _itUseRate = 5
    , _itUseTime = 0
    , _itUse   = useAmmoParams
    , _itUseModifiers =
        [ ammoCheckI
        , charFiringStratI
            [('S', hammerCheckI)
            ]
        , useTimeCheckI
        , charFiringStratI
            [('M', torqueBefore 0.08) 
            ,('S', torqueBefore 0.05) 
            ]
        , withSoundForI autoBS 5
        , useAmmo 1
        , withRandomDirI (autogunSpread/2)
        , withMuzFlareI
        , withSmoke 1 black 20 200 5
        ]
    , _wpSpread = autogunSpread
    , _wpRange = 20
    , _itHammer = HammerUp
    , _itFloorPict = autoGunPic
    , _itAimingSpeed = 0.4
    , _itAimingRange = 1
    , _itZoom = defaultItZoom 
    , _itAimZoom = defaultItZoom {_itZoomFac = 1.5}
    , _itEquipPict = pictureWeaponOnAim autoGunPic
    , _itEffect = wpRecock
    , _itAttachment = ItCharMode $ Seq.fromList "MS"
    , _itScroll   = scrollCharMode
    , _itInvDisplay = basicWeaponDisplay
    , _wpAmmo = basicBullet    
    }
autoGunPic :: SPic
autoGunPic =
    ( colorSH red $ upperPrismPoly 5 $ rectNESW 4 12 (-4) (-12)
    , mempty
    )

autogunSpread :: Float
autogunSpread = 0.07

