2020-03-15 22:14:50 +01:00
|
|
|
/* Copyright © 2020 tyrolyean
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GAME_H
|
|
|
|
#define _GAME_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2020-03-20 00:09:03 +01:00
|
|
|
#include <stdbool.h>
|
2020-03-15 22:14:50 +01:00
|
|
|
|
|
|
|
extern char command_buffer[100];
|
|
|
|
extern uint8_t command_buffer_pointer;
|
|
|
|
|
2020-03-26 23:53:14 +01:00
|
|
|
#define COMPUTER_STATE_NOTHING 0
|
|
|
|
#define COMPUTER_STATE_KEYBOARD 1
|
|
|
|
#define COMPUTER_STATE_FLOPPY 2
|
|
|
|
extern uint8_t computer_state; /* FSM for the computer */
|
|
|
|
|
|
|
|
extern bool bear_shot;
|
|
|
|
|
2020-03-17 17:50:19 +01:00
|
|
|
extern uint8_t current_room;
|
|
|
|
|
2020-03-15 22:14:50 +01:00
|
|
|
void routine_game();
|
2020-03-17 17:50:19 +01:00
|
|
|
void prepare_command_buffer();
|
2020-03-15 22:14:50 +01:00
|
|
|
void ingest_user_char(char in);
|
2020-03-17 17:50:19 +01:00
|
|
|
void perform_action(uint8_t action_id);
|
2020-03-20 00:09:03 +01:00
|
|
|
void move_direction(uint8_t direction);
|
|
|
|
void describe_room(uint8_t room, bool auto_desc);
|
|
|
|
void print_inventory();
|
|
|
|
void print_room_item();
|
2020-03-26 23:53:14 +01:00
|
|
|
void consume_room_item(const char* item_name);
|
2020-03-15 22:14:50 +01:00
|
|
|
|
2020-03-20 00:09:03 +01:00
|
|
|
void use_item(const char* item_name);
|
|
|
|
void use_item_id(uint8_t item_id);
|
2020-03-26 23:53:14 +01:00
|
|
|
|
|
|
|
bool perform_computer_action(uint8_t action_id);
|
|
|
|
void reset_game(bool fleshed);
|
|
|
|
void init_game();
|
2020-03-15 22:14:50 +01:00
|
|
|
#endif
|