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