Planeshift
Public Member Functions | Protected Attributes

AttackPerception Class Reference

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

#include <perceptions.h>

List of all members.

Public Member Functions

 AttackPerception (const char *n, gemNPCObject *attack)
virtual void ExecutePerception (NPC *npc, float weight)
 All preconditions has been checked, now excecute the perception.
virtual gemNPCObjectGetTarget ()
 Some perception has a target/source.
virtual PerceptionMakeCopy ()
 Make a copy of this perception.

Protected Attributes

csWeakRef< gemNPCActorattacker

Detailed Description

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

The npc should use this to build an initial hate list for the player and his group (if any). 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 311 of file perceptions.h.


Constructor & Destructor Documentation

AttackPerception::AttackPerception ( const char *  n,
gemNPCObject attack 
) [inline]

Definition at line 317 of file perceptions.h.


Member Function Documentation

virtual void AttackPerception::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 gemNPCObject* AttackPerception::GetTarget ( ) [inline, virtual]

Some perception has a target/source.

See also:
DamagePerception
Returns:
the target of this perception.

Reimplemented from Perception.

Definition at line 322 of file perceptions.h.

virtual Perception* AttackPerception::MakeCopy ( ) [virtual]

Make a copy of this perception.

Returns:
the copy.

Reimplemented from Perception.


Member Data Documentation

csWeakRef<gemNPCActor> AttackPerception::attacker [protected]

Definition at line 314 of file perceptions.h.


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