Safe Haskell | None |
---|---|
Language | Haskell2010 |
Semantics of abilities in terms of actions and the AI procedure for picking the best action for an actor.
- actionStrategy :: forall m. MonadClient m => ActorId -> Bool -> m (Strategy RequestAnyAbility)
- data ApplyItemGroup
- waitBlockNow :: MonadClient m => m (Strategy (RequestTimed AbWait))
- pickup :: MonadClient m => ActorId -> Bool -> m (Strategy (RequestTimed AbMoveItem))
- equipItems :: MonadClient m => ActorId -> m (Strategy (RequestTimed AbMoveItem))
- toShare :: EqpSlot -> Bool
- yieldUnneeded :: MonadClient m => ActorId -> m (Strategy (RequestTimed AbMoveItem))
- unEquipItems :: MonadClient m => ActorId -> m (Strategy (RequestTimed AbMoveItem))
- groupByEqpSlot :: [(ItemId, ItemFull)] -> EnumMap EqpSlot [(ItemId, ItemFull)]
- bestByEqpSlot :: DiscoveryBenefit -> [(ItemId, ItemFull)] -> [(ItemId, ItemFull)] -> [(ItemId, ItemFull)] -> [(EqpSlot, ([(Int, (ItemId, ItemFull))], [(Int, (ItemId, ItemFull))], [(Int, (ItemId, ItemFull))]))]
- harmful :: DiscoveryBenefit -> ItemId -> Bool
- meleeBlocker :: MonadClient m => ActorId -> m (Strategy (RequestTimed AbMelee))
- meleeAny :: MonadClient m => ActorId -> m (Strategy (RequestTimed AbMelee))
- trigger :: MonadClient m => ActorId -> FleeViaStairsOrEscape -> m (Strategy (RequestTimed AbAlter))
- projectItem :: MonadClient m => ActorId -> m (Strategy (RequestTimed AbProject))
- applyItem :: MonadClient m => ActorId -> ApplyItemGroup -> m (Strategy (RequestTimed AbApply))
- flee :: MonadClient m => ActorId -> [(Int, Point)] -> m (Strategy RequestAnyAbility)
- displaceFoe :: MonadClient m => ActorId -> m (Strategy RequestAnyAbility)
- displaceBlocker :: MonadClient m => ActorId -> Bool -> m (Strategy RequestAnyAbility)
- displaceTowards :: MonadClient m => ActorId -> Point -> Bool -> m (Strategy Vector)
- chase :: MonadClient m => ActorId -> Bool -> Bool -> m (Strategy RequestAnyAbility)
- moveTowards :: MonadClient m => ActorId -> Point -> Point -> Bool -> m (Strategy Vector)
- moveOrRunAid :: MonadClient m => ActorId -> Vector -> m (Maybe RequestAnyAbility)
Documentation
actionStrategy :: forall m. MonadClient m => ActorId -> Bool -> m (Strategy RequestAnyAbility) Source #
AI strategy based on actor's sight, smell, etc. Never empty.
Internal operations
data ApplyItemGroup Source #
waitBlockNow :: MonadClient m => m (Strategy (RequestTimed AbWait)) Source #
A strategy to always just wait.
pickup :: MonadClient m => ActorId -> Bool -> m (Strategy (RequestTimed AbMoveItem)) Source #
equipItems :: MonadClient m => ActorId -> m (Strategy (RequestTimed AbMoveItem)) Source #
yieldUnneeded :: MonadClient m => ActorId -> m (Strategy (RequestTimed AbMoveItem)) Source #
unEquipItems :: MonadClient m => ActorId -> m (Strategy (RequestTimed AbMoveItem)) Source #
bestByEqpSlot :: DiscoveryBenefit -> [(ItemId, ItemFull)] -> [(ItemId, ItemFull)] -> [(ItemId, ItemFull)] -> [(EqpSlot, ([(Int, (ItemId, ItemFull))], [(Int, (ItemId, ItemFull))], [(Int, (ItemId, ItemFull))]))] Source #
meleeBlocker :: MonadClient m => ActorId -> m (Strategy (RequestTimed AbMelee)) Source #
meleeAny :: MonadClient m => ActorId -> m (Strategy (RequestTimed AbMelee)) Source #
trigger :: MonadClient m => ActorId -> FleeViaStairsOrEscape -> m (Strategy (RequestTimed AbAlter)) Source #
The level the actor is on is either explored or the actor already has a weapon equipped, so no need to explore further, he tries to find enemies on other levels. We don't verify any embedded item is targeted by the actor, but at least the actor doesn't target a visible enemy at this point.
projectItem :: MonadClient m => ActorId -> m (Strategy (RequestTimed AbProject)) Source #
applyItem :: MonadClient m => ActorId -> ApplyItemGroup -> m (Strategy (RequestTimed AbApply)) Source #
flee :: MonadClient m => ActorId -> [(Int, Point)] -> m (Strategy RequestAnyAbility) Source #
displaceFoe :: MonadClient m => ActorId -> m (Strategy RequestAnyAbility) Source #
displaceBlocker :: MonadClient m => ActorId -> Bool -> m (Strategy RequestAnyAbility) Source #
displaceTowards :: MonadClient m => ActorId -> Point -> Bool -> m (Strategy Vector) Source #
chase :: MonadClient m => ActorId -> Bool -> Bool -> m (Strategy RequestAnyAbility) Source #
moveTowards :: MonadClient m => ActorId -> Point -> Point -> Bool -> m (Strategy Vector) Source #
moveOrRunAid :: MonadClient m => ActorId -> Vector -> m (Maybe RequestAnyAbility) Source #
Actor moves or searches or alters or attacks. This function is very general, even though it's often used in contexts when only one or two of the many cases can possibly occur.