1 /* NetHack 3.6 rip.c $NHDT-Date: 1450432760 2015/12/18 09:59:20 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.22 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
7 STATIC_DCL
void FDECL(center
, (int, char *));
9 #if defined(TTY_GRAPHICS) || defined(X11_GRAPHICS) || defined(GEM_GRAPHICS) \
10 || defined(MSWIN_GRAPHICS)
11 #define TEXT_TOMBSTONE
13 #if defined(mac) || defined(__BEOS__) || defined(WIN32_GRAPHICS)
14 #ifndef TEXT_TOMBSTONE
15 #define TEXT_TOMBSTONE
21 #ifndef NH320_DEDICATION
22 /* A normal tombstone for end of game display. */
23 static const char *rip_txt
[] = {
30 " | |", /* Name of player */
31 " | |", /* Amount of $ */
32 " | |", /* Type of death */
36 " | 1001 |", /* Real year of death */
38 " _________)/\\\\_//(\\/(/\\)/\\//\\/|_)_______", 0
40 #define STONE_LINE_CENT 28 /* char[] element of center of stone face */
41 #else /* NH320_DEDICATION */
42 /* NetHack 3.2.x displayed a dual tombstone as a tribute to Izchak. */
43 static const char *rip_txt
[] = {
44 " ---------- ----------",
46 " / REST \\ / This \\",
47 " / IN \\ / release of \\",
48 " / PEACE \\ / NetHack is \\",
49 " / \\ / dedicated to \\",
50 " | | | the memory of |",
52 " | | | Izchak Miller |",
53 " | | | 1935 - 1994 |",
57 " * | * * * | * * | * * * | *",
58 " _____)/\\|\\__//(\\/(/\\)/\\//\\/|_)________)/|\\\\_/_/(\\/(/\\)/\\/\\/|_)____",
61 #define STONE_LINE_CENT 19 /* char[] element of center of stone face */
62 #endif /* NH320_DEDICATION */
63 #define STONE_LINE_LEN \
64 16 /* # chars that fit on one line \
65 * (note 1 ' ' border) \
67 #define NAME_LINE 6 /* *char[] line # for player name */
68 #define GOLD_LINE 7 /* *char[] line # for amount of gold */
69 #define DEATH_LINE 8 /* *char[] line # for death description */
70 #define YEAR_LINE 12 /* *char[] line # for year */
79 register char *ip
, *op
;
81 op
= &rip
[line
][STONE_LINE_CENT
- ((strlen(text
) + 1) >> 1)];
87 genl_outrip(tmpwin
, how
, when
)
99 rip
= dp
= (char **) alloc(sizeof(rip_txt
));
100 for (x
= 0; rip_txt
[x
]; ++x
)
101 dp
[x
] = dupstr(rip_txt
[x
]);
104 /* Put name on stone */
105 Sprintf(buf
, "%s", plname
);
106 buf
[STONE_LINE_LEN
] = 0;
107 center(NAME_LINE
, buf
);
110 Sprintf(buf
, "%ld Au", done_money
);
111 buf
[STONE_LINE_LEN
] = 0; /* It could be a *lot* of gold :-) */
112 center(GOLD_LINE
, buf
);
114 /* Put together death description */
115 formatkiller(buf
, sizeof buf
, how
, FALSE
);
117 /* Put death type on stone */
118 for (line
= DEATH_LINE
, dpx
= buf
; line
< YEAR_LINE
; line
++) {
122 if ((i0
= strlen(dpx
)) > STONE_LINE_LEN
) {
123 for (i
= STONE_LINE_LEN
; ((i0
> STONE_LINE_LEN
) && i
); i
--)
132 if (tmpchar
!= ' ') {
139 /* Put year on stone */
140 year
= yyyymmdd(when
) / 10000L;
141 Sprintf(buf
, "%4ld", year
);
142 center(YEAR_LINE
, buf
);
144 putstr(tmpwin
, 0, "");
146 putstr(tmpwin
, 0, *dp
);
148 putstr(tmpwin
, 0, "");
149 putstr(tmpwin
, 0, "");
151 for (x
= 0; rip_txt
[x
]; x
++) {
152 free((genericptr_t
) rip
[x
]);
154 free((genericptr_t
) rip
);
158 #endif /* TEXT_TOMBSTONE */