Use intelligent screen refresh only in split regions.
[screen-lua.git] / src / nethack.c
blobd8ae456ee8b2c9aa74d2c697db865c563318a3e1
1 /* Copyright (c) 2008, 2009
2 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
3 * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
4 * Micah Cowan (micah@cowan.name)
5 * Sadrul Habib Chowdhury (sadrul@users.sourceforge.net)
6 * Copyright (c) 1993-2002, 2003, 2005, 2006, 2007
7 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
8 * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
9 * Copyright (c) 1987 Oliver Laumann
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3, or (at your option)
14 * any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program (see the file COPYING); if not, see
23 * http://www.gnu.org/licenses/, or contact Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
26 ****************************************************************
29 #include "config.h"
30 #include "screen.h"
32 #ifdef NETHACK
33 extern int nethackflag;
34 #endif
36 struct nlstrans {
37 char *from;
38 char *to;
41 #ifdef NETHACK
42 static struct nlstrans nethacktrans[] = {
43 {"Cannot lock terminal - fork failed",
44 "Cannot fork terminal - lock failed"},
45 {"Got only %d bytes from %s",
46 "You choke on your food: %d bytes from %s"},
47 {"Copy mode - Column %d Line %d(+%d) (%d,%d)",
48 "Welcome to hacker's treasure zoo - Column %d Line %d(+%d) (%d,%d)"},
49 {"First mark set - Column %d Line %d",
50 "You drop a magic marker - Column %d Line %d"},
51 {"Copy mode aborted",
52 "You escaped the dungeon."},
53 {"Filter removed.",
54 "You have a sad feeling for a moment..."},
55 {"Window %d (%s) killed.",
56 "You destroy poor window %d (%s)."},
57 {"Window %d (%s) is now being monitored for all activity.",
58 "You feel like someone is watching you..."},
59 {"Window %d (%s) is no longer being monitored for activity.",
60 "You no longer sense the watcher's presence."},
61 {"empty buffer",
62 "Nothing happens."},
63 {"switched to audible bell.",
64 "Suddenly you can't see your bell!"},
65 {"switched to visual bell.",
66 "Your bell is no longer invisible."},
67 {"The window is now being monitored for %d sec. silence.",
68 "You feel like someone is waiting for %d sec. silence..."},
69 {"The window is no longer being monitored for silence.",
70 "You no longer sense the watcher's silence."},
71 {"No other window.",
72 "You cannot escape from window %d!"},
73 {"Logfile \"%s\" closed.",
74 "You put away your scroll of logging named \"%s\"." },
75 {"Error opening logfile \"%s\"",
76 "You don't seem to have a scroll of logging named \"%s\"."},
77 {"Creating logfile \"%s\".",
78 "You start writing on your scroll of logging named \"%s\"."},
79 {"Appending to logfile \"%s\".",
80 "You add to your scroll of logging named \"%s\"."},
81 {"Detach aborted.",
82 "The blast of disintegration whizzes by you!"},
83 {"Empty register.",
84 "Nothing happens."},
85 {"[ Passwords don't match - checking turned off ]",
86 "[ Passwords don't match - your armor crumbles away ]"},
87 {"Aborted because of window size change.",
88 "KAABLAMM!!! You triggered a land mine!"},
89 {"Out of memory.",
90 "Who was that Maude person anyway?"},
91 {"getpwuid() can't identify your account!",
92 "An alarm sounds through the dungeon...\nThe Keystone Kops are after you!"},
93 {"Must be connected to a terminal.",
94 "You must play from a terminal."},
95 {"No Sockets found in %s.\n",
96 "This room is empty (%s).\n"},
97 {"New screen...",
98 "Be careful! New screen tonight."},
99 {"Child has been stopped, restarting.",
100 "You regain consciousness."},
101 {"There are screens on:",
102 "Your inventory:"},
103 {"There is a screen on:",
104 "Your inventory:"},
105 {"There are several screens on:",
106 "Prove thyself worthy or perish:"},
107 {"There is a suitable screen on:",
108 "You see here a good looking screen:"},
109 {"There are several suitable screens on:",
110 "You may wish for a screen, what do you want?"},
111 {"%d socket%s wiped out.",
112 "You hear %d distant explosion%s."},
113 {"Remove dead screens with 'screen -wipe'.",
114 "The dead screen%s touch%s you. Try 'screen -wipe'."},
115 {"Illegal reattach attempt from terminal %s.",
116 "'%s' tries to touch your session, but fails."},
117 {"Could not write %s",
118 "%s is too hard to dig in"},
119 {0, 0}
121 #endif
123 const char *
124 DoNLS(from)
125 const char *from;
127 #ifdef NETHACK
128 struct nlstrans *t;
130 if (nethackflag)
132 for (t = nethacktrans; t->from; t++)
133 if (strcmp(from, t->from) == 0)
134 return t->to;
136 #endif
137 return from;