LambdaHack-0.4.99.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone

Game.LambdaHack.Common.Dice

Contents

Description

Representation of dice for parameters scaled with current level depth.

Synopsis

Frequency distribution for casting dice scaled with level depth

data Dice Source

Dice for parameters scaled with current level depth. To the result of rolling the first set of dice we add the second, scaled in proportion to current depth divided by maximal dungeon depth. The result if then multiplied by the scale --- to be used to ensure that dice results are multiples of, e.g., 10. The scale is set with |*|.

maxDice :: Dice -> IntSource

Maximal value of dice. The scaled part taken assuming maximum level. Assumes the frequencies are not null.

minDice :: Dice -> IntSource

Minimal value of dice. The scaled part ignored. Assumes the frequencies are not null.

meanDice :: Dice -> RationalSource

Mean value of dice. The scaled part taken assuming average level. Assumes the frequencies are not null.

Dice for rolling a pair of integer parameters representing coordinates.

data DiceXY Source

Dice for rolling a pair of integer parameters pertaining to, respectively, the X and Y cartesian 2D coordinates.

Constructors

DiceXY !Dice !Dice 

maxDiceXY :: DiceXY -> (Int, Int)Source

Maximal value of DiceXY.

minDiceXY :: DiceXY -> (Int, Int)Source

Minimal value of DiceXY.

meanDiceXY :: DiceXY -> (Rational, Rational)Source

Mean value of DiceXY.