* This source herein may be modified and/or distributed by anybody who
* so desires, with the following restrictions:
* 1.) No portion of this notice shall be removed.
* 2.) Credit shall not be taken for the creation of this source.
* 3.) This code is not to be traded, sold, or used for personal
static char sccsid
[] = "@(#)message.c 5.1 (Berkeley) %G%";
char msgs
[NMESSAGES
][DCOLS
] = {"", "", "", "", ""};
short msg_col
= 0, imsg
= -1;
boolean msg_cleared
= 1, rmsg
= 0;
extern boolean cant_int
, did_int
, interrupted
, save_is_interactive
;
extern short add_strength
;
if (!save_is_interactive
) {
mvaddstr(MIN_ROW
-1, msg_col
, more
);
imsg
= (imsg
+ 1) % NMESSAGES
;
(void) strcpy(msgs
[imsg
], msg
);
mvaddstr(MIN_ROW
-1, 0, msg
);
message(msgs
[((imsg
- c
) % NMESSAGES
)], 0);
move(rogue
.row
, rogue
.col
);
get_input_line(prompt
, insert
, buf
, if_cancelled
, add_blank
, do_echo
)
char *prompt
, *buf
, *insert
;
mvaddstr(0, n
+ 1, insert
);
(void) strcpy(buf
, insert
);
while (((ch
= rgetchar()) != '\r') && (ch
!= '\n') && (ch
!= CANCEL
)) {
if ((ch
>= ' ') && (ch
<= '~') && (i
< MAX_TITLE_LENGTH
-2)) {
if ((ch
!= ' ') || (i
> 0)) {
if ((ch
== '\b') && (i
> 0)) {
while ((i
> 0) && (buf
[i
-1] == ' ')) {
if ((ch
== CANCEL
) || (i
== 0) || ((i
== 1) && add_blank
)) {
message(if_cancelled
, 0);
Level: 99 Gold: 999999 Hp: 999(999) Str: 99(99) Arm: 99 Exp: 21/10000000 Hungry
0 5 1 5 2 5 3 5 4 5 5 5 6 5 7 5
label
= (stat_mask
& STAT_LABEL
) ? 1 : 0;
if (stat_mask
& STAT_LEVEL
) {
mvaddstr(row
, 0, "Level: ");
/* max level taken care of in make_level() */
sprintf(buf
, "%d", cur_level
);
if (stat_mask
& STAT_GOLD
) {
mvaddstr(row
, 10, "Gold: ");
if (rogue
.gold
> MAX_GOLD
) {
sprintf(buf
, "%ld", rogue
.gold
);
if (stat_mask
& STAT_HP
) {
mvaddstr(row
, 23, "Hp: ");
if (rogue
.hp_max
> MAX_HP
) {
rogue
.hp_current
-= (rogue
.hp_max
- MAX_HP
);
sprintf(buf
, "%d(%d)", rogue
.hp_current
, rogue
.hp_max
);
if (stat_mask
& STAT_STRENGTH
) {
mvaddstr(row
, 36, "Str: ");
if (rogue
.str_max
> MAX_STRENGTH
) {
rogue
.str_current
-= (rogue
.str_max
- MAX_STRENGTH
);
rogue
.str_max
= MAX_STRENGTH
;
sprintf(buf
, "%d(%d)", (rogue
.str_current
+ add_strength
),
if (stat_mask
& STAT_ARMOR
) {
mvaddstr(row
, 48, "Arm: ");
if (rogue
.armor
&& (rogue
.armor
->d_enchant
> MAX_ARMOR
)) {
rogue
.armor
->d_enchant
= MAX_ARMOR
;
sprintf(buf
, "%d", get_armor_class(rogue
.armor
));
if (stat_mask
& STAT_EXP
) {
mvaddstr(row
, 56, "Exp: ");
if (rogue
.exp_points
> MAX_EXP
) {
rogue
.exp_points
= MAX_EXP
;
if (rogue
.exp
> MAX_EXP_LEVEL
) {
rogue
.exp
= MAX_EXP_LEVEL
;
sprintf(buf
, "%d/%ld", rogue
.exp
, rogue
.exp_points
);
if (stat_mask
& STAT_HUNGER
) {
mvaddstr(row
, 73, hunger_str
);
for (i
= strlen(s
); i
< n
; i
++) {
if ((fp
= fopen("rogue.screen", "w")) != NULL
) {
for (i
= 0; i
< DROWS
; i
++) {
for (j
= (DCOLS
- 1); j
>= 0; j
--) {
if ((buf
[j
] != ' ') || (j
== 0)) {
buf
[j
+ ((j
== 0) ? 0 : 1)] = 0;
return((ch
>= '0') && (ch
<= '9'));
for (i
= strlen(str
) - 1; i
>= 0; i
--) {
for (i
= 0; str
[i
]; i
++) {