24 a = 1 + Mathf.Abs(num3 / 100) + ((Mathf.Abs(num3 % 100) >
rnd(100)) ? 1 : 0);
26 for (
int i = 0; i < Mathf.Min(a, 20); i++)
29 if (i == 0 || (flag && num4 > num2) || (!flag && num4 < num2))
38 for (
int j = 0; j <
num; j++)
51 public static int rnd(
int a)
56 public Dice(
int _num = 0,
int _sides = 0,
int _bonus = 0,
Card _card =
null)
67 string[] array = raw.Split(
',');
68 if (array.Length != 0)
70 string[] array2 = array[0].Split(
'd');
71 dice.num =
int.Parse(array2[0]);
72 dice.sides =
int.Parse(array2[1]);
76 dice.bonus =
int.Parse(array[1]);
98 string key = ele.
source.alias;
101 key = ele.
source.alias.Split(
'_')[0] +
"_";
109 int ele2 = ((!ele.
source.aliasParent.IsEmpty()) ? c.
Evalue(ele.
source.aliasParent) : 0);
112 return new Dice(Mathf.Max(1, row.
num.Calc(power, ele2)), Mathf.Max(1, row.
sides.Calc(power, ele2)), row.
bonus.Calc(power, ele2), c);
130 int ele = power / 10;
133 Element orCreateElement = c.elements.GetOrCreateElement(act.source.id);
134 power2 = orCreateElement.
GetPower(c);
135 ele = ((!orCreateElement.
source.aliasParent.IsEmpty()) ? c.Evalue(orCreateElement.
source.aliasParent) : 0);
139 return new Dice(Mathf.Max(1, row.
num.Calc(power2, ele)), Mathf.Max(1, row.
sides.Calc(power2, ele)), row.
bonus.Calc(power2, ele), c);
static int RollMax(int num, int sides, int bonus=0)
static Dice Parse(string raw)
static int Roll(int num, int sides, int bonus=0, Card card=null)
override string ToString()
static Dice Create(Element ele, Card c)
static Dice Create(string id, int power, Card c=null, Act act=null)
Dice(int _num=0, int _sides=0, int _bonus=0, Card _card=null)
static SourceManager sources
virtual int GetPower(Card c)
static int Range(int min, int max)