ActionPlan refactor

This commit is contained in:
2022-07-21 22:56:19 +01:00
parent 583027112d
commit dfc9b2dca9
9 changed files with 180 additions and 61 deletions
+7 -5
View File
@@ -741,6 +741,7 @@ data Action
{_actLabel :: String
,_actAction :: Action
}
| ActionNothing
| AimAt
{_targetID :: Int
,_targetSeenAt :: Point2
@@ -812,19 +813,19 @@ data Action
| NoAction
| StartSentinelPost
| UseTarget
{_useTarget :: Maybe Creature -> Action
{_useTarget :: MCrAc
}
| UseSelf
{_useSelf :: Creature -> Action
{_useSelf :: CrAc
}
| UseAheadPos
{_useAheadPos :: Point2 -> Action
{_useAheadPos :: P2Ac
}
| UseMvTargetPos
{_useMvTargetPos :: Maybe Point2 -> Action
{_useMvTargetPos :: MP2Ac
}
| ArbitraryAction
{ _arbitraryAction :: Creature -> World -> Action }
{ _arbitraryAction :: CrWdAc }
| DoImpulsesAlongside
-- ^ Repeatedly perform impulses alongside a main action until the main action terminates
{_sideImpulses :: [Impulse]
@@ -833,6 +834,7 @@ data Action
deriving (Generic)
instance Show Action where
show act = case act of
ActionNothing -> "ActionNothing"
LabelAction
{_actLabel = str
,_actAction = subAct