1*34609Sbostic /*
2*34609Sbostic  * phantglobs.c - globals for Phantasia
3*34609Sbostic  */
4*34609Sbostic 
5*34609Sbostic #include "include.h"
6*34609Sbostic 
7*34609Sbostic double	Circle;		/* which circle player is in			*/
8*34609Sbostic double	Shield;		/* force field thrown up in monster battle	*/
9*34609Sbostic 
10*34609Sbostic bool	Beyond;		/* set if player is beyond point of no return	*/
11*34609Sbostic bool	Marsh;		/* set if player is in dead marshes		*/
12*34609Sbostic bool	Throne;		/* set if player is on throne			*/
13*34609Sbostic bool	Changed;	/* set if important player stats have changed	*/
14*34609Sbostic bool	Wizard;		/* set if player is the 'wizard' of the game	*/
15*34609Sbostic bool	Timeout;	/* set if short timeout waiting for input	*/
16*34609Sbostic bool	Windows;	/* set if we are set up for curses stuff	*/
17*34609Sbostic bool	Luckout;	/* set if we have tried to luck out in fight	*/
18*34609Sbostic bool	Foestrikes;	/* set if foe gets a chance to hit in battleplayer()	*/
19*34609Sbostic bool	Echo;		/* set if echo input to terminal		*/
20*34609Sbostic 
21*34609Sbostic int	Users;		/* number of users currently playing		*/
22*34609Sbostic int	Whichmonster;	/* which monster we are fighting		*/
23*34609Sbostic int	Lines;		/* line on screen counter for fight routines	*/
24*34609Sbostic 
25*34609Sbostic jmp_buf Fightenv;	/* used to jump into fight routine		*/
26*34609Sbostic jmp_buf Timeoenv;	/* used for timing out waiting for input	*/
27*34609Sbostic 
28*34609Sbostic long	Fileloc;	/* location in file of player statistics	*/
29*34609Sbostic 
30*34609Sbostic char	*Login;		/* pointer to login of player			*/
31*34609Sbostic char	*Enemyname;	/* pointer name of monster/player we are battling*/
32*34609Sbostic 
33*34609Sbostic struct	player	Player;	/* stats for player				*/
34*34609Sbostic struct	player	Other;	/* stats for another player			*/
35*34609Sbostic 
36*34609Sbostic struct	monster	Curmonster;/* stats for current monster			*/
37*34609Sbostic 
38*34609Sbostic struct	energyvoid Enrgyvoid;/* energy void buffer			*/
39*34609Sbostic 
40*34609Sbostic struct	charstats *Statptr;/* pointer into Stattable[]			*/
41*34609Sbostic 
42*34609Sbostic /* lookup table for character type dependent statistics */
43*34609Sbostic struct	charstats Stattable[7] =
44*34609Sbostic 	{
45*34609Sbostic 	/* MAGIC USER */
46*34609Sbostic 	/* max brains, max mana, weakness, gold tote, ring duration */
47*34609Sbostic 	15.0, 200.0, 18.0, 175.0, 10,
48*34609Sbostic 	/* quickness strength     mana         energy       brains       magic lvl */
49*34609Sbostic 	30, 6, 0.0,  10, 6, 2.0,  50,51,75.0,  30,16,20.0,  60,26, 6.0,	 5, 5,2.75,
50*34609Sbostic 
51*34609Sbostic 	/* FIGHTER */
52*34609Sbostic 	/* max brains, max mana, weakness, gold tote, ring duration */
53*34609Sbostic 	10.0, 110.0, 15.0, 220.0, 20,
54*34609Sbostic 	/* quickness strength     mana         energy       brains       magic lvl */
55*34609Sbostic 	30, 6, 0.0,  40,16, 3.0,  30,21,40.0,  45,26,30.0,  25,21, 3.0,	 3, 4, 1.5,
56*34609Sbostic 
57*34609Sbostic 	/* ELF */
58*34609Sbostic 	/* max brains, max mana, weakness, gold tote, ring duration */
59*34609Sbostic 	12.0, 150.0, 17.0, 190.0, 13,
60*34609Sbostic 	/* quickness strength     mana         energy       brains       magic lvl */
61*34609Sbostic 	32, 7, 0.0,  35,11, 2.5,  45,46,65.0,  30,21,25.0,  40,26, 4.0,	 4, 4, 2.0,
62*34609Sbostic 
63*34609Sbostic 	/* DWARF */
64*34609Sbostic 	/* max brains, max mana, weakness, gold tote, ring duration */
65*34609Sbostic 	7.0, 80.0, 13.0, 255.0,  25,
66*34609Sbostic 	/* quickness strength     mana         energy       brains       magic lvl */
67*34609Sbostic 	25, 6, 0.0,  50,21, 5.0,  25,21,30.0,  60,41,35.0,  20,21, 2.5,	 2, 4, 1.0,
68*34609Sbostic 
69*34609Sbostic 	/* HALFLING */
70*34609Sbostic 	/* max brains, max mana, weakness, gold tote, ring duration */
71*34609Sbostic 	11.0, 80.0, 10.0, 125.0, 40,
72*34609Sbostic 	/* quickness strength     mana         energy       brains       magic lvl */
73*34609Sbostic 	34, 0, 0.0,  20, 6, 2.0,  25,21,30.0,  55,36,30.0,  40,36, 4.5,	 1, 4, 1.0,
74*34609Sbostic 
75*34609Sbostic 	/* EXPERIMENTO */
76*34609Sbostic 	/* max brains, max mana, weakness, gold tote, ring duration */
77*34609Sbostic 	9.0, 90.0, 16.0, 160.0, 20,
78*34609Sbostic 	/* quickness strength     mana         energy       brains       magic lvl */
79*34609Sbostic 	27, 0, 0.0,  25, 0, 0.0,  100,0, 0.0,  35, 0, 0.0,  25, 0, 0.0,	 2, 0, 0.0,
80*34609Sbostic 
81*34609Sbostic 	/* SUPER */
82*34609Sbostic 	/* max brains, max mana, weakness, gold tote, ring duration */
83*34609Sbostic 	15.0, 200.0, 10.0, 225.0, 40,
84*34609Sbostic 	/* quickness strength     mana         energy       brains       magic lvl */
85*34609Sbostic 	38, 0, 0.0,  65, 0, 5.0,  100,0,75.0,  80, 0,35.0,  85, 0, 6.0,	 9, 0,2.75
86*34609Sbostic 	};
87*34609Sbostic 
88*34609Sbostic /* menu of items for purchase */
89*34609Sbostic struct menuitem	Menu[] =
90*34609Sbostic     {
91*34609Sbostic     "Mana", 1,
92*34609Sbostic     "Shield", 5,
93*34609Sbostic     "Book", 200,
94*34609Sbostic     "Sword", 500,
95*34609Sbostic     "Charm", 1000,
96*34609Sbostic     "Quicksilver", 2500,
97*34609Sbostic     "Blessing", 1000,
98*34609Sbostic     };
99*34609Sbostic 
100*34609Sbostic FILE	*Playersfp;	/* pointer to open player file			*/
101*34609Sbostic FILE	*Monstfp;	/* pointer to open monster file			*/
102*34609Sbostic FILE	*Messagefp;	/* pointer to open message file			*/
103*34609Sbostic FILE	*Energyvoidfp;	/* pointer to open energy void file		*/
104*34609Sbostic 
105*34609Sbostic char	Databuf[SZ_DATABUF];	/* a place to read data into		*/
106*34609Sbostic 
107*34609Sbostic /* some canned strings for messages */
108*34609Sbostic char	Illcmd[] = "Illegal command.\n";
109*34609Sbostic char	Illmove[] = "Too far.\n";
110*34609Sbostic char	Illspell[] = "Illegal spell.\n";
111*34609Sbostic char	Nomana[] = "Not enought mana for that spell.\n";
112*34609Sbostic char	Somebetter[] = "But you already have something better.\n";
113*34609Sbostic char	Nobetter[] = "That's no better than what you already have.\n";
114