Planeshift
|
Whenever a player casts a spell on himself, another player, or any npc, this perception is passed to npc's in the vicinity. More...
#include <perceptions.h>
Public Member Functions | |
virtual void | ExecutePerception (NPC *npc, float weight) |
All preconditions has been checked, now excecute the perception. More... | |
virtual gemNPCObject * | GetTarget () |
Some perception has a target/source. More... | |
virtual Perception * | MakeCopy () |
Make a copy of this perception. More... | |
virtual bool | ShouldReact (Reaction *reaction, NPC *npc) |
Check if this perception should react to a reaction. More... | |
SpellPerception (const char *name, gemNPCObject *caster, gemNPCObject *target, const char *spell_type, float severity) | |
![]() | |
virtual bool | GetLocation (csVector3 &pos, iSector *§or) |
Get a location assosiated with the perception. More... | |
virtual const csString & | GetName () const |
Get the name of the perception. More... | |
virtual float | GetRadius () const |
Get the radius of the perception. More... | |
const csString & | GetType () const |
Get the type of the perception. More... | |
Perception (const char *name) | |
Constructor. More... | |
Perception (const char *name, const char *type) | |
Constructor. More... | |
void | SetType (const char *type) |
Set the type of the perception. More... | |
virtual csString | ToString (NPC *npc) |
Get a text description of the perception. More... | |
virtual | ~Perception () |
Destructor. More... | |
Protected Attributes | |
csWeakRef< gemNPCActor > | caster |
float | spell_severity |
csWeakRef< gemNPCActor > | target |
![]() | |
csString | name |
The name of this perception. More... | |
csString | type |
Type used by perceptions. Usally they correspond to the same value in a reaction. More... | |
Whenever a player casts a spell on himself, another player, or any npc, this perception is passed to npc's in the vicinity.
We cannot only use targeted NPCs because an npc in combat may want to react to a player healing his group mate, which helps his team and hurts the NPC indirectly. Right now, reactions are allowed by type of spell, and depending on the severity, it affects his/her hate list according to the weight supplied.
Definition at line 388 of file perceptions.h.
SpellPerception::SpellPerception | ( | const char * | name, |
gemNPCObject * | caster, | ||
gemNPCObject * | target, | ||
const char * | spell_type, | ||
float | severity | ||
) |
All preconditions has been checked, now excecute the perception.
npc | The target of the percpetion. |
weight | Indicate how much the HateList of the npc should be changed. Value comes from the reaction. |
Reimplemented from Perception.
|
inlinevirtual |
Some perception has a target/source.
Reimplemented from Perception.
Definition at line 400 of file perceptions.h.
|
virtual |
Check if this perception should react to a reaction.
reaction | The reaction to check for. |
npc | The NPC that might receive this. |
Reimplemented from Perception.
|
protected |
Definition at line 391 of file perceptions.h.
|
protected |
Definition at line 393 of file perceptions.h.
|
protected |
Definition at line 392 of file perceptions.h.