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