2 * phantglobs.c - globals for Phantasia
4 * $DragonFly: src/games/phantasia/phantglobs.c,v 1.3 2005/05/31 00:06:26 swildner Exp $
11 double Circle
; /* which circle player is in */
12 double Shield
; /* force field thrown up in monster battle */
14 bool Beyond
; /* set if player is beyond point of no return */
15 bool Marsh
; /* set if player is in dead marshes */
16 bool Throne
; /* set if player is on throne */
17 bool Changed
; /* set if important player stats have changed */
18 bool Wizard
; /* set if player is the 'wizard' of the game */
19 bool Timeout
; /* set if short timeout waiting for input */
20 bool Windows
; /* set if we are set up for curses stuff */
21 bool Luckout
; /* set if we have tried to luck out in fight */
22 bool Foestrikes
; /* set if foe gets a chance to hit in battleplayer() */
23 bool Echo
; /* set if echo input to terminal */
25 int Users
; /* number of users currently playing */
26 int Whichmonster
; /* which monster we are fighting */
27 int Lines
; /* line on screen counter for fight routines */
29 jmp_buf Fightenv
; /* used to jump into fight routine */
30 jmp_buf Timeoenv
; /* used for timing out waiting for input */
32 long Fileloc
; /* location in file of player statistics */
34 const char *Login
; /* pointer to login of player */
35 const char *Enemyname
; /* pointer name of monster/player we are battling*/
37 struct player Player
; /* stats for player */
38 struct player Other
; /* stats for another player */
40 struct monster Curmonster
;/* stats for current monster */
42 struct energyvoid Enrgyvoid
;/* energy void buffer */
44 struct charstats
*Statptr
;/* pointer into Stattable[] */
46 /* lookup table for character type dependent statistics */
47 struct charstats Stattable
[7] =
51 /* max brains, max mana, weakness, gold tote, ring duration */
52 15.0, 200.0, 18.0, 175.0, 10,
53 /* quickness, strength, mana */
54 {30, 6, 0.0}, {10, 6, 2.0}, {50, 51, 75.0},
55 /* energy, brains, magic lvl */
56 {30, 16, 20.0}, {60, 26, 6.0}, {5, 5, 2.75}
61 /* max brains, max mana, weakness, gold tote, ring duration */
62 10.0, 110.0, 15.0, 220.0, 20,
63 /* quickness, strength, mana */
64 {30, 6, 0.0}, {40, 16, 3.0}, {30, 21, 40.0},
65 /* energy, brains, magic lvl */
66 {45, 26, 30.0}, {25, 21, 3.0}, {3, 4, 1.5}
71 /* max brains, max mana, weakness, gold tote, ring duration */
72 12.0, 150.0, 17.0, 190.0, 13,
73 /* quickness, strength, mana */
74 {32, 7, 0.0}, {35, 11, 2.5}, {45, 46, 65.0},
75 /* energy, brains, magic lvl */
76 {30, 21, 25.0}, {40, 26, 4.0}, {4, 4, 2.0}
81 /* max brains, max mana, weakness, gold tote, ring duration */
82 7.0, 80.0, 13.0, 255.0, 25,
83 /* quickness, strength, mana */
84 {25, 6, 0.0}, {50, 21, 5.0}, {25, 21, 30.0},
85 /* energy, brains, magic lvl */
86 {60, 41, 35.0}, {20, 21, 2.5}, {2, 4, 1.0}
91 /* max brains, max mana, weakness, gold tote, ring duration */
92 11.0, 80.0, 10.0, 125.0, 40,
93 /* quickness, strength, mana */
94 {34, 0, 0.0}, {20, 6, 2.0}, {25, 21, 30.0},
95 /* energy, brains, magic lvl */
96 {55, 36, 30.0}, {40, 36, 4.5}, {1, 4, 1.0}
101 /* max brains, max mana, weakness, gold tote, ring duration */
102 9.0, 90.0, 16.0, 160.0, 20,
103 /* quickness, strength, mana */
104 {27, 0, 0.0}, {25, 0, 0.0}, {100, 0, 0.0},
105 /* energy, brains, magic lvl */
106 {35, 0, 0.0}, {25, 0, 0.0}, {2, 0, 0.0}
111 /* max brains, max mana, weakness, gold tote, ring duration */
112 15.0, 200.0, 10.0, 225.0, 40,
113 /* quickness, strength, mana */
114 {38, 0, 0.0}, {65, 0, 5.0}, {100, 0, 75.0},
115 /* energy, brains, magic lvl */
116 {80, 0, 35.0}, {85, 0, 6.0}, {9, 0, 2.75}
120 /* menu of items for purchase */
121 struct menuitem Menu
[] =
128 {"Quicksilver", 2500},
132 FILE *Playersfp
; /* pointer to open player file */
133 FILE *Monstfp
; /* pointer to open monster file */
134 FILE *Messagefp
; /* pointer to open message file */
135 FILE *Energyvoidfp
; /* pointer to open energy void file */
137 char Databuf
[SZ_DATABUF
]; /* a place to read data into */
139 /* some canned strings for messages */
140 const char Illcmd
[] = "Illegal command.\n";
141 const char Illmove
[] = "Too far.\n";
142 const char Illspell
[] = "Illegal spell.\n";
143 const char Nomana
[] = "Not enought mana for that spell.\n";
144 const char Somebetter
[] = "But you already have something better.\n";
145 const char Nobetter
[] = "That's no better than what you already have.\n";
148 /************************************************************************
150 / FUNCTION NAME: drandom()
152 / FUNCTION: return a random number
154 / AUTHOR: E. A. Estes, 2/7/86
160 / MODULES CALLED: random()
162 / GLOBAL INPUTS: none
164 / GLOBAL OUTPUTS: none
168 *************************************************************************/
173 if (sizeof(int) != 2)
174 return((double) (random() & 0x7fff) / 32768.0);
176 return((double) random() / 32768.0);