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