Remove creature move type record

This commit is contained in:
2025-06-06 15:32:19 +01:00
parent e9b69be7de
commit 7292bc9012
16 changed files with 193 additions and 183 deletions
+4 -3
View File
@@ -13,6 +13,7 @@ module Dodge.Creature.Action (
youDropItem,
) where
import Dodge.Creature.MoveType
import Dodge.Creature.Radius
import Dodge.Item.BackgroundEffect
import Control.Applicative
@@ -49,7 +50,7 @@ performAimAt cr w tcid p = ([TurnToward tpos aimSp], Just $ AimAt tcid tpos)
cdir = _crDir cr
cpos = _crPos cr
canSee' = canSee (_crID cr) tcid w
aimSp = case cr ^? crMvType . mvAimSpeed of
aimSp = case crMvType cr ^? mvAimSpeed of
Just f -> doFloatFloat f $ safeAngleVV (unitVectorAtAngle cdir) (tpos - cpos)
Nothing -> error "creature without aiming type"
tpos
@@ -72,7 +73,7 @@ performPathTo cr w p
_ -> ([], Nothing)
where
cpos = _crPos cr
jit = _mvTurnJit $ _crMvType cr
jit = _mvTurnJit $ crMvType cr
performTurnToA :: Creature -> Point2 -> OutAction
performTurnToA cr p
@@ -82,7 +83,7 @@ performTurnToA cr p
cpos = _crPos cr
cdirv = unitVectorAtAngle (_crDir cr)
dirv = p -.- cpos
jit = _mvTurnJit $ _crMvType cr
jit = _mvTurnJit $ crMvType cr
{- | Performing an action on a frame creates an OutAction:
adds impulses and updates or deletes the action itself.