1/* register server type for #if..#else..#endif structures with 'preproc' */
2#parse "../config.h"
3#parse "../common/defines-local.h"
4#parse "../common/defines-features.h"
5
6/* specific includes for player.pre file */
7#include "../common/defines-player.h"
8
9
10/* $Id$ */
11
12/* added this for consistency in some (unrelated) header-inclusion, it IS a server file, isn't it? */
13$#define SERVER
14
15$#include "angband.h"
16
17typedef char* cptr;
18typedef int errr;
19typedef unsigned char bool;
20typedef unsigned char byte;
21typedef signed short s16b;
22typedef unsigned short u16b;
23typedef signed int s32b;
24typedef unsigned int u32b;
25
26
27struct worldpos{
28	s16b wx;	/* west to east */
29	s16b wy;	/* south to north */
30	s16b wz;	/* deep to sky */
31};
32
33struct object_type
34{
35	byte mode;			/* Player that found it */
36        s32b owner;			/* Player that found it */
37        s16b level;			/* Level req */
38
39	s16b k_idx;			/* Kind index (zero if "dead") */
40
41	byte iy;			/* Y-position on map, or zero */
42	byte ix;			/* X-position on map, or zero */
43
44	struct worldpos wpos;
45
46	byte tval;			/* Item type (from kind) */
47	byte sval;			/* Item sub-type (from kind) */
48	byte tval2;			/* normally unused - except for invalid-item-seals */
49	byte sval2;			/* normally unused - except for invalid-item-seals */
50
51	s32b bpval;			/* Base item extra-parameter */
52	s32b pval;			/* Extra enchantment item extra-parameter */
53
54	byte discount;			/* Discount (if any) */
55
56	byte number;			/* Number of items */
57
58	s16b weight;			/* Item weight */
59
60	u16b name1;			/* Artifact type, if any */
61	u16b name2;			/* Ego-Item type, if any */
62	u16b name2b;			/* Ego-Item type, if any */
63	s32b name3;			/* Randart seed, if any */
64
65	byte attr;			/* colour in inventory (for client) */
66
67	byte xtra1;			/* Extra info type */
68	byte xtra2;			/* Extra info type */
69	byte xtra3;			/* Extra info type */
70	byte xtra4;			/* Extra info type */
71	byte xtra5;			/* Extra info type */
72	byte xtra6;			/* Extra info type */
73	byte xtra7;			/* Extra info type */
74	byte xtra8;			/* Extra info type */
75	byte xtra9;			/* Extra info type */
76
77	s16b to_h;			/* Plusses to hit */
78	s16b to_d;			/* Plusses to damage */
79	s16b to_a;			/* Plusses to AC */
80
81	s16b ac;			/* Normal AC */
82
83	byte dd;
84        byte ds;			/* Damage dice/sides */
85
86	long timeout;			/* Timeout Counter */
87
88	byte ident;			/* Special flags  */
89
90	/*byte marked;	*/		/* Object is marked */
91
92	u16b note;			/* Inscription index */
93
94	bool questor;			/* for quest_info */
95	/* byte questor_invincible, questor_hostile, questor_target; */
96	s16b quest;
97	s16b quest_stage;
98	s16b questor_idx;
99};
100
101/*
102 * Skills of each player
103 */
104struct skill_player
105{
106	s32b base_value;                             /* Actual value */
107	s32b value;                             /* Actual value */
108	u16b mod;                               /* Modifier(1 skill point = modifier skill) */
109	bool dev;                               /* Is the branch developped ? */
110	char flags1;
111};
112
113struct version_type {	/* Extended version structure */
114	int major;
115	int minor;
116	int patch;
117	int extra;
118	int branch;
119	int build;
120
121	int os;
122};
123
124/*
125* Structure for keeping track of inventory changes
126*/
127struct inventory_change_type {
128	char type;
129	int revision;
130	s16b begin;
131	s16b end;
132	s16b mod;
133	inventory_change_type *next;
134};
135
136struct player_type
137{
138	int conn;		/* Connection number */
139	const char *name;	/* Nickname */
140	const char *basename;
141	const char *realname;	/* Userid */
142	const char *accountname;/* Account name */
143	const char *hostname;	/* His hostname */
144	const char *addr;	/* His IP address */
145//	unsigned int version;	/* His version */
146	version_type version;
147	bool v_outdated;
148	bool v_latest;
149	bool v_test;
150	bool v_test_latest;
151	bool v_unknown;
152
153	s32b id;		/* Unique ID to each player */
154	u32b account;           /* account group id */
155	u32b dna;		/* DNA - psuedo unique to each player life */
156
157	s32b turn;
158	s32b turns_online;
159	s32b turns_afk;
160	s32b turns_idle;
161
162	hostile_type *hostile;	/* List of players we wish to attack */
163
164	const char *savefile;	/* Name of the savefile */
165
166	byte restricted;        /* account is restricted (ie after cheating) */
167	byte privileged;        /* account is privileged (ie for quest running) */
168	byte pvpexception;      /* account uses different pvp rules than server settings */
169	byte mutedchat;         /* account has chat restrictions */
170	bool inval;		/* dont make them logout to validate */
171
172	bool alive;		/* Are we alive */
173	bool death;		/* Have we died */
174	int deathblow;		/* How much damage the final blow afflicted */
175	u16b deaths;		/* how often we died / safely died */
176	u16b soft_deaths;
177	s16b ghost;		/* Are we a ghost */
178	s16b fruit_bat;		/* Are we a fruit bat */
179	byte lives;		/* number of times we have ressurected */
180	byte houses_owned;	/* number of simultaneously owned houses */
181	byte castles_owned;	/* number of castles owned */
182
183	byte prace;		/* Race index */
184	byte pclass;		/* Class index */
185	byte ptrait;		/* Trait index */
186	byte male;		/* Sex of character */
187	byte oops;		/* Unused */
188
189	skill_player s_info[MAX_SKILLS]; /* Player skills */
190	s16b skill_points;      /* number of skills assignable */
191
192	/* Copies for /undoskills - mikaelh */
193	skill_player s_info_old[MAX_SKILLS]; /* Player skills */
194	s16b skill_points_old;  /* number of skills assignable */
195	bool reskill_possible;
196
197	byte hitdie;		/* Hit dice (sides) */
198	s16b expfact;		/* Experience factor */
199
200	s32b au;		/* Current Gold */
201	s32b balance;		/* Deposit/debt in bank account */
202
203	s32b max_exp;		/* Max experience */
204	s32b exp;		/* Cur experience */
205	u16b exp_frac;		/* Cur exp frac (times 2^16) */
206
207	s16b lev;		/* Level */
208	s16b max_lev;		/* Level according to max_exp */
209
210	s16b mhp;		/* Max hit pts */
211	s16b chp;		/* Cur hit pts */
212	u16b chp_frac;		/* Cur hit frac (times 2^16) */
213
214	s16b player_hp[PY_MAX_LEVEL];
215
216	s16b msp;		/* Max mana pts */
217	s16b csp;		/* Cur mana pts */
218	u16b csp_frac;		/* Cur mana frac (times 2^16) */
219
220	s16b mst;                       /* Max stamina pts */
221	s16b cst;                       /* Cur stamina pts */
222	s16b cst_frac;                  /* 1/10000 */
223
224	object_type inventory[INVEN_TOTAL];	/* Player's inventory */
225	inventory_change_type *inventory_changes; /* List of recent inventory changes */
226	int inventory_revision;	/* Current inventory ID */
227	char inventory_changed;	/* Inventory has changed since last update to the client */
228
229	s32b total_weight;	/* Total weight being carried */
230
231	s16b inven_cnt;		/* Number of items in inventory */
232	s16b equip_cnt;		/* Number of items in equipment */
233
234	s16b max_plv;		/* Max Player Level */
235	s16b max_dlv;		/* Max level explored */
236	worldpos recall_pos;	/* which depth to recall to */
237
238	s16b stat_max[6];	/* Current "maximal" stat values */
239	s16b stat_cur[6];	/* Current "natural" stat values */
240
241	unsigned char wild_map[MAX_WILD_8]; /* the wilderness we have explored */
242
243	s16b py;		/* Player location in dungeon */
244	s16b px;
245	struct worldpos wpos;
246
247	s16b cur_hgt;		/* Height and width of their dungeon level */
248	s16b cur_wid;
249
250	bool new_level_flag;	/* Has this player changed depth? */
251	byte new_level_method;	/* Climb up stairs, down, or teleport level? */
252
253	/* changed from byte to u16b - mikaelh */
254	u16b party;		/* The party he belongs to (or 0 if neutral) */
255	byte guild;		/* The guild he belongs to (or 0 if neutral) */
256	u32b guild_dna;
257
258	s16b target_who;
259	s16b target_col;	/* What position is targetted */
260	s16b target_row;
261
262	s16b health_who;	/* Who's shown on the health bar */
263
264	s16b view_n;		/* Array of grids viewable to player */
265	byte view_y[VIEW_MAX];
266	byte view_x[VIEW_MAX];
267
268	s16b lite_n;		/* Array of grids lit by player lite */
269	byte lite_y[LITE_MAX];
270	byte lite_x[LITE_MAX];
271
272	s16b temp_n;		/* Array of grids used for various things */
273	byte temp_y[TEMP_MAX];
274	byte temp_x[TEMP_MAX];
275
276	s16b target_n;		/* Array of grids used for targetting/looking */
277	byte target_y[TEMP_MAX];
278	byte target_x[TEMP_MAX];
279	s16b target_idx[TEMP_MAX];
280
281	u32b dlev_id;
282
283/*	cptr info[128];		Temp storage of *ID* and Self Knowledge info */
284	const char *infofile;		/* Temp storage of *ID* and Self Knowledge info */
285	byte special_file_type;	/* Is he using *ID* or Self Knowledge? */
286
287	bool obj_aware[MAX_K_IDX]; /* Is the player aware of this obj type? */
288	bool obj_tried[MAX_K_IDX]; /* Has the player tried this obj type? */
289	bool trap_ident[MAX_T_IDX];       /* do we know the name */
290
291	byte d_attr[MAX_K_IDX];
292	char d_char[MAX_K_IDX];
293	byte f_attr[MAX_F_IDX];
294	char f_char[MAX_F_IDX];
295	byte k_attr[MAX_K_IDX];
296	char k_char[MAX_K_IDX];
297	byte r_attr[MAX_R_IDX];
298	char r_char[MAX_R_IDX];
299
300	bool carry_query_flag;
301	bool use_old_target;
302	bool always_pickup;
303	bool stack_force_notes;
304	bool stack_force_costs;
305	bool find_ignore_stairs;
306	bool find_ignore_doors;
307	bool find_cut;
308	bool find_examine;
309	bool disturb_move;
310	bool disturb_near;
311	bool disturb_panel;
312	bool disturb_state;
313	bool disturb_minor;
314	bool disturb_other;
315	bool stack_allow_items;
316	bool stack_allow_wands;
317	bool view_perma_grids;
318	bool view_torch_grids;
319	bool view_reduce_lite;
320	bool view_reduce_view;
321	bool view_lamp_floor;
322	bool view_lamp_walls;
323	bool view_shade_floor;
324	bool view_shade_walls;
325	bool wall_lighting;
326	bool floor_lighting;
327	bool view_animated_lite;
328
329	/* TomeNET additions -- consider using macro or bitfield */
330	bool easy_open;
331	bool easy_disarm;
332	bool easy_tunnel;
333//	bool auto_destroy;
334	bool clear_inscr;
335	bool auto_inscribe;
336	bool taciturn_messages;
337	bool last_words;
338	/* bool speak_unique; */
339	bool warn_unique_credit;
340
341	s16b max_panel_rows;
342	s16b max_panel_cols;
343	s16b panel_row;
344	s16b panel_col;
345	s16b panel_row_min;
346	s16b panel_row_max;
347	s16b panel_col_min;
348	s16b panel_col_max;
349	s16b panel_col_prt;	/* What panel this guy's on */
350	s16b panel_row_prt;
351	s16b panel_row_old;
352	s16b panel_col_old;
353
354	s16b screen_wid;
355	s16b screen_hgt;
356
357	const char *died_from;	/* What off-ed him */
358	const char *really_died_from;	/* What off-ed him */
359	const char *died_from_list; /* what goes on the high score list */
360	s16b died_from_depth;	/* what depth we died on */
361
362	u16b total_winner;	/* Is this guy the winner */
363	u16b once_winner;	/* Has this guy ever been a winner */
364	bool iron_winner;	/* Ironman Deep Dive Challenge */
365	bool iron_winner_ded;
366	struct worldpos own1;
367	struct worldpos own2;
368	u16b retire_timer;	/* The number of minutes this guy can play until
369				   he will be forcibly retired.
370				 */
371
372	u16b noscore;		/* Has he cheated in some way (hopefully not) */
373	s16b command_rep;	/* Command repetition */
374
375	byte last_dir;		/* Last direction moved (used for swapping places) */
376
377	s16b running;		/* Are we running */
378	byte find_current;	/* These are used for the running code */
379	byte find_prevdir;
380	bool find_openarea;
381	bool find_breakright;
382	bool find_breakleft;
383
384	bool resting;		/* Are we resting? */
385
386	s16b energy_use;	/* How much energy has been used */
387
388	int look_index;		/* Used for looking or targeting */
389
390	s32b current_char;
391	s16b current_spell;	/* Spell being cast */
392	s16b current_mind;	/* Power being use */
393	s16b current_rod;	/* Rod being zapped */
394	s16b current_activation;/* Artifact (or dragon mail) being activated */
395	s16b current_enchant_h; /* Current enchantments */
396	s16b current_enchant_d;
397	s16b current_enchant_a;
398	s16b current_identify;	/* Are we identifying something? */
399	s16b current_star_identify;
400	s16b current_recharge;
401	s16b current_artifact;
402	bool current_artifact_nolife;
403	object_type *current_telekinesis;
404#ifdef TELEKINESIS_GETITEM_SERVERSIDE
405	s16b current_telekinesis_mw;
406#endif
407	s16b current_curse;
408
409	s16b current_selling;
410	s16b current_sell_amt;
411	int current_sell_price;
412
413	int store_num;		/* What store this guy is in */
414
415	s16b fast;			/* Timed -- Fast */
416	s16b fast_mod;			/* Timed -- Fast */
417	s16b slow;			/* Timed -- Slow */
418	s16b blind;			/* Timed -- Blindness */
419	s16b paralyzed;		/* Timed -- Paralysis */
420	s16b confused;		/* Timed -- Confusion */
421	s16b afraid;		/* Timed -- Fear */
422	s16b image;			/* Timed -- Hallucination */
423	s16b poisoned;		/* Timed -- Poisoned */
424	s16b slow_poison;
425	int poisoned_attacker;	/* Who poisoned the player - used for blood bond */
426	s16b cut;			/* Timed -- Cut */
427	int cut_attacker;		/* Who cut the player - used for blood bond */
428	s16b stun;			/* Timed -- Stun */
429
430	s16b xtrastat;		/* Timed temp +stats */
431	s16b focus_time;		/* Timed temp +spr */
432
433	s16b protevil;		/* Timed -- Protection */
434	s16b zeal;
435	s16b zeal_power;
436	s16b martyr;
437	s16b martyr_timeout;
438	s16b res_fear_temp;
439	s16b invuln;		/* Timed -- Invulnerable */
440	s16b hero;			/* Timed -- Heroism */
441	s16b shero;			/* Timed -- Super Heroism */
442	s16b fury;			/* Timed -- Furry */
443	s16b shield;		/* Timed -- Shield Spell */
444	s16b blessed;		/* Timed -- Blessed */
445	s16b blessed_power;
446	s16b tim_invis;		/* Timed -- See Invisible */
447	s16b tim_infra;		/* Timed -- Infra Vision */
448	s16b tim_wraith;	/* Timed -- Wraithform */
449	bool wraith_in_wall;
450	u16b tim_jail;
451	u16b tim_susp;
452	u16b tim_pkill;
453	u16b pkill;
454	s16b tim_meditation;	/* Timed -- Meditation */
455	s16b tim_invisibility;		/* Timed -- Invisibility */
456	s16b tim_invis_power;	/* Timed -- Invisibility Power (perm) */
457	s16b tim_invis_power2;	/* Timed -- Invisibility Power (temp) */
458	s16b tim_traps; 	/* Timed -- Avoid traps */
459	s16b tim_manashield;    /* Timed -- Mana Shield */
460	s16b tim_mimic; 	/* Timed -- Mimicry */
461	s16b tim_mimic_what; 	/* Timed -- Mimicry */
462	s16b bow_brand; 	/* Timed -- Bow Branding */
463	byte bow_brand_t; 	/* Timed -- Bow Branding */
464	s16b bow_brand_d; 	/* Timed -- Bow Branding */
465	s16b prob_travel;       /* Timed -- Probability travel */
466	s16b st_anchor;         /* Timed -- Space/Time Anchor */
467	s16b tim_esp;           /* Timed -- ESP */
468	s16b adrenaline;
469	s16b biofeedback;
470	s16b mindboost;
471	s16b mindboost_power;
472
473	s16b auto_tunnel;
474	s16b body_monster;
475
476	s16b oppose_acid;	/* Timed -- oppose acid */
477	s16b oppose_elec;	/* Timed -- oppose lightning */
478	s16b oppose_fire;	/* Timed -- oppose heat */
479	s16b oppose_cold;	/* Timed -- oppose cold */
480	s16b oppose_pois;	/* Timed -- oppose poison */
481
482	s16b word_recall;	/* Word of recall counter */
483
484	s16b energy;		/* Current energy */
485
486	s16b food;			/* Current nutrition */
487
488	byte confusing;		/* Glowing hands */
489	byte stunning;		/* Heavy hands */
490	byte searching;		/* Currently searching */
491	byte cloaked;		/* Cloaking mode enabled */
492
493	s16b old_lite;		/* Old radius of lite (if any) */
494	s16b old_view;		/* Old radius of view (if any) */
495
496	s16b old_food_aux;	/* Old value of food */
497
498
499	bool cumber_armor;	/* Encumbering armor (tohit, sneakiness) */
500	bool awkward_armor;	/* Mana draining armor */
501	bool cumber_glove;	/* Mana draining gloves */
502	bool heavy_wield;	/* Heavy weapon */
503	bool heavy_shield;	/* Heavy shield */
504	bool heavy_shoot;	/* Heavy shooter */
505	bool icky_wield;	/* Icky weapon */
506	bool awkward_wield;	/* Icky weapon */
507	bool easy_wield;        /* Using a 1-h weapon which is MAY2H with both hands */
508	bool cumber_weight;	/* FA from MA is lost if overburdened */
509        bool monk_heavyarmor;   /* Reduced MA power? */
510        bool awkward_shoot;     /* using ranged weapon while having a shield on the arm */
511	bool rogue_heavyarmor;  /* No AoE-searching? Encumbered dual-wield? */
512	bool heavy_swim;	/* Too heavy to swim without drowning chance? */
513
514	s16b cur_lite;		/* Radius of lite (if any) */
515	byte lite_type;
516
517
518	u32b notice;		/* Special Updates (bit flags) */
519	u32b update;		/* Pending Updates (bit flags) */
520	u32b redraw;		/* Normal Redraws (bit flags) */
521	u32b window;		/* Window Redraws (bit flags) */
522
523	s16b stat_use[6];	/* Current modified stats */
524	s16b stat_top[6];	/* Maximal modified stats */
525
526	s16b stat_add[6];	/* Modifiers to stat values */
527	s16b stat_ind[6];	/* Indexes into stat tables */
528
529	bool immune_acid;	/* Immunity to acid */
530	bool immune_elec;	/* Immunity to lightning */
531	bool immune_fire;	/* Immunity to fire */
532	bool immune_cold;	/* Immunity to cold */
533
534	s16b reduc_fire;        /* Fire damage reduction */
535	s16b reduc_elec;        /* elec damage reduction */
536	s16b reduc_acid;        /* acid damage reduction */
537	s16b reduc_cold;        /* cold damage reduction */
538
539	bool resist_acid;	/* Resist acid */
540	bool resist_elec;	/* Resist lightning */
541	bool resist_fire;	/* Resist fire */
542	bool resist_cold;	/* Resist cold */
543	bool resist_pois;	/* Resist poison */
544
545	bool resist_conf;	/* Resist confusion */
546	bool resist_sound;	/* Resist sound */
547	bool resist_lite;	/* Resist light */
548	bool resist_dark;	/* Resist darkness */
549	bool resist_chaos;	/* Resist chaos */
550	bool resist_disen;	/* Resist disenchant */
551	bool resist_shard;	/* Resist shards */
552	bool resist_nexus;	/* Resist nexus */
553	bool resist_blind;	/* Resist blindness */
554	bool resist_neth;	/* Resist nether */
555	bool resist_fear;	/* Resist fear */
556
557	bool immune_neth;       /* Immunity to nether */
558
559	bool suscep_fire;     /* Fire does more damage on the player */
560	bool suscep_cold;     /* Cold does more damage on the player */
561	bool suscep_acid;     /* Acid does more damage on the player */
562	bool suscep_elec;     /* Electricity does more damage on the player */
563	bool suscep_pois;     /* Poison does more damage on the player */
564	bool suscep_lite;
565	bool suscep_good;
566	bool suscep_life;
567
568	bool reflect;       /* Reflect 'bolt' attacks */
569	byte shield_deflect;       /* Deflect various attacks (ranged), needs USE_BLOCKING */
570	byte weapon_parry;       /* Parry various attacks (melee), needs USE_PARRYING */
571	bool res_tele;          /* Prevents being teleported from someone else */
572
573	bool ty_curse;		/* bad curses from artifacts */
574	bool dg_curse;
575
576	u16b xorder_id;		/* Quest number */
577	s16b xorder_num;	/* Number of kills needed */
578
579	bool sustain_str;	/* Keep strength */
580	bool sustain_int;	/* Keep intelligence */
581	bool sustain_wis;	/* Keep wisdom */
582	bool sustain_dex;	/* Keep dexterity */
583	bool sustain_con;	/* Keep constitution */
584	bool sustain_chr;	/* Keep charisma */
585
586	bool aggravate;		/* Aggravate monsters */
587	bool teleport;		/* Random teleporting */
588
589	long int idle;		/* player's been idle for <idle> seconds */
590	long int idle_char;	/* character's been idle for <idle> seconds */
591	bool afk;		/* Player is afk */
592	byte drain_exp;		/* Experience draining */
593	byte drain_life;	/* HP draining */
594	byte drain_mana;	/* SP draining */
595
596	bool feather_fall;	/* No damage falling */
597	bool lite;		/* Permanent light */
598	bool free_act;		/* Never paralyzed */
599	bool see_inv;		/* Can see invisible */
600	bool regenerate;	/* Regenerate hit pts */
601	bool resist_time;       /* Resist Time */
602	bool resist_mana;       /* Resist mana / magic */
603	bool immune_poison;     /* Poison Immunity */
604	bool immune_water;      /* Water Immunity, would also let you breathe under water. */
605	bool resist_water;	/* Resist Water */
606	bool resist_plasma;     /* Resist Plasma */
607	bool regen_mana;	/* Regenerate mana */
608	bool hold_life;		/* Resist life draining */
609	u32b telepathy;		/* Telepathy */
610	bool slow_digest;	/* Slower digestion */
611	bool bless_blade;	/* Blessed blade */
612	bool xtra_might;	/* Extra might bow */
613	bool impact;		/* Earthquake blows */
614	bool auto_id; /* Pickup = Id */
615	bool no_cut;		/* for mimic forms */
616	bool levitate;
617	bool can_swim;		/* for mimic forms mainly */
618	bool pass_trees;
619	bool town_pass_trees;
620	bool reduce_insanity;	/* for mimic forms with weird/empty mind */
621
622	s16b invis;		/* Invisibility */
623	bool admin_wiz;         /* Is this char Wizard? */
624	bool admin_dm;          /* or Dungeon Master? */
625
626	s16b extra_blows;
627	s16b xtra_crit;
628
629	s16b to_l;		/* Bonus to life */
630	s32b to_hp;		/* Bonus to Hit Points */
631	s16b to_m;		/* Bonus to mana */
632
633	s16b dis_to_h;		/* Known bonus to hit */
634	s16b dis_to_d;		/* Known bonus to dam */
635	s16b dis_to_a;		/* Known bonus to ac */
636
637	s16b dis_ac;		/* Known base ac */
638
639	s16b to_h_melee;		/* Bonus to hit */
640	s16b to_d_melee;		/* Bonus to dam */
641	s16b to_h_ranged;		/* Bonus to hit */
642	s16b to_d_ranged;		/* Bonus to dam */
643	s16b to_h;			/* Bonus to hit */
644	s16b to_d;			/* Bonus to dam */
645	s16b to_a;			/* Bonus to ac */
646
647	s16b ac;			/* Base ac */
648
649	s16b overall_tohit_r;
650	s16b overall_todam_r;
651	s16b overall_tohit_m;
652	s16b overall_todam_m;
653
654	s16b see_infra;		/* Infravision range */
655
656	s16b skill_dis;		/* Skill: Disarming */
657	s16b skill_dev;		/* Skill: Magic Devices */
658	s16b skill_sav;		/* Skill: Saving throw */
659	s16b skill_stl;		/* Skill: Stealth factor */
660	s16b skill_srh;		/* Skill: Searching ability */
661	s16b skill_fos;		/* Skill: Searching frequency */
662	s16b skill_thn;		/* Skill: To hit (normal) */
663	s16b skill_thb;		/* Skill: To hit (shooting) */
664	s16b skill_tht;		/* Skill: To hit (throwing) */
665	s16b skill_dig;		/* Skill: Digging */
666
667	s16b num_blow;		/* Number of blows */
668	s16b num_fire;		/* Number of shots */
669	s16b num_spell;		/* Number of spells */
670
671	byte tval_xtra;		/* Correct xtra tval */
672	byte tval_ammo;		/* Correct ammo tval */
673
674	s16b pspeed;		/* Current speed */
675
676	s16b r_killed[MAX_R_IDX];	/* Monsters killed */
677
678	s32b melee_techniques; /* for weaponmastery */
679	s32b ranged_techniques; /* for archery */
680	s32b innate_spells[3]; /* Monster spells */
681	bool body_changed;
682
683	bool anti_magic;	/* Can the player resist magic */
684	byte antimagic;		/* Anti-magic(in percent) */
685	byte antimagic_dis;	/* Radius of the anti magic field */
686
687	player_list_type	*blood_bond;	/* Norc is now happy :) */
688
689	byte mode; /* Difficulty MODE */
690
691	s32b esp_link; /* Mental link */
692	byte esp_link_type;
693	u16b esp_link_flags;
694	u16b esp_link_end; /* Time before actual end */
695
696	/* additions */
697	bool black_breath;      /* The Tolkien's Black Breath */
698
699	s16b msane;                   /* Max sanity */
700	s16b csane;                   /* Cur sanity */
701	u16b csane_frac;              /* Cur sanity frac */
702
703	byte spell_project;             /* Do the spells(some) affect nearby party members ? */
704	s16b dodge_level;
705	s32b tim_blacklist;
706	s32b tim_watchlist;
707	s32b pstealing;
708
709	u16b team;
710
711#ifdef ARCADE_SERVER
712	/* Moltor's arcade crap */
713	int arc_a;
714	int arc_b;
715	int arc_c;
716	int arc_d;
717	int arc_e;
718	int arc_f;
719	int arc_g;
720	int arc_h;
721	int arc_i;
722	int arc_j;
723	int arc_k;
724	int arc_l;
725	char firedir;
726	char game;
727	int gametime;
728	char pushed;
729	char pushdir;
730#endif
731
732	int ret_dam;			/* Drained life from a monster */
733	const char *attacker;		/* Attacking player string, contains name and attack */
734
735	int luck;   /* Extra luck of this player */
736
737	/* C. Blue - was the last shutdown a panic save? */
738	bool panic;
739
740	/* Anti-cheeze */
741	s16b supp;			/* level of the highest supporter */
742	s16b supp_top;			/* top-level of the highest supporter */
743	s16b support_timer;		/* safe maximum possible duration of the support spells */
744
745	/* C. Blue - any automatic savegame update to perform? (toggle) */
746	byte updated_savegame;
747	/* for auto-artreset */
748	byte artifact_reset;
749	bool fluent_artifact_reset;
750
751	/* C. Blue - fun stuff */
752	s16b corner_turn;
753	int joke_weather;
754
755	/* Muting variable - the_sandman */
756	bool muted;
757	byte has_pet;
758
759	/* global events */
760	int global_event_type[MAX_GLOBAL_EVENTS]; /* 0 means 'not participating' */
761	time_t global_event_signup[MAX_GLOBAL_EVENTS];
762	time_t global_event_started[MAX_GLOBAL_EVENTS];
763//	u32b global_event_progress[MAX_GLOBAL_EVENTS][4];
764	int global_event_participated[MAX_GLOBAL_EVENT_TYPES];
765
766	int combat_stance;
767	int combat_stance_power;
768
769	bool shoot_till_kill;
770	bool shooty_till_kill;
771	bool shooting_till_kill;
772	int shoot_till_kill_book;
773	int shoot_till_kill_spell;
774	int shoot_till_kill_mimic;
775
776	int kills_own;
777	int kills;
778	int kills_lower;
779	int kills_higher;
780	int kills_equal;
781	int free_mimic;
782	int pvp_prevent_tele;
783	long heal_effect;
784
785	int mcharming;
786	u32b turns_on_floor;
787	bool dual_mode;
788	u16b tim_deflect;
789
790	bool panel_changed;
791
792	char warning_bpr;
793	char warning_bpr2;
794	char warning_bpr3;
795	char warning_run;
796	char warning_run_steps;
797	char warning_run_monlos;
798	char warning_wield;
799	char warning_chat;
800	char warning_lite;
801	char warning_rest;
802	char warning_rest_cooldown;
803	char warning_mimic;
804	char warning_dual;
805	char warning_potions;
806	char warning_wor;
807	char warning_ghost;
808	char warning_instares;
809	char warning_ma_weapon;
810	char warning_ma_shield;
811
812#ifdef USE_SOUND_2010
813	int music_current;
814	int musicalt_current;
815	int music_monster;
816	int audio_sfx;
817	int audio_mus;
818	int sound_ambient;
819#endif
820
821	int admin_stasis;
822	int admin_godly_strike;
823	int admin_set_defeat;
824
825#ifdef ENABLE_GO_GAME
826	int go_level;
827	int go_sublevel;
828#endif
829
830	int vampiric_melee;
831	int vampiric_ranged;
832	bool IDDC_found_rndtown;
833	bool IDDC_logscum;
834	byte IDDC_flags;
835	bool insta_res;
836	bool hilite_player;
837	bool consistent_players;
838#ifdef TELEPORT_SURPRISES
839	byte teleported;
840#endif
841	bool distinct_floor_feeling;
842	bool exp_bar;
843
844	bool dummy_option_7;
845	bool dummy_option_8;
846};
847
848extern bool imprison(int Ind, int time, char *reason);
849bool check_antimagic(int Ind, int percentage);
850
851extern int NumPlayers;
852extern player_type *Players[0xFFFFF] @ Players_real;
853extern int get_playerind(char *name);
854extern int get_playerind_loose(char *name);
855extern int get_playerslot_loose(int Ind, char *iname);
856extern bool no_lite(int Ind);
857
858extern bool can_use(int Ind, object_type *o_ptr);
859extern bool can_use_verbose(int Ind, object_type *o_ptr);
860extern bool interfere(int Ind, int chance);
861
862#ifdef TELEKINESIS_GETITEM_SERVERSIDE
863extern bool telekinesis(int Ind, object_type *o_ptr, int max_weight);
864#endif
865extern void telekinesis_aux(int Ind, int item);
866extern void recall_player(int Ind, char *message);
867extern int apply_dodge_chance(int Ind, int attack_level);
868extern void respec_skill(int Ind, int i, bool update_skill, bool polymorph);
869extern void respec_skills(int Ind, bool update_skills);
870extern int invested_skill_points(int Ind, int i);
871
872extern int get_inven_sval(int Ind, int inven_slot);
873extern int get_inven_xtra(int Ind, int inven_slot, int n);
874
875//typedef struct player_race player_race;
876struct player_race
877{
878	cptr title;
879	s32b choice;
880};
881extern player_race race_info[MAX_RACE];
882
883struct player_class
884{
885	cptr title;
886	byte color;
887};
888extern player_class class_info[MAX_CLASS];
889
890struct player_trait
891{
892	cptr title;
893	s32b choice;
894};
895extern player_trait trait_info[MAX_TRAIT];
896
897extern void do_mimic_change(int Ind, int r_idx, bool force);
898extern void shape_Maia_skills(int Ind);
899
900extern void lua_fix_max_depth(int Ind);
901extern void lua_fix_max_depth_bug(int Ind);
902