Steam Fort 0.5
|
Contains all informations and functions about mobiles. More...
#include <mobile.hpp>
Public Member Functions | |
Mobile () | |
Standard class constructor. | |
Mobile (char c, TCODColor col, int t) | |
Class constructor. | |
int | addmob (bool start) |
Add mob to mobs vector. | |
void | setmob (int x1, int y1, int mindex=-1, bool start=false) |
Draw mobile on sceen. | |
void | generatestats (int newlevel=-1) |
Generate stats of mobile. | |
void | generatename () |
Generate name for mob. | |
bool | generatepath (int x1, int y1, int range=1) |
Generate path to selected target. | |
void | movestep (float time, int mindex) |
Move mobile by one step in path. | |
void | gainexp (int amount) |
Gaining experience by mob. | |
void | setworktime (float time, int stat=-2) |
Set working time of mob. | |
void | deletemob () |
Remove mobile from game. | |
Public Attributes | |
std::string | name |
Name of mobile. | |
int | type |
Type of mobile. | |
int | x |
X-axis position of mobile. | |
int | y |
Y-axis position of mobile. | |
char | ch |
Char displayed on screen for mobile. | |
TCODColor | color |
Char color for displaying on screen for mobile. | |
int | stats [16] |
Mobile statistics. | |
std::string | work |
Name of current mobile work. | |
int | targettype |
Current type of target of mobile. | |
int | target |
Target index. | |
TCODPath * | path |
Path finder for mobile. | |
float | worktime |
Working time for mobile. | |
int | carries |
Index of item carried by mob. | |
int | taken |
If true, mob is used in order. | |
int | workstage |
Stage of order of mob. | |
float | walktime |
Time before next step. | |
std::string | description |
Description of mobile. | |
int | equipment [5] |
Equipment of mob (for robots - upgrades) | |
int | ais [3] |
AI's of mob 0 - movement, 1 - other NPC's, 2 - PC and robots. | |
TCODList< int > | inventory |
Inventory of mob. | |
int | location |
Where mobile can be meet (0 - fort, 1 - adventure, 2 - fort and adventure) | |
TCODList< int > | loot |
Loot available from mobile. | |
bool | flying |
Did mob can fly. | |
TCODList< int > | spells |
Spells known by mobile. |
Contains all informations and functions about mobiles.
Mobile::Mobile | ( | ) |
Standard class constructor.
Set mobile path finder.
Mobile::Mobile | ( | char | c, |
TCODColor | col, | ||
int | t | ||
) |
Class constructor.
Create new mobile and fill some variables.
c | Character used to display mobile on screen |
col | Color for character used to display mobile on screen |
t | Type of mobile (player, robot, etc) |
int Mobile::addmob | ( | bool | start | ) |
Add mob to mobs vector.
start | True mean we start game. |
void Mobile::deletemob | ( | ) |
Remove mobile from game.
void Mobile::gainexp | ( | int | amount | ) |
Gaining experience by mob.
amount | Amount of experience points gained. |
void Mobile::generatename | ( | ) |
Generate name for mob.
bool Mobile::generatepath | ( | int | x1, |
int | y1, | ||
int | range = 1 |
||
) |
Generate path to selected target.
x1 | X-axis position of target |
y1 | Y-axis position of target |
range | Size of range in which destination will be checked. |
void Mobile::generatestats | ( | int | newlevel = -1 | ) |
Generate stats of mobile.
newlevel | New level of mobile. Default -1. |
void Mobile::movestep | ( | float | time, |
int | mindex | ||
) |
Move mobile by one step in path.
time | Length in seconds of the last rendered frame |
mindex | Index of current mob. |
void Mobile::setmob | ( | int | x1, |
int | y1, | ||
int | mindex = -1 , |
||
bool | start = false |
||
) |
Draw mobile on sceen.
x1 | X-axis position on screen |
y1 | Y-axis position on screen |
mindex | Index of mobile. |
start | True means we start game. Default is false. |
void Mobile::setworktime | ( | float | time, |
int | stat = -2 |
||
) |
Set working time of mob.
time | New value of time or length in seconds of the last rendered frame |
stat | Index of stat to use. Default -1. |
int Mobile::ais[3] |
AI's of mob 0 - movement, 1 - other NPC's, 2 - PC and robots.
int Mobile::carries |
Index of item carried by mob.
char Mobile::ch |
Char displayed on screen for mobile.
TCODColor Mobile::color |
Char color for displaying on screen for mobile.
std::string Mobile::description |
Description of mobile.
int Mobile::equipment[5] |
Equipment of mob (for robots - upgrades)
bool Mobile::flying |
Did mob can fly.
TCODList<int> Mobile::inventory |
Inventory of mob.
int Mobile::location |
Where mobile can be meet (0 - fort, 1 - adventure, 2 - fort and adventure)
TCODList<int> Mobile::loot |
Loot available from mobile.
std::string Mobile::name |
Name of mobile.
TCODPath* Mobile::path |
Path finder for mobile.
TCODList<int> Mobile::spells |
Spells known by mobile.
int Mobile::stats[16] |
Mobile statistics.
int Mobile::taken |
If true, mob is used in order.
int Mobile::target |
Target index.
Current type of target of mobile.
int Mobile::type |
Type of mobile.
float Mobile::walktime |
Time before next step.
std::string Mobile::work |
Name of current mobile work.
Stage of order of mob.
float Mobile::worktime |
Working time for mobile.
int Mobile::x |
X-axis position of mobile.
int Mobile::y |
Y-axis position of mobile.