diff options
author | celestar <celestar@openttd.org> | 2006-05-01 09:25:23 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2006-05-01 09:25:23 +0000 |
commit | d76279144d409a2b3d003606baa146bdb6a2bb00 (patch) | |
tree | ffc556fa2c8a008977f660b62a0e3ae8c0ec1206 | |
parent | 1056def1764a962b57420f2ae712663e25be3f01 (diff) | |
download | openttd-d76279144d409a2b3d003606baa146bdb6a2bb00.tar.xz |
(svn r4639) -Feature: Turkish town names (jnmbk)
-rw-r--r-- | lang/english.txt | 1 | ||||
-rw-r--r-- | namegen.c | 29 | ||||
-rw-r--r-- | openttd.h | 3 | ||||
-rw-r--r-- | settings.c | 2 | ||||
-rw-r--r-- | table/namegen.h | 114 |
5 files changed, 147 insertions, 2 deletions
diff --git a/lang/english.txt b/lang/english.txt index ace41dd3e..93874896f 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -870,6 +870,7 @@ STR_TOWNNAME_ROMANIAN :Romanian STR_TOWNNAME_CZECH :Czech STR_TOWNNAME_SWISS :Swiss STR_TOWNNAME_DANISH :Danish +STR_TOWNNAME_TURKISH :Turkish ############ end of townname region STR_CURR_GBP :Pounds (£) @@ -620,6 +620,34 @@ static byte MakeDanishTownName(char *buf, uint32 seed) return 0; } +static byte MakeTurkishTownName(char *buf, uint32 seed) +{ + uint i; + + // null terminates the string for strcat + strcpy(buf, ""); + + if ((i = SeedModChance(0, 5, seed)) == 0) { + strcat(buf, name_turkish_prefix[SeedModChance( 2, lengthof(name_turkish_prefix), seed)]); + + // middle segment + strcat(buf, name_turkish_middle[SeedModChance( 4, lengthof(name_turkish_middle), seed)]); + + // optional suffix + if (SeedModChance(0, 7, seed) == 0) { + strcat(buf, name_turkish_suffix[SeedModChance( 10, lengthof(name_turkish_suffix), seed)]); + } + } else { + if (i == 1 || i == 2) { + strcat(buf, name_turkish_prefix[SeedModChance( 2, lengthof(name_turkish_prefix), seed)]); + strcat(buf, name_turkish_suffix[SeedModChance( 4, lengthof(name_turkish_suffix), seed)]); + } else { + strcat(buf, name_turkish_real[SeedModChance( 4, lengthof(name_turkish_real), seed)]); + } + } + return 0; +} + TownNameGenerator * const _town_name_generators[] = { MakeEnglishOriginalTownName, @@ -640,6 +668,7 @@ TownNameGenerator * const _town_name_generators[] = MakeCzechTownName, MakeSwissTownName, MakeDanishTownName, + MakeTurkishTownName, }; // DO WE NEED THIS ANY MORE? @@ -470,7 +470,8 @@ enum SpecialStrings { SPECSTR_TOWNNAME_CZECH, SPECSTR_TOWNNAME_SWISS, SPECSTR_TOWNNAME_DANISH, - SPECSTR_TOWNNAME_LAST = SPECSTR_TOWNNAME_DANISH, + SPECSTR_TOWNNAME_TURKISH, + SPECSTR_TOWNNAME_LAST = SPECSTR_TOWNNAME_TURKISH, // special strings for player names on the form "TownName transport". SPECSTR_PLAYERNAME_START = 0x70EA, diff --git a/settings.c b/settings.c index 4f0c89e25..9726e9980 100644 --- a/settings.c +++ b/settings.c @@ -1202,7 +1202,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, 17, "english|french|german|american|latin|silly|swedish|dutch|finnish|polish|slovakish|norwegian|hungarian|austrian|romanian|czech|swiss|danish", 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, 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 8e0cd8533..3a67a3694 100644 --- a/table/namegen.h +++ b/table/namegen.h @@ -2751,3 +2751,117 @@ static const char *name_danish_3[] = { "feld", "skov" }; + +static const char *name_turkish_prefix[] = { + "Akça", + "Altin", + "Bahçe", + "Boz", + "Büyük", + "Çay", + "Dogu", + "Eski", + "Güzel", + "Kizil", + "Küçük", + "Orta", + "Sari", + "Sultan", + "Ulu", + "Yeni" +}; + +static const char *name_turkish_middle[] = { + "agaç", + "ayva", + "çam", + "elma", + "kurt", + "pazar", + "yali" +}; + +static const char *name_turkish_suffix[] = { + "dere", + "hisar", + "kale", + "kaya", + "kent", + "köy", + "ova", + "özü", + "ören", + "pazar", + "saray", + "tepe", + "yer", + "yurt" +}; + +static const char *name_turkish_real[] = { + "Adana", + "Adiyaman", + "Afyon", + "Agri", + "Amasya", + "Antalya", + "Artvin", + "Balikesir", + "Bilecik", + "Bitlis", + "Bolu", + "Burdur", + "Bursa", + "Çanakkale", + "Çankiri", + "Denizli", + "Diyarbakir", + "Edirne", + "Elazig", + "Erzurum", + "Eskisehir", + "Giresun", + "Gümüshane", + "Hatay", + "Isparta", + "içel", + "istanbul", + "izmir", + "Kars", + "Kastamonu", + "Kayseri", + "Kirklareli", + "Kocaeli", + "Konya", + "Kütahya", + "Malatya", + "Manisa", + "Kahramanmaras", + "Mardin", + "Mugla", + "Mus", + "Nevsehir", + "Nigde", + "Rize", + "Sakarya", + "Samsun", + "Siirt", + "Sinop", + "Sivas", + "Trabzon", + "Sanliurfa", + "Van", + "Yozgat", + "Zonguldak", + "Aksaray", + "Bayburt", + "Karaman", + "Sirnak", + "Bartin", + "Ardahan", + "Igdir", + "Yalova", + "Karabük", + "Osmaniye", + "Düzce" +}; |