Adds constitutionScore and constitutionModifier to Monster.

Adds tests for constitutionScore and constitutionModifier.
This commit is contained in:
2020-09-13 03:29:01 -07:00
parent 58ce77e4df
commit aca029955e
2 changed files with 28 additions and 2 deletions

View File

@@ -85,6 +85,10 @@
if (tempNumber != nil && [tempNumber isKindOfClass:[NSNumber class]]) {
self.dexterityScore = tempNumber.intValue;
}
tempNumber = [jsonRoot objectForKey:@"conPoints"];
if (tempNumber != nil && [tempNumber isKindOfClass:[NSNumber class]]) {
self.constitutionScore = tempNumber.intValue;
}
return self;
}
@@ -136,7 +140,7 @@
}
-(int)constitutionModifier {
@throw [[NSException alloc] initWithName:@"unimplemented" reason:@"Method not implemented." userInfo:nil];
return [Monster abilityModifierForScore:self.constitutionScore];
}
-(int)intelligenceModifier {
@@ -350,6 +354,7 @@
self.alignment = monster.alignment;
self.strengthScore = monster.strengthScore;
self.dexterityScore = monster.dexterityScore;
self.constitutionScore = monster.constitutionScore;
}
@end