/// <summary> /// gets the values for barbarian rage /// </summary> public BarbarianRage getBarbarianRage(int level) { BarbarianRage rage = new BarbarianRage(); using (SQLiteConnection connection = new SQLiteConnection(ConnectionString)) using (SQLiteCommand command = new SQLiteCommand(connection)) { connection.Open(); command.CommandText = "SELECT rages, damageBonus FROM barbarianRage " + "WHERE level BETWEEN 1 AND @Level " + "ORDER BY level DESC LIMIT 1"; command.Parameters.AddWithValue("@Level", level.ToString()); using (SQLiteDataReader dbReader = command.ExecuteReader()) { if (dbReader.Read()) { if (!dbReader.IsDBNull(0)) { rage = new BarbarianRage(dbReader.GetString(0), dbReader.GetString(1)); } } } } return(rage); }
private List <Feature> constructFeatureList() { List <Feature> featureList = DBManager.ExportData.getFeatures(Choices.RaceChoice.getSelectedSubrace().Name, Choices.ClassChoice.Name, Choices.ClassChoice.getSelectedSubclass().Name, Choices.BackgroundChoice.Name, Choices.Level); //add additional feature //fighting style if (Choices.ClassChoice.HasFightingStyle) { foreach (FightingStyle style in Choices.ClassChoice.FightingStyles) { featureList.Add(new Feature(style.Name, style.Description)); } } ////Rogue Thieves' Tools exptertise //if (!string.IsNullOrEmpty(DBManager.ExtraClassChoiceData.ExtraClassSkillData.getExtraSkillCheckbox(Choices.ClassChoice.Name))) //{ // if (Choices.ClassChoice.NameSkills.Contains(DBManager.ExtraClassChoiceData.ExtraClassSkillData.getExtraSkillCheckbox(Choices.ClassChoice.Name))) // { // featureList.Add(DBManager.ExportData.getFeatureById(60)); // } //} //class/subclass expertise if (Choices.ClassChoice.HasExtraSkills) { if (Choices.ClassChoice.DoublesProficiency) { string description = $"Your proficiency bonus is doubled for any ability check using {Choices.ClassChoice.ExtraSkills}."; featureList.Add(new Feature($"{Choices.ClassChoice.Name} Expertise", description)); } } if (Choices.ClassChoice.getSelectedSubclass().HasExtraSkills) { if (Choices.ClassChoice.getSelectedSubclass().DoublesProficiency) { string description = $"Your proficiency bonus is doubled for any ability check using {Choices.ClassChoice.getSelectedSubclass().ExtraSkills}."; featureList.Add(new Feature($"{Choices.ClassChoice.getSelectedSubclass().Name} Expertise", description)); } } //background choices if (Choices.BackgroundChoice.HasStoryChoice) { string featureTitle = $"{Choices.BackgroundChoice.StoryChoice.Name} ({Choices.BackgroundChoice.StoryChoice.getSelectedOption()})"; featureList.Add(new Feature(featureTitle, Choices.BackgroundChoice.StoryChoice.Description)); } //elemental disciplines if (Choices.ClassChoice.getSelectedSubclass().HasElementalDisciplines) { foreach (ElementalDiscipline discipline in new List <ElementalDiscipline>().Concat(Choices.ClassChoice.getSelectedSubclass().MandatoryDisciplines) .Concat(Choices.ClassChoice.getSelectedSubclass().ChosenDisciplines) .ToList()) { featureList.Add(new Feature(discipline.Name, discipline.Description)); } } //warlock pact & invocations if (Choices.ClassChoice.HasWarlockChoices) { //pact featureList.Add(new Feature(Choices.ClassChoice.WarlockPactChoice.Name, Choices.ClassChoice.WarlockPactChoice.Description)); //invocations foreach (EldritchInvocation invocation in Choices.ClassChoice.WarlockInvocations) { featureList.Add(new Feature(invocation.Name, invocation.Description)); } } //hunter features if (Choices.ClassChoice.getSelectedSubclass().HasHunterChoices) { foreach (ChoiceFeature feature in Choices.ClassChoice.getSelectedSubclass().HunterFeatures) { string featureTitle = feature.Name + " (" + feature.getSelectedOption().Name + ")"; featureList.Add(new Feature(featureTitle, feature.getSelectedOption().Description)); } } //metamagic if (Choices.ClassChoice.HasMetamagic) { foreach (Metamagic entry in Choices.ClassChoice.SorcererMetamagic) { featureList.Add(new Feature(entry.Name, entry.Description)); } } //totem features if (Choices.ClassChoice.getSelectedSubclass().HasTotems) { foreach (ChoiceFeature totem in Choices.ClassChoice.getSelectedSubclass().TotemFeatures) { string featureTitle = totem.Name + " (" + totem.getSelectedOption().Name + ")"; featureList.Add(new Feature(featureTitle, totem.getSelectedOption().Description)); } } //maneuvers if (Choices.ClassChoice.getSelectedSubclass().HasManeuvers) { foreach (Maneuver maneuver in Choices.ClassChoice.getSelectedSubclass().Maneuvers) { featureList.Add(new Feature(maneuver.Name, maneuver.Description)); } } //favored enemy if (Choices.ClassChoice.HasFavoredEnemy) { foreach (Feature feature in featureList.Where(entry => entry.Name == "Favored Enemy")) { feature.Description = $"({Choices.ClassChoice.FavoredEnemies}) {feature.Description}"; } } //favored terrain if (Choices.ClassChoice.HasFavoredTerrain) { foreach (Feature feature in featureList.Where(entry => entry.Name == "Natural Explorer")) { feature.Description = $"({Choices.ClassChoice.FavoredTerrains}) {feature.Description}"; } } //Beast Compantion if (Choices.ClassChoice.getSelectedSubclass().HasCompanion) { foreach (Feature feature in featureList.Where(entry => entry.Name == "Ranger's Companion")) { string compantionString = $"{Choices.ClassChoice.getSelectedSubclass().BeastCompanion.Name} -> {Choices.ClassChoice.getSelectedSubclass().BeastCompanion.Book} p.{Choices.ClassChoice.getSelectedSubclass().BeastCompanion.Page}"; feature.Description = $"({compantionString }) {feature.Description}"; } } //rage foreach (Feature feature in featureList.Where(entry => entry.Name == "Rage")) { BarbarianRage rage = DBManager.ExportData.getBarbarianRage(Choices.Level); feature.Description = $"({rage.RageAmount}, {rage.DamageBonus}) {feature.Description}"; } //bardic inspiration foreach (Feature feature in featureList.Where(entry => entry.Name == "Bardic Inspiration")) { feature.Description = $"({DBManager.ExportData.getBardicInspirationDie(Choices.Level)}) {feature.Description}"; } //sorcery points foreach (Feature feature in featureList.Where(entry => entry.Name == "Font of Magic")) { feature.Description = $"({DBManager.ExportData.getSorceryPoints(Choices.Level)} Sorcery Points) {feature.Description}"; } //ki foreach (Feature feature in featureList.Where(entry => entry.Name == "Ki")) { feature.Description = $"({DBManager.ExportData.getKiPoints(Choices.Level)}) {feature.Description}"; } //martial arts foreach (Feature feature in featureList.Where(entry => entry.Name == "Martial Arts")) { feature.Description = $"({DBManager.ExportData.getMartialArtsDie(Choices.Level)}) {feature.Description}"; } //dragonborn breath weapon foreach (Feature feature in featureList.Where(entry => entry.Name == "Breath Weapon")) { feature.Description = DBManager.ExportData.getBreathWeapon(Choices.RaceChoice.getSelectedSubrace().Name, Choices.Level); } return(featureList); }