Steam Fort 0.5
|
00001 /********************************************************************* 00002 * Copyright 2011 Bartek thindil Jasicki 00003 * 00004 * This file is part of Steam Fort. 00005 * 00006 * Steam Fort is free software: you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation, either version 3 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * Steam Fort is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with Steam Fort. If not, see <http://www.gnu.org/licenses/>. 00018 *********************************************************************/ 00019 #ifndef MOBILE_HPP 00020 #define MOBILE_HPP 00021 #include <string> 00022 #include "libtcod.hpp" 00023 #include "gui/gui.hpp" 00024 00028 typedef enum MobileTypes 00029 { 00030 PLAYER, 00031 ROBOT, 00032 ANIMAL, 00033 MONSTER 00034 } MOBILETYPE; 00035 00036 typedef enum MobileLocations 00037 { 00038 FORTONLY, 00039 ADVENTUREONLY 00040 } MOBILELOCATION; 00041 00045 class Mobile 00046 { 00047 public: 00051 std::string name; 00055 int type; 00059 int x; 00063 int y; 00067 char ch; 00071 TCODColor color; 00075 int stats[16]; 00079 std::string work; 00083 int targettype; 00087 int target; 00091 TCODPath *path; 00095 float worktime; 00099 int carries; 00103 int taken; 00107 int workstage; 00111 float walktime; 00115 std::string description; 00119 int equipment[5]; 00123 int ais[3]; 00127 TCODList<int> inventory; 00131 int location; 00135 TCODList<int> loot; 00139 bool flying; 00143 TCODList<int> spells; 00144 00145 Mobile(); 00146 Mobile(char c, TCODColor col, int t); 00147 int addmob(bool start); 00148 void setmob(int x1, int y1, int mindex = -1, bool start = false); 00149 void generatestats(int newlevel = -1); 00150 void generatename(); 00151 bool generatepath(int x1, int y1, int range = 1); 00152 void movestep(float time, int mindex); 00153 void gainexp(int amount); 00154 void setworktime(float time, int stat = -2); 00155 void deletemob(); 00156 }; 00157 00158 int find_proto_mob(std::string name, int type = -1); 00159 void buildMobileUI(); 00160 void setVisibleCrew(bool visible); 00161 int showMobInfo(int index); 00162 int find_mob(std::string name = "", int x = -1, int y = -1); 00163 TCODList<int> find_all_proto_mobs(int type, int notlocation = -1, int maxlevel = -1); 00164 int find_near_mob(std::string name, int x, int y, int radius, TCODList<int> *types, int fovradius, bool visible = true); 00165 void drawItems(int index); 00166 TCODList<int> find_all_mobs(int type); 00167 void mobClb(Widget *w, void *data); 00168 00169 #endif