Adds tasks to show the proficiency bonus and to sort damage types better.
This commit is contained in:
@@ -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 ")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -238,6 +238,8 @@ struct MonsterDetail: View {
|
|||||||
LabeledField("Challenge") {
|
LabeledField("Challenge") {
|
||||||
Text(monsterChallengeRatingDescription)
|
Text(monsterChallengeRatingDescription)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: add proficiency bonus
|
||||||
}
|
}
|
||||||
|
|
||||||
// Abilities
|
// Abilities
|
||||||
|
|||||||
Reference in New Issue
Block a user