Planeshift
GroupAttackPerception Class Reference

Whenever an NPC is attacked by a grouop, this perception is passed to the attacked npc. More...

#include <perceptions.h>

Public Member Functions

virtual void ExecutePerception (NPC *npc, float weight)
 All preconditions has been checked, now excecute the perception. More...
 
 GroupAttackPerception (const char *n, csArray< gemNPCObject * > &ents, csArray< int > &slots)
 
virtual PerceptionMakeCopy ()
 Make a copy of this perception. More...
 
- Public Member Functions inherited from Perception
virtual bool GetLocation (csVector3 &pos, iSector *&sector)
 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...
 
virtual gemNPCObjectGetTarget ()
 Some perception has a target/source. 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 bool ShouldReact (Reaction *reaction, NPC *npc)
 Check if this perception should react to a reaction. More...
 
virtual csString ToString (NPC *npc)
 Get a text description of the perception. More...
 
virtual ~Perception ()
 Destructor. More...
 

Protected Attributes

csWeakRef< gemNPCObjectattacker
 
csArray< gemNPCObject * > attacker_ents
 
csArray< intbestSkillSlots
 
- Protected Attributes inherited from Perception
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...
 

Detailed Description

Whenever an NPC is attacked by a grouop, this perception is passed to the attacked npc.

The npc should use this to build an initial hate list for the player group. If the designer wants to cheat, he can start attacking back on this event instead of on first damage, and save a few seconds in response time.

Definition at line 335 of file perceptions.h.

Constructor & Destructor Documentation

GroupAttackPerception::GroupAttackPerception ( const char *  n,
csArray< gemNPCObject * > &  ents,
csArray< int > &  slots 
)
inline

Definition at line 343 of file perceptions.h.

Member Function Documentation

virtual void GroupAttackPerception::ExecutePerception ( NPC npc,
float  weight 
)
virtual

All preconditions has been checked, now excecute the perception.

Parameters
npcThe target of the percpetion.
weightIndicate how much the HateList of the npc should be changed. Value comes from the reaction.

Reimplemented from Perception.

virtual Perception* GroupAttackPerception::MakeCopy ( )
virtual

Make a copy of this perception.

Returns
the copy.

Reimplemented from Perception.

Member Data Documentation

csWeakRef<gemNPCObject> GroupAttackPerception::attacker
protected

Definition at line 338 of file perceptions.h.

csArray<gemNPCObject*> GroupAttackPerception::attacker_ents
protected

Definition at line 339 of file perceptions.h.

csArray<int> GroupAttackPerception::bestSkillSlots
protected

Definition at line 340 of file perceptions.h.


The documentation for this class was generated from the following file: