module Dodge.Item
  where
import Dodge.Data
import Dodge.Default
import Dodge.Picture
import Picture
import Geometry.Data
--import ShapePicture
import Shape

keyToken :: Int -> Item
keyToken n = defaultEquipment
    { _itIdentity = Generic
    , _itName = "KEYTOKEN "++show n
    , _itMaxStack = 5
    , _itAmount = 1
    , _itFloorPict = \_ -> (,) emptySH $ setDepth 0.5 keyPic
    , _itEquipPict = \_ _ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) keyPic
    , _itEffect = NoItEffect
    , _itHammer = HammerUp
    , _itID = Nothing
    , _itAimingSpeed = 1
    , _itAimingRange = 0
    , _itZoom = defaultItZoom
    , _itInvColor = yellow
    , _itInvDisplay = _itName
    }
keyPic :: Picture
keyPic = color green $
              pictures [translate (-4) 0 $ thickCircle 4 2
                       ,lineOfThickness 2 $ map toV2 [(0,0),(8,0),(8,-4)]
                       ,lineOfThickness 2 $ map toV2 [(4,0),(4,-4)]
                       ]

latchkey :: Int -> Item
latchkey n = defaultEquipment
    { _itIdentity = Generic
    , _itName = "KEY "++show n
    , _itMaxStack = 1
    , _itAmount = 1
    , _itFloorPict = \_ -> (,) emptySH $ setDepth 0.5 latchkeyPic
    , _itEquipPict = \_ _ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) latchkeyPic
    , _itEffect = NoItEffect
    , _itHammer = HammerUp
    , _itID = Nothing
    , _itAimingSpeed = 1
    , _itAimingRange = 0
    , _itZoom = defaultItZoom
    , _itInvColor = yellow
    , _itInvDisplay = _itName
    }
latchkeyPic :: Picture
latchkeyPic = color yellow $
              pictures [translate (-4) 0 $ thickCircle 4 2
                       ,lineOfThickness 2 $ map toV2 [(0,0),(8,0),(8,-4)]
                       ,lineOfThickness 2 $ map toV2 [(4,0),(4,-4)]
                       ]
