blob: 883b2efe84e80a64e02907044899fadd14b2d55d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
#pragma once
#include "StarThread.hpp"
#include "StarItemDescriptor.hpp"
#include "StarHumanoid.hpp"
#include "StarStatusTypes.hpp"
namespace Star {
STAR_CLASS(SpeciesDefinition);
STAR_CLASS(SpeciesDatabase);
struct SpeciesCharCreationTooltip {
String title;
String subTitle;
String description;
};
struct SpeciesGenderOption {
Gender gender;
String name;
String image;
String characterImage;
List<String> hairOptions;
String hairGroup;
List<String> shirtOptions;
List<String> pantsOptions;
String facialHairGroup;
List<String> facialHairOptions;
String facialMaskGroup;
List<String> facialMaskOptions;
};
struct SpeciesOption {
SpeciesOption();
String species;
bool headOptionAsHairColor;
bool headOptionAsFacialhair;
bool altOptionAsUndyColor;
bool altOptionAsHairColor;
bool altOptionAsFacialMask;
bool hairColorAsBodySubColor;
bool bodyColorAsFacialMaskSubColor;
bool altColorAsFacialMaskSubColor;
List<SpeciesGenderOption> genderOptions;
List<String> bodyColorDirectives;
List<String> undyColorDirectives;
List<String> hairColorDirectives;
};
class SpeciesDefinition {
public:
SpeciesDefinition(Json const& config);
String kind() const;
bool playerSelectable() const;
SpeciesOption const& options() const;
Json humanoidConfig() const;
List<Personality> const& personalities() const;
String nameGen(Gender gender) const;
String ouchNoise(Gender gender) const;
List<ItemDescriptor> defaultItems() const;
List<ItemDescriptor> defaultBlueprints() const;
StringList charGenTextLabels() const;
String skull() const;
List<PersistentStatusEffect> statusEffects() const;
String effectDirectives() const;
SpeciesCharCreationTooltip const& tooltip() const;
void generateHumanoid(HumanoidIdentity& identity, int64_t seed);
private:
String m_kind;
SpeciesCharCreationTooltip m_tooltip;
bool m_playerSelectable;
Json m_config;
String m_humanoidConfig;
Json m_humanoidOverrides;
List<Personality> m_personalities;
List<String> m_nameGen;
List<String> m_ouchNoises;
SpeciesOption m_options;
List<ItemDescriptor> m_defaultItems;
List<ItemDescriptor> m_defaultBlueprints;
StringList m_charGenTextLabels;
String m_skull;
List<PersistentStatusEffect> m_statusEffects;
String m_effectDirectives;
friend class SpeciesDatabase;
};
class SpeciesDatabase {
public:
SpeciesDatabase();
SpeciesDefinitionPtr species(String const& kind) const;
StringMap<SpeciesDefinitionPtr> allSpecies() const;
private:
StringMap<SpeciesDefinitionPtr> m_species;
};
}
|