diff options
-rw-r--r-- | lang/english.txt | 1 | ||||
-rw-r--r-- | namegen.c | 49 | ||||
-rw-r--r-- | openttd.h | 3 | ||||
-rw-r--r-- | settings.c | 2 | ||||
-rw-r--r-- | table/namegen.h | 266 |
5 files changed, 319 insertions, 2 deletions
diff --git a/lang/english.txt b/lang/english.txt index ef823281a..41e5f46f8 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -880,6 +880,7 @@ STR_TOWNNAME_CZECH :Czech STR_TOWNNAME_SWISS :Swiss STR_TOWNNAME_DANISH :Danish STR_TOWNNAME_TURKISH :Turkish +STR_TOWNNAME_ITALIAN :Italian ############ end of townname region STR_CURR_GBP :Pounds (£) @@ -647,6 +647,54 @@ static byte MakeTurkishTownName(char *buf, uint32 seed) return 0; } +static byte MakeItalianTownName(char *buf, uint32 seed) { + + byte i; + char *c; + strcpy(buf, ""); + + if (SeedModChance(0, 6, seed) == 0) { + // real city names + strcat(buf, name_italian_real[SeedModChance(4, lengthof(name_italian_real), seed)]); + } else { + if (SeedModChance(0, 8, seed) == 0) { + // prefix + strcat(buf, name_italian_pref[SeedModChance(11, lengthof(name_italian_pref), seed)]); + } + + i = SeedModChance(0, 2, seed); + if (i == 0) { // masculine form + strcat(buf, name_italian_1m[SeedModChance(4, lengthof(name_italian_1m), seed)]); + c = "o"; + } else { // femminine form + strcat(buf, name_italian_1f[SeedModChance(4, lengthof(name_italian_1f), seed)]); + c = "a"; + } + + if (SeedModChance(0, 3, seed) == 0) { + strcat(buf, name_italian_2[SeedModChance(11, lengthof(name_italian_2), seed)]); + strcat(buf,c); + } else { + strcat(buf, name_italian_2i[SeedModChance(16, lengthof(name_italian_2i), seed)]); + } + + + if (SeedModChance(15, 4, seed) == 0) { + if (SeedModChance(0, 2, seed) == 0) { + // generic suffix + strcat(buf, name_italian_3[SeedModChance(4, lengthof(name_italian_3), seed)]); + } + else { + // river name suffix + strcat(buf, name_italian_river1[SeedModChance(4, lengthof(name_italian_river1), seed)]); + strcat(buf, name_italian_river2[SeedModChance(16, lengthof(name_italian_river2), seed)]); + } + } + } + + return 0; +} + TownNameGenerator * const _town_name_generators[] = { MakeEnglishOriginalTownName, @@ -668,6 +716,7 @@ TownNameGenerator * const _town_name_generators[] = MakeSwissTownName, MakeDanishTownName, MakeTurkishTownName, + MakeItalianTownName, }; // DO WE NEED THIS ANY MORE? @@ -472,7 +472,8 @@ enum SpecialStrings { SPECSTR_TOWNNAME_SWISS, SPECSTR_TOWNNAME_DANISH, SPECSTR_TOWNNAME_TURKISH, - SPECSTR_TOWNNAME_LAST = SPECSTR_TOWNNAME_TURKISH, + SPECSTR_TOWNNAME_ITALIAN, + SPECSTR_TOWNNAME_LAST = SPECSTR_TOWNNAME_ITALIAN, // special strings for player names on the form "TownName transport". SPECSTR_PLAYERNAME_START = 0x70EA, diff --git a/settings.c b/settings.c index b4c086e39..4e8cc5cf1 100644 --- a/settings.c +++ b/settings.c @@ -1213,7 +1213,7 @@ static const SettingDesc _gameopt_settings[] = { SDT_VAR(GameOptions, diff_level,SLE_UINT8, 0, 0, 9,0, 9, STR_NULL, NULL), SDT_OMANY(GameOptions, currency, SLE_UINT8, N, 0, 0, CUSTOM_CURRENCY_ID, "GBP|USD|EUR|YEN|ATS|BEF|CHF|CZK|DEM|DKK|ESP|FIM|FRF|GRD|HUF|ISK|ITL|NLG|NOK|PLN|ROL|RUR|SEK|custom", STR_NULL, NULL), SDT_OMANY(GameOptions, units, SLE_UINT8, N, 0, 1, 2, "imperial|metric|si", STR_NULL, NULL), - SDT_OMANY(GameOptions, town_name, SLE_UINT8, 0, 0, 0, 18, "english|french|german|american|latin|silly|swedish|dutch|finnish|polish|slovakish|norwegian|hungarian|austrian|romanian|czech|swiss|danish|turkish", STR_NULL, NULL), + SDT_OMANY(GameOptions, town_name, SLE_UINT8, 0, 0, 0, 19, "english|french|german|american|latin|silly|swedish|dutch|finnish|polish|slovakish|norwegian|hungarian|austrian|romanian|czech|swiss|danish|turkish|italian", STR_NULL, NULL), SDT_OMANY(GameOptions, landscape, SLE_UINT8, 0, 0, 0, 3, "normal|hilly|desert|candy", STR_NULL, NULL), SDT_VAR(GameOptions, snow_line, SLE_UINT8, 0, 0, 1,0,56, STR_NULL, NULL), SDT_CONDOMANY(GameOptions,autosave, SLE_UINT8, 0, 22, N, 0, 0, 0, "", STR_NULL, NULL), diff --git a/table/namegen.h b/table/namegen.h index 3a67a3694..ca2ff6af2 100644 --- a/table/namegen.h +++ b/table/namegen.h @@ -2865,3 +2865,269 @@ static const char *name_turkish_real[] = { "Osmaniye", "Düzce" }; + +static const char *name_italian_real[] = { + "Roma", + "Milano", + "Napoli", + "Torino", + "Venezia", + "Firenze", + "Palermo", + "Genova", + "Parma", + "Bologna", + "Bari", + "Cagliari", + "Sassari", + "Pisa", + "Aosta", + "Brescia", + "Verona", + "Bolzano", + "Padova", + "Udine", + "Trieste", + "Livorno", + "Ancona", + "Perugia", + "Pescara", + "L'Aquila", + "Campobasso", + "Potenza", + "Cosenza", + "Reggio Calabria", + "Catania", + "Caltanisetta", + "Agrigento", + "La Spezia", + "Modena", + "Vicenza", + "Mantova", + "Cremona", + "Piacenza", + "Reggio Emilia", + "Foggia", + "Benevento", + "Salerno", + "Catanzaro", + "Lecce", + "Como", + "Lecco", + "Sondrio", + "Trento", + "Desenzano", + "Cuneo", + "Asti", + "Lodi", + "Novara", + "Biella", + "Vercelli", + "Rieti", + "Nuoro", + "Oristano", + "Matera", + "Taranto", + "Varese", + "Bergamo", + "Pavia", + "Caserta", + "Frosinone", + "Latina", + "Enna", + "Ragusa", + "Siracusa", + "Pordenone", + "Imperia", + "Verbania", + "Alessandria", + "Messina", + "Siena", + "Arezzo", + "Grosseto", +}; + +static const char *name_italian_pref[] = { + "Alpe ", + "Borgo ", + "Cascina ", + "Castel ", + "Fonte ", + "Forte ", + "Malga ", + "Pieve ", + "Poggio ", + "Rocca ", + "Villa ", + "Villar ", +}; + +static const char *name_italian_1m[] = { + "Bel", + "Borgo", + "Bosco", + "Campo", + "Capo", + "Casal", + "Castel", + "Colle", + "Fiume", + "Fonte", + "Lago", + "Mezzo", + "Monte", + "Mon", + "Orto", + "Passo", + "Prato", + "Poggio", + "Ponte", + "Pozzo", + "Sasso", + "Tra", + "Tre", + "Ver", + "Vico", +}; + +static const char *name_italian_1f[] = { + "Acqua", + "Bra", + "Cala", + "Casa", + "Chiesa", + "Citta", + "Civita", + "Corte", + "Costa", + "Croce", + "Fontana", + "Grotta", + "Guardia", + "Mezza", + "Palma", + "Pietra", + "Ripa", + "Rocca", + "Serra", + "Torre", + "Val", + "Valle", + "Villa", +}; + +static const char *name_italian_2[] = { + "bell", + "bianc", + "cald", + "chiar", + "cort", + "ferrat", + "fier", + "fredd", + "gioios", + "grec", + "guzz", + "lung", + "long", + "migli", + "negr", + "ner", + "nov", + "nuov", + "ross", + "rotond", + "scur", + "secc", + "sett", + "vecchi", + "ventos", + "vers", + "viv", +}; + +static const char *name_italian_2i[] = { + "", + "breve", + "brevi", + "chiari", + "ferro", + "fieschi", + "fiore", + "fonte", + "forte", + "gate", + "leone", + "maggiore", + "minore", + "mole", + "monte", + "poli", + "scuri", + "terra", + "te", + "torrione", + "vento", + "verde", + "versiere", +}; + + +static const char *name_italian_3[] = { + " Marittimo", + " Marittima", + " del Capo", + " del Monte", + " di Sopra", + " di Sotto", + " sui Monti", + " dei Marmi", + " dei Sassi", + " delle Fonti", + " sui Prati", + " a Mare", + " Superiore", + " Inferiore", + " Terme", + " Alta", + " Bassa", + " Brianza", + " Vesuviano", + " Scrivia", + " Ticino", +}; + +static const char *name_italian_river1[] = { + " del", + " sul", + " al", + " nel", +}; + +static const char *name_italian_river2[] = { + "l'Adda", + "l'Adige", + "le Alpi", + "l'Arno", + " Bormida", + " Brenta", + "la Dora Baltea", + " Lambro", + " Mincio", + " Naviglio", + "l'Oglio", + "l'Olona", + "l'Ombrone", + " Panaro", + " Piave", + " Po", + " Reno", + " Scrivia", + " Secchia", + " Serio", + " Tagliamento", + " Tanaro", + " Taro", + " Ticino", + " Tevere", +}; |