static void Load_Chars(Menu _char_menu, UI ui) { //characters should be loaded from xml and an approprioate character creatation class/method should be implemented and called from the character menu Character sprinkles = new Character("Sprinkles"); DataHandler.Chars.Add(sprinkles); foreach(Character c in DataHandler.Chars) { MItemData str = new MItemData(c.Strength.ToString(), "Strength", ui); MItemData dex = new MItemData(c.Dexterity.ToString(), "Dexterity", ui); MItemData con = new MItemData(c.Constitution.ToString(), "Constitution", ui); MItemData inte = new MItemData(c.Intelligence.ToString(), "Intelligence", ui); MItemData wis = new MItemData(c.Wisdom.ToString(), "Wisdom", ui); MItemData chari = new MItemData(c.Charisma.ToString(), "Charisma", ui); MItemData hp = new MItemData(c.HP.ToString(), "HP", ui); MItemToogle add = new MItemToogle("Add to party", sprinkles, ui); Menu character_menu = new Menu(c.Name, ui); character_menu.Items.Add(add); character_menu.Items.Add(hp); character_menu.Items.Add(str); character_menu.Items.Add(dex); character_menu.Items.Add(con); character_menu.Items.Add(inte); character_menu.Items.Add(wis); character_menu.Items.Add(chari); _char_menu.Items.Add(character_menu); } }
static Character Generate_Goblin() { Character goblin = new Character("Goblin"); goblin.CharClasses.Add(new CharClass("Scavenger")); goblin.Race = "goblin"; goblin.Strength = Die.Roll(2, 6); goblin.Dexterity = Die.Roll(3, 6); goblin.Constitution = Die.Roll(2, 6); goblin.Intelligence = Die.Roll(1, 6); goblin.Wisdom = Die.Roll(2, 6); goblin.Charisma = Die.Roll(3, 6); return goblin; }
private string Print_Combatant(Character _char) { return ($"{_char.Name}: {_char.HP}"); }