LambdaHack-0.7.0.0: A game engine library for 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 () Source #

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 -> Container -> Bool -> Bool -> [Effect] -> m Bool Source #

The source actor affects the target actor, with a given item. If any of the effects fires up, the item gets identified. This function is mutually recursive with effect and so it's a part of Effect semantics.

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 Bool Source #

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.

effectAscend :: MonadServerAtomic m => (Effect -> m Bool) -> m () -> Bool -> ActorId -> ActorId -> Point -> m Bool Source #

effectEscape :: MonadServerAtomic m => ActorId -> ActorId -> m Bool Source #

The faction leaves the dungeon.

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

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

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

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 Bool Source #

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 Bool Source #

Make the target actor drop all items in a store from the given group (not just a random single item, or cluttering equipment with rubbish would be beneficial).

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

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

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 Bool Source #

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

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

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).

effectTransformEqp :: forall m. MonadServerAtomic m => m () -> ActorId -> Char -> CStore -> (ItemId -> ItemQuant -> m ()) -> m Bool Source #