Steam Fort 0.5
Public Member Functions | Public Attributes

Mobile Class Reference

Contains all informations and functions about mobiles. More...

#include <mobile.hpp>

List of all members.

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.

Detailed Description

Contains all informations and functions about mobiles.


Constructor & Destructor Documentation

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.

Parameters:
cCharacter used to display mobile on screen
colColor for character used to display mobile on screen
tType of mobile (player, robot, etc)

Member Function Documentation

int Mobile::addmob ( bool  start)

Add mob to mobs vector.

Parameters:
startTrue mean we start game.
void Mobile::deletemob ( )

Remove mobile from game.

void Mobile::gainexp ( int  amount)

Gaining experience by mob.

Parameters:
amountAmount 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.

Parameters:
x1X-axis position of target
y1Y-axis position of target
rangeSize of range in which destination will be checked.
Returns:
True if path was computed, otherwise false
void Mobile::generatestats ( int  newlevel = -1)

Generate stats of mobile.

Parameters:
newlevelNew level of mobile. Default -1.
void Mobile::movestep ( float  time,
int  mindex 
)

Move mobile by one step in path.

Parameters:
timeLength in seconds of the last rendered frame
mindexIndex of current mob.
void Mobile::setmob ( int  x1,
int  y1,
int  mindex = -1,
bool  start = false 
)

Draw mobile on sceen.

Parameters:
x1X-axis position on screen
y1Y-axis position on screen
mindexIndex of mobile.
startTrue means we start game. Default is false.
void Mobile::setworktime ( float  time,
int  stat = -2 
)

Set working time of mob.

Parameters:
timeNew value of time or length in seconds of the last rendered frame
statIndex of stat to use. Default -1.

Member Data Documentation

int Mobile::ais[3]

AI's of mob 0 - movement, 1 - other NPC's, 2 - PC and robots.

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.

Equipment of mob (for robots - upgrades)

Did mob can fly.

TCODList<int> Mobile::inventory

Inventory of mob.

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.

If true, mob is used in order.

Target index.

Current type of target of mobile.

Type of mobile.

Time before next step.

std::string Mobile::work

Name of current mobile work.

Stage of order of mob.

Working time for mobile.

int Mobile::x

X-axis position of mobile.

int Mobile::y

Y-axis position of mobile.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines