summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/Callsign.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-01 21:23:39 +0200
committerAki <please@ignore.pl>2022-04-01 21:23:39 +0200
commit3c487c5cd69c53d6fea948643c0a76df03516605 (patch)
tree72730c7b8b26a5ef8fc9a987ec4c16129efd5aac /StarsEx/Callsign.cpp
parent8f353abd0bfe18baddd8a8250ab7c4f2d1c83a6e (diff)
downloadstarshatter-3c487c5cd69c53d6fea948643c0a76df03516605.zip
starshatter-3c487c5cd69c53d6fea948643c0a76df03516605.tar.gz
starshatter-3c487c5cd69c53d6fea948643c0a76df03516605.tar.bz2
Moved Stars45 to StarsEx
Diffstat (limited to 'StarsEx/Callsign.cpp')
-rw-r--r--StarsEx/Callsign.cpp100
1 files changed, 100 insertions, 0 deletions
diff --git a/StarsEx/Callsign.cpp b/StarsEx/Callsign.cpp
new file mode 100644
index 0000000..7cb7499
--- /dev/null
+++ b/StarsEx/Callsign.cpp
@@ -0,0 +1,100 @@
+/* Starshatter: The Open Source Project
+ Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors
+ Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors
+ Copyright (c) 1997-2006, Destroyer Studios LLC.
+
+ AUTHOR: John DiCamillo
+
+
+ OVERVIEW
+ ========
+ Package Callsign catalog class
+*/
+
+#include "Callsign.h"
+
+// +----------------------------------------------------------------------+
+
+static int callsign_index = -1;
+
+static char civilian_catalog[32][16] = {
+ "Aleph", "Vehan", "Galvin", "Caleb",
+ "Mercury", "Lancet", "Hera", "Zeus",
+ "Odin", "Thor", "Nereus", "Klono",
+ "Athena", "Helios", "Leto", "Nivas",
+
+ "Selene", "Proteus", "Triton", "Thetis",
+ "Aurora", "Ceres", "Rana", "Doradus",
+ "Perseus", "Corina", "Cygnus", "Lago",
+ "Andil", "Galen", "Temas", "Dalan"
+};
+
+static char alliance_catalog[32][16] = {
+ "Alpha", "Bravo", "Delta", "Echo",
+ "Ranger", "Magic", "Falcon", "Omega",
+ "Vulcan", "Hammer", "Nomad", "Dragon",
+ "Sierra", "Tango", "Victor", "Zulu",
+
+ "Sentry", "Wolf", "Zeta", "Jackal",
+ "Merlin", "Eagle", "Blade", "Tiger",
+ "Raptor", "Ares", "Condor", "Rogue",
+ "Hornet", "Gold", "Mustang", "Voodoo"
+};
+
+static char hegemony_catalog[32][16] = {
+ "Nagal", "Nalak", "Olkar", "Kalar",
+ "Narom", "Tranor", "Orrin", "Orlak",
+ "Nardik", "Sorrin", "Amnar", "Kizek",
+ "Orten", "Ronar", "Molkar", "Ternal",
+
+ "Martak", "Komar", "Malik", "Morgul",
+ "Kliek", "Torlan", "Arvin", "Artak",
+ "Ralka", "Sernal", "Roten", "Reza",
+ "Tinet", "Aliek", "Salar", "Sona"
+};
+
+static char pirate_catalog[32][16] = {
+ "Raider", "Skull", "Black", "Blood",
+ "Roger", "Hook", "Galleon", "Privateer",
+ "Cutlass", "Sabre", "Pike", "Blackbeard",
+ "Pistol", "Cortez", "Pirate", "Buccaneer",
+
+ "Raider", "Skull", "Black", "Blood",
+ "Morgan", "Redbeard", "Cutlass", "Sabre",
+ "Iron", "Stocks", "Quarter", "Gray",
+ "Ruby", "Cross", "Pirate", "Raider"
+};
+
+static char zolon_catalog[32][16] = {
+ "Cancer", "Krill", "Bluefin", "Scylla",
+ "Charybdis","Finback", "Mantis", "Skate",
+ "Sealion", "Lamprey", "Tarpon", "Hammerhead",
+ "Orca", "Skipjack", "Sculpin", "Thresher",
+
+ "Devilray", "Chinook", "Moray", "Seastar",
+ "Heron", "Puffin", "Rockeye", "Tiburon",
+ "Coho", "Stingray", "Mako", "Conger",
+ "Scad", "Pompano", "Tusk", "Nautilus"
+};
+
+
+// +----------------------------------------------------------------------+
+
+const char*
+Callsign::GetCallsign(int IFF)
+{
+ if (callsign_index < 0)
+ callsign_index = rand()/1000;
+
+ if (callsign_index > 31)
+ callsign_index = 0;
+
+ switch (IFF) {
+ case 0: return civilian_catalog[callsign_index++];
+ default:
+ case 1: return alliance_catalog[callsign_index++];
+ case 2: return hegemony_catalog[callsign_index++];
+ case 3: return pirate_catalog[callsign_index++];
+ case 4: return zolon_catalog[callsign_index++];
+ }
+}