1 // $Id: main.cpp 3275 2006-04-09 00:32:34Z sommer $
4 // Copyright (C) 2005 Matthias Braun <matze@braunis.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 #ifndef __FUNCTIONS_H__
21 #define __FUNCTIONS_H__
27 #include "player_status.hpp"
33 //TODO: Get this from PlayerStatus (update MiniSwig!)
34 static const int KEY_BRASS = 0x001;
35 static const int KEY_IRON = 0x002;
36 static const int KEY_BRONZE = 0x004;
37 static const int KEY_SILVER = 0x008;
38 static const int KEY_GOLD = 0x010;
41 * Display the value of the argument. This is usefull for inspecting tables.
43 int display(HSQUIRRELVM vm) __custom;
46 * Display a text file and scrolls it over the screen (on next screenswitch)
48 void display_text_file(const std::string& filename);
51 * Load and display a worldmap (on next screenswitch)
53 void load_worldmap(const std::string& filename);
56 * Load and display a level (on next screenswitch)
58 void load_level(const std::string& filename);
61 * Suspend the script execution for the specified number of seconds
63 void wait(HSQUIRRELVM vm, float seconds) __suspend;
66 * Suspend the script execution until the current screen has been changed
68 void wait_for_screenswitch(HSQUIRRELVM vm) __suspend;
71 * Translate a text into the users language (by looking it up in the .po
74 std::string translate(const std::string& text);
77 * Load a script file and executes it. This is typically used to import
78 * functions from external files.
80 void import(HSQUIRRELVM v, const std::string& filename);
83 * Add a key to the inventory
85 void add_key(int new_key);