Description Public fields Active bindings Methods Examples
A roller has a number of die sides and may support modify rolls.
ModifyType
Enumeration that defines the type of a modifier. The 'Bonus' is an enhancement; the 'Malus' is a risk.
Label
A string that characterices the roller and may be used as button label.
DieSides
Sides of the die
ModsAllowed
Does this roller support modify rolls (TRUE/FALSE)?
ModDieSides
The number of sides of a modifier die (readonly)
IsSkillRoller
Does the roller satisfy the characterstics of a skill roll (i.e. 1d100 with modify rolls allowed). (readonly)
new()
dieSides Private property
modsAllowed Private property
modDieSides Private property
Constructor
CthulhuRoller$new(dieSides = NA, label = NA, modDieSides = NA)
dieSides
Dies sides
label
A label that could qualify as button label to initiate this roller.
modDieSides
Sides of a modifier die (1 < 'modDieSides' < 'dieSides'/2).
'invisible(self)'
Roll()
Roll the roller to get a die roll result.
CthulhuRoller$Roll()
The roll (value between 1 and the number of sides of this roller die).
\dontrun{ roller = CthulhuRoller(100, "W100", 10) print(roller$Roll()) }
AddModifier()
AddModifier
CthulhuRoller$AddModifier(Roll, Modifier)
Roll
The current roll that shall be modified.
Modifier
A value of enumeration 'CthulhuRoller$ModifyType'.
The modified roll (value between 1 and the number of sides of this roller die).
\dontrun{ roller <- CthulhuRoller$new(100, "W100", 10) print(roller$AddModifier(12, roller$ModifyType["Bonus"])) }
MaxHardSuccess()
MaxHardSuccess Determine the smallest target value required so that a roll would be a hard success.
CthulhuRoller$MaxHardSuccess(value)
value
A roll result
Smallest target value required for a hard success
MaxExtremeSuccess()
MaxExtremeSuccess Determine the smallest target value required so that a roll would be an extreme success.
CthulhuRoller$MaxExtremeSuccess(value)
value
A roll result
Smallest target value required for an extreme success
MaxBotch()
What is the value for a critical failure?
CthulhuRoller$MaxBotch(value)
value
A roll result
The value characterizing a critical failure.
clone()
The objects of this class are cloneable with this method.
CthulhuRoller$clone(deep = FALSE)
deep
Whether to make a deep clone.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## ------------------------------------------------
## Method `CthulhuRoller$Roll`
## ------------------------------------------------
## Not run:
roller = CthulhuRoller(100, "W100", 10)
print(roller$Roll())
## End(Not run)
## ------------------------------------------------
## Method `CthulhuRoller$AddModifier`
## ------------------------------------------------
## Not run:
roller <- CthulhuRoller$new(100, "W100", 10)
print(roller$AddModifier(12, roller$ModifyType["Bonus"]))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.