1
0

make flow not suck

This commit is contained in:
dtb 2023-11-25 09:26:33 -07:00
parent 86289e3609
commit b5c73d1fc4

View File

@ -55,237 +55,132 @@ play_level(void)
{
short ch;
int count;
enum { NORMAL, COUNTED, CHECK } state;
state = NORMAL;
for (;;) {
interrupted = 0;
if (hit_message[0]) {
messagef(1, "%s", hit_message);
hit_message[0] = 0;
for(;;){
switch(state){
case NORMAL:
interrupted = 0;
if (hit_message[0]){
messagef(1, "%s", hit_message);
hit_message[0] = 0;
}
if(trap_door){
trap_door = 0;
return;
}
move(rogue.row, rogue.col);
refresh();
ch = rgetchar();
case CHECK:
check_message();
count = 0;
}
if (trap_door) {
trap_door = 0;
return;
}
move(rogue.row, rogue.col);
refresh();
ch = rgetchar();
CMCH:
check_message();
count = 0;
CH:
switch(ch) {
case '.':
rest((count > 0) ? count : 1);
break;
case 's':
search(((count > 0) ? count : 1), 0);
break;
case 'i':
inventory(&rogue.pack, ALL_OBJECTS);
break;
case 'f':
fight(0);
break;
case 'F':
fight(1);
break;
case 'h':
case 'j':
case 'k':
case 'l':
case 'y':
case 'u':
case 'n':
case 'b':
state = NORMAL;
switch(ch){
case '.': rest((count > 0) ? count : 1); break;
case 's': search(((count > 0) ? count : 1), 0); break;
case 'i': inventory(&rogue.pack, ALL_OBJECTS); break;
case 'f': fight(0); break;
case 'F': fight(1); break;
case 'h': case 'j': case 'k': case 'l': case 'y': case 'u':
case 'n': case 'b':
(void)one_move_rogue(ch, 1);
break;
case 'H':
case 'J':
case 'K':
case 'L':
case 'B':
case 'Y':
case 'U':
case 'N':
case '\010':
case '\012':
case '\013':
case '\014':
case '\031':
case '\025':
case '\016':
case '\002':
multiple_move_rogue(ch);
break;
case 'e':
eat();
break;
case 'q':
quaff();
break;
case 'r':
read_scroll();
break;
case 'm':
move_onto();
break;
case ',':
kick_into_pack();
break;
case 'd':
drop();
break;
case 'P':
put_on_ring();
break;
case 'R':
remove_ring();
break;
case 'H': case 'J': case 'K': case 'L': case 'Y': case 'U':
case 'N': case 'B': case '\010': case '\012': case '\013':
case '\014': case '\031': case '\025': case '\016':
case '\002': multiple_move_rogue(ch); break;
case 'e': eat(); break;
case 'q': quaff(); break;
case 'r': read_scroll(); break;
case 'm': move_onto(); break;
case ',': kick_into_pack(); break;
case 'd': drop(); break;
case 'P': put_on_ring(); break;
case 'R': remove_ring(); break;
case '\020':
do {
remessage(count++);
ch = rgetchar();
} while (ch == '\020');
goto CMCH;
state = CHECK;
break;
case '\027':
wizardize();
break;
case '>':
if (drop_check()) {
return;
}
break;
case '<':
if (check_up()) {
return;
}
break;
case ')':
case ']':
case '\027': wizardize(); break;
case '>': if(drop_check())
return;
break;
case '<': if(check_up())
return;
break;
case ')': case ']':
inv_armor_weapon(ch == ')');
break;
case '=':
inv_rings();
break;
case '^':
id_trap();
break;
case '/':
id_type();
break;
case '?':
id_com();
break;
case '!':
do_shell();
break;
case 'o':
edit_opts();
break;
case 'I':
single_inv(0);
break;
case 'T':
take_off();
break;
case 'W':
wear();
break;
case 'w':
wield();
break;
case 'c':
call_it();
break;
case 'z':
zapp();
break;
case 't':
throw();
break;
case '=': inv_rings(); break;
case '^': id_trap(); break;
case '/': id_type(); break;
case '?': id_com(); break;
case '!': do_shell(); break;
case 'o': edit_opts(); break;
case 'I': single_inv(0); break;
case 'T': take_off(); break;
case 'W': wear(); break;
case 'w': wield(); break;
case 'c': call_it(); break;
case 'z': zapp(); break;
case 't': throw(); break;
case 'v':
messagef(0, "rogue-clone: Version III. (Tim Stoehr was here), tektronix!zeus!tims");
messagef(0, "rogue-clone: Version III (trinity mod)."
" (Tim Stoehr was here), tektronix!zeus!tims");
break;
case 'Q':
quit(0);
__unreachable();
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'Q': quit(0);
case '0': case '1': case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9':
move(rogue.row, rogue.col);
refresh();
do {
if (count < 100) {
do{
if(count < 100)
count = (10 * count) + (ch - '0');
}
ch = rgetchar();
} while (is_digit(ch));
if (ch != CANCEL) {
goto CH;
}
break;
case ' ':
break;
case '\011':
if (wizard) {
inventory(&level_objects, ALL_OBJECTS);
} else {
messagef(0, "%s", unknown_command);
}
break;
case '\023':
if (wizard) {
draw_magic_map();
} else {
messagef(0, "%s", unknown_command);
}
break;
case '\024':
if (wizard) {
show_traps();
} else {
messagef(0, "%s", unknown_command);
}
break;
case '\017':
if (wizard) {
show_objects();
} else {
messagef(0, "%s", unknown_command);
}
break;
case '\001':
show_average_hp();
break;
case '\003':
if (wizard) {
c_object_for_wizard();
} else {
messagef(0, "%s", unknown_command);
}
break;
case '\015':
if (wizard) {
show_monsters();
} else {
messagef(0, "%s", unknown_command);
}
break;
case 'S':
save_game();
break;
default:
messagef(0, "%s", unknown_command);
}while (is_digit(ch));
if(ch != CANCEL)
state = COUNTED;
break;
case ' ': break;
case '\011': if(!wizard){
messagef(0, "%s", unknown_command);
break;
}
inventory(&level_objects, ALL_OBJECTS); break;
case '\023': if(!wizard){
messagef(0, "%s", unknown_command);
break;
}
draw_magic_map(); break;
case '\024': if(!wizard)
messagef(0, "%s", unknown_command);
break;
}
show_traps(); break;
case '\017': if(!wizard)
messagef(0, "%s", unknown_command);
break;
}
show_objects(); break;
case '\001': show_average_hp(); break;
case '\003': if(!wizard)
messagef(0, "%s", unknown_command);
break;
}
c_object_for_wizard(); break;
case '\015': if(!wizard)
messagef(0, "%s", unknown_command);
break;
}
show_monsters(); break;
case 'S': save_game(); break;
default: messagef(0, "%s", unknown_command); break;
}
}
}