From a6f048cc2d28567d9618f1d833d8e52c27edb386 Mon Sep 17 00:00:00 2001 From: Tom Hicks Date: Sun, 13 Sep 2020 04:03:30 -0700 Subject: [PATCH] Moves ability scores to Core Data entity. --- MonsterCards/Models/Monster.h | 6 ------ MonsterCards/Models/Monster.m | 6 ------ .../MonsterCards.xcdatamodel/contents | 8 +++++++- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/MonsterCards/Models/Monster.h b/MonsterCards/Models/Monster.h index b4bbcf6..4f6ad6f 100644 --- a/MonsterCards/Models/Monster.h +++ b/MonsterCards/Models/Monster.h @@ -39,12 +39,6 @@ NS_ASSUME_NONNULL_BEGIN @property NSString *truesightDistance; @property NSString *understandsBut; -@property int strengthScore; -@property int dexterityScore; -@property int constitutionScore; -@property int intelligenceScore; -@property int wisdomScore; -@property int charismaScore; @property int shieldBonus; @property int naturalArmorBonus; @property int hitDice; diff --git a/MonsterCards/Models/Monster.m b/MonsterCards/Models/Monster.m index 89df28f..9f0a398 100644 --- a/MonsterCards/Models/Monster.m +++ b/MonsterCards/Models/Monster.m @@ -15,33 +15,27 @@ @synthesize blindsightDistance; @synthesize burrowSpeed; @synthesize challengeRating; -@synthesize charismaScore; @synthesize climbSpeed; -@synthesize constitutionScore; @synthesize customChallengeRating; @synthesize customHP; @synthesize customProficiencyBonus; @synthesize customSpeed; @synthesize customSpeedDescription; @synthesize darkvisionDistance; -@synthesize dexterityScore; @synthesize flySpeed; @synthesize hitDice; @synthesize hover; @synthesize hpText; -@synthesize intelligenceScore; @synthesize isBlind; @synthesize naturalArmorBonus; @synthesize otherArmorDescription; @synthesize shieldBonus; @synthesize speed; -@synthesize strengthScore; @synthesize swimSpeed; @synthesize telepathy; @synthesize tremorsenseDistance; @synthesize truesightDistance; @synthesize understandsBut; -@synthesize wisdomScore; +(int)abilityModifierForScore: (int)score { return (int)floor((score - 10) / 2.0); diff --git a/MonsterCards/MonsterCards.xcdatamodeld/MonsterCards.xcdatamodel/contents b/MonsterCards/MonsterCards.xcdatamodeld/MonsterCards.xcdatamodel/contents index 928c297..d6bd62e 100644 --- a/MonsterCards/MonsterCards.xcdatamodeld/MonsterCards.xcdatamodel/contents +++ b/MonsterCards/MonsterCards.xcdatamodeld/MonsterCards.xcdatamodel/contents @@ -2,12 +2,18 @@ + + + + + + - + \ No newline at end of file