diff options
author | Darkvater <darkvater@openttd.org> | 2005-09-16 10:37:21 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2005-09-16 10:37:21 +0000 |
commit | 2525e1d507d1bccb2a5e296a921758998dd6b7be (patch) | |
tree | f94be8f3cb6816c890e8f9b4b8071ca246195307 | |
parent | 180997534c08d1ffa0d153ee50c3a369b66d0cd6 (diff) | |
download | openttd-2525e1d507d1bccb2a5e296a921758998dd6b7be.tar.xz |
(svn r2957) - Feature: [ 1263280 ] Danish town names (fey_dk)
-rw-r--r-- | lang/danish.txt | 1 | ||||
-rw-r--r-- | lang/english.txt | 1 | ||||
-rw-r--r-- | namegen.c | 20 | ||||
-rw-r--r-- | openttd.h | 3 | ||||
-rw-r--r-- | table/namegen.h | 132 |
5 files changed, 156 insertions, 1 deletions
diff --git a/lang/danish.txt b/lang/danish.txt index 39137458d..38272a1c0 100644 --- a/lang/danish.txt +++ b/lang/danish.txt @@ -832,6 +832,7 @@ STR_TOWNNAME_AUSTRIAN :Østrigske STR_TOWNNAME_ROMANIAN :Rumænske STR_TOWNNAME_CZECH :Tjekkiske STR_TOWNNAME_SWISS :Schweiziske +STR_TOWNNAME_DANISH :Danske ############ end of townname region STR_CURR_GBP :Pund ({POUNDSIGN}) diff --git a/lang/english.txt b/lang/english.txt index 2bd6eb5b8..150e53c5d 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -835,6 +835,7 @@ STR_TOWNNAME_AUSTRIAN :Austrian STR_TOWNNAME_ROMANIAN :Romanian STR_TOWNNAME_CZECH :Czech STR_TOWNNAME_SWISS :Swiss +STR_TOWNNAME_DANISH :Danish ############ end of townname region STR_CURR_GBP :Pounds ({POUNDSIGN}) @@ -573,6 +573,25 @@ static byte MakeSwissTownName(char *buf, uint32 seed) return 0; } +static byte MakeDanishTownName(char *buf, uint32 seed) +{ + int i; + + // null terminates the string for strcat + strcpy(buf, ""); + + // optional first segment + i = SeedChanceBias(0, lengthof(name_danish_1), seed, 50); + if (i >= 0) + strcat(buf, name_danish_1[i]); + + // middle segments removed as this algorithm seems to create much more realistic names + strcat(buf, name_danish_2[SeedChance( 7, lengthof(name_danish_2), seed)]); + strcat(buf, name_danish_3[SeedChance(16, lengthof(name_danish_3), seed)]); + + return 0; +} + TownNameGenerator * const _town_name_generators[] = { MakeEnglishOriginalTownName, @@ -592,6 +611,7 @@ TownNameGenerator * const _town_name_generators[] = MakeRomanianTownName, MakeCzechTownName, MakeSwissTownName, + MakeDanishTownName, }; // DO WE NEED THIS ANY MORE? @@ -487,7 +487,8 @@ enum SpecialStrings { SPECSTR_TOWNNAME_ROMANIAN, SPECSTR_TOWNNAME_CZECH, SPECSTR_TOWNNAME_SWISS, - SPECSTR_TOWNNAME_LAST = SPECSTR_TOWNNAME_SWISS, + SPECSTR_TOWNNAME_DANISH, + SPECSTR_TOWNNAME_LAST = SPECSTR_TOWNNAME_DANISH, // special strings for player names on the form "TownName transport". SPECSTR_PLAYERNAME_START = 0x70EA, diff --git a/table/namegen.h b/table/namegen.h index f24440cd9..ff1aa9c2b 100644 --- a/table/namegen.h +++ b/table/namegen.h @@ -2597,3 +2597,135 @@ static const char *name_swiss_real[] = { "Zürich", "Zug", }; + +static const char *name_danish_1[] = { + "Gamle ", + "Lille ", + "Nye ", + "Store ", + "Kirke ", + "Nørre ", + "Vester ", + "Sønder ", + "Øster ", + "Hvide ", + "Høje ", + "Kongens ", +}; + +static const char *name_danish_2[] = { + "Ager", + "Alle", + "Aske", + "Balle", + "Bede", + "Birke", + "Bjerring", + "Bjæver", + "Blommens", + "Blok", + "Bolder", + "Bred", + "Charlotten", + "Christians", + "Danne", + "Diana", + "Es", + "Fredens", + "Frederiks", + "Fugle", + "Fåre", + "Gille", + "Gis", + "Givs", + "Glams", + "Glo", + "Guld", + "Had", + "Haralds", + "Hassel", + "Hede", + "Helle", + "Hessel", + "Hjorts", + "Hol", + "Horn", + "Humle", + "Høj", + "Hør", + "Is", + "Jyde", + "Jægers", + "Karls", + "Klov", + "Kokke", + "Kvist", + "Lang", + "Lange", + "Mari", + "Nord", + "Ny", + "Oks", + "Ring", + "Røde", + "Rung", + "Rør", + "Rud", + "Saks", + "Salt", + "Skam", + "Silke", + "Skod", + "Skæl", + "Skær", + "Sol", + "Svend", + "Svine", + "Strand", + "Stubbe", + "Ting", + "Tjære", + "Tore", + "Uger", + "Ulf", + "Val", + "Vand", + "Vej", + "Vor", + "Vær", + "Ør", + "Ål" +}; + +static const char *name_danish_3[] = { + "basse", + "borg", + "berg", + "bro", + "by", + "havn", + "strup", + "holm", + "hus", + "købing", + "lund", + "lunde", + "sund", + "ovre", + "høj", + "dal", + "sted", + "sten", + "løse", + "rød", + "magle", + "sø", + "bjerg", + "bæk", + "drup", + "lev", + "bo", + "lyst", + "feld", + "skov" +}; |