Planeshift
|
#include <gem.h>
Classes | |
struct | DialogCounter |
Public Member Functions | |
void | ActionCommand (bool actionMy, bool actionNarrate, const char *actText, Client *who, bool actionPublic, csTicks &timeDelay) |
Used to allow a NPC to communicate through action to its environment. | |
void | AddBadText (const char *playerSaid, const char *trigger) |
virtual void | AddLootablePlayer (PID playerID) |
virtual void | ApplyStaminaCalculations (const csVector3 &velocity, float times) |
virtual void | Broadcast (int clientnum, bool control) |
void | CheckSpeakers () |
Check speakers to see if not spoken to anymore. | |
virtual void | ForcePositionUpdate () |
gemNPC (GEMSupervisor *gemSupervisor, CacheManager *cachemanager, EntityManager *entityManager, psCharacter *chardata, const char *factname, InstanceID myInstance, iSector *room, const csVector3 &pos, float rotangle, int clientnum) | |
void | GetBadText (size_t first, size_t last, csStringArray &saidArray, csStringArray &trigArray) |
virtual unsigned | GetDefaultAttackID () |
virtual csString | GetDefaultBehavior (const csString &dfltBehaviors) |
const csArray< PID > & | GetLootablePlayers () const |
virtual psNPCDialog * | GetNPCDialogPtr () |
virtual const char * | GetObjectType () |
virtual gemObject * | GetOwner () |
virtual Client * | GetRandomLootClient (int range) |
virtual AccountID | GetSuperclientID () |
virtual gemObject * | GetTarget () |
virtual bool | HasKillStealProtection () |
Returns if the npc has killsteal protection. | |
bool | IsBusy () const |
True if the NPC client sent the busy command. | |
bool | IsLootablePlayer (PID playerID) |
void | ReactToPlayerApproach (psNPCCommandsMessage::PerceptionType type, gemActor *player) |
void | RegisterSpeaker (Client *client) |
Register clients that speak to a npc. | |
virtual void | RemoveLootablePlayer (PID playerID) |
void | Say (const char *sayText, Client *who, bool sayPublic, csTicks &timeDelay) |
Used to allow a NPC to communicate by saying things to its environment. | |
virtual bool | Send (int clientnum, bool control, bool to_superclients, psPersistAllEntities *allEntities=NULL) |
Send this object to the given client. | |
virtual void | SendBehaviorMessage (const csString &str, gemObject *obj) |
virtual void | SendGroupStats () |
void | SetBusy (bool busy) |
To set the busy state of the NPC. | |
virtual void | SetCombatStance (const Stance &stance) |
virtual void | SetDefaultAttackID (unsigned id) |
virtual void | SetOwner (gemObject *owner) |
virtual void | SetPosition (const csVector3 &pos, float angle, iSector *sector) |
virtual void | SetSuperclientID (AccountID id) |
virtual void | SetTarget (gemObject *newTarget) |
void | SetupDialog (PID npcID, PID masterNpcID, bool force=false) |
void | ShowPopupMenu (Client *client) |
virtual | ~gemNPC () |
Protected Attributes | |
csPDelArray< DialogCounter > | badText |
bool | busy |
Indicator from the NPC client to state the if the NPC is busy. | |
unsigned | default_attackid |
Default attack type ID. | |
csArray< PID > | lootablePlayers |
Array of client id's allowed to loot this char. | |
csTicks | nextLongRangeAvail |
When can npc respond to long range prox trigger again. | |
csTicks | nextShortRangeAvail |
When can npc respond to short range prox trigger again. | |
csTicks | nextVeryShortRangeAvail |
When can npc respond to very short range prox trigger again. | |
psNPCDialog * | npcdialog |
csWeakRef< gemObject > | owner |
int | speakers |
AccountID | superClientID |
csWeakRef< gemObject > | target |
gemNPC::gemNPC | ( | GEMSupervisor * | gemSupervisor, |
CacheManager * | cachemanager, | ||
EntityManager * | entityManager, | ||
psCharacter * | chardata, | ||
const char * | factname, | ||
InstanceID | myInstance, | ||
iSector * | room, | ||
const csVector3 & | pos, | ||
float | rotangle, | ||
int | clientnum | ||
) |
virtual gemNPC::~gemNPC | ( | ) | [virtual] |
void gemNPC::ActionCommand | ( | bool | actionMy, |
bool | actionNarrate, | ||
const char * | actText, | ||
Client * | who, | ||
bool | actionPublic, | ||
csTicks & | timeDelay | ||
) |
Used to allow a NPC to communicate through action to its environment.
Use this to publish chat messages of type ME,MY,NARRATE for NPCs. They can either be of private to the client who or broadcasted. Use one of the actionMy or actionNarrate to override the default type of ME.
actionMy | If true a /my will be used |
actionNarrate | If true a narrate will be used if not actionMy is set. |
actText | The text to send. |
who | Who to send to. |
actionPublic | True if it should be a public action, otherwise it will only be sent to the destination client given by who. |
timeDelay | Used to lay out a sequence of responses in time depended on the length of the actText. |
void gemNPC::AddBadText | ( | const char * | playerSaid, |
const char * | trigger | ||
) |
virtual void gemNPC::AddLootablePlayer | ( | PID | playerID | ) | [virtual] |
Reimplemented from gemObject.
virtual void gemNPC::ApplyStaminaCalculations | ( | const csVector3 & | velocity, |
float | times | ||
) | [inline, virtual] |
virtual void gemNPC::Broadcast | ( | int | clientnum, |
bool | control | ||
) | [virtual] |
clientnum | The client that initiated this update. |
control | Set to true when sent to the controlling client. |
Reimplemented from gemActor.
void gemNPC::CheckSpeakers | ( | ) |
Check speakers to see if not spoken to anymore.
virtual void gemNPC::ForcePositionUpdate | ( | ) | [virtual] |
void gemNPC::GetBadText | ( | size_t | first, |
size_t | last, | ||
csStringArray & | saidArray, | ||
csStringArray & | trigArray | ||
) |
virtual unsigned gemNPC::GetDefaultAttackID | ( | ) | [inline, virtual] |
virtual csString gemNPC::GetDefaultBehavior | ( | const csString & | dfltBehaviors | ) | [virtual] |
Reimplemented from gemActor.
const csArray<PID>& gemNPC::GetLootablePlayers | ( | ) | const [inline] |
virtual psNPCDialog* gemNPC::GetNPCDialogPtr | ( | ) | [inline, virtual] |
virtual const char* gemNPC::GetObjectType | ( | ) | [inline, virtual] |
virtual gemObject* gemNPC::GetOwner | ( | ) | [inline, virtual] |
virtual AccountID gemNPC::GetSuperclientID | ( | ) | [inline, virtual] |
virtual bool gemNPC::HasKillStealProtection | ( | ) | [inline, virtual] |
bool gemNPC::IsBusy | ( | ) | const |
True if the NPC client sent the busy command.
NPC operation <busy /> and <idle /> set and cleare this flag.
bool gemNPC::IsLootablePlayer | ( | PID | playerID | ) | [virtual] |
Reimplemented from gemObject.
void gemNPC::ReactToPlayerApproach | ( | psNPCCommandsMessage::PerceptionType | type, |
gemActor * | player | ||
) |
void gemNPC::RegisterSpeaker | ( | Client * | client | ) |
Register clients that speak to a npc.
virtual void gemNPC::RemoveLootablePlayer | ( | PID | playerID | ) | [virtual] |
Reimplemented from gemObject.
void gemNPC::Say | ( | const char * | sayText, |
Client * | who, | ||
bool | sayPublic, | ||
csTicks & | timeDelay | ||
) |
Used to allow a NPC to communicate by saying things to its environment.
Use this to publish chat messages of type SAY for NPCs. They can either be of private to the client who or broadcasted.
sayText | The text to send. |
who | Who to send to. |
sayPublic | True if it should be a public say, otherwise it will only be sent to the destination client given by who. |
timeDelay | Used to lay out a sequence of responses in time depended on the length of the sayText. |
virtual bool gemNPC::Send | ( | int | clientnum, |
bool | control, | ||
bool | to_superclients, | ||
psPersistAllEntities * | allEntities = NULL |
||
) | [virtual] |
Send this object to the given client.
clientnum | The client that initiated this update. |
control | Set to true when sent to the controlling client. |
to_superclients | Send to super clients |
allEntities | Buffer the message instead of sending it. |
Reimplemented from gemActor.
virtual void gemNPC::SendBehaviorMessage | ( | const csString & | str, |
gemObject * | obj | ||
) | [virtual] |
Reimplemented from gemActor.
virtual void gemNPC::SendGroupStats | ( | ) | [virtual] |
Reimplemented from gemActor.
void gemNPC::SetBusy | ( | bool | busy | ) |
To set the busy state of the NPC.
NPC operation <busy /> and <idle /> set and cleare this flag.
virtual void gemNPC::SetCombatStance | ( | const Stance & | stance | ) | [virtual] |
Reimplemented from gemActor.
virtual void gemNPC::SetDefaultAttackID | ( | unsigned | id | ) | [inline, virtual] |
virtual void gemNPC::SetOwner | ( | gemObject * | owner | ) | [virtual] |
virtual void gemNPC::SetPosition | ( | const csVector3 & | pos, |
float | angle, | ||
iSector * | sector | ||
) | [virtual] |
Reimplemented from gemActor.
virtual void gemNPC::SetSuperclientID | ( | AccountID | id | ) | [inline, virtual] |
virtual void gemNPC::SetTarget | ( | gemObject * | newTarget | ) | [inline, virtual] |
void gemNPC::SetupDialog | ( | PID | npcID, |
PID | masterNpcID, | ||
bool | force = false |
||
) |
void gemNPC::ShowPopupMenu | ( | Client * | client | ) |
csPDelArray<DialogCounter> gemNPC::badText [protected] |
bool gemNPC::busy [protected] |
unsigned gemNPC::default_attackid [protected] |
csArray<PID> gemNPC::lootablePlayers [protected] |
csTicks gemNPC::nextLongRangeAvail [protected] |
csTicks gemNPC::nextShortRangeAvail [protected] |
csTicks gemNPC::nextVeryShortRangeAvail [protected] |
psNPCDialog* gemNPC::npcdialog [protected] |
csWeakRef<gemObject> gemNPC::owner [protected] |
int gemNPC::speakers [protected] |
AccountID gemNPC::superClientID [protected] |
csWeakRef<gemObject> gemNPC::target [protected] |