Newer
Older
/** Get all the enunciations used by a particular slave as a destructurable object.
* @param {App.Entity.SlaveState} slave
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
globalThis.getEnunciation = function(slave) {
let ret = {};
if (SlaveStatsChecker.checkForLisp(slave)) {
if (V.PC.customTitleLisp !== undefined) {
ret.title = V.PC.customTitleLisp;
} else if (V.PC.title !== 0) {
ret.title = "Mathter";
} else {
ret.title = "Mithtreth";
}
if (V.allowFamilyTitles === 1) {
const soleParentPrefersMom = slave.father === -1 && slave.mother === -1 && V.PC.title === 0;
if (slave.father === -1 && !soleParentPrefersMom) {
if (slave.actualAge < 4 && slave.physicalAge < 4) {
ret.title = "Dadda";
} else if (slave.actualAge < 9) {
ret.title = "Daddy";
} else {
ret.title = "Dad";
}
} else if (slave.mother === -1) {
if (slave.actualAge < 4 && slave.physicalAge < 4) {
ret.title = "Mama";
} else if (slave.actualAge < 9) {
ret.title = "Mommy";
} else {
ret.title = "Mom";
}
} else if (V.PC.mother === slave.ID || V.PC.father === slave.ID) {
if (V.PC.title === 1) {
ret.title = "Thon";
} else if (V.PC.title === 0) {
ret.title = "Daughter";
}
} else if (areSisters(slave, V.PC) > 0) {
if (V.PC.title === 1) {
if (slave.actualAge < 18) {
ret.title = "Bro";
} else {
ret.title = "Brother";
}
} else if (V.PC.title === 0) {
if (slave.actualAge < 18) {
ret.title = "Thith";
} else {
ret.title = "Thithter";
}
}
}
}
if (slave.custom.titleLisp !== undefined && slave.custom.titleLisp !== "") {
if (slave.rudeTitle === 1) {
if (slave.trust > 20) {
ret.title = slave.custom.titleLisp;
}
} else {
ret.title = slave.custom.titleLisp;
}
}
ret.say = "lisp";
ret.s = "th";
ret.S = "Th";
ret.ss = "th";
ret.c = "th";
ret.C = "Th";
ret.cc = "kth";
ret.z = "th";
ret.Z = "Th";
ret.zz = "th";
ret.ch = "th";
ret.Ch = "Th";
ret.ps = "th";
ret.Ps = "Th";
ret.sh = "th";
ret.Sh = "Th";
ret.sc = "th";
ret.Sc = "Th";
ret.sch = "th";
ret.Sch = "Th";
ret.x = "kth";
ret.X = "Th";
} else {
if (V.PC.customTitle !== undefined) {
ret.title = V.PC.customTitle;
} else if (V.PC.title !== 0) {
ret.title = "Master";
} else {
ret.title = "Mistress";
}
if (V.allowFamilyTitles === 1) {
const soleParentPrefersMom = slave.father === -1 && slave.mother === -1 && V.PC.title === 0;
if (slave.father === -1 && !soleParentPrefersMom) {
if (slave.actualAge < 4 && slave.physicalAge < 4) {
ret.title = "Dadda";
} else if (slave.actualAge < 9) {
ret.title = "Daddy";
} else {
ret.title = "Dad";
}
} else if (slave.mother === -1) {
if (slave.actualAge < 4 && slave.physicalAge < 4) {
ret.title = "Mama";
} else if (slave.actualAge < 9) {
ret.title = "Mommy";
} else {
ret.title = "Mom";
}
} else if (V.PC.mother === slave.ID || V.PC.father === slave.ID) {
if (V.PC.title === 1) {
ret.title = "Son";
} else if (V.PC.title === 0) {
ret.title = "Daughter";
}
} else if (areSisters(slave, V.PC) > 0) {
if (V.PC.title === 1) {
if (slave.actualAge < 18) {
ret.title = "Bro";
} else {
ret.title = "Brother";
}
} else if (V.PC.title === 0) {
if (slave.actualAge < 18) {
ret.title = "Sis";
} else {
ret.title = "Sister";
}
}
}
}
if (slave.custom.title !== undefined && slave.custom.title !== "") {
if (slave.rudeTitle === 1) {
if (slave.trust > 20) {
ret.title = slave.custom.title;
}
} else {
ret.title = slave.custom.title;
}
}
ret.say = "say";
ret.s = "s";
ret.S = "S";
ret.ss = "ss";
ret.c = "c";
ret.C = "C";
ret.cc = "cc";
ret.z = "z";
ret.Z = "Z";
ret.zz = "zz";
ret.ch = "ch";
ret.Ch = "Ch";
ret.ps = "ps";
ret.Ps = "Ps";
ret.sh = "sh";
ret.Sh = "Sh";
ret.sc = "sc";
ret.Sc = "Sc";
ret.sch = "sch";
ret.Sch = "Sch";
ret.x = "x";
ret.X = "X";
}
return ret;
};
/** Write all of the enunciations used by a slave into global state data for use by SugarCube macros.
* @param {App.Entity.SlaveState} slave
*/
globalThis.Enunciate = function(slave) {
V.enunciate = getEnunciation(slave);
};
/**
* Returns speech with lisp if slave lisps
* @param {App.Entity.SlaveState} slave
* @param {string} speech
* @returns {string}
*/
globalThis.Spoken = function(slave, speech) {
if (SlaveStatsChecker.checkForLisp(slave)) {
return lispReplace(speech);
} else {
return speech;
}
};