Renames armorName to armorType.

Sets default values for core data fields.
Moves hit dice and hp related fields into the basic info section of the editor.
This commit is contained in:
2020-09-26 17:12:35 -07:00
parent ec7f827123
commit 57bf1f2e3a
5 changed files with 107 additions and 85 deletions

View File

@@ -333,8 +333,8 @@
isa = PBXGroup;
children = (
E22F837D2511E8350072105C /* Helpers */,
E2592B8B250D6B6000906A40 /* Views */,
E2FD91E225047C1D00D5E935 /* Models */,
E2592B8B250D6B6000906A40 /* Views */,
E2F7249525005E8A007D87ED /* MonsterCardsTests.m */,
E2F7249725005E8A007D87ED /* Info.plist */,
);

View File

@@ -112,7 +112,7 @@ NSString* const kMonsterSizeGargantuan = @"gargantuan";
self.hpText = [JSONHelper readStringFromDictionary:jsonRoot forKey:@"hpText" withDefaultValue:@""];
self.alignment = [JSONHelper readStringFromDictionary:jsonRoot forKey:@"alignment" withDefaultValue:@""];
self.armorName = [JSONHelper readStringFromDictionary:jsonRoot forKey:@"armorName" withDefaultValue:@""];
self.armorType = [JSONHelper readStringFromDictionary:jsonRoot forKey:@"armorName" withDefaultValue:@""];
self.otherArmorDescription = [JSONHelper readStringFromDictionary:jsonRoot forKey:@"otherArmorDesc" withDefaultValue:@""];
self.strengthScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"strPoints" withDefaultValue:0];
self.dexterityScore = [JSONHelper readIntFromDictionary:jsonRoot forKey:@"dexPoints" withDefaultValue:0];
@@ -195,69 +195,69 @@ NSString* const kMonsterSizeGargantuan = @"gargantuan";
//getArmorClass
-(NSString*)armorClassDescription {
BOOL hasShield = [self shieldBonus] != 0;
NSString *armorName = [self armorName];
if ([StringHelper isStringNilOrEmpty:armorName] || [kArmorNameNone isEqualToString:armorName]) {
NSString *armorType = [self armorType];
if ([StringHelper isStringNilOrEmpty:armorType] || [kArmorNameNone isEqualToString:armorType]) {
// 10 + dexMod + 2 for shieldBonus "15" or "17 (shield)"
int armorClass = kArmorClassUnarmored + self.dexterityModifier + self.shieldBonus;
return [NSString stringWithFormat:@"%d%@", armorClass, (hasShield ? @" (shield)" : @"")];
} else if ([kArmorNameNaturalArmor isEqualToString:armorName]) {
} else if ([kArmorNameNaturalArmor isEqualToString:armorType]) {
// 10 + dexMod + naturalArmorBonus + 2 for shieldBonus "16 (natural armor)" or "18 (natural armor, shield)"
int armorClass = kArmorClassUnarmored + self.dexterityModifier + self.naturalArmorBonus + self.shieldBonus;
return [NSString stringWithFormat:@"%d (natural armor%@)", armorClass, (hasShield ? @" (shield)" : @"")];
} else if ([kArmorNameMageArmor isEqualToString:armorName]) {
} else if ([kArmorNameMageArmor isEqualToString:armorType]) {
// 10 + dexMod + 2 for shield + 3 for mage armor "15 (18 with mage armor)" or 17 (shield, 20 with mage armor)
int armorClass = kArmorClassUnarmored + self.dexterityModifier + self.shieldBonus;
int armorClassWithMageArmor = kArmorClassMageArmor + self.dexterityModifier + self.shieldBonus;
return [NSString stringWithFormat:@"%d (%@%d with mage armor)", armorClass, (hasShield ? @"shield, " : @""), armorClassWithMageArmor];
} else if ([kArmorNamePadded isEqualToString:armorName]) {
} else if ([kArmorNamePadded isEqualToString:armorType]) {
// 11 + dexMod + 2 for shield "18 (padded armor, shield)"
int armorClass = kArmorClassPadded + self.dexterityModifier + self.shieldBonus;
return [NSString stringWithFormat:@"%d (padded%@)", armorClass, (hasShield ? @"shield, " : @"")];
} else if ([kArmorNameLeather isEqualToString:armorName]) {
} else if ([kArmorNameLeather isEqualToString:armorType]) {
// 11 + dexMod + 2 for shield "18 (leather, shield)"
int armorClass = kArmorClassLeather + self.dexterityModifier + self.shieldBonus;
return [NSString stringWithFormat:@"%d (leather%@)", armorClass, (hasShield ? @"shield, " : @"")];
} else if ([kArmorNameStuddedLeather isEqualToString:armorName]) {
} else if ([kArmorNameStuddedLeather isEqualToString:armorType]) {
// 12 + dexMod +2 for shield "17 (studded leather)"
int armorClass = kArmorClassStudded + self.dexterityModifier + self.shieldBonus;
return [NSString stringWithFormat:@"%d (studded leather%@)", armorClass, (hasShield ? @"shield, " : @"")];
} else if ([kArmorNameHide isEqualToString:armorName]) {
} else if ([kArmorNameHide isEqualToString:armorType]) {
// 12 + Min(2, dexMod) + 2 for shield "12 (hide armor)"
int armorClass = kArmorClassHide + MIN(2, self.dexterityModifier) + self.shieldBonus;
return [NSString stringWithFormat:@"%d (hide%@)", armorClass, (hasShield ? @", shield" : @"")];
} else if ([kArmorNameChainShirt isEqualToString:armorName]) {
} else if ([kArmorNameChainShirt isEqualToString:armorType]) {
// 13 + Min(2, dexMod) + 2 for shield "12 (chain shirt)"
int armorClass = kArmorClassChainShirt + MIN(2, self.dexterityModifier) + self.shieldBonus;
return [NSString stringWithFormat:@"%d (chain shirt%@)", armorClass, (hasShield ? @", shield" : @"")];
} else if ([kArmorNameScaleMail isEqualToString:armorName]) {
} else if ([kArmorNameScaleMail isEqualToString:armorType]) {
// 14 + Min(2, dexMod) + 2 for shield "14 (scale mail)"
int armorClass = kArmorClassScaleMail + MIN(2, self.dexterityModifier) + self.shieldBonus;
return [NSString stringWithFormat:@"%d (scale mail%@)", armorClass, (hasShield ? @", shield" : @"")];
} else if ([kArmorNameBreastplate isEqualToString:armorName]) {
} else if ([kArmorNameBreastplate isEqualToString:armorType]) {
// 14 + Min(2, dexMod) + 2 for shield "16 (breastplate)"
int armorClass = kArmorClassBreastplate + MIN(2, self.dexterityModifier) + self.shieldBonus;
return [NSString stringWithFormat:@"%d (breastplate%@)", armorClass, (hasShield ? @", shield" : @"")];
} else if ([kArmorNameHalfPlate isEqualToString:armorName]) {
} else if ([kArmorNameHalfPlate isEqualToString:armorType]) {
// 15 + Min(2, dexMod) + 2 for shield "17 (half plate)"
int armorClass = kArmorClassHalfPlate + MIN(2, self.dexterityModifier) + self.shieldBonus;
return [NSString stringWithFormat:@"%d (half plate%@)", armorClass, (hasShield ? @", shield" : @"")];
} else if ([kArmorNameRingMail isEqualToString:armorName]) {
} else if ([kArmorNameRingMail isEqualToString:armorType]) {
// 14 + 2 for shield "14 (ring mail)
int armorClass = kArmorClassRingMail + self.shieldBonus;
return [NSString stringWithFormat:@"%d (ring mail%@)", armorClass, (hasShield ? @", shield" : @"")];
} else if ([kArmorNameChainMail isEqualToString:armorName]) {
} else if ([kArmorNameChainMail isEqualToString:armorType]) {
// 16 + 2 for shield "16 (chain mail)"
int armorClass = kArmorClassChainMail + self.shieldBonus;
return [NSString stringWithFormat:@"%d (chain mail%@)", armorClass, (hasShield ? @", shield" : @"")];
} else if ([kArmorNameSplintMail isEqualToString:armorName]) {
} else if ([kArmorNameSplintMail isEqualToString:armorType]) {
// 17 + 2 for shield "17 (splint)"
int armorClass = kArmorClassSplintMail + self.shieldBonus;
return [NSString stringWithFormat:@"%d (splint%@)", armorClass, (hasShield ? @", shield" : @"")];
} else if ([kArmorNamePlateMail isEqualToString:armorName]) {
} else if ([kArmorNamePlateMail isEqualToString:armorType]) {
// 18 + 2 for shield "18 (plate)"
int armorClass = kArmorClassPlate + self.shieldBonus;
return [NSString stringWithFormat:@"%d (plate%@)", armorClass, (hasShield ? @", shield" : @"")];
} else if ([kArmorNameOther isEqualToString:armorName]) {
} else if ([kArmorNameOther isEqualToString:armorType]) {
// pure string value shield check does nothing just copies the string from otherArmorDesc
return self.otherArmorDescription;
} else {
@@ -490,7 +490,7 @@ NSString* const kMonsterSizeGargantuan = @"gargantuan";
self.intelligenceScore = monster.intelligenceScore;
self.wisdomScore = monster.wisdomScore;
self.charismaScore = monster.charismaScore;
self.armorName = monster.armorName;
self.armorType = monster.armorType;
self.otherArmorDescription = monster.otherArmorDescription;
self.shieldBonus = monster.shieldBonus;
self.customHP = monster.customHP;

View File

@@ -1,33 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="17192" systemVersion="19G2021" minimumToolsVersion="Automatic" sourceLanguage="Objective-C" usedWithCloudKit="YES" userDefinedModelVersionIdentifier="">
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="17192" systemVersion="19H2" minimumToolsVersion="Automatic" sourceLanguage="Objective-C" usedWithCloudKit="YES" userDefinedModelVersionIdentifier="">
<entity name="Monster" representedClassName="Monster" syncable="YES" codeGenerationType="category">
<attribute name="alignment" attributeType="String" defaultValueString=""/>
<attribute name="armorName" optional="YES" attributeType="String" defaultValueString=""/>
<attribute name="baseSpeed" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="burrowSpeed" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="canHover" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="charismaScore" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="climbSpeed" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="constitutionScore" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="customHP" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="customSpeed" optional="YES" attributeType="String"/>
<attribute name="dexterityScore" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="flySpeed" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="hasCustomSpeed" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="hitDice" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="hpText" optional="YES" attributeType="String" defaultValueString=""/>
<attribute name="intelligenceScore" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="armorType" attributeType="String" defaultValueString=""/>
<attribute name="baseSpeed" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="burrowSpeed" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="canHover" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="charismaScore" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="climbSpeed" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="constitutionScore" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="customArmor" attributeType="String" defaultValueString=""/>
<attribute name="customHP" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="customSpeed" attributeType="String" defaultValueString=""/>
<attribute name="dexterityScore" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="flySpeed" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="hasCustomSpeed" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="hasShield" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="hitDice" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="hpText" attributeType="String" defaultValueString=""/>
<attribute name="intelligenceScore" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="name" attributeType="String" defaultValueString=""/>
<attribute name="otherArmorDescription" optional="YES" attributeType="String" defaultValueString=""/>
<attribute name="shieldBonus" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="natrualArmorBonus" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="otherArmorDescription" attributeType="String" defaultValueString=""/>
<attribute name="shieldBonus" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="size" attributeType="String" defaultValueString=""/>
<attribute name="strengthScore" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="strengthScore" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="subtype" attributeType="String" defaultValueString=""/>
<attribute name="swimSpeed" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="swimSpeed" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="type" attributeType="String" defaultValueString=""/>
<attribute name="wisdomScore" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="wisdomScore" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
</entity>
<elements>
<element name="Monster" positionX="-63" positionY="-18" width="128" height="418"/>
<element name="Monster" positionX="-63" positionY="-18" width="128" height="463"/>
</elements>
</model>

View File

@@ -28,10 +28,14 @@ const int kBasicInfoSectionRowIndexSize = 1;
const int kBasicInfoSectionRowIndexType = 2;
const int kBasicInfoSectionRowIndexSubtype = 3;
const int kBasicInfoSectionRowIndexAlignment = 4;
const int kBasicInfoSectionRowIndexHitDice = 5;
const int kBasicInfoSectionRowIndexCustomHP = 6;
const int kBasicInfoSectionRowIndexCustomHPText = 7;
const int kArmorSectionRowIndexHitDice = 0;
const int kArmorSectionRowIndexCustomHP = 1;
const int kArmorSectionRowIndexCustomHPText = 2;
const int kArmorSectionRowIndexArmorType = 0;
const int kArmorSectionRowIndexHasShield = 1;
const int kArmorSectionRowIndexNaturalArmorBonus = 2;
const int kArmorSectionRowIndexCustomArmor = 3;
const int kSpeedSectionRowIndexBaseSpeed = 0;
const int kSpeedSectionRowIndexBurrowSpeed = 1;
@@ -154,9 +158,9 @@ const int kAbilityScoreSectionRowIndexCharisma = 5;
// * Type
// * Subtype
// * Alignment
return 5;
return 8;
case kSectionIndexArmor:
return 3;
return 0;
case kSectionIndexSpeed:
return 8;
case kSectionIndexAbilityScores:
@@ -224,105 +228,120 @@ titleForHeaderInSection:(NSInteger)section {
label: NSLocalizedString(@"Alignment", @"Placeholder text for the alignment of a monster or NPC.")
andInitialValue:self.editingMonster.alignment];
break;
case kBasicInfoSectionRowIndexHitDice:
newCell = [self makeIntegerCellFromTableView:self.monsterTableView
withIdentifier:@"monster.hitDice"
label:NSLocalizedString(@"Hit Dice", @"")
andInitialValue:self.editingMonster.hitDice];
break;
case kBasicInfoSectionRowIndexCustomHP:
newCell = [self makeBooleanCellFromTableView:self.monsterTableView
withIdentifier:@"monster.customHP"
label:NSLocalizedString(@"Custom HP", @"")
andInitialValue:self.editingMonster.customHP];
break;
case kBasicInfoSectionRowIndexCustomHPText:
newCell = [self makeShortStringCellFromTableView:self.monsterTableView
withIdentifier:@"monster.customHPText"
label:NSLocalizedString(@"Custom HP Text", @"")
andInitialValue:self.editingMonster.hpText];
break;
}
break;
case kSectionIndexArmor:
switch (indexPath.row) {
case kArmorSectionRowIndexHitDice:
return [self makeIntegerCellFromTableView:self.monsterTableView
withIdentifier:@"monster.hitDice"
label:NSLocalizedString(@"Hit Dice", @"")
andInitialValue:self.editingMonster.hitDice];
case kArmorSectionRowIndexCustomHP:
return [self makeBooleanCellFromTableView:self.monsterTableView
withIdentifier:@"monster.customHP"
label:NSLocalizedString(@"Custom HP", @"")
andInitialValue:self.editingMonster.customHP];
return nil;
case kArmorSectionRowIndexCustomHPText:
return [self makeShortStringCellFromTableView:self.monsterTableView
withIdentifier:@"monster.customHPText"
label:NSLocalizedString(@"Custom HP Text", @"")
andInitialValue:self.editingMonster.hpText];
}
break;
case kSectionIndexSpeed:
switch (indexPath.row) {
case kSpeedSectionRowIndexBaseSpeed:
return [self makeIntegerCellFromTableView:self.monsterTableView
newCell = [self makeIntegerCellFromTableView:self.monsterTableView
withIdentifier:@"monster.baseSpeed"
label:NSLocalizedString(@"Base", @"")
andInitialValue:self.editingMonster.baseSpeed];
break;
case kSpeedSectionRowIndexBurrowSpeed:
return [self makeIntegerCellFromTableView:self.monsterTableView
newCell = [self makeIntegerCellFromTableView:self.monsterTableView
withIdentifier:@"monster.burrowSpeed"
label:NSLocalizedString(@"Burrow", @"")
andInitialValue:self.editingMonster.burrowSpeed];
break;
case kSpeedSectionRowIndexClimbSpeed:
return [self makeIntegerCellFromTableView:self.monsterTableView
newCell = [self makeIntegerCellFromTableView:self.monsterTableView
withIdentifier:@"monster.climbSpeed"
label:NSLocalizedString(@"Climb", @"")
andInitialValue:self.editingMonster.climbSpeed];
break;
case kSpeedSectionRowIndexFlySpeed:
return [self makeIntegerCellFromTableView:self.monsterTableView
newCell = [self makeIntegerCellFromTableView:self.monsterTableView
withIdentifier:@"monster.flySpeed"
label:NSLocalizedString(@"Fly", @"")
andInitialValue:self.editingMonster.flySpeed];
break;
case kSpeedSectionRowIndexCanHover:
return [self makeBooleanCellFromTableView:self.monsterTableView
newCell = [self makeBooleanCellFromTableView:self.monsterTableView
withIdentifier:@"monster.canHover"
label:NSLocalizedString(@"Hover", @"")
andInitialValue:self.editingMonster.canHover];
break;
case kSpeedSectionRowIndexSwimSpeed:
return [self makeIntegerCellFromTableView:self.monsterTableView
newCell = [self makeIntegerCellFromTableView:self.monsterTableView
withIdentifier:@"monster.swimSpeed"
label:NSLocalizedString(@"Swim", @"")
andInitialValue:self.editingMonster.swimSpeed];
break;
case kSpeedSectionRowIndexHasCustomSpeed:
return [self makeBooleanCellFromTableView:self.monsterTableView
newCell = [self makeBooleanCellFromTableView:self.monsterTableView
withIdentifier:@"monster.hasCustomSpeed"
label:NSLocalizedString(@"Custom Speed", @"")
andInitialValue:self.editingMonster.hasCustomSpeed];
break;
case kSpeedSectionRowIndexCustomSpeed:
return [self makeShortStringCellFromTableView:self.monsterTableView
newCell = [self makeShortStringCellFromTableView:self.monsterTableView
withIdentifier:@"monster.customSpeed"
label:NSLocalizedString(@"Custom Speed", @"")
andInitialValue:self.editingMonster.customSpeed];
break;
}
break;
case kSectionIndexAbilityScores:
switch (indexPath.row) {
case kAbilityScoreSectionRowIndexStrength:
return [self makeIntegerCellFromTableView:self.monsterTableView
newCell = [self makeIntegerCellFromTableView:self.monsterTableView
withIdentifier:@"monster.strengthScore"
label:NSLocalizedString(@"STR", @"Placeholder abbreviation for the strength score of a monster or NPC.")
andInitialValue:self.editingMonster.strengthScore];
break;
case kAbilityScoreSectionRowIndexDexterity:
return [self makeIntegerCellFromTableView:self.monsterTableView
newCell = [self makeIntegerCellFromTableView:self.monsterTableView
withIdentifier:@"monster.dexterityScore"
label:NSLocalizedString(@"DEX", @"Placeholder abbreviation for the dexterity score of a monster or NPC.")
andInitialValue:self.editingMonster.dexterityScore];
break;
case kAbilityScoreSectionRowIndexConstitution:
return [self makeIntegerCellFromTableView:self.monsterTableView
newCell = [self makeIntegerCellFromTableView:self.monsterTableView
withIdentifier:@"monster.constitutionScore"
label:NSLocalizedString(@"CON", @"Placeholder abbreviation for the constitution score of a monster or NPC.")
andInitialValue:self.editingMonster.constitutionScore];
break;
case kAbilityScoreSectionRowIndexIntelligence:
return [self makeIntegerCellFromTableView:self.monsterTableView
newCell = [self makeIntegerCellFromTableView:self.monsterTableView
withIdentifier:@"monster.intelligenceScore"
label:NSLocalizedString(@"INT", @"Placeholder abbreviation for the intelligence score of a monster or NPC.")
andInitialValue:self.editingMonster.intelligenceScore];
break;
case kAbilityScoreSectionRowIndexWisdom:
return [self makeIntegerCellFromTableView:self.monsterTableView
newCell = [self makeIntegerCellFromTableView:self.monsterTableView
withIdentifier:@"monster.wisdomScore"
label:NSLocalizedString(@"WIS", @"Placeholder abbreviation for the wisdom score of a monster or NPC.")
andInitialValue:self.editingMonster.wisdomScore];
break;
case kAbilityScoreSectionRowIndexCharisma:
return [self makeIntegerCellFromTableView:self.monsterTableView
newCell = [self makeIntegerCellFromTableView:self.monsterTableView
withIdentifier:@"monster.charismaScore"
label:NSLocalizedString(@"CHA", @"Placeholder abbreviation for the charisma score of a monster or NPC.")
andInitialValue:self.editingMonster.charismaScore];
break;
}
break;

View File

@@ -46,7 +46,7 @@
XCTAssertEqual(0, _monster.intelligenceScore);
XCTAssertEqual(0, _monster.wisdomScore);
XCTAssertEqual(0, _monster.charismaScore);
XCTAssertEqualObjects(@"", _monster.armorName);
XCTAssertEqualObjects(@"", _monster.armorType);
XCTAssertEqualObjects(@"", _monster.otherArmorDescription);
XCTAssertEqual(0, _monster.shieldBonus);
XCTAssertEqual(NO, _monster.customHP);
@@ -68,7 +68,7 @@
XCTAssertEqual(14, _monster.intelligenceScore);
XCTAssertEqual(16, _monster.wisdomScore);
XCTAssertEqual(18, _monster.charismaScore);
XCTAssertEqualObjects(@"none", _monster.armorName);
XCTAssertEqualObjects(@"none", _monster.armorType);
XCTAssertEqualObjects(@"10", _monster.otherArmorDescription);
XCTAssertEqual(2, _monster.shieldBonus);
XCTAssertEqual(YES, _monster.customHP);
@@ -91,7 +91,7 @@
XCTAssertEqual(0, _monster.intelligenceScore);
XCTAssertEqual(0, _monster.wisdomScore);
XCTAssertEqual(0, _monster.charismaScore);
XCTAssertEqualObjects(@"", _monster.armorName);
XCTAssertEqualObjects(@"", _monster.armorType);
XCTAssertEqualObjects(@"", _monster.otherArmorDescription);
XCTAssertEqual(0, _monster.shieldBonus);
XCTAssertEqual(NO, _monster.customHP);
@@ -114,7 +114,7 @@
XCTAssertEqual(14, _monster.intelligenceScore);
XCTAssertEqual(16, _monster.wisdomScore);
XCTAssertEqual(18, _monster.charismaScore);
XCTAssertEqualObjects(@"none", _monster.armorName);
XCTAssertEqualObjects(@"none", _monster.armorType);
XCTAssertEqualObjects(@"10", _monster.otherArmorDescription);
XCTAssertEqual(2, _monster.shieldBonus);
XCTAssertEqual(YES, _monster.customHP);
@@ -167,7 +167,7 @@
XCTAssertEqual(14, _monster.intelligenceScore);
XCTAssertEqual(16, _monster.wisdomScore);
XCTAssertEqual(18, _monster.charismaScore);
XCTAssertEqualObjects(@"none", _monster.armorName);
XCTAssertEqualObjects(@"none", _monster.armorType);
XCTAssertEqualObjects(@"10", _monster.otherArmorDescription);
XCTAssertEqual(2, _monster.shieldBonus);
}
@@ -385,8 +385,8 @@
}
- (void)testGetterAndSetterForArmorName {
_monster.armorName = @"dandelion";
XCTAssertEqualObjects(@"dandelion", _monster.armorName);
_monster.armorType = @"dandelion";
XCTAssertEqualObjects(@"dandelion", _monster.armorType);
}
- (void)testGetterAndSetterForOtherArmorDescription {