class Dice

This is a simple class to roll a die. More...

Definition#include <lycad_chargen/dice.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Private Methods

Private Members


Detailed Description

This is a simple class to roll a die.

 Dice ()

Dice

 ~Dice ()

~Dice

int  rollProcedural ()

rollProcedural

These two types of rolls set the result internally. You must use success and degreeOS to find out whether you were successful or not and by how much.

int  rollBoundless ()

rollBoundless

bool  attributeCheck (int attribute, int mods)

attributeCheck

These methods do an attribute check against a target of ten. It adds the value of an attribute and a modifier. The first one returns whether the check succeeded or failed. The second one also takes a shift value and returns the degree of success. These rolls do not alter the internal state of the die.

int  attributeCheck (int attribute, int mods, int shift)

attributeCheck

int  roll ()

roll

roll performs a general roll of a d10 and returns the result. Internally it just calls rollProcedural and returns the result.

int  rollPercent ()

rollPercent

This method does a percentile roll, 1>= X <=100, and returns the result as we do not usually use percentile rolls for actions. Does not alter the internal state of the die.

bool  success (int tgt=10, int mods=0)

success

This method determines whether or not your roll succeeded tgt is the target number, and it defaults to 10. mods is the modifier to the roll, a skill, etc. It will be added to the result of the roll, but defaults to 0.

int  degreeOS (int shift=0)

degreeOS

This method returns the degree of success. This method should only be called after success is called. shift is the shift value in determining the degree of success, it defaults to 0.

void  init ()

init

[private]

int target

target

[private]

int result

result

[private]

int modifiedResult

modifiedResult

[private]

int dos

dos

[private]