public int GetClassMaxByRace(OSRIC_RACE _or, OSRIC_CLASS _oc) { int yindex = raceMinMax.GetYIndexOf(_or.GetDesc()); if(yindex<0) return 0; try { return raceMinMax.GetValue(_oc.GetDesc(),yindex); } catch { return 0; } }
public int RollHitPoints(OSRIC_CLASS oc,int bonus,int _minHPthreshhold) { int accumulator,die,temp; accumulator = die = temp = 0; string[] classString = oc.GetDesc().Split('/'); for(int i = 0;i<classString.Length;i++) { die = OSRICConstants.ClassHitDie[classString[i]]; temp = UnityEngine.Random.Range(1,die) + bonus; accumulator += (int)(temp/classString.Length); } if(accumulator >= _minHPthreshhold) return accumulator; else return RollHitPoints(oc,bonus,_minHPthreshhold); }
public void SetSelectedValue(OSRIC_CLASS oc) { int selected = GetOptionPosition(oc.GetDesc()); if(selected>-1) drop.value = selected; }