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