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

magShield :: Item
magShield = defaultEquipment
    { _itIdentity = MagShield
    , _itName = "MAGSHIELD"
    , _itMaxStack = 1
    , _itAmount = 1
    , _itFloorPict = (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
    , _itEquipPict = \_ _ -> (,) emptySH blank
    , _itID = Nothing
    }
flameShield :: Item 
flameShield = defaultEquipment
    { _itIdentity = FlameShield
    , _itName = "FLAMESHIELD"
    , _itMaxStack = 1
    , _itAmount = 1
    , _itFloorPict = (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
    , _itEquipPict = \cr _ -> (,) emptySH $ onLayer CrLayer $ pictures [color cyan $ circle (_crRad cr+2)]
    , _itID = Nothing
    }
{- | Slows you down, blocks forward projectiles. -}
frontArmour :: Item
frontArmour = defaultEquipment
    { _itIdentity = FrontArmour
    , _itName = "FARMOUR"
    , _itMaxStack = 1
    , _itAmount = 1
    , _itFloorPict = (,) emptySH $ onLayer FlItLayer $ translate 0 (-5) $ pictures 
        [color (greyN 0.1) $ thickArc 0        (pi/2) 10 5
        ,color (greyN 0.1) $ thickArc (3*pi/2) (2*pi) 10 5
        ]
    , _itEquipPict = \_ _ -> (,) emptySH $ onLayer CrLayer $ pictures 
        [color (greyN 0.1) $ thickArc 0        (pi/2) 10 5
        ,color (greyN 0.1) $ thickArc (3*pi/2) (2*pi) 10 5
        ]
    , _itEffect = NoItEffect
    , _itID = Nothing
    }
{- | Increases speed, reduces friction, cannot only move forwards. -}
jetPack :: Item
jetPack = defaultEquipment
    { _itIdentity = JetPack
    , _itName = "JETPACK"
    , _itMaxStack = 1
    , _itAmount = 1
    , _itFloorPict = (,) emptySH $ onLayer FlItLayer $ color yellow $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
    , _itEquipPict = \_ _ -> (,) emptySH $ onLayer CrLayer 
        $ pictures [color yellow $ polygon $ rectNSEW 5 (-5) (-3) (-11) ]
    , _itEffect = NoItEffect
    , _itID = Nothing
    }
