Refactor creature ai
This commit is contained in:
+18
-3
@@ -2,17 +2,32 @@ module Dodge.Item.Draw
|
||||
where
|
||||
import Dodge.Data
|
||||
import Dodge.Picture.Layer
|
||||
import Dodge.Creature.Stance.Data
|
||||
import Picture
|
||||
{- |
|
||||
Places an item picture onto a creature when the item is selected. -}
|
||||
drawWeapon
|
||||
pictureWeaponOnAim
|
||||
:: Picture
|
||||
-> Creature
|
||||
-> Int -- ^ Position of item in inventory
|
||||
-> Picture
|
||||
drawWeapon p cr posInInv
|
||||
pictureWeaponOnAim p cr posInInv
|
||||
| _crInvSel cr == posInInv && _posture (_crStance cr) == Aiming
|
||||
= onLayer PtLayer drawnWep
|
||||
| _crInvSel cr == posInInv
|
||||
= onLayer PtLayer holsteredWep
|
||||
| otherwise = blank
|
||||
where
|
||||
drawnWep = uncurry translate (_crRad cr,0) p
|
||||
holsteredWep = uncurry translate (_crRad cr,0) (scale 0.1 1 p)
|
||||
|
||||
pictureItem
|
||||
:: Picture
|
||||
-> Creature
|
||||
-> Int -- ^ Position of item in inventory
|
||||
-> Picture
|
||||
pictureItem p cr posInInv
|
||||
| _crInvSel cr == posInInv = onLayer PtLayer drawnWep
|
||||
| otherwise = blank
|
||||
where
|
||||
drawnWep = uncurry translate (_crRad cr,0) p
|
||||
|
||||
|
||||
Reference in New Issue
Block a user