|
@@ -270,46 +270,44 @@ static byte MakeDutchTownName(char *buf,
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
static byte MakeFinnishTownName(char *buf, uint32 seed)
|
|
|
{
|
|
|
//null terminates the string for strcat
|
|
|
strcpy(buf, "");
|
|
|
|
|
|
// Select randomly if town name should consists of one or two parts.
|
|
|
if (SeedChance(0, 15, seed) >= 10) {
|
|
|
strcat(buf, name_finnish_real[SeedChance( 2, lengthof(name_finnish_real), seed)]);
|
|
|
}
|
|
|
// A two-part name by combining one of name_finnish_1 + "la"/"lä"
|
|
|
// The reason for not having the contents of name_finnish_{1,2} in the same table is
|
|
|
// that the ones in name_finnish_2 are not good for this purpose.
|
|
|
else if (SeedChance(0, 15, seed) >= 5) {
|
|
|
} else if (SeedChance(0, 15, seed) >= 5) {
|
|
|
// A two-part name by combining one of name_finnish_1 + "la"/"lä"
|
|
|
// The reason for not having the contents of name_finnish_{1,2} in the same table is
|
|
|
// that the ones in name_finnish_2 are not good for this purpose.
|
|
|
uint sel = SeedChance( 0, lengthof(name_finnish_1), seed);
|
|
|
char *last;
|
|
|
strcat(buf, name_finnish_1[sel]);
|
|
|
last = &buf[strlen(buf)-1];
|
|
|
if (*last == 'i')
|
|
|
*last = 'e';
|
|
|
if (strstr(buf, "a") || strstr(buf, "o") || strstr(buf, "u") ||
|
|
|
strstr(buf, "A") || strstr(buf, "O") || strstr(buf, "U"))
|
|
|
{
|
|
|
strcat(buf, "la");
|
|
|
} else {
|
|
|
strcat(buf, "lä");
|
|
|
}
|
|
|
}
|
|
|
// A two-part name by combining one of name_finnish_{1,2} + name_finnish_3.
|
|
|
// Why aren't name_finnish_{1,2} just one table? See above.
|
|
|
else {
|
|
|
} else {
|
|
|
// A two-part name by combining one of name_finnish_{1,2} + name_finnish_3.
|
|
|
// Why aren't name_finnish_{1,2} just one table? See above.
|
|
|
uint sel = SeedChance(2,
|
|
|
lengthof(name_finnish_1) + lengthof(name_finnish_2), seed);
|
|
|
if (sel >= lengthof(name_finnish_1)) {
|
|
|
strcat(buf, name_finnish_2[sel-lengthof(name_finnish_1)]);
|
|
|
} else {
|
|
|
strcat(buf, name_finnish_1[sel]);
|
|
|
}
|
|
|
strcat(buf, name_finnish_3[SeedChance(10, lengthof(name_finnish_3), seed)]);
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -415,28 +413,29 @@ static byte MakeCzechTownName(char *buf,
|
|
|
|
|
|
// Load the postfix (1:1 chance that a postfix will be inserted)
|
|
|
postfix = SeedModChance(14, lengthof(name_czech_subst_postfix) * 2, seed);
|
|
|
|
|
|
if (choose & CZC_POSTFIX) {
|
|
|
// Always get a real postfix.
|
|
|
postfix %= lengthof(name_czech_subst_postfix);
|
|
|
}
|
|
|
if (choose & CZC_NOPOSTFIX) {
|
|
|
// Always drop a postfix.
|
|
|
postfix += lengthof(name_czech_subst_postfix);
|
|
|
}
|
|
|
if (postfix < lengthof(name_czech_subst_postfix))
|
|
|
if (postfix < lengthof(name_czech_subst_postfix)) {
|
|
|
choose |= CZC_POSTFIX;
|
|
|
else
|
|
|
} else {
|
|
|
choose |= CZC_NOPOSTFIX;
|
|
|
}
|
|
|
|
|
|
// Localize the array segment containing a good gender
|
|
|
for (ending = 0; ending < (int) lengthof(name_czech_subst_ending); ending++) {
|
|
|
const CzechNameSubst *e = &name_czech_subst_ending[ending];
|
|
|
|
|
|
if (gender == CZG_FREE ||
|
|
|
(gender == CZG_NFREE && e->gender != CZG_SNEUT && e->gender != CZG_PNEUT) ||
|
|
|
gender == e->gender) {
|
|
|
if (ending_start < 0)
|
|
|
ending_start = ending;
|
|
|
|
|
|
} else if (ending_start >= 0) {
|