Adds tasks to show the proficiency bonus and to sort damage types better.

This commit is contained in:
2021-03-25 01:18:35 -07:00
parent ba7a680cfd
commit 4426ed52eb
2 changed files with 5 additions and 0 deletions

View File

@@ -629,6 +629,7 @@ public class Monster: NSManagedObject {
var damageVulnerabilitiesDescription: String { var damageVulnerabilitiesDescription: String {
get { get {
// TODO: sort "bludgeoning, piercing, and slashing from nonmagical attacks" to the end and use ; as a separator before it.
let sortedVulnerabilities = self.damageVulnerabilities?.sorted() ?? [] let sortedVulnerabilities = self.damageVulnerabilities?.sorted() ?? []
return StringHelper.oxfordJoin(sortedVulnerabilities, ", ", ", and ", " and ") return StringHelper.oxfordJoin(sortedVulnerabilities, ", ", ", and ", " and ")
@@ -637,6 +638,7 @@ public class Monster: NSManagedObject {
var damageResistancesDescription: String { var damageResistancesDescription: String {
get { get {
// TODO: sort "bludgeoning, piercing, and slashing from nonmagical attacks" to the end and use ; as a separator before it.
let sortedResistances = self.damageResistances?.sorted() ?? [] let sortedResistances = self.damageResistances?.sorted() ?? []
return StringHelper.oxfordJoin(sortedResistances, ", ", ", and ", " and ") return StringHelper.oxfordJoin(sortedResistances, ", ", ", and ", " and ")
} }
@@ -644,6 +646,7 @@ public class Monster: NSManagedObject {
var damageImmunitiesDescription: String { var damageImmunitiesDescription: String {
get { get {
// TODO: sort "bludgeoning, piercing, and slashing from nonmagical attacks" to the end and use ; as a separator before it.
let sortedImmunities = self.damageImmunities?.sorted() ?? [] let sortedImmunities = self.damageImmunities?.sorted() ?? []
return StringHelper.oxfordJoin(sortedImmunities, ", ", ", and ", " and ") return StringHelper.oxfordJoin(sortedImmunities, ", ", ", and ", " and ")
} }

View File

@@ -238,6 +238,8 @@ struct MonsterDetail: View {
LabeledField("Challenge") { LabeledField("Challenge") {
Text(monsterChallengeRatingDescription) Text(monsterChallengeRatingDescription)
} }
// TODO: add proficiency bonus
} }
// Abilities // Abilities