Safe Haskell | None |
---|
Semantics of CmdSer
server commands.
A couple of them do not take time, the rest does.
Note that since the results are atomic commands, which are executed
only later (on the server and some of the clients), all condition
are checkd by the semantic functions in the context of the state
before the server command. Even if one or more atomic actions
are already issued by the point an expression is evaluated, they do not
influence the outcome of the evaluation.
TODO: document
- execFailure :: MonadAtomic m => FactionId -> Msg -> m Bool
- broadcastCmdAtomic :: MonadAtomic m => (FactionId -> CmdAtomic) -> m ()
- broadcastSfxAtomic :: MonadAtomic m => (FactionId -> SfxAtomic) -> m ()
- moveSer :: (MonadAtomic m, MonadServer m) => ActorId -> Vector -> Bool -> m Bool
- addSmell :: MonadAtomic m => ActorId -> m ()
- actorAttackActor :: (MonadAtomic m, MonadServer m) => ActorId -> ActorId -> m ()
- actorOpenDoor :: (MonadAtomic m, MonadServer m) => ActorId -> Vector -> Bool -> m Bool
- runSer :: (MonadAtomic m, MonadServer m) => ActorId -> Vector -> m Bool
- displaceActor :: MonadAtomic m => ActorId -> ActorId -> m ()
- waitSer :: MonadAtomic m => ActorId -> m ()
- pickupSer :: MonadAtomic m => ActorId -> ItemId -> Int -> InvChar -> m ()
- dropSer :: MonadAtomic m => ActorId -> ItemId -> m ()
- projectSer :: (MonadAtomic m, MonadServer m) => ActorId -> Point -> Int -> ItemId -> Container -> m Bool
- addProjectile :: (MonadAtomic m, MonadServer m) => ItemId -> Point -> LevelId -> FactionId -> [Point] -> Time -> m ActorId
- applySer :: (MonadAtomic m, MonadServer m) => ActorId -> ItemId -> Container -> m ()
- triggerSer :: (MonadAtomic m, MonadServer m) => ActorId -> Point -> m Bool
- setPathSer :: (MonadAtomic m, MonadServer m) => ActorId -> [Vector] -> m ()
- gameRestartSer :: (MonadAtomic m, MonadServer m) => ActorId -> Text -> m ()
- gameExitSer :: (MonadAtomic m, MonadServer m) => ActorId -> m ()
- gameSaveSer :: MonadServer m => m ()
- cfgDumpSer :: (MonadAtomic m, MonadServer m) => ActorId -> m ()
Documentation
execFailure :: MonadAtomic m => FactionId -> Msg -> m BoolSource
broadcastCmdAtomic :: MonadAtomic m => (FactionId -> CmdAtomic) -> m ()Source
broadcastSfxAtomic :: MonadAtomic m => (FactionId -> SfxAtomic) -> m ()Source
MoveSer
moveSer :: (MonadAtomic m, MonadServer m) => ActorId -> Vector -> Bool -> m BoolSource
Actor moves or attacks or searches or opens doors. Note that client can't determine which of these actions is chosen, because foes can be invisible, doors hidden, clients can move simultaneously during the same turn, etc. Also, only the server is authorized to check if a move is legal and it needs full context for that, e.g., the initial actor position to check if melee attack does not try to reach to a distant tile.
addSmell :: MonadAtomic m => ActorId -> m ()Source
Add a smell trace for the actor to the level. For now, all and only actors from non-spawning factions leave smell.
actorAttackActor :: (MonadAtomic m, MonadServer m) => ActorId -> ActorId -> m ()Source
Resolves the result of an actor moving into another. Actors on blocked positions can be attacked without any restrictions. For instance, an actor embedded in a wall can be attacked from an adjacent position. This function is analogous to projectGroupItem, but for melee and not using up the weapon.
actorOpenDoor :: (MonadAtomic m, MonadServer m) => ActorId -> Vector -> Bool -> m BoolSource
An actor opens a door.
RunSer
runSer :: (MonadAtomic m, MonadServer m) => ActorId -> Vector -> m BoolSource
Actor moves or swaps position with others or opens doors.
displaceActor :: MonadAtomic m => ActorId -> ActorId -> m ()Source
When an actor runs (not walks) into another, they switch positions.
WaitSer
waitSer :: MonadAtomic m => ActorId -> m ()Source
Update the wait/block count. Uses local, per-level time, to remain correct even if the level is frozen for some global time turns.
PickupSer
DropSer
dropSer :: MonadAtomic m => ActorId -> ItemId -> m ()Source
ProjectSer
:: (MonadAtomic m, MonadServer m) | |
=> ActorId | actor projecting the item (is on current lvl) |
-> Point | target position of the projectile |
-> Int | digital line parameter |
-> ItemId | the item to be projected |
-> Container | whether the items comes from floor or inventory |
-> m Bool |
addProjectile :: (MonadAtomic m, MonadServer m) => ItemId -> Point -> LevelId -> FactionId -> [Point] -> Time -> m ActorIdSource
Create a projectile actor containing the given missile.
ApplySer
:: (MonadAtomic m, MonadServer m) | |
=> ActorId | actor applying the item (is on current level) |
-> ItemId | the item to be applied |
-> Container | the location of the item |
-> m () |
TriggerSer
triggerSer :: (MonadAtomic m, MonadServer m) => ActorId -> Point -> m BoolSource
Perform the action specified for the tile in case it's triggered.
SetPathSer
setPathSer :: (MonadAtomic m, MonadServer m) => ActorId -> [Vector] -> m ()Source
GameRestart
gameRestartSer :: (MonadAtomic m, MonadServer m) => ActorId -> Text -> m ()Source
GameExit
gameExitSer :: (MonadAtomic m, MonadServer m) => ActorId -> m ()Source
GameSaveSer
gameSaveSer :: MonadServer m => m ()Source
CfgDumpSer
cfgDumpSer :: (MonadAtomic m, MonadServer m) => ActorId -> m ()Source