Refactor creature ai

This commit is contained in:
2021-05-20 21:25:42 +02:00
parent 4463dc7716
commit 114335fdbe
32 changed files with 449 additions and 270 deletions
+18 -3
View File
@@ -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