Atrinik Server  4.0
Typedefs | Functions
faction.h File Reference

Go to the source code of this file.

Typedefs

typedef struct factionfaction_t
 

Functions

void toolkit_faction_init (void)
 
void toolkit_faction_deinit (void)
 
faction_t faction_find (shstr *name)
 
void faction_update (faction_t faction, player *pl, double reputation)
 
void faction_update_kill (faction_t faction, player *pl)
 
bool faction_is_friend (faction_t faction, object *op)
 
bool faction_is_alliance (faction_t faction, faction_t faction2)
 
double faction_get_bounty (faction_t faction, player *pl)
 
void faction_clear_bounty (faction_t faction, player *pl)
 

Detailed Description

Structures and prototypes for the faction code.

Author
Alex Tokar

Definition in file faction.h.

Typedef Documentation

typedef struct faction* faction_t

Pointer to a faction structure.

Definition at line 38 of file faction.h.

Function Documentation

void faction_clear_bounty ( faction_t  faction,
player pl 
)

Clear player's bounty for the specified faction.

If the faction is part of an alliance, the bounty will be cleared in the entire alliance.

Parameters
factionFaction.
plPlayer.

Definition at line 790 of file faction.c.

faction_t faction_find ( shstr *  name)

Find a faction in the factions hash table, identified by its name.

Parameters
nameName to find.
Returns
Faction if found, NULL otherwise.

Definition at line 382 of file faction.c.

double faction_get_bounty ( faction_t  faction,
player pl 
)

Acquire player's bounty for the specified faction.

If the faction is part of an alliance, the entire alliance will be checked instead.

Parameters
factionFaction.
plPlayer.
Returns
Bounty.

Definition at line 734 of file faction.c.

bool faction_is_alliance ( faction_t  faction,
faction_t  faction2 
)

Checks whether the two specified factions are in an alliance.

In order to be in an alliance, the first parent with an alliance flag must be the same for both factions.

Parameters
factionFirst faction.
faction2Second faction.
Returns
True if the two factions are in an alliance, false otherwise.

Definition at line 663 of file faction.c.

bool faction_is_friend ( faction_t  faction,
object op 
)

Checks whether the specified object is a friend of the given faction.

Parameters
factionFaction.
opObject to check.
Returns
Whether the object is a friend of the faction.

Definition at line 618 of file faction.c.

void faction_update ( faction_t  faction,
player pl,
double  reputation 
)

Update player's reputation with the specified faction.

Parameters
factionFaction.
plPlayer.
reputationReputation value to add.

Definition at line 509 of file faction.c.

void faction_update_kill ( faction_t  faction,
player pl 
)

Update player's reputation with the specified faction, triggered by killing a member of the faction.

Parameters
factionFaction.
plPlayer.

Definition at line 527 of file faction.c.