Crossfire Server, Branch 1.12  R12190
Functions
player.c File Reference

Player-structure related functions. More...

#include <global.h>
Include dependency graph for player.c:

Go to the source code of this file.

Functions

int atnr_is_dragon_enabled (int attacknr)
 Determine if the attacktype represented by the specified attack-number is enabled for dragon players.
void clear_player (player *pl)
 Clears data in player structure.
void free_player (player *pl)
 Clears player structure, including pointed object (through free_object()).
client_spellget_client_spell_state (player *pl, object *spell)
 Gets the (client-side) spell state for specified spell.
int is_dragon_pl (const object *op)
 Checks if player is a dragon.
int is_old_wraith_pl (object *op)
 Checks if player is a wraith without the 'wraith feed' skill.
int is_wraith_pl (object *op)
 Tests if a player is a wraith.

Detailed Description

Player-structure related functions.

Definition in file player.c.


Function Documentation

int atnr_is_dragon_enabled ( int  attacknr)

Determine if the attacktype represented by the specified attack-number is enabled for dragon players.

A dragon player (quetzal) can gain resistances for all enabled attacktypes.

Parameters:
attacknrattacktype to check
Returns:
TRUE if player can gain resistances in that, FALSE else.

Definition at line 106 of file player.c.

References ATNR_ACID, ATNR_COLD, ATNR_ELECTRICITY, ATNR_FIRE, ATNR_MAGIC, and ATNR_POISON.

Referenced by command_resistances(), describe_item(), describe_resistance(), dragon_eat_flesh(), dragon_level_gain(), and set_dragon_name().

Here is the caller graph for this function:

void clear_player ( player pl)

Clears data in player structure.

Socket isn't touched. Nor is anything that doesn't need to be freed. So you may need to do a memset() to clear out values.

Parameters:
plplayer to clear. Pointer is still valid, and can be reused for "play again".

Definition at line 45 of file player.c.

References client_spell::next, pl::spell_state, pl::stack_items, and pl::stack_position.

Referenced by free_player(), and get_player().

Here is the caller graph for this function:

void free_player ( player pl)

Clears player structure, including pointed object (through free_object()).

Parameters:
plplayer to clear. Pointer is invalid after this call.

Definition at line 68 of file player.c.

References CFREE, clear_player(), socket_struct::faces_sent, first_player, FLAG_REMOVED, free_object(), llevError, LOG(), pl::next, pl::ob, QUERY_FLAG, remove_ob(), and pl::socket.

Referenced by final_free_player().

Here is the call graph for this function:

Here is the caller graph for this function:

client_spell* get_client_spell_state ( player pl,
object *  spell 
)

Gets the (client-side) spell state for specified spell.

Will be created to empty state if not found.

Note:
will fatal() in case of memory allocation failure.
Parameters:
plplayer we're handling.
spellspell for which to search data.
Returns:
state information for that spell.

Definition at line 147 of file player.c.

References fatal(), client_spell::next, OUT_OF_MEMORY, client_spell::spell, and pl::spell_state.

Referenced by append_spell(), and esrv_update_spells().

Here is the call graph for this function:

Here is the caller graph for this function:

int is_dragon_pl ( const object *  op)

Checks if player is a dragon.

Parameters:
opplayer to check. Can be NULL.
Returns:
TRUE if the adressed object 'ob' is a player of the dragon race.

Definition at line 125 of file player.c.

References PLAYER.

Referenced by check_login(), command_resistances(), command_title(), describe_item(), describe_monster(), dragon_eat_flesh(), find_best_player_hth_skill(), food_type_apply(), perceive_self(), and player_lvl_adj().

Here is the caller graph for this function:

int is_old_wraith_pl ( object *  op)

Checks if player is a wraith without the 'wraith feed' skill.

Parameters:
opplayer to check.
Returns:
true if the adressed object 'ob' is an old wraith player, false else.

Definition at line 192 of file player.c.

References is_wraith_pl(), and PLAYER.

Referenced by food_type_apply().

Here is the call graph for this function:

Here is the caller graph for this function:

int is_wraith_pl ( object *  op)

Tests if a player is a wraith.

Parameters:
opplayer to check.
Returns:
true if the adressed object 'ob' is a wraith player, false else.

Definition at line 173 of file player.c.

References PLAYER.

Referenced by eat_special_food(), food_type_apply(), hit_with_one_attacktype(), and is_old_wraith_pl().

Here is the caller graph for this function: