Atrinik Client 2.5
Functions | Variables
client/player.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

void clear_player ()
void new_player (long tag, long weight, short face)
void client_send_apply (int tag)
void client_send_examine (int tag)
void client_send_move (int loc, int tag, int nrof)
void send_command (const char *command)
void CompleteCmd (unsigned char *data, int len)
void set_weight_limit (uint32 wlim)
void init_player_data ()
void widget_player_data_event (widgetdata *widget, int x, int y)
void widget_show_player_data (widgetdata *widget)
void widget_player_stats (widgetdata *widget)
void widget_skillgroups (widgetdata *widget)
void widget_show_player_doll_event ()
void widget_show_player_doll (widgetdata *widget)
void widget_show_main_lvl (widgetdata *widget)
void widget_show_skill_exp (widgetdata *widget)
void widget_show_regeneration (widgetdata *widget)
void widget_show_container (widgetdata *widget)
void widget_highlight_menu (widgetdata *widget)
void widget_menu_event (widgetdata *widget, int x, int y)
void widget_menuitem_event (widgetdata *widget, int x, int y, void(*menu_func_ptr)(widgetdata *, int, int))
void widget_show_label (widgetdata *widget)
void widget_show_bitmap (widgetdata *widget)
int gender_to_id (const char *gender)

Variables

static _player_doll_pos player_doll [PDOLL_INIT]
static float weapon_speed_table [19]
const char * gender_noun [GENDER_MAX]

Detailed Description

This file handles various player related functions. This includes both things that operate on the player item, cpl structure, or various commands that the player issues.

This file does most of the handling of commands from the client to server (see commands.c for server->client)

Does most of the work for sending messages to the server

Definition in file player.c.


Function Documentation

void clear_player ( )

Clear the player data like quickslots, inventory items, etc.

Definition at line 81 of file player.c.

void client_send_apply ( int  tag)

Send apply command to server.

Parameters:
tagItem tag.

Definition at line 106 of file player.c.

void client_send_examine ( int  tag)

Send examine command to server.

Parameters:
tagItem tag.

Definition at line 117 of file player.c.

void client_send_move ( int  loc,
int  tag,
int  nrof 
)

Request nrof of objects of tag get moved to loc.

Parameters:
locLocation where to move the object.
tagItem tag.
nrofNumber of objects from tag.

Definition at line 130 of file player.c.

void CompleteCmd ( unsigned char *  data,
int  len 
)

Receive complete command.

Parameters:
dataThe incoming data.
lenLength of the data.

Definition at line 161 of file player.c.

int gender_to_id ( const char *  gender)

Transform gender-string into its ID.

Parameters:
genderThe gender string.
Returns:
The gender's ID as one of Gender IDs., or -1 if 'gender' didn't match any of the existing genders.

Definition at line 1352 of file player.c.

void init_player_data ( )

Initialize player data.

Definition at line 177 of file player.c.

void new_player ( long  tag,
long  weight,
short  face 
)

Initialize new player.

Parameters:
tagTag of the player.
nameName of the player.
weightWeight of the player.
faceFace ID.

Definition at line 96 of file player.c.

void send_command ( const char *  command)

This should be used for all 'command' processing. Other functions should call this so that proper windowing will be done.

Parameters:
commandText command.
Returns:
1 if command was sent, 0 otherwise.

Definition at line 143 of file player.c.

void set_weight_limit ( uint32  wlim)

Set the player's weight limit.

Parameters:
wlimThe weight limit to set.

Definition at line 170 of file player.c.

void widget_menu_event ( widgetdata widget,
int  x,
int  y 
)

Handles events when the menuitem is clicked on.

Definition at line 1285 of file player.c.

void widget_menuitem_event ( widgetdata widget,
int  x,
int  y,
void(*)(widgetdata *, int, int)  menu_func_ptr 
)

Call the function for the menuitem that was clicked on.

Definition at line 1322 of file player.c.

void widget_player_data_event ( widgetdata widget,
int  x,
int  y 
)

Mouse event on player data widget.

Parameters:
widgetThe widget object.
xMouse X.
yMouse Y.

Definition at line 230 of file player.c.

void widget_player_stats ( widgetdata widget)

Show player stats widget with stats, health, mana, grace, etc.

Parameters:
widgetThe widget object.

Definition at line 263 of file player.c.

void widget_show_container ( widgetdata widget)

Show container widget.

Parameters:
widgetThe widget object.

Definition at line 1080 of file player.c.

void widget_show_main_lvl ( widgetdata widget)

Show main level widget.

Contains the player's level, experience in highest skill, and percent in bubbles to how close you are to next level.

Parameters:
widgetThe widget object.

Definition at line 730 of file player.c.

void widget_show_player_data ( widgetdata widget)

Show player data widget with name, gender, title, etc.

Parameters:
widgetThe widget object.

Definition at line 246 of file player.c.

void widget_show_player_doll ( widgetdata widget)

Show player doll widget with applied items from inventory.

Parameters:
widgetThe widget object.

Definition at line 570 of file player.c.

void widget_show_player_doll_event ( )

Handle mouse events over player doll widget (dragging items).

Definition at line 532 of file player.c.

void widget_show_regeneration ( widgetdata widget)

Show regeneration widget.

Parameters:
widgetThe widget object.

Definition at line 1026 of file player.c.

void widget_show_skill_exp ( widgetdata widget)

Show skill experience widget. This also includes the action timer.

Parameters:
widgetThe widget object.

Definition at line 806 of file player.c.

void widget_skillgroups ( widgetdata widget)

Show skill groups widget.

Parameters:
widgetThe widget object.

Definition at line 471 of file player.c.


Variable Documentation

const char* gender_noun[GENDER_MAX]
Initial value:
{
    "neuter", "male", "female", "hermaphrodite"
}

Gender nouns.

Definition at line 74 of file player.c.

_player_doll_pos player_doll[PDOLL_INIT] [static]
Initial value:
{
    {93,    55},
    {93,    8},
    {93,    100},
    {93,    158},
    {135,   95},
    {50,    95},
    {50,    134},
    {135,   134},
    {54,    51},
    {141,   10},
    {5,     148},
    {180,   148},
    {5,     108},
    {180,   108},
    {43,    10},
    {4,     10}
}

Player doll item positions.

Used to determine where to put item sprites on the player doll.

Definition at line 43 of file player.c.

float weapon_speed_table[19] [static]
Initial value:
{
    20.0f,  18.0f,  10.0f,  8.0f,   5.5f,
    4.25f,  3.50f,  3.05f,  2.70f,  2.35f,
    2.15f,  1.95f,  1.80f,  1.60f,  1.52f,
    1.44f,  1.32f,  1.25f,  1.20f
}

Weapon speed table.

Definition at line 64 of file player.c.