Adds saving throws to monster card display.

Adds proficiencyBonus implementation to Monster. The proficiency bonus relies on CR and defaults to 0 until the CR fields are implemented
This commit is contained in:
2020-10-04 00:19:04 -07:00
parent 3c3ed3c94b
commit 0e800dfd1c
4 changed files with 119 additions and 2 deletions

View File

@@ -24,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UILabel *monsterIntelligence;
@property (weak, nonatomic) IBOutlet UILabel *monsterWisdom;
@property (weak, nonatomic) IBOutlet UILabel *monsterCharisma;
@property (weak, nonatomic) IBOutlet UILabel *monsterSavingThrows;
@property Monster* monster;

View File

@@ -105,6 +105,14 @@ NSString* makeHTMLFragmentString(NSString* format, ...) {
if (self.monsterCharisma) {
self.monsterCharisma.text = self.monster.charismaDescription;
}
if (self.monsterSavingThrows) {
NSString *savingThrowsDescription = self.monster.savingThrowsDescription;
if (savingThrowsDescription == nil) {
self.monsterSavingThrows.text = @"";
} else {
self.monsterSavingThrows.attributedText = [HTMLHelper attributedStringFromHTML:makeHTMLFragmentString(@"<b>Saving Throws</b> %@", savingThrowsDescription)];
}
}
}
- (IBAction)unwindWithSegue:(UIStoryboardSegue *)unwindSegue {