HEAD: sfllaw/jim's patch for xplc detection broke xplc detection in
[wvapps.git] / twc / src / twcnowhere.cc
blob188501540dba27dcf04817ca7c086c4f82e443a3
1 #include "twcnowhere.h"
2 #include "twcgamecontroller.h"
3 #include "twcplayerclient.h"
5 TWCObjectIf *TWCNowhere::create_if(TWCHumanPlayerClient &plyrcli)
7 return new TWCNowhereIf(*this, plyrcli);
11 void TWCNowhereIf::print_menu()
13 plyrcli.print(plyrcli.game.get_screen("nowhere"));
17 void TWCNowhereIf::menu_input()
19 char *line = plyrcli.getline(0);
20 if (!line)
21 return;
23 switch (line[0])
25 case 'q':
26 case 'Q':
27 plyrcli.quit();
28 break;
30 case 'E':
31 case 'e':
33 bool wasdead = plyrcli.player.dead();
34 if (wasdead)
35 plyrcli.player.resurrect();
37 TWCShipList ships;
38 plyrcli.player.ships(ships);
39 if (!ships.count())
41 plyrcli.new_ship(wasdead);
42 plyrcli.player.ships(ships);
45 plyrcli.print("You warm up the engines of %s and prepare for "
46 "your trading day.\n", ships.first()->name());
47 plyrcli.set_location(ships.first());
48 #if 0
49 int towed = loccfg()["being towed"].getint();
50 if (towed)
52 TWCPlayerClient *towing_player = game->players[
53 cfg["ships"][towed]["captain"].getint()];
55 if (towing_player)
56 towing_player->event(Event, loccfg().key().printable().num(),
57 0, WvString("%s has just come online.\n",
58 loccfg()["name"].get()));
59 loccfg()["being towed"].setint(0);
61 #endif
62 // player.location->sector_scan();
64 break;
67 default:
68 break;
74 WvString TWCNowhereIf::prompt()
76 return WvString("%s< %sEntrance %s>", ANSI_YELLOW, ANSI_GREEN,
77 ANSI_YELLOW);