526
edits
(Created the page) |
(→Dice Roll: added EN description.) |
||
| Line 54: | Line 54: | ||
The slope of the function gradually decreases and finally reaches <code>(rate / 100)^10</code> | The slope of the function gradually decreases and finally reaches <code>(rate / 100)^10</code> | ||
== | ==Dice Roll== | ||
{{EA 23.109 Stable Patch 2}} | {{EA 23.109 Stable Patch 2}} | ||
| Line 64: | Line 64: | ||
public int num; | public int num; | ||
This is the number of the dices. | |||
public int sides; | public int sides; | ||
This is the sides of each dice. | |||
public int bonus; | public int bonus; | ||
This is a constant that is added to the ressult of roll. | |||
public Card card; | public Card card; | ||
Here starts the definition of the Roll() | |||
public static int Roll(int num, int sides, int bonus = 0, Card card = null) | public static int Roll(int num, int sides, int bonus = 0, Card card = null) | ||
| Line 89: | Line 89: | ||
a = 1 + Mathf.Abs(num3 / 100) + ((Mathf.Abs(num3 % 100) > rnd(100)) ? 1 : 0); | a = 1 + Mathf.Abs(num3 / 100) + ((Mathf.Abs(num3 % 100) > rnd(100)) ? 1 : 0); | ||
} | } | ||
Evalue(78) | Evalue(78) is luck, flag is used to show luck is greater than 0. | ||
"a" is an integer that indicates how many tries the dices are thrown. | |||
"a" is approximately |luck| / 100, but "a" increases by 1 at the chance of <b>rest of</b> |luck| / 100 | |||
| Line 104: | Line 105: | ||
} | } | ||
return num2; | return num2; | ||
This part generates the results of dice rolls and records the best/worst result depending on flag. | |||
There are "a"es of results (up to 20) and the final result of the whole Roll() process is the best result of this process if the luck is positive. | |||
For a character with negative luck, the result will be the worst one among all the results. | |||
int Roll() | int Roll() | ||
| Line 127: | Line 124: | ||
} | } | ||
This is just a dice roll simulatiion, but bonus being added to the roll is an important point. | |||
public static int RollMax(int num, int sides, int bonus = 0) | public static int RollMax(int num, int sides, int bonus = 0) | ||
| Line 138: | Line 131: | ||
} | } | ||
This is the possible best ressult of roll + bonus as well. | |||
public static int rnd(int a) | public static int rnd(int a) | ||
| Line 145: | Line 138: | ||
} | } | ||
This function emits a random number that is { 0, 1,..., a }. | |||
[[Category: Elin Spoiler]] | [[Category: Elin Spoiler]] | ||
[[Category: EN]] | [[Category: EN]] | ||
edits