LambdaHack-0.8.3.0: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Server.HandleEffectM

Contents

Description

Handle effects. They are most often caused by requests sent by clients but sometimes also caused by projectiles or periodically activated items.

Synopsis

Documentation

dropCStoreItem :: MonadServerAtomic m => Bool -> CStore -> ActorId -> Actor -> Int -> ItemId -> ItemQuant -> m () #

Drop a single actor's item. Note that if there are multiple copies, at most one explodes to avoid excessive carnage and UI clutter (let's say, the multiple explosions interfere with each other or perhaps larger quantities of explosives tend to be packaged more safely).

Internal operations

itemEffectDisco :: MonadServerAtomic m => ActorId -> ActorId -> ItemId -> ItemKind -> Container -> Bool -> Bool -> [Effect] -> m UseResult #

The source actor affects the target actor, with a given item. If any of the effects fires up, the item gets identified. Note that using raw damage (beating the enemy with the magic wand, for example) does not identify the item.

Note that if we activate a durable item, e.g., armor, from the ground, it will get identified, which is perfectly fine, until we want to add sticky armor that can't be easily taken off (and, e.g., has some maluses).

effectSem :: MonadServerAtomic m => ActorId -> ActorId -> ItemId -> Container -> Bool -> Bool -> Effect -> m UseResult #

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 item may or may not still be in the container. The boolean result indicates if the effect actually fired up, as opposed to fizzled.

effectEscape :: MonadServerAtomic m => ActorId -> ActorId -> m UseResult #

The faction leaves the dungeon.

effectParalyze :: MonadServerAtomic m => m () -> Dice -> ActorId -> ActorId -> m UseResult #

Advance target actor time by this many time clips. Not by actor moves, to hurt fast actors more.

effectInsertMove :: MonadServerAtomic m => m () -> Dice -> ActorId -> ActorId -> m UseResult #

Give target actor the given number of extra moves. Don't give an absolute amount of time units, to benefit slow actors more.

effectTeleport :: MonadServerAtomic m => m () -> Dice -> ActorId -> ActorId -> m UseResult #

Teleport the target actor. Note that projectiles can be teleported, too, for extra fun.

effectDropItem :: MonadServerAtomic m => m () -> Int -> Int -> CStore -> GroupName ItemKind -> ActorId -> m UseResult #

Make the target actor drop items in a store from the given group.

effectDetectX :: MonadServerAtomic m => DetectKind -> (Point -> Bool) -> ([Point] -> m Bool) -> m () -> Int -> ActorId -> m UseResult #

effectSendFlying :: MonadServerAtomic m => m () -> ThrowMod -> ActorId -> ActorId -> Maybe Bool -> m UseResult #

Send the target actor flying like a projectile. The arguments correspond to ToThrow and Linger properties of items. If the actors are adjacent, the vector is directed outwards, if no, inwards, if it's the same actor, boldpos is used, if it can't, a random outward vector of length 10 is picked.

effectDropBestWeapon :: MonadServerAtomic m => m () -> ActorId -> m UseResult #

Make the target actor drop his best weapon (stack).

effectActivateInv :: MonadServerAtomic m => m () -> ActorId -> Char -> m UseResult #

Activate all items with the given symbol in the target actor's equipment (there's no variant that activates a random one, to avoid the incentive for carrying garbage). Only one item of each stack is activated (and possibly consumed).

effectTransformContainer :: forall m. MonadServerAtomic m => m () -> Char -> Container -> (ItemId -> ItemQuant -> m ()) -> m UseResult #