Main Page   Class Hierarchy   Compound List   File List   Compound Members  

NPC Class Reference

A simple non-player character (NPC) class that contains statistics and a number of conditionals to see if the character is a "special" character (like Mr. More...

#include <npc.h>

Inheritance diagram for NPC:

Player List of all members.

Public Methods

 NPC ()
 Constructor -- sets variables and defaults.

void moveRelative (int dx, int dy)
 Tells the NPC to move x,y tiles relatively.


Public Attributes

int hp
 Current health points.

int hp_max
 Maximum number of obtainable health points.

int mp
 Current magic points.

int mp_max
 Maximum obtainable magic points.

int mod
 Attack modifier.

bool bIsHostile
 Will this NPC start a fight upon talking?

string myName
 Obviously, the name of the NPC. STL String.

string whatToSay0
 Their one-liner of conversation. STL String.

int x
 Their location in the world.

int y
 Their location in the world.

bool bIsMrQuesty
 Tells the game engine whether or not this character can give quests.

bool bIsShopKeeper
 Tells the game engine whether or not this character brings up the shop menu.

SDL_Rect rect
 Their location drawn on the screen.

int sprite
 What sprite number should we pull out?

int heading
 What direction (0-3) is the character facing?


Detailed Description

A simple non-player character (NPC) class that contains statistics and a number of conditionals to see if the character is a "special" character (like Mr.

Questy or Mr. Shoppy).

The Player class inherits from this!!!


The documentation for this class was generated from the following files:
Generated on Thu Jun 3 16:21:29 2004 by doxygen1.2.15