📄 data.c
字号:
/*- * Copyright (c) 1988 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */#ifndef lintstatic char sccsid[] = "@(#)data.c 5.3 (Berkeley) 5/13/91";#endif /* not lint *//* data.c Larn is copyrighted 1986 by Noah Morgan. */#define NODEFS#include "header.h"/* class[c[LEVEL]-1] gives the correct name of the players experience level */static char aa1[] = " mighty evil master";static char aa2[] = "apprentice demi-god";static char aa3[] = " minor demi-god ";static char aa4[] = " major demi-god ";static char aa5[] = " minor deity ";static char aa6[] = " major deity "; static char aa7[] = " novice guardian ";static char aa8[] = "apprentice guardian";static char aa9[] = " The Creator ";char *class[]={ " novice explorer ", "apprentice explorer", " practiced explorer",/* -3*/ " expert explorer ", " novice adventurer", " adventurer ",/* -6*/ "apprentice conjurer", " conjurer ", " master conjurer ",/* -9*/ " apprentice mage ", " mage ", " experienced mage ",/* -12*/ " master mage ", " apprentice warlord", " novice warlord ",/* -15*/ " expert warlord ", " master warlord ", " apprentice gorgon ",/* -18*/ " gorgon ", " practiced gorgon ", " master gorgon ",/* -21*/ " demi-gorgon ", " evil master ", " great evil master ",/* -24*/ aa1 , aa1 , aa1 ,/* -27*/ aa1 , aa1 , aa1 ,/* -30*/ aa1 , aa1 , aa1 ,/* -33*/ aa1 , aa1 , aa1 ,/* -36*/ aa1 , aa1 , aa1 ,/* -39*/ aa2 , aa2 , aa2 ,/* -42*/ aa2 , aa2 , aa2 ,/* -45*/ aa2 , aa2 , aa2 ,/* -48*/ aa3 , aa3 , aa3 ,/* -51*/ aa3 , aa3 , aa3 ,/* -54*/ aa3 , aa3 , aa3 ,/* -57*/ aa4 , aa4 , aa4 ,/* -60*/ aa4 , aa4 , aa4 ,/* -63*/ aa4 , aa4 , aa4 ,/* -66*/ aa5 , aa5 , aa5 ,/* -69*/ aa5 , aa5 , aa5 ,/* -72*/ aa5 , aa5 , aa5 ,/* -75*/ aa6 , aa6 , aa6 ,/* -78*/ aa6 , aa6 , aa6 ,/* -81*/ aa6 , aa6 , aa6 ,/* -84*/ aa7 , aa7 , aa7 ,/* -87*/ aa8 , aa8 , aa8 ,/* -90*/ aa8 , aa8 , aa8 ,/* -93*/ " earth guardian ", " air guardian ", " fire guardian ",/* -96*/ " water guardian ", " time guardian ", " ethereal guardian ",/* -99*/ aa9 , aa9 , aa9 ,/* -102*/};/* table of experience needed to be a certain level of player skill[c[LEVEL]] is the experience required to attain the next level */#define MEG 1000000long skill[] = {0, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, /* 1-11 */10240, 20480, 40960, 100000, 200000, 400000, 700000, 1*MEG, /* 12-19 */2*MEG,3*MEG,4*MEG,5*MEG,6*MEG,8*MEG,10*MEG, /* 20-26 */12*MEG,14*MEG,16*MEG,18*MEG,20*MEG,22*MEG,24*MEG,26*MEG,28*MEG, /* 27-35 */30*MEG,32*MEG,34*MEG,36*MEG,38*MEG,40*MEG,42*MEG,44*MEG,46*MEG, /* 36-44 */48*MEG,50*MEG,52*MEG,54*MEG,56*MEG,58*MEG,60*MEG,62*MEG,64*MEG, /* 45-53 */66*MEG,68*MEG,70*MEG,72*MEG,74*MEG,76*MEG,78*MEG,80*MEG,82*MEG, /* 54-62 */84*MEG,86*MEG,88*MEG,90*MEG,92*MEG,94*MEG,96*MEG,98*MEG,100*MEG, /* 63-71 */105*MEG,110*MEG,115*MEG,120*MEG, 125*MEG, 130*MEG, 135*MEG, 140*MEG, /* 72-79 */145*MEG,150*MEG,155*MEG,160*MEG, 165*MEG, 170*MEG, 175*MEG, 180*MEG, /* 80-87 */185*MEG,190*MEG,195*MEG,200*MEG, 210*MEG, 220*MEG, 230*MEG, 240*MEG, /* 88-95 */250*MEG,260*MEG,270*MEG,280*MEG, 290*MEG, 300*MEG /* 96-101*/};#undef MEGchar *lpbuf,*lpnt,*inbuffer,*lpend; /* input/output pointers to the buffers */struct cel *cell; /* pointer to the dungeon storage */short hitp[MAXX][MAXY]; /* monster hp on level */short iarg[MAXX][MAXY]; /* arg for the item array */char item[MAXX][MAXY]; /* objects in maze if any */char know[MAXX][MAXY]; /* 1 or 0 if here before */char mitem[MAXX][MAXY]; /* monster item array */char moved[MAXX][MAXY]; /* monster movement flags */char stealth[MAXX][MAXY]; /* 0=sleeping 1=awake monst*/char iven[26]; /* inventory for player */short ivenarg[26]; /* inventory for player */char lastmonst[40]; /* this has the name of the current monster */char beenhere[MAXLEVEL+MAXVLEVEL]={0}; /* 1 if have been on this level */char VERSION=VER; /* this is the present version # of the program */char SUBVERSION=SUBVER;char nosignal=0; /* set to 1 to disable the signals from doing anything */char predostuff=0; /* 2 means that the trap handling routines must do a showplayer() after a trap. 0 means don't showplayer() 0 - we are in create player screen 1 - we are in welcome screen 2 - we are in the normal game */char loginname[20]; /* players login name */char logname[LOGNAMESIZE]; /* players name storage for scoring */char sex=1; /* default is a man 0=woman */char boldon=1; /* 1=bold objects 0=inverse objects */char ckpflag=0; /* 1 if want checkpointing of game, 0 otherwise */char cheat=0; /* 1 if the player has fudged save file */char level=0; /* cavelevel player is on = c[CAVELEVEL] */char wizard=0; /* the wizard mode flag */short lastnum=0; /* the number of the monster last hitting player */short hitflag=0; /* flag for if player has been hit when running */short hit2flag=0; /* flag for if player has been hit when running */short hit3flag=0; /* flag for if player has been hit flush input */short playerx,playery; /* the room on the present level of the player */short lastpx,lastpy; /* 0 --- MAXX-1 or 0 --- MAXY-1 */short oldx,oldy;short lasthx=0,lasthy=0; /* location of monster last hit by player */short nobeep=0; /* true if program is not to beep */unsigned long randx=33601; /* the random number seed */long initialtime=0; /* time playing began */long gtime=0; /* the clock for the game */long outstanding_taxes=0; /* present tax bill from score file */long c[100],cbak[100]; /* the character description arrays */int enable_scroll=0; /* constant for enabled/disabled scrolling regn */char aborted[] = " aborted";struct sphere *spheres=0; /*pointer to linked list for spheres of annihilation*/char *levelname[]={ " H"," 1"," 2"," 3"," 4"," 5"," 6"," 7"," 8"," 9","10","V1","V2","V3" };char objnamelist[]=" ATOP%^F&^+M=%^$$f*OD#~][[)))(((||||||||{?!BC}o:@.<<<<EVV))([[]]](^ [H*** ^^ S tsTLc............................................";char monstnamelist[]=" BGHJKOScjtAELNQRZabhiCTYdegmvzFWflorXV pqsyUkMwDDPxnDDuD ...............................................................";char *objectname[]={ 0,"a holy altar","a handsome jewel encrusted throne","the orb","a pit", "a staircase leading upwards","an elevator going up","a bubbling fountain", "a great marble statue","a teleport trap","the college of Larn", "a mirror","the DND store","a staircase going down","an elevator going down", "the bank of Larn","the 5th branch of the Bank of Larn", "a dead fountain","gold","an open door","a closed door", "a wall","The Eye of Larn","plate mail","chain mail","leather armor", "a sword of slashing","Bessman's flailing hammer","a sunsword", "a two handed sword","a spear","a dagger", "ring of extra regeneration","a ring of regeneration","a ring of protection", "an energy ring","a ring of dexterity","a ring of strength", "a ring of cleverness","a ring of increase damage","a belt of striking", "a magic scroll","a magic potion","a book","a chest", "an amulet of invisibility","an orb of dragon slaying", "a scarab of negate spirit","a cube of undead control", "device of theft prevention","a brilliant diamond","a ruby", "an enchanting emerald","a sparkling sapphire","the dungeon entrance", "a volcanic shaft leaning downward","the base of a volcanic shaft", "a battle axe","a longsword","a flail","ring mail","studded leather armor", "splint mail","plate armor","stainless plate armor","a lance of death", "an arrow trap","an arrow trap","a shield","your home", "gold","gold","gold","a dart trap", "a dart trap","a trapdoor","a trapdoor","the local trading post", "a teleport trap", "a massive throne", "a sphere of annihilation","a handsome jewel encrusted throne", "the Larn Revenue Service","a fortune cookie","","","","","","", "","","","","","","","","","","","","","","","","","","","" };/* * for the monster data * * array to do rnd() to create monsters <= a given level */char monstlevel[] = { 5, 11, 17, 22, 27, 33, 39, 42, 46, 50, 53, 56, 59 };struct monst monster[] = {/* NAME LV AC DAM ATT DEF GEN INT GOLD HP EXP----------------------------------------------------------------- */{ "", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0 },{ "bat", 1, 0, 1, 0, 0, 0, 3, 0, 1, 1 },{ "gnome", 1, 10, 1, 0, 0, 0, 8, 30, 2, 2 },{ "hobgoblin", 1, 14, 2, 0, 0, 0, 5, 25, 3, 2 },{ "jackal", 1, 17, 1, 0, 0, 0, 4, 0, 1, 1 },{ "kobold", 1, 20, 1, 0, 0, 0, 7, 10, 1, 1 },{ "orc", 2, 12, 1, 0, 0, 0, 9, 40, 4, 2 },{ "snake", 2, 15, 1, 0, 0, 0, 3, 0, 3, 1 },{ "giant centipede",2, 14, 0, 4, 0, 0, 3, 0, 1, 2 },{ "jaculi", 2, 20, 1, 0, 0, 0, 3, 0, 2, 1 },{ "troglodyte", 2, 10, 2, 0, 0, 0, 5, 80, 4, 3 },{ "giant ant", 2, 8, 1, 4, 0, 0, 4, 0, 5, 5 },
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -