Merge from vendor branch PKGSRC:
[netbsd-mini2440.git] / games / phantasia / phantglobs.c
blob53160b9b6297a577870a844d846e88c5f9f32819
1 /* $NetBSD: phantglobs.c,v 1.5 1999/09/08 21:17:54 jsm Exp $ */
3 /*
4 * phantglobs.c - globals for Phantasia
5 */
7 #include <setjmp.h>
8 #include <stdio.h>
10 #include "phantdefs.h"
11 #include "phantstruct.h"
12 #include "phantglobs.h"
15 double Circle; /* which circle player is in */
16 double Shield; /* force field thrown up in monster battle */
18 bool Beyond; /* set if player is beyond point of no return */
19 bool Marsh; /* set if player is in dead marshes */
20 bool Throne; /* set if player is on throne */
21 bool Changed; /* set if important player stats have changed */
22 bool Wizard; /* set if player is the 'wizard' of the game */
23 bool Timeout; /* set if short timeout waiting for input */
24 bool Windows; /* set if we are set up for curses stuff */
25 bool Luckout; /* set if we have tried to luck out in fight */
26 bool Foestrikes; /* set if foe gets a chance to hit in battleplayer() */
27 bool Echo; /* set if echo input to terminal */
29 int Users; /* number of users currently playing */
30 int Whichmonster; /* which monster we are fighting */
31 int Lines; /* line on screen counter for fight routines */
33 jmp_buf Fightenv; /* used to jump into fight routine */
34 jmp_buf Timeoenv; /* used for timing out waiting for input */
36 long Fileloc; /* location in file of player statistics */
38 const char *Login; /* pointer to login of player */
39 const char *Enemyname; /* pointer name of monster/player we are battling*/
41 struct player Player; /* stats for player */
42 struct player Other; /* stats for another player */
44 struct monster Curmonster;/* stats for current monster */
46 struct energyvoid Enrgyvoid;/* energy void buffer */
48 const struct charstats *Statptr;/* pointer into Stattable[] */
50 /* lookup table for character type dependent statistics */
51 const struct charstats Stattable[7] = {
52 /* MAGIC USER */
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}
59 /* FIGHTER */
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}
66 /* ELF */
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}
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}
79 /* HALFLING */
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}
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}
92 /* SUPER */
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}
100 /* menu of items for purchase */
101 const struct menuitem Menu[] = {
102 {"Mana", 1},
103 {"Shield", 5},
104 {"Book", 200},
105 {"Sword", 500},
106 {"Charm", 1000},
107 {"Quicksilver", 2500},
108 {"Blessing", 1000},
111 FILE *Playersfp; /* pointer to open player file */
112 FILE *Monstfp; /* pointer to open monster file */
113 FILE *Messagefp; /* pointer to open message file */
114 FILE *Energyvoidfp; /* pointer to open energy void file */
116 char Databuf[SZ_DATABUF]; /* a place to read data into */
118 /* some canned strings for messages */
119 const char Illcmd[] = "Illegal command.\n";
120 const char Illmove[] = "Too far.\n";
121 const char Illspell[] = "Illegal spell.\n";
122 const char Nomana[] = "Not enought mana for that spell.\n";
123 const char Somebetter[] = "But you already have something better.\n";
124 const char Nobetter[] = "That's no better than what you already have.\n";