module Dodge.Default.Weapon
    where
import Dodge.Data
import Dodge.Item.Weapon.ExtraEffect
import Dodge.Item.Weapon.InventoryDisplay
import Dodge.Item.Draw
import Picture
import ShapePicture
import Shape
import Geometry.Vector3D
import Geometry

defaultGun :: Item
defaultGun = Weapon 
    { _itName = "default"
    , _itCurseStatus = Uncursed
    , _itIdentity = Pistol
    , _wpMaxAmmo = 15
    , _wpLoadedAmmo = 15
    , _wpAmmo = GenericAmmo
    , _wpReloadTime = 40
    , _wpReloadState = 0
    , _wpReloadType = ActiveReload
    , _wpMaxWarmUp = 0
    , _wpCurWarmUp = 0
    , _wpMaxCoolDown = 0
    , _wpCurCoolDown = 0
    , _itUseRate = 8
    , _itUseTime = 0
    , _itUse = \_ _ -> id
    , _itUseModifiers = []
    , _itLeftClickUse = Nothing
    , _wpSpread = 0.02
    , _wpRange = 20
    , _itHammer = HammerUp
    , _itFloorPict = const $ noPic $ colorSH green (prismPoly 
        (map (addZ 3) $ rectNESW 3 3 (-3) (-3))
        (map (addZ 0) $ rectNESW 5 3 (-5) (-7))
        )
    , _itAimingSpeed = 1
    , _itAimingRange = 0
    , _itZoom    = ItZoom 20 0.2 1
    , _itAimZoom = ItZoom 20 0.2 1
    , _itEquipPict = pictureWeaponOnAim
    , _itScroll = \_ _ -> id
    , _itAttachment = NoItAttachment
    , _itID = Nothing
    , _itEffect = wpRecock
    , _itInvDisplay = basicWeaponDisplay
    , _itInvColor = white
    , _itTargeting = Nothing
    , _itWorldTrigger = Nothing
    , _itAimStance = OneHand
    , _wpNumBarrels = 1
    , _itDimension = defaultItemDimension
    }
defaultItemDimension :: ItemDimension
defaultItemDimension = ItemDimension
    { _itDim = V3 4 4 4
    , _itRad = 10
    , _itHandle = V3 2 2 2
    , _itCenter = V3 2 2 2
    , _muzzleLength = 5 -- how much the item projects out from the cr radius when aiming
    }

defaultAutoGun :: Item
defaultAutoGun = defaultGun 
    { _itInvDisplay = basicWeaponDisplay
    , _itAimStance = TwoHandTwist
    }
defaultShellAmmo :: Ammo
defaultShellAmmo = ShellAmmo
    { _amPayload = const id
    , _amString = "Shell"
    , _amPjParams = []
    , _amPjDraw = const mempty
    , _amParamSel = 0
    }
