antisplice-0.7.2.0: An engine for text-based dungeons.

Safe HaskellNone

Game.Antisplice.Stats

Description

Provides utility functions for dealing with stats and stereotypes

Synopsis

Documentation

class HasStats s whereSource

Typeclass for every pure data that saves stats

Methods

setStat :: StatKey -> Int -> s -> sSource

Set the given key to the given value

getStat :: StatKey -> s -> IntSource

Lookup the given key

class HasStatsM m whereSource

Typeclass for every monad that saves stats

Methods

setStatM :: StatKey -> Int -> m ()Source

Set the given key to the given value

getStatM :: StatKey -> m IntSource

Lookup the given key

Instances

sumStat :: MonadPlayer m => StatKey -> m IntSource

Sum the stats of the objects the player carries (ignoring base stats and boni)

calcStat :: (Functor m, MonadPlayer m, MonadAtoms m, MonadRoom m, MonadPrinter m) => StatKey -> m IntSource

Calculates the stats of the objects the player carries

defaultStereo :: PlayerStereoSource

Default stereotype.

registerStereo :: MonadAtoms m => PlayerStereo -> m (Atom PlayerStereo)Source

Register the given stereotype and return its atom.

addStereo :: MonadPlayer m => Atom PlayerStereo -> m ()Source

Add the given stereotype to the current player.

replaceStereo :: MonadPlayer m => Atom PlayerStereo -> Atom PlayerStereo -> m ()Source

Remove one stereotype and add another