public Character(Background myBackground, CharacterClassOption myCharacterClass, Race myRace) { Speed = myRace.Speed; CharacterLevel = 1; SetProficiencyBonusBool(); SavingThrowBoolArray = SetSavingThrows(myCharacterClass); SkillProfsArray = SetSkillProfs(myBackground, myCharacterClass); Languages = myBackground.Languages; }
private void UpdateClassInfo(CharacterClassOption characterClass) { cbSkill1.Items.Clear(); cbSkill2.Items.Clear(); cbSkill3.Items.Clear(); cbSkill4.Items.Clear(); txtblkClassDesc.Text = characterClass.Description; txtblkHitDice.Text = "d" + characterClass.HitDice; txtblkFavoredStats.Text = characterClass.FavoredStats; txtblkClassProficiencies.Text = characterClass.ClassProficiencies; txtblkClassSavingThrows.Text = characterClass.SavingThrows; txtblkClassSkillProfs.Text = "Choose " + characterClass.NumberOfSkills + " from: " + characterClass.ClassSkillOptions; string skills = characterClass.ClassSkillOptions; string[] skillarray = skills.Split(','); for (int i = 0; i < skillarray.Length; i++) { if (skillarray[i].Trim() != "") { cbSkill1.Items.Add(skillarray[i].Trim()); cbSkill2.Items.Add(skillarray[i].Trim()); cbSkill3.Items.Add(skillarray[i].Trim()); cbSkill4.Items.Add(skillarray[i].Trim()); } if (characterClass.NumberOfSkills == 2) { cbSkill1.Visibility = Visibility.Visible; cbSkill2.Visibility = Visibility.Visible; cbSkill3.Visibility = Visibility.Hidden; cbSkill4.Visibility = Visibility.Hidden; } if (characterClass.NumberOfSkills == 3) { cbSkill1.Visibility = Visibility.Visible; cbSkill2.Visibility = Visibility.Visible; cbSkill3.Visibility = Visibility.Visible; cbSkill4.Visibility = Visibility.Hidden; } if (characterClass.NumberOfSkills == 4) { cbSkill1.Visibility = Visibility.Visible; cbSkill2.Visibility = Visibility.Visible; cbSkill3.Visibility = Visibility.Visible; cbSkill4.Visibility = Visibility.Visible; } } }
public void SetPassiveStats(CharacterClassOption myCharacterClass) { HitPoints = myCharacterClass.HitDice + ConBonus; Initiative = DexBonus; if (Perception) { PassivePerception = 10 + WisBonus + ProficiencyBonus; } else { PassivePerception = 10 + WisBonus; } }
private bool[] SetSavingThrows(CharacterClassOption myCharacterClass) { bool[] SavingThrowBools = { false, false, false, false, false, false }; SavingThrowBools[0] = myCharacterClass.StrSavingThrow; SavingThrowBools[1] = myCharacterClass.DexSavingThrow; SavingThrowBools[2] = myCharacterClass.ConSavingThrow; SavingThrowBools[3] = myCharacterClass.IntSavingThrow; SavingThrowBools[4] = myCharacterClass.WisSavingThrow; SavingThrowBools[5] = myCharacterClass.ChaSavingThrow; StrSavingThrowBool = SavingThrowBools[0]; DexSavingThrowBool = SavingThrowBools[1]; ConSavingThrowBool = SavingThrowBools[2]; IntSavingThrowBool = SavingThrowBools[3]; WisSavingThrowBool = SavingThrowBools[4]; ChaSavingThrowBool = SavingThrowBools[5]; return(SavingThrowBools); }
private bool[] SetSkillProfs(Background myBackground, CharacterClassOption characterClass ) { bool[] BackgroundSkillProfsArray = { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; BackgroundSkillProfsArray[0] = myBackground.Acrobatics; BackgroundSkillProfsArray[1] = myBackground.AnimalHandling; BackgroundSkillProfsArray[2] = myBackground.Arcana; BackgroundSkillProfsArray[3] = myBackground.Athletics; BackgroundSkillProfsArray[4] = myBackground.Deception; BackgroundSkillProfsArray[5] = myBackground.History; BackgroundSkillProfsArray[6] = myBackground.Insight; BackgroundSkillProfsArray[7] = myBackground.Intimidation; BackgroundSkillProfsArray[8] = myBackground.Investigation; BackgroundSkillProfsArray[9] = myBackground.Medicine; BackgroundSkillProfsArray[10] = myBackground.Nature; BackgroundSkillProfsArray[11] = myBackground.Perception; BackgroundSkillProfsArray[12] = myBackground.Performance; BackgroundSkillProfsArray[13] = myBackground.Persuasion; BackgroundSkillProfsArray[14] = myBackground.Religion; BackgroundSkillProfsArray[15] = myBackground.SleightOfHand; BackgroundSkillProfsArray[16] = myBackground.Stealth; BackgroundSkillProfsArray[17] = myBackground.Survival; bool[] ClassSkillProfsArray = { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; ClassSkillProfsArray[0] = characterClass.Acrobatics; ClassSkillProfsArray[1] = characterClass.AnimalHandling; ClassSkillProfsArray[2] = characterClass.Arcana; ClassSkillProfsArray[3] = characterClass.Athletics; ClassSkillProfsArray[4] = characterClass.Deception; ClassSkillProfsArray[5] = characterClass.History; ClassSkillProfsArray[6] = characterClass.Insight; ClassSkillProfsArray[7] = characterClass.Intimidation; ClassSkillProfsArray[8] = characterClass.Investigation; ClassSkillProfsArray[9] = characterClass.Medicine; ClassSkillProfsArray[10] = characterClass.Nature; ClassSkillProfsArray[11] = characterClass.Perception; ClassSkillProfsArray[12] = characterClass.Performance; ClassSkillProfsArray[13] = characterClass.Persuasion; ClassSkillProfsArray[14] = characterClass.Religion; ClassSkillProfsArray[15] = characterClass.SleightOfHand; ClassSkillProfsArray[16] = characterClass.Stealth; ClassSkillProfsArray[17] = characterClass.Survival; bool[] SkillProfsArray = { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; for (int i = 0; i < ClassSkillProfsArray.Length; i++) { if (ClassSkillProfsArray[i] || BackgroundSkillProfsArray[i]) { SkillProfsArray[i] = true; } else { SkillProfsArray[i] = false; } } Acrobatics = SkillProfsArray[0]; AnimalHandling = SkillProfsArray[1]; Arcana = SkillProfsArray[2]; Athletics = SkillProfsArray[3]; Deception = SkillProfsArray[4]; History = SkillProfsArray[5]; Insight = SkillProfsArray[6]; Intimidation = SkillProfsArray[7]; Investigation = SkillProfsArray[8]; Medicine = SkillProfsArray[9]; Nature = SkillProfsArray[10]; Perception = SkillProfsArray[11]; Performance = SkillProfsArray[12]; Persuasion = SkillProfsArray[13]; Religion = SkillProfsArray[14]; SleightOfHand = SkillProfsArray[15]; Stealth = SkillProfsArray[16]; Survival = SkillProfsArray[17]; return(SkillProfsArray); }