Collection¶
| Qualified name: | Ouxsoft\LuckByDice\Collection |
|---|---|
| Implements: | CollectionInterface |
-
class
Collection¶ -
public
__construct(int $amount, int $sides[, int $modifier, int $multiplier])¶ Collectionconstructor.Parameters: - $amount (int) –
- $sides (int) –
- $modifier (int) – Default:
1 - $multiplier (int) – Default:
1
-
public
count() → int¶ Returns: int –
-
public
getBonus() → int¶ Get bonus of dice without modifier or multiplier
Returns: int –
-
public
getMaxOutcome() → int¶ Get max potential of outcome
Returns: int –
-
public
getMaxPotential() → int¶ Get the maximum potential of a collections
-
public
Takes into account maximum outcome, modifier, and multiplier
Takes into account minimal outcome, modifier, and multiplier
returns: int –
- public
Collection::getModifier() → int¶
Returns: int –
- public
Collection::getMultiplier() → int¶
Returns: int –
- public
Collection::getNotation() → string¶Get the notation for the collection
Returns: string –
- public
Collection::getOutcomePercent() → float¶Compute percent outcome of previous roll
Convert dice outcomes to percent outcomes. Dice outcomes start counting at one. This formula works by starting the counts at 0. Example using 1d4: 1/4 = 0/3; 2/4 = 1/3; 3/4 = 2/3; 4/4 = 3/3
returns: float –
- public
Collection::getSides() → int¶
Returns: int –
- public
Collection::getTotal([]) → int¶Gets total value of each dice within
Collectionwith modifier and multiplier applied
Parameters:
- $adjustments (bool) – Default:
trueReturns: int –
- public
Collection::getValue([]) → int¶Get value of rolled dice
Parameters:
- $adjustments (bool) – Default:
trueReturns: int –
- public
Collection::roll() → int¶Roll each dice and returns Total
Returns: int –
- public
Collection::setBonus(int $amount) → int¶Distributes a new bonus across all dice
Parameters:
- $amount (int) –
Returns: int – returns the remaining bonus amount left to distribute