Crossfire Server, Branch 1.12  R12190
player.h
Go to the documentation of this file.
00001 /*
00002  * static char *rcsid_player_h =
00003  *   "$Id: player.h 11578 2009-02-23 22:02:27Z lalo $";
00004  */
00005 
00006 /*
00007     CrossFire, A Multiplayer game for X-windows
00008 
00009     Copyright (C) 2002 Mark Wedel & Crossfire Development Team
00010     Copyright (C) 1992 Frank Tore Johansen
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00025 
00026     The authors can be reached via e-mail at crossfire-devel@real-time.com
00027 */
00028 
00034 #ifndef PLAYER_H
00035 #define PLAYER_H
00036 
00038 #define NUM_OUTPUT_BUFS 5
00039 
00040 typedef struct {
00041     const char *buf;        
00042     uint32 first_update;    
00043     uint16 count;           
00044 } Output_Buf;
00045 
00052 typedef enum rangetype {
00053     range_bottom    = -1,
00054     range_none      = 0,
00055     range_bow       = 1,
00056     range_magic     = 2,
00057     range_misc      = 3,
00058     range_golem     = 4,
00059     range_skill     = 5,
00060     range_builder   = 6,
00061     range_size      = 7
00062 } rangetype;
00063 
00065 typedef enum _bowtype {
00066     bow_normal = 0,
00067     bow_threewide = 1,
00068     bow_spreadshot = 2,
00069     bow_n = 3, /* must stay at 3 */
00070     bow_ne = 4,
00071     bow_e = 5,
00072     bow_se = 6,
00073     bow_s = 7,
00074     bow_sw = 8,
00075     bow_w = 9,
00076     bow_nw = 10, /* must stay at 10 */
00077     bow_bestarrow = 11
00078 } bowtype_t;
00079 
00081 typedef enum _petmode {
00082     pet_normal = 0,
00083     pet_sad = 1,
00084     pet_defend = 2,
00085     pet_arena = 3
00086 } petmode_t;
00087 
00089 typedef enum usekeytype {
00090     key_inventory = 0,
00091     keyrings = 1,
00092     containers = 2
00093 } usekeytype;
00094 
00099 typedef enum unapplymode {
00100     unapply_nochoice = 0,   
00101     unapply_never = 1,      
00102     unapply_always = 2      
00106 } unapplymode;
00107 
00111 typedef struct client_spell {
00112     object *spell;
00113     sint16 last_sp;
00114     sint16 last_grace;
00115     sint16 last_dam;
00116     struct client_spell *next;
00117 } client_spell;
00118 
00120 typedef struct party_struct {
00121     char *partyleader;          
00122     char passwd[9];             
00123     struct party_struct *next;  
00124     char *partyname;            
00126 #ifdef PARTY_KILL_LOG
00127     struct party_kill {
00128         char killer[MAX_NAME+1], dead[MAX_NAME+1];
00129         sint64 exp;
00130     } party_kills[PARTY_KILL_LOG];
00131 #endif
00132     sint64 total_exp;
00133     uint32  kills;
00134 } partylist;
00135 
00139 typedef enum party_rejoin_mode {
00140     party_rejoin_no = 0,        
00141     party_rejoin_if_exists = 1, 
00142     party_rejoin_always = 2     
00143 } party_rejoin_mode;
00144 
00146 typedef struct pl {
00147     struct pl   *next;                  
00148     socket_struct socket;               
00150     char        maplevel[MAX_BUF];      
00151     char        savebed_map[MAX_BUF];   
00152     sint16      bed_x, bed_y;           
00153     rangetype   shoottype;              
00154     char        spellparam[MAX_BUF];    
00155     bowtype_t   bowtype;                
00156     petmode_t   petmode;                
00157     object      *ranges[range_size];    
00160     uint32      golem_count;            
00161     usekeytype  usekeys;                
00162     unapplymode unapply;                
00163     uint32      count;                  
00164     uint32      mode;                   
00166     sint16      digestion;              
00167     sint16      gen_hp;                 
00168     sint16      gen_sp;                 
00169     sint16      gen_sp_armour;          
00170     sint16      gen_grace;              
00171     sint16      item_power;             
00172     uint8       state;                  
00174     uint8       listening;              
00175     sint8       last_level;             
00177     /* Try to put all the bitfields together - saves some small amount of memory */
00178     uint32      braced:1;            
00179     uint32      tmp_invis:1;         
00180     uint32      do_los:1;            
00181     uint32      fire_on:1;           
00182     uint32      run_on:1;            
00183     uint32      has_hit:1;           
00184     uint32      name_changed:1;      
00185     uint32      peaceful:1;          
00186     uint32      hidden:1;            
00187     uint32      explore:1;           
00188     uint32      no_shout:1;          
00189     const char  *invis_race;         
00191     object      *last_skill_ob[NUM_SKILLS];     
00192     sint64      last_skill_exp[NUM_SKILLS];     
00194     float       weapon_sp;           
00195     float       last_weapon_sp;      
00196     uint16      last_flags;          
00197     sint32      last_weight;         
00198     sint32      last_weight_limit;   
00199     uint32      last_path_attuned;   
00200     uint32      last_path_repelled;  
00201     uint32      last_path_denied;    
00202     int         Swap_First;          
00203     living      orig_stats;          
00204     living      last_stats;          
00205     float       last_speed;          
00206     sint16      last_resist[NROFATTACKS];       
00207     object      *ob;                 
00208     object      *last_used;          
00209     uint32      last_used_id;        
00210     sint8       blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]; 
00214     char        own_title[MAX_NAME]; 
00216     char        title[BIG_NAME];     
00218     sint8       levhp[11];           
00219     sint8       levsp[11];           
00220     sint8       levgrace[11];        
00222     char        killer[BIG_NAME];    
00223     char        last_tell[MAX_NAME]; 
00225     char        write_buf[MAX_BUF];  
00226     char        input_buf[MAX_BUF];  
00227     char        password[16];        
00228     char        new_password[16];    
00230     sint16      encumbrance;         
00231 #ifdef SAVE_INTERVAL
00232     time_t      last_save_time;      
00233 #endif /* SAVE_INTERVAL */
00234 #ifdef AUTOSAVE
00235     uint32      last_save_tick;      
00236 #endif
00237     partylist   *party;              
00238     partylist   *party_to_join;      
00242     party_rejoin_mode rejoin_party;  
00243     char        search_str[MAX_BUF]; 
00244     Output_Buf  outputs[NUM_OUTPUT_BUFS]; 
00245     uint16      outputs_sync;        
00246     uint16      outputs_count;       
00247     uint32      mark_count;          
00248     object      *mark;               
00249     object      *transport;          
00250     client_spell *spell_state;       
00251     /* Special DM fields */
00252     tag_t       *stack_items;        
00253     sstring     followed_player;     
00254     int         stack_position;      
00255     int         language;            
00256 } player;
00257 
00258 #endif /* PLAYER_H */