Safe Haskell | None |
---|---|
Language | Haskell2010 |
Handle effects. They are most often caused by requests sent by clients but sometimes also caused by projectiles or periodically activated items.
Synopsis
- applyItem :: MonadServerAtomic m => ActorId -> ItemId -> CStore -> m ()
- meleeEffectAndDestroy :: MonadServerAtomic m => ActorId -> ActorId -> ItemId -> Container -> m ()
- effectAndDestroy :: MonadServerAtomic m => Bool -> ActorId -> ActorId -> ItemId -> Container -> Bool -> [Effect] -> ItemFullKit -> m ()
- itemEffectEmbedded :: MonadServerAtomic m => ActorId -> LevelId -> Point -> ItemId -> m ()
- dropCStoreItem :: MonadServerAtomic m => Bool -> CStore -> ActorId -> Actor -> Int -> ItemId -> ItemQuant -> m ()
- highestImpression :: MonadServerAtomic m => ActorId -> m (Maybe FactionId)
- dominateFidSfx :: MonadServerAtomic m => ActorId -> FactionId -> m Bool
- pickDroppable :: MonadStateRead m => ActorId -> Actor -> m Container
- refillHP :: MonadServerAtomic m => ActorId -> ActorId -> Int64 -> m ()
- cutCalm :: MonadServerAtomic m => ActorId -> m ()
- data UseResult
- applyMeleeDamage :: MonadServerAtomic m => ActorId -> ActorId -> ItemId -> m Bool
- imperishableKit :: Bool -> Bool -> ItemTimer -> ItemFull -> ItemQuant -> (Bool, ItemQuant)
- itemEffectDisco :: MonadServerAtomic m => ActorId -> ActorId -> ItemId -> ItemKind -> Container -> Bool -> Bool -> [Effect] -> m UseResult
- effectSem :: MonadServerAtomic m => ActorId -> ActorId -> ItemId -> Container -> Bool -> Bool -> Effect -> m UseResult
- effectBurn :: MonadServerAtomic m => Dice -> ActorId -> ActorId -> m UseResult
- effectExplode :: MonadServerAtomic m => m () -> GroupName ItemKind -> ActorId -> m UseResult
- effectRefillHP :: MonadServerAtomic m => Int -> ActorId -> ActorId -> m UseResult
- effectRefillCalm :: MonadServerAtomic m => m () -> Int -> ActorId -> ActorId -> m UseResult
- effectDominate :: MonadServerAtomic m => ActorId -> ActorId -> m UseResult
- dominateFid :: MonadServerAtomic m => FactionId -> ActorId -> m Bool
- effectImpress :: MonadServerAtomic m => (Effect -> m UseResult) -> m () -> ActorId -> ActorId -> m UseResult
- effectSummon :: MonadServerAtomic m => GroupName ItemKind -> Dice -> ItemId -> ActorId -> ActorId -> Bool -> m UseResult
- effectAscend :: MonadServerAtomic m => (Effect -> m UseResult) -> m () -> Bool -> ActorId -> ActorId -> Point -> m UseResult
- findStairExit :: MonadStateRead m => FactionId -> Bool -> LevelId -> Point -> m Point
- switchLevels1 :: MonadServerAtomic m => (ActorId, Actor) -> m (Maybe ActorId)
- switchLevels2 :: MonadServerAtomic m => LevelId -> Point -> (ActorId, Actor) -> Time -> Maybe ActorId -> m ()
- effectEscape :: MonadServerAtomic m => ActorId -> ActorId -> m UseResult
- effectParalyze :: MonadServerAtomic m => m () -> Dice -> ActorId -> ActorId -> m UseResult
- effectInsertMove :: MonadServerAtomic m => m () -> Dice -> ActorId -> ActorId -> m UseResult
- effectTeleport :: MonadServerAtomic m => m () -> Dice -> ActorId -> ActorId -> m UseResult
- effectCreateItem :: MonadServerAtomic m => Maybe FactionId -> Maybe Int -> ActorId -> CStore -> GroupName ItemKind -> TimerDice -> m UseResult
- effectDropItem :: MonadServerAtomic m => m () -> Int -> Int -> CStore -> GroupName ItemKind -> ActorId -> m UseResult
- allGroupItems :: MonadServerAtomic m => CStore -> GroupName ItemKind -> ActorId -> m [(ItemId, ItemQuant)]
- effectPolyItem :: MonadServerAtomic m => m () -> ActorId -> ActorId -> m UseResult
- effectIdentify :: MonadServerAtomic m => m () -> ItemId -> ActorId -> ActorId -> m UseResult
- identifyIid :: MonadServerAtomic m => ItemId -> Container -> ContentId ItemKind -> m ()
- effectDetect :: MonadServerAtomic m => m () -> DetectKind -> Int -> ActorId -> Point -> m UseResult
- 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
- sendFlyingVector :: MonadServerAtomic m => ActorId -> ActorId -> Maybe Bool -> m Vector
- effectDropBestWeapon :: MonadServerAtomic m => m () -> ActorId -> m UseResult
- effectActivateInv :: MonadServerAtomic m => m () -> ActorId -> Char -> m UseResult
- effectTransformContainer :: forall m. MonadServerAtomic m => m () -> Char -> Container -> (ItemId -> ItemQuant -> m ()) -> m UseResult
- effectApplyPerfume :: MonadServerAtomic m => m () -> ActorId -> m UseResult
- effectOneOf :: MonadServerAtomic m => (Effect -> m UseResult) -> [Effect] -> m UseResult
- effectRecharging :: MonadServerAtomic m => (Effect -> m UseResult) -> Effect -> Bool -> m UseResult
- effectTemporary :: MonadServerAtomic m => m () -> ActorId -> ItemId -> Container -> m UseResult
- effectComposite :: forall m. MonadServerAtomic m => (Effect -> m UseResult) -> [Effect] -> m UseResult
Documentation
meleeEffectAndDestroy :: MonadServerAtomic m => ActorId -> ActorId -> ItemId -> Container -> m () Source #
effectAndDestroy :: MonadServerAtomic m => Bool -> ActorId -> ActorId -> ItemId -> Container -> Bool -> [Effect] -> ItemFullKit -> m () Source #
itemEffectEmbedded :: MonadServerAtomic m => ActorId -> LevelId -> Point -> ItemId -> m () Source #
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).
highestImpression :: MonadServerAtomic m => ActorId -> m (Maybe FactionId) Source #
dominateFidSfx :: MonadServerAtomic m => ActorId -> FactionId -> m Bool Source #
pickDroppable :: MonadStateRead m => ActorId -> Actor -> m Container Source #
cutCalm :: MonadServerAtomic m => ActorId -> m () Source #
Internal operations
applyMeleeDamage :: MonadServerAtomic m => ActorId -> ActorId -> ItemId -> m Bool Source #
itemEffectDisco :: MonadServerAtomic m => ActorId -> ActorId -> ItemId -> ItemKind -> Container -> Bool -> Bool -> [Effect] -> m UseResult Source #
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 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.
effectBurn :: MonadServerAtomic m => Dice -> ActorId -> ActorId -> m UseResult Source #
effectExplode :: MonadServerAtomic m => m () -> GroupName ItemKind -> ActorId -> m UseResult Source #
effectRefillHP :: MonadServerAtomic m => Int -> ActorId -> ActorId -> m UseResult Source #
effectRefillCalm :: MonadServerAtomic m => m () -> Int -> ActorId -> ActorId -> m UseResult Source #
effectDominate :: MonadServerAtomic m => ActorId -> ActorId -> m UseResult Source #
dominateFid :: MonadServerAtomic m => FactionId -> ActorId -> m Bool Source #
effectImpress :: MonadServerAtomic m => (Effect -> m UseResult) -> m () -> ActorId -> ActorId -> m UseResult Source #
effectSummon :: MonadServerAtomic m => GroupName ItemKind -> Dice -> ItemId -> ActorId -> ActorId -> Bool -> m UseResult Source #
effectAscend :: MonadServerAtomic m => (Effect -> m UseResult) -> m () -> Bool -> ActorId -> ActorId -> Point -> m UseResult Source #
findStairExit :: MonadStateRead m => FactionId -> Bool -> LevelId -> Point -> m Point Source #
switchLevels1 :: MonadServerAtomic m => (ActorId, Actor) -> m (Maybe ActorId) Source #
switchLevels2 :: MonadServerAtomic m => LevelId -> Point -> (ActorId, Actor) -> Time -> Maybe ActorId -> m () Source #
effectEscape :: MonadServerAtomic m => ActorId -> ActorId -> m UseResult Source #
The faction leaves the dungeon.
effectParalyze :: MonadServerAtomic m => m () -> Dice -> ActorId -> ActorId -> m UseResult 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 -> ActorId -> m UseResult 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 UseResult Source #
Teleport the target actor. Note that projectiles can be teleported, too, for extra fun.
effectCreateItem :: MonadServerAtomic m => Maybe FactionId -> Maybe Int -> ActorId -> CStore -> GroupName ItemKind -> TimerDice -> m UseResult Source #
effectDropItem :: MonadServerAtomic m => m () -> Int -> Int -> CStore -> GroupName ItemKind -> ActorId -> m UseResult Source #
Make the target actor drop items in a store from the given group.
allGroupItems :: MonadServerAtomic m => CStore -> GroupName ItemKind -> ActorId -> m [(ItemId, ItemQuant)] Source #
effectPolyItem :: MonadServerAtomic m => m () -> ActorId -> ActorId -> m UseResult Source #
effectIdentify :: MonadServerAtomic m => m () -> ItemId -> ActorId -> ActorId -> m UseResult Source #
identifyIid :: MonadServerAtomic m => ItemId -> Container -> ContentId ItemKind -> m () Source #
effectDetect :: MonadServerAtomic m => m () -> DetectKind -> Int -> ActorId -> Point -> m UseResult Source #
effectDetectX :: MonadServerAtomic m => DetectKind -> (Point -> Bool) -> ([Point] -> m Bool) -> m () -> Int -> ActorId -> m UseResult Source #
effectSendFlying :: MonadServerAtomic m => m () -> ThrowMod -> ActorId -> ActorId -> Maybe Bool -> m UseResult 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.
sendFlyingVector :: MonadServerAtomic m => ActorId -> ActorId -> Maybe Bool -> m Vector Source #
effectDropBestWeapon :: MonadServerAtomic m => m () -> ActorId -> m UseResult Source #
Make the target actor drop his best weapon (stack).
effectActivateInv :: MonadServerAtomic m => m () -> ActorId -> Char -> m UseResult 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).
effectTransformContainer :: forall m. MonadServerAtomic m => m () -> Char -> Container -> (ItemId -> ItemQuant -> m ()) -> m UseResult Source #
effectApplyPerfume :: MonadServerAtomic m => m () -> ActorId -> m UseResult Source #
effectOneOf :: MonadServerAtomic m => (Effect -> m UseResult) -> [Effect] -> m UseResult Source #
effectRecharging :: MonadServerAtomic m => (Effect -> m UseResult) -> Effect -> Bool -> m UseResult Source #
effectTemporary :: MonadServerAtomic m => m () -> ActorId -> ItemId -> Container -> m UseResult Source #
effectComposite :: forall m. MonadServerAtomic m => (Effect -> m UseResult) -> [Effect] -> m UseResult Source #