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. More... | |
Behavior * | Find (const char *name) |
Find a behavior in the set. More... | |
void | FirePerception (NPC *npc, Perception *pcpt) |
float | GetAngularVelocity (NPC *npc) |
Return the angular velociy of the NPC. More... | |
const csString & | GetCollisionPerception () const |
Return the percpetion to fire for collisions. More... | |
Behavior * | GetCurrentBehavior () |
const csString & | GetFallingPerception () const |
Return the percpetion to fire for falling. More... | |
float | GetHighestNeed (NPC *npc) |
Return hight current or new need. More... | |
const csString & | GetInBoundsPerception () const |
Return the percpetion to fire for InBound. More... | |
const char * | GetName () |
const csString & | GetOutOfBoundsPerception () const |
Return the percpetion to fire for OutOfBounds. More... | |
float | GetVelocity (NPC *npc) |
Return the velociy of the NPC. More... | |
csString | InfoBehaviors (NPC *npc) |
csString | InfoReactions (NPC *npc) |
Info about the reaction list for debug. More... | |
void | Interrupt (NPC *npc) |
bool | Load (iDocumentNode *node) |
bool | Load (iResultRow &node) |
NPCType () | |
NPCType (NPCType &other, NPC *npc) | |
void | SetVelSource (ScriptOperation::VelSource velSource, float vel) |
Set a new velocity source. More... | |
~NPCType () | |
Protected Attributes | |
float | ang_vel |
Default ang_vel for this NPCType. < Will be used for all behaviors unless overriden < by each behavior. More... | |
BehaviorSet | behaviors |
The set of behaviors available for this NPCType. More... | |
csString | collisionPerception |
Global perception value for falling. More... | |
csString | fallingPerception |
Global perception value for falling. More... | |
csString | inBoundsPerception |
Global perception value for falling. More... | |
csString | name |
The name of this NPC type. More... | |
NPC * | npc |
Pointer to the NPC for this brain. More... | |
csString | outOfBoundsPerception |
Global perception value for falling. More... | |
csPDelArray< Reaction > | reactions |
The reactions available for this NPCType. More... | |
float | vel |
Default vel for this NPCType. < Will be used for all behaviors unless overriden < by each behavior. More... | |
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 | ) |
|
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. |
|
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.
|
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.
|
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. |
|
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 | ( | iDocumentNode * | node | ) |
bool NPCType::Load | ( | iResultRow & | node | ) |
void NPCType::SetVelSource | ( | ScriptOperation::VelSource | velSource, |
float | vel | ||
) |
Set a new velocity source.
|
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.
|
protected |
The set of behaviors available for this NPCType.
Definition at line 203 of file npcbehave.h.
|
protected |
Global perception value for falling.
Definition at line 212 of file npcbehave.h.
|
protected |
Global perception value for falling.
Definition at line 215 of file npcbehave.h.
|
protected |
Global perception value for falling.
Definition at line 214 of file npcbehave.h.
|
protected |
The name of this NPC type.
Definition at line 201 of file npcbehave.h.
|
protected |
Pointer to the NPC for this brain.
Definition at line 200 of file npcbehave.h.
|
protected |
Global perception value for falling.
Definition at line 213 of file npcbehave.h.
|
protected |
The reactions available for this NPCType.
Definition at line 202 of file npcbehave.h.
|
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.
|
protected |
Definition at line 210 of file npcbehave.h.