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