From 8dde2db07f7d1ba8ddae285013642e54b9a69b17 Mon Sep 17 00:00:00 2001 From: Tom Hicks Date: Thu, 2 Mar 2023 00:47:18 -0800 Subject: [PATCH] Cleans up NewCharacter. --- TODO.md | 7 ------- dos/sbf/sbf.bas | 32 +++++++++++++------------------- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/TODO.md b/TODO.md index 076bf07..78298d6 100644 --- a/TODO.md +++ b/TODO.md @@ -18,13 +18,6 @@ * Spending virtue points # Low Priority -* Calculating values not directly queried for. - * Conviction - * Instinct - * Generation - * Willpower - * Humanity/RoadValue -* Change character initializer to use abilityGroups/abilities instead of individual setTalent, setSkill, setKnowledge * Rename items, abilities/abilities, abilityGroups rename the shared arrays and constants too * Change CharacterType to use fields like attribute_1_1 instead of attr_strength * Same for abilities like knowledge_computer -> ability_3_2, background_allies -> background_1, and discipline_obeah -> discipline_13. diff --git a/dos/sbf/sbf.bas b/dos/sbf/sbf.bas index 803a7e7..5d1e3ac 100644 --- a/dos/sbf/sbf.bas +++ b/dos/sbf/sbf.bas @@ -1115,32 +1115,26 @@ Sub NewCharacter (ch As CharacterType) ch.willpower = 0 ' Arrays/Objects - ' Disciplines - For index = 1 To DISCIPLINES_COUNT - Call SetDiscipline(ch, index, 0) - Next - ' Attributes - For GroupIndex = 1 To ATTRIBUTE_GROUPS_COUNT - For AttributeIndex = 1 To GetNumAttributesInGroup(GroupIndex) - Call SetAttributeValue(ch, GroupIndex, AttributeIndex, 1) + ' Abilities (Talents/Skills/Knowledges) + For groupIndex = 1 To ABILITY_GROUPS_COUNT + For index = 1 To GetNumItemsForAbilityGroup(groupIndex) + Call SetAbilityValue(ch, groupIndex, index, 0) Next Next - ' Talents - For index = 1 To TALENTS_COUNT - Call SetTalent(ch, index, 0) - Next - ' Skills - For index = 1 To SKILLS_COUNT - Call SetSkill(ch, index, 0) - Next - ' Knowledges - For index = 1 To KNOWLEDGES_COUNT - Call SetKnowledge(ch, index, 0) + ' Attributes + For groupIndex = 1 To ATTRIBUTE_GROUPS_COUNT + For index = 1 To GetNumAttributesInGroup(groupIndex) + Call SetAttributeValue(ch, groupIndex, index, 1) + Next Next ' Backgrounds For index = 1 To BACKGROUNDS_COUNT Call SetBackground(ch, index, 0) Next + ' Disciplines + For index = 1 To DISCIPLINES_COUNT + Call SetDiscipline(ch, index, 0) + Next End Sub Sub BuildMenu (items() As MenuItem, labels() As String, count As Integer)