added throwing
This commit is contained in:
@ -6,6 +6,8 @@ curses_input::curses_input(cursor *new_curse):
|
||||
curse{new_curse} {}
|
||||
|
||||
game_command curses_input::get_command() {
|
||||
int tmp;
|
||||
|
||||
switch (curse->getcmd()) {
|
||||
case 'h':
|
||||
return game_command::move_west;
|
||||
@ -32,6 +34,7 @@ game_command curses_input::get_command() {
|
||||
return game_command::move_southeast;
|
||||
|
||||
case 'a':
|
||||
tmp = apply_north;
|
||||
break; // wait for another command
|
||||
|
||||
case '<':
|
||||
@ -52,37 +55,44 @@ game_command curses_input::get_command() {
|
||||
case 'e':
|
||||
return game_command::enter;
|
||||
|
||||
case 'i':
|
||||
return toggle_inventory;
|
||||
|
||||
case 't':
|
||||
tmp = throw_north;
|
||||
break;
|
||||
|
||||
default:
|
||||
return game_command_pass;
|
||||
}
|
||||
|
||||
switch (curse->getcmd()) {
|
||||
case 'h':
|
||||
return game_command::apply_west;
|
||||
return (game_command)(tmp + west);
|
||||
|
||||
case 'j':
|
||||
return game_command::apply_south;
|
||||
return (game_command)(tmp + south);
|
||||
|
||||
case 'k':
|
||||
return game_command::apply_north;
|
||||
return (game_command)(tmp + north);
|
||||
|
||||
case 'l':
|
||||
return game_command::apply_east;
|
||||
return (game_command)(tmp + east);
|
||||
|
||||
case 'y':
|
||||
return game_command::apply_northwest;
|
||||
return (game_command)(tmp + northwest);
|
||||
|
||||
case 'u':
|
||||
return game_command::apply_northeast;
|
||||
return (game_command)(tmp + northeast);
|
||||
|
||||
case 'b':
|
||||
return game_command::apply_southwest;
|
||||
return (game_command)(tmp + southwest);
|
||||
|
||||
case 'n':
|
||||
return game_command::apply_southeast;
|
||||
return (game_command)(tmp + southeast);
|
||||
|
||||
default:
|
||||
return game_command::apply_panic;
|
||||
return game_command_panic;
|
||||
}
|
||||
|
||||
return game_command::game_command_panic;
|
||||
|
Reference in New Issue
Block a user