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