class Dice
|
This is a simple class to roll a die. More... |
|
|
Public Methods
Private Methods
Private Members
This is a simple class to roll a die.
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 |
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.
[private]
[private]
[private]
int modifiedResult
| modifiedResult |
[private]
[private]
- Author: Sheldon Lee Wen
- Generated: sheldonl on cr595811-a on Fri Nov 30 10:24:34 2001, using kdoc 2.0a53.