Safe Haskell | None |
---|
Effect semantics. TODO: document
- itemEffect :: (MonadAtomic m, MonadServer m) => ActorId -> ActorId -> Maybe ItemId -> Item -> m ()
- effectSem :: (MonadAtomic m, MonadServer m) => Effect Int -> ActorId -> ActorId -> m Bool
- createItems :: (MonadAtomic m, MonadServer m) => Int -> Point -> LevelId -> m ()
- addHero :: (MonadAtomic m, MonadServer m) => FactionId -> Point -> LevelId -> [(Int, Text)] -> Maybe Int -> Time -> m ActorId
- spawnMonsters :: (MonadAtomic m, MonadServer m) => [Point] -> LevelId -> Time -> FactionId -> m ()
- pickFaction :: MonadServer m => Text -> ((FactionId, Faction) -> Bool) -> m (Maybe FactionId)
- electLeader :: MonadAtomic m => FactionId -> LevelId -> ActorId -> m ()
- deduceKilled :: (MonadAtomic m, MonadServer m) => Actor -> m ()
Documentation
itemEffect :: (MonadAtomic m, MonadServer m) => ActorId -> ActorId -> Maybe ItemId -> Item -> m ()Source
The source actor affects the target actor, with a given item.
If the event is seen, the item may get identified. This function
is mutually recursive with effect
and so it's a part of Effect
semantics.
effectSem :: (MonadAtomic m, MonadServer m) => Effect Int -> ActorId -> ActorId -> m BoolSource
The source actor affects the target actor, with a given effect and power. Both actors are on the current level and can be the same actor. The boolean result indicates if the effect was spectacular enough for the actors to identify it (and the item that caused it, if any).
Assorted operations
createItems :: (MonadAtomic m, MonadServer m) => Int -> Point -> LevelId -> m ()Source
addHero :: (MonadAtomic m, MonadServer m) => FactionId -> Point -> LevelId -> [(Int, Text)] -> Maybe Int -> Time -> m ActorIdSource
Create a new hero on the current level, close to the given position.
spawnMonsters :: (MonadAtomic m, MonadServer m) => [Point] -> LevelId -> Time -> FactionId -> m ()Source
Spawn monsters of any spawn or summon faction, friendly or not. To be used for spontaneous spawning of monsters and for the summon effect.
pickFaction :: MonadServer m => Text -> ((FactionId, Faction) -> Bool) -> m (Maybe FactionId)Source
Roll a faction based on faction kind frequency key.
electLeader :: MonadAtomic m => FactionId -> LevelId -> ActorId -> m ()Source
deduceKilled :: (MonadAtomic m, MonadServer m) => Actor -> m ()Source