Planeshift
|
A collection of behaviors and reactions will represent a type of npc. More...
#include <npcbehave.h>
Public Member Functions | |
void | Advance (csTicks delta, NPC *npc) |
void | ClearState (NPC *npc) |
void | DeepCopy (NPCType &other) |
void | DumpBehaviorList (csString &output, NPC *npc) |
void | DumpReactionList (csString &output, NPC *npc) |
Dump the reaction list for this NPC. | |
Behavior * | Find (const char *name) |
Find a behavior in the set. | |
void | FirePerception (NPC *npc, Perception *pcpt) |
float | GetAngularVelocity (NPC *npc) |
Return the angular velociy of the NPC. | |
const csString & | GetCollisionPerception () const |
Return the percpetion to fire for collisions. | |
Behavior * | GetCurrentBehavior () |
const csString & | GetFallingPerception () const |
Return the percpetion to fire for falling. | |
float | GetHighestNeed (NPC *npc) |
Return hight current or new need. | |
const csString & | GetInBoundsPerception () const |
Return the percpetion to fire for InBound. | |
const char * | GetName () |
const csString & | GetOutOfBoundsPerception () const |
Return the percpetion to fire for OutOfBounds. | |
float | GetVelocity (NPC *npc) |
Return the velociy of the NPC. | |
csString | InfoBehaviors (NPC *npc) |
csString | InfoReactions (NPC *npc) |
Info about the reaction list for debug. | |
void | Interrupt (NPC *npc) |
bool | Load (iResultRow &node) |
bool | Load (iDocumentNode *node) |
NPCType () | |
NPCType (NPCType &other, NPC *npc) | |
void | SetVelSource (ScriptOperation::VelSource velSource, float vel) |
Set a new velocity source. | |
~NPCType () | |
Protected Attributes | |
float | ang_vel |
Default ang_vel for this NPCType. < Will be used for all behaviors unless overriden < by each behavior. | |
BehaviorSet | behaviors |
The set of behaviors available for this NPCType. | |
csString | collisionPerception |
Global perception value for falling. | |
csString | fallingPerception |
Global perception value for falling. | |
csString | inBoundsPerception |
Global perception value for falling. | |
csString | name |
The name of this NPC type. | |
NPC * | npc |
Pointer to the NPC for this brain. | |
csString | outOfBoundsPerception |
Global perception value for falling. | |
csPDelArray< Reaction > | reactions |
The reactions available for this NPCType. | |
float | vel |
Default vel for this NPCType. < Will be used for all behaviors unless overriden < by each behavior. | |
ScriptOperation::VelSource | velSource |
A collection of behaviors and reactions will represent a type of npc.
Each npc will be assigned one of these types. This lets us reuse the same script for many mobs at once--each one keeping its own state information.
Definition at line 197 of file npcbehave.h.
NPCType::NPCType | ( | ) |
NPCType::~NPCType | ( | ) |
void NPCType::Advance | ( | csTicks | delta, |
NPC * | npc | ||
) |
void NPCType::ClearState | ( | NPC * | npc | ) |
void NPCType::DeepCopy | ( | NPCType & | other | ) |
void NPCType::DumpBehaviorList | ( | csString & | output, |
NPC * | npc | ||
) | [inline] |
Definition at line 248 of file npcbehave.h.
void NPCType::DumpReactionList | ( | csString & | output, |
NPC * | npc | ||
) |
Dump the reaction list for this NPC.
npc | The NPC that own this BehaviorSet. |
Behavior* NPCType::Find | ( | const char * | name | ) | [inline] |
Find a behavior in the set.
Search the set for a behavior maching the given name.
name | The name to search for. |
Definition at line 239 of file npcbehave.h.
void NPCType::FirePerception | ( | NPC * | npc, |
Perception * | pcpt | ||
) |
Return the angular velociy of the NPC.
npc | The NPC that own this BehaviorSet. |
const csString& NPCType::GetCollisionPerception | ( | ) | const |
Return the percpetion to fire for collisions.
Behavior* NPCType::GetCurrentBehavior | ( | ) | [inline] |
Definition at line 269 of file npcbehave.h.
const csString& NPCType::GetFallingPerception | ( | ) | const |
Return the percpetion to fire for falling.
Return hight current or new need.
npc | The NPC that own this BehaviorSet. |
const csString& NPCType::GetInBoundsPerception | ( | ) | const |
Return the percpetion to fire for InBound.
The percepton to fire when a NPC with a region move back inside the region.
const char* NPCType::GetName | ( | ) | [inline] |
Definition at line 227 of file npcbehave.h.
const csString& NPCType::GetOutOfBoundsPerception | ( | ) | const |
Return the percpetion to fire for OutOfBounds.
The percepton to fire when a NPC with a region is moving outside the region.
Return the velociy of the NPC.
npc | The NPC that own this BehaviorSet. |
csString NPCType::InfoBehaviors | ( | NPC * | npc | ) | [inline] |
Definition at line 252 of file npcbehave.h.
csString NPCType::InfoReactions | ( | NPC * | npc | ) |
Info about the reaction list for debug.
npc | The NPC that own this BehaviorSet. |
void NPCType::Interrupt | ( | NPC * | npc | ) |
bool NPCType::Load | ( | iResultRow & | node | ) |
bool NPCType::Load | ( | iDocumentNode * | node | ) |
void NPCType::SetVelSource | ( | ScriptOperation::VelSource | velSource, |
float | vel | ||
) |
Set a new velocity source.
float NPCType::ang_vel [protected] |
Default ang_vel for this NPCType. < Will be used for all behaviors unless overriden < by each behavior.
Definition at line 204 of file npcbehave.h.
BehaviorSet NPCType::behaviors [protected] |
The set of behaviors available for this NPCType.
Definition at line 203 of file npcbehave.h.
csString NPCType::collisionPerception [protected] |
Global perception value for falling.
Definition at line 212 of file npcbehave.h.
csString NPCType::fallingPerception [protected] |
Global perception value for falling.
Definition at line 215 of file npcbehave.h.
csString NPCType::inBoundsPerception [protected] |
Global perception value for falling.
Definition at line 214 of file npcbehave.h.
csString NPCType::name [protected] |
The name of this NPC type.
Definition at line 201 of file npcbehave.h.
NPC* NPCType::npc [protected] |
Pointer to the NPC for this brain.
Definition at line 200 of file npcbehave.h.
csString NPCType::outOfBoundsPerception [protected] |
Global perception value for falling.
Definition at line 213 of file npcbehave.h.
csPDelArray<Reaction> NPCType::reactions [protected] |
The reactions available for this NPCType.
Definition at line 202 of file npcbehave.h.
float NPCType::vel [protected] |
Default vel for this NPCType. < Will be used for all behaviors unless overriden < by each behavior.
Definition at line 207 of file npcbehave.h.
ScriptOperation::VelSource NPCType::velSource [protected] |
Definition at line 210 of file npcbehave.h.