summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lang/danish.txt1
-rw-r--r--lang/english.txt1
-rw-r--r--namegen.c20
-rw-r--r--openttd.h3
-rw-r--r--table/namegen.h132
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})
diff --git a/namegen.c b/namegen.c
index e81e6985e..d43893a8f 100644
--- a/namegen.c
+++ b/namegen.c
@@ -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?
diff --git a/openttd.h b/openttd.h
index a379f9130..2648cfe4c 100644
--- a/openttd.h
+++ b/openttd.h
@@ -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"
+};