Safe Haskell | None |
---|
- actorAssocs :: (FactionId -> Bool) -> LevelId -> State -> [(ActorId, Actor)]
- actorList :: (FactionId -> Bool) -> LevelId -> State -> [Actor]
- actorNotProjAssocs :: (FactionId -> Bool) -> LevelId -> State -> [(ActorId, Actor)]
- actorNotProjList :: (FactionId -> Bool) -> LevelId -> State -> [Actor]
- calculateTotal :: Actor -> State -> (ItemBag, Int)
- nearbyFreePoints :: Ops TileKind -> (Id TileKind -> Bool) -> Point -> LevelId -> State -> [Point]
- whereTo :: LevelId -> Point -> Int -> State -> (LevelId, Point)
- posToActor :: Point -> LevelId -> State -> Maybe ActorId
- getItemBody :: ItemId -> State -> Item
- memActor :: ActorId -> LevelId -> State -> Bool
- getActorBody :: ActorId -> State -> Actor
- updateActorBody :: ActorId -> (Actor -> Actor) -> State -> State
- getActorItem :: ActorId -> State -> [(ItemId, Item)]
- getActorBag :: ActorId -> State -> ItemBag
- actorContainer :: ActorId -> ItemInv -> ItemId -> Container
- getActorInv :: ActorId -> State -> ItemInv
- tryFindHeroK :: State -> FactionId -> Int -> Maybe (ActorId, Actor)
- foesAdjacent :: X -> Y -> Point -> [Actor] -> Bool
Documentation
calculateTotal :: Actor -> State -> (ItemBag, Int)
Calculate loot's worth for heroes on the current level.
Warning: scores are shown during the game, so when the server calculates then, we should be careful not to leak secret information (e.g., the nature of the items through the total worth of inventory).
:: LevelId | level of the stairs |
-> Point | position of the stairs |
-> Int | jump up this many levels |
-> State | game state |
-> (LevelId, Point) | target level and the position of its receiving stairs |
Compute the level identifier and starting position on the level, after a level change.
posToActor :: Point -> LevelId -> State -> Maybe ActorId
Finds an actor at a position on the current level. Perception irrelevant.
getItemBody :: ItemId -> State -> Item
memActor :: ActorId -> LevelId -> State -> Bool
Checks if the actor is present on the current level. The order of argument here and in other functions is set to allow
b <- getsState (memActor a)
getActorBody :: ActorId -> State -> Actor
Gets actor body from the current level. Error if not found.
getActorItem :: ActorId -> State -> [(ItemId, Item)]
Gets actor's items from the current level. Warning: this does not work for viewing items of actors from remote level.
getActorBag :: ActorId -> State -> ItemBag
actorContainer :: ActorId -> ItemInv -> ItemId -> Container
getActorInv :: ActorId -> State -> ItemInv