public static float calcOAPoints(IMob ms) { IStats stats = (IStats)ms.getComponent(typeof(IStats)); float tot = stats.Strength + stats.Dexterity + stats.Intelligence + stats.Wisdom; return((float)(tot / 20.0)); }
public static int addHp(IMob ms, int startHp, int dice, int numDice) { IStats stats = (IStats)ms.getComponent(typeof(IStats)); int OA = Convert.ToInt32(Math.Floor(calcOAPoints(ms))); int conMod = Convert.ToInt32(Math.Floor((stats.Constitution - 10.0) / 20.0)); return(startHp + (OA + 1) * conMod + roll(OA * numDice, dice)); }
public InitiativeEntry(IMob ms, removeDelegate rem) { IStats stats = (IStats)ms.getComponent(typeof(IStats)); InitializeComponent(); EntryName.Text = ms.Name; EntryNumber.Text = ms.Number.ToString(); int initiative = MobRollHelper.roll(1, 20) + Convert.ToInt32(Math.Floor((stats.Dexterity - 10.0) / 2.0)); EntryInitiative.Text = initiative.ToString(); remDel = rem; }
public MobEntry(IMob ms) { InitializeComponent(); IStats s = (IStats)ms.getComponent(typeof(IStats)); Mob = ms; mobType.Text = ms.Name; mobNumber.Text = ms.Number.ToString(); Str.Text = s.Strength.ToString(); Dex.Text = s.Dexterity.ToString(); Int.Text = s.Intelligence.ToString(); Wis.Text = s.Wisdom.ToString(); Con.Text = s.Constitution.ToString(); Cha.Text = s.Charisma.ToString(); Hp.Text = s.HP.ToString(); AC.Text = s.AC.ToString(); }