Add Read/Show instance for Creature

This commit is contained in:
2022-07-22 10:44:54 +01:00
parent 4c5218c633
commit 6b69fc1684
35 changed files with 345 additions and 225 deletions
+2 -1
View File
@@ -20,6 +20,7 @@ module Dodge.Creature.Action
, pickUpItemID
)
where
import Dodge.FloatFunction
import Dodge.Inventory.Add
import Dodge.CreatureEffect
--import Dodge.ShortShow
@@ -63,7 +64,7 @@ performAimAt cr w tcid p = ([TurnToward tpos aimSp], Just $ AimAt tcid tpos)
cpos = _crPos cr
canSee' = canSee (_crID cr) tcid w
aimSp = case cr ^? crMvType . mvAimSpeed of
Just f -> f $ safeAngleVV (unitVectorAtAngle cdir) (tpos - cpos)
Just f -> doFloatFloat f $ safeAngleVV (unitVectorAtAngle cdir) (tpos - cpos)
Nothing -> error "creature without aiming type"
tpos | canSee' = _crPos (_creatures w IM.! tcid)
| otherwise = p