Planeshift
CombatManager Class Reference

This class handles all calculations around combat, using statistics and information from the pspccharacterinfo Prop Classes for both the attacker and the target. More...

#include <combatmanager.h>

Public Member Functions

bool AttackSomeone (gemActor *attacker, gemActor *target, const Stance &stance)
 This is how you start an attack sequence. More...
 
 CombatManager (CacheManager *cachemanager, EntityManager *entitymanager)
 
EntityManagerGetEntityManager ()
 
bool InitializePVP ()
 
bool InPVPRegion (csVector3 &pos, iSector *sector)
 
void NotifyTarget (gemActor *attacker, gemObject *target)
 
void sendAttackList (MsgEntry *me, Client *client)
 
void sendAttackQueue (MsgEntry *me, Client *client)
 
void sendAttackQueue (psCharacter *character)
 
void SetCombat (gemActor *combatant, const Stance &stance)
 
void StopAttack (gemActor *attacker)
 This is how you break an attack sequence off, through death or user command. More...
 
virtual ~CombatManager ()
 
- Public Member Functions inherited from MessageManager< CombatManager >
void HandleMessage (MsgEntry *msg, Client *client)
 Transfers the message to the manager specific function. More...
 
void Subscribe (FunctionPointer fpt, msgtype type, uint32_t flags=0x01)
 Subscribes this manager to a specific message type with a custom callback. More...
 
bool Unsubscribe (msgtype type)
 Unsubscribes this manager from a specific message type. More...
 
bool Unsubscribe (FunctionPointer handler, msgtype type)
 Unsubscribes a specific handler from a specific message type. More...
 
bool UnsubscribeAll ()
 Unsubscribes this manager from all message types. More...
 
virtual ~MessageManager ()
 Unsubscribes all messages then destroys this object. More...
 
- Public Member Functions inherited from MessageManagerBase
csArray< csString > DecodeCommandArea (Client *client, csString target)
 Decodes an area: expression. More...
 
gemObjectFindObjectByString (const csString &str, gemActor *me) const
 Find the object we are referring to in str. More...
 
ClientFindPlayerClient (const char *name)
 Finds Client* of character with given name. More...
 
virtual bool Verify (MsgEntry *pMsg, unsigned int flags, Client *&client)
 

Static Public Member Functions

static const StanceGetLoweredActorStance (CacheManager *cachemanager, gemActor *attacker)
 Gets increased combat stance of particular attacker. More...
 
static const StanceGetRaisedActorStance (CacheManager *cachemanager, gemActor *attacker)
 Gets increased combat stance of particular attacker. More...
 
static const StanceGetStance (CacheManager *cachemanager, csString name)
 Gets combat stance by name. More...
 

Public Attributes

csArray< INVENTORY_SLOT_NUMBERtargetLocations
 

Additional Inherited Members

- Public Types inherited from MessageManager< CombatManager >
typedef void(CombatManager::* FunctionPointer) (MsgEntry *, Client *)
 

Detailed Description

This class handles all calculations around combat, using statistics and information from the pspccharacterinfo Prop Classes for both the attacker and the target.

Definition at line 55 of file combatmanager.h.

Constructor & Destructor Documentation

CombatManager::CombatManager ( CacheManager cachemanager,
EntityManager entitymanager 
)
virtual CombatManager::~CombatManager ( )
virtual

Member Function Documentation

bool CombatManager::AttackSomeone ( gemActor attacker,
gemActor target,
const Stance stance 
)

This is how you start an attack sequence.

EntityManager* CombatManager::GetEntityManager ( )
inline

Definition at line 102 of file combatmanager.h.

static const Stance& CombatManager::GetLoweredActorStance ( CacheManager cachemanager,
gemActor attacker 
)
static

Gets increased combat stance of particular attacker.

If current combat stance is the lowest returns current combat stance

Parameters
cachemanagermanager that holds details about stances from database.
attackergemActor that requests to lower his stance
Returns
Returns combat stance.
static const Stance& CombatManager::GetRaisedActorStance ( CacheManager cachemanager,
gemActor attacker 
)
static

Gets increased combat stance of particular attacker.

If current combat stance is the highest returns current combat stance

Parameters
cachemanagermanager that holds details about stances from database.
attackergemActor that requests to raise his stance
Returns
Returns combat stance.
static const Stance& CombatManager::GetStance ( CacheManager cachemanager,
csString  name 
)
static

Gets combat stance by name.

If combat stance name is invalid returns default global stance

Parameters
cachemanagermanager that holds details about stances from database.
namename of requested stance
Returns
Returns combat stance.
bool CombatManager::InitializePVP ( )
bool CombatManager::InPVPRegion ( csVector3 &  pos,
iSector *  sector 
)
void CombatManager::NotifyTarget ( gemActor attacker,
gemObject target 
)
void CombatManager::sendAttackList ( MsgEntry me,
Client client 
)
void CombatManager::sendAttackQueue ( MsgEntry me,
Client client 
)
void CombatManager::sendAttackQueue ( psCharacter character)
void CombatManager::SetCombat ( gemActor combatant,
const Stance stance 
)
void CombatManager::StopAttack ( gemActor attacker)

This is how you break an attack sequence off, through death or user command.

Member Data Documentation

csArray<INVENTORY_SLOT_NUMBER> CombatManager::targetLocations

Definition at line 105 of file combatmanager.h.


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