Modularise items
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
module Dodge.Item
|
||||
where
|
||||
|
||||
import Dodge.Data
|
||||
import Dodge.Base
|
||||
import Dodge.Default
|
||||
import Picture
|
||||
|
||||
keyToken :: Int -> Item
|
||||
keyToken n = defaultEquipment
|
||||
{ _itIdentity = Generic
|
||||
, _itName = "KEYTOKEN "++show n
|
||||
, _itMaxStack = 5
|
||||
, _itAmount = 1
|
||||
, _itFloorPict = setDepth 0.5 $ keyPic
|
||||
, _itEquipPict = \cr _ -> 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 = color green $
|
||||
pictures [translate (-4) 0 $ thickCircle 4 2
|
||||
,lineOfThickness 2 [(0,0),(8,0),(8,-4)]
|
||||
,lineOfThickness 2 [(4,0),(4,-4)]
|
||||
]
|
||||
|
||||
latchkey :: Int -> Item
|
||||
latchkey n = defaultEquipment
|
||||
{ _itIdentity = Generic
|
||||
, _itName = "KEY "++show n
|
||||
, _itMaxStack = 1
|
||||
, _itAmount = 1
|
||||
, _itFloorPict = setDepth 0.5 $ latchkeyPic
|
||||
, _itEquipPict = \cr _ -> 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 = color yellow $
|
||||
pictures [translate (-4) 0 $ thickCircle 4 2
|
||||
,lineOfThickness 2 [(0,0),(8,0),(8,-4)]
|
||||
,lineOfThickness 2 [(4,0),(4,-4)]
|
||||
]
|
||||
Reference in New Issue
Block a user