Adds proficiency bonus to monster detail.

This commit is contained in:
2021-03-25 17:32:40 -07:00
parent f70390d585
commit 46e4b9a1f6

View File

@@ -231,60 +231,64 @@ struct MonsterDetail: View {
ResistancesAndImmunitiesView(monster: monster) ResistancesAndImmunitiesView(monster: monster)
// Languages Group {
if (!monsterLanguagesDescription.isEmpty) { // Languages
LabeledField("Languages") { if (!monsterLanguagesDescription.isEmpty) {
Text(monsterLanguagesDescription) LabeledField("Languages") {
} Text(monsterLanguagesDescription)
}
// Challenge Rating
if (!monsterChallengeRatingDescription.isEmpty) {
LabeledField("Challenge") {
Text(monsterChallengeRatingDescription)
}
// TODO: add proficiency bonus
}
// Abilities
if (monsterAbilities.count > 0) {
ForEach(monsterAbilities) { ability in
VStack {
Markdown(Document(ability.renderedText(monster)))
Divider()
} }
} }
}
// Actions // Challenge Rating
if (monsterActions.count > 0) { if (!monsterChallengeRatingDescription.isEmpty) {
VStack(alignment: .leading) { LabeledField("Challenge") {
Text("Actions") Text(monsterChallengeRatingDescription)
.fontWeight(.bold) }
ForEach(monsterActions) { action in }
// Proficiency Bonus
LabeledField("Proficiency Bonus") {
Text(String(monster.proficiencyBonus))
}
// Abilities
if (monsterAbilities.count > 0) {
ForEach(monsterAbilities) { ability in
VStack { VStack {
Markdown(Document(action.renderedText(monster))) Markdown(Document(ability.renderedText(monster)))
Divider() Divider()
} }
} }
} }
}
// Legendary Actions // Actions
if (monsterLegendaryActions.count > 0) { if (monsterActions.count > 0) {
VStack(alignment: .leading) { VStack(alignment: .leading) {
Text("Legendary Actions") Text("Actions")
.fontWeight(.bold) .font(.system(size: 24, weight: .bold))
ForEach(monsterLegendaryActions) { action in ForEach(monsterActions) { action in
VStack { VStack {
Markdown(Document(action.renderedText(monster))) Markdown(Document(action.renderedText(monster)))
Divider() Divider()
}
}
}
}
// Legendary Actions
if (monsterLegendaryActions.count > 0) {
VStack(alignment: .leading) {
Text("Legendary Actions")
.font(.system(size: 20, weight: .bold))
ForEach(monsterLegendaryActions) { action in
VStack {
Markdown(Document(action.renderedText(monster)))
Divider()
}
} }
} }
} }
} }
} }
.padding(.horizontal) .padding(.horizontal)
.foregroundColor(kTextColor) .foregroundColor(kTextColor)