Refactors constants out of Character.h.
This commit is contained in:
@@ -17,6 +17,7 @@ using std::vector;
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
const int kBackgroundPoints = 5;
|
const int kBackgroundPoints = 5;
|
||||||
|
const int kInitialGeneration = 13;
|
||||||
|
|
||||||
CharacterType::CharacterType() {
|
CharacterType::CharacterType() {
|
||||||
// Scalars
|
// Scalars
|
||||||
@@ -741,4 +742,16 @@ int CharacterType::GetRoadValue() const {
|
|||||||
void CharacterType::SetRoadValue(int value) {
|
void CharacterType::SetRoadValue(int value) {
|
||||||
road_value = value;
|
road_value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CharacterType::SetGeneration(int value) {
|
||||||
|
generation = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CharacterType::GetGeneration() const {
|
||||||
|
return generation;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetInitialGeneration() {
|
||||||
|
return kInitialGeneration;
|
||||||
|
}
|
||||||
} // End namespace SBF
|
} // End namespace SBF
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ int GetAttributePointsForRank(int rank_id);
|
|||||||
int GetBackgroundPoints();
|
int GetBackgroundPoints();
|
||||||
int GetDisciplinePoints();
|
int GetDisciplinePoints();
|
||||||
int GetVirtuePoints();
|
int GetVirtuePoints();
|
||||||
const int kInitialGeneration = 13;
|
int GetInitialGeneration();
|
||||||
|
|
||||||
class CharacterType {
|
class CharacterType {
|
||||||
public:
|
public:
|
||||||
@@ -49,6 +49,7 @@ class CharacterType {
|
|||||||
int GetDisciplineValue(int id) const;
|
int GetDisciplineValue(int id) const;
|
||||||
std::vector<int> GetDisciplineValues() const;
|
std::vector<int> GetDisciplineValues() const;
|
||||||
int GetFreebiePoints() const;
|
int GetFreebiePoints() const;
|
||||||
|
int GetGeneration() const;
|
||||||
int GetKnowledgeValue(int id) const;
|
int GetKnowledgeValue(int id) const;
|
||||||
int GetMentalAttributeValue(int id) const;
|
int GetMentalAttributeValue(int id) const;
|
||||||
int GetPhysicalAttributeValue(int id) const;
|
int GetPhysicalAttributeValue(int id) const;
|
||||||
@@ -64,6 +65,7 @@ class CharacterType {
|
|||||||
void SetBackgroundValue(int id, int value);
|
void SetBackgroundValue(int id, int value);
|
||||||
void SetDisciplineValue(int id, int value);
|
void SetDisciplineValue(int id, int value);
|
||||||
void SetFreebiePoints(int value);
|
void SetFreebiePoints(int value);
|
||||||
|
void SetGeneration(int value);
|
||||||
void SetKnowledgeValue(int id, int value);
|
void SetKnowledgeValue(int id, int value);
|
||||||
void SetMentalAttributeValue(int id, int value);
|
void SetMentalAttributeValue(int id, int value);
|
||||||
void SetPhysicalAttributeValue(int id, int value);
|
void SetPhysicalAttributeValue(int id, int value);
|
||||||
@@ -87,7 +89,6 @@ class CharacterType {
|
|||||||
int conscience;
|
int conscience;
|
||||||
int selfControl;
|
int selfControl;
|
||||||
int courage;
|
int courage;
|
||||||
int generation;
|
|
||||||
int willpower;
|
int willpower;
|
||||||
int bloodPool;
|
int bloodPool;
|
||||||
int derangementId;
|
int derangementId;
|
||||||
@@ -95,6 +96,7 @@ class CharacterType {
|
|||||||
private:
|
private:
|
||||||
// Scalars
|
// Scalars
|
||||||
int freebie_points;
|
int freebie_points;
|
||||||
|
int generation;
|
||||||
std::string road_name;
|
std::string road_name;
|
||||||
int road_value;
|
int road_value;
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "Random.h"
|
#include "Random.h"
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
#include "sbf-cpp/Abilities.h"
|
#include "sbf-cpp/Abilities.h"
|
||||||
|
#include "sbf-cpp/Backgrounds.h"
|
||||||
|
|
||||||
namespace SBF {
|
namespace SBF {
|
||||||
namespace {
|
namespace {
|
||||||
@@ -379,7 +380,7 @@ void ShowCharacterSheet(CharacterType& ch) {
|
|||||||
MaybeClearScreen();
|
MaybeClearScreen();
|
||||||
cout << "╔══════════════════════════════════════╦═══════════════════════════════════════╗" << endl;
|
cout << "╔══════════════════════════════════════╦═══════════════════════════════════════╗" << endl;
|
||||||
cout << "║ Name: " << MakeFitL(ch.name, 30) << " ║ Gender: " << MakeFitL(GetGenderLabel(ch.genderId), 14)
|
cout << "║ Name: " << MakeFitL(ch.name, 30) << " ║ Gender: " << MakeFitL(GetGenderLabel(ch.genderId), 14)
|
||||||
<< " Generation: " << MakeFitR(to_string(ch.generation), 2) << " ║" << endl;
|
<< " Generation: " << MakeFitR(to_string(ch.GetGeneration()), 2) << " ║" << endl;
|
||||||
cout << "║ Clan: " << MakeFitL(GetClanLabel(ch.clanId), 30) << " ║ Age: " << MakeFitL(ch.age, 32) << " ║" << endl;
|
cout << "║ Clan: " << MakeFitL(GetClanLabel(ch.clanId), 30) << " ║ Age: " << MakeFitL(ch.age, 32) << " ║" << endl;
|
||||||
cout << "╠══════════════════════════════════════╣ Player: " << MakeFitL(ch.player, 29) << " ║" << endl;
|
cout << "╠══════════════════════════════════════╣ Player: " << MakeFitL(ch.player, 29) << " ║" << endl;
|
||||||
cout << "║ Attributes ║ Chronicle: " << MakeFitL(ch.chronicle, 26) << " ║" << endl;
|
cout << "║ Attributes ║ Chronicle: " << MakeFitL(ch.chronicle, 26) << " ║" << endl;
|
||||||
@@ -503,7 +504,7 @@ void CharacterGenerator() {
|
|||||||
CGGetRoad(ch);
|
CGGetRoad(ch);
|
||||||
CGSpendVirtuePoints(ch);
|
CGSpendVirtuePoints(ch);
|
||||||
CGGetDerangement(ch);
|
CGGetDerangement(ch);
|
||||||
ch.generation = kInitialGeneration - ch.GetBackgroundValue(kBackgroundGenerationId);
|
ch.SetGeneration(GetInitialGeneration() - ch.GetBackgroundValue(kBackgroundGenerationId));
|
||||||
ch.willpower = ch.courage;
|
ch.willpower = ch.courage;
|
||||||
ch.SetRoadValue(ch.conscience + ch.selfControl);
|
ch.SetRoadValue(ch.conscience + ch.selfControl);
|
||||||
ch.bloodPool = GetRandomInt(1, 10);
|
ch.bloodPool = GetRandomInt(1, 10);
|
||||||
|
|||||||
Reference in New Issue
Block a user