diff -rN -c slashem-0.0.7E7F2/Geekpatch.txt geekslashem-0.0.7E7F2/Geekpatch.txt *** slashem-0.0.7E7F2/Geekpatch.txt 1970-01-01 09:00:00.000000000 +0900 --- geekslashem-0.0.7E7F2/Geekpatch.txt 2006-04-29 23:15:37.000000000 +0900 *************** *** 0 **** --- 1,47 ---- + geekpatch4slash'em 0.6 + by Iwakiri + + This patch adds some features from TNG3.4.3-jp + In other words, this patch adds the following + the role geek + some objects + gauntlets of typing + ring of timely backup + amulet of data storage + diode + transistor + IC + pack of floppies + relay + Hacker's Food + Jolt Cola + scroll of root password detection + wand of bugging + some artifacts + The Burned Moth Relay (relay) + The NetHack Sources (pack of floppies) + some monsters + bug + heisenbug + PDP-11 + PDP-9 + VAX + walking disk drive + Cray + pupil + teacher + principal + news daemon + printer daemon + UNIX Kernel + geek + The DevTeam + Bill Gates + hacker + + There are some changes from the original TNG + geeks' initial weapon is a lightsaber, not a electric sword. + geeks have some technique. + + For I am a linux user, I couldn't fix the makefiles except unixs.If you are not unix user, please fix around Makefiles by yourself. + If you want to enjoy this patch, don't forget to define "GEEK" in "include/config.h" before compiling. diff -rN -c slashem-0.0.7E7F2/Geekpatch.txt.j geekslashem-0.0.7E7F2/Geekpatch.txt.j *** slashem-0.0.7E7F2/Geekpatch.txt.j 1970-01-01 09:00:00.000000000 +0900 --- geekslashem-0.0.7E7F2/Geekpatch.txt.j 2006-04-30 00:07:12.000000000 +0900 *************** *** 0 **** --- 1,53 ---- + geekpatch4slash'em 0.6 + by Iwakiri + + このパッチはjTNGからいくつか機能を移植します + 次のものが追加されます + 職業ギーク + アイテム類 + タイピングの小手 + 適時バックアップの指輪 + データ保存の魔除け + ダイオード + トランジスタ + IC + フロッピーディスク + リレー + ハッカーの糧 + ジョルトコーラ + ルートパスワード検知の巻物 + バグ出しの杖 + アーティファクト類 + 焦げた蛾のリレー + ネットハックのソース + モンスター類 + バグ + ハイゼンバグ + PDP-11 + PDP-9 + VAX + お散歩ディスクドライブ + クレイ + 生徒 + 教官 + 校長 + ニュースデーモン + プリンタデーモン + UNIX カーネル + ギーク + 開発チーム + ビル・ゲイツ + ハッカー + + いくつかの点でオリジナルのTNGと異なります + ギークの初期武器がTNGのライトサーベルではなくslash'emのライトサーベルです + ギークにもテクニックがあります + + 私がリナックスを使っているため、unix系の以外のMakefileは修正できませんでした もしもunix系以外を使っている方は自分でMakefile周りを修正してください + このパッチを楽しむためには、コンパイルの前に忘れずに"include/config.h"の"GEEK"を定めてください + + まだ多くの点でバグが有ると思います利用は自己責任で。 + + TODO: + Translating Deustch in src/school.c + diff -rN -c slashem-0.0.7E7F2/dat/Gdungeon.def geekslashem-0.0.7E7F2/dat/Gdungeon.def *** slashem-0.0.7E7F2/dat/Gdungeon.def 1970-01-01 09:00:00.000000000 +0900 --- geekslashem-0.0.7E7F2/dat/Gdungeon.def 2006-04-28 02:21:22.000000000 +0900 *************** *** 0 **** --- 1,316 ---- + # SCCS Id: @(#)dungeon.def 3.3 96/03/10 + # Copyright (c) 1990-92 by M. Stephenson + # NetHack may be freely redistributed. See license for details. + # + # The dungeon description file for Slash'em. + # Modified by KMH for the balance patch. + # + # Note: The order of the definition of dungeons in this file + # reflects in their order of creation in the real dungeon. + # The "Main" branch must *always* be first. + # Also note that the order of the dungeons in this file + # determines the order in which branch levels are assigned. + # If two dungeons have overlapping ranges for their entry + # points, then you should list the dungeon with the _least_ + # number of choices for its branch level _first_. + + ### The Dungeons of Doom ### + # The main dungeon is from 42 to 47 levels deep... + # [Tom] stretched it out to make it a little more interesting, and + # have more "normal" levels, because the special ones were more + # frequent than normal ones! + DUNGEON: "The Dungeons of Doom" "D" (42, 5) + ALIGNMENT: unaligned + + + # Early levels, to the Oracle + # KMH -- The Gnomish Mines are an important source of essential + # items for low-level characters: food, armor, and tools. Even a + # short stay in the mines pays off. Slash moved the entrance + # deeper, penalizing many characters. The balance patch restores + # the entrance to levels 2 to 4. + BRANCH: "The Gnomish Mines" @ (2, 3) + + # + # New mall is on levels 5 to 6, 75% chance. + # There shouldn't be any other special levels down to the Oracle. + # This allows a weak character to plunge to the Oracle, then return + # to the Mines. + RNDLEVEL: "mall" "T" @ (5, 2) 75 2 + LEVALIGN: lawful + LEVELDESC: town + # + # Oracle on levels 7 to 9. + LEVEL: "oracle" "O" @ (7, 3) + LEVALIGN: neutral + CHAINBRANCH: "Sokoban" "oracle" + (1, 0) up -1 + + + # Levels between the Oracle and the Quest. + # There's no guarantee that all will be created. + LEVEL: "rats" "R" @ (10, 2) 50 + RNDLEVEL: "kobold" "K" @ (11, 2) 50 2 + BRANCH: "Grund's Stronghold" @ (12, 2) + + + # The quests, on levels 15 to 19. + # These levels should not be shared with other special levels + # or branches, else the quests may not be generated! + BRANCH: "The Quest" @ (15, 5) portal + BRANCH: "Lawful Quest" @ (15, 5) portal + BRANCH: "Neutral Quest" @ (15, 5) portal + BRANCH: "Chaotic Quest" @ (15, 5) portal + + + # The rogue level (if required), on levels 15 to 19. The portal to one + # of the quest levels may also be on this level. The rogue level is not + # defined by default in Slash'EM. The dungeon is crowded enough already. + %REINCARNATION LEVEL: "rogue" "R" @ (15, 5) + + + # Post-quest levels + # Now all the branches... stretching all along the dungeon + # Put the branches with the least number of choices first + BRANCH: "The Wyrm Caves" @ (20, 2) + BRANCH: "One-eyed Sam's Market" @ (22, 2) portal + BRANCH: "The Lost Tomb" @ (21, 4) + BRANCH: "The Spider Caves" @ (26, 4) + BRANCH: "The Sunless Sea" @ (28, 4) + BRANCH: "The Temple of Moloch" @ (32, 4) + BRANCH: "The Giant Caverns" @ (32, 4) + # And the levels... + LEVEL: "nymph" "N" @ (23, 2) 45 + RNDLEVEL: "bigrm" "B" @ (20, 7) 15 5 + # Storage room (treasure) on levels 19-26, 66% of the time + # "Unused 'cause they suck"? + RNDLEVEL: "stor" "S" @ (19, 8) 66 3 + # Rounding out the bottom levels + LEVEL: "guild" "G" @ (26, 6) 50 + + + # The famous Fort Ludios... + BRANCH: "Fort Ludios" @ (23, 4) portal + + + # Medusa and the castle. There should be nothing in between. + RNDLEVEL: "medusa" "none" @ (-5, 4) 4 + LEVALIGN: chaotic + LEVEL: "castle" "none" @ (-1, 0) + CHAINBRANCH: "Gehennom" "castle" + (0, 0) no_down + + + # Branch to the endgame... + BRANCH: "The Elemental Planes" @ (1, 0) no_down up -2 + + + ### Gehennom ### + # + # Now re-worked for 3.1, hell is hopefully going to be a little + # less boring. Also, in 3.1, the tower is not considered as a + # part of hell, but is set up as a separate dungeon. + # + # Gehennom is no longer considered "hellish" as a complete dungeon. + # That is, fire resistance is no longer a condition for survival in + # it. However, Gehennom, and the special levels in it in particular, + # is abundant with fire traps. As a result, fire resistance is still + # a prudent survival strategy in Gehennom. + # + # Note: Gehennom *must* be the second dungeon defined so that + # monsters can properly migrate here under certain + # circumstances. + # + # [Tom] tried to remove most of the non-unique levels (i.e. lame mazes) + # also tried to organize it a little -- demons before the wizard, devils + # after. + + # DUNGEON: "Gehennom" "G" (17, 0) + DUNGEON: "Gehennom" "G" (20, 0) + DESCRIPTION: mazelike + DESCRIPTION: hellish + ALIGNMENT: noalign + LEVEL: "valley" "V" @ (1, 0) + LEVEL: "sanctum" "none" @ (-1, 0) + # Tower before wiz, please + BRANCH: "Vlad's Tower" @ (3, 10) up -1 + # Dr. Frankenstein's Lab + BRANCH: "Frankenstein's Lab" @ (3, 10) up + # [Iwakiri] - Geekpatch + # The levels from TNG + # KILLER HIGH SCHOOL + BRANCH: "Killer High School" @ (3,7) + # Computer Room + BRANCH: "Computer Room" @ (3,7) + + # The demon levels + LEVEL: "juiblex" "J" @ (2, 5) + LEVEL: "yeenoghu" "E" @ (2, 5) + LEVEL: "orcus" "O" @ (2, 5) + LEVEL: "demogorg" "D" @ (2, 5) + # Half-way down + LEVEL: "wizard1" "none" @ (7, 0) + CHAINLEVEL: "wizard2" "X" "wizard1" + (1, 0) + CHAINLEVEL: "wizard3" "Y" "wizard1" + (2, 0) + # The devil levels + #LEVEL: "baalz" "B" @ (10, 6) + #LEVEL: "geryon" "R" @ (10, 6) + #LEVEL: "dispater" "S" @ (10, 6) + #LEVEL: "asmodeus" "A" @ (10, 6) + #LEVEL: "fakewiz1" "F" @ (10, 6) + #LEVEL: "fakewiz2" "G" @ (10, 6) + LEVEL: "baalz" "B" @ (12, 6) + LEVEL: "geryon" "R" @ (12, 6) + LEVEL: "dispater" "S" @ (12, 6) + LEVEL: "asmodeus" "A" @ (12, 6) + LEVEL: "fakewiz1" "F" @ (12, 6) + LEVEL: "fakewiz2" "G" @ (12, 6) + + ### Gnomish Mines ### + # (The Mines of the Gnomes of Zurich.) + # + DUNGEON: "The Gnomish Mines" "M" (8, 2) + ALIGNMENT: lawful + DESCRIPTION: mazelike + RNDLEVEL: "minetn" "T" @ (3, 2) 7 + LEVELDESC: town + RNDLEVEL: "minend" "E" @ (-2, 0) 3 + LEVEL: "mineking" "M" @ (-1, 0) + + + ### The Quest Dungeon ### + # This is a proto-dungeon. The level file names will be prepended with + # the role code (eg, Arc, Val) during initialization. + # Special "x-fila" and "x-filb" levels must be defined in the levels + # description file. It will be used for all levels not defined explicitly + # below. + DUNGEON: "The Quest" "Q" (5, 2) + LEVEL: "x-strt" "none" @ (1, 1) + LEVEL: "x-loca" "L" @ (3, 1) + LEVEL: "x-goal" "none" @ (-1, 0) + + + ### The aligned key quests ### + DUNGEON: "Lawful Quest" "none" (1, 0) + ALIGNMENT: lawful + DESCRIPTION: mazelike + LEVEL: "nightmar" "none" @ (1, 0) + + DUNGEON: "Neutral Quest" "none" (1, 0) + ALIGNMENT: neutral + DESCRIPTION: mazelike + LEVEL: "beholder" "none" @ (1, 0) + + DUNGEON: "Chaotic Quest" "none" (1, 0) + ALIGNMENT: chaotic + DESCRIPTION: mazelike + LEVEL: "lich" "none" @ (1, 0) + + # + # Sokoban + # + DUNGEON: "Sokoban" "none" (4, 0) + DESCRIPTION: mazelike + ALIGNMENT: neutral + RNDLEVEL: "soko1" "none" @ (1, 0) 4 + RNDLEVEL: "soko2" "none" @ (2, 0) 7 + RNDLEVEL: "soko3" "none" @ (3, 0) 7 + RNDLEVEL: "soko4" "none" @ (4, 0) 5 + + + ### Grund's Stronghold ### + DUNGEON: "Grund's Stronghold" "Z" (1, 0) + ALIGNMENT: chaotic + DESCRIPTION: mazelike + RNDLEVEL: "grund" "Z" @ (1, 0) 3 + + ### Fort Ludios ### + # (The Central Vault of Croesus.) + # + DUNGEON: "Fort Ludios" "K" (1, 0) + DESCRIPTION: mazelike + ALIGNMENT: unaligned + LEVEL: "knox" "K" @ (-1, 0) + + ### The Wyrm Caves ### + DUNGEON: "The Wyrm Caves" "D" (1, 0) + ALIGNMENT: chaotic + DESCRIPTION: mazelike + LEVEL: "dragons" "D" @ (1, 0) + + ### The Black Market ### + DUNGEON: "One-eyed Sam's Market" "D" (1, 0) + ALIGNMENT: chaotic + DESCRIPTION: mazelike + LEVEL: "blkmar" "D" @ (1, 0) + + ### The Lost Tomb ### + DUNGEON: "The Lost Tomb" "L" (1, 0) + ALIGNMENT: chaotic + DESCRIPTION: mazelike + LEVEL: "tomb" "L" @ (1, 0) + + ### The Spider Caves ### + DUNGEON: "The Spider Caves" "S" (1, 0) + ALIGNMENT: chaotic + DESCRIPTION: mazelike + LEVEL: "spiders" "S" @ (1, 0) + + ### The Sunless Sea ### + DUNGEON: "The Sunless Sea" "none" (1, 0) + ALIGNMENT: chaotic + DESCRIPTION: mazelike + LEVEL: "sea" "none" @ (1, 0) + + ### The Temple of Moloch ### + DUNGEON: "The Temple of Moloch" "none" (1, 0) + ALIGNMENT: chaotic + DESCRIPTION: mazelike + LEVEL: "mtemple" "none" @ (1, 0) + + ### The Giant Caverns ### + DUNGEON: "The Giant Caverns" "H" (1, 0) + ALIGNMENT: chaotic + DESCRIPTION: mazelike + LEVEL: "cav2fill" "H" @ (1, 0) + + ### Vlad's Tower ### + # It has been removed from Gehennom, and it is surrounded by stone. + DUNGEON: "Vlad's Tower" "T" (3, 0) + PROTOFILE: "tower" + DESCRIPTION: mazelike + ALIGNMENT: chaotic + + + ### Dr Frankenstein's Lab ### + DUNGEON: "Frankenstein's Lab" "none" (1, 0) + ALIGNMENT: chaotic + DESCRIPTION: mazelike + LEVEL: "frnknstn" "none" @ (1, 0) + + ### KILLER HIGH SCHOOL ### + DUNGEON: "Killer High School" "none" (1,0) + ALIGNMENT: chaotic + DESCRIPTION: mazelike + DESCRIPTION: hellish + LEVEL: "school" "none" @ (1,0) + + ### Computer Room ### + DUNGEON: "Computer Room" "none" (1,0) + ALIGNMENT: noalign + DESCRIPTION: mazelike + LEVEL: "computer" "none" @ (1,0) + + ### The Endgame levels ### + # + # Enter on 2nd level from bottom; 1st (from bottom) is a + # placeholder for surface level, and should be unreachable. + # [Note: the name "dummy" is checked for in init_dungeons().] + # + DUNGEON: "The Elemental Planes" "E" (6, 0) + DESCRIPTION: mazelike + ALIGNMENT: unaligned + LEVEL: "astral" "none" @ (1, 0) + LEVEL: "water" "none" @ (2, 0) + LEVEL: "fire" "none" @ (3, 0) + LEVEL: "air" "none" @ (4, 0) + LEVEL: "earth" "none" @ (5, 0) + LEVEL: "dummy" "none" @ (6, 0) diff -rN -c slashem-0.0.7E7F2/dat/Geek.des geekslashem-0.0.7E7F2/dat/Geek.des *** slashem-0.0.7E7F2/dat/Geek.des 1970-01-01 09:00:00.000000000 +0900 --- geekslashem-0.0.7E7F2/dat/Geek.des 2006-04-22 17:18:13.000000000 +0900 *************** *** 0 **** --- 1,353 ---- + # Geek.des + # The Geek quest + # 03/19/94 by Sebastian Klein + + # --- start level --- + + MAZE: "Gek-strt",' ' + FLAGS: noteleport,hardfloor + GEOMETRY: center,center + + # 1 2 3 4 5 6 7 + #123456789012345678901234567890123456789012345678901234567890123456789012345 + + MAP + ............................................................................ + ............................................................................ + ..........................|-------------------------|....................... + ..........................|.........................|....................... + ..........................|-------------+-----------|....................... + ............................................................................ + ............................................................................ + ............................................................................ + ..........................|-------------------------|-|..................... + ..........................|.........................|.|..................... + ..........................|.........................|.|..................... + ..........................|.........................|.|..................... + ..........................|.........................+.+..................... + ..........................|.........................|.|..................... + ..........................|.........................|.|..................... + ..........................|.........................|.|..................... + ..........................|-------------------------|-|..................... + ............................................................................ + ............................................................................ + ............................................................................ + ENDMAP + + REGION:(00,00,75,19),lit,"ordinary" + + BRANCH:(60,18,60,18),(0,0,0,0) + + STAIR:(27,03),down + + DOOR:locked,(40,04) + DOOR:locked,(54,12) + DOOR:locked,(52,12) + + MONSTER:'@',"The DevTeam",(38,12) + + MONSTER:'@',"hacker",(37,11) + MONSTER:'@',"hacker",(38,11) + MONSTER:'@',"hacker",(39,11) + MONSTER:'@',"hacker",(37,12) + MONSTER:'@',"hacker",(39,12) + MONSTER:'@',"hacker",(37,13) + MONSTER:'@',"hacker",(38,13) + MONSTER:'@',"hacker",(39,13) + + # For the textwork care has to be exercised that there are no + # rock moles, dwarves with pick-axes etc. to break the walls. + + # "May the force be with you" + MONSTER:'M',random,(27,03) + MONSTER:'a',random,(28,03) + MONSTER:'y',random,(29,03) + MONSTER:':',random,(30,03) + MONSTER:'t',random,(31,03) + MONSTER:'h',"hobbit",(32,03) + MONSTER:'e',random,(33,03) + MONSTER:':',random,(34,03) + MONSTER:'f',random,(35,03) + MONSTER:'o',random,(36,03) + MONSTER:'r',"sewer rat",(37,03) + MONSTER:'c',random,(38,03) + MONSTER:'e',random,(39,03) + MONSTER:':',random,(40,03) + MONSTER:'b',random,(41,03) + MONSTER:'e',random,(42,03) + MONSTER:':',random,(43,03) + MONSTER:'w',random,(44,03) + MONSTER:'i',random,(45,03) + MONSTER:'t',random,(46,03) + MONSTER:'h',"hobbit",(47,03) + MONSTER:':',random,(48,03) + MONSTER:'y',random,(49,03) + MONSTER:'o',random,(50,03) + MONSTER:'u',random,(51,03) + + # "WELCOME" + MONSTER:'W',"wraith",(53,09) + MONSTER:'E',random,(53,10) + MONSTER:'L',"lich",(53,11) + MONSTER:'C',random,(53,12) + MONSTER:'O',random,(53,12) + MONSTER:'M',random,(53,13) + MONSTER:'E',random,(53,14) + + # To ensure that the player can see the artwork + OBJECT:'"',"amulet of ESP",random + OBJECT:'(',"blindfold",random + + OBJECT:'!',"Jolt Cola",random + OBJECT:'!',"Jolt Cola",random + OBJECT:'/',"digging",random + + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + + TRAP:random,random + TRAP:random,random + TRAP:random,random + TRAP:random,random + + # --- locate level --- + + # looks harmless but *IS* tough!!! + + MAZE: "Gek-loca",' ' + FLAGS: hardfloor + GEOMETRY: center,center + + # 1 2 3 4 5 6 7 + #123456789012345678901234567890123456789012345678901234567890123456789012345 + + MAP + ............................................................................ + ............................................................................ + ............................................................................ + ............................................................................ + .....--------------------------|............|--------------------------..... + ...............................|............|............................... + ...-------------------------|..|............|..|-------------------------... + ............................|..|............|..|............................ + .---------------------|--|..|..|............|..|..|--|---------------------. + ......................|..|..|..|............|..|..|..|...................... + .---------------------|--|..|..|............|..|..|--|---------------------. + ............................|..|............|..|............................ + ...-------------------------|..|............|..|-------------------------... + ...............................|............|............................... + .....--------------------------|............|--------------------------..... + ............................................................................ + ............................................................................ + ............................................................................ + ............................................................................ + ............................................................................ + ENDMAP + + RANDOM_PLACES: (24,09), (27,09), (30,09), (45,09), (48,09), (51,09) + + REGION:(00,00,75,19),lit,"ordinary" + + # the niches + STAIR:place[0],down + OBJECT:'"',"amulet of life saving",place[1] + OBJECT:'"',"amulet of strangulation",place[2] + MONSTER:'m',"giant mimic",place[3], m_feature "staircase down" + MONSTER:'m',"giant mimic",place[4], m_feature "staircase down" + TRAP:"polymorph",place[5] + + STAIR:random,up + + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + MONSTER:random,random,random,hostile + + TRAP:random,random + TRAP:random,random + TRAP:random,random + TRAP:random,random + TRAP:random,random + TRAP:random,random + TRAP:random,random + TRAP:random,random + + # --- the goal level --- + + MAZE: "Gek-goal", ' ' + GEOMETRY:center,center + + # 1 2 3 4 5 6 7 + #123456789012345678901234567890123456789012345678901234567890123456789012345 + + MAP + ............................................................................ + .-------------------------------------------------------------------------|. + ..........................................................................|. + ....|-----------------------------------------------------------------|...|. + ....|.................................................................|...|. + ....|...|---------------------------------------------------------|...|...|. + ....|...|...+.....................................................|...|...|. + ....|...|...|.....................................................|...|...|. + ....|...|...|.....................................................|...|...|. + ....|...|...|........................\............................|...|...|. + ....|...|...|.....................................................|...|...|. + ....|...|...|.....................................................|...|...|. + ....|...|...|.....................................................|...|...|. + ....|...|...|-----------------------------------------------------|...|...|. + ....|...|.............................................................|...|. + ....|...|-------------------------------------------------------------|...|. + ....|.....................................................................|. + ....|---------------------------------------------------------------------|. + ............................................................................ + ............................................................................ + ENDMAP + + REGION:(0,0,75,19),lit,"ordinary" + + STAIR:(75,19),up + + DOOR:locked,(12,06) + + # that's what's this all about :-) + OBJECT:'(',"pack of floppies",(37,09),blessed,0,"The NetHack Sources" + MONSTER:'@',"Bill Gates",(37,09) + + MONSTER:random,random,random + MONSTER:random,random,random + MONSTER:random,random,random + MONSTER:random,random,random + MONSTER:random,random,random + MONSTER:random,random,random + MONSTER:random,random,random + MONSTER:random,random,random + + OBJECT:'(',"pack of floppies",random + OBJECT:'(',"pack of floppies",random + OBJECT:'(',"pack of floppies",random + OBJECT:'(',"pack of floppies",random + OBJECT:'(',"pack of floppies",random + OBJECT:'(',"pack of floppies",random + OBJECT:'(',"pack of floppies",random + OBJECT:'(',"pack of floppies",random + + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + OBJECT:random,random,random + + # --- fill a --- + + LEVEL: "Gek-fila" + + ROOM: "ordinary", random, random, random, random + STAIR: random,up + OBJECT:random,random,random + OBJECT:random,random,random + MONSTER:random,random,random + TRAP:random,random + + ROOM: "ordinary", random, random, random, random + STAIR: random,down + OBJECT:random,random,random + OBJECT:random,random,random + MONSTER:random,random,random + TRAP:random,random + + ROOM: "ordinary", random, random, random, random + OBJECT:random,random,random + OBJECT:random,random,random + MONSTER:random,random,random + TRAP:random,random + + ROOM: "ordinary", random, random, random, random + OBJECT:random,random,random + OBJECT:random,random,random + MONSTER:random,random,random + TRAP:random,random + + ROOM: "ordinary", random, random, random, random + OBJECT:random,random,random + OBJECT:random,random,random + MONSTER:random,random,random + TRAP:random,random + + ROOM: "ordinary", random, random, random, random + OBJECT:random,random,random + OBJECT:random,random,random + MONSTER:random,random,random + TRAP:random,random + + RANDOM_CORRIDORS + + + # --- fill b --- + + LEVEL: "Gek-filb" + + ROOM: "ordinary", random, random, random, random + STAIR: random,up + OBJECT:random,random,random + OBJECT:random,random,random + MONSTER:random,random,random + TRAP:random,random + + ROOM: "ordinary", random, random, random, random + STAIR: random,down + OBJECT:random,random,random + OBJECT:random,random,random + MONSTER:random,random,random + TRAP:random,random + + ROOM: "ordinary", random, random, random, random + OBJECT:random,random,random + OBJECT:random,random,random + MONSTER:random,random,random + TRAP:random,random + + ROOM: "ordinary", random, random, random, random + OBJECT:random,random,random + OBJECT:random,random,random + MONSTER:random,random,random + TRAP:random,random + + ROOM: "ordinary", random, random, random, random + OBJECT:random,random,random + OBJECT:random,random,random + MONSTER:random,random,random + TRAP:random,random + + ROOM: "ordinary", random, random, random, random + OBJECT:random,random,random + OBJECT:random,random,random + MONSTER:random,random,random + TRAP:random,random + + RANDOM_CORRIDORS diff -rN -c slashem-0.0.7E7F2/dat/dungeon.def geekslashem-0.0.7E7F2/dat/dungeon.def *** slashem-0.0.7E7F2/dat/dungeon.def 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/dat/dungeon.def 2006-04-25 01:19:34.000000000 +0900 *************** *** 150,156 **** LEVEL: "fakewiz1" "F" @ (10, 6) LEVEL: "fakewiz2" "G" @ (10, 6) - ### Gnomish Mines ### # (The Mines of the Gnomes of Zurich.) # --- 150,155 ---- diff -rN -c slashem-0.0.7E7F2/dat/quest.txt geekslashem-0.0.7E7F2/dat/quest.txt *** slashem-0.0.7E7F2/dat/quest.txt 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/dat/quest.txt 2006-04-22 18:36:59.000000000 +0900 *************** *** 1067,1072 **** --- 1067,1463 ---- "This is all I know, %p. I hope it will help you." %E # + # Geek + # + %Cc Gek 00001 + You now enter what is pretty known to you - it is the location of + the Holy Development Team, which in a year-long effort developed + the computer game "NetHack". + + With a sudden feeling of melancholy you remember the patches you + yourself wrote and contributed to that game. You truly believe + that this game is the best of all games known to mankind. + + However -- something has changed. At first you cannot tell what, + but then you notice. Everywhere there are hostile monsters like + the ones you used to program in NetHack, but, now in reality. + + What the heck is going on here?! + #あなたは,馴染み深い土地に踏み入った.長年,コンピュータゲーム + #「NetHack」の開発に努力を重ねている神聖なる開発チームの本拠地だ. + # + #急に憂鬱な気分になったあなたは,自分が書いてゲームに提供したパッチのこ + #とを思い出した.あなたは,このゲームこそ人類の知る最高のゲームだと信じ + #ている. + # + #だが − 何かが変わってしまった.最初は何なのか判らなかったが,あなたは + #気付いた.あなたが NetHack にプログラムした怪物どもが,あたり一面に現 + #実の存在として牙を剥いているのだ. + # + #いったいこの地で何があったのだ!? + %E + %Cp Gek 00002 + Once again you approach %H. + #あなたは再び%Hにやって来た. + %E + %Cp Gek 00003 + As you again approach %H you fear it might be the last time you see this place. + #あなたは再び%Hにやって来たが,今回が最後になるのではないかと不安になった. + %E + %Cp Gek 00005 + "Written any patches lately?" + #「最近パッチは書いたかい?」 + %E + %Cp Gek 00006 + "Do _you_ know what erf(3M) does?" + #「君は erf(3M) が何をするのか知っているか?」 + %E + %Cc Gek 00007 + #"How do you like this implementation of the Ravenous Bugblatter Of Traal" + #You reply, "Be careful not to get sued for copyright infringement!" + "How do you like this implementation of the Geek's quest" + You reply, "Be careful not to get sued from the M$!" + #「この『がつがつむしゃむしゃトラアル獣』の実装はどうかな?」 + #あなたは答えた.「著作権侵害で告訴されないように注意しなよ」 + %E + %Cp Gek 00008 + :-) + %E + %Cp Gek 00009 + "May the force be with you!" + #「フォースが共にあらんことを!」 + %E + %Cp Gek 00010 + "When is the next release?" + #「次のリリースは何時だい?」 + %E + %Cp Gek 00011 + "Don't you have any good idea?" + #「なにか良いネタはないかな?」 + %E + %Cp Gek 00012 + :) + #(^_^)/ + %E + %Cp Gek 00013 + "Use the Source, Luke!" + #「ソースを使え,ルーク!」 + %E + %Cc Gek 00014 + "Don't you think 'ASCII arts' should be renamed as 'UTF arts'?" + # こんなところにも登場なわけだが。 + #        /\ + #     /\  /__\ + #   /__\ |´< `| + #    |´ゝ`| 彡πヾ⌒i + #   /彡πヾ\  | | + #   /   /  ̄ ̄ ̄ ̄/ | + # __(__二つ/ mind /| .|____ + #     \/ flayer /(u ⊃ + #       ̄ ̄ ̄ ̄ ̄ + # きっともうネタぎれだな。 + %E + %Cc Gek 00015 + "It is a pleasure to see you again, %p. + + Horrible things have happened since our last meeting and I really need + a brave %R to clean up things for once and all. + + Let me see whether you are really able to cope with the task ... " + #「君に再び会えるとはうれしいね,%p. + # + # 先日の会合のあと,恐しい事態が発生してしまった.今回限りでいいから + # この事態を解決してくれる勇敢な%Rが本当に必要なんだ. + # + # この任務が君の手に負えるかどうか調べさせてもらうよ...」 + %E + %Cp Gek 00016 + "Please stand still while I finger(1) your state ..." + #「君の状態を finger(1) する間ちょっと立っててくれ」 + %E + %Cp Gek 00017 + $ finger %p + %E + %Cc Gek 00018 + "This was too much. You'll never attain the state of Hackishness. + Now begone!" + #「こりゃ駄目だ.ハッカーの地位は君には無理なんだろうな.帰りたまえ」 + %E + %Cc Gek 00019 + "I see you fighting %n and finally being done in by him, who we call + The Dark Lord Of Software. + No, I can't let you go like this, I really can't see a chance of a + %r fighting against Him. + I can only ask you to train some more until you have achieved the + %R's state of ability." + #「君が,我々がソフトウェア界の暗黒の王と呼んでいる%nと闘い, + # 倒されるのが見える. + # + # 駄目だ.君をこんな目に会わせるわけにはいかない.%rが奴に太刀打 + # ちできる可能性なんて見えない. + # + # 君に頼めるのは,%Rになるまで,もっと鍛練を積んでくれということ + # だけだ」 + %E + %Cc Gek 00020 + "Foo! + You have strayed from the path of %d! + Trying to destroy %n in this state of mind would mean the sure death + of your hackish soul! + Purify yourself, until you're again piously aligned with Our God, + and then come again and I will admit you." + #「何と! + # 君は%dの道から外れてしまっている! + # + # こんな心の状態で%nを倒そうなんて,君のハッカー魂の死を意味するね! + # + # 自分自身を浄めて来るんだ.我等の神を敬虔に敬うようになったらもう一度 + # 戻って来い.そうしたら許してあげよう」 + %E + %Cc Gek 00021 + "I now see that you are truly worthy to fight %n, my %s. + + Half a year ago, a young programmer, known to everybody as %n, came + to me to get a hackish education. I was suspicious from the first + moment on, but I admitted him for testing and let him stay. + + Several days later, upon waking up, I found %o to be missing. + %n was away as well. + + You are my last hope. If you fail to regain %o, NetHack development + is doomed to stop forever!" + #「我が%sよ,君は%nと闘うに十分値するようだ. + # + # 半年前,誰もが%nと言えば知っている若いプログラマが,私のところに + # ハッカーの奥儀を授かろうとやって来た.最初から疑ってはいたんだが, + # 試してみるために留まることを許したんだ. + # + # 数日後,目が覚めると,%oが消え失せているのに気付いた. + # %nもいなくなっていた. + # + # 君が私の最後の希望だ.もし君が %oを手に入れそこねたら, + # NetHack の開発は永遠に止まってしまうことになる!」 + %E + %Cp Gek 00025 + "May %d protect you!" + #「%dがお守り下さいますように!」 + %E + %Cp Gek 00026 + "Remember, He is completely evil, yet not invulnerable!" + #「覚えておくんだ.奴は徹底的に邪悪だ.しかし無敵じゃぁない!」 + %E + %Cp Gek 00027 + :-) + #(^_^) + %E + %Cp Gek 00028 + "I know you can do it!" + #「君ならきっとできるさ!」 + %E + %Cp Gek 00029 + "Our fate is up to you now." + #「我等の運命は,今や君にかかっている」 + %E + %Cp Gek 00030 + "A level being seemingly harmless may prove to be fatal by monsters + suddenly transforming one into another" + #「一見無害に見える階も,怪物が突然別の奴に変化したら致命的になる」 + %E + %Cp Gek 00031 + "It is rumoured that %n filled His lair with deadly traps." + #「%nは本拠地を死の罠で埋めつくしたらしい」 + %E + %Cp Gek 00032 + "Do you know what 'memalezu' means?" + #「君は『memalezu』の意味を知っているか?」 + %E + %Cp Gek 00033 + "They say that you can escape the dungeon by teleporting to level 0." + #「0階にテレポートすると迷宮から脱出できるそうだ」 + %E + %Cp Gek 00034 + "Nobody here has an idea what to use a silver bell for." + #「ここの連中は誰も銀のベルの使い方を知らないんだ」 + %E + %Cp Gek 00035 + You have a sure feeling that you will soon find the entrace to the %i. + You *know* you can do it! + #あなたは,すぐに%iへの入り口を見付けられるような気がした. + #あなたは成功を確信した! + %E + %Cp Gek 00036 + Once again you enter this place and once again you are sure you will succeed. + #再びこの場所に立ち入った君は,再び成功の予感を感じた. + %E + %Cp Gek 00040 + You now almost smell %o. + #あなたは%oの気配を感じた. + %E + %Cp Gek 00041 + Once again you sense %o. + #あなたは再び,%oの気配を感じた. + %E + %Cp Gek 00050 + You will never retrieve %o! + #「おまえには %oを手に入れることなどできない!」 + %E + %Cp Gek 00051 + You're doomed! You will end your life as a litte programmer slave earning + $1000 ... per year! ... before taxes! + #「死ぬがいい! おまえはちっぽけなプログラミング奴隷で一生を終わるのさ! + # ...年収1000ドル...控除前でな!」 + %E + %Cp Gek 00052 + You will never succeed! You could give up now as well! + #「成功できるわけがない! 降参したほうがいいんじゃないか!」 + %E + %Cp Gek 00053 + I will now get %o back from you and then I will make you the MS-DOS + Project Manager. This will be enough torture for you! + #「%oを手に入れたからには,お前をMS-DOSのプロジェクト + # マネージャにしてやろう.お前にぴったりの拷問だて!」 + %E + %Cp Gek 00060 + FORMAT C: /V /S + #C:\> FORMAT C: /V /S + %E + %Cp Gek 00061 + #You will die now, as sure as if you quaffed a potion of cyanide! + Use Windows Me, and everything will be fine. + #「さあお前はもう死ぬぞ,青酸を飲んだときと同じくらい確実にな!」 + %E + %Cp Gek 00062 + I think I'll be generous. I will let you have a little fun with my + pet succubus before you die ... + #「慈悲を与えてやろうか.死ぬ前にペットのサキュバスと楽しませてやろうじゃ + # ないか..」 + %E + %Cc Gek 00063 + "Perhaps you should consider the following qoute from Terry Pratchett: + + "But I don't know how to use a sword!" + + "Put the blunt end in your hand and the sharp end in the enemy!" + + "There must be more to it than that!" + + "Remember which end is which." + #「お前にはこのTerry Pratchettの引用をくれてやろう. + # + # 『でも私は剣の使い方を知らないんだ!』 + # + # 『丸い方を手に持って,尖った方を敵に向けるんだ!』 + # + # 『もっと複雑じゃないのかい!』 + # + # 『どっちがどっちかだけ覚えておけ』」 + %E + %Cp Gek 00064 + "What? You said 'Microsloth'? Then die, bastard!" + #「何? 『魔夷苦賂粗負妬』だと? 死ね,畜生め!」 + %E + %Cp Gek 00065 + "I will soon format your body, mind and soul!" + #「すぐにお前の体も心も魂もFORMATしてくれる!」 + %E + %Cp Gek 00066 + "I've got an idea: we can greatly speed this up (and save much pain + for you). You just have to take your sword and push it into your + stomach. Or, if you prefer, take a COBOL programming course." + #「思いついた.手っ取り早く済ませよう.お前の苦痛も少ないしな.剣を手に + # 取ってお前の腹に押し込むんだ.COBOLプログラミングの講習でもいいぞ」 + %E + %Cp Gek 00067 + "Don't worry, your pains will soon be over!" + #「心配するな.お前の苦痛はもうすぐ終わる!」 + %E + %Cp Gek 00068 + "I'm wondering all the time why somebody like you does something like this. + Does pain excite you or what? Well, I have a *great* sortiment of whips handy!" + #「いつも不思議に思うんだが,どうしてお前のような奴がこうもやってくる + # んだ? 痛めつけられると燃えるクチなのか? 鞭なら各種揃えてあるぞ!」 + %E + %Cp Gek 00069 + "Nobody will ever need more than 640 KB of RAM." + #「640K以上のRAMが必要な奴なんておらんさ」 + %E + %Cc Gek 00070 + You feel the power of %o flow through your body. Although you know + you have to return it to %l, you now feel like you could continue + developing NetHack on your own now. + #あなたは %oの力が体に満ちるのを感じた.これを%lに + #返さなくてはならないのは分かっているのだが,今やあなたは自分だけで開発 + #が続けられるような気分になっている. + %E + %Cp Gek 00080 + You see %n lying dead in a puddle of blood. Not a second do you + regret what you've done. + #%nが血溜りに倒れているのが見える.あなたは,自分のしたことを + #いささかも後悔していない. + %E + %Cc Gek 00081 + "You've finally got %o back! I am very grateful for what you've done. + + Yet, I am an old man and I will not long more be able to supervise + NetHack. Therefore I pass the duty on to your young and responsible + hands. Take the sources and expand them at your leisure, but be + careful to maintain game balance. + + My ultimate secret is: Nothing is true. Everything is allowed." + #「よくぞ %oを取り戻してくれた! 君の行為には大いに感謝するよ. + # + # 私は年老いてこれ以上 NetHack を監修できない.だからこの仕事は君の若 + # い信用できる手に委ねるとしよう.ソースを持って行って,暇なときに展開 + # してくれたまえ.ゲームバランスには注意してくれよ. + # + # 究極の秘密はこうだ: 『真実は存在しない.全ては許される』」 + %E + %Cp Gek 00082 + %l took %o carefully, and hand it to you. + + "Now you are the chief of %o. + Go and resume the quest for the amulet. + %Z is waiting for you." + #%lは%oを慎重に受取り、あなたに手渡した. + # + #「今や,君は%oの責任者だ. + # 魔除け探索を再開してくれ.魔法の入口の向こうで, + # %Zが君を待ち構えているぞ.」 + %E + %Cp Gek 00090 + Latest news regarding the Amulet Of Yendor? + #「イェンダーの魔除けの最新の情報は?」 + %E + %Cc Gek 00091 + "Now I see you with the Amulet Of Yendor shining brightly in your + pack. Honestly, I didn't believe you'd (or anyone else, for that + matter) would manage to tear it from the hands of Moloch. + + Your way is up now, back to the first level of the Dungeon, and + beyond there. You now must leave the dungeon as you've entered + it. + + Then you will get to four planes, dedicated to the four arcane elements + of earth, air, fire and water. If thou successfully pass all these, + you will eventually reach the stars (or astra, as the Greek called + them). This is where the sacred High Temples of the aligned gods + are located. + + Return the amulet to %d at His altar, and you will be richly rewarded." + #「君の鞄からイェンダーの魔除けが明るく輝いているのが見える.白状すると + # 君が,いや,他の誰であれ,モーロックの手からこれをもぎ取ってくるとは + # 信じていなかったよ. + # + # 君はこれから上に向かい,迷宮の1階からさらに進むのだ.そして入ってき + # たのと同じように迷宮を出るのだ. + # + # そうすると,君は古代の四大元素である地水火風の4つの世界に対峙するこ + # とになる.君が見事全てを通過できれば,星界,ギリシャ人の言うアストラ + # ル界に至ることとなろう.そここそ,神々の聖なる大神殿がある地なのだ」 + # + %E + + # # Healer # %Cc Hea 00001 *************** *** 4948,4954 **** --- 5339,5374 ---- %Cc - 00151 King of Rings. %E + # + # GEEK + # + %Cc - 09999 + You read the following text in the Nethack sources ... + #NetHack のソースには,こんなことが書いてあった... + + + boolean + revive_nasty(x, y, msg) + int x,y; + const char *msg; + { + register struct obj *otmp, *otmp2; + struct monst *mtmp; + coord cc; + boolean revived = FALSE; + + /* prevent freeobj() of revivable corpses */ + for(otmp = level.objects[x][y]; otmp; otmp = otmp2) { + otmp2 = otmp->nexthere; + if (otmp->otyp == CORPSE && + (is_rider(&mons[otmp->corpsenm]) || + otmp->corpsenm == PM_WIZARD_OF_YENDOR)) { + /* move any living monster already at that location */ + if((mtmp = m_at(x,y)) && enexto(&cc, x, y, mtmp->data)) + ... and so on + #...以下略 + %E # # TEST PATTERN # diff -rN -c slashem-0.0.7E7F2/dat/tng.des geekslashem-0.0.7E7F2/dat/tng.des *** slashem-0.0.7E7F2/dat/tng.des 1970-01-01 09:00:00.000000000 +0900 --- geekslashem-0.0.7E7F2/dat/tng.des 2006-04-30 01:00:31.000000000 +0900 *************** *** 0 **** --- 1,558 ---- + # + # ... and finally: a school + # It is probably no coincidence that it is in hell :-) + # + # I had to comment out many pupils - weird things seem to happen when + # there are more than 127 monsters (lev_comp bug/feature ?) + + MAZE: "school", ' ' + MESSAGE: "You feel reminded of your days of learning ..." + #MESSAGE: "あなたは学問に励んだ頃を思い出した..." + GEOMETRY: center,center + + # 1 2 3 4 5 6 7 + # 23456789012345678901234567890123456789012345678901234567890123456789012345 + MAP + |--| |-------|-----|-----|-----|-----|-----|-----|-----|-----|------| + |..+########+.......|.....|.....|.....|.....|.....|.....|.....|.....|......| + |--| |.......|.....|.....|.....|.....|.....|.....|.....|.....|......| + |.......|.....|.....|.....|.....|.....|.....|.....|.....|......| + #######+.......|--+--|--+--|--+--|--+--|--+--|--+--|--+--|--+--|--+---| + # |..............................................................| + # |..............................................................| + # |.......|--+--|--+--|--+--|--+--|--+--|--+--|--+--|--+--|--+---| + |----+----| |.......|.....|.....|.....|.....|.....|.....|.....|.....|......| + |.........| |.......|.....|.....|.....|.....|.....|.....|.....|.....|......| + |.........| |.......|.....|.....|.....|.....|.....|.....|.....|.....|......| + |.........| |.......|-----|-----|-----|-----|-----|-----|-----|-----|------| + |.........| |..............................................................| + |.........| |..............................................................| + |.........| |.......|--+----------------------------+--|--+----------------| + |.........| |.......|..................................|...................| + |.........| |.......|..................................+...................| + |.........| |.......|..................................|...............\...| + |.........| |.......|..................................|...................| + |---------| |--------------------------------------------------------------| + ENDMAP + + # the antechamber + REGION:(01,01,02,01),unlit,"ordinary" + # the actual school + REGION:(13,01,74,18),lit,"ordinary" + # the gym + REGION:(01,09,09,18),lit,"ordinary" + + # Stairs: up in the antechamber, down behind the principal's throne + STAIR:(01,01),up + #STAIR:(72,17),down + + # main doors + DOOR:locked,(12,01) + DOOR:locked,(12,04) + # the classes + DOOR:locked,(23,04) + DOOR:locked,(29,04) + DOOR:locked,(35,04) + DOOR:locked,(41,04) + DOOR:locked,(47,04) + DOOR:locked,(53,04) + DOOR:locked,(59,04) + DOOR:locked,(65,04) + DOOR:locked,(71,04) + DOOR:locked,(23,07) + DOOR:locked,(29,07) + DOOR:locked,(35,07) + DOOR:locked,(41,07) + DOOR:locked,(47,07) + DOOR:locked,(53,07) + DOOR:locked,(59,07) + DOOR:locked,(65,07) + DOOR:locked,(71,07) + # the Teacher's Room + DOOR:locked,(23,14) + DOOR:locked,(52,14) + # the Principal's Office + DOOR:locked,(58,14) + DOOR:locked,(55,16) + # the Gym + DOOR:locked,(05,08) + + # Engravings: the classes and other rooms + ENGRAVING:(23,05),burn,"C101" + ENGRAVING:(29,05),burn,"C102" + ENGRAVING:(35,05),burn,"C103" + ENGRAVING:(41,05),burn,"C104" + ENGRAVING:(47,05),burn,"C105" + ENGRAVING:(53,05),burn,"C106" + ENGRAVING:(59,05),burn,"C107" + ENGRAVING:(65,05),burn,"C108" + ENGRAVING:(71,05),burn,"C109" + ENGRAVING:(23,06),burn,"C201" + ENGRAVING:(29,06),burn,"C202" + ENGRAVING:(35,06),burn,"C203" + ENGRAVING:(41,06),burn,"C204" + ENGRAVING:(47,06),burn,"Library" + #ENGRAVING:(47,06),burn,"図書室" + ENGRAVING:(53,06),burn,"B111 (Biology)" + #ENGRAVING:(53,06),burn,"B111 (生物講義室)" + ENGRAVING:(59,06),burn,"B115 (Chemical Storage)" + #ENGRAVING:(59,06),burn,"B115 (薬品庫)" + ENGRAVING:(65,06),burn,"B116 (Chemistry)" + #ENGRAVING:(65,06),burn,"B116 (化学講義室)" + ENGRAVING:(71,06),burn,"C311 (Computers)" + #ENGRAVING:(71,06),burn,"C311 (計算機室)" + ENGRAVING:(23,13),burn,"Teacher's Room" + #ENGRAVING:(23,13),burn,"職員室" + ENGRAVING:(52,13),burn,"Teacher's Room" + #ENGRAVING:(52,13),burn,"職員室" + ENGRAVING:(58,13),burn,"Principal's Office" + #ENGRAVING:(58,13),burn,"校長室" + ENGRAVING:(05,07),burn,"Abandon all hope, ye who enter here!" + #ENGRAVING:(05,07),burn,"ここへ立ち入る者,全ての望みを捨てよ!" + ENGRAVING:(11,01),burn,"KILLER HIGH SCHOOL" + #ENGRAVING:(11,01),burn,"殺人ハイスクール" + + # Room C101, in memorial of my old kind but tough English teacher + # Mr. Baumert + # + MONSTER:'@',"teacher",(23,03),"Mr. Baumert",peaceful + MONSTER:'@',"pupil",(21,01) + MONSTER:'@',"pupil",(22,01) + MONSTER:'@',"pupil",(23,01) + MONSTER:'@',"pupil",(24,01) + # MONSTER:'@',"pupil",(25,01) + # MONSTER:'@',"pupil",(21,02) + # MONSTER:'@',"pupil",(22,02) + # MONSTER:'@',"pupil",(23,02) + # MONSTER:'@',"pupil",(24,02) + # MONSTER:'@',"pupil",(25,02) + # MONSTER:'@',"pupil",(21,03) + # MONSTER:'@',"pupil",(22,03) + # MONSTER:'@',"pupil",(24,03) + # MONSTER:'@',"pupil",(25,03) + + # Room C102, Mr. Gier. I have always loved his blasts of sleep. + # + MONSTER:'@',"teacher",(29,03),"Mr. Gier",hostile + MONSTER:'@',"pupil",(27,01) + MONSTER:'@',"pupil",(28,01) + MONSTER:'@',"pupil",(29,01) + MONSTER:'@',"pupil",(30,01) + MONSTER:'@',"pupil",(31,01) + # MONSTER:'@',"pupil",(27,02) + # MONSTER:'@',"pupil",(28,02) + # MONSTER:'@',"pupil",(29,02) + # MONSTER:'@',"pupil",(30,02) + # MONSTER:'@',"pupil",(31,02) + # MONSTER:'@',"pupil",(27,03) + # MONSTER:'@',"pupil",(28,03) + # MONSTER:'@',"pupil",(30,03) + # MONSTER:'@',"pupil",(31,03) + + # Room C103. Mrs. Dickler. Her capabilities in explaining maths + # were always of use. + # + MONSTER:'@',"teacher",(35,03),"Mrs. Dickler" + MONSTER:'@',"pupil",(33,01) + MONSTER:'@',"pupil",(34,01) + MONSTER:'@',"pupil",(35,01) + MONSTER:'@',"pupil",(36,01) + # MONSTER:'@',"pupil",(37,01) + # MONSTER:'@',"pupil",(33,02) + # MONSTER:'@',"pupil",(34,02) + # MONSTER:'@',"pupil",(35,02) + # MONSTER:'@',"pupil",(36,02) + # MONSTER:'@',"pupil",(37,02) + # MONSTER:'@',"pupil",(33,03) + # MONSTER:'@',"pupil",(34,03) + # MONSTER:'@',"pupil",(36,03) + # MONSTER:'@',"pupil",(37,03) + + # Room C104. Mrs. Wessel. Thank you for being so kind ... + MONSTER:'@',"teacher",(41,03),"Mrs. Wessel" + MONSTER:'@',"pupil",(39,01) + MONSTER:'@',"pupil",(40,01) + MONSTER:'@',"pupil",(41,01) + MONSTER:'@',"pupil",(42,01) + # MONSTER:'@',"pupil",(43,01) + # MONSTER:'@',"pupil",(39,02) + # MONSTER:'@',"pupil",(40,02) + # MONSTER:'@',"pupil",(41,02) + # MONSTER:'@',"pupil",(42,02) + # MONSTER:'@',"pupil",(43,02) + # MONSTER:'@',"pupil",(39,03) + # MONSTER:'@',"pupil",(40,03) + # MONSTER:'@',"pupil",(42,03) + # MONSTER:'@',"pupil",(43,03) + + # C105. Mr. Koerfgen - I have always loved your acid blasts + # Guess why there are so many corpses here :-) + # + MONSTER:'@',"teacher",(47,03),"Mr. Koerfgen",hostile + # OBJECT:'/',"acid",(47,03) + # + OBJECT:'/',"magic missile",(47,03) + MONSTER:'@',"pupil",(45,01) + OBJECT:'%',"corpse",(46,01),"pupil",0 + MONSTER:'@',"pupil",(47,01) + OBJECT:'%',"corpse",(48,01),"pupil",0 + MONSTER:'@',"pupil",(49,01) + OBJECT:'%',"corpse",(45,02),"pupil",0 + # MONSTER:'@',"pupil",(46,02) + OBJECT:'%',"corpse",(47,02),"pupil",0 + # MONSTER:'@',"pupil",(48,02) + OBJECT:'%',"corpse",(49,02),"pupil",0 + # MONSTER:'@',"pupil",(45,03) + OBJECT:'%',"corpse",(46,03),"pupil",0 + # MONSTER:'@',"pupil",(48,03) + OBJECT:'%',"corpse",(49,03),"pupil",0 + + # C106 is the residence of Mr. Schuster. + MONSTER:'@',"teacher",(53,03),"Mr. Schuster" + MONSTER:'@',"pupil",(51,01) + MONSTER:'@',"pupil",(52,01) + MONSTER:'@',"pupil",(53,01) + MONSTER:'@',"pupil",(54,01) + MONSTER:'@',"pupil",(55,01) + # MONSTER:'@',"pupil",(51,02) + # MONSTER:'@',"pupil",(52,02) + # MONSTER:'@',"pupil",(53,02) + # MONSTER:'@',"pupil",(54,02) + # MONSTER:'@',"pupil",(55,02) + # MONSTER:'@',"pupil",(51,03) + # MONSTER:'@',"pupil",(52,03) + # MONSTER:'@',"pupil",(54,03) + # MONSTER:'@',"pupil",(55,03) + + # The room C107 is dedicated to the memorial of Mr. Marre who + # perhaps was the most amusing and kind teacher known to mankind ... + MONSTER:'@',"teacher",(53,03),"Mr. Marre",peaceful + MONSTER:'@',"pupil",(51,01) + MONSTER:'@',"pupil",(52,01) + MONSTER:'@',"pupil",(53,01) + MONSTER:'@',"pupil",(54,01) + MONSTER:'@',"pupil",(55,01) + MONSTER:'@',"pupil",(51,02) + MONSTER:'@',"pupil",(52,02) + # MONSTER:'@',"pupil",(53,02) + # MONSTER:'@',"pupil",(54,02) + # MONSTER:'@',"pupil",(55,02) + # MONSTER:'@',"pupil",(51,03) + # MONSTER:'@',"pupil",(52,03) + # MONSTER:'@',"pupil",(54,03) + # MONSTER:'@',"pupil",(55,03) + + # Room C108 is the torture chamber of another funny chemistry teacher, + # Mr. Ennen + MONSTER:'@',"teacher",(65,03),"Mr. Ennen" + MONSTER:'@',"pupil",(63,01) + MONSTER:'@',"pupil",(64,01) + MONSTER:'@',"pupil",(65,01) + MONSTER:'@',"pupil",(66,01) + MONSTER:'@',"pupil",(67,01) + MONSTER:'@',"pupil",(63,02) + # MONSTER:'@',"pupil",(64,02) + # MONSTER:'@',"pupil",(65,02) + # MONSTER:'@',"pupil",(66,02) + # MONSTER:'@',"pupil",(67,02) + # MONSTER:'@',"pupil",(63,03) + # MONSTER:'@',"pupil",(64,03) + # MONSTER:'@',"pupil",(66,03) + # MONSTER:'@',"pupil",(67,03) + + # Room C109 is dedicated to Mr. Lewald, our former principal who was + # so kind to all - perhaps too kind ... + # Should me make him a principal in MONSTER: or not? + MONSTER:'@',"teacher",(71,03),"Mr. Lewald" + MONSTER:'@',"pupil",(69,01) + MONSTER:'@',"pupil",(70,01) + MONSTER:'@',"pupil",(71,01) + MONSTER:'@',"pupil",(72,01) + MONSTER:'@',"pupil",(73,01) + # MONSTER:'@',"pupil",(74,01) + # MONSTER:'@',"pupil",(69,02) + # MONSTER:'@',"pupil",(70,02) + # MONSTER:'@',"pupil",(71,02) + # MONSTER:'@',"pupil",(72,02) + # MONSTER:'@',"pupil",(73,02) + # MONSTER:'@',"pupil",(74,02) + # MONSTER:'@',"pupil",(69,03) + # MONSTER:'@',"pupil",(70,03) + # MONSTER:'@',"pupil",(72,03) + # MONSTER:'@',"pupil",(73,03) + # MONSTER:'@',"pupil",(74,03) + + # Room C201 - Mr. Bitterberg + # Mr. Bitterberg, should you ever read this, I congratulate you for finally + # being convinced to use The One True Operating System, UNIX, and The One + # True Computer Game, Nethack. + MONSTER:'@',"teacher",(23,08),"Mr. Bitterberg" + MONSTER:'@',"pupil",(21,08) + MONSTER:'@',"pupil",(22,08) + MONSTER:'@',"pupil",(24,08) + # MONSTER:'@',"pupil",(25,08) + # MONSTER:'@',"pupil",(21,09) + # MONSTER:'@',"pupil",(22,09) + # MONSTER:'@',"pupil",(23,09) + # MONSTER:'@',"pupil",(24,09) + # MONSTER:'@',"pupil",(25,09) + # MONSTER:'@',"pupil",(21,10) + # MONSTER:'@',"pupil",(22,10) + # MONSTER:'@',"pupil",(23,10) + # MONSTER:'@',"pupil",(24,10) + # MONSTER:'@',"pupil",(25,10) + + # Room C202 - Mr. Ellerhold + # He teaches Music, yet he is the most demanding teacher of the whole + # school, much to the dislike of the pupils (and that's the reason + # why there are so few pupils left). + MONSTER:'@',"teacher",(29,08),"Mr. Ellerhold" + MONSTER:'@',"pupil",(27,08) + MONSTER:'@',"pupil",(28,08) + + # Room C203 - Mr. Hartstone + # He is very funny, in fact he is the teacher most entertaining to listen + # to ... + MONSTER:'@',"teacher",(35,08),"Mr. Hartstone",peaceful + MONSTER:'@',"pupil",(33,08) + MONSTER:'@',"pupil",(34,08) + MONSTER:'@',"pupil",(36,08) + MONSTER:'@',"pupil",(37,08) + MONSTER:'@',"pupil",(33,09) + MONSTER:'@',"pupil",(34,09) + # MONSTER:'@',"pupil",(35,09) + # MONSTER:'@',"pupil",(36,09) + # MONSTER:'@',"pupil",(37,09) + # MONSTER:'@',"pupil",(33,10) + # MONSTER:'@',"pupil",(34,10) + # MONSTER:'@',"pupil",(35,10) + # MONSTER:'@',"pupil",(36,10) + # MONSTER:'@',"pupil",(37,10) + + # Room C204 - Mrs. Ludwig. She is one (perhaps the only) exception to + # the rule regarding PE teachers stated below ... + MONSTER:'@',"teacher",(41,08),"Mrs. Ludwig",peaceful + MONSTER:'@',"pupil",(39,08) + MONSTER:'@',"pupil",(40,08) + MONSTER:'@',"pupil",(42,08) + MONSTER:'@',"pupil",(43,08) + MONSTER:'@',"pupil",(39,09) + MONSTER:'@',"pupil",(40,09) + # MONSTER:'@',"pupil",(41,09) + # MONSTER:'@',"pupil",(42,09) + # MONSTER:'@',"pupil",(43,09) + # MONSTER:'@',"pupil",(39,10) + # MONSTER:'@',"pupil",(40,10) + # MONSTER:'@',"pupil",(41,10) + # MONSTER:'@',"pupil",(42,10) + # MONSTER:'@',"pupil",(43,10) + + # The library, also the residence of Mrs. Meurer + MONSTER:'@',"teacher",(47,08),"Mrs. Meurer" + OBJECT:'?',random,(45,08) + OBJECT:'?',random,(46,08) + OBJECT:'+',random,(47,08) + OBJECT:'?',random,(48,08) + OBJECT:'?',random,(49,08) + OBJECT:'?',random,(45,09) + OBJECT:'?',random,(46,09) + OBJECT:'+',random,(47,09) + OBJECT:'?',random,(48,09) + OBJECT:'?',random,(49,09) + OBJECT:'?',random,(45,10) + OBJECT:'?',random,(46,10) + OBJECT:'+',random,(47,10) + OBJECT:'?',random,(48,10) + OBJECT:'?',random,(49,10) + + # The biology room (B111), occupied by Mr. Overbeck, who always was + # kind and always had time for a joke + # Mr. Overbeck is not peaceful - so let's have fun with polymorph ... + # + MONSTER:'@',"teacher",(53,08),"Mrs. Overbeck" + OBJECT:'/',"polymorph",(53,08),cursed,0,"The wand of hatred" + # He has a wand of polymorph and always was *very* generous in its usage ... + # the following are the (former) pupils. + MONSTER:random,random,(51,08) + MONSTER:random,random,(52,08) + MONSTER:random,random,(54,08) + MONSTER:random,random,(55,08) + MONSTER:random,random,(51,09) + MONSTER:random,random,(52,09) + MONSTER:random,random,(53,09) + # MONSTER:random,random,(54,09) + # MONSTER:random,random,(55,09) + # MONSTER:random,random,(51,10) + # MONSTER:random,random,(52,10) + # MONSTER:random,random,(53,10) + # MONSTER:random,random,(54,10) + # MONSTER:random,random,(55,10) + + # The chemical storage (B115) + OBJECT:'!',random,(57,08) + OBJECT:'!',random,(58,08) + OBJECT:'!',random,(59,08) + OBJECT:'!',random,(60,08) + OBJECT:'!',random,(61,08) + OBJECT:'!',random,(57,09) + OBJECT:'!',random,(58,09) + OBJECT:'!',random,(59,09) + OBJECT:'!',random,(60,09) + OBJECT:'!',random,(61,09) + OBJECT:'!',random,(57,10) + OBJECT:'!',random,(58,10) + OBJECT:'!',random,(59,10) + OBJECT:'!',random,(60,10) + OBJECT:'!',random,(61,10) + + # The chemistry room (B116) is occupied by Mr. Klomp, the teacher I believe to + # be most balanced between teaching, kindness and humour. + MONSTER:'@',"teacher",(65,08),"Mr. Klomp",peaceful + MONSTER:'@',"pupil",(63,08) + MONSTER:'@',"pupil",(64,08) + MONSTER:'@',"pupil",(66,08) + MONSTER:'@',"pupil",(67,08) + MONSTER:'@',"pupil",(63,09) + MONSTER:'@',"pupil",(64,09) + MONSTER:'@',"pupil",(65,09) + # MONSTER:'@',"pupil",(66,09) + # MONSTER:'@',"pupil",(67,09) + # MONSTER:'@',"pupil",(63,10) + # MONSTER:'@',"pupil",(64,10) + # MONSTER:'@',"pupil",(65,10) + # MONSTER:'@',"pupil",(66,10) + # MONSTER:'@',"pupil",(67,10) + + # The computer room (C311), and, with it, Mr. Alers + MONSTER:'@',"teacher",(71,08),"Mr. Alers",peaceful + MONSTER:'@',"pupil",(69,08) + MONSTER:'@',"pupil",(70,08) + MONSTER:'@',"pupil",(72,08) + MONSTER:'@',"pupil",(73,08) + MONSTER:'@',"pupil",(74,08) + MONSTER:'@',"pupil",(69,09) + MONSTER:'@',"pupil",(70,09) + MONSTER:'@',"pupil",(71,09) + MONSTER:'@',"pupil",(72,09) + # MONSTER:'@',"pupil",(73,09) + # MONSTER:'@',"pupil",(74,09) + # MONSTER:'@',"pupil",(69,10) + # MONSTER:'@',"pupil",(70,10) + # MONSTER:'@',"pupil",(71,10) + # MONSTER:'@',"pupil",(72,10) + # MONSTER:'@',"pupil",(73,10) + # MONSTER:'@',"pupil",(74,08) + OBJECT:'(',"pack of floppies",(69,08) + OBJECT:'(',"pack of floppies",(70,08) + OBJECT:'(',"pack of floppies",(71,08) + OBJECT:'(',"pack of floppies",(72,08) + OBJECT:'(',"pack of floppies",(73,08) + OBJECT:'(',"pack of floppies",(74,08) + OBJECT:'(',"pack of floppies",(69,09) + OBJECT:'(',"pack of floppies",(70,09) + OBJECT:'(',"pack of floppies",(71,09) + OBJECT:'(',"pack of floppies",(72,09) + OBJECT:'(',"pack of floppies",(73,09) + OBJECT:'(',"pack of floppies",(74,09) + OBJECT:'(',"pack of floppies",(69,10) + OBJECT:'(',"pack of floppies",(70,10) + OBJECT:'(',"pack of floppies",(71,10) + OBJECT:'(',"pack of floppies",(72,10) + OBJECT:'(',"pack of floppies",(73,10) + OBJECT:'(',"pack of floppies",(74,10) + + # the Teacher's Room + MONSTER:'@',"teacher",(30,16),"Mr. Biciste" + + # the Principal + MONSTER:'@',"principal",(71,17),"Mr. Gemein" + # [Iwakiri] + # Diploma isn't considered as a passport to job nowadays :( + # + #OBJECT:'?',"gold detection",(71,17),blessed,0,"Diploma" + OBJECT:'?',"blank paper",(71,17),blessed,0,"Diploma" + #OBJECT:'?',"skill up",(71,17),blessed,0,"卒業証書" + + # the Gym + # it contains such crap as Mr. Geis and Mrs. Haastert + # Remember the old rule that all PE teachers are sadists. + # (with very few exceptions) + MONSTER:'@',"teacher",(02,12),"Mr. Geis" + MONSTER:'@',"teacher",(08,15),"Mrs. Haastert" + MONSTER:'@',"pupil",(01,09) + MONSTER:'@',"pupil",(02,10) + MONSTER:'@',"pupil",(03,11) + MONSTER:'@',"pupil",(04,12) + MONSTER:'@',"pupil",(05,13) + MONSTER:'@',"pupil",(06,14) + MONSTER:'@',"pupil",(07,15) + MONSTER:'@',"pupil",(08,16) + MONSTER:'@',"pupil",(09,17) + # MONSTER:'@',"pupil",(01,18) + # MONSTER:'@',"pupil",(02,09) + # MONSTER:'@',"pupil",(01,10) + # MONSTER:'@',"pupil",(01,11) + # MONSTER:'@',"pupil",(01,12) + # MONSTER:'@',"pupil",(01,13) + # This is the ultimate fate of those addicted to sports ... + MONSTER:'Z',"human zombie",(01,14) + MONSTER:'Z',"human zombie",(01,15) + MONSTER:'Z',"human zombie",(01,16) + MONSTER:'Z',"human zombie",(01,17) + MONSTER:'Z',"skeleton",(01,18) + + # The Computer Land + MAZE: "computer", ' ' + GEOMETRY: center,center + # 1 2 3 4 5 6 7 + # 23456789012345678901234567890123456789012345678901234567890123456789012345 + MAP + |--------------------------------------------------------------------------| + |....|.....................................................................| + |-+--|.....................................................................| + |..........................................................................| + |..........................................................................| + |..........................................................................| + |..........................................................................| + |..........................................................................| + |..........................................................................| + |..........................................................................| + |..........................................................................| + |..........................................................................| + |..........................................................................| + |..........................................................................| + |..........................................................................| + |..........................................................................| + |..........................................................................| + |.....................................................................|--+-| + |.....................................................................|....| + |--------------------------------------------------------------------------| + ENDMAP + + DOOR:locked,(02,02) + STAIR:(01,01),up + DOOR:locked,(73,17) + #STAIR:(74,18),down + + MONSTER:'x',"PDP-9",random + MONSTER:'x',"PDP-11",random + MONSTER:'x',"VAX",random + MONSTER:'x',"Cray",random + MONSTER:'&',"news daemon",random + MONSTER:'&',"printer daemon",random + MONSTER:'&',"UNIX Kernel",random + + MONSTER:'x',"bug",random + MONSTER:'x',"bug",random + MONSTER:'x',"bug",random + MONSTER:'x',"bug",random + MONSTER:'x',"bug",random + MONSTER:'x',"bug",random + MONSTER:'x',"heisenbug",random + MONSTER:'x',"heisenbug",random + + OBJECT:'=',"timely backup",random + OBJECT:'?',"root password detection",random + OBJECT:'"',"amulet of data storage",random + OBJECT:'/',"bugging",random + diff -rN -c slashem-0.0.7E7F2/include/artifact.h geekslashem-0.0.7E7F2/include/artifact.h *** slashem-0.0.7E7F2/include/artifact.h 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/include/artifact.h 2006-04-20 22:51:55.000000000 +0900 *************** *** 34,39 **** --- 34,44 ---- #define SPFX_XRAY 0x2000000L /* gives X-RAY vision to player */ #define SPFX_REFLECT 0x4000000L /* Reflection */ + #ifdef GEEK + #define SPFX_PROTEC 0x8000000L /* protects you if worn (+2 to AC) */ + #define SPFX_TOUCH 0x10000000L /* artifact doesn't care if touched */ + #endif + #define SPFX_DBONUS 0x1F00000L /* attack bonus mask */ struct artifact { *************** *** 70,73 **** --- 75,83 ---- #define SUMMON_WATER_ELEMENTAL (LAST_PROP+15) #define OBJ_DETECTION (LAST_PROP+16) + #ifdef GEEK + #define IDENTIFY (LAST_PROP+17) + #define DRAGON_BREATH (LAST_PROP+18) + #endif + #endif /* ARTIFACT_H */ diff -rN -c slashem-0.0.7E7F2/include/artilist.h geekslashem-0.0.7E7F2/include/artilist.h *** slashem-0.0.7E7F2/include/artilist.h 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/include/artilist.h 2006-04-29 22:47:52.000000000 +0900 *************** *** 44,49 **** --- 44,51 ---- * 2. By weapon class (skill). */ + /* [Iwakiri] added geek ones at last */ + /* dummy element #0, so that all interesting indices are non-zero */ A("", STRANGE_OBJECT, 0, 0, 0, NO_ATTK, NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 0L ), *************** *** 427,432 **** --- 429,459 ---- 0, A_LAWFUL, PM_YEOMAN, NON_PM, 5000L ), #endif + #ifdef GEEK + /* + A("Scales of the Dragon Lord", GRAY_DRAGON_SCALE_MAIL, + (SPFX_NOGEN|SPFX_RESTR|SPFX_PROTEC), 0, 0, + NO_ATTK, NO_DFNS, NO_CARY, DRAGON_BREATH, A_CHAOTIC, NON_PM, NON_PM, 3000L ), + */ + A("The Burned Moth Relay", RELAY, + (SPFX_RESTR), SPFX_PROTEC, 0, + NO_ATTK, NO_DFNS, NO_CARY, 0, A_NEUTRAL, PM_GEEK, NON_PM, 100L ), + /* + A("Wand Of Might", WAN_WISHING, + (SPFX_RESTR|SPFX_TOUCH), 0, 0, + NO_ATTK, NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 500L ), + + A("The Key Of Access", SKELETON_KEY, + (SPFX_RESTR|SPFX_NOGEN), 0, 0, + NO_ATTK, NO_DFNS, NO_CARY, CREATE_PORTAL, A_NONE, NON_PM, NON_PM, 4000L ), + */ + A("The NetHack Sources", PACK_OF_FLOPPIES, + (SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL), + (SPFX_SEARCH | SPFX_ESP | SPFX_REGEN), 0, + NO_ATTK, NO_DFNS, NO_CARY, + IDENTIFY, A_NEUTRAL, PM_GEEK, NON_PM, 5000L ), + + #endif /* GEEK */ /* * terminator; otyp must be zero */ diff -rN -c slashem-0.0.7E7F2/include/config.h geekslashem-0.0.7E7F2/include/config.h *** slashem-0.0.7E7F2/include/config.h 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/include/config.h 2006-04-30 00:33:46.000000000 +0900 *************** *** 410,415 **** --- 410,422 ---- #define DWARF /* Dwarf Patch, Osku Salerma (osku@iki.fi) */ #define TOURIST /* Tourist players with cameras and Hawaiian shirts */ #define YEOMAN /* KMH -- Yeoman class */ + #define GEEK /* [Iwakiri] -- Geek class with some objects and monsters from TNG */ + + #ifdef GEEK + # ifndef LIGHTSABERS + # define LIGHTSABERS + # endif + #endif /* #define ZOUTHERN */ /* KMH -- Zoutherner class and its animals */ /* I/O */ diff -rN -c slashem-0.0.7E7F2/include/dgn_comp.h geekslashem-0.0.7E7F2/include/dgn_comp.h *** slashem-0.0.7E7F2/include/dgn_comp.h 1970-01-01 09:00:00.000000000 +0900 --- geekslashem-0.0.7E7F2/include/dgn_comp.h 2006-04-22 15:48:37.000000000 +0900 *************** *** 0 **** --- 1,96 ---- + /* A Bison parser, made by GNU Bison 1.875d. */ + + /* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + /* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + + /* Tokens. */ + #ifndef YYTOKENTYPE + # define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + INTEGER = 258, + A_DUNGEON = 259, + BRANCH = 260, + CHBRANCH = 261, + LEVEL = 262, + RNDLEVEL = 263, + CHLEVEL = 264, + RNDCHLEVEL = 265, + UP_OR_DOWN = 266, + PROTOFILE = 267, + DESCRIPTION = 268, + DESCRIPTOR = 269, + LEVELDESC = 270, + ALIGNMENT = 271, + LEVALIGN = 272, + ENTRY = 273, + STAIR = 274, + NO_UP = 275, + NO_DOWN = 276, + PORTAL = 277, + STRING = 278 + }; + #endif + #define INTEGER 258 + #define A_DUNGEON 259 + #define BRANCH 260 + #define CHBRANCH 261 + #define LEVEL 262 + #define RNDLEVEL 263 + #define CHLEVEL 264 + #define RNDCHLEVEL 265 + #define UP_OR_DOWN 266 + #define PROTOFILE 267 + #define DESCRIPTION 268 + #define DESCRIPTOR 269 + #define LEVELDESC 270 + #define ALIGNMENT 271 + #define LEVALIGN 272 + #define ENTRY 273 + #define STAIR 274 + #define NO_UP 275 + #define NO_DOWN 276 + #define PORTAL 277 + #define STRING 278 + + + + + #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) + #line 67 "dgn_comp.y" + typedef union YYSTYPE { + int i; + char* str; + } YYSTYPE; + /* Line 1285 of yacc.c. */ + #line 88 "y.tab.h" + # define yystype YYSTYPE /* obsolescent; will be withdrawn */ + # define YYSTYPE_IS_DECLARED 1 + # define YYSTYPE_IS_TRIVIAL 1 + #endif + + extern YYSTYPE yylval; + + + diff -rN -c slashem-0.0.7E7F2/include/extern.h geekslashem-0.0.7E7F2/include/extern.h *** slashem-0.0.7E7F2/include/extern.h 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/include/extern.h 2006-04-22 01:52:49.000000000 +0900 *************** *** 50,55 **** --- 50,59 ---- E void FDECL(fig_transform, (genericptr_t, long)); E int FDECL(unfixable_trouble_count,(BOOLEAN_P)); E int FDECL(wand_explode, (struct obj *,BOOLEAN_P)); + #ifdef GEEK + E int NDECL(percent_success_chemistry); + E void FDECL(use_floppies, (struct obj *)); + #endif /* ### artifact.c ### */ *************** *** 88,93 **** --- 92,106 ---- E boolean FDECL(artifact_has_invprop, (struct obj *,UCHAR_P)); E long FDECL(arti_cost, (struct obj *)); + #ifdef GEEK + E boolean FDECL(nogen_nrartifact,(int artino)); + E boolean FDECL(exists_nrartifact,(int artino)); + E int FDECL(nrartifact_obtype,(int artino)); + E void FDECL(artifact_unexist, (struct obj *)); + E int FDECL(artifact_name2no, (const char *name)); + E void FDECL(artifact_unexist, (struct obj *)); + #endif + /* ### attrib.c ### */ E boolean FDECL(adjattrib, (int,int,int)); *************** *** 1886,1891 **** --- 1899,1917 ---- E void NDECL(free_dungeons); E void NDECL(freedynamicdata); + #ifdef GEEK + /* ### school.c ### */ + E boolean FDECL(is_principal, (struct monst *)); + E boolean FDECL(is_teacher, (struct monst *)); + E boolean FDECL(is_educator, (struct monst *)); + /*#ifdef SOUNDS*/ + # if 1 + E void FDECL(pupil_sound, (struct monst *)); + E void FDECL(teacher_sound, (struct monst *)); + E void FDECL(principal_sound, (struct monst *)); + # endif + #endif + /* ### shk.c ### */ #ifdef GOLDOBJ diff -rN -c slashem-0.0.7E7F2/include/hack.h geekslashem-0.0.7E7F2/include/hack.h *** slashem-0.0.7E7F2/include/hack.h 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/include/hack.h 2006-04-22 01:49:28.000000000 +0900 *************** *** 82,87 **** --- 82,88 ---- #define ESCAPED 15 #define ASCENDED 16 + #include "align.h" #include "dungeon.h" #include "monsym.h" diff -rN -c slashem-0.0.7E7F2/include/lev_comp.h geekslashem-0.0.7E7F2/include/lev_comp.h *** slashem-0.0.7E7F2/include/lev_comp.h 1970-01-01 09:00:00.000000000 +0900 --- geekslashem-0.0.7E7F2/include/lev_comp.h 2006-04-22 15:48:50.000000000 +0900 *************** *** 0 **** --- 1,203 ---- + /* A Bison parser, made by GNU Bison 1.875d. */ + + /* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + /* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + + /* Tokens. */ + #ifndef YYTOKENTYPE + # define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + CHAR = 258, + INTEGER = 259, + BOOLEAN = 260, + PERCENT = 261, + MESSAGE_ID = 262, + MAZE_ID = 263, + LEVEL_ID = 264, + LEV_INIT_ID = 265, + GEOMETRY_ID = 266, + NOMAP_ID = 267, + OBJECT_ID = 268, + COBJECT_ID = 269, + MONSTER_ID = 270, + TRAP_ID = 271, + DOOR_ID = 272, + DRAWBRIDGE_ID = 273, + MAZEWALK_ID = 274, + WALLIFY_ID = 275, + REGION_ID = 276, + FILLING = 277, + RANDOM_OBJECTS_ID = 278, + RANDOM_MONSTERS_ID = 279, + RANDOM_PLACES_ID = 280, + ALTAR_ID = 281, + LADDER_ID = 282, + STAIR_ID = 283, + NON_DIGGABLE_ID = 284, + NON_PASSWALL_ID = 285, + ROOM_ID = 286, + PORTAL_ID = 287, + TELEPRT_ID = 288, + BRANCH_ID = 289, + LEV = 290, + CHANCE_ID = 291, + CORRIDOR_ID = 292, + GOLD_ID = 293, + ENGRAVING_ID = 294, + FOUNTAIN_ID = 295, + POOL_ID = 296, + SINK_ID = 297, + NONE = 298, + RAND_CORRIDOR_ID = 299, + DOOR_STATE = 300, + LIGHT_STATE = 301, + CURSE_TYPE = 302, + ENGRAVING_TYPE = 303, + DIRECTION = 304, + RANDOM_TYPE = 305, + O_REGISTER = 306, + M_REGISTER = 307, + P_REGISTER = 308, + A_REGISTER = 309, + ALIGNMENT = 310, + LEFT_OR_RIGHT = 311, + CENTER = 312, + TOP_OR_BOT = 313, + ALTAR_TYPE = 314, + UP_OR_DOWN = 315, + SUBROOM_ID = 316, + NAME_ID = 317, + FLAGS_ID = 318, + FLAG_TYPE = 319, + MON_ATTITUDE = 320, + MON_ALERTNESS = 321, + MON_APPEARANCE = 322, + CONTAINED = 323, + OBJFLAG_TYPE = 324, + OBJFLAGS_ID = 325, + RANDOMREGION_ID = 326, + R_REGISTER = 327, + STRING = 328, + MAP_ID = 329 + }; + #endif + #define CHAR 258 + #define INTEGER 259 + #define BOOLEAN 260 + #define PERCENT 261 + #define MESSAGE_ID 262 + #define MAZE_ID 263 + #define LEVEL_ID 264 + #define LEV_INIT_ID 265 + #define GEOMETRY_ID 266 + #define NOMAP_ID 267 + #define OBJECT_ID 268 + #define COBJECT_ID 269 + #define MONSTER_ID 270 + #define TRAP_ID 271 + #define DOOR_ID 272 + #define DRAWBRIDGE_ID 273 + #define MAZEWALK_ID 274 + #define WALLIFY_ID 275 + #define REGION_ID 276 + #define FILLING 277 + #define RANDOM_OBJECTS_ID 278 + #define RANDOM_MONSTERS_ID 279 + #define RANDOM_PLACES_ID 280 + #define ALTAR_ID 281 + #define LADDER_ID 282 + #define STAIR_ID 283 + #define NON_DIGGABLE_ID 284 + #define NON_PASSWALL_ID 285 + #define ROOM_ID 286 + #define PORTAL_ID 287 + #define TELEPRT_ID 288 + #define BRANCH_ID 289 + #define LEV 290 + #define CHANCE_ID 291 + #define CORRIDOR_ID 292 + #define GOLD_ID 293 + #define ENGRAVING_ID 294 + #define FOUNTAIN_ID 295 + #define POOL_ID 296 + #define SINK_ID 297 + #define NONE 298 + #define RAND_CORRIDOR_ID 299 + #define DOOR_STATE 300 + #define LIGHT_STATE 301 + #define CURSE_TYPE 302 + #define ENGRAVING_TYPE 303 + #define DIRECTION 304 + #define RANDOM_TYPE 305 + #define O_REGISTER 306 + #define M_REGISTER 307 + #define P_REGISTER 308 + #define A_REGISTER 309 + #define ALIGNMENT 310 + #define LEFT_OR_RIGHT 311 + #define CENTER 312 + #define TOP_OR_BOT 313 + #define ALTAR_TYPE 314 + #define UP_OR_DOWN 315 + #define SUBROOM_ID 316 + #define NAME_ID 317 + #define FLAGS_ID 318 + #define FLAG_TYPE 319 + #define MON_ATTITUDE 320 + #define MON_ALERTNESS 321 + #define MON_APPEARANCE 322 + #define CONTAINED 323 + #define OBJFLAG_TYPE 324 + #define OBJFLAGS_ID 325 + #define RANDOMREGION_ID 326 + #define R_REGISTER 327 + #define STRING 328 + #define MAP_ID 329 + + + + + #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) + #line 135 "lev_comp.y" + typedef union YYSTYPE { + int i; + char* map; + struct { + xchar room; + xchar wall; + xchar door; + } corpos; + } YYSTYPE; + /* Line 1285 of yacc.c. */ + #line 195 "y.tab.h" + # define yystype YYSTYPE /* obsolescent; will be withdrawn */ + # define YYSTYPE_IS_DECLARED 1 + # define YYSTYPE_IS_TRIVIAL 1 + #endif + + extern YYSTYPE yylval; + + + diff -rN -c slashem-0.0.7E7F2/include/monattk.h geekslashem-0.0.7E7F2/include/monattk.h *** slashem-0.0.7E7F2/include/monattk.h 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/include/monattk.h 2006-04-26 00:20:14.000000000 +0900 *************** *** 26,31 **** --- 26,35 ---- #define AT_TENT 16 /* tentacles */ #define AT_MULTIPLY 17 /* RJ - multiplies (yes, it's an attack) */ + #ifdef GEEK + #define AT_TALK 42 /* talks (e.g. teacher)*/ + #endif + #define AT_WEAP 254 /* uses weapon */ #define AT_MAGC 255 /* uses magic spell(s) */ diff -rN -c slashem-0.0.7E7F2/include/monflag.h geekslashem-0.0.7E7F2/include/monflag.h *** slashem-0.0.7E7F2/include/monflag.h 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/include/monflag.h 2006-04-26 00:32:01.000000000 +0900 *************** *** 54,59 **** --- 54,65 ---- #define MS_COW 43 /* cows and bulls */ #define MS_PARROT 44 /* parrots */ + #ifdef GEEK + #define MS_PUPIL 96 + #define MS_TEACHER 97 + #define MS_PRINCIPAL 98 + #endif + #define MR_FIRE 0x01 /* resists fire */ #define MR_COLD 0x02 /* resists cold */ diff -rN -c slashem-0.0.7E7F2/include/obj.h geekslashem-0.0.7E7F2/include/obj.h *** slashem-0.0.7E7F2/include/obj.h 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/include/obj.h 2006-04-22 01:00:26.000000000 +0900 *************** *** 372,377 **** --- 372,384 ---- #define is_plural(o) ((o)->quan > 1 || \ (o)->oartifact == ART_EYES_OF_THE_OVERWORLD) + #ifdef GEEK + #define Is_comp_object(otmp) (otmp->otyp == RIN_TIMELY_BACKUP || \ + otmp->otyp == SCR_ROOT_PASSWORD_DETECTION || \ + otmp->otyp == AMULET_OF_DATA_STORAGE || \ + otmp->otyp == WAN_BUGGING) + #endif /* GEEK */ + /* Flags for get_obj_location(). */ #define CONTAINED_TOO 0x1 #define BURIED_TOO 0x2 diff -rN -c slashem-0.0.7E7F2/include/unixconf.h geekslashem-0.0.7E7F2/include/unixconf.h *** slashem-0.0.7E7F2/include/unixconf.h 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/include/unixconf.h 2006-04-30 00:52:51.000000000 +0900 *************** *** 33,39 **** /* define any of the following that are appropriate */ ! #define SVR4 /* use in addition to SYSV for System V Release 4 */ /* including Solaris 2+ */ #define NETWORK /* if running on a networked system */ /* e.g. Suns sharing a playground through NFS */ --- 33,39 ---- /* define any of the following that are appropriate */ ! /* #define SVR4 */ /* use in addition to SYSV for System V Release 4 */ /* including Solaris 2+ */ #define NETWORK /* if running on a networked system */ /* e.g. Suns sharing a playground through NFS */ diff -rN -c slashem-0.0.7E7F2/include/you.h geekslashem-0.0.7E7F2/include/you.h *** slashem-0.0.7E7F2/include/you.h 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/include/you.h 2006-04-23 00:22:01.000000000 +0900 *************** *** 349,354 **** --- 349,357 ---- int ugangr; /* if the gods are angry at you */ int ugifts; /* number of artifacts bestowed */ int ublessed, ublesscnt; /* blessing/duration from #pray */ + #ifdef GEEK + int uprotected; /* [Iwakiri] protection from artifact */ + #endif /* GEEK */ #ifdef NOARTIFACTWISH int usacrifice; /* number of sacrifices so far */ #endif diff -rN -c slashem-0.0.7E7F2/src/apply.c geekslashem-0.0.7E7F2/src/apply.c *** slashem-0.0.7E7F2/src/apply.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/apply.c 2006-04-30 00:53:53.000000000 +0900 *************** *** 2028,2033 **** --- 2028,2078 ---- update_inventory(); } + #ifdef GEEK + void + use_floppies(obj) + struct obj *obj; + { + char *softwares[] = { + "Microsoft Windows 3.1", + "Bill Gates", + "Leisure Suit Larry V", + "LINUX 1.00", + "your NetHack patches", + "nothing of importance" + }; + int x; + + if (pl_character[0] != 'G') { + pline("If only you knew what the heck this is ... "); + return; + } + + pline("Due to years of experience with computers, you can read the"); + pline("disks' contents by merely looking at the magnetic surface ..."); + + if (Blind) { + pline("Yet, without seeing, not even you can read anyting."); + return; + } + + if (obj->oartifact == ART_NETHACK_SOURCES) { + com_pager(9999); + } + + else { + x = rn2(sizeof(softwares) / sizeof(softwares[0])); + pline("You see %s on the disk",softwares[x]); + if (x == 0) { /* Windows */ + pline("You shriek in pain!"); + make_confused(HConfusion+rn2(50)+50,TRUE); + } else if (x == 1) { /* Bill Gates */ + pline("You feel horrible!"); + /* nothing happens (yet ...) */ + } + } + } + #endif /* GEEK */ static struct trapinfo { struct obj *tobj; xchar tx, ty; *************** *** 3328,3333 **** --- 3373,3383 ---- /* u.ux,u.uy creates it near you--x,y might create it in rock */ (void) makemon((struct permonst *)0, u.ux, u.uy, NO_MM_FLAGS); continue; + #ifdef GEEK + } else if(obj->otyp == WAN_BUGGING) { + (void) makemon(&mons[rn2(3) ? PM_BUG : PM_HEISENBUG], u.ux, u.uy, NO_MM_FLAGS); + continue; + #endif /* GEEK */ } else { if (x == u.ux && y == u.uy) { /* teleport objects first to avoid race with tele control and *************** *** 3803,3808 **** --- 3853,3877 ---- light_cocktail(obj); break; #endif + #ifdef GEEK + case RELAY: + if (obj->oartifact == ART_BURNED_MOTH_RELAY) { + pline("There's a little badly burned moth in that relay!"); + makeknown(RELAY); + if (pl_character[0] == 'G') { + You("feel remembered of %s.",Hallucination ? "when the net was flat" : "the old times"); + break; + } + } /* fall through */ + case DIODE: + case TRANSISTOR: + case IC: + pline("You don't understand anything about electronics !!!"); + break; + case PACK_OF_FLOPPIES: + use_floppies(obj); + break; + #endif /* GEEK */ default: /* KMH, balance patch -- polearms can strike at a distance */ if (is_pole(obj)) { diff -rN -c slashem-0.0.7E7F2/src/artifact.c geekslashem-0.0.7E7F2/src/artifact.c *** slashem-0.0.7E7F2/src/artifact.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/artifact.c 2006-04-22 23:40:36.000000000 +0900 *************** *** 603,609 **** if (on) EReflecting |= wp_mask; else EReflecting &= ~wp_mask; } ! if(wp_mask == W_ART && !on && oart->inv_prop) { /* might have to turn off invoked power too */ if (oart->inv_prop <= LAST_PROP && --- 603,617 ---- if (on) EReflecting |= wp_mask; else EReflecting &= ~wp_mask; } ! #ifdef GEEK ! if (spfx & SPFX_PROTEC) { ! if (on) { ! u.uprotected += 2; ! } else { ! u.uprotected -= 2; ! } ! } ! #endif /* GEEK */ if(wp_mask == W_ART && !on && oart->inv_prop) { /* might have to turn off invoked power too */ if (oart->inv_prop <= LAST_PROP && *************** *** 1506,1511 **** --- 1514,1529 ---- (void) seffects(&pseudo); break; } + #ifdef GEEK + case IDENTIFY: { + struct obj *pseudo = mksobj(SPE_IDENTIFY, FALSE, FALSE); + pseudo->blessed = pseudo->cursed = 0; + pseudo->quan = 42L; /* do not let useup get it */ + (void) seffects(pseudo); + obfree(pseudo, (struct obj *) 0); + break; + } + #endif /* GEEK */ case HEALING: { int healamt = (u.uhpmax + 1 - u.uhp) / 2; long creamed = (long)u.ucreamed; diff -rN -c slashem-0.0.7E7F2/src/attrib.c geekslashem-0.0.7E7F2/src/attrib.c *** slashem-0.0.7E7F2/src/attrib.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/attrib.c 2006-04-28 00:06:45.000000000 +0900 *************** *** 47,53 **** hea_abil[] = { { 1, &(HPoison_resistance), "", "" }, { 15, &(HWarning), "sensitive", "" }, { 0, 0, 0, 0 } }, ! ice_abil[] = { { 1, &(HCold_resistance), "", "" }, { 13, &(HFire_resistance), "cool", "warmer" }, { 0, 0, 0, 0 } }, --- 47,60 ---- hea_abil[] = { { 1, &(HPoison_resistance), "", "" }, { 15, &(HWarning), "sensitive", "" }, { 0, 0, 0, 0 } }, ! #ifdef GEEK ! gek_abil[] = { { 1, &(HPoison_resistance), "", "" }, ! { 1, &(HShock_resistance), "", "" }, ! { 1, &(HSleep_resistance), "", "" }, ! { 8, &(HTeleport_control), "controlled", "helpless" }, ! { 15, &(HWarning), "sensitive", "careless" }, ! { 0, 0, 0, 0 } }, ! #endif /* GEEK */ ice_abil[] = { { 1, &(HCold_resistance), "", "" }, { 13, &(HFire_resistance), "cool", "warmer" }, { 0, 0, 0, 0 } }, *************** *** 629,634 **** --- 636,644 ---- case PM_BARBARIAN: abil = bar_abil; break; case PM_CAVEMAN: abil = cav_abil; break; case PM_FLAME_MAGE: abil = fla_abil; break; + #ifdef GEEK + case PM_GEEK: abil = gek_abil; break; + #endif case PM_HEALER: abil = hea_abil; break; case PM_ICE_MAGE: abil = ice_abil; break; case PM_KNIGHT: abil = kni_abil; break; diff -rN -c slashem-0.0.7E7F2/src/cmd.c geekslashem-0.0.7E7F2/src/cmd.c *** slashem-0.0.7E7F2/src/cmd.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/cmd.c 2006-04-23 00:28:18.000000000 +0900 *************** *** 1431,1438 **** --- 1431,1443 ---- you_have(enlght_combatinc("damage", u.udaminc, final, buf)); if (Slow_digestion) you_have("slower digestion"); if (Regeneration) enl_msg("You regenerate", "", "d", ""); + #ifdef GEEK + if (u.uspellprot || Protection || u.uprotected) { + int prot = u.uprotected; + #else /* GEEK */ if (u.uspellprot || Protection) { int prot = 0; + #endif /* GEEK */ if(uleft && uleft->otyp == RIN_PROTECTION) prot += uleft->spe; if(uright && uright->otyp == RIN_PROTECTION) prot += uright->spe; diff -rN -c slashem-0.0.7E7F2/src/do.c geekslashem-0.0.7E7F2/src/do.c *** slashem-0.0.7E7F2/src/do.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/do.c 2006-04-26 00:00:04.000000000 +0900 *************** *** 363,368 **** --- 363,373 ---- /* Not the same as aggravate monster; besides, it's obvious. */ pline("Several flies buzz around the sink."); break; + #ifdef GEEk + case RIN_TIMELY_BACKUP: + pline("The sink seems undestroyable."); + break; + #endif /* GEEK */ default: ideed = FALSE; break; diff -rN -c slashem-0.0.7E7F2/src/do_wear.c geekslashem-0.0.7E7F2/src/do_wear.c *** slashem-0.0.7E7F2/src/do_wear.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/do_wear.c 2006-04-23 00:29:13.000000000 +0900 *************** *** 418,423 **** --- 418,426 ---- switch(uarmg->otyp) { case LEATHER_GLOVES: + #ifdef GEEK + case GAUNTLETS_OF_TYPING: + #endif /* GEEK */ break; case GAUNTLETS_OF_SWIMMING: if (u.uinwater) { *************** *** 451,456 **** --- 454,462 ---- switch(uarmg->otyp) { case LEATHER_GLOVES: + #ifdef GEEK + case GAUNTLETS_OF_TYPING: + #endif /* GEEK */ break; case GAUNTLETS_OF_SWIMMING: if (u.uinwater) { *************** *** 1775,1780 **** --- 1781,1791 ---- #ifdef TOURIST if(uarmu) uac -= ARM_BONUS(uarmu); #endif + + #ifdef GEEK + uac -= u.uprotected; + #endif /* GEEK */ + if(uleft && uleft->otyp == RIN_PROTECTION) uac -= uleft->spe; if(uright && uright->otyp == RIN_PROTECTION) uac -= uright->spe; if (HProtection & INTRINSIC) uac -= u.ublessed; diff -rN -c slashem-0.0.7E7F2/src/engrave.c geekslashem-0.0.7E7F2/src/engrave.c *** slashem-0.0.7E7F2/src/engrave.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/engrave.c 2006-04-22 00:54:49.000000000 +0900 *************** *** 646,651 **** --- 646,654 ---- case WAN_CREATE_MONSTER: case WAN_CREATE_HORDE: case WAN_ENLIGHTENMENT: + #ifdef GEEK + case WAN_BUGGING: + #endif /* GEEK */ case WAN_WISHING: zapnodir(otmp); break; diff -rN -c slashem-0.0.7E7F2/src/mhitu.c geekslashem-0.0.7E7F2/src/mhitu.c *** slashem-0.0.7E7F2/src/mhitu.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/mhitu.c 2006-04-30 00:55:03.000000000 +0900 *************** *** 81,87 **** break; case AT_MULTIPLY: /* No message. */ ! break; default: pline("%s hits!", Monnam(mtmp)); } --- 81,94 ---- break; case AT_MULTIPLY: /* No message. */ ! break; ! #ifdef GEEK ! case AT_TALK: ! pline( ! "%s talks to you!", ! Monnam(mtmp)); ! break; ! #endif /* GEEK */ default: pline("%s hits!", Monnam(mtmp)); } *************** *** 763,768 **** --- 770,784 ---- if (!range2) clone_mon(mtmp, 0, 0); break; + #ifdef GEEK + case AT_TALK: + if (!ranged) { + pline( + "%s talks to you!", + youseeit ? Monnam(mtmp) : "It"); + sum[i] = hitmu(mtmp,mattk); + } break; + #endif /* GEEK */ case AT_WEAP: if(range2) { #ifdef REINCARNATION diff -rN -c slashem-0.0.7E7F2/src/mon.c geekslashem-0.0.7E7F2/src/mon.c *** slashem-0.0.7E7F2/src/mon.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/mon.c 2006-04-28 00:12:22.000000000 +0900 *************** *** 105,110 **** --- 105,113 ---- case PM_CHIEFTAIN: mndx = mode ? PM_BARBARIAN : PM_HUMAN; break; case PM_NEANDERTHAL: mndx = mode ? PM_CAVEMAN : PM_HUMAN; break; case PM_ATTENDANT: mndx = mode ? PM_HEALER : PM_HUMAN; break; + #ifdef GEEK + case PM_HACKER: mndx = mode ? PM_GEEK : PM_HUMAN; break; + #endif case PM_PAGE: mndx = mode ? PM_KNIGHT : PM_HUMAN; break; case PM_ABBOT: mndx = mode ? PM_MONK : PM_HUMAN; break; case PM_ACOLYTE: mndx = mode ? PM_PRIEST : PM_HUMAN; break; diff -rN -c slashem-0.0.7E7F2/src/monst.c geekslashem-0.0.7E7F2/src/monst.c *** slashem-0.0.7E7F2/src/monst.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/monst.c 2006-04-29 22:50:41.000000000 +0900 *************** *** 1816,1821 **** --- 1816,1872 ---- SIZ(300, 300, 0, MS_BUZZ, MZ_TINY), MR_POISON, MR_POISON, M1_FLY|M1_ANIMAL|M1_NOHANDS|M1_POIS, M2_HOSTILE, M3_INFRAVISIBLE, CLR_RED), + #ifdef GEEK + MON("bug", S_XAN, + LVL(8, 10, 10, 0, 0), (G_NOCORPSE|1), + A(ATTK(AT_TUCH, AD_ELEC, 2, 8), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK,NO_ATTK), + SIZ(0, 0, 0, MS_BUZZ, MZ_SMALL), MR_ELEC, MR_ELEC, + M1_AMORPHOUS|M1_CONCEAL|M1_NOEYES|M1_NOHANDS|M1_BREATHLESS|M1_NOLIMBS|M1_THICK_HIDE, + M2_NEUTER|M2_HOSTILE, 0, CLR_BROWN), + MON("heisenbug", S_XAN, + LVL(10, 35, 10, 0, 0), (G_NOCORPSE|1), + A(ATTK(AT_TUCH, AD_ELEC, 4, 8), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(0, 0, 0, MS_BUZZ, MZ_MEDIUM), MR_ELEC, MR_ELEC, + M1_AMORPHOUS|M1_WALLWALK|M1_BREATHLESS|M1_TPORT|M1_TPORT_CNTRL, + M2_NEUTER|M2_HOSTILE, 0, CLR_YELLOW), + MON("PDP-11", S_XAN, + LVL(8, 1, -2, 0, 0), (G_NOCORPSE|G_NOGEN|G_GENO), + A(ATTK(AT_TUCH, AD_ELEC, 2, 4), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK,NO_ATTK), + SIZ(0, 0, 0, MS_BUZZ, MZ_HUGE), 0, 0, + M1_NOEYES|M1_NOHANDS|M1_NOLIMBS|M1_NOHEAD, + M2_NEUTER|M2_HOSTILE, 0, CLR_WHITE), + MON("PDP-9", S_XAN, + LVL(10, 1, -2, 0, 0), (G_NOCORPSE|G_NOGEN|G_GENO), + A(ATTK(AT_TUCH, AD_ELEC, 4, 4), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(0, 0, 0, MS_BUZZ, MZ_HUGE), 0, 0, + M1_NOEYES|M1_NOHANDS|M1_NOLIMBS|M1_NOHEAD, + M2_NEUTER|M2_HOSTILE, 0, CLR_WHITE), + MON("VAX", S_XAN, + LVL(12, 1, -2, 0, 0), (G_NOCORPSE|G_NOGEN|G_GENO), + A(ATTK(AT_TUCH, AD_ELEC, 6, 4), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(0, 0, 0, MS_BUZZ, MZ_HUGE), 0, 0, + M1_NOEYES|M1_NOHANDS|M1_NOLIMBS|M1_NOHEAD, + M2_NEUTER|M2_HOSTILE, 0, CLR_BRIGHT_GREEN), + MON("walking disk drive", S_XAN, + LVL(14, 50, -2, 0, 0), (G_NOCORPSE|G_NOGEN|G_GENO), + A(ATTK(AT_TUCH, AD_ELEC, 4, 4), ATTK(AT_HUGS, AD_PHYS, 2, 4), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(0, 0, 0, MS_BUZZ, MZ_HUGE), 0, 0, + M1_NOEYES|M1_NOHANDS|M1_NOLIMBS|M1_NOHEAD, + M2_NEUTER|M2_HOSTILE, 0, CLR_WHITE), + MON("Cray", S_XAN, + LVL(15, 1, -2, 0, 0), (G_NOCORPSE|G_NOGEN|G_GENO), + A(ATTK(AT_TUCH, AD_ELEC, 8, 6), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(0, 0, 0, MS_BUZZ, MZ_HUGE), 0, 0, + M1_NOEYES|M1_NOHANDS|M1_NOLIMBS|M1_NOHEAD, + M2_NEUTER|M2_HOSTILE, 0, CLR_WHITE), + #endif /* GEEK */ /* * lights */ *************** *** 3770,3775 **** --- 3821,3854 ---- M1_HUMANOID|M1_OMNIVORE|M1_SEE_INVIS, M2_ELF|M2_STRONG|M2_PRINCE|M2_MALE|M2_COLLECT, M3_INFRAVISIBLE|M3_INFRAVISION, HI_LORD), + #ifdef GEEK + /* these are for the special "school" level written by the author of TNG */ + MON("pupil", S_HUMAN, + LVL(4, 10, 10, 0, 0), G_NOGEN, + A(ATTK(AT_WEAP, AD_PHYS, 1, 1), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + /* sleep resistance keeps them from sleeping in lessons :-) */ + SIZ(WT_HUMAN, 400, 0, MS_PUPIL, MZ_HUMAN), MR_SLEEP, MR_SLEEP, + M1_HUMANOID|M1_OMNIVORE, + M2_HUMAN|M2_COLLECT|M2_HOSTILE, 0, HI_DOMESTIC), + MON("teacher", S_HUMAN, + LVL(8, 10, 10, 0, 0), G_NOGEN, + A(ATTK(AT_WEAP, AD_PHYS, 2, 4), ATTK(AT_TALK, AD_SLEE, 1, 1), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(WT_HUMAN, 400, 0, MS_TEACHER, MZ_HUMAN), MR_SLEEP|MR_POISON, + /* teachers have to be proof against their own attempts to put */ + /* pupils to sleep; they're poisonous as well ... */ + MR_SLEEP|MR_POISON,M1_HUMANOID|M1_OMNIVORE, + M2_HUMAN|M2_COLLECT|M2_HOSTILE, 0, HI_LORD), + MON("principal", S_HUMAN, + LVL(12, 10, 10, 30, 0), (G_NOGEN|G_UNIQ), + A(ATTK(AT_WEAP, AD_PHYS, 4, 8), ATTK(AT_TALK, AD_DRIN, 2, 2), + ATTK(AT_TALK, AD_SLEE, 1, 1), + NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(WT_HUMAN, 400, 0, MS_PRINCIPAL, MZ_HUMAN), MR_SLEEP|MR_POISON, + MR_SLEEP|MR_POISON, M1_HUMANOID|M1_OMNIVORE, + M2_HUMAN|M2_COLLECT|M2_MAGIC|M2_STALK|M2_HOSTILE, 0, HI_LORD), + #endif /* GEEK */ MON("doppelganger", S_HUMAN, LVL(9, 12, 5, 20, 0), (G_GENO|1), A(ATTK(AT_WEAP, AD_PHYS, 1, 12), *************** *** 4068,4073 **** --- 4147,4166 ---- M2_DEMON|M2_STALK|M2_HOSTILE|M2_NASTY|M2_MALE, M3_INFRAVISIBLE|M3_INFRAVISION|M3_TRAITOR, CLR_GRAY), #undef SEDUCTION_ATTACKS + #ifdef GEEK + MON("news daemon", S_DEMON, + LVL(6, 12, 0, 0, 0), (G_NOCORPSE|G_NOGEN), + A(ATTK(AT_BITE, AD_PHYS, 2, 4), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK,NO_ATTK), + SIZ(0, 0, 0, MS_BUZZ, MZ_HUMAN), 0, 0, M1_FLY|M1_UNSOLID, + M2_DEMON|M2_NASTY|M2_NEUTER|M2_HOSTILE, 0, CLR_BRIGHT_BLUE), + MON("printer daemon", S_DEMON, + LVL(6, 12, 0, 0, 0), (G_NOCORPSE|G_NOGEN), + A(ATTK(AT_BITE, AD_PHYS, 2, 6), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(0, 0, 0, MS_BUZZ, MZ_HUMAN), 0, 0, M1_FLY|M1_UNSOLID, + M2_DEMON|M2_NASTY|M2_NEUTER|M2_HOSTILE, 0, CLR_BRIGHT_BLUE), + #endif /* GEEK */ /* Used by AD&D for a type of demon, originally one of the Furies */ /* and spelled this way */ MON("erinys", S_DEMON, *************** *** 4186,4194 **** M1_FLY|M1_SEE_INVIS|M1_POIS, M2_DEMON|M2_STALK|M2_HOSTILE|M2_STRONG|M2_NASTY|M2_COLLECT, M3_INFRAVISIBLE|M3_INFRAVISION|M3_TRAITOR, CLR_RED), /* Named demon lords & princes plus Arch-Devils. ! * (their order matters; see minion.c) */ MON("Juiblex", S_DEMON, LVL(50, 3, -7, 65, -15), (G_HELL|G_NOCORPSE|G_NOGEN|G_UNIQ), A(ATTK(AT_ENGL, AD_DISE, 4,10), ATTK(AT_SPIT, AD_ACID, 3, 6), --- 4279,4299 ---- M1_FLY|M1_SEE_INVIS|M1_POIS, M2_DEMON|M2_STALK|M2_HOSTILE|M2_STRONG|M2_NASTY|M2_COLLECT, M3_INFRAVISIBLE|M3_INFRAVISION|M3_TRAITOR, CLR_RED), + #ifdef GEEK + MON("UNIX Kernel", S_DEMON, + LVL(28, 10, 0, 20, -3), (G_NOGEN|G_UNIQ|G_NOCORPSE), + A(ATTK(AT_BITE, AD_PHYS, 4, 8), ATTK(AT_CLAW, AD_STUN, 2, 2), + ATTK(AT_KICK, AD_DRLI, 3, 3), + NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(WT_HUMAN, 0, 0, MS_BUZZ, MZ_HUMAN), 0, 0, + M1_UNSOLID|M1_FLY, M2_NOPOLY|M2_DEMON|M2_HOSTILE|M2_LORD|M2_NEUTER, + 0, CLR_BRIGHT_BLUE), + #endif /* GEEK */ + /* Named demon lords & princes plus Arch-Devils. ! * (their order matters; see minion.c:dlord(),dprince()) */ + MON("Juiblex", S_DEMON, LVL(50, 3, -7, 65, -15), (G_HELL|G_NOCORPSE|G_NOGEN|G_UNIQ), A(ATTK(AT_ENGL, AD_DISE, 4,10), ATTK(AT_SPIT, AD_ACID, 3, 6), *************** *** 4651,4656 **** --- 4756,4771 ---- M1_HUMANOID|M1_OMNIVORE, M2_NOPOLY|M2_HUMAN|M2_STRONG|M2_COLLECT|M2_MAGIC|M2_HOSTILE, M3_INFRAVISIBLE, CLR_RED), + #ifdef GEEK + MON("geek", S_HUMAN, + LVL(10, 12, 10, 3, 0), G_NOGEN, + A(ATTK(AT_WEAP, AD_PHYS, 1, 8), ATTK(AT_WEAP, AD_PHYS, 1, 6), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(WT_HUMAN, 400, 0, MS_HUMANOID, MZ_HUMAN), MR_POISON|MR_ELEC, 0, + M1_HUMANOID|M1_OMNIVORE, + M2_NOPOLY|M2_HUMAN|M2_STRONG|M2_COLLECT, + M3_INFRAVISIBLE, HI_DOMESTIC), + #endif /* GEEK */ MON("healer", S_HUMAN, LVL(10, 12, 10, 1, 0), G_NOGEN, A(ATTK(AT_WEAP, AD_PHYS, 1, 6), *************** *** 4852,4857 **** --- 4967,4982 ---- MR_POISON, M1_HUMANOID|M1_OMNIVORE, M2_NOPOLY|M2_HUMAN|M2_PNAME|M2_PEACEFUL|M2_STRONG|M2_MALE| M2_COLLECT|M2_MAGIC, M3_CLOSE|M3_INFRAVISIBLE, HI_LORD), + #ifdef GEEK + MON("The DevTeam", S_HUMAN, + LVL(20, 12, 0, 80, 0), (G_NOGEN|G_UNIQ), + A(ATTK(AT_WEAP, AD_PHYS, 1, 8), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(WT_HUMAN, 400, 0, MS_LEADER, MZ_HUMAN), MR_POISON|MR_ELEC, + MR_POISON|MR_ELEC, M1_HUMANOID|M1_OMNIVORE, + M2_NOPOLY|M2_HUMAN|M2_PNAME|M2_PEACEFUL|M2_STRONG|M2_NEUTER|M2_COLLECT|M2_MAGIC, + M3_CLOSE, HI_LORD), + #endif /* GEEK */ MON("Hippocrates", S_HUMAN, LVL(20, 12, 0, 40, 0), (G_NOGEN|G_UNIQ), A(ATTK(AT_WEAP, AD_PHYS, 1, 6), *************** *** 5107,5112 **** --- 5232,5248 ---- M2_MALE|M2_COLLECT|M2_JEWELS|M2_MAGIC|M2_STALK, M3_WANTSARTI|M3_WAITFORU, CLR_BLACK), #endif + #ifdef GEEK + MON("Bill Gates", S_HUMAN, + LVL(20, 10, 10, 0, -15), (G_NOGEN|G_UNIQ), + A(ATTK(AT_WEAP, AD_PHYS, 4, 8), ATTK(AT_BITE, AD_PHYS, 6, 8), + ATTK(AT_TENT, AD_DRIN, 2, 1), + NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(WT_HUMAN, 400, 0, MS_NEMESIS, MZ_HUMAN), 0, 0, + M1_HUMANOID|M1_OMNIVORE, + M2_NOPOLY|M2_HUMAN|M2_STRONG|M2_STALK|M2_PNAME|M2_HOSTILE|M2_NASTY|M2_MALE, + M3_WANTSARTI|M3_WAITFORU, HI_LORD), + #endif /* GEEK */ MON("Cyclops", S_GIANT, LVL(18, 12, 0, 0, -15), (G_NOGEN|G_UNIQ), A(ATTK(AT_WEAP, AD_PHYS, 4, 8), ATTK(AT_WEAP, AD_PHYS, 4, 8), *************** *** 5338,5343 **** --- 5474,5488 ---- M2_NOPOLY|M2_HUMAN|M2_PEACEFUL|M2_STRONG|M2_COLLECT, M3_INFRAVISION|M3_INFRAVISIBLE, CLR_ORANGE), #endif + #ifdef GEEK + MON("hacker", S_HUMAN, + LVL(5, 12, 10, 10, 1), G_NOGEN, + A(ATTK(AT_WEAP, AD_PHYS, 2, 4), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(WT_HUMAN, 400, 0, MS_GUARDIAN, MZ_HUMAN), 0, 0, + M1_HUMANOID|M1_OMNIVORE, + M2_NOPOLY|M2_HUMAN|M2_PEACEFUL, 0, HI_DOMESTIC), + #endif /* GEEK */ MON("attendant", S_HUMAN, LVL(5, 12, 10, 10, 3), G_NOGEN, A(ATTK(AT_WEAP, AD_PHYS, 1, 6), diff -rN -c slashem-0.0.7E7F2/src/mplayer.c geekslashem-0.0.7E7F2/src/mplayer.c *** slashem-0.0.7E7F2/src/mplayer.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/mplayer.c 2006-04-21 23:33:09.000000000 +0900 *************** *** 167,172 **** --- 167,177 ---- else if (rn2(2)) weapon = CLUB; if (helm == HELM_OF_BRILLIANCE) helm = STRANGE_OBJECT; break; + #ifdef GEEK + case PM_GEEK: + weapon = RED_DOUBLE_LIGHTSABER; + break; + #endif /* GEEK */ case PM_HEALER: if (rn2(4)) weapon = QUARTERSTAFF; else if (rn2(2)) weapon = rn2(2) ? UNICORN_HORN : SCALPEL; diff -rN -c slashem-0.0.7E7F2/src/objects.c geekslashem-0.0.7E7F2/src/objects.c *** slashem-0.0.7E7F2/src/objects.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/objects.c 2006-04-29 22:46:29.000000000 +0900 *************** *** 556,598 **** 0, 1, DISPLACED, 10, 0, 10, 50, 9, 2, CLOTH, HI_CLOTH), /* Helmets */ HELM("elven leather helm", "leather hat", ! 0, 0, 0, 6, 1, 3, 8, 9, 0, LEATHER, HI_LEATHER), HELM("orcish helm", "iron skull cap", ! 0, 0, 0, 6, 1, 30, 10, 9, 0, IRON, CLR_BLACK), HELM("dwarvish iron helm", "hard hat", ! 0, 0, 0, 6, 1, 40, 20, 8, 0, IRON, HI_METAL), HELM("fedora", (char *)0, ! 1, 0, 0, 0, 0, 3, 1,10, 0, CLOTH, CLR_BROWN), HELM("cornuthaum", "conical hat", ! 0, 1, CLAIRVOYANT, 3, 1, 4, 80,10, 2, CLOTH, CLR_BLUE), HELM("dunce cap", "conical hat", ! 0, 1, 0, 3, 1, 4, 1,10, 0, CLOTH, CLR_BLUE), HELM("dented pot", (char *)0, ! 1, 0, 0, 2, 0, 10, 8, 9, 0, IRON, CLR_BLACK), /* ...with shuffled appearances */ HELM("helmet", "plumed helmet", ! 0, 0, 0, 10, 1, 30, 10, 9, 0, IRON, HI_METAL), HELM("helm of brilliance", "etched helmet", ! 0, 1, 0, 6, 1, 50, 50, 9, 0, IRON, CLR_GREEN), HELM("helm of opposite alignment", "crested helmet", ! 0, 1, 0, 6, 1, 50, 50, 9, 0, IRON, HI_METAL), HELM("helm of telepathy", "visored helmet", ! 0, 1, TELEPAT, 2, 1, 50, 50, 9, 0, IRON, HI_METAL), /* Gloves */ /* these have their color but not material shuffled, so the IRON must stay * CLR_BROWN (== HI_LEATHER) */ GLOVES("leather gloves", "old gloves", ! 0, 0, 0, 16, 1, 10, 8, 9, 0, LEATHER, HI_LEATHER), GLOVES("gauntlets of fumbling", "padded gloves", 0, 1, FUMBLING, 8, 1, 10, 50, 9, 0, LEATHER, HI_LEATHER), GLOVES("gauntlets of power", "riding gloves", ! 0, 1, 0, 8, 1, 30, 50, 9, 0, IRON, CLR_BROWN), GLOVES("gauntlets of swimming", "black gloves", 0, 1, SWIMMING, 8, 1, 10, 50, 9, 0, LEATHER, HI_LEATHER), GLOVES("gauntlets of dexterity", "fencing gloves", ! 0, 1, 0, 8, 1, 10, 50, 9, 0, LEATHER, HI_LEATHER), /* Shields */ SHIELD("small shield", (char *)0, --- 556,605 ---- 0, 1, DISPLACED, 10, 0, 10, 50, 9, 2, CLOTH, HI_CLOTH), /* Helmets */ HELM("elven leather helm", "leather hat", ! 0, 0, 0, 6, 1, 3, 8, 9, 0, LEATHER, HI_LEATHER), HELM("orcish helm", "iron skull cap", ! 0, 0, 0, 6, 1, 30, 10, 9, 0, IRON, CLR_BLACK), HELM("dwarvish iron helm", "hard hat", ! 0, 0, 0, 6, 1, 40, 20, 8, 0, IRON, HI_METAL), HELM("fedora", (char *)0, ! 1, 0, 0, 0, 0, 3, 1,10, 0, CLOTH, CLR_BROWN), HELM("cornuthaum", "conical hat", ! 0, 1, CLAIRVOYANT, 3, 1, 4, 80,10, 2, CLOTH, CLR_BLUE), HELM("dunce cap", "conical hat", ! 0, 1, 0, 3, 1, 4, 1,10, 0, CLOTH, CLR_BLUE), HELM("dented pot", (char *)0, ! 1, 0, 0, 2, 0, 10, 8, 9, 0, IRON, CLR_BLACK), /* ...with shuffled appearances */ HELM("helmet", "plumed helmet", ! 0, 0, 0, 10, 1, 30, 10, 9, 0, IRON, HI_METAL), HELM("helm of brilliance", "etched helmet", ! 0, 1, 0, 6, 1, 50, 50, 9, 0, IRON, CLR_GREEN), HELM("helm of opposite alignment", "crested helmet", ! 0, 1, 0, 6, 1, 50, 50, 9, 0, IRON, HI_METAL), HELM("helm of telepathy", "visored helmet", ! 0, 1, TELEPAT, 2, 1, 50, 50, 9, 0, IRON, HI_METAL), /* Gloves */ /* these have their color but not material shuffled, so the IRON must stay * CLR_BROWN (== HI_LEATHER) */ + #ifdef GEEK GLOVES("leather gloves", "old gloves", ! 0, 0, 0, 12, 1, 10, 8, 9, 0, LEATHER, HI_LEATHER), ! GLOVES("gauntlets of typing", "brand-new gloves", ! 0, 1, 0, 4, 1, 10, 50, 8, 0, LEATHER, HI_LEATHER), ! #else ! GLOVES("leather gloves", "old gloves", ! 0, 0, 0, 16, 1, 10, 8, 9, 0, LEATHER, HI_LEATHER), ! #endif /* GEEK */ GLOVES("gauntlets of fumbling", "padded gloves", 0, 1, FUMBLING, 8, 1, 10, 50, 9, 0, LEATHER, HI_LEATHER), GLOVES("gauntlets of power", "riding gloves", ! 0, 1, 0, 8, 1, 30, 50, 9, 0, IRON, CLR_BROWN), GLOVES("gauntlets of swimming", "black gloves", 0, 1, SWIMMING, 8, 1, 10, 50, 9, 0, LEATHER, HI_LEATHER), GLOVES("gauntlets of dexterity", "fencing gloves", ! 0, 1, 0, 8, 1, 10, 50, 9, 0, LEATHER, HI_LEATHER), /* Shields */ SHIELD("small shield", (char *)0, *************** *** 653,659 **** RING("mood", 0, "ridged", 100, 1, 0, 8, IRON, HI_METAL), RING("protection", PROTECTION, "black onyx",100, 1, 1, 7, MINERAL, CLR_BLACK), RING("protection from shape changers", PROT_FROM_SHAPE_CHANGERS, "shiny", ! 100, 1, 0, 5, IRON, CLR_BRIGHT_CYAN), RING("sleeping", SLEEPING, "wedding", 100, 1, 0, 7, GEMSTONE, CLR_WHITE), RING("stealth", STEALTH, "jade", 100, 1, 0, 6, GEMSTONE, CLR_GREEN), RING("sustain ability", FIXED_ABIL, "bronze", --- 660,666 ---- RING("mood", 0, "ridged", 100, 1, 0, 8, IRON, HI_METAL), RING("protection", PROTECTION, "black onyx",100, 1, 1, 7, MINERAL, CLR_BLACK), RING("protection from shape changers", PROT_FROM_SHAPE_CHANGERS, "shiny", ! 100, 1, 0, 5, IRON, CLR_BRIGHT_CYAN), RING("sleeping", SLEEPING, "wedding", 100, 1, 0, 7, GEMSTONE, CLR_WHITE), RING("stealth", STEALTH, "jade", 100, 1, 0, 6, GEMSTONE, CLR_GREEN), RING("sustain ability", FIXED_ABIL, "bronze", *************** *** 675,681 **** RING("poison resistance", POISON_RES, "pearl", 150, 1, 0, 4, IRON, CLR_WHITE), RING("see invisible", SEE_INVIS, "engagement", ! 150, 1, 0, 5, IRON, HI_METAL), RING("shock resistance", SHOCK_RES, "copper", 150, 1, 0, 3, COPPER, HI_COPPER), RING("fire resistance", FIRE_RES, "iron", 200, 1, 0, 5, IRON, HI_METAL), --- 682,688 ---- RING("poison resistance", POISON_RES, "pearl", 150, 1, 0, 4, IRON, CLR_WHITE), RING("see invisible", SEE_INVIS, "engagement", ! 150, 1, 0, 5, IRON, HI_METAL), RING("shock resistance", SHOCK_RES, "copper", 150, 1, 0, 3, COPPER, HI_COPPER), RING("fire resistance", FIRE_RES, "iron", 200, 1, 0, 5, IRON, HI_METAL), *************** *** 684,690 **** /*RING("infravision", 0, "zinc", 200, 1, 0, 5, MITHRIL, HI_METAL),*/ RING("levitation", LEVITATION, "agate", 200, 1, 0, 7, GEMSTONE, CLR_RED), RING("regeneration", REGENERATION, "moonstone", ! 200, 1, 0, 6, MINERAL, HI_MINERAL), RING("searching", SEARCHING, "tiger eye", 200, 1, 0, 6, GEMSTONE, CLR_BROWN), RING("teleportation", TELEPORT, "silver", 200, 1, 0, 3, SILVER, HI_SILVER), RING("conflict", CONFLICT, "ruby", 300, 1, 0, 9, GEMSTONE, CLR_RED), --- 691,697 ---- /*RING("infravision", 0, "zinc", 200, 1, 0, 5, MITHRIL, HI_METAL),*/ RING("levitation", LEVITATION, "agate", 200, 1, 0, 7, GEMSTONE, CLR_RED), RING("regeneration", REGENERATION, "moonstone", ! 200, 1, 0, 6, MINERAL, HI_MINERAL), RING("searching", SEARCHING, "tiger eye", 200, 1, 0, 6, GEMSTONE, CLR_BROWN), RING("teleportation", TELEPORT, "silver", 200, 1, 0, 3, SILVER, HI_SILVER), RING("conflict", CONFLICT, "ruby", 300, 1, 0, 9, GEMSTONE, CLR_RED), *************** *** 692,698 **** RING("polymorph control", POLYMORPH_CONTROL, "emerald", 300, 1, 0, 8, GEMSTONE, CLR_BRIGHT_GREEN), RING("teleport control", TELEPORT_CONTROL, "gold", ! 300, 1, 0, 3, GOLD, HI_GOLD), /* More descriptions: cameo, intaglio */ #undef RING --- 699,712 ---- RING("polymorph control", POLYMORPH_CONTROL, "emerald", 300, 1, 0, 8, GEMSTONE, CLR_BRIGHT_GREEN), RING("teleport control", TELEPORT_CONTROL, "gold", ! 300, 1, 0, 3, GOLD, HI_GOLD), ! #ifdef GEEK ! /* [Iwakiri]:FIXME ! * I have no confidence in color and mohs :( ! * Would anyone fix here, please? ! */ ! RING("timely backup", 0, "cameo", 150, 1, 0, 3, MINERAL, CLR_WHITE), ! #endif /* GEEK */ /* More descriptions: cameo, intaglio */ #undef RING *************** *** 712,717 **** --- 726,734 ---- AMULET("amulet of unchanging", "concave", UNCHANGING, 50), AMULET("amulet versus poison", "pyramidal", POISON_RES, 140), AMULET("amulet versus stone", "lunate", /*STONE_RES*/0,60), + #ifdef GEEK + AMULET("amulet of data storage", "icosahedral", 0, 0), + #endif /* GEEK */ OBJECT(OBJ("cheap plastic imitation of the Amulet of Yendor", "Amulet of Yendor"), BITS(0,0,1,0,0,0,0,0,0,0,0,0,PLASTIC), 0, AMULET_CLASS, 0, 0, 20, 0, 0, 0, 0, 0, 1, HI_METAL), *************** *** 831,836 **** --- 848,858 ---- * red : 6 + d9, 10 + d11 * red double: 6 + d9 + d9, 10 + d11 + d11 (15/21) in double mode */ + /* [Iwakiri] + * Geeks' init weapon was "electric sword":d12,d16 (6.5/8.5) in TNG + * so if you think geeks are too easier than TNG, decrease damage here. + */ + WEPTOOL("green lightsaber", "lightsaber", 0, 0, 1, 0, 1, 60, 500, 3, 5, -3, SLASH, P_LIGHTSABER, PLASTIC, HI_METAL), # ifdef D_SABER *************** *** 852,858 **** TOOL("mirror", "looking glass", 0, 0, 0, 0, 50, 13, 10, GLASS, HI_SILVER), #endif TOOL("crystal ball", "glass orb", ! 0, 0, 1, 1, 10,150, 60, GLASS, HI_GLASS), #if 0 /* STEPHEN WHITE'S NEW CODE */ /* KMH -- removed because there's potential for abuse */ --- 874,880 ---- TOOL("mirror", "looking glass", 0, 0, 0, 0, 50, 13, 10, GLASS, HI_SILVER), #endif TOOL("crystal ball", "glass orb", ! 0, 0, 1, 1, 10,150, 60, GLASS, HI_GLASS), #if 0 /* STEPHEN WHITE'S NEW CODE */ /* KMH -- removed because there's potential for abuse */ *************** *** 879,885 **** --- 901,921 ---- TOOL("tin opener", (char *)0, 1, 0, 0, 0, 25, 4, 30, IRON, HI_METAL), TOOL("can of grease", (char *)0,1, 0, 0, 1, 15, 15, 20, IRON, HI_METAL), TOOL("figurine", (char *)0, 1, 0, 1, 0, 25, 50, 80, MINERAL, HI_MINERAL), + #ifdef GEEK + TOOL("magic marker", (char *)0, 1, 0, 1, 1, 10, 2, 50, PLASTIC, CLR_RED), + TOOL("diode", "two-wired thing", + 0, 1, 0, 0, 0, 2, 50, IRON, CLR_WHITE), + TOOL("transistor", "three-wired thing", + 0, 1, 0, 0, 0, 2, 100, IRON, CLR_WHITE), + TOOL("IC", "many-wired thing", + 0, 1, 0, 0, 0, 2,5000, IRON, CLR_WHITE), + TOOL("pack of floppies","box containing little plastic cards", + 0, 1, 0, 0, 4, 30, 300,PLASTIC, CLR_RED), + TOOL("relay", "four-wired thing", + 0, 1, 0, 0, 1, 8, 100, IRON, CLR_WHITE), + #else TOOL("magic marker", (char *)0, 1, 0, 1, 1, 15, 2, 50, PLASTIC, CLR_RED), + #endif /* GEEK */ /* Two pseudo tools. These can never exist outside of medical kits. */ OBJECT(OBJ("bandage", (char *)0), *************** *** 962,968 **** --- 998,1009 ---- FOOD("holy wafer", 7, 1, 1, 0, VEGGY, 150, CLR_WHITE), FOOD("lembas wafer", 20, 2, 5, 0, VEGGY, 800, CLR_WHITE), FOOD("cram ration", 20, 3, 15, 0, VEGGY, 600, HI_ORGANIC), + #ifdef GEEK + FOOD("Hacker's Food", 50, 1, 20, 0, VEGGY, 800, HI_METAL), + FOOD("food ration", 330, 5, 20, 0, VEGGY, 800, HI_ORGANIC), + #else FOOD("food ration", 380, 5, 20, 0, VEGGY, 800, HI_ORGANIC), + #endif /* GEEK */ FOOD("K-ration", 0, 1, 10, 0, VEGGY, 400, HI_ORGANIC), FOOD("C-ration", 0, 1, 10, 0, VEGGY, 300, HI_ORGANIC), FOOD("tin", 75, 0, 10, 1, METAL, 0, HI_METAL), *************** *** 980,989 **** --- 1021,1038 ---- POTION("clairvoyance","luminescent", 1, 0, 20, 100, CLR_WHITE), POTION("confusion", "orange", 1, CONFUSION, 40, 100, CLR_ORANGE), POTION("hallucination", "sky blue", 1, HALLUC, 40, 100, CLR_CYAN), + #ifdef GEEK + POTION("healing", "purple-red", 1, 0, 50, 100, CLR_MAGENTA), + POTION("extra healing", "puce", 1, 0, 40, 100, CLR_RED), + POTION("restore ability", "pink", 1, 0, 35, 100, CLR_BRIGHT_MAGENTA), + POTION("blindness", "yellow", 1, BLINDED, 33, 150, CLR_YELLOW), + POTION("Jolt Cola", "blood-red", 0, 0, 20, 50, CLR_BROWN), + #else POTION("healing", "purple-red", 1, 0, 55, 100, CLR_MAGENTA), POTION("extra healing", "puce", 1, 0, 45, 100, CLR_RED), POTION("restore ability", "pink", 1, 0, 40, 100, CLR_BRIGHT_MAGENTA), POTION("blindness", "yellow", 1, BLINDED, 38, 150, CLR_YELLOW), + #endif /* GEEK */ POTION("ESP", "muddy", 1, TELEPAT, 20, 150, CLR_BROWN), POTION("gain energy", "cloudy", 1, 0, 40, 150, CLR_WHITE), POTION("invisibility", "brilliant blue",1, INVIS, 40, 150, CLR_BRIGHT_BLUE), *************** *** 1039,1044 **** --- 1088,1096 ---- SCROLL("genocide", "ELBIB YLOH", P_NONE, 1, 15, 300), SCROLL("punishment", "VE FORBRYDERNE", P_NONE, 1, 15, 300), SCROLL("stinking cloud", "VELOX NEB", P_NONE, 1, 15, 300), + #ifdef GEEK + SCROLL("root password detection","XYZZY", P_NONE, 1, 0,1000), + #endif /* GEEK */ SCROLL((char *)0, "FOOBIE BLETCH", P_NONE, 1, 0, 100), SCROLL((char *)0, "TEMOV", P_NONE, 1, 0, 100), SCROLL((char *)0, "GARVEN DEH", P_NONE, 1, 0, 100), *************** *** 1173,1178 **** --- 1225,1233 ---- WAND("death", "long", 5, 500, 1, RAY, IRON, HI_METAL), WAND("lightning", "curved", 20, 175, 1, RAY, IRON, HI_METAL), WAND("fireball", "octagonal", 5, 300, 1, RAY, IRON, HI_METAL), + #ifdef GEEK + WAND("bugging", "wooden", 0, 200, 1, NODIR, WOOD, HI_METAL), + #endif /* GEEK */ WAND((char *)0, "forked", 0, 150, 1, 0, WOOD, HI_WOOD), WAND((char *)0, "spiked", 0, 150, 1, 0, IRON, HI_METAL), WAND((char *)0, "jeweled", 0, 150, 1, 0, IRON, HI_MINERAL), diff -rN -c slashem-0.0.7E7F2/src/objnam.c geekslashem-0.0.7E7F2/src/objnam.c *** slashem-0.0.7E7F2/src/objnam.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/objnam.c 2006-04-25 01:45:20.000000000 +0900 *************** *** 1763,1769 **** !BSTRCMPI(bp, p-5, "shoes") || !BSTRCMPI(bp, p-6, "scales")) return bp; ! } else if (!BSTRCMPI(bp, p-5, "boots") || !BSTRCMP(bp, p-9, "gauntlets") || !BSTRCMPI(bp, p-6, "tricks") || --- 1763,1775 ---- !BSTRCMPI(bp, p-5, "shoes") || !BSTRCMPI(bp, p-6, "scales")) return bp; ! #ifdef GEEK ! if (!BSTRCMP(bp,p-15,"NetHack Sources")){ ! Strcpy(p-15,"NetHack Sources"); ! return bp; ! } ! ! #endif /* GEEK */ } else if (!BSTRCMPI(bp, p-5, "boots") || !BSTRCMP(bp, p-9, "gauntlets") || !BSTRCMPI(bp, p-6, "tricks") || *************** *** 1800,1806 **** Strcpy(p-5, "fungus"); return bp; } - /* here we cannot find the plural suffix */ } return bp; --- 1806,1811 ---- *************** *** 2117,2124 **** very = 2; } else if (!strncmpi(bp, "rusty ", l=6) || !strncmpi(bp, "rusted ", l=7) || ! !strncmpi(bp, "burnt ", l=6) || ! !strncmpi(bp, "burned ", l=7)) { eroded = 1 + very; very = 0; } else if (!strncmpi(bp, "corroded ", l=9) || --- 2122,2133 ---- very = 2; } else if (!strncmpi(bp, "rusty ", l=6) || !strncmpi(bp, "rusted ", l=7) || ! #ifdef GEEK ! strncmpi(bp,"burnt Moth Relay",l=16) && ! strncmpi(bp,"burned Moth Relay",l=17) && ! #endif /* GEEK */ ! (!strncmpi(bp, "burnt ", l=6) || ! !strncmpi(bp, "burned ", l=7))) { eroded = 1 + very; very = 0; } else if (!strncmpi(bp, "corroded ", l=9) || *************** *** 2268,2273 **** --- 2277,2286 ---- /* Find corpse type w/o "of" (red dragon scale mail, yeti corpse) */ if (strncmpi(bp, "samurai sword", 13)) /* not the "samurai" monster! */ if (strncmpi(bp, "wizard lock", 11)) /* not the "wizard" monster! */ + #ifdef GEEK + if (strncmpi(bp, "Hacker's Food", 13)) /* not the "Hacker" monster! */ + if (strncmpi(bp, "NetHack Sources", 15)) /* not the "NetHacker" nor "Nethackeress" rank! */ + #endif /* GEEK */ if (strncmpi(bp, "ninja-to", 8)) /* not the "ninja" rank */ if (strncmpi(bp, "master key", 10)) /* not the "master" rank */ if (strncmpi(bp, "magenta", 7)) /* not the "mage" rank */ *************** *** 2291,2296 **** --- 2304,2310 ---- } } + /* first change to singular if necessary */ if (*bp) { char *sng = makesingular(bp); *************** *** 2300,2305 **** --- 2314,2320 ---- } } + /* Alternate spellings (pick-ax, silver sabre, &c) */ { struct alt_spellings *as = spellings; *************** *** 2391,2400 **** strncmpi(bp, "studded leather arm", 19) && strncmpi(bp, "leather arm", 11) && strncmpi(bp, "tooled horn", 11) && ! strncmpi(bp, "graywand", 8) && ! strncmpi(bp, "staff of withering", 18) && ! strncmpi(bp, "one ring", 8) && strncmpi(bp, "food ration", 11) && strncmpi(bp, "meat ring", 9) ) for (i = 0; i < (int)(sizeof wrpsym); i++) { --- 2406,2418 ---- strncmpi(bp, "studded leather arm", 19) && strncmpi(bp, "leather arm", 11) && strncmpi(bp, "tooled horn", 11) && ! strncmpi(bp, "graywand", 8) && ! strncmpi(bp, "staff of withering", 18) && ! strncmpi(bp, "one ring", 8) && strncmpi(bp, "food ration", 11) && + #ifdef GEEK + strncmpi(bp, "Hacker's Food", 13) && + #endif /* GEEK */ strncmpi(bp, "meat ring", 9) ) for (i = 0; i < (int)(sizeof wrpsym); i++) { diff -rN -c slashem-0.0.7E7F2/src/potion.c geekslashem-0.0.7E7F2/src/potion.c *** slashem-0.0.7E7F2/src/potion.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/potion.c 2006-04-22 17:05:10.000000000 +0900 *************** *** 1081,1086 **** --- 1081,1108 ---- make_vomiting(Vomiting+d(10,8), TRUE); } break; + #ifdef GEEK + case POT_JOLT_COLA: + You("are jolted back to your senses."); + if (otmp->cursed) { + You("feel bad."); + u.uhp -= rn2(10); + if (u.uhp < 1) u.uhp = 1; /* can't kill you */ + } else { + if (Hallucination) make_hallucinated(0L,FALSE,0L); + if (otmp->blessed && !rn2(10)) { + pluslvl(FALSE); + } else { + u.uhp += 5; + if (u.uhp > u.uhpmax) { + if (otmp->blessed) u.uhpmax++; + u.uhp = u.uhpmax; + } + } + } + break; + #endif /* GEEK */ + default: impossible("What a funny potion! (%u)", otmp->otyp); return(0); diff -rN -c slashem-0.0.7E7F2/src/read.c geekslashem-0.0.7E7F2/src/read.c *** slashem-0.0.7E7F2/src/read.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/read.c 2006-04-26 01:15:49.000000000 +0900 *************** *** 1607,1613 **** (void) create_gas_cloud(cc.x, cc.y, 3+bcsign(sobj), 8+4*bcsign(sobj)); break; ! } default: impossible("What weird effect is this? (%u)", sobj->otyp); } --- 1607,1621 ---- (void) create_gas_cloud(cc.x, cc.y, 3+bcsign(sobj), 8+4*bcsign(sobj)); break; ! } ! #ifdef GEEK ! case SCR_ROOT_PASSWORD_DETECTION: ! You("sense the computer's root password."); ! pline("It is: %s.", sobj->cursed ? "jsdfljfdsh" : (sobj->blessed ? "memalezu" : "xyzzy")); ! pline("(No warranty implied.)"); ! break; ! #endif /* GEEK */ ! default: impossible("What weird effect is this? (%u)", sobj->otyp); } diff -rN -c slashem-0.0.7E7F2/src/role.c geekslashem-0.0.7E7F2/src/role.c *** slashem-0.0.7E7F2/src/role.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/role.c 2006-04-25 01:03:23.000000000 +0900 *************** *** 142,147 **** --- 142,176 ---- 0, 1, 0, 2, 10, A_INT, SPE_FIREBALL, -4 /* From old role.c */ }, + #ifdef GEEK + { {"Geek", 0},{ + {"Newbie", 0}, + {"BASIC Programmer", "BASIC Programmeress"}, + {"C Programmer", "C Programmeress"}, + {"Hacker", "Hackeress"}, + {"NetHacker", "NetHackeress"}, + {"Nethack Programmer", "Nethack Programmeress"}, + {"he who uses", "she who uses"}, + {"he who knows", "she who knows"}, + {"he who learns", "she who learns"} }, + "UNIX","_PDP-7","VMS", /* Computer */ + "Gek","The Dev Team","The main office of M$", + PM_GEEK, NON_PM, NON_PM, + PM_THE_DEVTEAM, PM_HACKER, PM_BILL_GATES, + PM_BUG, PM_GRID_BUG, S_XAN, S_EYE, + ART_NETHACK_SOURCES, + MH_HUMAN|MH_DWARF|MH_GNOME|MH_ORC|MH_ELF|MH_HOBBIT|MH_WERE|MH_VAMPIRE | + ROLE_MALE|ROLE_FEMALE|ROLE_NEUTER | + ROLE_LAWFUL|ROLE_NEUTRAL|ROLE_CHAOTIC, + /* Str Int Wis Dex Con Cha */ + { 10, 10, 10, 8, 9, 7 }, + { 30, 15, 15, 10, 20, 10 }, + /* Init Lower Higher */ + { 10, 0, 0, 8, 1, 0 }, /* Hit points */ + { 1, 0, 0, 1, 0, 1 },20, /* Energy */ + 10, 4,-1, 2, 10, A_WIS, SPE_DETECT_UNSEEN, -4 + }, + #endif /* GEEK */ { {"Healer", 0}, { {"Rhizotomist", 0}, {"Empiric", 0}, diff -rN -c slashem-0.0.7E7F2/src/school.c geekslashem-0.0.7E7F2/src/school.c *** slashem-0.0.7E7F2/src/school.c 1970-01-01 09:00:00.000000000 +0900 --- geekslashem-0.0.7E7F2/src/school.c 2006-04-29 22:33:47.000000000 +0900 *************** *** 0 **** --- 1,344 ---- + /* SCCS Id: @(#)school.c 3.2 06/26/04 */ + /* NetHack may be freely redistributed. See license for details. */ + /* Copyright 1994, Sebastian Klein */ + + #include "hack.h" + #include + + /*#ifdef USER_SOUNDS*/ + #ifdef OVL0 + + static char *pupil_msgs[] = { + #ifdef JP + + "今日は宿題なしにして ...お願い!", + "6かける9は...んと...えーと... ...42", + "君 ...それは変だよ", /* You're not expected to understand this ... */ + "消えちまえ!", + "ほっといてくれ!", + "情報スーパーハイウェイ構想について,何か知らないかい?", + "何が欲しいんだい?", + "Do the world a favour---jump out of the 20th story of the Uni-Center!", + #else + "Today no homework ... *please*", + "six times nine is ... um ... uh ... ... forty-two", + "you ... Strange word", /* You're not expected to understand this ... */ + "Bugger off!", + "*uck off!", + "What are the newest news about the Super Information Highway?", + "What do you want?", + "Do the world a favour---jump out of the 20th story of the Uni-Center!", + #endif /*JP*/ + NULL + }; + + static char *baumert_msgs[] = { + #ifdef JP + "だめだ! 宿題は毎日出してやる!", + "だれもかれも宿題をやってきたんだって? 嘘じゃないだろうな?", + "その'goes'の用法は耳に悪い!", + #else + "No chance! Every day you'll get homework!", + "Is it really true? Does really _everybody_ have the homework?", + "That usage of the word 'goes' does harm to my ears!", + #endif /*JP*/ + NULL + }; + + static char *gier_msgs[] = { + #ifdef JP + "君の態度はなっとらん!", + "「Stigel酒造」は1492年に設立された.あぁ,この年はコロンブスと関係があるんだが,そっちはどうでもいいことだ.", + "なぜ帰るんだ? たった20分遅刻してきただけじゃないか!", + #else + "Your attitude is really unacceptable!", + "The \"Stigel-Brauerei\" was founded 1492. Well, in that year was that affair with that guy, Columbus, but that really isn't important.", + "Why are you going? I'm only 20 minutes late!", + #endif /*JP*/ + NULL + }; + + static char *dickler_msgs[] = { + #ifdef JP + "何が問題なの? 私じゃ役に立たないかしら", + "わからないの? じゃ,最初からもう一度...(*ふうっ*)", + #else + "Where's your problem? I'll be happy to help you", + "You didn't understand? Then let's begin again ... (*sigh*)", + #endif /*JP*/ + + NULL + }; + + static char *overbeck_msgs[] = { + #ifdef JP + "宿題がない? じゃあこれをあげよう!", + "Overbecks - das Ueberbier", + #else + "No homework yet? - This can be changed!", + "Overbecks - das Ueberbier", + #endif /*JP*/ + + NULL + }; + + static char *klomp_msgs[] = { + #ifdef JP + "今日は炭水化物を脱水してみようか?", + "私が学生だったころ,こんなことがあったんだ...", + "私が化学を学んでいたころ,こんなことがあったんだ...", + #else + "How about dehydrating carbonhydrates today?", + "Back when I was a pupil, the following thing happened ...", + "Back when I was studying chemistry, the following thing happened ...", + #endif /*JP*/ + NULL + }; + + static char *alers_msgs[] = { + #ifdef JP + "... dann ist die Scheisse am dampfen", + "NIKIよ永遠に!", /* Pascal の作者の Niklaus Wirth のこと? */ + "Pascalよ永遠に!", + "確かに...Cで書いた方が楽なのは判ってるんだが,私は単にPascalの方が好きなんだ...", + #else + "... dann ist die Scheisse am dampfen", + "NIKI forever!", + "Pascal forever!", + "Yes ... I know that everything is easier in C, but I simply love Pascal ...", + #endif /*JP*/ + NULL + }; + + static char *geis_msgs[] = { + #ifdef JP + "君は体力が0しかないな.帰りなさい!", + "やれと言ったらやりなさい.骨折なんて気にしてくれるやつはいないよ", + "30分走ったら気分が悪くなった? もう1時間追加!", + "手伝おうか? (と鞭を手に取る)", + #else + "You have Str:0 (at most), so bugger off!", + "Do it - who cares about the odd broken bone?", + "You are sick because you were running for 30 minutes? So run another hour!", + "Shall I help you? (takes the whip)", + #endif /*JP*/ + NULL + }; + + static char *haastert_msgs[] = { + #ifdef JP + "あなたは体力が0しかないわね.帰りなさい!", + "やれと言ったらやるのよ.骨折なんて気にしてくれるやつはいないわ", + "30分走ったら気分が悪くなった? もう1時間追加!", + "手伝いましょうか? (と鞭を手に取る)", + #else /*JP*/ + "You have Str:0 (at most), so bugger off!", + "Do it - who cares about the odd broken bone?", + "You are sick because you were running for 30 minutes? So run another hour!", + "Shall I help you? (takes the whip)", + #endif + NULL + }; + + static char *koerfgen_msgs[] = { + #ifdef JP + "斜めからやってみよう.(にんまり) (顔の汗を拭いながら)", + "(にんまり)", + "さて(にんまり),何かしないといかんな!(にんまり)", + #else + "We'll do that diagonally. *grin* (wipes sweat off head)", + "*grin*", + "You know, (*grin*) we'll have to do something now! (*grin*)", + #endif /*JP*/ + NULL + }; + + static char *ennen_msgs[] = { + #ifdef JP + "学生実験をやらんかね? - 耳をちょん切ろうか?", + "学生実験のテーマに「青酸カリ摂取の結果」ってのはどうだろう", + #else + "How about a pupil experiment - cut off your ears?", + "Yet another pupil experiment: the consequences of KCN ingested.", + #endif /*JP*/ + NULL + }; + + static char *ellerhold_msgs[] = { + #ifdef JP + "宿題が出ないなどと思わないように!", + "祝日は宿題なしだぁ? どうせ何かしなきゃならないだろうが!", + "君の低いレベルじゃぁ合格点はやれないね!", + #else + "Don't expect to get away without homework!", + "No homework in the holidays? You must have something to do, after all!", + "The low level of you all is really beyond acception!", + #endif /*JP*/ + NULL + }; + + static char *hartstone_msgs[] = { + #ifdef JP + "農場の監督管理の仕事は終りがないんだ...", + #else + "There was endless work in the supervision and administration of the farm ...", + /* it's really a shame that I can't think of more messages for him */ + #endif /*JP*/ + NULL + }; + + static char *arimura_msgs[] = { + "Yukiho-tan haa haa", + "I want to play games... *sigh* ", + "*sigh* (thinking of games idly)", + + NULL + }; + + static char *generic_msgs[] = { + #ifdef JP + "宿題は几帳面に,注意深くやるように!", + "この頃の課題はほんとに簡単だ!", + "私の頃は生徒は生徒らしくて,先生も先生らしかったものだ!", + "生徒は生徒らしくて,先生も先生らしかった頃は何もかも今よりましだったぞ!", + #else + "I expect you to do your homework _regularly_ and _carefully_!", + "The level of work is really very low nowadays!", + "In _our_ times pupils were real pupils and teachers were real teachers!", + "Back when pupils where real pupils and teachers were real teachers, everything was better!", + #endif /*JP*/ + NULL + }; + + static char *generic_female_msgs[] = { + #ifdef JP + "宿題は几帳面に,注意深くやってちょうだい!", + "この頃の課題はほんとに簡単だわ!", + "私の頃は生徒は生徒らしくて,先生も先生らしかったものよ!", + "生徒は生徒らしくて,先生も先生らしかった頃は何もかも今よりましだったわ!", + #else + "I expect you to do your homework _regularly_ and _carefully_!", + "The level of work is really very low nowadays!", + "In _our_ times pupils were real pupils and teachers were real teachers!", + "Back when pupils where real pupils and teachers were real teachers, everything was better!", + #endif /*JP*/ + NULL + }; + + static struct teacher_msg_desc { + char *teacher_name; + char **messages; + } teacher_msgs[] = { + { "Mr. Baumert", baumert_msgs }, + { "Mr. Gier", gier_msgs }, + { "Mrs. Dickler", dickler_msgs }, + { "Mr. Overbeck", overbeck_msgs }, + { "Mr. Klomp", klomp_msgs }, + { "Mr. Alers", alers_msgs }, + { "Mr. Geis", geis_msgs }, + { "Mrs. Haastert", haastert_msgs }, + { "Mr. Koerfgen", koerfgen_msgs }, + { "Mr. Ennen", ennen_msgs }, + { "Mr. Ellerhold", ellerhold_msgs }, + { "Mr. Hartstone", hartstone_msgs }, + + { "Mr. Arimura" , arimura_msgs }, + { NULL, generic_msgs }, + { NULL, generic_female_msgs } + }; + + static char *principal_msgs[] = { + #ifdef JP + "何だね?", + "気分が悪い.しなくちゃならんことが山積みだ!", + "手伝ってくれ,気絶しそうだ!", + "We'll do that in groups of one person!", + #else + "What's up?", + "I really feel sick - there are so many things to do!", + "Help me, I faint!", + "We'll do that in groups of one person!", + #endif /*JP*/ + NULL + }; + + boolean + is_principal(mon) + struct monst * mon; + { + return(mon->mnum == PM_PRINCIPAL); + } + + boolean + is_teacher(mon) + struct monst * mon; + { + return(mon->mnum == PM_TEACHER); + } + + boolean + is_educator(mon) + struct monst * mon; + { + return(is_teacher(mon) || is_principal(mon)); + } + + static void + select_message(msgs) + char **msgs; + { + int i; + + i = 0; + while (msgs[i] != NULL) i++; + verbalize(msgs[rn2(i)]); + + } + + static void + select_teacher_message(mmsgs, tname) + struct teacher_msg_desc *mmsgs; + char *tname; + { + int i; + + i = 0; + while (mmsgs[i].teacher_name != NULL) { + if (strcmp(mmsgs[i].teacher_name,tname) == 0) { + select_message(mmsgs[i].messages); + return; + } + i++; + } + /* i now indexes generic_msgs, female teachers should use next one */ + if (strncmp(tname, "Mrs. ", 4) == 0 || strncmp(tname, "Ms. ", 3) == 0) i++; + select_message(mmsgs[i].messages); + } + + void + pupil_sound(mon) + struct monst *mon; + { + select_message(pupil_msgs); + } + + void + teacher_sound(mon) + struct monst *mon; + { + select_teacher_message(teacher_msgs,NAME(mon)); + } + + void + principal_sound(mon) + struct monst *mon; + { + select_message(principal_msgs); + } + + #endif /* OVL0 */ + + /*#endif*/ /* USER_SOUNDS */ + + /* school.c */ + diff -rN -c slashem-0.0.7E7F2/src/shk.c geekslashem-0.0.7E7F2/src/shk.c *** slashem-0.0.7E7F2/src/shk.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/shk.c 2006-04-21 01:01:56.000000000 +0900 *************** *** 3355,3360 **** --- 3355,3363 ---- tmp /= 2L; } } + #ifdef GEEK + if (obj->otyp == IC && obj->cursed) tmp /= 20L; + #endif break; } return tmp; diff -rN -c slashem-0.0.7E7F2/src/sounds.c geekslashem-0.0.7E7F2/src/sounds.c *** slashem-0.0.7E7F2/src/sounds.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/sounds.c 2006-04-26 01:17:27.000000000 +0900 *************** *** 939,944 **** --- 939,955 ---- pline_msg = "is busy reading a copy of Sandman #8."; else verbl_msg = "Who do you think you are, War?"; break; + #ifdef GEEK + case MS_PUPIL: + pupil_sound(mtmp); + break; + case MS_TEACHER: + teacher_sound(mtmp); + break; + case MS_PRINCIPAL: + principal_sound(mtmp); + break; + #endif /* GEEK */ } if (pline_msg) pline("%s %s", Monnam(mtmp), pline_msg); diff -rN -c slashem-0.0.7E7F2/src/tech.c geekslashem-0.0.7E7F2/src/tech.c *** slashem-0.0.7E7F2/src/tech.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/tech.c 2006-04-26 00:13:27.000000000 +0900 *************** *** 106,111 **** --- 106,115 ---- { 12, T_POWER_SURGE, 1}, { 20, T_SIGIL_DISCHARGE, 1}, { 0, 0, 0} }, + #ifdef GEEK + gek_tech[] = { { 7, T_TINKER, 1}, + { 0, 0, 0} }, + #endif /* GEEK */ kni_tech[] = { { 1, T_TURN_UNDEAD, 1}, { 1, T_HEAL_HANDS, 1}, { 0, 0, 0} }, *************** *** 1626,1631 **** --- 1630,1638 ---- case PM_BARBARIAN: return (bar_tech); case PM_CAVEMAN: return (cav_tech); case PM_FLAME_MAGE: return (fla_tech); + #ifdef GEEK + case PM_GEEK: return (gek_tech); + #endif case PM_HEALER: return (hea_tech); case PM_ICE_MAGE: return (ice_tech); case PM_KNIGHT: return (kni_tech); diff -rN -c slashem-0.0.7E7F2/src/u_init.c geekslashem-0.0.7E7F2/src/u_init.c *** slashem-0.0.7E7F2/src/u_init.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/u_init.c 2006-04-23 00:25:46.000000000 +0900 *************** *** 72,77 **** --- 72,90 ---- { UNDEF_TYP, UNDEF_SPE, SPBOOK_CLASS, 1, 1 }, { 0, 0, 0, 0, 0 } }; + #ifdef GEEK + static struct trobj Geek[] = { + #define G_LIGHTSABER 0 + { UNDEF_TYP, 1, WEAPON_CLASS, 1, 1 }, + #define G_IC 1 + { IC, 0, TOOL_CLASS, 7, UNDEF_BLESS }, /* quan is var. */ + { GAUNTLETS_OF_TYPING, 1, ARMOR_CLASS, 1, UNDEF_BLESS }, + { POT_JOLT_COLA, 0, POTION_CLASS, 4, UNDEF_BLESS }, + { HACKER_S_FOOD, 0, FOOD_CLASS, 2, UNDEF_BLESS }, + { PACK_OF_FLOPPIES, 0, TOOL_CLASS, 1, UNDEF_BLESS }, + { 0, 0, 0, 0, 0 } + }; + #endif static struct trobj Healer[] = { { SCALPEL, 1, WEAPON_CLASS, 1, UNDEF_BLESS }, { LEATHER_GLOVES, 1, ARMOR_CLASS, 1, UNDEF_BLESS }, *************** *** 481,486 **** --- 494,523 ---- { P_NONE, 0 } }; + #ifdef GEEK + static const struct def_skill Skill_G[] = { + { P_DAGGER, P_SKILLED }, { P_KNIFE, P_EXPERT }, + { P_AXE, P_BASIC }, { P_PICK_AXE, P_BASIC }, + { P_SHORT_SWORD, P_SKILLED }, { P_BROAD_SWORD, P_BASIC }, + { P_LONG_SWORD, P_EXPERT }, { P_TWO_HANDED_SWORD, P_BASIC }, + { P_SABER, P_EXPERT }, { P_MACE, P_BASIC }, + { P_HAMMER, P_SKILLED }, { P_BOW, P_BASIC }, + { P_CROSSBOW, P_BASIC }, { P_DART, P_SKILLED }, + { P_SHURIKEN, P_SKILLED }, { P_BOOMERANG, P_SKILLED }, + { P_WHIP, P_EXPERT }, { P_UNICORN_HORN, P_BASIC }, + { P_ATTACK_SPELL, P_EXPERT }, { P_HEALING_SPELL, P_BASIC }, + { P_DIVINATION_SPELL, P_EXPERT }, { P_ENCHANTMENT_SPELL, P_SKILLED }, + { P_PROTECTION_SPELL, P_BASIC }, { P_BODY_SPELL, P_BASIC }, + { P_MATTER_SPELL, P_EXPERT }, + #ifdef STEED + { P_RIDING, P_SKILLED }, + #endif + { P_TWO_WEAPON_COMBAT, P_SKILLED }, + { P_BARE_HANDED_COMBAT, P_SKILLED }, + { P_NONE, 0 } + }; + #endif + static const struct def_skill Skill_H[] = { { P_DAGGER, P_SKILLED }, { P_KNIFE, P_EXPERT }, { P_SHORT_SWORD, P_SKILLED }, { P_SCIMITAR, P_BASIC }, *************** *** 967,972 **** --- 1004,1013 ---- u.utotype = 0; #endif /* 0 */ + #ifdef GEEK + u.uprotected = 0; + #endif /* GEEK */ + u.uz.dlevel = 1; u.uz0.dlevel = 0; u.utolev = u.uz; *************** *** 1064,1069 **** --- 1105,1129 ---- else if(!rn2(5)) ini_inv(Magicmarker); skill_init(Skill_F); break; + #ifdef GEEK + case PM_GEEK: + switch (rnd(3)){ + case 1:Geek[G_LIGHTSABER].trotyp = RED_LIGHTSABER;break; + case 2:Geek[G_LIGHTSABER].trotyp = BLUE_LIGHTSABER;break; + case 3:Geek[G_LIGHTSABER].trotyp = GREEN_LIGHTSABER;break; + }/* Maybe needs charge fixed here*/ + Geek[G_IC].trquan = rn2(7) + 1; + ini_inv(Geek); + knows_class(WEAPON_CLASS); + knows_class(ARMOR_CLASS); + knows_object(PACK_OF_FLOPPIES); + knows_object(POT_JOLT_COLA); + knows_object(DIODE); + knows_object(TRANSISTOR); + knows_object(IC); + skill_init(Skill_G); + break; + #endif /* GEEK */ case PM_HEALER: #ifndef GOLDOBJ u.ugold = u.ugold0 = rn1(1000, 1001); *************** *** 1448,1453 **** --- 1508,1514 ---- case PM_ARCHEOLOGIST: skills = Skill_A; break; case PM_BARBARIAN: skills = Skill_B; break; case PM_CAVEMAN: skills = Skill_C; break; + /*case PM_GEEK: skills = Skill_G; break;*/ case PM_HEALER: skills = Skill_H; break; case PM_KNIGHT: skills = Skill_K; break; case PM_MONK: skills = Skill_Mon; break; diff -rN -c slashem-0.0.7E7F2/src/weapon.c geekslashem-0.0.7E7F2/src/weapon.c *** slashem-0.0.7E7F2/src/weapon.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/weapon.c 2006-04-21 23:24:43.000000000 +0900 *************** *** 618,624 **** GREEN_LIGHTSABER, #endif TWO_HANDED_SWORD, BATTLE_AXE, ! KATANA, UNICORN_HORN, CRYSKNIFE, TRIDENT, LONG_SWORD, ELVEN_BROADSWORD, BROADSWORD, SCIMITAR, SILVER_SABER, SILVER_SHORT_SWORD, SILVER_LONG_SWORD, SILVER_MACE, MORNING_STAR, DARK_ELVEN_SHORT_SWORD, ELVEN_SHORT_SWORD, --- 618,625 ---- GREEN_LIGHTSABER, #endif TWO_HANDED_SWORD, BATTLE_AXE, ! KATANA, UNICORN_HORN, CRYSKNIFE, ! TRIDENT, LONG_SWORD, ELVEN_BROADSWORD, BROADSWORD, SCIMITAR, SILVER_SABER, SILVER_SHORT_SWORD, SILVER_LONG_SWORD, SILVER_MACE, MORNING_STAR, DARK_ELVEN_SHORT_SWORD, ELVEN_SHORT_SWORD, diff -rN -c slashem-0.0.7E7F2/src/zap.c geekslashem-0.0.7E7F2/src/zap.c *** slashem-0.0.7E7F2/src/zap.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/src/zap.c 2006-04-28 00:21:09.000000000 +0900 *************** *** 2099,2105 **** --- 2099,2119 ---- pline_The("feeling subsides."); exercise(A_WIS, TRUE); break; + #ifdef GEEK + case WAN_BUGGING: { + int i; + + i = rn2(6) + 1; + while (i--) { + if(makemon(&mons[rn2(3) ? PM_BUG : PM_HEISENBUG], + u.ux,u.uy, NO_MINVENT)) + known = TRUE; + } + } break; + #endif /* GEEK */ + } + if (known && !objects[obj->otyp].oc_name_known) { makeknown(obj->otyp); more_experienced(0,10); diff -rN -c slashem-0.0.7E7F2/sys/unix/Makefile.dat geekslashem-0.0.7E7F2/sys/unix/Makefile.dat *** slashem-0.0.7E7F2/sys/unix/Makefile.dat 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/sys/unix/Makefile.dat 2006-04-29 22:58:03.000000000 +0900 *************** *** 258,265 **** endgame.des frnknstn.des gehennom.des giants.des guild.des knox.des \ kobold-1.des kobold-2.des lich.des mall-1.des mall-2.des medusa.des \ mines.des mtemple.des newmall.des nightmar.des nymph.des oracle.des \ ! rats.des sea.des spiders.des stor-1.des stor-2.des stor-3.des tomb.des \ ! tower.des yendor.des sokoban.des ../util/lev_comp beholder.des ../util/lev_comp bigroom.des ../util/lev_comp blkmar.des --- 258,265 ---- endgame.des frnknstn.des gehennom.des giants.des guild.des knox.des \ kobold-1.des kobold-2.des lich.des mall-1.des mall-2.des medusa.des \ mines.des mtemple.des newmall.des nightmar.des nymph.des oracle.des \ ! rats.des sea.des spiders.des stor-1.des stor-2.des stor-3.des tng.des \ ! tomb.des tower.des yendor.des sokoban.des ../util/lev_comp beholder.des ../util/lev_comp bigroom.des ../util/lev_comp blkmar.des *************** *** 291,309 **** ../util/lev_comp stor-1.des ../util/lev_comp stor-2.des ../util/lev_comp stor-3.des ../util/lev_comp tomb.des ../util/lev_comp tower.des ../util/lev_comp yendor.des touch spec_levs quest_levs: ../util/lev_comp \ ! Arch.des Barb.des Caveman.des Flame.des Healer.des Ice.des Knight.des \ Monk.des Necro.des Priest.des Ranger.des Rogue.des Samurai.des \ Tourist.des Slayer.des Valkyrie.des Wizard.des Yeoman.des ../util/lev_comp Arch.des ../util/lev_comp Barb.des ../util/lev_comp Caveman.des ../util/lev_comp Flame.des ../util/lev_comp Healer.des ../util/lev_comp Ice.des ../util/lev_comp Knight.des --- 291,315 ---- ../util/lev_comp stor-1.des ../util/lev_comp stor-2.des ../util/lev_comp stor-3.des + @if egrep -s geek options > /dev/null ; then \ + echo ../util/lev_comp tng.des ; ../util/lev_comp tng.des ; \ + else rm -f school.lev computer.lev ; fi ../util/lev_comp tomb.des ../util/lev_comp tower.des ../util/lev_comp yendor.des touch spec_levs quest_levs: ../util/lev_comp \ ! Arch.des Barb.des Caveman.des Flame.des Geek.des Healer.des Ice.des Knight.des \ Monk.des Necro.des Priest.des Ranger.des Rogue.des Samurai.des \ Tourist.des Slayer.des Valkyrie.des Wizard.des Yeoman.des ../util/lev_comp Arch.des ../util/lev_comp Barb.des ../util/lev_comp Caveman.des ../util/lev_comp Flame.des + @if egrep -s geek options > /dev/null ; then \ + echo ../util/lev_comp Geek.des ; ../util/lev_comp Geek.des ; \ + else rm -f Gek-goal.lev Gek-fil?.lev Gek-loca.lev Gek-strt.lev ; fi ../util/lev_comp Healer.des ../util/lev_comp Ice.des ../util/lev_comp Knight.des diff -rN -c slashem-0.0.7E7F2/sys/unix/Makefile.src geekslashem-0.0.7E7F2/sys/unix/Makefile.src *** slashem-0.0.7E7F2/sys/unix/Makefile.src 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/sys/unix/Makefile.src 2006-04-30 00:56:41.000000000 +0900 *************** *** 431,436 **** --- 431,444 ---- # used by `make depend' to reconstruct this Makefile; you shouldn't need this AWK = nawk + # optional source files + + OPTSRCGEEK= school.c + OPTOBJGEEK= school.o + + OPTGEEK:=$(shell grep -s geek ../dat/options) + + # ---------------------------------------- # # Nothing below this line should have to be changed. *************** *** 463,468 **** --- 471,481 ---- windows.c wizard.c worm.c worn.c write.c zap.c \ gypsy.c tech.c + + ifneq "x$(OPTGEEK)" "x" + HACKCSRC+= $(OPTSRCGEEK) + endif + # all operating-system-dependent .c (for dependencies and such) SYSCSRC = ../sys/atari/tos.c ../sys/share/pcmain.c ../sys/share/pcsys.c \ ../sys/share/pctty.c ../sys/share/pcunix.c ../sys/share/random.c \ *************** *** 523,528 **** --- 536,546 ---- wizard.o worm.o worn.o write.o zap.o \ gypsy.o tech.o \ $(RANDOBJ) $(SYSOBJ) $(WINOBJ) version.o + + ifneq "x$(OPTGEEK)" "x" + HOBJ+= $(OPTGEEKOBJ) + endif + # the .o files from the HACKCSRC, SYSSRC, and WINSRC lists $(GAME): $(SYSTEM) *************** *** 1122,1127 **** --- 1140,1147 ---- zap.o: zap.c $(HACK_H) gypsy.o: gypsy.c $(HACK_H) ../include/egyp.h ../include/qtext.h tech.o: tech.c $(HACK_H) + school.o: school.c $(HACK_H) + # DEPENDENCIES MUST END AT END OF FILE # IF YOU PUT STUFF HERE IT WILL GO AWAY # see make depend above diff -rN -c slashem-0.0.7E7F2/sys/unix/Makefile.top geekslashem-0.0.7E7F2/sys/unix/Makefile.top *** slashem-0.0.7E7F2/sys/unix/Makefile.top 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/sys/unix/Makefile.top 2006-04-29 23:07:09.000000000 +0900 *************** *** 138,143 **** --- 138,150 ---- tomb.lev yeenoghu.lev frnknstn.lev nightmar.lev QUEST_LEVS = ???-goal.lev ???-fil?.lev ???-loca.lev ???-strt.lev + OPTSPEC_LEVSGEEK= school.lev computer.lev + OPTGEEK:=$(shell grep -s geek dat/options) + + ifneq "x$(OPTGEEK)" "x" + SPEC_LEVS+= $(OPTSPEC_LEVSGEEK) + endif + SHARE_DATNODLB = $(CNF_SHARE_DATND) UNSHARE_DATNODLB = SHARE_DATDLB = $(DATHELP) $(CNF_SHARE_DATD) diff -rN -c slashem-0.0.7E7F2/util/dgn_lex.c geekslashem-0.0.7E7F2/util/dgn_lex.c *** slashem-0.0.7E7F2/util/dgn_lex.c 1970-01-01 09:00:00.000000000 +0900 --- geekslashem-0.0.7E7F2/util/dgn_lex.c 2006-04-22 15:48:42.000000000 +0900 *************** *** 0 **** --- 1,2080 ---- + + #line 3 "lex.yy.c" + + #define YY_INT_ALIGNED short int + + /* A lexical scanner generated by flex */ + + #define FLEX_SCANNER + #define YY_FLEX_MAJOR_VERSION 2 + #define YY_FLEX_MINOR_VERSION 5 + #define YY_FLEX_SUBMINOR_VERSION 31 + #if YY_FLEX_SUBMINOR_VERSION > 0 + #define FLEX_BETA + #endif + + /* First, we deal with platform-specific or compiler-specific issues. */ + + /* begin standard C headers. */ + #include + #include + #include + #include + + /* end standard C headers. */ + + /* flex integer type definitions */ + + #ifndef FLEXINT_H + #define FLEXINT_H + + /* C99 systems have . Non-C99 systems may or may not. */ + + #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L + #include + typedef int8_t flex_int8_t; + typedef uint8_t flex_uint8_t; + typedef int16_t flex_int16_t; + typedef uint16_t flex_uint16_t; + typedef int32_t flex_int32_t; + typedef uint32_t flex_uint32_t; + #else + typedef signed char flex_int8_t; + typedef short int flex_int16_t; + typedef int flex_int32_t; + typedef unsigned char flex_uint8_t; + typedef unsigned short int flex_uint16_t; + typedef unsigned int flex_uint32_t; + #endif /* ! C99 */ + + /* Limits of integral types. */ + #ifndef INT8_MIN + #define INT8_MIN (-128) + #endif + #ifndef INT16_MIN + #define INT16_MIN (-32767-1) + #endif + #ifndef INT32_MIN + #define INT32_MIN (-2147483647-1) + #endif + #ifndef INT8_MAX + #define INT8_MAX (127) + #endif + #ifndef INT16_MAX + #define INT16_MAX (32767) + #endif + #ifndef INT32_MAX + #define INT32_MAX (2147483647) + #endif + #ifndef UINT8_MAX + #define UINT8_MAX (255U) + #endif + #ifndef UINT16_MAX + #define UINT16_MAX (65535U) + #endif + #ifndef UINT32_MAX + #define UINT32_MAX (4294967295U) + #endif + + #endif /* ! FLEXINT_H */ + + #ifdef __cplusplus + + /* The "const" storage-class-modifier is valid. */ + #define YY_USE_CONST + + #else /* ! __cplusplus */ + + #if __STDC__ + + #define YY_USE_CONST + + #endif /* __STDC__ */ + #endif /* ! __cplusplus */ + + #ifdef YY_USE_CONST + #define yyconst const + #else + #define yyconst + #endif + + /* Returned upon end-of-file. */ + #define YY_NULL 0 + + /* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ + #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + + /* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ + #define BEGIN (yy_start) = 1 + 2 * + + /* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ + #define YY_START (((yy_start) - 1) / 2) + #define YYSTATE YY_START + + /* Action number for EOF rule of a given start state. */ + #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + + /* Special action meaning "start processing a new file". */ + #define YY_NEW_FILE yyrestart(yyin ) + + #define YY_END_OF_BUFFER_CHAR 0 + + /* Size of default input buffer. */ + #ifndef YY_BUF_SIZE + #define YY_BUF_SIZE 16384 + #endif + + #ifndef YY_TYPEDEF_YY_BUFFER_STATE + #define YY_TYPEDEF_YY_BUFFER_STATE + typedef struct yy_buffer_state *YY_BUFFER_STATE; + #endif + + extern int yyleng; + + extern FILE *yyin, *yyout; + + #define EOB_ACT_CONTINUE_SCAN 0 + #define EOB_ACT_END_OF_FILE 1 + #define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + + /* Return all but the first "n" matched characters back to the input stream. */ + #define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + + #define unput(c) yyunput( c, (yytext_ptr) ) + + /* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ + + #ifndef YY_TYPEDEF_YY_SIZE_T + #define YY_TYPEDEF_YY_SIZE_T + typedef unsigned int yy_size_t; + #endif + + #ifndef YY_STRUCT_YY_BUFFER_STATE + #define YY_STRUCT_YY_BUFFER_STATE + struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + #define YY_BUFFER_NEW 0 + #define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ + #define YY_BUFFER_EOF_PENDING 2 + + }; + #endif /* !YY_STRUCT_YY_BUFFER_STATE */ + + /* Stack of input buffers. */ + static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ + static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ + static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + + /* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ + #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + + /* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ + #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + + /* yy_hold_char holds the character lost when yytext is formed. */ + static char yy_hold_char; + static int yy_n_chars; /* number of characters read into yy_ch_buf */ + int yyleng; + + /* Points to current character in buffer. */ + static char *yy_c_buf_p = (char *) 0; + static int yy_init = 1; /* whether we need to initialize */ + static int yy_start = 0; /* start state number */ + + /* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ + static int yy_did_buffer_switch_on_eof; + + void yyrestart (FILE *input_file ); + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); + YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); + void yy_delete_buffer (YY_BUFFER_STATE b ); + void yy_flush_buffer (YY_BUFFER_STATE b ); + void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); + void yypop_buffer_state (void ); + + static void yyensure_buffer_stack (void ); + static void yy_load_buffer_state (void ); + static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); + + #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) + + YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); + YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); + YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); + + void *yyalloc (yy_size_t ); + void *yyrealloc (void *,yy_size_t ); + void yyfree (void * ); + + #define yy_new_buffer yy_create_buffer + + #define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + + #define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + + #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + + /* Begin user sect3 */ + + typedef unsigned char YY_CHAR; + + FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + + typedef int yy_state_type; + + extern int yylineno; + + int yylineno = 1; + + extern char *yytext; + #define yytext_ptr yytext + + static yy_state_type yy_get_previous_state (void ); + static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); + static int yy_get_next_buffer (void ); + static void yy_fatal_error (yyconst char msg[] ); + + /* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ + #define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + + #define YY_NUM_RULES 35 + #define YY_END_OF_BUFFER 36 + /* This struct is not used in this scanner, + but its presence is necessary. */ + struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; + static yyconst flex_int16_t yy_accept[196] = + { 0, + 0, 0, 36, 34, 33, 32, 34, 34, 29, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 33, + 32, 0, 30, 29, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2, 0, 31, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, + 4, 0, 25, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 6, 0, 0, 0, 5, 0, 0, 23, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 20, 0, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 0, 22, + 15, 0, 21, 7, 19, 0, 0, 0, 0, 0, + 0, 13, 0, 0, 0, 26, 16, 0, 0, 12, + 0, 0, 0, 11, 9, 0, 17, 18, 0, 27, + 0, 28, 24, 10, 0 + + } ; + + static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 5, 6, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 7, 1, 1, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, + 1, 1, 1, 1, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 1, 1, 17, 18, 19, 20, 21, + 1, 22, 23, 24, 25, 26, 1, 1, 27, 1, + 1, 1, 1, 1, 28, 1, 29, 1, 30, 31, + + 32, 33, 34, 35, 36, 1, 37, 38, 39, 40, + 41, 42, 1, 43, 44, 45, 46, 1, 47, 1, + 1, 48, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + + static yyconst flex_int32_t yy_meta[49] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1 + } ; + + static yyconst flex_int16_t yy_base[198] = + { 0, + 0, 213, 218, 220, 215, 220, 213, 210, 207, 196, + 190, 196, 37, 191, 197, 186, 188, 171, 164, 172, + 174, 173, 18, 160, 159, 154, 157, 11, 194, 194, + 220, 190, 220, 187, 177, 184, 183, 167, 170, 164, + 161, 166, 174, 155, 136, 144, 134, 132, 133, 26, + 135, 143, 147, 128, 145, 220, 170, 220, 158, 152, + 154, 159, 154, 145, 44, 142, 47, 124, 124, 125, + 129, 129, 115, 27, 121, 113, 111, 120, 115, 116, + 134, 142, 132, 128, 137, 121, 130, 129, 125, 129, + 131, 97, 220, 105, 94, 101, 95, 96, 94, 99, + + 105, 101, 89, 220, 95, 112, 114, 51, 112, 107, + 220, 110, 114, 111, 106, 96, 85, 76, 81, 82, + 88, 69, 220, 81, 76, 75, 220, 78, 99, 220, + 88, 97, 87, 88, 92, 93, 88, 91, 90, 71, + 65, 220, 62, 60, 57, 56, 220, 59, 54, 74, + 84, 65, 66, 220, 70, 65, 70, 60, 68, 220, + 220, 52, 220, 220, 220, 46, 50, 57, 61, 67, + 62, 220, 67, 64, 63, 220, 220, 42, 41, 220, + 61, 53, 49, 220, 220, 50, 220, 220, 51, 220, + 46, 220, 220, 220, 220, 62, 60 + + } ; + + static yyconst flex_int16_t yy_def[198] = + { 0, + 195, 1, 195, 195, 195, 195, 195, 196, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 197, 195, + 195, 196, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 197, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 0, 195, 195 + + } ; + + static yyconst flex_int16_t yy_nxt[269] = + { 0, + 4, 5, 6, 7, 8, 4, 9, 10, 11, 12, + 13, 14, 4, 4, 4, 4, 15, 4, 4, 4, + 16, 17, 4, 4, 4, 4, 4, 4, 4, 18, + 19, 4, 4, 4, 20, 4, 4, 21, 22, 23, + 4, 24, 25, 26, 27, 28, 4, 4, 38, 49, + 55, 87, 56, 74, 75, 88, 90, 98, 50, 131, + 57, 39, 32, 91, 194, 193, 192, 132, 191, 190, + 189, 188, 99, 187, 186, 185, 184, 183, 182, 181, + 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, + 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, + + 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, + 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, + 140, 139, 138, 137, 136, 135, 134, 133, 130, 129, + 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, + 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, + 108, 107, 106, 105, 104, 103, 102, 101, 100, 97, + 96, 95, 94, 93, 92, 89, 86, 85, 84, 83, + 82, 81, 58, 80, 79, 78, 77, 76, 73, 72, + 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, + 61, 60, 59, 34, 33, 30, 58, 54, 53, 52, + + 51, 48, 47, 46, 45, 44, 43, 42, 41, 40, + 37, 36, 35, 34, 33, 31, 30, 195, 29, 3, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195 + } ; + + static yyconst flex_int16_t yy_chk[269] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 13, 23, + 28, 65, 28, 50, 50, 65, 67, 74, 23, 108, + 197, 13, 196, 67, 191, 189, 186, 108, 183, 182, + 181, 179, 74, 178, 175, 174, 173, 171, 170, 169, + 168, 167, 166, 162, 159, 158, 157, 156, 155, 153, + 152, 151, 150, 149, 148, 146, 145, 144, 143, 141, + + 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, + 129, 128, 126, 125, 124, 122, 121, 120, 119, 118, + 117, 116, 115, 114, 113, 112, 110, 109, 107, 106, + 105, 103, 102, 101, 100, 99, 98, 97, 96, 95, + 94, 92, 91, 90, 89, 88, 87, 86, 85, 84, + 83, 82, 81, 80, 79, 78, 77, 76, 75, 73, + 72, 71, 70, 69, 68, 66, 64, 63, 62, 61, + 60, 59, 57, 55, 54, 53, 52, 51, 49, 48, + 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, + 37, 36, 35, 34, 32, 30, 29, 27, 26, 25, + + 24, 22, 21, 20, 19, 18, 17, 16, 15, 14, + 12, 11, 10, 9, 8, 7, 5, 3, 2, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195 + } ; + + static yy_state_type yy_last_accepting_state; + static char *yy_last_accepting_cpos; + + extern int yy_flex_debug; + int yy_flex_debug = 0; + + /* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ + #define REJECT reject_used_but_not_detected + #define yymore() yymore_used_but_not_detected + #define YY_MORE_ADJ 0 + #define YY_RESTORE_YY_MORE_OFFSET + char *yytext; + #line 1 "dgn_comp.l" + #line 2 "dgn_comp.l" + /* SCCS Id: @(#)dgn_lex.c 3.4 2002/03/27 */ + /* Copyright (c) 1989 by Jean-Christophe Collet */ + /* Copyright (c) 1990 by M. Stephenson */ + /* NetHack may be freely redistributed. See license for details. */ + + #define DGN_COMP + + #include "config.h" + #include "dgn_comp.h" + #include "dgn_file.h" + + /* + * Most of these don't exist in flex, yywrap is macro and + * yyunput is properly declared in flex.skel. + */ + #if !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER) + int FDECL(yyback, (int *,int)); + int NDECL(yylook); + int NDECL(yyinput); + int NDECL(yywrap); + int NDECL(yylex); + /* Traditional lexes let yyunput() and yyoutput() default to int; + * newer ones may declare them as void since they don't return + * values. For even more fun, the lex supplied as part of the + * newer unbundled compiler for SunOS 4.x adds the void declarations + * (under __STDC__ or _cplusplus ifdefs -- otherwise they remain + * int) while the bundled lex and the one with the older unbundled + * compiler do not. To detect this, we need help from outside -- + * sys/unix/Makefile.utl. + * + * Digital UNIX is difficult and still has int in spite of all + * other signs. + */ + # if defined(NeXT) || defined(SVR4) || defined(_AIX32) + # define VOIDYYPUT + # endif + # if !defined(VOIDYYPUT) && defined(POSIX_TYPES) + # if !defined(BOS) && !defined(HISX) && !defined(_M_UNIX) && !defined(VMS) + # define VOIDYYPUT + # endif + # endif + # if !defined(VOIDYYPUT) && defined(WEIRD_LEX) + # if defined(SUNOS4) && defined(__STDC__) && (WEIRD_LEX > 1) + # define VOIDYYPUT + # endif + # endif + # if defined(VOIDYYPUT) && defined(__osf__) + # undef VOIDYYPUT + # endif + # ifdef VOIDYYPUT + void FDECL(yyunput, (int)); + void FDECL(yyoutput, (int)); + # else + int FDECL(yyunput, (int)); + int FDECL(yyoutput, (int)); + # endif + #endif /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ + + #ifdef FLEX_SCANNER + #define YY_MALLOC_DECL \ + genericptr_t FDECL(malloc, (size_t)); \ + genericptr_t FDECL(realloc, (genericptr_t,size_t)); + #endif + + + void FDECL(init_yyin, (FILE *)); + void FDECL(init_yyout, (FILE *)); + + /* this doesn't always get put in dgn_comp.h + * (esp. when using older versions of bison) + */ + + extern YYSTYPE yylval; + + int line_number = 1; + /* + * This is a hack required by Michael Hamel to get things + * working on the Mac. + */ + #if defined(MAC_MPW) && !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER) + #undef input + #undef unput + #define unput(c) { yytchar = (c); if (yytchar == 10) yylineno--; *yysptr++ = yytchar; } + # ifndef YYNEWLINE + # define YYNEWLINE 10 + # endif + + char + input() /* Under MPW \n is chr(13)! Compensate for this. */ + { + if (yysptr > yysbuf) return(*--yysptr); + else { + yytchar = getc(yyin); + if (yytchar == '\n') { + yylineno++; + return(YYNEWLINE); + } + if (yytchar == EOF) return(0); + else return(yytchar); + } + } + #endif /* MAC_MPW && !FLEX_SCANNER && !FLEXHACK_SCANNER */ + + #line 668 "lex.yy.c" + + #define INITIAL 0 + + #ifndef YY_NO_UNISTD_H + /* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ + #include + #endif + + #ifndef YY_EXTRA_TYPE + #define YY_EXTRA_TYPE void * + #endif + + /* Macros after this point can all be overridden by user definitions in + * section 1. + */ + + #ifndef YY_SKIP_YYWRAP + #ifdef __cplusplus + extern "C" int yywrap (void ); + #else + extern int yywrap (void ); + #endif + #endif + + static void yyunput (int c,char *buf_ptr ); + + #ifndef yytext_ptr + static void yy_flex_strncpy (char *,yyconst char *,int ); + #endif + + #ifdef YY_NEED_STRLEN + static int yy_flex_strlen (yyconst char * ); + #endif + + #ifndef YY_NO_INPUT + + #ifdef __cplusplus + static int yyinput (void ); + #else + static int input (void ); + #endif + + #endif + + /* Amount of stuff to slurp up with each read. */ + #ifndef YY_READ_BUF_SIZE + #define YY_READ_BUF_SIZE 8192 + #endif + + /* Copy whatever the last rule matched to the standard output. */ + #ifndef ECHO + /* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ + #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) + #endif + + /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ + #ifndef YY_INPUT + #define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ + \ + + #endif + + /* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ + #ifndef yyterminate + #define yyterminate() return YY_NULL + #endif + + /* Number of entries by which start-condition stack grows. */ + #ifndef YY_START_STACK_INCR + #define YY_START_STACK_INCR 25 + #endif + + /* Report a fatal error. */ + #ifndef YY_FATAL_ERROR + #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) + #endif + + /* end tables serialization structures and prototypes */ + + /* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ + #ifndef YY_DECL + #define YY_DECL_IS_OURS 1 + + extern int yylex (void); + + #define YY_DECL int yylex (void) + #endif /* !YY_DECL */ + + /* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ + #ifndef YY_USER_ACTION + #define YY_USER_ACTION + #endif + + /* Code executed at the end of each rule. */ + #ifndef YY_BREAK + #define YY_BREAK break; + #endif + + #define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + + /** The main scanner function which does all the work. + */ + YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + + #line 106 "dgn_comp.l" + + #line 824 "lex.yy.c" + + if ( (yy_init) ) + { + (yy_init) = 0; + + #ifdef YY_USER_INIT + YY_USER_INIT; + #endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); + yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 196 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 220 ); + + yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + + case 1: + YY_RULE_SETUP + #line 107 "dgn_comp.l" + return(A_DUNGEON); + YY_BREAK + case 2: + YY_RULE_SETUP + #line 108 "dgn_comp.l" + { yylval.i=1; return(UP_OR_DOWN); } + YY_BREAK + case 3: + YY_RULE_SETUP + #line 109 "dgn_comp.l" + { yylval.i=0; return(UP_OR_DOWN); } + YY_BREAK + case 4: + YY_RULE_SETUP + #line 110 "dgn_comp.l" + return(ENTRY); + YY_BREAK + case 5: + YY_RULE_SETUP + #line 111 "dgn_comp.l" + return(STAIR); + YY_BREAK + case 6: + YY_RULE_SETUP + #line 112 "dgn_comp.l" + return(NO_UP); + YY_BREAK + case 7: + YY_RULE_SETUP + #line 113 "dgn_comp.l" + return(NO_DOWN); + YY_BREAK + case 8: + YY_RULE_SETUP + #line 114 "dgn_comp.l" + return(PORTAL); + YY_BREAK + case 9: + YY_RULE_SETUP + #line 115 "dgn_comp.l" + return(PROTOFILE); + YY_BREAK + case 10: + YY_RULE_SETUP + #line 116 "dgn_comp.l" + return(DESCRIPTION); + YY_BREAK + case 11: + YY_RULE_SETUP + #line 117 "dgn_comp.l" + return(LEVELDESC); + YY_BREAK + case 12: + YY_RULE_SETUP + #line 118 "dgn_comp.l" + return(ALIGNMENT); + YY_BREAK + case 13: + YY_RULE_SETUP + #line 119 "dgn_comp.l" + return(LEVALIGN); + YY_BREAK + case 14: + YY_RULE_SETUP + #line 120 "dgn_comp.l" + { yylval.i=TOWN ; return(DESCRIPTOR); } + YY_BREAK + case 15: + YY_RULE_SETUP + #line 121 "dgn_comp.l" + { yylval.i=HELLISH ; return(DESCRIPTOR); } + YY_BREAK + case 16: + YY_RULE_SETUP + #line 122 "dgn_comp.l" + { yylval.i=MAZELIKE ; return(DESCRIPTOR); } + YY_BREAK + case 17: + YY_RULE_SETUP + #line 123 "dgn_comp.l" + { yylval.i=ROGUELIKE ; return(DESCRIPTOR); } + YY_BREAK + case 18: + YY_RULE_SETUP + #line 124 "dgn_comp.l" + { yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); } + YY_BREAK + case 19: + YY_RULE_SETUP + #line 125 "dgn_comp.l" + { yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); } + YY_BREAK + case 20: + YY_RULE_SETUP + #line 126 "dgn_comp.l" + { yylval.i=D_ALIGN_LAWFUL ; return(DESCRIPTOR); } + YY_BREAK + case 21: + YY_RULE_SETUP + #line 127 "dgn_comp.l" + { yylval.i=D_ALIGN_NEUTRAL ; return(DESCRIPTOR); } + YY_BREAK + case 22: + YY_RULE_SETUP + #line 128 "dgn_comp.l" + { yylval.i=D_ALIGN_CHAOTIC ; return(DESCRIPTOR); } + YY_BREAK + case 23: + YY_RULE_SETUP + #line 129 "dgn_comp.l" + return(BRANCH); + YY_BREAK + case 24: + YY_RULE_SETUP + #line 130 "dgn_comp.l" + return(CHBRANCH); + YY_BREAK + case 25: + YY_RULE_SETUP + #line 131 "dgn_comp.l" + return(LEVEL); + YY_BREAK + case 26: + YY_RULE_SETUP + #line 132 "dgn_comp.l" + return(RNDLEVEL); + YY_BREAK + case 27: + YY_RULE_SETUP + #line 133 "dgn_comp.l" + return(CHLEVEL); + YY_BREAK + case 28: + YY_RULE_SETUP + #line 134 "dgn_comp.l" + return(RNDCHLEVEL); + YY_BREAK + case 29: + YY_RULE_SETUP + #line 135 "dgn_comp.l" + { yylval.i=atoi(yytext); return(INTEGER); } + YY_BREAK + case 30: + /* rule 30 can match eol */ + YY_RULE_SETUP + #line 136 "dgn_comp.l" + { yytext[yyleng-1] = 0; /* Discard the trailing \" */ + yylval.str = (char *) alloc(strlen(yytext+1)+1); + Strcpy(yylval.str, yytext+1); /* Discard the first \" */ + return(STRING); } + YY_BREAK + case 31: + /* rule 31 can match eol */ + YY_RULE_SETUP + #line 140 "dgn_comp.l" + { line_number++; } + YY_BREAK + case 32: + /* rule 32 can match eol */ + YY_RULE_SETUP + #line 141 "dgn_comp.l" + { line_number++; } + YY_BREAK + case 33: + YY_RULE_SETUP + #line 142 "dgn_comp.l" + ; /* skip trailing tabs & spaces */ + YY_BREAK + case 34: + YY_RULE_SETUP + #line 143 "dgn_comp.l" + { return yytext[0]; } + YY_BREAK + case 35: + YY_RULE_SETUP + #line 144 "dgn_comp.l" + ECHO; + YY_BREAK + #line 1089 "lex.yy.c" + case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + /* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + static int yy_get_next_buffer (void) + { + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart(yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; + } + + /* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 196 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; + } + + /* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) + { + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 196 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 195); + + return yy_is_jam ? 0 : yy_current_state; + } + + static void yyunput (int c, register char * yy_bp ) + { + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up yytext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; + } + + #ifndef YY_NO_INPUT + #ifdef __cplusplus + static int yyinput (void) + #else + static int input (void) + #endif + + { + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart(yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + #ifdef __cplusplus + return yyinput(); + #else + return input(); + #endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + return c; + } + #endif /* ifndef YY_NO_INPUT */ + + /** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) + { + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } + + yy_init_buffer(YY_CURRENT_BUFFER,input_file ); + yy_load_buffer_state( ); + } + + /** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) + { + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; + } + + static void yy_load_buffer_state (void) + { + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); + } + + /** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer(b,file ); + + return b; + } + + /** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) + { + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree((void *) b->yy_ch_buf ); + + yyfree((void *) b ); + } + + #ifndef __cplusplus + extern int isatty (int ); + #endif /* __cplusplus */ + + /* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + + { + int oerrno = errno; + + yy_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; + } + + /** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); + } + + /** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ + void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) + { + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } + + /** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ + void yypop_buffer_state (void) + { + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } + } + + /* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ + static void yyensure_buffer_stack (void) + { + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } + } + + /** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ + YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer(b ); + + return b; + } + + /** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param str a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ + YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str ) + { + + return yy_scan_bytes(yy_str,strlen(yy_str) ); + } + + /** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ + YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len ) + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yyalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } + + #ifndef YY_EXIT_FAILURE + #define YY_EXIT_FAILURE 2 + #endif + + static void yy_fatal_error (yyconst char* msg ) + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + /* Redefine yyless() so it works in section 3 code. */ + + #undef yyless + #define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + + /* Accessor methods (get/set functions) to struct members. */ + + /** Get the current line number. + * + */ + int yyget_lineno (void) + { + + return yylineno; + } + + /** Get the input stream. + * + */ + FILE *yyget_in (void) + { + return yyin; + } + + /** Get the output stream. + * + */ + FILE *yyget_out (void) + { + return yyout; + } + + /** Get the length of the current token. + * + */ + int yyget_leng (void) + { + return yyleng; + } + + /** Get the current token. + * + */ + + char *yyget_text (void) + { + return yytext; + } + + /** Set the current line number. + * @param line_number + * + */ + void yyset_lineno (int line_number ) + { + + yylineno = line_number; + } + + /** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see yy_switch_to_buffer + */ + void yyset_in (FILE * in_str ) + { + yyin = in_str ; + } + + void yyset_out (FILE * out_str ) + { + yyout = out_str ; + } + + int yyget_debug (void) + { + return yy_flex_debug; + } + + void yyset_debug (int bdebug ) + { + yy_flex_debug = bdebug ; + } + + /* yylex_destroy is for both reentrant and non-reentrant scanners. */ + int yylex_destroy (void) + { + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + return 0; + } + + /* + * Internal utility routines. + */ + + #ifndef yytext_ptr + static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } + #endif + + #ifdef YY_NEED_STRLEN + static int yy_flex_strlen (yyconst char * s ) + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } + #endif + + void *yyalloc (yy_size_t size ) + { + return (void *) malloc( size ); + } + + void *yyrealloc (void * ptr, yy_size_t size ) + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + + void yyfree (void * ptr ) + { + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + } + + #define YYTABLES_NAME "yytables" + + #undef YY_NEW_FILE + #undef YY_FLUSH_BUFFER + #undef yy_set_bol + #undef yy_new_buffer + #undef yy_set_interactive + #undef yytext_ptr + #undef YY_DO_BEFORE_ACTION + + #ifdef YY_DECL_IS_OURS + #undef YY_DECL_IS_OURS + #undef YY_DECL + #endif + #line 144 "dgn_comp.l" + + + + /* routine to switch to another input file; needed for flex */ + void init_yyin( input_f ) + FILE *input_f; + { + #if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) + if (yyin) + yyrestart(input_f); + else + #endif + yyin = input_f; + } + /* analogous routine (for completeness) */ + void init_yyout( output_f ) + FILE *output_f; + { + yyout = output_f; + } + + /*dgn_comp.l*/ + diff -rN -c slashem-0.0.7E7F2/util/dgn_yacc.c geekslashem-0.0.7E7F2/util/dgn_yacc.c *** slashem-0.0.7E7F2/util/dgn_yacc.c 1970-01-01 09:00:00.000000000 +0900 --- geekslashem-0.0.7E7F2/util/dgn_yacc.c 2006-04-22 15:48:37.000000000 +0900 *************** *** 0 **** --- 1,2009 ---- + /* A Bison parser, made by GNU Bison 1.875d. */ + + /* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + /* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + + /* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ + + /* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + + /* Identify Bison output. */ + #define YYBISON 1 + + /* Skeleton name. */ + #define YYSKELETON_NAME "yacc.c" + + /* Pure parsers. */ + #define YYPURE 0 + + /* Using locations. */ + #define YYLSP_NEEDED 0 + + + + /* Tokens. */ + #ifndef YYTOKENTYPE + # define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + INTEGER = 258, + A_DUNGEON = 259, + BRANCH = 260, + CHBRANCH = 261, + LEVEL = 262, + RNDLEVEL = 263, + CHLEVEL = 264, + RNDCHLEVEL = 265, + UP_OR_DOWN = 266, + PROTOFILE = 267, + DESCRIPTION = 268, + DESCRIPTOR = 269, + LEVELDESC = 270, + ALIGNMENT = 271, + LEVALIGN = 272, + ENTRY = 273, + STAIR = 274, + NO_UP = 275, + NO_DOWN = 276, + PORTAL = 277, + STRING = 278 + }; + #endif + #define INTEGER 258 + #define A_DUNGEON 259 + #define BRANCH 260 + #define CHBRANCH 261 + #define LEVEL 262 + #define RNDLEVEL 263 + #define CHLEVEL 264 + #define RNDCHLEVEL 265 + #define UP_OR_DOWN 266 + #define PROTOFILE 267 + #define DESCRIPTION 268 + #define DESCRIPTOR 269 + #define LEVELDESC 270 + #define ALIGNMENT 271 + #define LEVALIGN 272 + #define ENTRY 273 + #define STAIR 274 + #define NO_UP 275 + #define NO_DOWN 276 + #define PORTAL 277 + #define STRING 278 + + + + + /* Copy the first part of user declarations. */ + #line 1 "dgn_comp.y" + + /* SCCS Id: @(#)dgn_comp.c 3.4 1996/06/22 */ + /* Copyright (c) 1989 by Jean-Christophe Collet */ + /* Copyright (c) 1990 by M. Stephenson */ + /* NetHack may be freely redistributed. See license for details. */ + + /* + * This file contains the Dungeon Compiler code + */ + + /* In case we're using bison in AIX. This definition must be + * placed before any other C-language construct in the file + * excluding comments and preprocessor directives (thanks IBM + * for this wonderful feature...). + * + * Note: some cpps barf on this 'undefined control' (#pragma). + * Addition of the leading space seems to prevent barfage for now, + * and AIX will still see the directive in its non-standard locale. + */ + + #ifdef _AIX + #pragma alloca /* keep leading space! */ + #endif + + #include "config.h" + #include "date.h" + #include "dgn_file.h" + + void FDECL(yyerror, (const char *)); + void FDECL(yywarning, (const char *)); + int NDECL(yylex); + int NDECL(yyparse); + int FDECL(getchain, (char *)); + int NDECL(check_dungeon); + int NDECL(check_branch); + int NDECL(check_level); + void NDECL(init_dungeon); + void NDECL(init_branch); + void NDECL(init_level); + void NDECL(output_dgn); + + #define Free(ptr) free((genericptr_t)ptr) + + #ifdef AMIGA + # undef printf + #ifndef LATTICE + # define memset(addr,val,len) setmem(addr,len,val) + #endif + #endif + + #define ERR (-1) + + static struct couple couple; + static struct tmpdungeon tmpdungeon[MAXDUNGEON]; + static struct tmplevel tmplevel[LEV_LIMIT]; + static struct tmpbranch tmpbranch[BRANCH_LIMIT]; + + static int in_dungeon = 0, n_dgns = -1, n_levs = -1, n_brs = -1; + + extern int fatal_error; + extern const char *fname; + extern FILE *yyin, *yyout; /* from dgn_lex.c */ + + + + /* Enabling traces. */ + #ifndef YYDEBUG + # define YYDEBUG 0 + #endif + + /* Enabling verbose error messages. */ + #ifdef YYERROR_VERBOSE + # undef YYERROR_VERBOSE + # define YYERROR_VERBOSE 1 + #else + # define YYERROR_VERBOSE 0 + #endif + + #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) + #line 67 "dgn_comp.y" + typedef union YYSTYPE { + int i; + char* str; + } YYSTYPE; + /* Line 191 of yacc.c. */ + #line 192 "y.tab.c" + # define yystype YYSTYPE /* obsolescent; will be withdrawn */ + # define YYSTYPE_IS_DECLARED 1 + # define YYSTYPE_IS_TRIVIAL 1 + #endif + + + + /* Copy the second part of user declarations. */ + + + /* Line 214 of yacc.c. */ + #line 204 "y.tab.c" + + #if ! defined (yyoverflow) || YYERROR_VERBOSE + + # ifndef YYFREE + # define YYFREE free + # endif + # ifndef YYMALLOC + # define YYMALLOC malloc + # endif + + /* The parser invokes alloca or malloc; define the necessary symbols. */ + + # ifdef YYSTACK_USE_ALLOCA + # if YYSTACK_USE_ALLOCA + # define YYSTACK_ALLOC alloca + # endif + # else + # if defined (alloca) || defined (_ALLOCA_H) + # define YYSTACK_ALLOC alloca + # else + # ifdef __GNUC__ + # define YYSTACK_ALLOC __builtin_alloca + # endif + # endif + # endif + + # ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ + # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) + # else + # if defined (__STDC__) || defined (__cplusplus) + # include /* INFRINGES ON USER NAME SPACE */ + # define YYSIZE_T size_t + # endif + # define YYSTACK_ALLOC YYMALLOC + # define YYSTACK_FREE YYFREE + # endif + #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ + + + #if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) + + /* A type that is properly aligned for any stack member. */ + union yyalloc + { + short int yyss; + YYSTYPE yyvs; + }; + + /* The size of the maximum gap between one aligned stack and the next. */ + # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + + /* The size of an array large to enough to hold all stacks, each with + N elements. */ + # define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + + /* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ + # ifndef YYCOPY + # if defined (__GNUC__) && 1 < __GNUC__ + # define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) + # else + # define YYCOPY(To, From, Count) \ + do \ + { \ + register YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) + # endif + # endif + + /* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ + # define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + + #endif + + #if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; + #else + typedef short int yysigned_char; + #endif + + /* YYFINAL -- State number of the termination state. */ + #define YYFINAL 45 + /* YYLAST -- Last index in YYTABLE. */ + #define YYLAST 85 + + /* YYNTOKENS -- Number of terminals. */ + #define YYNTOKENS 30 + /* YYNNTS -- Number of nonterminals. */ + #define YYNNTS 25 + /* YYNRULES -- Number of rules. */ + #define YYNRULES 49 + /* YYNRULES -- Number of states. */ + #define YYNSTATES 111 + + /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ + #define YYUNDEFTOK 2 + #define YYMAXUTOK 278 + + #define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + + /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ + static const unsigned char yytranslate[] = + { + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 27, 29, 2, 26, 28, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 24, 2, + 2, 2, 2, 2, 25, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23 + }; + + #if YYDEBUG + /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ + static const unsigned char yyprhs[] = + { + 0, 0, 3, 4, 6, 8, 11, 13, 15, 17, + 19, 26, 27, 29, 31, 33, 35, 39, 41, 45, + 49, 53, 55, 57, 59, 61, 63, 70, 78, 86, + 95, 99, 103, 111, 120, 129, 139, 141, 143, 152, + 162, 163, 165, 167, 169, 171, 172, 174, 176, 182 + }; + + /* YYRHS -- A `-1'-separated list of the rules' RHS. */ + static const yysigned_char yyrhs[] = + { + 31, 0, -1, -1, 32, -1, 33, -1, 32, 33, + -1, 34, -1, 36, -1, 47, -1, 41, -1, 4, + 24, 23, 52, 54, 35, -1, -1, 3, -1, 37, + -1, 38, -1, 40, -1, 18, 24, 3, -1, 39, + -1, 13, 24, 14, -1, 16, 24, 14, -1, 12, + 24, 23, -1, 42, -1, 43, -1, 44, -1, 45, + -1, 46, -1, 7, 24, 23, 52, 25, 53, -1, + 8, 24, 23, 52, 25, 53, 3, -1, 7, 24, + 23, 52, 25, 53, 3, -1, 8, 24, 23, 52, + 25, 53, 3, 3, -1, 15, 24, 14, -1, 17, + 24, 14, -1, 9, 24, 23, 52, 23, 26, 54, + -1, 10, 24, 23, 52, 23, 26, 54, 3, -1, + 9, 24, 23, 52, 23, 26, 54, 3, -1, 10, + 24, 23, 52, 23, 26, 54, 3, 3, -1, 48, + -1, 49, -1, 5, 24, 23, 25, 53, 50, 51, + 35, -1, 6, 24, 23, 23, 26, 54, 50, 51, + 35, -1, -1, 19, -1, 20, -1, 21, -1, 22, + -1, -1, 11, -1, 23, -1, 27, 3, 28, 3, + 29, -1, 27, 3, 28, 3, 29, -1 + }; + + /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + static const unsigned short int yyrline[] = + { + 0, 81, 81, 82, 88, 89, 92, 93, 94, 95, + 98, 113, 116, 122, 123, 124, 127, 134, 137, 144, + 153, 162, 163, 164, 165, 166, 169, 181, 196, 209, + 225, 232, 241, 256, 274, 290, 309, 310, 313, 330, + 350, 353, 357, 361, 365, 372, 375, 381, 411, 448 + }; + #endif + + #if YYDEBUG || YYERROR_VERBOSE + /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ + static const char *const yytname[] = + { + "$end", "error", "$undefined", "INTEGER", "A_DUNGEON", "BRANCH", + "CHBRANCH", "LEVEL", "RNDLEVEL", "CHLEVEL", "RNDCHLEVEL", "UP_OR_DOWN", + "PROTOFILE", "DESCRIPTION", "DESCRIPTOR", "LEVELDESC", "ALIGNMENT", + "LEVALIGN", "ENTRY", "STAIR", "NO_UP", "NO_DOWN", "PORTAL", "STRING", + "':'", "'@'", "'+'", "'('", "','", "')'", "$accept", "file", "dungeons", + "dungeon", "dungeonline", "optional_int", "dungeondesc", "entry", + "descriptions", "desc", "prototype", "levels", "level1", "level2", + "levdesc", "chlevel1", "chlevel2", "branches", "branch", "chbranch", + "branch_type", "direction", "bones_tag", "acouple", "rcouple", 0 + }; + #endif + + # ifdef YYPRINT + /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ + static const unsigned short int yytoknum[] = + { + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 58, 64, 43, 40, 44, 41 + }; + # endif + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ + static const unsigned char yyr1[] = + { + 0, 30, 31, 31, 32, 32, 33, 33, 33, 33, + 34, 35, 35, 36, 36, 36, 37, 38, 39, 39, + 40, 41, 41, 41, 41, 41, 42, 42, 43, 43, + 44, 44, 45, 45, 46, 46, 47, 47, 48, 49, + 50, 50, 50, 50, 50, 51, 51, 52, 53, 54 + }; + + /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ + static const unsigned char yyr2[] = + { + 0, 2, 0, 1, 1, 2, 1, 1, 1, 1, + 6, 0, 1, 1, 1, 1, 3, 1, 3, 3, + 3, 1, 1, 1, 1, 1, 6, 7, 7, 8, + 3, 3, 7, 8, 8, 9, 1, 1, 8, 9, + 0, 1, 1, 1, 1, 0, 1, 1, 5, 5 + }; + + /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ + static const unsigned char yydefact[] = + { + 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 6, 7, 13, + 14, 17, 15, 9, 21, 22, 23, 24, 25, 8, + 36, 37, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 5, 0, 0, 0, + 0, 0, 0, 0, 20, 18, 30, 19, 31, 16, + 47, 0, 0, 0, 0, 0, 0, 0, 0, 11, + 0, 40, 0, 0, 0, 0, 0, 0, 12, 10, + 0, 41, 42, 43, 44, 45, 40, 26, 0, 0, + 0, 0, 0, 46, 11, 45, 28, 27, 32, 0, + 0, 0, 38, 11, 29, 34, 33, 49, 48, 39, + 35 + }; + + /* YYDEFGOTO[NTERM-NUM]. */ + static const yysigned_char yydefgoto[] = + { + -1, 14, 15, 16, 17, 79, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 85, 94, 61, 71, 69 + }; + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ + #define YYPACT_NINF -84 + static const yysigned_char yypact[] = + { + -3, -16, -8, -5, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 41, -3, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, 19, 20, 21, 22, 23, 24, 25, 26, + 36, 37, 38, 39, 51, -84, -84, 32, 31, 34, + 32, 32, 32, 32, -84, -84, -84, -84, -84, -84, + -84, 33, 35, 40, 42, 43, 46, 47, 55, 56, + 58, 2, 33, 35, 35, 45, 48, 44, -84, -84, + 49, -84, -84, -84, -84, 52, 2, 61, 62, 33, + 33, 70, 72, -84, 56, 52, -84, 73, 75, 76, + 53, 54, -84, 56, -84, -84, 77, -84, -84, -84, + -84 + }; + + /* YYPGOTO[NTERM-NUM]. */ + static const yysigned_char yypgoto[] = + { + -84, -84, -84, 66, -84, -83, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -2, -10, -25, -44, -72 + }; + + /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ + #define YYTABLE_NINF -1 + static const unsigned char yytable[] = + { + 86, 1, 2, 3, 4, 5, 6, 7, 32, 8, + 9, 102, 10, 11, 12, 13, 33, 98, 99, 34, + 109, 81, 82, 83, 84, 64, 65, 66, 67, 87, + 88, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 62, 63, 77, 78, + 68, 80, 70, 93, 96, 97, 72, 73, 74, 75, + 76, 89, 91, 100, 90, 101, 104, 92, 105, 106, + 110, 46, 107, 108, 95, 103 + }; + + static const unsigned char yycheck[] = + { + 72, 4, 5, 6, 7, 8, 9, 10, 24, 12, + 13, 94, 15, 16, 17, 18, 24, 89, 90, 24, + 103, 19, 20, 21, 22, 50, 51, 52, 53, 73, + 74, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 0, 23, 23, 23, 23, 23, 23, 23, 23, + 14, 14, 14, 14, 3, 23, 25, 23, 3, 3, + 27, 3, 27, 11, 3, 3, 26, 25, 25, 23, + 23, 26, 28, 3, 26, 3, 3, 28, 3, 3, + 3, 15, 29, 29, 86, 95 + }; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ + static const unsigned char yystos[] = + { + 0, 4, 5, 6, 7, 8, 9, 10, 12, 13, + 15, 16, 17, 18, 31, 32, 33, 34, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 0, 33, 23, 23, 23, + 23, 23, 23, 23, 23, 14, 14, 14, 14, 3, + 23, 52, 25, 23, 52, 52, 52, 52, 27, 54, + 27, 53, 26, 25, 25, 23, 23, 3, 3, 35, + 3, 19, 20, 21, 22, 50, 54, 53, 53, 26, + 26, 28, 28, 11, 51, 50, 3, 3, 54, 54, + 3, 3, 35, 51, 3, 3, 3, 29, 29, 35, + 3 + }; + + #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) + # define YYSIZE_T __SIZE_TYPE__ + #endif + #if ! defined (YYSIZE_T) && defined (size_t) + # define YYSIZE_T size_t + #endif + #if ! defined (YYSIZE_T) + # if defined (__STDC__) || defined (__cplusplus) + # include /* INFRINGES ON USER NAME SPACE */ + # define YYSIZE_T size_t + # endif + #endif + #if ! defined (YYSIZE_T) + # define YYSIZE_T unsigned int + #endif + + #define yyerrok (yyerrstatus = 0) + #define yyclearin (yychar = YYEMPTY) + #define YYEMPTY (-2) + #define YYEOF 0 + + #define YYACCEPT goto yyacceptlab + #define YYABORT goto yyabortlab + #define YYERROR goto yyerrorlab + + + /* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + + #define YYFAIL goto yyerrlab + + #define YYRECOVERING() (!!yyerrstatus) + + #define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror ("syntax error: cannot back up");\ + YYERROR; \ + } \ + while (0) + + #define YYTERROR 1 + #define YYERRCODE 256 + + /* YYLLOC_DEFAULT -- Compute the default location (before the actions + are run). */ + + #ifndef YYLLOC_DEFAULT + # define YYLLOC_DEFAULT(Current, Rhs, N) \ + ((Current).first_line = (Rhs)[1].first_line, \ + (Current).first_column = (Rhs)[1].first_column, \ + (Current).last_line = (Rhs)[N].last_line, \ + (Current).last_column = (Rhs)[N].last_column) + #endif + + /* YYLEX -- calling `yylex' with the right arguments. */ + + #ifdef YYLEX_PARAM + # define YYLEX yylex (YYLEX_PARAM) + #else + # define YYLEX yylex () + #endif + + /* Enable debugging if requested. */ + #if YYDEBUG + + # ifndef YYFPRINTF + # include /* INFRINGES ON USER NAME SPACE */ + # define YYFPRINTF fprintf + # endif + + # define YYDPRINTF(Args) \ + do { \ + if (yydebug) \ + YYFPRINTF Args; \ + } while (0) + + # define YYDSYMPRINT(Args) \ + do { \ + if (yydebug) \ + yysymprint Args; \ + } while (0) + + # define YYDSYMPRINTF(Title, Token, Value, Location) \ + do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Token, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ + } while (0) + + /*------------------------------------------------------------------. + | yy_stack_print -- Print the state stack from its BOTTOM up to its | + | TOP (included). | + `------------------------------------------------------------------*/ + + #if defined (__STDC__) || defined (__cplusplus) + static void + yy_stack_print (short int *bottom, short int *top) + #else + static void + yy_stack_print (bottom, top) + short int *bottom; + short int *top; + #endif + { + YYFPRINTF (stderr, "Stack now"); + for (/* Nothing. */; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); + } + + # define YY_STACK_PRINT(Bottom, Top) \ + do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ + } while (0) + + + /*------------------------------------------------. + | Report that the YYRULE is going to be reduced. | + `------------------------------------------------*/ + + #if defined (__STDC__) || defined (__cplusplus) + static void + yy_reduce_print (int yyrule) + #else + static void + yy_reduce_print (yyrule) + int yyrule; + #endif + { + int yyi; + unsigned int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", + yyrule - 1, yylno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + } + + # define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug) \ + yy_reduce_print (Rule); \ + } while (0) + + /* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ + int yydebug; + #else /* !YYDEBUG */ + # define YYDPRINTF(Args) + # define YYDSYMPRINT(Args) + # define YYDSYMPRINTF(Title, Token, Value, Location) + # define YY_STACK_PRINT(Bottom, Top) + # define YY_REDUCE_PRINT(Rule) + #endif /* !YYDEBUG */ + + + /* YYINITDEPTH -- initial size of the parser's stacks. */ + #ifndef YYINITDEPTH + # define YYINITDEPTH 200 + #endif + + /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + + #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 + # undef YYMAXDEPTH + #endif + + #ifndef YYMAXDEPTH + # define YYMAXDEPTH 10000 + #endif + + + + #if YYERROR_VERBOSE + + # ifndef yystrlen + # if defined (__GLIBC__) && defined (_STRING_H) + # define yystrlen strlen + # else + /* Return the length of YYSTR. */ + static YYSIZE_T + # if defined (__STDC__) || defined (__cplusplus) + yystrlen (const char *yystr) + # else + yystrlen (yystr) + const char *yystr; + # endif + { + register const char *yys = yystr; + + while (*yys++ != '\0') + continue; + + return yys - yystr - 1; + } + # endif + # endif + + # ifndef yystpcpy + # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) + # define yystpcpy stpcpy + # else + /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ + static char * + # if defined (__STDC__) || defined (__cplusplus) + yystpcpy (char *yydest, const char *yysrc) + # else + yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; + # endif + { + register char *yyd = yydest; + register const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; + } + # endif + # endif + + #endif /* !YYERROR_VERBOSE */ + + + + #if YYDEBUG + /*--------------------------------. + | Print this symbol on YYOUTPUT. | + `--------------------------------*/ + + #if defined (__STDC__) || defined (__cplusplus) + static void + yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) + #else + static void + yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE *yyvaluep; + #endif + { + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (yytype < YYNTOKENS) + { + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + # ifdef YYPRINT + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); + # endif + } + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + switch (yytype) + { + default: + break; + } + YYFPRINTF (yyoutput, ")"); + } + + #endif /* ! YYDEBUG */ + /*-----------------------------------------------. + | Release the memory associated to this symbol. | + `-----------------------------------------------*/ + + #if defined (__STDC__) || defined (__cplusplus) + static void + yydestruct (int yytype, YYSTYPE *yyvaluep) + #else + static void + yydestruct (yytype, yyvaluep) + int yytype; + YYSTYPE *yyvaluep; + #endif + { + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + switch (yytype) + { + + default: + break; + } + } + + + /* Prevent warnings from -Wmissing-prototypes. */ + + #ifdef YYPARSE_PARAM + # if defined (__STDC__) || defined (__cplusplus) + int yyparse (void *YYPARSE_PARAM); + # else + int yyparse (); + # endif + #else /* ! YYPARSE_PARAM */ + #if defined (__STDC__) || defined (__cplusplus) + int yyparse (void); + #else + int yyparse (); + #endif + #endif /* ! YYPARSE_PARAM */ + + + + /* The lookahead symbol. */ + int yychar; + + /* The semantic value of the lookahead symbol. */ + YYSTYPE yylval; + + /* Number of syntax errors so far. */ + int yynerrs; + + + + /*----------. + | yyparse. | + `----------*/ + + #ifdef YYPARSE_PARAM + # if defined (__STDC__) || defined (__cplusplus) + int yyparse (void *YYPARSE_PARAM) + # else + int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; + # endif + #else /* ! YYPARSE_PARAM */ + #if defined (__STDC__) || defined (__cplusplus) + int + yyparse (void) + #else + int + yyparse () + + #endif + #endif + { + + register int yystate; + register int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + register short int *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + register YYSTYPE *yyvsp; + + + + #define YYPOPSTACK (yyvsp--, yyssp--) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + + goto yysetstate; + + /*------------------------------------------------------------. + | yynewstate -- Push a new state, which is found in yystate. | + `------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. + */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + + #ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + short int *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow ("parser stack overflow", + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } + #else /* no yyoverflow */ + # ifndef YYSTACK_RELOCATE + goto yyoverflowlab; + # else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyoverflowlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + short int *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyoverflowlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + + # undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } + # endif + #endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + + /*-----------. + | yybackup. | + `-----------*/ + yybackup: + + /* Do appropriate processing given the current state. */ + /* Read a lookahead token if we need one and don't already have one. */ + /* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; + + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + yystate = yyn; + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- Do a reduction. | + `-----------------------------*/ + yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 3: + #line 83 "dgn_comp.y" + { + output_dgn(); + } + break; + + case 10: + #line 99 "dgn_comp.y" + { + init_dungeon(); + if (strlen(yyvsp[-3].str)+1 > sizeof(tmpdungeon[n_dgns].name)) + yyerror("Dungeon name is too long"); + Strcpy(tmpdungeon[n_dgns].name, yyvsp[-3].str); + tmpdungeon[n_dgns].boneschar = (char)yyvsp[-2].i; + tmpdungeon[n_dgns].lev.base = couple.base; + tmpdungeon[n_dgns].lev.rand = couple.rand; + tmpdungeon[n_dgns].chance = yyvsp[0].i; + Free(yyvsp[-3].str); + } + break; + + case 11: + #line 113 "dgn_comp.y" + { + yyval.i = 0; + } + break; + + case 12: + #line 117 "dgn_comp.y" + { + yyval.i = yyvsp[0].i; + } + break; + + case 16: + #line 128 "dgn_comp.y" + { + /* tmpdungeon[n_dgns].entry_lev = $3; */ + yyerror("ENTRY is obsolete!"); + } + break; + + case 18: + #line 138 "dgn_comp.y" + { + if(yyvsp[0].i <= TOWN || yyvsp[0].i >= D_ALIGN_CHAOTIC) + yyerror("Illegal description - ignoring!"); + else + tmpdungeon[n_dgns].flags |= yyvsp[0].i ; + } + break; + + case 19: + #line 145 "dgn_comp.y" + { + if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC) + yyerror("Illegal alignment - ignoring!"); + else + tmpdungeon[n_dgns].flags |= yyvsp[0].i ; + } + break; + + case 20: + #line 154 "dgn_comp.y" + { + if (strlen(yyvsp[0].str)+1 > sizeof(tmpdungeon[n_dgns].protoname)) + yyerror("Proto name is too long"); + Strcpy(tmpdungeon[n_dgns].protoname, yyvsp[0].str); + Free(yyvsp[0].str); + } + break; + + case 26: + #line 170 "dgn_comp.y" + { + init_level(); + if (strlen(yyvsp[-3].str)+1 > sizeof(tmplevel[n_levs].name)) + yyerror("Level name is too long"); + Strcpy(tmplevel[n_levs].name, yyvsp[-3].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-2].i; + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmpdungeon[n_dgns].levels++; + Free(yyvsp[-3].str); + } + break; + + case 27: + #line 182 "dgn_comp.y" + { + init_level(); + if (strlen(yyvsp[-4].str)+1 > sizeof(tmplevel[n_levs].name)) + yyerror("Level name is too long"); + Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-3].i; + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmplevel[n_levs].rndlevs = yyvsp[0].i; + tmpdungeon[n_dgns].levels++; + Free(yyvsp[-4].str); + } + break; + + case 28: + #line 197 "dgn_comp.y" + { + init_level(); + if (strlen(yyvsp[-4].str)+1 > sizeof(tmplevel[n_levs].name)) + yyerror("Level name is too long"); + Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-3].i; + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmplevel[n_levs].chance = yyvsp[0].i; + tmpdungeon[n_dgns].levels++; + Free(yyvsp[-4].str); + } + break; + + case 29: + #line 210 "dgn_comp.y" + { + init_level(); + if (strlen(yyvsp[-5].str)+1 > sizeof(tmplevel[n_levs].name)) + yyerror("Level name is too long"); + Strcpy(tmplevel[n_levs].name, yyvsp[-5].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-4].i; + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmplevel[n_levs].chance = yyvsp[-1].i; + tmplevel[n_levs].rndlevs = yyvsp[0].i; + tmpdungeon[n_dgns].levels++; + Free(yyvsp[-5].str); + } + break; + + case 30: + #line 226 "dgn_comp.y" + { + if(yyvsp[0].i >= D_ALIGN_CHAOTIC) + yyerror("Illegal description - ignoring!"); + else + tmplevel[n_levs].flags |= yyvsp[0].i ; + } + break; + + case 31: + #line 233 "dgn_comp.y" + { + if(yyvsp[0].i && yyvsp[0].i < D_ALIGN_CHAOTIC) + yyerror("Illegal alignment - ignoring!"); + else + tmplevel[n_levs].flags |= yyvsp[0].i ; + } + break; + + case 32: + #line 242 "dgn_comp.y" + { + init_level(); + if (strlen(yyvsp[-4].str)+1 > sizeof(tmplevel[n_levs].name)) + yyerror("Level name is too long"); + Strcpy(tmplevel[n_levs].name, yyvsp[-4].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-3].i; + tmplevel[n_levs].chain = getchain(yyvsp[-2].str); + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + if(!check_level()) n_levs--; + else tmpdungeon[n_dgns].levels++; + Free(yyvsp[-4].str); + Free(yyvsp[-2].str); + } + break; + + case 33: + #line 257 "dgn_comp.y" + { + init_level(); + if (strlen(yyvsp[-5].str)+1 > sizeof(tmplevel[n_levs].name)) + yyerror("Level name is too long"); + Strcpy(tmplevel[n_levs].name, yyvsp[-5].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-4].i; + tmplevel[n_levs].chain = getchain(yyvsp[-3].str); + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmplevel[n_levs].rndlevs = yyvsp[0].i; + if(!check_level()) n_levs--; + else tmpdungeon[n_dgns].levels++; + Free(yyvsp[-5].str); + Free(yyvsp[-3].str); + } + break; + + case 34: + #line 275 "dgn_comp.y" + { + init_level(); + if (strlen(yyvsp[-5].str)+1 > sizeof(tmplevel[n_levs].name)) + yyerror("Level name is too long"); + Strcpy(tmplevel[n_levs].name, yyvsp[-5].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-4].i; + tmplevel[n_levs].chain = getchain(yyvsp[-3].str); + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmplevel[n_levs].chance = yyvsp[0].i; + if(!check_level()) n_levs--; + else tmpdungeon[n_dgns].levels++; + Free(yyvsp[-5].str); + Free(yyvsp[-3].str); + } + break; + + case 35: + #line 291 "dgn_comp.y" + { + init_level(); + if (strlen(yyvsp[-6].str)+1 > sizeof(tmplevel[n_levs].name)) + yyerror("Level name is too long"); + Strcpy(tmplevel[n_levs].name, yyvsp[-6].str); + tmplevel[n_levs].boneschar = (char)yyvsp[-5].i; + tmplevel[n_levs].chain = getchain(yyvsp[-4].str); + tmplevel[n_levs].lev.base = couple.base; + tmplevel[n_levs].lev.rand = couple.rand; + tmplevel[n_levs].chance = yyvsp[-1].i; + tmplevel[n_levs].rndlevs = yyvsp[0].i; + if(!check_level()) n_levs--; + else tmpdungeon[n_dgns].levels++; + Free(yyvsp[-6].str); + Free(yyvsp[-4].str); + } + break; + + case 38: + #line 314 "dgn_comp.y" + { + init_branch(); + if (strlen(yyvsp[-5].str)+1 > sizeof(tmpbranch[n_brs].name)) + yyerror("Dungeon name is too long"); + Strcpy(tmpbranch[n_brs].name, yyvsp[-5].str); + tmpbranch[n_brs].lev.base = couple.base; + tmpbranch[n_brs].lev.rand = couple.rand; + tmpbranch[n_brs].type = yyvsp[-2].i; + tmpbranch[n_brs].up = yyvsp[-1].i; + tmpbranch[n_brs].entry_lev = yyvsp[0].i; + if(!check_branch()) n_brs--; + else tmpdungeon[n_dgns].branches++; + Free(yyvsp[-5].str); + } + break; + + case 39: + #line 331 "dgn_comp.y" + { + init_branch(); + if (strlen(yyvsp[-6].str)+1 > sizeof(tmpbranch[n_brs].name)) + yyerror("Dungeon name is too long"); + Strcpy(tmpbranch[n_brs].name, yyvsp[-6].str); + tmpbranch[n_brs].chain = getchain(yyvsp[-5].str); + tmpbranch[n_brs].lev.base = couple.base; + tmpbranch[n_brs].lev.rand = couple.rand; + tmpbranch[n_brs].type = yyvsp[-2].i; + tmpbranch[n_brs].up = yyvsp[-1].i; + tmpbranch[n_brs].entry_lev = yyvsp[0].i; + if(!check_branch()) n_brs--; + else tmpdungeon[n_dgns].branches++; + Free(yyvsp[-6].str); + Free(yyvsp[-5].str); + } + break; + + case 40: + #line 350 "dgn_comp.y" + { + yyval.i = TBR_STAIR; /* two way stair */ + } + break; + + case 41: + #line 354 "dgn_comp.y" + { + yyval.i = TBR_STAIR; /* two way stair */ + } + break; + + case 42: + #line 358 "dgn_comp.y" + { + yyval.i = TBR_NO_UP; /* no up staircase */ + } + break; + + case 43: + #line 362 "dgn_comp.y" + { + yyval.i = TBR_NO_DOWN; /* no down staircase */ + } + break; + + case 44: + #line 366 "dgn_comp.y" + { + yyval.i = TBR_PORTAL; /* portal connection */ + } + break; + + case 45: + #line 372 "dgn_comp.y" + { + yyval.i = 0; /* defaults to down */ + } + break; + + case 46: + #line 376 "dgn_comp.y" + { + yyval.i = yyvsp[0].i; + } + break; + + case 47: + #line 382 "dgn_comp.y" + { + char *p = yyvsp[0].str; + if (strlen(p) != 1) { + if (strcmp(p, "none") != 0) + yyerror("Bones marker must be a single char, or \"none\"!"); + *p = '\0'; + } + yyval.i = *p; + Free(p); + } + break; + + case 48: + #line 412 "dgn_comp.y" + { + if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) { + yyerror("Abs base out of dlevel range - zeroing!"); + couple.base = couple.rand = 0; + } else if (yyvsp[-1].i < -1 || + ((yyvsp[-3].i < 0) ? (MAXLEVEL + yyvsp[-3].i + yyvsp[-1].i + 1) > MAXLEVEL : + (yyvsp[-3].i + yyvsp[-1].i) > MAXLEVEL)) { + yyerror("Abs range out of dlevel range - zeroing!"); + couple.base = couple.rand = 0; + } else { + couple.base = yyvsp[-3].i; + couple.rand = yyvsp[-1].i; + } + } + break; + + case 49: + #line 449 "dgn_comp.y" + { + if (yyvsp[-3].i < -MAXLEVEL || yyvsp[-3].i > MAXLEVEL) { + yyerror("Rel base out of dlevel range - zeroing!"); + couple.base = couple.rand = 0; + } else { + couple.base = yyvsp[-3].i; + couple.rand = yyvsp[-1].i; + } + } + break; + + + } + + /* Line 1010 of yacc.c. */ + #line 1537 "y.tab.c" + + yyvsp -= yylen; + yyssp -= yylen; + + + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + + /*------------------------------------. + | yyerrlab -- here on detecting error | + `------------------------------------*/ + yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + #if YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (YYPACT_NINF < yyn && yyn < YYLAST) + { + YYSIZE_T yysize = 0; + int yytype = YYTRANSLATE (yychar); + const char* yyprefix; + char *yymsg; + int yyx; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 0; + + yyprefix = ", expecting "; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); + yycount += 1; + if (yycount == 5) + { + yysize = 0; + break; + } + } + yysize += (sizeof ("syntax error, unexpected ") + + yystrlen (yytname[yytype])); + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg != 0) + { + char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); + yyp = yystpcpy (yyp, yytname[yytype]); + + if (yycount < 5) + { + yyprefix = ", expecting "; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + yyp = yystpcpy (yyp, yyprefix); + yyp = yystpcpy (yyp, yytname[yyx]); + yyprefix = " or "; + } + } + yyerror (yymsg); + YYSTACK_FREE (yymsg); + } + else + yyerror ("syntax error; also virtual memory exhausted"); + } + else + #endif /* YYERROR_VERBOSE */ + yyerror ("syntax error"); + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* If at end of input, pop the error token, + then the rest of the stack, then return failure. */ + if (yychar == YYEOF) + for (;;) + { + YYPOPSTACK; + if (yyssp == yyss) + YYABORT; + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + yydestruct (yystos[*yyssp], yyvsp); + } + } + else + { + YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); + yydestruct (yytoken, &yylval); + yychar = YYEMPTY; + + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + + #ifdef __GNUC__ + /* Pacify GCC when the user code never invokes YYERROR and the label + yyerrorlab therefore never appears in user code. */ + if (0) + goto yyerrorlab; + #endif + + yyvsp -= yylen; + yyssp -= yylen; + yystate = *yyssp; + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + yydestruct (yystos[yystate], yyvsp); + YYPOPSTACK; + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + YYDPRINTF ((stderr, "Shifting error token, ")); + + *++yyvsp = yylval; + + + yystate = yyn; + goto yynewstate; + + + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ + yyacceptlab: + yyresult = 0; + goto yyreturn; + + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ + yyabortlab: + yyresult = 1; + goto yyreturn; + + #ifndef yyoverflow + /*----------------------------------------------. + | yyoverflowlab -- parser overflow comes here. | + `----------------------------------------------*/ + yyoverflowlab: + yyerror ("parser stack overflow"); + yyresult = 2; + /* Fall through. */ + #endif + + yyreturn: + #ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); + #endif + return yyresult; + } + + + #line 459 "dgn_comp.y" + + + void + init_dungeon() + { + if(++n_dgns > MAXDUNGEON) { + (void) fprintf(stderr, "FATAL - Too many dungeons (limit: %d).\n", + MAXDUNGEON); + (void) fprintf(stderr, "To increase the limit edit MAXDUNGEON in global.h\n"); + exit(EXIT_FAILURE); + } + + in_dungeon = 1; + tmpdungeon[n_dgns].lev.base = 0; + tmpdungeon[n_dgns].lev.rand = 0; + tmpdungeon[n_dgns].chance = 100; + Strcpy(tmpdungeon[n_dgns].name, ""); + Strcpy(tmpdungeon[n_dgns].protoname, ""); + tmpdungeon[n_dgns].flags = 0; + tmpdungeon[n_dgns].levels = 0; + tmpdungeon[n_dgns].branches = 0; + } + + void + init_level() + { + if(++n_levs > LEV_LIMIT) { + + yyerror("FATAL - Too many special levels defined."); + exit(EXIT_FAILURE); + } + tmplevel[n_levs].lev.base = 0; + tmplevel[n_levs].lev.rand = 0; + tmplevel[n_levs].chance = 100; + tmplevel[n_levs].rndlevs = 0; + tmplevel[n_levs].flags = 0; + Strcpy(tmplevel[n_levs].name, ""); + tmplevel[n_levs].chain = -1; + } + + void + init_branch() + { + if(++n_brs > BRANCH_LIMIT) { + + yyerror("FATAL - Too many special levels defined."); + exit(EXIT_FAILURE); + } + tmpbranch[n_brs].lev.base = 0; + tmpbranch[n_brs].lev.rand = 0; + Strcpy(tmpbranch[n_brs].name, ""); + tmpbranch[n_brs].chain = -1; + tmpbranch[n_brs].entry_lev = 0; + } + + int + getchain(s) + char *s; + { + int i; + + if(strlen(s)) { + + for(i = n_levs - tmpdungeon[n_dgns].levels + 1; i <= n_levs; i++) + if(!strcmp(tmplevel[i].name, s)) return i; + + yyerror("Can't locate the specified chain level."); + return(-2); + } + return(-1); + } + + /* + * Consistancy checking routines: + * + * - A dungeon must have a unique name. + * - A dungeon must have a originating "branch" command + * (except, of course, for the first dungeon). + * - A dungeon must have a proper depth (at least (1, 0)). + */ + + int + check_dungeon() + { + int i; + + for(i = 0; i < n_dgns; i++) + if(!strcmp(tmpdungeon[i].name, tmpdungeon[n_dgns].name)) { + yyerror("Duplicate dungeon name."); + return(0); + } + + if(n_dgns) + for(i = 0; i < n_brs - tmpdungeon[n_dgns].branches; i++) { + if(!strcmp(tmpbranch[i].name, tmpdungeon[n_dgns].name)) break; + + if(i >= n_brs - tmpdungeon[n_dgns].branches) { + yyerror("Dungeon cannot be reached."); + return(0); + } + } + + if(tmpdungeon[n_dgns].lev.base <= 0 || + tmpdungeon[n_dgns].lev.rand < 0) { + yyerror("Invalid dungeon depth specified."); + return(0); + } + return(1); /* OK */ + } + + /* + * - A level must have a unique level name. + * - If chained, the level used as reference for the chain + * must be in this dungeon, must be previously defined, and + * the level chained from must be "non-probabilistic" (ie. + * have a 100% chance of existing). + */ + + int + check_level() + { + int i; + + if(!in_dungeon) { + yyerror("Level defined outside of dungeon."); + return(0); + } + + for(i = 0; i < n_levs; i++) + if(!strcmp(tmplevel[i].name, tmplevel[n_levs].name)) { + yyerror("Duplicate level name."); + return(0); + } + + if(tmplevel[i].chain == -2) { + yyerror("Invalid level chain reference."); + return(0); + } else if(tmplevel[i].chain != -1) { /* there is a chain */ + /* KMH -- tmplevel[tmpbranch[i].chain].chance was in error */ + if(tmplevel[tmplevel[i].chain].chance != 100) { + yyerror("Level cannot chain from a probabilistic level."); + return(0); + } else if(tmplevel[i].chain == n_levs) { + yyerror("A level cannot chain to itself!"); + return(0); + } + } + return(1); /* OK */ + } + + /* + * - A branch may not branch backwards - to avoid branch loops. + * - A branch name need not be unique. + * (ie. You can have many entry points to each dungeon). + * - If chained, the level used as reference for the chain + * must be in this dungeon, must be previously defined, and + * the level chained from must be "non-probabilistic" (ie. + * have a 100% chance of existing). + */ + + int + check_branch() + { + int i; + + if(!in_dungeon) { + yyerror("Branch defined outside of dungeon."); + return(0); + } + #if 0 + for(i = 0; i < n_dgns; i++) + if(!strcmp(tmpdungeon[i].name, tmpbranch[n_brs].name)) { + + yyerror("Reverse branching not allowed."); + return(0); + } + #endif + if(tmpbranch[n_dgns].chain == -2) { + + yyerror("Invalid branch chain reference."); + return(0); + } else if(tmpbranch[n_dgns].chain != -1) { /* it is chained */ + + if(tmplevel[tmpbranch[n_dgns].chain].chance != 100) { + yyerror("Branch cannot chain from a probabilistic level."); + return(0); + } + } + return(1); /* OK */ + } + + /* + * Output the dungon definition into a file. + * + * The file will have the following format: + * + * [ nethack version ID ] + * [ number of dungeons ] + * [ first dungeon struct ] + * [ levels for the first dungeon ] + * ... + * [ branches for the first dungeon ] + * ... + * [ second dungeon struct ] + * ... + */ + + void + output_dgn() + { + int nd, cl = 0, nl = 0, + cb = 0, nb = 0; + static struct version_info version_data = { + VERSION_NUMBER, VERSION_FEATURES, + VERSION_SANITY1, VERSION_SANITY2 + }; + + if(++n_dgns <= 0) { + yyerror("FATAL - no dungeons were defined."); + exit(EXIT_FAILURE); + } + + if (fwrite((char *)&version_data, sizeof version_data, 1, yyout) != 1) { + yyerror("FATAL - output failure."); + exit(EXIT_FAILURE); + } + + (void) fwrite((char *)&n_dgns, sizeof(int), 1, yyout); + for (nd = 0; nd < n_dgns; nd++) { + (void) fwrite((char *)&tmpdungeon[nd], sizeof(struct tmpdungeon), + 1, yyout); + + nl += tmpdungeon[nd].levels; + for(; cl < nl; cl++) + (void) fwrite((char *)&tmplevel[cl], sizeof(struct tmplevel), + 1, yyout); + + nb += tmpdungeon[nd].branches; + for(; cb < nb; cb++) + (void) fwrite((char *)&tmpbranch[cb], sizeof(struct tmpbranch), + 1, yyout); + } + /* apparently necessary for Think C 5.x, otherwise harmless */ + (void) fflush(yyout); + } + + /*dgn_comp.y*/ + バイナリー・ファイルslashem-0.0.7E7F2/util/lev_compとgeekslashem-0.0.7E7F2/util/lev_compは違います diff -rN -c slashem-0.0.7E7F2/util/lev_lex.c geekslashem-0.0.7E7F2/util/lev_lex.c *** slashem-0.0.7E7F2/util/lev_lex.c 1970-01-01 09:00:00.000000000 +0900 --- geekslashem-0.0.7E7F2/util/lev_lex.c 2006-04-22 15:49:00.000000000 +0900 *************** *** 0 **** --- 1,2835 ---- + + #line 3 "lex.yy.c" + + #define YY_INT_ALIGNED short int + + /* A lexical scanner generated by flex */ + + #define FLEX_SCANNER + #define YY_FLEX_MAJOR_VERSION 2 + #define YY_FLEX_MINOR_VERSION 5 + #define YY_FLEX_SUBMINOR_VERSION 31 + #if YY_FLEX_SUBMINOR_VERSION > 0 + #define FLEX_BETA + #endif + + /* First, we deal with platform-specific or compiler-specific issues. */ + + /* begin standard C headers. */ + #include + #include + #include + #include + + /* end standard C headers. */ + + /* flex integer type definitions */ + + #ifndef FLEXINT_H + #define FLEXINT_H + + /* C99 systems have . Non-C99 systems may or may not. */ + + #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L + #include + typedef int8_t flex_int8_t; + typedef uint8_t flex_uint8_t; + typedef int16_t flex_int16_t; + typedef uint16_t flex_uint16_t; + typedef int32_t flex_int32_t; + typedef uint32_t flex_uint32_t; + #else + typedef signed char flex_int8_t; + typedef short int flex_int16_t; + typedef int flex_int32_t; + typedef unsigned char flex_uint8_t; + typedef unsigned short int flex_uint16_t; + typedef unsigned int flex_uint32_t; + #endif /* ! C99 */ + + /* Limits of integral types. */ + #ifndef INT8_MIN + #define INT8_MIN (-128) + #endif + #ifndef INT16_MIN + #define INT16_MIN (-32767-1) + #endif + #ifndef INT32_MIN + #define INT32_MIN (-2147483647-1) + #endif + #ifndef INT8_MAX + #define INT8_MAX (127) + #endif + #ifndef INT16_MAX + #define INT16_MAX (32767) + #endif + #ifndef INT32_MAX + #define INT32_MAX (2147483647) + #endif + #ifndef UINT8_MAX + #define UINT8_MAX (255U) + #endif + #ifndef UINT16_MAX + #define UINT16_MAX (65535U) + #endif + #ifndef UINT32_MAX + #define UINT32_MAX (4294967295U) + #endif + + #endif /* ! FLEXINT_H */ + + #ifdef __cplusplus + + /* The "const" storage-class-modifier is valid. */ + #define YY_USE_CONST + + #else /* ! __cplusplus */ + + #if __STDC__ + + #define YY_USE_CONST + + #endif /* __STDC__ */ + #endif /* ! __cplusplus */ + + #ifdef YY_USE_CONST + #define yyconst const + #else + #define yyconst + #endif + + /* Returned upon end-of-file. */ + #define YY_NULL 0 + + /* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ + #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + + /* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ + #define BEGIN (yy_start) = 1 + 2 * + + /* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ + #define YY_START (((yy_start) - 1) / 2) + #define YYSTATE YY_START + + /* Action number for EOF rule of a given start state. */ + #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + + /* Special action meaning "start processing a new file". */ + #define YY_NEW_FILE yyrestart(yyin ) + + #define YY_END_OF_BUFFER_CHAR 0 + + /* Size of default input buffer. */ + #ifndef YY_BUF_SIZE + #define YY_BUF_SIZE 16384 + #endif + + #ifndef YY_TYPEDEF_YY_BUFFER_STATE + #define YY_TYPEDEF_YY_BUFFER_STATE + typedef struct yy_buffer_state *YY_BUFFER_STATE; + #endif + + extern int yyleng; + + extern FILE *yyin, *yyout; + + #define EOB_ACT_CONTINUE_SCAN 0 + #define EOB_ACT_END_OF_FILE 1 + #define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + + /* Return all but the first "n" matched characters back to the input stream. */ + #define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + + #define unput(c) yyunput( c, (yytext_ptr) ) + + /* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ + + #ifndef YY_TYPEDEF_YY_SIZE_T + #define YY_TYPEDEF_YY_SIZE_T + typedef unsigned int yy_size_t; + #endif + + #ifndef YY_STRUCT_YY_BUFFER_STATE + #define YY_STRUCT_YY_BUFFER_STATE + struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + #define YY_BUFFER_NEW 0 + #define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ + #define YY_BUFFER_EOF_PENDING 2 + + }; + #endif /* !YY_STRUCT_YY_BUFFER_STATE */ + + /* Stack of input buffers. */ + static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ + static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ + static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + + /* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ + #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + + /* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ + #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + + /* yy_hold_char holds the character lost when yytext is formed. */ + static char yy_hold_char; + static int yy_n_chars; /* number of characters read into yy_ch_buf */ + int yyleng; + + /* Points to current character in buffer. */ + static char *yy_c_buf_p = (char *) 0; + static int yy_init = 1; /* whether we need to initialize */ + static int yy_start = 0; /* start state number */ + + /* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ + static int yy_did_buffer_switch_on_eof; + + void yyrestart (FILE *input_file ); + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); + YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); + void yy_delete_buffer (YY_BUFFER_STATE b ); + void yy_flush_buffer (YY_BUFFER_STATE b ); + void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); + void yypop_buffer_state (void ); + + static void yyensure_buffer_stack (void ); + static void yy_load_buffer_state (void ); + static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); + + #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) + + YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); + YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); + YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); + + void *yyalloc (yy_size_t ); + void *yyrealloc (void *,yy_size_t ); + void yyfree (void * ); + + #define yy_new_buffer yy_create_buffer + + #define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + + #define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + + #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + + /* Begin user sect3 */ + + typedef unsigned char YY_CHAR; + + FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + + typedef int yy_state_type; + + extern int yylineno; + + int yylineno = 1; + + extern char *yytext; + #define yytext_ptr yytext + + static yy_state_type yy_get_previous_state (void ); + static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); + static int yy_get_next_buffer (void ); + static void yy_fatal_error (yyconst char msg[] ); + + /* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ + #define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + + #define YY_NUM_RULES 120 + #define YY_END_OF_BUFFER 121 + /* This struct is not used in this scanner, + but its presence is necessary. */ + struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; + static yyconst flex_int16_t yy_accept[679] = + { 0, + 0, 0, 0, 0, 121, 119, 116, 115, 119, 119, + 119, 119, 113, 4, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 2, 119, 116, 119, 119, 113, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 116, + 115, 0, 114, 0, 0, 113, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 90, 0, 0, 3, 0, 2, + 2, 0, 116, 0, 113, 0, 0, 0, 0, 0, + 0, 0, 0, 2, 0, 0, 118, 0, 118, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 75, 0, 0, + 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 117, 0, 0, 0, 0, 0, 18, + 0, 0, 0, 0, 0, 42, 0, 0, 0, 6, + + 0, 0, 44, 0, 0, 0, 0, 35, 0, 0, + 0, 38, 34, 0, 0, 0, 17, 0, 0, 112, + 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, + 0, 0, 0, 0, 0, 91, 94, 53, 0, 0, + 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, + 0, 97, 0, 0, 0, 0, 0, 0, 57, 0, + 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, + 55, 12, 0, 0, 0, 0, 0, 26, 0, 0, + 0, 0, 0, 0, 10, 0, 0, 0, 0, 8, + + 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, + 0, 28, 0, 0, 0, 61, 89, 0, 0, 83, + 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 111, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, + 103, 0, 0, 60, 0, 0, 67, 0, 0, 0, + 0, 54, 0, 0, 0, 71, 0, 0, 32, 45, + 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, + 0, 0, 0, 13, 0, 29, 0, 22, 0, 0, + 0, 0, 82, 0, 69, 51, 65, 48, 0, 0, + + 101, 0, 72, 0, 0, 0, 0, 0, 49, 0, + 0, 0, 0, 0, 0, 50, 107, 0, 0, 0, + 58, 0, 56, 62, 0, 98, 0, 88, 110, 0, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 5, 16, 0, 0, 0, 0, 39, 0, 21, + 0, 99, 0, 0, 95, 0, 0, 0, 81, 0, + 0, 0, 0, 59, 76, 74, 0, 0, 0, 0, + 87, 0, 0, 0, 0, 41, 0, 0, 33, 11, + 9, 20, 0, 0, 14, 0, 0, 0, 0, 0, + 0, 108, 0, 0, 0, 0, 0, 0, 0, 0, + + 86, 0, 0, 104, 80, 0, 100, 73, 15, 0, + 43, 0, 0, 0, 0, 0, 0, 0, 0, 78, + 102, 64, 0, 106, 46, 84, 85, 0, 0, 0, + 19, 0, 0, 0, 0, 0, 0, 0, 0, 66, + 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 36, 37, 0, 0, 0, 0, 0, + 0, 79, 109, 0, 0, 0, 25, 31, 0, 0, + 0, 23, 0, 0, 24, 30, 40, 0 + } ; + + static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 5, 1, 6, 7, 1, 8, 1, 9, 1, + 1, 1, 10, 1, 11, 12, 1, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 14, 1, 1, + 1, 1, 1, 1, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 1, 31, 32, 33, 34, 35, 36, 1, 37, 38, + 39, 40, 41, 1, 42, 1, 43, 44, 45, 46, + + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 1, 59, 60, 61, 62, 63, 64, 1, + 65, 1, 12, 12, 12, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + + static yyconst flex_int32_t yy_meta[66] = + { 0, + 1, 2, 3, 2, 2, 1, 2, 1, 1, 2, + 2, 2, 2, 1, 2, 2, 2, 1, 1, 2, + 1, 2, 2, 1, 2, 2, 1, 1, 1, 2, + 1, 2, 2, 1, 1, 2, 1, 2, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + + static yyconst flex_int16_t yy_base[684] = + { 0, + 0, 59, 84, 63, 838, 839, 66, 839, 834, 830, + 795, 821, 820, 839, 806, 800, 45, 44, 802, 43, + 63, 801, 61, 64, 69, 812, 798, 96, 79, 99, + 811, 72, 67, 75, 86, 66, 95, 96, 62, 98, + 110, 97, 114, 88, 114, 119, 109, 115, 778, 821, + 131, 839, 820, 176, 180, 183, 186, 189, 198, 201, + 794, 184, 189, 197, 141, 198, 206, 218, 245, 76, + 839, 815, 839, 811, 810, 805, 784, 801, 800, 166, + 785, 798, 791, 796, 776, 780, 782, 784, 788, 770, + 766, 771, 774, 774, 147, 776, 178, 771, 777, 768, + + 768, 780, 778, 767, 777, 765, 209, 226, 147, 746, + 735, 745, 740, 725, 728, 725, 727, 739, 724, 195, + 721, 715, 718, 717, 727, 721, 720, 182, 713, 708, + 211, 710, 725, 225, 710, 712, 705, 233, 199, 714, + 718, 721, 720, 706, 712, 711, 703, 699, 185, 695, + 699, 697, 692, 239, 839, 693, 749, 839, 216, 839, + 839, 748, 293, 268, 278, 277, 287, 245, 289, 283, + 291, 299, 301, 839, 747, 0, 839, 740, 739, 732, + 718, 717, 711, 712, 711, 705, 709, 718, 710, 710, + 718, 702, 716, 714, 713, 699, 698, 710, 713, 685, + + 305, 700, 692, 706, 700, 695, 696, 697, 688, 699, + 687, 690, 154, 666, 671, 656, 665, 658, 650, 648, + 655, 651, 645, 648, 644, 649, 641, 641, 644, 638, + 637, 638, 636, 641, 646, 647, 631, 839, 630, 640, + 630, 839, 635, 640, 629, 641, 631, 623, 621, 627, + 623, 624, 284, 617, 630, 614, 624, 627, 617, 627, + 626, 624, 618, 618, 622, 623, 606, 613, 602, 605, + 839, 614, 598, 608, 607, 596, 329, 319, 314, 629, + 316, 317, 325, 839, 624, 637, 636, 637, 628, 839, + 634, 634, 616, 614, 627, 839, 603, 625, 617, 606, + + 626, 607, 839, 609, 278, 621, 611, 839, 621, 606, + 605, 839, 839, 602, 603, 601, 839, 607, 312, 839, + 573, 569, 568, 579, 578, 564, 566, 575, 839, 574, + 560, 572, 567, 574, 569, 839, 839, 839, 572, 567, + 566, 601, 563, 559, 839, 562, 561, 560, 563, 549, + 552, 839, 542, 543, 550, 543, 556, 541, 839, 547, + 542, 536, 533, 548, 839, 545, 544, 533, 532, 527, + 526, 522, 524, 528, 533, 529, 839, 522, 526, 518, + 839, 839, 575, 327, 562, 328, 338, 839, 554, 556, + 551, 555, 541, 536, 839, 555, 536, 541, 536, 839, + + 551, 544, 545, 839, 540, 547, 528, 545, 533, 531, + 529, 839, 527, 526, 534, 839, 839, 506, 494, 839, + 504, 495, 493, 489, 839, 501, 497, 494, 498, 480, + 839, 496, 210, 487, 486, 839, 490, 492, 476, 476, + 488, 487, 490, 483, 472, 472, 486, 839, 481, 476, + 839, 465, 477, 839, 469, 467, 839, 460, 467, 460, + 472, 839, 453, 457, 462, 839, 485, 342, 839, 839, + 486, 484, 489, 488, 487, 478, 493, 839, 481, 487, + 474, 483, 471, 839, 481, 839, 459, 839, 473, 468, + 461, 454, 839, 450, 839, 839, 839, 839, 439, 438, + + 839, 446, 839, 445, 440, 433, 442, 437, 839, 425, + 425, 440, 425, 429, 426, 839, 839, 427, 422, 432, + 839, 416, 839, 839, 422, 839, 425, 839, 839, 428, + 427, 839, 341, 454, 441, 453, 442, 441, 431, 437, + 441, 839, 839, 444, 432, 431, 352, 839, 429, 839, + 407, 839, 413, 412, 839, 410, 408, 399, 839, 398, + 395, 406, 391, 839, 839, 839, 400, 393, 403, 394, + 839, 398, 400, 399, 413, 839, 422, 421, 839, 839, + 839, 839, 426, 404, 839, 410, 409, 421, 410, 416, + 392, 839, 387, 386, 370, 380, 370, 372, 380, 367, + + 839, 376, 365, 839, 839, 373, 839, 839, 839, 403, + 839, 405, 405, 388, 390, 393, 401, 394, 383, 839, + 839, 839, 352, 839, 839, 839, 839, 356, 350, 349, + 839, 383, 382, 376, 374, 386, 387, 380, 383, 839, + 354, 839, 353, 380, 372, 374, 363, 363, 358, 347, + 354, 328, 327, 839, 839, 354, 349, 333, 333, 327, + 329, 839, 839, 315, 304, 294, 839, 839, 274, 255, + 213, 839, 196, 76, 839, 839, 839, 839, 383, 386, + 388, 390, 393 + } ; + + static yyconst flex_int16_t yy_def[684] = + { 0, + 678, 1, 1, 3, 678, 678, 678, 678, 678, 679, + 680, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 681, + 678, 678, 678, 682, 682, 682, 682, 682, 682, 682, + 678, 60, 60, 60, 60, 60, 60, 60, 681, 678, + 678, 679, 678, 678, 683, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 681, 678, 678, 678, + 678, 678, 60, 60, 60, 60, 60, 678, 60, 60, + 60, 60, 60, 678, 681, 69, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 60, 60, 678, + 60, 60, 60, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 60, 678, 60, 60, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 60, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 60, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 0, 678, 678, + 678, 678, 678 + } ; + + static yyconst flex_int16_t yy_nxt[905] = + { 0, + 6, 7, 8, 9, 7, 10, 6, 6, 11, 12, + 12, 6, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 6, 22, 6, 6, 23, 24, 25, 26, 27, + 28, 29, 30, 6, 6, 31, 6, 6, 32, 6, + 6, 6, 33, 34, 35, 36, 37, 38, 6, 39, + 6, 6, 6, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 6, 49, 6, 50, 79, 70, 84, 69, + 70, 85, 81, 80, 82, 89, 107, 70, 91, 90, + 70, 86, 92, 94, 108, 51, 52, 53, 54, 51, + 55, 87, 93, 56, 56, 55, 57, 95, 58, 59, + + 60, 101, 61, 62, 128, 55, 63, 677, 55, 64, + 98, 102, 103, 65, 99, 66, 67, 104, 129, 68, + 109, 55, 122, 55, 100, 110, 111, 123, 113, 105, + 112, 114, 117, 115, 142, 118, 116, 124, 126, 119, + 130, 143, 120, 137, 131, 159, 127, 121, 132, 92, + 125, 134, 135, 138, 133, 139, 144, 140, 319, 93, + 145, 147, 164, 148, 146, 152, 136, 153, 149, 97, + 154, 141, 155, 199, 200, 150, 151, 70, 161, 162, + 163, 678, 161, 162, 678, 161, 162, 678, 161, 162, + 678, 161, 162, 183, 320, 165, 184, 214, 165, 678, + + 161, 162, 678, 161, 162, 164, 202, 215, 203, 169, + 164, 170, 85, 107, 166, 90, 88, 678, 164, 164, + 171, 108, 167, 676, 104, 678, 678, 164, 78, 80, + 172, 103, 173, 213, 678, 235, 105, 226, 108, 164, + 236, 267, 256, 268, 675, 277, 678, 174, 175, 176, + 227, 176, 257, 195, 176, 176, 176, 176, 239, 176, + 176, 176, 280, 504, 176, 187, 176, 176, 505, 176, + 176, 240, 244, 241, 176, 250, 176, 176, 251, 245, + 176, 246, 176, 273, 176, 674, 274, 252, 253, 164, + 165, 254, 275, 255, 70, 405, 678, 163, 164, 164, + + 193, 279, 673, 281, 164, 678, 678, 406, 164, 278, + 164, 678, 164, 282, 164, 678, 319, 678, 207, 678, + 164, 678, 164, 306, 307, 672, 283, 678, 358, 678, + 359, 382, 383, 384, 671, 164, 293, 164, 164, 386, + 164, 287, 678, 670, 678, 678, 164, 678, 164, 164, + 387, 669, 320, 678, 668, 678, 678, 388, 412, 164, + 468, 533, 164, 164, 667, 666, 678, 665, 586, 678, + 678, 664, 663, 662, 661, 660, 659, 550, 587, 658, + 588, 589, 590, 72, 72, 72, 74, 74, 157, 157, + 157, 164, 164, 178, 178, 657, 656, 655, 654, 653, + + 652, 651, 650, 649, 648, 647, 646, 645, 644, 643, + 642, 641, 640, 639, 638, 637, 636, 635, 634, 633, + 632, 631, 630, 629, 628, 627, 626, 625, 624, 623, + 622, 621, 620, 619, 618, 617, 616, 615, 614, 613, + 612, 611, 610, 609, 608, 607, 606, 605, 604, 603, + 602, 601, 600, 599, 598, 597, 596, 595, 594, 593, + 592, 591, 585, 584, 583, 582, 581, 580, 579, 578, + 577, 576, 575, 574, 573, 572, 571, 570, 569, 568, + 567, 566, 565, 564, 563, 562, 561, 560, 559, 558, + 557, 556, 555, 554, 553, 552, 551, 550, 549, 548, + + 547, 546, 545, 544, 543, 542, 541, 540, 539, 538, + 537, 536, 535, 534, 532, 531, 530, 529, 528, 527, + 526, 525, 524, 523, 522, 521, 520, 519, 518, 517, + 516, 515, 514, 513, 512, 511, 510, 509, 508, 507, + 506, 503, 502, 501, 500, 499, 498, 497, 496, 495, + 494, 493, 492, 491, 490, 489, 488, 487, 486, 485, + 484, 483, 482, 481, 480, 479, 478, 477, 476, 475, + 474, 473, 472, 471, 470, 469, 467, 382, 466, 465, + 464, 463, 462, 461, 460, 459, 458, 457, 456, 455, + 454, 453, 452, 451, 450, 449, 448, 447, 446, 445, + + 444, 443, 442, 441, 440, 439, 438, 437, 436, 435, + 434, 433, 432, 431, 430, 429, 428, 427, 426, 425, + 424, 423, 422, 421, 420, 419, 418, 417, 416, 415, + 414, 413, 412, 411, 410, 409, 408, 407, 404, 403, + 402, 401, 400, 399, 398, 397, 396, 395, 394, 393, + 392, 391, 390, 389, 388, 385, 381, 380, 379, 378, + 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, + 367, 366, 365, 364, 363, 362, 361, 360, 357, 356, + 355, 354, 353, 352, 351, 350, 349, 348, 347, 346, + 345, 344, 343, 342, 341, 340, 339, 338, 337, 336, + + 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, + 325, 324, 323, 322, 321, 318, 317, 316, 315, 314, + 313, 312, 311, 310, 309, 308, 305, 304, 303, 302, + 301, 300, 299, 298, 297, 296, 295, 294, 293, 292, + 291, 290, 289, 288, 287, 286, 285, 284, 284, 174, + 161, 158, 276, 272, 271, 270, 269, 266, 265, 264, + 263, 262, 261, 260, 259, 258, 249, 248, 247, 243, + 242, 238, 237, 234, 233, 232, 231, 230, 229, 228, + 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, + 212, 211, 210, 209, 208, 207, 206, 205, 204, 201, + + 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, + 188, 187, 186, 185, 182, 181, 180, 76, 179, 177, + 73, 168, 160, 158, 156, 106, 97, 96, 88, 83, + 78, 77, 76, 76, 75, 73, 71, 678, 5, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + + 678, 678, 678, 678 + } ; + + static yyconst flex_int16_t yy_chk[905] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 17, 7, 20, 4, + 7, 20, 18, 17, 18, 23, 32, 70, 24, 23, + 70, 21, 24, 25, 32, 2, 3, 3, 3, 4, + 3, 21, 24, 3, 3, 3, 3, 25, 3, 3, + + 3, 29, 3, 3, 39, 3, 3, 674, 3, 3, + 28, 29, 29, 3, 28, 3, 3, 30, 39, 3, + 33, 3, 36, 3, 28, 33, 33, 36, 34, 30, + 33, 34, 35, 34, 44, 35, 34, 37, 38, 35, + 40, 44, 35, 42, 40, 51, 38, 35, 40, 51, + 37, 41, 41, 42, 40, 43, 45, 43, 213, 51, + 45, 46, 65, 46, 45, 47, 41, 47, 46, 65, + 48, 43, 48, 95, 95, 46, 46, 54, 54, 54, + 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, + 58, 58, 58, 80, 213, 56, 80, 109, 57, 59, + + 59, 59, 60, 60, 60, 62, 97, 109, 97, 62, + 63, 64, 62, 107, 58, 64, 63, 63, 64, 66, + 66, 107, 60, 673, 67, 64, 66, 67, 59, 60, + 66, 66, 68, 108, 67, 128, 67, 120, 108, 68, + 128, 149, 139, 149, 671, 159, 68, 69, 69, 69, + 120, 69, 139, 159, 69, 69, 69, 69, 131, 69, + 69, 69, 168, 433, 69, 168, 69, 69, 433, 69, + 69, 131, 134, 131, 69, 138, 69, 69, 138, 134, + 69, 134, 69, 154, 69, 670, 154, 138, 138, 164, + 165, 138, 154, 138, 163, 305, 164, 163, 166, 165, + + 170, 167, 669, 169, 170, 166, 165, 305, 167, 166, + 169, 170, 171, 172, 163, 167, 319, 169, 171, 171, + 172, 163, 173, 201, 201, 666, 173, 172, 253, 173, + 253, 277, 277, 278, 665, 279, 281, 281, 282, 282, + 278, 279, 279, 664, 281, 282, 283, 278, 384, 386, + 283, 661, 319, 283, 660, 384, 386, 384, 386, 387, + 387, 468, 533, 468, 659, 658, 387, 657, 547, 533, + 468, 656, 653, 652, 651, 650, 649, 533, 547, 648, + 547, 547, 547, 679, 679, 679, 680, 680, 681, 681, + 681, 682, 682, 683, 683, 647, 646, 645, 644, 643, + + 641, 639, 638, 637, 636, 635, 634, 633, 632, 630, + 629, 628, 623, 619, 618, 617, 616, 615, 614, 613, + 612, 610, 606, 603, 602, 600, 599, 598, 597, 596, + 595, 594, 593, 591, 590, 589, 588, 587, 586, 584, + 583, 578, 577, 575, 574, 573, 572, 570, 569, 568, + 567, 563, 562, 561, 560, 558, 557, 556, 554, 553, + 551, 549, 546, 545, 544, 541, 540, 539, 538, 537, + 536, 535, 534, 531, 530, 527, 525, 522, 520, 519, + 518, 515, 514, 513, 512, 511, 510, 508, 507, 506, + 505, 504, 502, 500, 499, 494, 492, 491, 490, 489, + + 487, 485, 483, 482, 481, 480, 479, 477, 476, 475, + 474, 473, 472, 471, 467, 465, 464, 463, 461, 460, + 459, 458, 456, 455, 453, 452, 450, 449, 447, 446, + 445, 444, 443, 442, 441, 440, 439, 438, 437, 435, + 434, 432, 430, 429, 428, 427, 426, 424, 423, 422, + 421, 419, 418, 415, 414, 413, 411, 410, 409, 408, + 407, 406, 405, 403, 402, 401, 399, 398, 397, 396, + 394, 393, 392, 391, 390, 389, 385, 383, 380, 379, + 378, 376, 375, 374, 373, 372, 371, 370, 369, 368, + 367, 366, 364, 363, 362, 361, 360, 358, 357, 356, + + 355, 354, 353, 351, 350, 349, 348, 347, 346, 344, + 343, 342, 341, 340, 339, 335, 334, 333, 332, 331, + 330, 328, 327, 326, 325, 324, 323, 322, 321, 318, + 316, 315, 314, 311, 310, 309, 307, 306, 304, 302, + 301, 300, 299, 298, 297, 295, 294, 293, 292, 291, + 289, 288, 287, 286, 285, 280, 276, 275, 274, 273, + 272, 270, 269, 268, 267, 266, 265, 264, 263, 262, + 261, 260, 259, 258, 257, 256, 255, 254, 252, 251, + 250, 249, 248, 247, 246, 245, 244, 243, 241, 240, + 239, 237, 236, 235, 234, 233, 232, 231, 230, 229, + + 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, + 218, 217, 216, 215, 214, 212, 211, 210, 209, 208, + 207, 206, 205, 204, 203, 202, 200, 199, 198, 197, + 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, + 186, 185, 184, 183, 182, 181, 180, 179, 178, 175, + 162, 157, 156, 153, 152, 151, 150, 148, 147, 146, + 145, 144, 143, 142, 141, 140, 137, 136, 135, 133, + 132, 130, 129, 127, 126, 125, 124, 123, 122, 121, + 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, + 106, 105, 104, 103, 102, 101, 100, 99, 98, 96, + + 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, + 84, 83, 82, 81, 79, 78, 77, 76, 75, 74, + 72, 61, 53, 50, 49, 31, 27, 26, 22, 19, + 16, 15, 13, 12, 11, 10, 9, 5, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + + 678, 678, 678, 678 + } ; + + static yy_state_type yy_last_accepting_state; + static char *yy_last_accepting_cpos; + + extern int yy_flex_debug; + int yy_flex_debug = 0; + + /* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ + #define REJECT reject_used_but_not_detected + #define yymore() yymore_used_but_not_detected + #define YY_MORE_ADJ 0 + #define YY_RESTORE_YY_MORE_OFFSET + char *yytext; + #line 1 "lev_comp.l" + #line 2 "lev_comp.l" + /* SCCS Id: @(#)lev_lex.c 3.4 2002/03/27 */ + /* Copyright (c) 1989 by Jean-Christophe Collet */ + /* NetHack may be freely redistributed. See license for details. */ + + #define LEV_LEX_C + + #include "hack.h" + #include "lev_comp.h" + #include "sp_lev.h" + + /* Most of these don't exist in flex, yywrap is macro and + * yyunput is properly declared in flex.skel. + */ + #if !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER) + int FDECL(yyback, (int *,int)); + int NDECL(yylook); + int NDECL(yyinput); + int NDECL(yywrap); + int NDECL(yylex); + /* Traditional lexes let yyunput() and yyoutput() default to int; + * newer ones may declare them as void since they don't return + * values. For even more fun, the lex supplied as part of the + * newer unbundled compiler for SunOS 4.x adds the void declarations + * (under __STDC__ or _cplusplus ifdefs -- otherwise they remain + * int) while the bundled lex and the one with the older unbundled + * compiler do not. To detect this, we need help from outside -- + * sys/unix/Makefile.utl. + * + * Digital UNIX is difficult and still has int in spite of all + * other signs. + */ + # if defined(NeXT) || defined(SVR4) || defined(_AIX32) + # define VOIDYYPUT + # endif + # if !defined(VOIDYYPUT) && defined(POSIX_TYPES) + # if !defined(BOS) && !defined(HISX) && !defined(_M_UNIX) && !defined(VMS) + # define VOIDYYPUT + # endif + # endif + # if !defined(VOIDYYPUT) && defined(WEIRD_LEX) + # if defined(SUNOS4) && defined(__STDC__) && (WEIRD_LEX > 1) + # define VOIDYYPUT + # endif + # endif + # if defined(VOIDYYPUT) && defined(__osf__) + # undef VOIDYYPUT + # endif + # ifdef VOIDYYPUT + void FDECL(yyunput, (int)); + void FDECL(yyoutput, (int)); + # else + int FDECL(yyunput, (int)); + int FDECL(yyoutput, (int)); + # endif + #endif /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ + + #ifdef FLEX_SCANNER + #define YY_MALLOC_DECL \ + genericptr_t FDECL(malloc, (size_t)); \ + genericptr_t FDECL(realloc, (genericptr_t,size_t)); + #endif + + void FDECL(init_yyin, (FILE *)); + void FDECL(init_yyout, (FILE *)); + + /* + * This doesn't always get put in lev_comp.h + * (esp. when using older versions of bison). + */ + extern YYSTYPE yylval; + + int line_number = 1, colon_line_number = 1; + static char map[4096]; + static int map_cnt = 0; + + /* + * This is a hack required by Michael Hamel to get things + * working on the Mac. + */ + #if defined(MAC_MPW) && !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER) + #undef input + #undef unput + #define unput(c) { yytchar = (c); if (yytchar == 10) yylineno--; *yysptr++ = yytchar; } + # ifndef YYNEWLINE + # define YYNEWLINE 10 + # endif + + char + input() /* Under MPW \n is chr(13)! Compensate for this. */ + { + if (yysptr > yysbuf) return(*--yysptr); + else { + yytchar = getc(yyin); + if (yytchar == '\n') { + yylineno++; + return(YYNEWLINE); + } + if (yytchar == EOF) return(0); + else return(yytchar); + } + } + #endif /* MAC_MPW && !FLEX_SCANNER && !FLEXHACK_SCANNER */ + + + #line 971 "lex.yy.c" + + #define INITIAL 0 + #define MAPC 1 + + #ifndef YY_NO_UNISTD_H + /* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ + #include + #endif + + #ifndef YY_EXTRA_TYPE + #define YY_EXTRA_TYPE void * + #endif + + /* Macros after this point can all be overridden by user definitions in + * section 1. + */ + + #ifndef YY_SKIP_YYWRAP + #ifdef __cplusplus + extern "C" int yywrap (void ); + #else + extern int yywrap (void ); + #endif + #endif + + static void yyunput (int c,char *buf_ptr ); + + #ifndef yytext_ptr + static void yy_flex_strncpy (char *,yyconst char *,int ); + #endif + + #ifdef YY_NEED_STRLEN + static int yy_flex_strlen (yyconst char * ); + #endif + + #ifndef YY_NO_INPUT + + #ifdef __cplusplus + static int yyinput (void ); + #else + static int input (void ); + #endif + + #endif + + /* Amount of stuff to slurp up with each read. */ + #ifndef YY_READ_BUF_SIZE + #define YY_READ_BUF_SIZE 8192 + #endif + + /* Copy whatever the last rule matched to the standard output. */ + #ifndef ECHO + /* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ + #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) + #endif + + /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ + #ifndef YY_INPUT + #define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ + \ + + #endif + + /* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ + #ifndef yyterminate + #define yyterminate() return YY_NULL + #endif + + /* Number of entries by which start-condition stack grows. */ + #ifndef YY_START_STACK_INCR + #define YY_START_STACK_INCR 25 + #endif + + /* Report a fatal error. */ + #ifndef YY_FATAL_ERROR + #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) + #endif + + /* end tables serialization structures and prototypes */ + + /* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ + #ifndef YY_DECL + #define YY_DECL_IS_OURS 1 + + extern int yylex (void); + + #define YY_DECL int yylex (void) + #endif /* !YY_DECL */ + + /* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ + #ifndef YY_USER_ACTION + #define YY_USER_ACTION + #endif + + /* Code executed at the end of each rule. */ + #ifndef YY_BREAK + #define YY_BREAK break; + #endif + + #define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + + /** The main scanner function which does all the work. + */ + YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + + #line 110 "lev_comp.l" + + #line 1128 "lex.yy.c" + + if ( (yy_init) ) + { + (yy_init) = 0; + + #ifdef YY_USER_INIT + YY_USER_INIT; + #endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); + yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 679 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 839 ); + + yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + + case 1: + YY_RULE_SETUP + #line 111 "lev_comp.l" + { + BEGIN(INITIAL); + yylval.map = (char *) alloc(map_cnt + 1); + (void) strncpy(yylval.map, map, map_cnt); + yylval.map[map_cnt] = 0; + map_cnt = 0; + return MAP_ID; + } + YY_BREAK + case 2: + /* rule 2 can match eol */ + YY_RULE_SETUP + #line 119 "lev_comp.l" + { + int len = yyleng; + /* convert \r\n to \n */ + if (len >= 2 && yytext[len - 2] == '\r') len -= 1; + line_number++; + (void) strncpy(map + map_cnt, yytext, len); + map_cnt += len; + map[map_cnt - 1] = '\n'; + map[map_cnt] = '\0'; + } + YY_BREAK + case 3: + /* rule 3 can match eol */ + YY_RULE_SETUP + #line 129 "lev_comp.l" + { line_number++; } + YY_BREAK + case 4: + YY_RULE_SETUP + #line 130 "lev_comp.l" + { colon_line_number = line_number; return ':'; } + YY_BREAK + case 5: + YY_RULE_SETUP + #line 131 "lev_comp.l" + return MESSAGE_ID; + YY_BREAK + case 6: + YY_RULE_SETUP + #line 132 "lev_comp.l" + return MAZE_ID; + YY_BREAK + case 7: + YY_RULE_SETUP + #line 133 "lev_comp.l" + return NOMAP_ID; + YY_BREAK + case 8: + YY_RULE_SETUP + #line 134 "lev_comp.l" + return LEVEL_ID; + YY_BREAK + case 9: + YY_RULE_SETUP + #line 135 "lev_comp.l" + return LEV_INIT_ID; + YY_BREAK + case 10: + YY_RULE_SETUP + #line 136 "lev_comp.l" + return FLAGS_ID; + YY_BREAK + case 11: + YY_RULE_SETUP + #line 137 "lev_comp.l" + return GEOMETRY_ID; + YY_BREAK + case 12: + /* rule 12 can match eol */ + YY_RULE_SETUP + #line 138 "lev_comp.l" + { BEGIN(MAPC); line_number++; } + YY_BREAK + case 13: + YY_RULE_SETUP + #line 139 "lev_comp.l" + return OBJECT_ID; + YY_BREAK + case 14: + YY_RULE_SETUP + #line 140 "lev_comp.l" + return OBJFLAGS_ID; + YY_BREAK + case 15: + YY_RULE_SETUP + #line 141 "lev_comp.l" + return COBJECT_ID; + YY_BREAK + case 16: + YY_RULE_SETUP + #line 142 "lev_comp.l" + return MONSTER_ID; + YY_BREAK + case 17: + YY_RULE_SETUP + #line 143 "lev_comp.l" + return TRAP_ID; + YY_BREAK + case 18: + YY_RULE_SETUP + #line 144 "lev_comp.l" + return DOOR_ID; + YY_BREAK + case 19: + YY_RULE_SETUP + #line 145 "lev_comp.l" + return DRAWBRIDGE_ID; + YY_BREAK + case 20: + YY_RULE_SETUP + #line 146 "lev_comp.l" + return MAZEWALK_ID; + YY_BREAK + case 21: + YY_RULE_SETUP + #line 147 "lev_comp.l" + return WALLIFY_ID; + YY_BREAK + case 22: + YY_RULE_SETUP + #line 148 "lev_comp.l" + return REGION_ID; + YY_BREAK + case 23: + YY_RULE_SETUP + #line 149 "lev_comp.l" + return RANDOM_OBJECTS_ID; + YY_BREAK + case 24: + YY_RULE_SETUP + #line 150 "lev_comp.l" + return RANDOM_MONSTERS_ID; + YY_BREAK + case 25: + YY_RULE_SETUP + #line 151 "lev_comp.l" + return RANDOM_PLACES_ID; + YY_BREAK + case 26: + YY_RULE_SETUP + #line 152 "lev_comp.l" + return ALTAR_ID; + YY_BREAK + case 27: + YY_RULE_SETUP + #line 153 "lev_comp.l" + return LADDER_ID; + YY_BREAK + case 28: + YY_RULE_SETUP + #line 154 "lev_comp.l" + return STAIR_ID; + YY_BREAK + case 29: + YY_RULE_SETUP + #line 155 "lev_comp.l" + return PORTAL_ID; + YY_BREAK + case 30: + YY_RULE_SETUP + #line 156 "lev_comp.l" + return TELEPRT_ID; + YY_BREAK + case 31: + YY_RULE_SETUP + #line 157 "lev_comp.l" + return RANDOMREGION_ID; + YY_BREAK + case 32: + YY_RULE_SETUP + #line 158 "lev_comp.l" + return BRANCH_ID; + YY_BREAK + case 33: + YY_RULE_SETUP + #line 159 "lev_comp.l" + return FOUNTAIN_ID; + YY_BREAK + case 34: + YY_RULE_SETUP + #line 160 "lev_comp.l" + return SINK_ID; + YY_BREAK + case 35: + YY_RULE_SETUP + #line 161 "lev_comp.l" + return POOL_ID; + YY_BREAK + case 36: + YY_RULE_SETUP + #line 162 "lev_comp.l" + return NON_DIGGABLE_ID; + YY_BREAK + case 37: + YY_RULE_SETUP + #line 163 "lev_comp.l" + return NON_PASSWALL_ID; + YY_BREAK + case 38: + YY_RULE_SETUP + #line 164 "lev_comp.l" + return ROOM_ID; + YY_BREAK + case 39: + YY_RULE_SETUP + #line 165 "lev_comp.l" + return SUBROOM_ID; + YY_BREAK + case 40: + YY_RULE_SETUP + #line 166 "lev_comp.l" + return RAND_CORRIDOR_ID; + YY_BREAK + case 41: + YY_RULE_SETUP + #line 167 "lev_comp.l" + return CORRIDOR_ID; + YY_BREAK + case 42: + YY_RULE_SETUP + #line 168 "lev_comp.l" + return GOLD_ID; + YY_BREAK + case 43: + YY_RULE_SETUP + #line 169 "lev_comp.l" + return ENGRAVING_ID; + YY_BREAK + case 44: + YY_RULE_SETUP + #line 170 "lev_comp.l" + return NAME_ID; + YY_BREAK + case 45: + YY_RULE_SETUP + #line 171 "lev_comp.l" + return CHANCE_ID; + YY_BREAK + case 46: + YY_RULE_SETUP + #line 172 "lev_comp.l" + return LEV; + YY_BREAK + case 47: + YY_RULE_SETUP + #line 173 "lev_comp.l" + { yylval.i=D_ISOPEN; return DOOR_STATE; } + YY_BREAK + case 48: + YY_RULE_SETUP + #line 174 "lev_comp.l" + { yylval.i=D_CLOSED; return DOOR_STATE; } + YY_BREAK + case 49: + YY_RULE_SETUP + #line 175 "lev_comp.l" + { yylval.i=D_LOCKED; return DOOR_STATE; } + YY_BREAK + case 50: + YY_RULE_SETUP + #line 176 "lev_comp.l" + { yylval.i=D_NODOOR; return DOOR_STATE; } + YY_BREAK + case 51: + YY_RULE_SETUP + #line 177 "lev_comp.l" + { yylval.i=D_BROKEN; return DOOR_STATE; } + YY_BREAK + case 52: + YY_RULE_SETUP + #line 178 "lev_comp.l" + { yylval.i=W_NORTH; return DIRECTION; } + YY_BREAK + case 53: + YY_RULE_SETUP + #line 179 "lev_comp.l" + { yylval.i=W_EAST; return DIRECTION; } + YY_BREAK + case 54: + YY_RULE_SETUP + #line 180 "lev_comp.l" + { yylval.i=W_SOUTH; return DIRECTION; } + YY_BREAK + case 55: + YY_RULE_SETUP + #line 181 "lev_comp.l" + { yylval.i=W_WEST; return DIRECTION; } + YY_BREAK + case 56: + YY_RULE_SETUP + #line 182 "lev_comp.l" + { yylval.i = -1; return RANDOM_TYPE; } + YY_BREAK + case 57: + YY_RULE_SETUP + #line 183 "lev_comp.l" + { yylval.i = -2; return NONE; } + YY_BREAK + case 58: + YY_RULE_SETUP + #line 184 "lev_comp.l" + return O_REGISTER; + YY_BREAK + case 59: + YY_RULE_SETUP + #line 185 "lev_comp.l" + return M_REGISTER; + YY_BREAK + case 60: + YY_RULE_SETUP + #line 186 "lev_comp.l" + return P_REGISTER; + YY_BREAK + case 61: + YY_RULE_SETUP + #line 187 "lev_comp.l" + return A_REGISTER; + YY_BREAK + case 62: + YY_RULE_SETUP + #line 188 "lev_comp.l" + return R_REGISTER; + YY_BREAK + case 63: + YY_RULE_SETUP + #line 189 "lev_comp.l" + { yylval.i=1; return LEFT_OR_RIGHT; } + YY_BREAK + case 64: + YY_RULE_SETUP + #line 190 "lev_comp.l" + { yylval.i=2; return LEFT_OR_RIGHT; } + YY_BREAK + case 65: + YY_RULE_SETUP + #line 191 "lev_comp.l" + { yylval.i=3; return CENTER; } + YY_BREAK + case 66: + YY_RULE_SETUP + #line 192 "lev_comp.l" + { yylval.i=4; return LEFT_OR_RIGHT; } + YY_BREAK + case 67: + YY_RULE_SETUP + #line 193 "lev_comp.l" + { yylval.i=5; return LEFT_OR_RIGHT; } + YY_BREAK + case 68: + YY_RULE_SETUP + #line 194 "lev_comp.l" + { yylval.i=1; return TOP_OR_BOT; } + YY_BREAK + case 69: + YY_RULE_SETUP + #line 195 "lev_comp.l" + { yylval.i=5; return TOP_OR_BOT; } + YY_BREAK + case 70: + YY_RULE_SETUP + #line 196 "lev_comp.l" + { yylval.i=1; return LIGHT_STATE; } + YY_BREAK + case 71: + YY_RULE_SETUP + #line 197 "lev_comp.l" + { yylval.i=0; return LIGHT_STATE; } + YY_BREAK + case 72: + YY_RULE_SETUP + #line 198 "lev_comp.l" + { yylval.i=0; return FILLING; } + YY_BREAK + case 73: + YY_RULE_SETUP + #line 199 "lev_comp.l" + { yylval.i=1; return FILLING; } + YY_BREAK + case 74: + YY_RULE_SETUP + #line 200 "lev_comp.l" + { yylval.i= AM_NONE; return ALIGNMENT; } + YY_BREAK + case 75: + YY_RULE_SETUP + #line 201 "lev_comp.l" + { yylval.i= AM_LAWFUL; return ALIGNMENT; } + YY_BREAK + case 76: + YY_RULE_SETUP + #line 202 "lev_comp.l" + { yylval.i= AM_NEUTRAL; return ALIGNMENT; } + YY_BREAK + case 77: + YY_RULE_SETUP + #line 203 "lev_comp.l" + { yylval.i= AM_CHAOTIC; return ALIGNMENT; } + YY_BREAK + case 78: + YY_RULE_SETUP + #line 204 "lev_comp.l" + { yylval.i= AM_SPLEV_CO; return ALIGNMENT; } + YY_BREAK + case 79: + YY_RULE_SETUP + #line 205 "lev_comp.l" + { yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; } + YY_BREAK + case 80: + YY_RULE_SETUP + #line 206 "lev_comp.l" + { yylval.i=1; return MON_ATTITUDE; } + YY_BREAK + case 81: + YY_RULE_SETUP + #line 207 "lev_comp.l" + { yylval.i=0; return MON_ATTITUDE; } + YY_BREAK + case 82: + YY_RULE_SETUP + #line 208 "lev_comp.l" + { yylval.i=1; return MON_ALERTNESS; } + YY_BREAK + case 83: + YY_RULE_SETUP + #line 209 "lev_comp.l" + { yylval.i=0; return MON_ALERTNESS; } + YY_BREAK + case 84: + YY_RULE_SETUP + #line 210 "lev_comp.l" + { yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; } + YY_BREAK + case 85: + YY_RULE_SETUP + #line 211 "lev_comp.l" + { yylval.i= M_AP_MONSTER; return MON_APPEARANCE; } + YY_BREAK + case 86: + YY_RULE_SETUP + #line 212 "lev_comp.l" + { yylval.i= M_AP_OBJECT; return MON_APPEARANCE; } + YY_BREAK + case 87: + YY_RULE_SETUP + #line 213 "lev_comp.l" + { yylval.i=2; return ALTAR_TYPE; } + YY_BREAK + case 88: + YY_RULE_SETUP + #line 214 "lev_comp.l" + { yylval.i=1; return ALTAR_TYPE; } + YY_BREAK + case 89: + YY_RULE_SETUP + #line 215 "lev_comp.l" + { yylval.i=0; return ALTAR_TYPE; } + YY_BREAK + case 90: + YY_RULE_SETUP + #line 216 "lev_comp.l" + { yylval.i=1; return UP_OR_DOWN; } + YY_BREAK + case 91: + YY_RULE_SETUP + #line 217 "lev_comp.l" + { yylval.i=0; return UP_OR_DOWN; } + YY_BREAK + case 92: + YY_RULE_SETUP + #line 218 "lev_comp.l" + { yylval.i=0; return BOOLEAN; } + YY_BREAK + case 93: + YY_RULE_SETUP + #line 219 "lev_comp.l" + { yylval.i=1; return BOOLEAN; } + YY_BREAK + case 94: + YY_RULE_SETUP + #line 220 "lev_comp.l" + { yylval.i=DUST; return ENGRAVING_TYPE; } + YY_BREAK + case 95: + YY_RULE_SETUP + #line 221 "lev_comp.l" + { yylval.i=ENGRAVE; return ENGRAVING_TYPE; } + YY_BREAK + case 96: + YY_RULE_SETUP + #line 222 "lev_comp.l" + { yylval.i=BURN; return ENGRAVING_TYPE; } + YY_BREAK + case 97: + YY_RULE_SETUP + #line 223 "lev_comp.l" + { yylval.i=MARK; return ENGRAVING_TYPE; } + YY_BREAK + case 98: + YY_RULE_SETUP + #line 224 "lev_comp.l" + { yylval.i=ENGR_BLOOD; return ENGRAVING_TYPE; } + YY_BREAK + case 99: + YY_RULE_SETUP + #line 225 "lev_comp.l" + { yylval.i=1; return CURSE_TYPE; } + YY_BREAK + case 100: + YY_RULE_SETUP + #line 226 "lev_comp.l" + { yylval.i=2; return CURSE_TYPE; } + YY_BREAK + case 101: + YY_RULE_SETUP + #line 227 "lev_comp.l" + { yylval.i=3; return CURSE_TYPE; } + YY_BREAK + case 102: + YY_RULE_SETUP + #line 228 "lev_comp.l" + { return CONTAINED; } + YY_BREAK + case 103: + YY_RULE_SETUP + #line 229 "lev_comp.l" + { yylval.i=OBJF_LIT; return OBJFLAG_TYPE; } + YY_BREAK + case 104: + YY_RULE_SETUP + #line 230 "lev_comp.l" + { yylval.i=OBJF_BURIED; return OBJFLAG_TYPE; } + YY_BREAK + case 105: + YY_RULE_SETUP + #line 231 "lev_comp.l" + { yylval.i=NOTELEPORT; return FLAG_TYPE; } + YY_BREAK + case 106: + YY_RULE_SETUP + #line 232 "lev_comp.l" + { yylval.i=HARDFLOOR; return FLAG_TYPE; } + YY_BREAK + case 107: + YY_RULE_SETUP + #line 233 "lev_comp.l" + { yylval.i=NOMMAP; return FLAG_TYPE; } + YY_BREAK + case 108: + YY_RULE_SETUP + #line 234 "lev_comp.l" + { yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */ + YY_BREAK + case 109: + YY_RULE_SETUP + #line 235 "lev_comp.l" + { yylval.i=SHORTSIGHTED; return FLAG_TYPE; } + YY_BREAK + case 110: + YY_RULE_SETUP + #line 236 "lev_comp.l" + { yylval.i=SPOOKY; return FLAG_TYPE; } + YY_BREAK + case 111: + YY_RULE_SETUP + #line 237 "lev_comp.l" + { yylval.i=LETHE; return FLAG_TYPE; } + YY_BREAK + case 112: + YY_RULE_SETUP + #line 238 "lev_comp.l" + { yylval.i = atoi(yytext + 1); return PERCENT; } + YY_BREAK + case 113: + YY_RULE_SETUP + #line 239 "lev_comp.l" + { yylval.i=atoi(yytext); return INTEGER; } + YY_BREAK + case 114: + /* rule 114 can match eol */ + YY_RULE_SETUP + #line 240 "lev_comp.l" + { yytext[yyleng-1] = 0; /* Discard the trailing \" */ + yylval.map = (char *) alloc(strlen(yytext+1)+1); + Strcpy(yylval.map, yytext+1); /* Discard the first \" */ + return STRING; } + YY_BREAK + case 115: + /* rule 115 can match eol */ + YY_RULE_SETUP + #line 244 "lev_comp.l" + { line_number++; } + YY_BREAK + case 116: + YY_RULE_SETUP + #line 245 "lev_comp.l" + ; + YY_BREAK + case 117: + YY_RULE_SETUP + #line 246 "lev_comp.l" + { yylval.i = yytext[2]; return CHAR; } + YY_BREAK + case 118: + YY_RULE_SETUP + #line 247 "lev_comp.l" + { yylval.i = yytext[1]; return CHAR; } + YY_BREAK + case 119: + YY_RULE_SETUP + #line 248 "lev_comp.l" + { return yytext[0]; } + YY_BREAK + case 120: + YY_RULE_SETUP + #line 249 "lev_comp.l" + ECHO; + YY_BREAK + #line 1836 "lex.yy.c" + case YY_STATE_EOF(INITIAL): + case YY_STATE_EOF(MAPC): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + /* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + static int yy_get_next_buffer (void) + { + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart(yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; + } + + /* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 679 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; + } + + /* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) + { + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 679 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 678); + + return yy_is_jam ? 0 : yy_current_state; + } + + static void yyunput (int c, register char * yy_bp ) + { + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up yytext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; + } + + #ifndef YY_NO_INPUT + #ifdef __cplusplus + static int yyinput (void) + #else + static int input (void) + #endif + + { + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart(yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + #ifdef __cplusplus + return yyinput(); + #else + return input(); + #endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + return c; + } + #endif /* ifndef YY_NO_INPUT */ + + /** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) + { + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } + + yy_init_buffer(YY_CURRENT_BUFFER,input_file ); + yy_load_buffer_state( ); + } + + /** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) + { + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; + } + + static void yy_load_buffer_state (void) + { + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); + } + + /** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer(b,file ); + + return b; + } + + /** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) + { + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree((void *) b->yy_ch_buf ); + + yyfree((void *) b ); + } + + #ifndef __cplusplus + extern int isatty (int ); + #endif /* __cplusplus */ + + /* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + + { + int oerrno = errno; + + yy_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; + } + + /** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); + } + + /** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ + void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) + { + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } + + /** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ + void yypop_buffer_state (void) + { + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } + } + + /* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ + static void yyensure_buffer_stack (void) + { + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } + } + + /** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ + YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer(b ); + + return b; + } + + /** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param str a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ + YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str ) + { + + return yy_scan_bytes(yy_str,strlen(yy_str) ); + } + + /** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ + YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len ) + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yyalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } + + #ifndef YY_EXIT_FAILURE + #define YY_EXIT_FAILURE 2 + #endif + + static void yy_fatal_error (yyconst char* msg ) + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + /* Redefine yyless() so it works in section 3 code. */ + + #undef yyless + #define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + + /* Accessor methods (get/set functions) to struct members. */ + + /** Get the current line number. + * + */ + int yyget_lineno (void) + { + + return yylineno; + } + + /** Get the input stream. + * + */ + FILE *yyget_in (void) + { + return yyin; + } + + /** Get the output stream. + * + */ + FILE *yyget_out (void) + { + return yyout; + } + + /** Get the length of the current token. + * + */ + int yyget_leng (void) + { + return yyleng; + } + + /** Get the current token. + * + */ + + char *yyget_text (void) + { + return yytext; + } + + /** Set the current line number. + * @param line_number + * + */ + void yyset_lineno (int line_number ) + { + + yylineno = line_number; + } + + /** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see yy_switch_to_buffer + */ + void yyset_in (FILE * in_str ) + { + yyin = in_str ; + } + + void yyset_out (FILE * out_str ) + { + yyout = out_str ; + } + + int yyget_debug (void) + { + return yy_flex_debug; + } + + void yyset_debug (int bdebug ) + { + yy_flex_debug = bdebug ; + } + + /* yylex_destroy is for both reentrant and non-reentrant scanners. */ + int yylex_destroy (void) + { + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + return 0; + } + + /* + * Internal utility routines. + */ + + #ifndef yytext_ptr + static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } + #endif + + #ifdef YY_NEED_STRLEN + static int yy_flex_strlen (yyconst char * s ) + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } + #endif + + void *yyalloc (yy_size_t size ) + { + return (void *) malloc( size ); + } + + void *yyrealloc (void * ptr, yy_size_t size ) + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + + void yyfree (void * ptr ) + { + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + } + + #define YYTABLES_NAME "yytables" + + #undef YY_NEW_FILE + #undef YY_FLUSH_BUFFER + #undef yy_set_bol + #undef yy_new_buffer + #undef yy_set_interactive + #undef yytext_ptr + #undef YY_DO_BEFORE_ACTION + + #ifdef YY_DECL_IS_OURS + #undef YY_DECL_IS_OURS + #undef YY_DECL + #endif + #line 249 "lev_comp.l" + + + #ifdef AMIGA + long *alloc(n) + unsigned n; + { + return ((long *)malloc (n)); + } + #endif + + /* routine to switch to another input file; needed for flex */ + void init_yyin( input_f ) + FILE *input_f; + { + #if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) + if (yyin) + yyrestart(input_f); + else + #endif + yyin = input_f; + } + /* analogous routine (for completeness) */ + void init_yyout( output_f ) + FILE *output_f; + { + yyout = output_f; + } + + /*lev_comp.l*/ + diff -rN -c slashem-0.0.7E7F2/util/lev_yacc.c geekslashem-0.0.7E7F2/util/lev_yacc.c *** slashem-0.0.7E7F2/util/lev_yacc.c 1970-01-01 09:00:00.000000000 +0900 --- geekslashem-0.0.7E7F2/util/lev_yacc.c 2006-04-22 15:48:50.000000000 +0900 *************** *** 0 **** --- 1,3690 ---- + /* A Bison parser, made by GNU Bison 1.875d. */ + + /* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + /* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + + /* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ + + /* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + + /* Identify Bison output. */ + #define YYBISON 1 + + /* Skeleton name. */ + #define YYSKELETON_NAME "yacc.c" + + /* Pure parsers. */ + #define YYPURE 0 + + /* Using locations. */ + #define YYLSP_NEEDED 0 + + + + /* Tokens. */ + #ifndef YYTOKENTYPE + # define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + CHAR = 258, + INTEGER = 259, + BOOLEAN = 260, + PERCENT = 261, + MESSAGE_ID = 262, + MAZE_ID = 263, + LEVEL_ID = 264, + LEV_INIT_ID = 265, + GEOMETRY_ID = 266, + NOMAP_ID = 267, + OBJECT_ID = 268, + COBJECT_ID = 269, + MONSTER_ID = 270, + TRAP_ID = 271, + DOOR_ID = 272, + DRAWBRIDGE_ID = 273, + MAZEWALK_ID = 274, + WALLIFY_ID = 275, + REGION_ID = 276, + FILLING = 277, + RANDOM_OBJECTS_ID = 278, + RANDOM_MONSTERS_ID = 279, + RANDOM_PLACES_ID = 280, + ALTAR_ID = 281, + LADDER_ID = 282, + STAIR_ID = 283, + NON_DIGGABLE_ID = 284, + NON_PASSWALL_ID = 285, + ROOM_ID = 286, + PORTAL_ID = 287, + TELEPRT_ID = 288, + BRANCH_ID = 289, + LEV = 290, + CHANCE_ID = 291, + CORRIDOR_ID = 292, + GOLD_ID = 293, + ENGRAVING_ID = 294, + FOUNTAIN_ID = 295, + POOL_ID = 296, + SINK_ID = 297, + NONE = 298, + RAND_CORRIDOR_ID = 299, + DOOR_STATE = 300, + LIGHT_STATE = 301, + CURSE_TYPE = 302, + ENGRAVING_TYPE = 303, + DIRECTION = 304, + RANDOM_TYPE = 305, + O_REGISTER = 306, + M_REGISTER = 307, + P_REGISTER = 308, + A_REGISTER = 309, + ALIGNMENT = 310, + LEFT_OR_RIGHT = 311, + CENTER = 312, + TOP_OR_BOT = 313, + ALTAR_TYPE = 314, + UP_OR_DOWN = 315, + SUBROOM_ID = 316, + NAME_ID = 317, + FLAGS_ID = 318, + FLAG_TYPE = 319, + MON_ATTITUDE = 320, + MON_ALERTNESS = 321, + MON_APPEARANCE = 322, + CONTAINED = 323, + OBJFLAG_TYPE = 324, + OBJFLAGS_ID = 325, + RANDOMREGION_ID = 326, + R_REGISTER = 327, + STRING = 328, + MAP_ID = 329 + }; + #endif + #define CHAR 258 + #define INTEGER 259 + #define BOOLEAN 260 + #define PERCENT 261 + #define MESSAGE_ID 262 + #define MAZE_ID 263 + #define LEVEL_ID 264 + #define LEV_INIT_ID 265 + #define GEOMETRY_ID 266 + #define NOMAP_ID 267 + #define OBJECT_ID 268 + #define COBJECT_ID 269 + #define MONSTER_ID 270 + #define TRAP_ID 271 + #define DOOR_ID 272 + #define DRAWBRIDGE_ID 273 + #define MAZEWALK_ID 274 + #define WALLIFY_ID 275 + #define REGION_ID 276 + #define FILLING 277 + #define RANDOM_OBJECTS_ID 278 + #define RANDOM_MONSTERS_ID 279 + #define RANDOM_PLACES_ID 280 + #define ALTAR_ID 281 + #define LADDER_ID 282 + #define STAIR_ID 283 + #define NON_DIGGABLE_ID 284 + #define NON_PASSWALL_ID 285 + #define ROOM_ID 286 + #define PORTAL_ID 287 + #define TELEPRT_ID 288 + #define BRANCH_ID 289 + #define LEV 290 + #define CHANCE_ID 291 + #define CORRIDOR_ID 292 + #define GOLD_ID 293 + #define ENGRAVING_ID 294 + #define FOUNTAIN_ID 295 + #define POOL_ID 296 + #define SINK_ID 297 + #define NONE 298 + #define RAND_CORRIDOR_ID 299 + #define DOOR_STATE 300 + #define LIGHT_STATE 301 + #define CURSE_TYPE 302 + #define ENGRAVING_TYPE 303 + #define DIRECTION 304 + #define RANDOM_TYPE 305 + #define O_REGISTER 306 + #define M_REGISTER 307 + #define P_REGISTER 308 + #define A_REGISTER 309 + #define ALIGNMENT 310 + #define LEFT_OR_RIGHT 311 + #define CENTER 312 + #define TOP_OR_BOT 313 + #define ALTAR_TYPE 314 + #define UP_OR_DOWN 315 + #define SUBROOM_ID 316 + #define NAME_ID 317 + #define FLAGS_ID 318 + #define FLAG_TYPE 319 + #define MON_ATTITUDE 320 + #define MON_ALERTNESS 321 + #define MON_APPEARANCE 322 + #define CONTAINED 323 + #define OBJFLAG_TYPE 324 + #define OBJFLAGS_ID 325 + #define RANDOMREGION_ID 326 + #define R_REGISTER 327 + #define STRING 328 + #define MAP_ID 329 + + + + + /* Copy the first part of user declarations. */ + #line 1 "lev_comp.y" + + /* SCCS Id: @(#)lev_yacc.c 3.4 2000/01/17 */ + /* Copyright (c) 1989 by Jean-Christophe Collet */ + /* NetHack may be freely redistributed. See license for details. */ + + /* + * This file contains the Level Compiler code + * It may handle special mazes & special room-levels + */ + + #define LEVEL_COMPILER 1 /* Enable definition of internal structures */ + + /* In case we're using bison in AIX. This definition must be + * placed before any other C-language construct in the file + * excluding comments and preprocessor directives (thanks IBM + * for this wonderful feature...). + * + * Note: some cpps barf on this 'undefined control' (#pragma). + * Addition of the leading space seems to prevent barfage for now, + * and AIX will still see the directive. + */ + #ifdef _AIX + #pragma alloca /* keep leading space! */ + #endif + + #include "hack.h" + #include "sp_lev.h" + + #define MAX_REGISTERS 10 + #define ERR (-1) + /* many types of things are put in chars for transference to NetHack. + * since some systems will use signed chars, limit everybody to the + * same number for portability. + */ + #define MAX_OF_TYPE 128 + + #define New(type) \ + (type *) memset((genericptr_t)alloc(sizeof(type)), 0, sizeof(type)) + #define NewTab(type, size) (type **) alloc(sizeof(type *) * size) + #define Free(ptr) free((genericptr_t)ptr) + + extern void FDECL(yyerror, (const char *)); + extern void FDECL(yywarning, (const char *)); + extern int NDECL(yylex); + int NDECL(yyparse); + + extern int FDECL(get_artifact_id, (char *)); + extern int FDECL(get_floor_type, (CHAR_P)); + extern int FDECL(get_room_type, (char *)); + extern int FDECL(get_trap_type, (char *)); + extern int FDECL(get_monster_id, (char *,CHAR_P)); + extern int FDECL(get_object_id, (char *,CHAR_P)); + extern boolean FDECL(check_monster_char, (CHAR_P)); + extern boolean FDECL(check_object_char, (CHAR_P)); + extern char FDECL(what_map_char, (CHAR_P)); + extern void FDECL(scan_map, (char *)); + extern void NDECL(wallify_map); + extern boolean NDECL(check_subrooms); + extern void FDECL(check_coord, (int,int,const char *)); + extern void NDECL(store_part); + extern void NDECL(store_room); + extern void FDECL(store_place_list, (int,int,int,const struct coord *)); + extern boolean FDECL(write_level_file, (char *,splev *,specialmaze *)); + extern void FDECL(free_rooms, (splev *)); + + static struct reg { + int x1, y1; + int x2, y2; + } current_region; + + static struct coord current_coord, current_align; + + static struct size { + int height; + int width; + } current_size; + + char tmpmessage[256]; + digpos *tmppass[32]; + char *tmpmap[ROWNO]; + + digpos *tmpdig[MAX_OF_TYPE]; + region *tmpreg[MAX_OF_TYPE]; + lev_region *tmplreg[MAX_OF_TYPE]; + door *tmpdoor[MAX_OF_TYPE]; + drawbridge *tmpdb[MAX_OF_TYPE]; + walk *tmpwalk[MAX_OF_TYPE]; + lev_region *tmprndlreg[MAX_REGISTERS]; + + room_door *tmprdoor[MAX_OF_TYPE]; + trap *tmptrap[MAX_OF_TYPE]; + monster *tmpmonst[MAX_OF_TYPE]; + object *tmpobj[MAX_OF_TYPE]; + altar *tmpaltar[MAX_OF_TYPE]; + lad *tmplad[MAX_OF_TYPE]; + stair *tmpstair[MAX_OF_TYPE]; + gold *tmpgold[MAX_OF_TYPE]; + engraving *tmpengraving[MAX_OF_TYPE]; + fountain *tmpfountain[MAX_OF_TYPE]; + sink *tmpsink[MAX_OF_TYPE]; + pool *tmppool[MAX_OF_TYPE]; + + mazepart *tmppart[10]; + room *tmproom[MAXNROFROOMS*2]; + corridor *tmpcor[MAX_OF_TYPE]; + + static specialmaze maze; + static splev special_lev; + static lev_init init_lev; + + static char olist[MAX_REGISTERS], mlist[MAX_REGISTERS]; + static struct coord plist[MAX_REGISTERS]; + + int n_olist = 0, n_mlist = 0, n_plist = 0; + + unsigned int nrndlreg = 0; + unsigned int nlreg = 0, nreg = 0, ndoor = 0, ntrap = 0, nmons = 0, nobj = 0; + unsigned int ndb = 0, nwalk = 0, npart = 0, ndig = 0, nlad = 0, nstair = 0; + unsigned int naltar = 0, ncorridor = 0, nrooms = 0, ngold = 0, nengraving = 0; + unsigned int nfountain = 0, npool = 0, nsink = 0, npass = 0; + + static int lev_flags = 0; + + unsigned int max_x_map, max_y_map; + + static xchar in_room; + + extern int fatal_error; + extern int want_warnings; + extern const char *fname; + + + + /* Enabling traces. */ + #ifndef YYDEBUG + # define YYDEBUG 0 + #endif + + /* Enabling verbose error messages. */ + #ifdef YYERROR_VERBOSE + # undef YYERROR_VERBOSE + # define YYERROR_VERBOSE 1 + #else + # define YYERROR_VERBOSE 0 + #endif + + #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) + #line 135 "lev_comp.y" + typedef union YYSTYPE { + int i; + char* map; + struct { + xchar room; + xchar wall; + xchar door; + } corpos; + } YYSTYPE; + /* Line 191 of yacc.c. */ + #line 367 "y.tab.c" + # define yystype YYSTYPE /* obsolescent; will be withdrawn */ + # define YYSTYPE_IS_DECLARED 1 + # define YYSTYPE_IS_TRIVIAL 1 + #endif + + + + /* Copy the second part of user declarations. */ + + + /* Line 214 of yacc.c. */ + #line 379 "y.tab.c" + + #if ! defined (yyoverflow) || YYERROR_VERBOSE + + # ifndef YYFREE + # define YYFREE free + # endif + # ifndef YYMALLOC + # define YYMALLOC malloc + # endif + + /* The parser invokes alloca or malloc; define the necessary symbols. */ + + # ifdef YYSTACK_USE_ALLOCA + # if YYSTACK_USE_ALLOCA + # define YYSTACK_ALLOC alloca + # endif + # else + # if defined (alloca) || defined (_ALLOCA_H) + # define YYSTACK_ALLOC alloca + # else + # ifdef __GNUC__ + # define YYSTACK_ALLOC __builtin_alloca + # endif + # endif + # endif + + # ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ + # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) + # else + # if defined (__STDC__) || defined (__cplusplus) + # include /* INFRINGES ON USER NAME SPACE */ + # define YYSIZE_T size_t + # endif + # define YYSTACK_ALLOC YYMALLOC + # define YYSTACK_FREE YYFREE + # endif + #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ + + + #if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) + + /* A type that is properly aligned for any stack member. */ + union yyalloc + { + short int yyss; + YYSTYPE yyvs; + }; + + /* The size of the maximum gap between one aligned stack and the next. */ + # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + + /* The size of an array large to enough to hold all stacks, each with + N elements. */ + # define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + + /* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ + # ifndef YYCOPY + # if defined (__GNUC__) && 1 < __GNUC__ + # define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) + # else + # define YYCOPY(To, From, Count) \ + do \ + { \ + register YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) + # endif + # endif + + /* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ + # define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + + #endif + + #if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; + #else + typedef short int yysigned_char; + #endif + + /* YYFINAL -- State number of the termination state. */ + #define YYFINAL 12 + /* YYLAST -- Last index in YYTABLE. */ + #define YYLAST 490 + + /* YYNTOKENS -- Number of terminals. */ + #define YYNTOKENS 81 + /* YYNNTS -- Number of nonterminals. */ + #define YYNNTS 130 + /* YYNRULES -- Number of rules. */ + #define YYNRULES 244 + /* YYNRULES -- Number of states. */ + #define YYNSTATES 518 + + /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ + #define YYUNDEFTOK 2 + #define YYMAXUTOK 329 + + #define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + + /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ + static const unsigned char yytranslate[] = + { + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 75, 76, 2, 2, 73, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 74, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 77, 2, 78, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 79, 80 + }; + + #if YYDEBUG + /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ + static const unsigned short int yyprhs[] = + { + 0, 0, 3, 4, 6, 8, 11, 13, 15, 21, + 29, 33, 34, 48, 50, 52, 53, 57, 61, 63, + 64, 67, 71, 72, 75, 79, 83, 84, 86, 88, + 91, 93, 95, 97, 98, 101, 107, 113, 121, 124, + 127, 140, 153, 154, 157, 163, 165, 171, 173, 179, + 181, 187, 189, 190, 193, 195, 197, 199, 201, 203, + 205, 207, 209, 211, 213, 215, 217, 219, 221, 225, + 229, 230, 242, 243, 246, 249, 251, 253, 255, 257, + 259, 261, 267, 269, 271, 273, 276, 280, 282, 285, + 291, 293, 295, 297, 299, 300, 303, 307, 311, 318, + 322, 324, 326, 330, 332, 336, 338, 339, 344, 345, + 348, 350, 352, 354, 356, 358, 360, 362, 364, 366, + 368, 370, 372, 374, 376, 378, 380, 382, 384, 386, + 388, 390, 391, 402, 403, 406, 409, 412, 415, 418, + 422, 425, 428, 429, 439, 441, 443, 444, 452, 458, + 464, 468, 472, 474, 476, 478, 480, 482, 484, 485, + 488, 491, 492, 500, 501, 504, 507, 514, 522, 528, + 530, 536, 542, 543, 552, 553, 563, 564, 573, 574, + 575, 584, 585, 592, 593, 596, 598, 609, 613, 617, + 621, 625, 629, 638, 646, 652, 660, 662, 664, 666, + 668, 670, 672, 674, 676, 678, 680, 682, 684, 686, + 688, 689, 692, 697, 699, 701, 703, 705, 707, 709, + 711, 713, 715, 717, 719, 721, 723, 728, 736, 741, + 746, 751, 756, 758, 760, 762, 764, 766, 768, 770, + 771, 773, 775, 777, 783 + }; + + /* YYRHS -- A `-1'-separated list of the rules' RHS. */ + static const short int yyrhs[] = + { + 82, 0, -1, -1, 83, -1, 84, -1, 84, 83, + -1, 85, -1, 86, -1, 122, 90, 88, 92, 124, + -1, 87, 90, 88, 92, 94, 96, 98, -1, 9, + 74, 205, -1, -1, 10, 74, 3, 73, 3, 73, + 5, 73, 5, 73, 194, 73, 89, -1, 5, -1, + 50, -1, -1, 63, 74, 91, -1, 64, 73, 91, + -1, 64, -1, -1, 93, 92, -1, 7, 74, 79, + -1, -1, 94, 95, -1, 23, 74, 132, -1, 24, + 74, 133, -1, -1, 97, -1, 103, -1, 103, 97, + -1, 99, -1, 100, -1, 44, -1, -1, 100, 101, + -1, 37, 74, 102, 73, 102, -1, 37, 74, 102, + 73, 4, -1, 75, 4, 73, 49, 73, 121, 76, + -1, 105, 111, -1, 104, 111, -1, 61, 74, 190, + 73, 194, 73, 108, 73, 110, 73, 205, 106, -1, + 31, 74, 190, 73, 194, 73, 107, 73, 109, 73, + 110, 106, -1, -1, 73, 5, -1, 75, 4, 73, + 4, 76, -1, 50, -1, 75, 4, 73, 4, 76, + -1, 50, -1, 75, 128, 73, 129, 76, -1, 50, + -1, 75, 4, 73, 4, 76, -1, 50, -1, -1, + 111, 112, -1, 113, -1, 114, -1, 115, -1, 138, + -1, 142, -1, 147, -1, 157, -1, 182, -1, 176, + -1, 177, -1, 178, -1, 183, -1, 184, -1, 162, + -1, 62, 74, 205, -1, 36, 74, 4, -1, -1, + 17, 74, 119, 73, 193, 73, 120, 73, 121, 116, + 117, -1, -1, 117, 118, -1, 73, 205, -1, 5, + -1, 50, -1, 49, -1, 50, -1, 4, -1, 50, + -1, 8, 74, 205, 73, 123, -1, 3, -1, 50, + -1, 125, -1, 125, 124, -1, 126, 130, 136, -1, + 12, -1, 127, 80, -1, 11, 74, 128, 73, 129, + -1, 56, -1, 57, -1, 58, -1, 57, -1, -1, + 130, 131, -1, 23, 74, 132, -1, 25, 74, 134, + -1, 25, 77, 4, 78, 74, 134, -1, 24, 74, + 133, -1, 165, -1, 204, -1, 204, 73, 132, -1, + 203, -1, 203, 73, 133, -1, 202, -1, -1, 202, + 135, 73, 134, -1, -1, 136, 137, -1, 138, -1, + 142, -1, 147, -1, 153, -1, 157, -1, 158, -1, + 181, -1, 163, -1, 167, -1, 169, -1, 172, -1, + 182, -1, 176, -1, 159, -1, 160, -1, 161, -1, + 162, -1, 183, -1, 184, -1, 179, -1, 180, -1, + -1, 15, 207, 74, 185, 73, 187, 73, 192, 139, + 140, -1, -1, 140, 141, -1, 73, 205, -1, 73, + 65, -1, 73, 66, -1, 73, 195, -1, 73, 67, + 205, -1, 13, 143, -1, 14, 143, -1, -1, 207, + 74, 186, 73, 188, 144, 73, 145, 146, -1, 192, + -1, 68, -1, -1, 73, 149, 73, 150, 73, 151, + 152, -1, 73, 149, 73, 151, 152, -1, 73, 150, + 73, 151, 152, -1, 70, 74, 148, -1, 148, 73, + 69, -1, 69, -1, 50, -1, 47, -1, 79, -1, + 50, -1, 4, -1, -1, 73, 43, -1, 73, 79, + -1, -1, 17, 74, 193, 73, 192, 154, 155, -1, + -1, 155, 156, -1, 73, 205, -1, 16, 207, 74, + 189, 73, 192, -1, 18, 74, 192, 73, 49, 73, + 193, -1, 19, 74, 192, 73, 49, -1, 20, -1, + 27, 74, 192, 73, 60, -1, 28, 74, 192, 73, + 60, -1, -1, 28, 74, 175, 164, 73, 175, 73, + 60, -1, -1, 71, 77, 4, 78, 74, 175, 166, + 73, 175, -1, -1, 32, 74, 175, 168, 73, 175, + 73, 205, -1, -1, -1, 33, 74, 175, 170, 73, + 175, 171, 174, -1, -1, 34, 74, 175, 173, 73, + 175, -1, -1, 73, 60, -1, 210, -1, 35, 75, + 4, 73, 4, 73, 4, 73, 4, 76, -1, 40, + 74, 192, -1, 42, 74, 192, -1, 41, 74, 192, + -1, 29, 74, 210, -1, 30, 74, 210, -1, 21, + 74, 210, 73, 194, 73, 190, 191, -1, 26, 74, + 192, 73, 195, 73, 196, -1, 38, 74, 206, 73, + 192, -1, 39, 74, 192, 73, 208, 73, 205, -1, + 203, -1, 50, -1, 200, -1, 204, -1, 50, -1, + 199, -1, 205, -1, 50, -1, 205, -1, 50, -1, + 205, -1, 50, -1, 205, -1, 50, -1, -1, 73, + 22, -1, 73, 22, 73, 5, -1, 209, -1, 197, + -1, 198, -1, 50, -1, 45, -1, 50, -1, 46, + -1, 50, -1, 55, -1, 201, -1, 50, -1, 59, + -1, 50, -1, 53, 77, 4, 78, -1, 53, 77, + 4, 78, 77, 4, 78, -1, 72, 77, 4, 78, + -1, 51, 77, 4, 78, -1, 52, 77, 4, 78, + -1, 54, 77, 4, 78, -1, 209, -1, 43, -1, + 3, -1, 3, -1, 79, -1, 4, -1, 50, -1, + -1, 6, -1, 48, -1, 50, -1, 75, 4, 73, + 4, 76, -1, 75, 4, 73, 4, 73, 4, 73, + 4, 76, -1 + }; + + /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + static const unsigned short int yyrline[] = + { + 0, 174, 174, 175, 178, 179, 182, 183, 186, 213, + 250, 263, 271, 291, 292, 296, 299, 306, 310, 316, + 317, 320, 337, 338, 341, 352, 366, 380, 383, 384, + 387, 388, 391, 399, 400, 403, 418, 434, 444, 448, + 454, 472, 491, 494, 500, 510, 516, 525, 531, 536, + 542, 547, 553, 554, 557, 558, 559, 560, 561, 562, + 563, 564, 565, 566, 567, 568, 569, 570, 573, 582, + 596, 595, 622, 623, 626, 640, 641, 644, 645, 648, + 649, 652, 665, 669, 675, 676, 679, 685, 701, 714, + 720, 721, 724, 725, 728, 729, 732, 743, 751, 759, + 770, 776, 783, 792, 799, 808, 816, 815, 825, 826, + 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, + 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, + 849, 853, 852, 888, 889, 892, 896, 900, 904, 908, + 915, 918, 928, 927, 956, 965, 975, 984, 987, 990, + 995, 1003, 1007, 1013, 1017, 1023, 1034, 1038, 1044, 1045, + 1048, 1055, 1054, 1075, 1076, 1079, 1092, 1109, 1151, 1165, + 1171, 1188, 1206, 1205, 1235, 1234, 1263, 1262, 1289, 1298, + 1288, 1322, 1321, 1348, 1351, 1357, 1361, 1381, 1397, 1410, + 1423, 1438, 1453, 1519, 1537, 1554, 1572, 1573, 1577, 1580, + 1581, 1585, 1588, 1589, 1595, 1596, 1602, 1610, 1613, 1623, + 1627, 1630, 1634, 1640, 1641, 1642, 1643, 1649, 1650, 1653, + 1654, 1657, 1658, 1659, 1665, 1666, 1669, 1678, 1689, 1700, + 1709, 1718, 1727, 1728, 1735, 1746, 1758, 1761, 1762, 1766, + 1769, 1777, 1778, 1781, 1792 + }; + #endif + + #if YYDEBUG || YYERROR_VERBOSE + /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ + static const char *const yytname[] = + { + "$end", "error", "$undefined", "CHAR", "INTEGER", "BOOLEAN", "PERCENT", + "MESSAGE_ID", "MAZE_ID", "LEVEL_ID", "LEV_INIT_ID", "GEOMETRY_ID", + "NOMAP_ID", "OBJECT_ID", "COBJECT_ID", "MONSTER_ID", "TRAP_ID", + "DOOR_ID", "DRAWBRIDGE_ID", "MAZEWALK_ID", "WALLIFY_ID", "REGION_ID", + "FILLING", "RANDOM_OBJECTS_ID", "RANDOM_MONSTERS_ID", "RANDOM_PLACES_ID", + "ALTAR_ID", "LADDER_ID", "STAIR_ID", "NON_DIGGABLE_ID", + "NON_PASSWALL_ID", "ROOM_ID", "PORTAL_ID", "TELEPRT_ID", "BRANCH_ID", + "LEV", "CHANCE_ID", "CORRIDOR_ID", "GOLD_ID", "ENGRAVING_ID", + "FOUNTAIN_ID", "POOL_ID", "SINK_ID", "NONE", "RAND_CORRIDOR_ID", + "DOOR_STATE", "LIGHT_STATE", "CURSE_TYPE", "ENGRAVING_TYPE", "DIRECTION", + "RANDOM_TYPE", "O_REGISTER", "M_REGISTER", "P_REGISTER", "A_REGISTER", + "ALIGNMENT", "LEFT_OR_RIGHT", "CENTER", "TOP_OR_BOT", "ALTAR_TYPE", + "UP_OR_DOWN", "SUBROOM_ID", "NAME_ID", "FLAGS_ID", "FLAG_TYPE", + "MON_ATTITUDE", "MON_ALERTNESS", "MON_APPEARANCE", "CONTAINED", + "OBJFLAG_TYPE", "OBJFLAGS_ID", "RANDOMREGION_ID", "R_REGISTER", "','", + "':'", "'('", "')'", "'['", "']'", "STRING", "MAP_ID", "$accept", "file", + "levels", "level", "maze_level", "room_level", "level_def", "lev_init", + "walled", "flags", "flag_list", "messages", "message", "rreg_init", + "init_rreg", "rooms", "roomlist", "corridors_def", "random_corridors", + "corridors", "corridor", "corr_spec", "aroom", "subroom_def", "room_def", + "roomfill", "room_pos", "subroom_pos", "room_align", "room_size", + "room_details", "room_detail", "room_name", "room_chance", "room_door", + "@1", "room_door_infos", "room_door_info", "secret", "door_wall", + "door_pos", "maze_def", "filling", "regions", "aregion", + "map_definition", "map_geometry", "h_justif", "v_justif", "reg_init", + "init_reg", "object_list", "monster_list", "place_list", "@2", + "map_details", "map_detail", "monster_detail", "@3", "monster_infos", + "monster_info", "object_detail", "object_desc", "@4", "object_where", + "object_infos", "object_flags", "obj_flag_list", "curse_state", + "monster_id", "enchantment", "optional_name", "door_detail", "@5", + "door_infos", "door_info", "trap_detail", "drawbridge_detail", + "mazewalk_detail", "wallify_detail", "ladder_detail", "stair_detail", + "stair_region", "@6", "rndlevregion", "@7", "portal_region", "@8", + "teleprt_region", "@9", "@10", "branch_region", "@11", "teleprt_detail", + "lev_region", "fountain_detail", "sink_detail", "pool_detail", + "diggable_detail", "passwall_detail", "region_detail", "altar_detail", + "gold_detail", "engraving_detail", "monster_c", "object_c", "m_name", + "o_name", "trap_name", "room_type", "prefilled", "coordinate", + "door_state", "light_state", "alignment", "altar_type", "p_register", + "r_register", "o_register", "m_register", "a_register", "place", + "monster", "object", "string", "amount", "chance", "engraving_type", + "coord", "region", 0 + }; + #endif + + # ifdef YYPRINT + /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ + static const unsigned short int yytoknum[] = + { + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 44, 58, 40, 41, 91, 93, 328, + 329 + }; + # endif + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ + static const unsigned char yyr1[] = + { + 0, 81, 82, 82, 83, 83, 84, 84, 85, 86, + 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, + 92, 93, 94, 94, 95, 95, 96, 96, 97, 97, + 98, 98, 99, 100, 100, 101, 101, 102, 103, 103, + 104, 105, 106, 106, 107, 107, 108, 108, 109, 109, + 110, 110, 111, 111, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 113, 114, + 116, 115, 117, 117, 118, 119, 119, 120, 120, 121, + 121, 122, 123, 123, 124, 124, 125, 126, 126, 127, + 128, 128, 129, 129, 130, 130, 131, 131, 131, 131, + 131, 132, 132, 133, 133, 134, 135, 134, 136, 136, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 139, 138, 140, 140, 141, 141, 141, 141, 141, + 142, 142, 144, 143, 145, 145, 146, 146, 146, 146, + 147, 148, 148, 149, 149, 150, 151, 151, 152, 152, + 152, 154, 153, 155, 155, 156, 157, 158, 159, 160, + 161, 162, 164, 163, 166, 165, 168, 167, 170, 171, + 169, 173, 172, 174, 174, 175, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 185, 185, 186, + 186, 186, 187, 187, 188, 188, 189, 189, 190, 190, + 191, 191, 191, 192, 192, 192, 192, 193, 193, 194, + 194, 195, 195, 195, 196, 196, 197, 197, 198, 199, + 200, 201, 202, 202, 203, 204, 205, 206, 206, 207, + 207, 208, 208, 209, 210 + }; + + /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ + static const unsigned char yyr2[] = + { + 0, 2, 0, 1, 1, 2, 1, 1, 5, 7, + 3, 0, 13, 1, 1, 0, 3, 3, 1, 0, + 2, 3, 0, 2, 3, 3, 0, 1, 1, 2, + 1, 1, 1, 0, 2, 5, 5, 7, 2, 2, + 12, 12, 0, 2, 5, 1, 5, 1, 5, 1, + 5, 1, 0, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, + 0, 11, 0, 2, 2, 1, 1, 1, 1, 1, + 1, 5, 1, 1, 1, 2, 3, 1, 2, 5, + 1, 1, 1, 1, 0, 2, 3, 3, 6, 3, + 1, 1, 3, 1, 3, 1, 0, 4, 0, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 10, 0, 2, 2, 2, 2, 2, 3, + 2, 2, 0, 9, 1, 1, 0, 7, 5, 5, + 3, 3, 1, 1, 1, 1, 1, 1, 0, 2, + 2, 0, 7, 0, 2, 2, 6, 7, 5, 1, + 5, 5, 0, 8, 0, 9, 0, 8, 0, 0, + 8, 0, 6, 0, 2, 1, 10, 3, 3, 3, + 3, 3, 8, 7, 5, 7, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 2, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 4, 7, 4, 4, + 4, 4, 1, 1, 1, 1, 1, 1, 1, 0, + 1, 1, 1, 5, 9 + }; + + /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ + static const unsigned char yydefact[] = + { + 2, 0, 0, 0, 3, 4, 6, 7, 15, 15, + 0, 0, 1, 5, 0, 11, 11, 236, 0, 10, + 0, 0, 19, 19, 0, 18, 16, 0, 0, 22, + 19, 0, 82, 83, 81, 0, 0, 0, 26, 20, + 0, 87, 8, 84, 94, 0, 17, 0, 21, 0, + 0, 0, 0, 23, 33, 27, 28, 52, 52, 0, + 85, 108, 88, 0, 0, 0, 0, 0, 32, 9, + 30, 31, 29, 39, 38, 90, 91, 0, 0, 0, + 0, 0, 95, 86, 100, 0, 235, 24, 101, 234, + 25, 103, 209, 0, 208, 0, 0, 34, 239, 239, + 239, 239, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, + 60, 67, 62, 63, 64, 61, 65, 66, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 169, 0, 0, + 0, 0, 0, 0, 0, 0, 109, 110, 111, 112, + 113, 114, 115, 123, 124, 125, 126, 117, 118, 119, + 120, 122, 129, 130, 116, 121, 127, 128, 0, 0, + 0, 0, 0, 0, 240, 140, 0, 141, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 93, 92, 89, 96, 99, 233, 0, 97, 105, + 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 102, 104, 219, 220, 0, + 0, 0, 0, 0, 0, 0, 75, 76, 0, 216, + 0, 0, 0, 214, 215, 213, 0, 69, 237, 238, + 0, 0, 187, 189, 188, 68, 152, 150, 0, 0, + 0, 0, 217, 218, 0, 0, 0, 0, 0, 0, + 0, 0, 172, 185, 190, 191, 176, 178, 181, 0, + 0, 0, 0, 0, 200, 0, 0, 201, 199, 197, + 0, 0, 198, 196, 207, 0, 206, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 45, 0, 0, 47, 0, 0, 0, 36, + 35, 0, 0, 0, 0, 0, 0, 0, 0, 223, + 0, 221, 0, 222, 171, 194, 241, 242, 0, 151, + 0, 107, 98, 174, 161, 0, 168, 0, 0, 170, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 205, 142, 204, 0, 203, 0, 202, + 166, 0, 226, 228, 0, 0, 0, 243, 0, 163, + 0, 0, 0, 0, 0, 0, 0, 179, 182, 0, + 0, 49, 0, 0, 0, 51, 0, 0, 0, 229, + 0, 230, 0, 77, 78, 0, 0, 0, 225, 224, + 193, 195, 0, 162, 167, 0, 210, 0, 0, 0, + 183, 13, 14, 12, 0, 0, 0, 0, 0, 0, + 79, 80, 0, 0, 131, 0, 0, 231, 175, 0, + 164, 0, 0, 192, 0, 173, 177, 0, 180, 44, + 0, 42, 46, 0, 42, 37, 145, 146, 144, 133, + 70, 227, 165, 0, 211, 0, 184, 0, 0, 41, + 0, 40, 0, 143, 132, 72, 0, 0, 0, 48, + 43, 50, 154, 153, 155, 0, 0, 0, 134, 71, + 244, 212, 0, 0, 0, 136, 137, 0, 138, 135, + 0, 73, 186, 157, 156, 0, 158, 158, 139, 74, + 0, 0, 148, 149, 158, 159, 160, 147 + }; + + /* YYDEFGOTO[NTERM-NUM]. */ + static const short int yydefgoto[] = + { + -1, 3, 4, 5, 6, 7, 8, 22, 423, 15, + 26, 29, 30, 38, 53, 54, 55, 69, 70, 71, + 97, 222, 56, 57, 58, 469, 314, 317, 393, 397, + 73, 113, 114, 115, 116, 475, 489, 501, 228, 405, + 432, 9, 34, 42, 43, 44, 45, 77, 193, 61, + 82, 87, 90, 198, 249, 83, 146, 117, 459, 474, + 488, 118, 175, 400, 457, 473, 119, 247, 485, 486, + 506, 512, 150, 379, 413, 440, 120, 152, 153, 154, + 155, 121, 157, 307, 84, 378, 158, 308, 159, 309, + 420, 160, 310, 448, 262, 122, 123, 124, 162, 163, + 164, 125, 126, 127, 281, 276, 368, 364, 285, 93, + 443, 236, 254, 219, 332, 410, 233, 234, 277, 282, + 333, 199, 91, 88, 94, 240, 176, 338, 235, 263 + }; + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ + #define YYPACT_NINF -393 + static const short int yypact[] = + { + 121, -2, 2, 120, -393, 121, -393, -393, 97, 97, + 111, 111, -393, -393, 119, 184, 184, -393, 122, -393, + 132, 124, 190, 190, 42, 126, -393, 197, 128, -393, + 190, 164, -393, -393, -393, 132, 130, 129, 80, -393, + 131, -393, -393, 164, -393, 133, -393, 198, -393, 135, + 136, 140, 142, -393, 160, -393, 65, -393, -393, 125, + -393, 16, -393, 134, 203, 208, 56, 56, -393, -393, + -393, 180, -393, 39, 39, -393, -393, 145, 146, 147, + -16, 148, -393, 4, -393, 214, -393, -393, 149, -393, + -393, 150, -393, 153, -393, 154, 155, -393, 222, 222, + 222, 222, 156, 157, 158, 159, 161, 162, 163, 165, + 166, 167, 168, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, 127, 203, + 208, 8, 230, 234, 169, 170, 171, -393, 172, 173, + 174, 175, 176, 177, 178, 179, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, 181, 203, + 208, 82, 82, 182, -393, -393, 185, -393, 186, 187, + 23, 90, 90, 252, 43, 90, 90, 90, 90, 111, + 189, -393, -393, -393, -393, -393, -393, 258, -393, 191, + -393, 188, 192, 123, 90, 90, 193, 90, 35, 193, + 193, 15, 15, 15, 260, -393, -393, -393, -393, 194, + 196, 259, 199, 13, 32, 66, -393, -393, 200, -393, + 201, 202, 204, -393, -393, -393, 207, -393, -393, -393, + 209, 210, -393, -393, -393, -393, -393, 211, 212, 213, + 215, 216, -393, -393, 218, 219, 220, 267, 221, 223, + 206, 270, -393, -393, -393, -393, -393, -393, -393, 224, + 81, 83, 225, 11, -393, 226, 227, -393, -393, -393, + 228, 229, -393, -393, -393, 231, -393, 123, 271, 272, + 117, 235, 90, 101, 232, 283, 8, 8, 15, 90, + 239, 250, 233, 82, 247, 304, 236, 237, 238, 240, + 242, 82, -393, 312, 245, -393, 315, 248, 273, -393, + -393, 316, 67, 319, 69, 90, 251, 249, 253, -393, + 255, -393, 256, -393, -393, -393, -393, -393, 257, -393, + 261, -393, -393, -393, -393, 262, -393, 321, 263, -393, + 265, 322, 15, 15, 15, 15, 266, 268, 84, 269, + 88, 274, 275, -393, -393, -393, 276, -393, 277, -393, + -393, 137, 278, -393, 324, 68, 111, -393, 279, -393, + 123, 284, 56, 329, 107, 285, 286, -393, -393, 41, + 330, -393, 125, 287, 336, -393, 339, 288, 44, -393, + 289, -393, 90, -393, -393, 290, 340, 291, -393, -393, + -393, -393, 15, 292, -393, 341, 294, 295, 296, 111, + 297, -393, -393, -393, 298, 299, 88, 300, 302, 111, + -393, -393, 301, 89, -393, 44, 293, -393, -393, 111, + -393, 305, 326, -393, 342, -393, -393, 313, -393, -393, + 127, 306, -393, 345, 306, -393, -393, 307, -393, -393, + -393, -393, -393, 347, 308, 309, -393, 310, 359, -393, + 311, -393, 21, -393, 317, -393, 318, 378, 380, -393, + -393, -393, -393, -393, -393, 320, 323, 58, -393, 325, + -393, -393, 327, 10, 45, -393, -393, 111, -393, -393, + 111, -393, -393, -393, -393, 328, 331, 331, -393, -393, + 45, 26, -393, -393, 331, -393, -393, -393 + }; + + /* YYPGOTO[NTERM-NUM]. */ + static const short int yypgoto[] = + { + -393, -393, 383, -393, -393, -393, -393, 369, -393, 382, + 354, 36, -393, -393, -393, -393, 343, -393, -393, -393, + -393, 138, -393, -393, -393, -62, -393, -393, -393, -31, + 344, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -38, -393, -393, 357, -393, -393, -393, 14, -45, -393, + -393, -72, -68, -108, -393, -393, -393, 332, -393, -393, + -393, 333, 314, -393, -393, -393, 334, -393, -393, -86, + -344, -392, -393, -393, -393, -393, 335, -393, -393, -393, + -393, 337, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -200, 338, -393, -393, -393, -393, + -393, 348, 349, 350, -393, -393, -393, -393, -393, -65, + -393, -178, -281, -167, -79, -393, -393, -393, -393, -393, + -393, -393, 217, 205, -10, -393, 91, -393, -127, -32 + }; + + /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ + #define YYTABLE_NINF -107 + static const short int yytable[] = + { + 18, 19, 95, 232, 200, 220, 326, 241, 242, 243, + 244, 266, 267, 268, 503, 319, 86, 98, 99, 100, + 101, 134, 135, 136, 137, 138, 255, 256, 226, 259, + 103, 139, 140, 141, 142, 89, 143, 144, 145, 78, + 79, 80, 106, 107, 108, 32, 421, 238, 430, 503, + 260, 196, 98, 99, 100, 101, 102, 194, 131, 31, + 504, 132, 195, 274, 275, 103, 39, 104, 482, 515, + 260, 483, 10, 227, 112, 105, 11, 106, 107, 108, + 109, 110, 279, 197, 280, 229, 221, 81, 230, 484, + 257, 422, 33, 239, 431, 504, 51, 215, 343, 414, + 484, 111, 216, 49, 50, 516, 92, 231, 329, 112, + 261, 51, 330, 331, 335, 513, 284, 363, 408, 367, + 12, 344, 517, 495, 496, 497, 52, 409, 217, 1, + 2, 312, 218, 315, 391, 17, 348, 17, 395, 229, + 229, 52, 230, 230, 356, 17, 17, 370, 17, 336, + 507, 337, 385, 386, 387, 388, 313, 456, 316, 392, + 14, 231, 231, 396, 197, 197, 514, 329, 252, 200, + 200, 330, 331, 253, 258, 40, 41, 264, 265, 245, + 415, 75, 76, 377, 191, 192, 403, 404, 341, 342, + 17, 178, 179, 20, 21, 24, 25, 28, 27, 35, + 36, 63, 37, 47, 68, 59, 86, 85, 48, 64, + 65, 89, 438, 62, 66, 286, 67, 96, 128, 168, + 129, 130, 169, 170, 434, 133, 171, 172, 174, 173, + 180, 181, 182, 183, 201, 184, 185, 186, 202, 187, + 188, 189, 190, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 458, 237, 221, 246, 223, + 224, 225, 248, 272, -106, 269, 250, 270, 257, 271, + 251, 302, 273, 287, 306, 327, 328, 290, 288, 289, + 291, 305, 292, 293, 294, 295, 296, 340, 345, 297, + 298, 299, 300, 301, 303, 334, 304, 311, 318, 346, + 322, 339, 324, 321, 325, 323, 347, 349, 350, 351, + 352, 353, 365, 354, 369, 355, 357, 416, 358, 359, + 362, 360, 361, 366, 371, 381, 384, 372, 407, 375, + 376, 373, 374, 417, 424, 380, 382, 377, 383, 389, + 427, 390, 394, 428, 436, 441, 465, 398, 464, 470, + 402, 476, 412, 399, 401, 406, 445, 415, 418, 419, + 426, 429, 433, 435, 480, 439, 411, 442, 444, 437, + 447, 461, 450, 466, 449, 453, 452, 455, 463, 468, + 472, 477, 478, 491, 492, 23, 479, 481, 13, 46, + 487, 16, 471, 493, 490, 451, 494, 460, 500, 72, + 60, 510, 74, 502, 511, 467, 425, 505, 498, 446, + 0, 320, 0, 177, 0, 147, 148, 149, 151, 454, + 156, 161, 0, 0, 0, 0, 0, 0, 278, 462, + 0, 165, 166, 167, 0, 0, 0, 0, 0, 0, + 0, 283, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 499, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 508, 0, 0, + 509 + }; + + static const short int yycheck[] = + { + 10, 11, 67, 181, 131, 172, 287, 185, 186, 187, + 188, 211, 212, 213, 4, 4, 3, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 204, 205, 5, 207, + 26, 27, 28, 29, 30, 3, 32, 33, 34, 23, + 24, 25, 38, 39, 40, 3, 5, 4, 4, 4, + 35, 43, 13, 14, 15, 16, 17, 129, 74, 23, + 50, 77, 130, 50, 51, 26, 30, 28, 47, 43, + 35, 50, 74, 50, 70, 36, 74, 38, 39, 40, + 41, 42, 50, 75, 52, 50, 75, 71, 53, 79, + 75, 50, 50, 50, 50, 50, 31, 169, 298, 380, + 79, 62, 170, 23, 24, 79, 50, 72, 50, 70, + 75, 31, 54, 55, 292, 507, 50, 50, 50, 50, + 0, 299, 514, 65, 66, 67, 61, 59, 46, 8, + 9, 50, 50, 50, 50, 79, 303, 79, 50, 50, + 50, 61, 53, 53, 311, 79, 79, 325, 79, 48, + 494, 50, 352, 353, 354, 355, 75, 68, 75, 75, + 63, 72, 72, 75, 75, 75, 510, 50, 45, 296, + 297, 54, 55, 50, 206, 11, 12, 209, 210, 189, + 73, 56, 57, 76, 57, 58, 49, 50, 296, 297, + 79, 100, 101, 74, 10, 73, 64, 7, 74, 73, + 3, 3, 74, 73, 44, 74, 3, 73, 79, 74, + 74, 3, 412, 80, 74, 225, 74, 37, 73, 5, + 74, 74, 73, 73, 402, 77, 73, 73, 6, 74, + 74, 74, 74, 74, 4, 74, 74, 74, 4, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 73, 433, 4, 75, 69, 74, + 74, 74, 4, 4, 73, 5, 78, 73, 75, 73, + 78, 4, 73, 73, 4, 4, 4, 73, 77, 77, + 73, 75, 73, 73, 73, 73, 73, 4, 49, 74, + 74, 73, 73, 73, 73, 60, 73, 73, 73, 49, + 73, 69, 73, 77, 73, 77, 73, 60, 4, 73, + 73, 73, 322, 73, 324, 73, 4, 382, 73, 4, + 4, 73, 49, 4, 73, 4, 4, 78, 4, 73, + 73, 78, 77, 4, 4, 73, 73, 76, 73, 73, + 4, 73, 73, 4, 4, 4, 4, 73, 22, 4, + 73, 4, 73, 78, 78, 77, 60, 73, 73, 73, + 73, 73, 73, 73, 5, 73, 376, 73, 73, 78, + 73, 78, 73, 60, 76, 73, 76, 76, 73, 73, + 73, 73, 73, 5, 4, 16, 76, 76, 5, 35, + 73, 9, 454, 73, 76, 426, 73, 435, 73, 56, + 43, 73, 58, 76, 73, 450, 392, 493, 487, 419, + -1, 273, -1, 99, -1, 83, 83, 83, 83, 429, + 83, 83, -1, -1, -1, -1, -1, -1, 223, 439, + -1, 83, 83, 83, -1, -1, -1, -1, -1, -1, + -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 487, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 497, -1, -1, + 500 + }; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ + static const unsigned char yystos[] = + { + 0, 8, 9, 82, 83, 84, 85, 86, 87, 122, + 74, 74, 0, 83, 63, 90, 90, 79, 205, 205, + 74, 10, 88, 88, 73, 64, 91, 74, 7, 92, + 93, 92, 3, 50, 123, 73, 3, 74, 94, 92, + 11, 12, 124, 125, 126, 127, 91, 73, 79, 23, + 24, 31, 61, 95, 96, 97, 103, 104, 105, 74, + 124, 130, 80, 3, 74, 74, 74, 74, 44, 98, + 99, 100, 97, 111, 111, 56, 57, 128, 23, 24, + 25, 71, 131, 136, 165, 73, 3, 132, 204, 3, + 133, 203, 50, 190, 205, 190, 37, 101, 13, 14, + 15, 16, 17, 26, 28, 36, 38, 39, 40, 41, + 42, 62, 70, 112, 113, 114, 115, 138, 142, 147, + 157, 162, 176, 177, 178, 182, 183, 184, 73, 74, + 74, 74, 77, 77, 17, 18, 19, 20, 21, 27, + 28, 29, 30, 32, 33, 34, 137, 138, 142, 147, + 153, 157, 158, 159, 160, 161, 162, 163, 167, 169, + 172, 176, 179, 180, 181, 182, 183, 184, 5, 73, + 73, 73, 73, 74, 6, 143, 207, 143, 207, 207, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 57, 58, 129, 132, 133, 43, 75, 134, 202, + 209, 4, 4, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 73, 132, 133, 46, 50, 194, + 194, 75, 102, 74, 74, 74, 5, 50, 119, 50, + 53, 72, 192, 197, 198, 209, 192, 4, 4, 50, + 206, 192, 192, 192, 192, 205, 69, 148, 4, 135, + 78, 78, 45, 50, 193, 192, 192, 75, 210, 192, + 35, 75, 175, 210, 210, 210, 175, 175, 175, 5, + 73, 73, 4, 73, 50, 51, 186, 199, 204, 50, + 52, 185, 200, 203, 50, 189, 205, 73, 77, 77, + 73, 73, 73, 73, 73, 73, 73, 74, 74, 73, + 73, 73, 4, 73, 73, 75, 4, 164, 168, 170, + 173, 73, 50, 75, 107, 50, 75, 108, 73, 4, + 102, 77, 73, 77, 73, 73, 193, 4, 4, 50, + 54, 55, 195, 201, 60, 192, 48, 50, 208, 69, + 4, 134, 134, 175, 192, 49, 49, 73, 194, 60, + 4, 73, 73, 73, 73, 73, 194, 4, 73, 4, + 73, 49, 4, 50, 188, 205, 4, 50, 187, 205, + 192, 73, 78, 78, 77, 73, 73, 76, 166, 154, + 73, 4, 73, 73, 4, 175, 175, 175, 175, 73, + 73, 50, 75, 109, 73, 50, 75, 110, 73, 78, + 144, 78, 73, 49, 50, 120, 77, 4, 50, 59, + 196, 205, 73, 155, 193, 73, 190, 4, 73, 73, + 171, 5, 50, 89, 4, 128, 73, 4, 4, 73, + 4, 50, 121, 73, 192, 73, 4, 78, 175, 73, + 156, 4, 73, 191, 73, 60, 205, 73, 174, 76, + 73, 110, 76, 73, 205, 76, 68, 145, 192, 139, + 121, 78, 205, 73, 22, 4, 60, 129, 73, 106, + 4, 106, 73, 146, 140, 116, 4, 73, 73, 76, + 5, 76, 47, 50, 79, 149, 150, 73, 141, 117, + 76, 5, 4, 73, 73, 65, 66, 67, 195, 205, + 73, 118, 76, 4, 50, 150, 151, 151, 205, 205, + 73, 73, 152, 152, 151, 43, 79, 152 + }; + + #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) + # define YYSIZE_T __SIZE_TYPE__ + #endif + #if ! defined (YYSIZE_T) && defined (size_t) + # define YYSIZE_T size_t + #endif + #if ! defined (YYSIZE_T) + # if defined (__STDC__) || defined (__cplusplus) + # include /* INFRINGES ON USER NAME SPACE */ + # define YYSIZE_T size_t + # endif + #endif + #if ! defined (YYSIZE_T) + # define YYSIZE_T unsigned int + #endif + + #define yyerrok (yyerrstatus = 0) + #define yyclearin (yychar = YYEMPTY) + #define YYEMPTY (-2) + #define YYEOF 0 + + #define YYACCEPT goto yyacceptlab + #define YYABORT goto yyabortlab + #define YYERROR goto yyerrorlab + + + /* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + + #define YYFAIL goto yyerrlab + + #define YYRECOVERING() (!!yyerrstatus) + + #define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror ("syntax error: cannot back up");\ + YYERROR; \ + } \ + while (0) + + #define YYTERROR 1 + #define YYERRCODE 256 + + /* YYLLOC_DEFAULT -- Compute the default location (before the actions + are run). */ + + #ifndef YYLLOC_DEFAULT + # define YYLLOC_DEFAULT(Current, Rhs, N) \ + ((Current).first_line = (Rhs)[1].first_line, \ + (Current).first_column = (Rhs)[1].first_column, \ + (Current).last_line = (Rhs)[N].last_line, \ + (Current).last_column = (Rhs)[N].last_column) + #endif + + /* YYLEX -- calling `yylex' with the right arguments. */ + + #ifdef YYLEX_PARAM + # define YYLEX yylex (YYLEX_PARAM) + #else + # define YYLEX yylex () + #endif + + /* Enable debugging if requested. */ + #if YYDEBUG + + # ifndef YYFPRINTF + # include /* INFRINGES ON USER NAME SPACE */ + # define YYFPRINTF fprintf + # endif + + # define YYDPRINTF(Args) \ + do { \ + if (yydebug) \ + YYFPRINTF Args; \ + } while (0) + + # define YYDSYMPRINT(Args) \ + do { \ + if (yydebug) \ + yysymprint Args; \ + } while (0) + + # define YYDSYMPRINTF(Title, Token, Value, Location) \ + do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Token, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ + } while (0) + + /*------------------------------------------------------------------. + | yy_stack_print -- Print the state stack from its BOTTOM up to its | + | TOP (included). | + `------------------------------------------------------------------*/ + + #if defined (__STDC__) || defined (__cplusplus) + static void + yy_stack_print (short int *bottom, short int *top) + #else + static void + yy_stack_print (bottom, top) + short int *bottom; + short int *top; + #endif + { + YYFPRINTF (stderr, "Stack now"); + for (/* Nothing. */; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); + } + + # define YY_STACK_PRINT(Bottom, Top) \ + do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ + } while (0) + + + /*------------------------------------------------. + | Report that the YYRULE is going to be reduced. | + `------------------------------------------------*/ + + #if defined (__STDC__) || defined (__cplusplus) + static void + yy_reduce_print (int yyrule) + #else + static void + yy_reduce_print (yyrule) + int yyrule; + #endif + { + int yyi; + unsigned int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", + yyrule - 1, yylno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + } + + # define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug) \ + yy_reduce_print (Rule); \ + } while (0) + + /* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ + int yydebug; + #else /* !YYDEBUG */ + # define YYDPRINTF(Args) + # define YYDSYMPRINT(Args) + # define YYDSYMPRINTF(Title, Token, Value, Location) + # define YY_STACK_PRINT(Bottom, Top) + # define YY_REDUCE_PRINT(Rule) + #endif /* !YYDEBUG */ + + + /* YYINITDEPTH -- initial size of the parser's stacks. */ + #ifndef YYINITDEPTH + # define YYINITDEPTH 200 + #endif + + /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + + #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 + # undef YYMAXDEPTH + #endif + + #ifndef YYMAXDEPTH + # define YYMAXDEPTH 10000 + #endif + + + + #if YYERROR_VERBOSE + + # ifndef yystrlen + # if defined (__GLIBC__) && defined (_STRING_H) + # define yystrlen strlen + # else + /* Return the length of YYSTR. */ + static YYSIZE_T + # if defined (__STDC__) || defined (__cplusplus) + yystrlen (const char *yystr) + # else + yystrlen (yystr) + const char *yystr; + # endif + { + register const char *yys = yystr; + + while (*yys++ != '\0') + continue; + + return yys - yystr - 1; + } + # endif + # endif + + # ifndef yystpcpy + # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) + # define yystpcpy stpcpy + # else + /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ + static char * + # if defined (__STDC__) || defined (__cplusplus) + yystpcpy (char *yydest, const char *yysrc) + # else + yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; + # endif + { + register char *yyd = yydest; + register const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; + } + # endif + # endif + + #endif /* !YYERROR_VERBOSE */ + + + + #if YYDEBUG + /*--------------------------------. + | Print this symbol on YYOUTPUT. | + `--------------------------------*/ + + #if defined (__STDC__) || defined (__cplusplus) + static void + yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) + #else + static void + yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE *yyvaluep; + #endif + { + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (yytype < YYNTOKENS) + { + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + # ifdef YYPRINT + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); + # endif + } + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + switch (yytype) + { + default: + break; + } + YYFPRINTF (yyoutput, ")"); + } + + #endif /* ! YYDEBUG */ + /*-----------------------------------------------. + | Release the memory associated to this symbol. | + `-----------------------------------------------*/ + + #if defined (__STDC__) || defined (__cplusplus) + static void + yydestruct (int yytype, YYSTYPE *yyvaluep) + #else + static void + yydestruct (yytype, yyvaluep) + int yytype; + YYSTYPE *yyvaluep; + #endif + { + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + switch (yytype) + { + + default: + break; + } + } + + + /* Prevent warnings from -Wmissing-prototypes. */ + + #ifdef YYPARSE_PARAM + # if defined (__STDC__) || defined (__cplusplus) + int yyparse (void *YYPARSE_PARAM); + # else + int yyparse (); + # endif + #else /* ! YYPARSE_PARAM */ + #if defined (__STDC__) || defined (__cplusplus) + int yyparse (void); + #else + int yyparse (); + #endif + #endif /* ! YYPARSE_PARAM */ + + + + /* The lookahead symbol. */ + int yychar; + + /* The semantic value of the lookahead symbol. */ + YYSTYPE yylval; + + /* Number of syntax errors so far. */ + int yynerrs; + + + + /*----------. + | yyparse. | + `----------*/ + + #ifdef YYPARSE_PARAM + # if defined (__STDC__) || defined (__cplusplus) + int yyparse (void *YYPARSE_PARAM) + # else + int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; + # endif + #else /* ! YYPARSE_PARAM */ + #if defined (__STDC__) || defined (__cplusplus) + int + yyparse (void) + #else + int + yyparse () + + #endif + #endif + { + + register int yystate; + register int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + register short int *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + register YYSTYPE *yyvsp; + + + + #define YYPOPSTACK (yyvsp--, yyssp--) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + + goto yysetstate; + + /*------------------------------------------------------------. + | yynewstate -- Push a new state, which is found in yystate. | + `------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. + */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + + #ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + short int *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow ("parser stack overflow", + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } + #else /* no yyoverflow */ + # ifndef YYSTACK_RELOCATE + goto yyoverflowlab; + # else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyoverflowlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + short int *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyoverflowlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + + # undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } + # endif + #endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + + /*-----------. + | yybackup. | + `-----------*/ + yybackup: + + /* Do appropriate processing given the current state. */ + /* Read a lookahead token if we need one and don't already have one. */ + /* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; + + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + yystate = yyn; + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- Do a reduction. | + `-----------------------------*/ + yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 8: + #line 187 "lev_comp.y" + { + unsigned i; + + if (fatal_error > 0) { + (void) fprintf(stderr, + "%s : %d errors detected. No output created!\n", + fname, fatal_error); + } else { + maze.flags = yyvsp[-3].i; + (void) memcpy((genericptr_t)&(maze.init_lev), + (genericptr_t)&(init_lev), + sizeof(lev_init)); + maze.numpart = npart; + maze.parts = NewTab(mazepart, npart); + for(i=0;i 0) { + (void) fprintf(stderr, + "%s : %d errors detected. No output created!\n", + fname, fatal_error); + } else { + special_lev.flags = (long) yyvsp[-5].i; + (void) memcpy( + (genericptr_t)&(special_lev.init_lev), + (genericptr_t)&(init_lev), + sizeof(lev_init)); + special_lev.nroom = nrooms; + special_lev.rooms = NewTab(room, nrooms); + for(i=0; i 8) + yyerror("Level names limited to 8 characters."); + yyval.map = yyvsp[0].map; + special_lev.nrmonst = special_lev.nrobjects = 0; + n_mlist = n_olist = 0; + } + break; + + case 11: + #line 263 "lev_comp.y" + { + /* in case we're processing multiple files, + explicitly clear any stale settings */ + (void) memset((genericptr_t) &init_lev, 0, + sizeof init_lev); + init_lev.init_present = FALSE; + yyval.i = 0; + } + break; + + case 12: + #line 272 "lev_comp.y" + { + init_lev.init_present = TRUE; + init_lev.fg = what_map_char((char) yyvsp[-10].i); + if (init_lev.fg == INVALID_TYPE) + yyerror("Invalid foreground type."); + init_lev.bg = what_map_char((char) yyvsp[-8].i); + if (init_lev.bg == INVALID_TYPE) + yyerror("Invalid background type."); + init_lev.smoothed = yyvsp[-6].i; + init_lev.joined = yyvsp[-4].i; + if (init_lev.joined && + init_lev.fg != CORR && init_lev.fg != ROOM) + yyerror("Invalid foreground type for joined map."); + init_lev.lit = yyvsp[-2].i; + init_lev.walled = yyvsp[0].i; + yyval.i = 1; + } + break; + + case 15: + #line 296 "lev_comp.y" + { + yyval.i = 0; + } + break; + + case 16: + #line 300 "lev_comp.y" + { + yyval.i = lev_flags; + lev_flags = 0; /* clear for next user */ + } + break; + + case 17: + #line 307 "lev_comp.y" + { + lev_flags |= yyvsp[-2].i; + } + break; + + case 18: + #line 311 "lev_comp.y" + { + lev_flags |= yyvsp[0].i; + } + break; + + case 21: + #line 321 "lev_comp.y" + { + int i, j; + + i = (int) strlen(yyvsp[0].map) + 1; + j = (int) strlen(tmpmessage); + if (i + j > 255) { + yyerror("Message string too long (>256 characters)"); + } else { + if (j) tmpmessage[j++] = '\n'; + (void) strncpy(tmpmessage+j, yyvsp[0].map, i - 1); + tmpmessage[j + i - 1] = 0; + } + Free(yyvsp[0].map); + } + break; + + case 24: + #line 342 "lev_comp.y" + { + if(special_lev.nrobjects) { + yyerror("Object registers already initialized!"); + } else { + special_lev.nrobjects = n_olist; + special_lev.robjects = (char *) alloc(n_olist); + (void) memcpy((genericptr_t)special_lev.robjects, + (genericptr_t)olist, n_olist); + } + } + break; + + case 25: + #line 353 "lev_comp.y" + { + if(special_lev.nrmonst) { + yyerror("Monster registers already initialized!"); + } else { + special_lev.nrmonst = n_mlist; + special_lev.rmonst = (char *) alloc(n_mlist); + (void) memcpy((genericptr_t)special_lev.rmonst, + (genericptr_t)mlist, n_mlist); + } + } + break; + + case 26: + #line 366 "lev_comp.y" + { + tmproom[nrooms] = New(room); + tmproom[nrooms]->name = (char *) 0; + tmproom[nrooms]->parent = (char *) 0; + tmproom[nrooms]->rtype = 0; + tmproom[nrooms]->rlit = 0; + tmproom[nrooms]->xalign = ERR; + tmproom[nrooms]->yalign = ERR; + tmproom[nrooms]->x = 0; + tmproom[nrooms]->y = 0; + tmproom[nrooms]->w = 2; + tmproom[nrooms]->h = 2; + in_room = 1; + } + break; + + case 32: + #line 392 "lev_comp.y" + { + tmpcor[0] = New(corridor); + tmpcor[0]->src.room = -1; + ncorridor = 1; + } + break; + + case 35: + #line 404 "lev_comp.y" + { + tmpcor[ncorridor] = New(corridor); + tmpcor[ncorridor]->src.room = yyvsp[-2].corpos.room; + tmpcor[ncorridor]->src.wall = yyvsp[-2].corpos.wall; + tmpcor[ncorridor]->src.door = yyvsp[-2].corpos.door; + tmpcor[ncorridor]->dest.room = yyvsp[0].corpos.room; + tmpcor[ncorridor]->dest.wall = yyvsp[0].corpos.wall; + tmpcor[ncorridor]->dest.door = yyvsp[0].corpos.door; + ncorridor++; + if (ncorridor >= MAX_OF_TYPE) { + yyerror("Too many corridors in level!"); + ncorridor--; + } + } + break; + + case 36: + #line 419 "lev_comp.y" + { + tmpcor[ncorridor] = New(corridor); + tmpcor[ncorridor]->src.room = yyvsp[-2].corpos.room; + tmpcor[ncorridor]->src.wall = yyvsp[-2].corpos.wall; + tmpcor[ncorridor]->src.door = yyvsp[-2].corpos.door; + tmpcor[ncorridor]->dest.room = -1; + tmpcor[ncorridor]->dest.wall = yyvsp[0].i; + ncorridor++; + if (ncorridor >= MAX_OF_TYPE) { + yyerror("Too many corridors in level!"); + ncorridor--; + } + } + break; + + case 37: + #line 435 "lev_comp.y" + { + if ((unsigned) yyvsp[-5].i >= nrooms) + yyerror("Wrong room number!"); + yyval.corpos.room = yyvsp[-5].i; + yyval.corpos.wall = yyvsp[-3].i; + yyval.corpos.door = yyvsp[-1].i; + } + break; + + case 38: + #line 445 "lev_comp.y" + { + store_room(); + } + break; + + case 39: + #line 449 "lev_comp.y" + { + store_room(); + } + break; + + case 40: + #line 455 "lev_comp.y" + { + tmproom[nrooms] = New(room); + tmproom[nrooms]->parent = yyvsp[-1].map; + tmproom[nrooms]->name = (char *) 0; + tmproom[nrooms]->rtype = yyvsp[-9].i; + tmproom[nrooms]->rlit = yyvsp[-7].i; + tmproom[nrooms]->filled = yyvsp[0].i; + tmproom[nrooms]->xalign = ERR; + tmproom[nrooms]->yalign = ERR; + tmproom[nrooms]->x = current_coord.x; + tmproom[nrooms]->y = current_coord.y; + tmproom[nrooms]->w = current_size.width; + tmproom[nrooms]->h = current_size.height; + in_room = 1; + } + break; + + case 41: + #line 473 "lev_comp.y" + { + tmproom[nrooms] = New(room); + tmproom[nrooms]->name = (char *) 0; + tmproom[nrooms]->parent = (char *) 0; + tmproom[nrooms]->rtype = yyvsp[-9].i; + tmproom[nrooms]->rlit = yyvsp[-7].i; + tmproom[nrooms]->filled = yyvsp[0].i; + tmproom[nrooms]->xalign = current_align.x; + tmproom[nrooms]->yalign = current_align.y; + tmproom[nrooms]->x = current_coord.x; + tmproom[nrooms]->y = current_coord.y; + tmproom[nrooms]->w = current_size.width; + tmproom[nrooms]->h = current_size.height; + in_room = 1; + } + break; + + case 42: + #line 491 "lev_comp.y" + { + yyval.i = 1; + } + break; + + case 43: + #line 495 "lev_comp.y" + { + yyval.i = yyvsp[0].i; + } + break; + + case 44: + #line 501 "lev_comp.y" + { + if ( yyvsp[-3].i < 1 || yyvsp[-3].i > 5 || + yyvsp[-1].i < 1 || yyvsp[-1].i > 5 ) { + yyerror("Room position should be between 1 & 5!"); + } else { + current_coord.x = yyvsp[-3].i; + current_coord.y = yyvsp[-1].i; + } + } + break; + + case 45: + #line 511 "lev_comp.y" + { + current_coord.x = current_coord.y = ERR; + } + break; + + case 46: + #line 517 "lev_comp.y" + { + if ( yyvsp[-3].i < 0 || yyvsp[-1].i < 0) { + yyerror("Invalid subroom position !"); + } else { + current_coord.x = yyvsp[-3].i; + current_coord.y = yyvsp[-1].i; + } + } + break; + + case 47: + #line 526 "lev_comp.y" + { + current_coord.x = current_coord.y = ERR; + } + break; + + case 48: + #line 532 "lev_comp.y" + { + current_align.x = yyvsp[-3].i; + current_align.y = yyvsp[-1].i; + } + break; + + case 49: + #line 537 "lev_comp.y" + { + current_align.x = current_align.y = ERR; + } + break; + + case 50: + #line 543 "lev_comp.y" + { + current_size.width = yyvsp[-3].i; + current_size.height = yyvsp[-1].i; + } + break; + + case 51: + #line 548 "lev_comp.y" + { + current_size.height = current_size.width = ERR; + } + break; + + case 68: + #line 574 "lev_comp.y" + { + if (tmproom[nrooms]->name) + yyerror("This room already has a name!"); + else + tmproom[nrooms]->name = yyvsp[0].map; + } + break; + + case 69: + #line 583 "lev_comp.y" + { + if (tmproom[nrooms]->chance) + yyerror("This room already assigned a chance!"); + else if (tmproom[nrooms]->rtype == OROOM) + yyerror("Only typed rooms can have a chance!"); + else if (yyvsp[0].i < 1 || yyvsp[0].i > 99) + yyerror("The chance is supposed to be percentile."); + else + tmproom[nrooms]->chance = yyvsp[0].i; + } + break; + + case 70: + #line 596 "lev_comp.y" + { + /* ERR means random here */ + if (yyvsp[-2].i == ERR && yyvsp[0].i != ERR) { + yyerror("If the door wall is random, so must be its pos!"); + tmprdoor[ndoor] = (struct room_door *)0; + } else { + tmprdoor[ndoor] = New(room_door); + tmprdoor[ndoor]->secret = yyvsp[-6].i; + tmprdoor[ndoor]->mask = yyvsp[-4].i; + tmprdoor[ndoor]->wall = yyvsp[-2].i; + tmprdoor[ndoor]->pos = yyvsp[0].i; + tmprdoor[ndoor]->arti_key = 0; + } + } + break; + + case 71: + #line 611 "lev_comp.y" + { + if (tmprdoor[ndoor]) { + ndoor++; + if (ndoor >= MAX_OF_TYPE) { + yyerror("Too many doors in room!"); + ndoor--; + } + } + } + break; + + case 74: + #line 627 "lev_comp.y" + { + int token = get_artifact_id(yyvsp[0].map); + if (token == ERR) { + char ebuf[100]; + Sprintf(ebuf, "Undefined artifact key \"%s\"", yyvsp[0].map); + yyerror(ebuf); + } + else if (tmprdoor[ndoor]) + tmprdoor[ndoor]->arti_key = token; + } + break; + + case 81: + #line 653 "lev_comp.y" + { + maze.filling = (schar) yyvsp[0].i; + if (index(yyvsp[-2].map, '.')) + yyerror("Invalid dot ('.') in level name."); + if ((int) strlen(yyvsp[-2].map) > 8) + yyerror("Level names limited to 8 characters."); + yyval.map = yyvsp[-2].map; + in_room = 0; + n_plist = n_mlist = n_olist = 0; + } + break; + + case 82: + #line 666 "lev_comp.y" + { + yyval.i = get_floor_type((char)yyvsp[0].i); + } + break; + + case 83: + #line 670 "lev_comp.y" + { + yyval.i = -1; + } + break; + + case 86: + #line 680 "lev_comp.y" + { + store_part(); + } + break; + + case 87: + #line 686 "lev_comp.y" + { + tmppart[npart] = New(mazepart); + tmppart[npart]->halign = 1; + tmppart[npart]->valign = 1; + tmppart[npart]->nrobjects = 0; + tmppart[npart]->nloc = 0; + tmppart[npart]->nrmonst = 0; + tmppart[npart]->xsize = 1; + tmppart[npart]->ysize = 1; + tmppart[npart]->map = (char **) alloc(sizeof(char *)); + tmppart[npart]->map[0] = (char *) alloc(1); + tmppart[npart]->map[0][0] = STONE; + max_x_map = COLNO-1; + max_y_map = ROWNO; + } + break; + + case 88: + #line 702 "lev_comp.y" + { + tmppart[npart] = New(mazepart); + tmppart[npart]->halign = yyvsp[-1].i % 10; + tmppart[npart]->valign = yyvsp[-1].i / 10; + tmppart[npart]->nrobjects = 0; + tmppart[npart]->nloc = 0; + tmppart[npart]->nrmonst = 0; + scan_map(yyvsp[0].map); + Free(yyvsp[0].map); + } + break; + + case 89: + #line 715 "lev_comp.y" + { + yyval.i = yyvsp[-2].i + (yyvsp[0].i * 10); + } + break; + + case 96: + #line 733 "lev_comp.y" + { + if (tmppart[npart]->nrobjects) { + yyerror("Object registers already initialized!"); + } else { + tmppart[npart]->robjects = (char *)alloc(n_olist); + (void) memcpy((genericptr_t)tmppart[npart]->robjects, + (genericptr_t)olist, n_olist); + tmppart[npart]->nrobjects = n_olist; + } + } + break; + + case 97: + #line 744 "lev_comp.y" + { + if (tmppart[npart]->nlocset) + yyerror("Location registers already initialized!"); + else + store_place_list(npart, 0, n_plist, plist); + n_plist = 0; + } + break; + + case 98: + #line 752 "lev_comp.y" + { + if (yyvsp[-3].i >= MAX_REGISTERS) + yyerror("Register Index overflow!"); + else + store_place_list(npart, yyvsp[-3].i, n_plist, plist); + n_plist = 0; + } + break; + + case 99: + #line 760 "lev_comp.y" + { + if (tmppart[npart]->nrmonst) { + yyerror("Monster registers already initialized!"); + } else { + tmppart[npart]->rmonst = (char *) alloc(n_mlist); + (void) memcpy((genericptr_t)tmppart[npart]->rmonst, + (genericptr_t)mlist, n_mlist); + tmppart[npart]->nrmonst = n_mlist; + } + } + break; + + case 100: + #line 771 "lev_comp.y" + { + /* nothing */ + } + break; + + case 101: + #line 777 "lev_comp.y" + { + if (n_olist < MAX_REGISTERS) + olist[n_olist++] = yyvsp[0].i; + else + yyerror("Object list too long!"); + } + break; + + case 102: + #line 784 "lev_comp.y" + { + if (n_olist < MAX_REGISTERS) + olist[n_olist++] = yyvsp[-2].i; + else + yyerror("Object list too long!"); + } + break; + + case 103: + #line 793 "lev_comp.y" + { + if (n_mlist < MAX_REGISTERS) + mlist[n_mlist++] = yyvsp[0].i; + else + yyerror("Monster list too long!"); + } + break; + + case 104: + #line 800 "lev_comp.y" + { + if (n_mlist < MAX_REGISTERS) + mlist[n_mlist++] = yyvsp[-2].i; + else + yyerror("Monster list too long!"); + } + break; + + case 105: + #line 809 "lev_comp.y" + { + if (n_plist < MAX_REGISTERS) + plist[n_plist++] = current_coord; + else + yyerror("Location list too long!"); + } + break; + + case 106: + #line 816 "lev_comp.y" + { + if (n_plist < MAX_REGISTERS) + plist[n_plist++] = current_coord; + else + yyerror("Location list too long!"); + } + break; + + case 131: + #line 853 "lev_comp.y" + { + tmpmonst[nmons] = New(monster); + tmpmonst[nmons]->x = current_coord.x; + tmpmonst[nmons]->y = current_coord.y; + tmpmonst[nmons]->class = yyvsp[-4].i; + tmpmonst[nmons]->peaceful = -1; /* no override */ + tmpmonst[nmons]->asleep = -1; + tmpmonst[nmons]->align = - MAX_REGISTERS - 2; + tmpmonst[nmons]->name.str = 0; + tmpmonst[nmons]->appear = 0; + tmpmonst[nmons]->appear_as.str = 0; + tmpmonst[nmons]->chance = yyvsp[-6].i; + tmpmonst[nmons]->id = NON_PM; + if (!in_room) + check_coord(current_coord.x, current_coord.y, + "Monster"); + if (yyvsp[-2].map) { + int token = get_monster_id(yyvsp[-2].map, (char) yyvsp[-4].i); + if (token == ERR) + yywarning( + "Invalid monster name! Making random monster."); + else + tmpmonst[nmons]->id = token; + Free(yyvsp[-2].map); + } + } + break; + + case 132: + #line 880 "lev_comp.y" + { + if (++nmons >= MAX_OF_TYPE) { + yyerror("Too many monsters in room or mazepart!"); + nmons--; + } + } + break; + + case 135: + #line 893 "lev_comp.y" + { + tmpmonst[nmons]->name.str = yyvsp[0].map; + } + break; + + case 136: + #line 897 "lev_comp.y" + { + tmpmonst[nmons]->peaceful = yyvsp[0].i; + } + break; + + case 137: + #line 901 "lev_comp.y" + { + tmpmonst[nmons]->asleep = yyvsp[0].i; + } + break; + + case 138: + #line 905 "lev_comp.y" + { + tmpmonst[nmons]->align = yyvsp[0].i; + } + break; + + case 139: + #line 909 "lev_comp.y" + { + tmpmonst[nmons]->appear = yyvsp[-1].i; + tmpmonst[nmons]->appear_as.str = yyvsp[0].map; + } + break; + + case 140: + #line 916 "lev_comp.y" + { + } + break; + + case 141: + #line 919 "lev_comp.y" + { + /* 1: is contents of preceeding object with 2 */ + /* 2: is a container */ + /* 0: neither */ + tmpobj[nobj-1]->containment = 2; + } + break; + + case 142: + #line 928 "lev_comp.y" + { + tmpobj[nobj] = New(object); + tmpobj[nobj]->class = yyvsp[-2].i; + tmpobj[nobj]->corpsenm = NON_PM; + tmpobj[nobj]->curse_state = -1; + tmpobj[nobj]->name.str = 0; + tmpobj[nobj]->chance = yyvsp[-4].i; + tmpobj[nobj]->id = -1; + tmpobj[nobj]->oflags = 0; + if (yyvsp[0].map) { + int token = get_object_id(yyvsp[0].map, yyvsp[-2].i); + if (token == ERR) + yywarning( + "Illegal object name! Making random object."); + else + tmpobj[nobj]->id = token; + Free(yyvsp[0].map); + } + } + break; + + case 143: + #line 948 "lev_comp.y" + { + if (++nobj >= MAX_OF_TYPE) { + yyerror("Too many objects in room or mazepart!"); + nobj--; + } + } + break; + + case 144: + #line 957 "lev_comp.y" + { + tmpobj[nobj]->containment = 0; + tmpobj[nobj]->x = current_coord.x; + tmpobj[nobj]->y = current_coord.y; + if (!in_room) + check_coord(current_coord.x, current_coord.y, + "Object"); + } + break; + + case 145: + #line 966 "lev_comp.y" + { + tmpobj[nobj]->containment = 1; + /* random coordinate, will be overridden anyway */ + tmpobj[nobj]->x = -MAX_REGISTERS-2; + tmpobj[nobj]->y = -MAX_REGISTERS-2; + } + break; + + case 146: + #line 975 "lev_comp.y" + { + tmpobj[nobj]->spe = -127; + /* Note below: we're trying to make as many of these optional as + * possible. We clearly can't make curse_state, enchantment, and + * monster_id _all_ optional, since ",random" would be ambiguous. + * We can't even just make enchantment mandatory, since if we do that + * alone, ",random" requires too much lookahead to parse. + */ + } + break; + + case 147: + #line 985 "lev_comp.y" + { + } + break; + + case 148: + #line 988 "lev_comp.y" + { + } + break; + + case 149: + #line 991 "lev_comp.y" + { + } + break; + + case 150: + #line 996 "lev_comp.y" + { + if (nobj > 0) + tmpobj[nobj-1]->oflags = yyvsp[0].i; + else yyerror("Need an object before object flags!"); + } + break; + + case 151: + #line 1004 "lev_comp.y" + { + yyval.i = (yyvsp[-2].i | yyvsp[0].i); + } + break; + + case 152: + #line 1008 "lev_comp.y" + { + yyval.i = yyvsp[0].i; + } + break; + + case 153: + #line 1014 "lev_comp.y" + { + tmpobj[nobj]->curse_state = -1; + } + break; + + case 154: + #line 1018 "lev_comp.y" + { + tmpobj[nobj]->curse_state = yyvsp[0].i; + } + break; + + case 155: + #line 1024 "lev_comp.y" + { + int token = get_monster_id(yyvsp[0].map, (char)0); + if (token == ERR) /* "random" */ + tmpobj[nobj]->corpsenm = NON_PM - 1; + else + tmpobj[nobj]->corpsenm = token; + Free(yyvsp[0].map); + } + break; + + case 156: + #line 1035 "lev_comp.y" + { + tmpobj[nobj]->spe = -127; + } + break; + + case 157: + #line 1039 "lev_comp.y" + { + tmpobj[nobj]->spe = yyvsp[0].i; + } + break; + + case 159: + #line 1046 "lev_comp.y" + { + } + break; + + case 160: + #line 1049 "lev_comp.y" + { + tmpobj[nobj]->name.str = yyvsp[0].map; + } + break; + + case 161: + #line 1055 "lev_comp.y" + { + tmpdoor[ndoor] = New(door); + tmpdoor[ndoor]->x = current_coord.x; + tmpdoor[ndoor]->y = current_coord.y; + tmpdoor[ndoor]->mask = yyvsp[-2].i; + tmpdoor[ndoor]->arti_key = 0; + if(current_coord.x >= 0 && current_coord.y >= 0 && + tmpmap[current_coord.y][current_coord.x] != DOOR && + tmpmap[current_coord.y][current_coord.x] != SDOOR) + yyerror("Door decl doesn't match the map"); + } + break; + + case 162: + #line 1067 "lev_comp.y" + { + if (++ndoor >= MAX_OF_TYPE) { + yyerror("Too many doors in mazepart!"); + ndoor--; + } + } + break; + + case 165: + #line 1080 "lev_comp.y" + { + int token = get_artifact_id(yyvsp[0].map); + if (token == ERR) { + char ebuf[100]; + Sprintf(ebuf, "Undefined artifact key \"%s\"", yyvsp[0].map); + yyerror(ebuf); + } + else + tmpdoor[ndoor]->arti_key = token; + } + break; + + case 166: + #line 1093 "lev_comp.y" + { + tmptrap[ntrap] = New(trap); + tmptrap[ntrap]->x = current_coord.x; + tmptrap[ntrap]->y = current_coord.y; + tmptrap[ntrap]->type = yyvsp[-2].i; + tmptrap[ntrap]->chance = yyvsp[-4].i; + if (!in_room) + check_coord(current_coord.x, current_coord.y, + "Trap"); + if (++ntrap >= MAX_OF_TYPE) { + yyerror("Too many traps in room or mazepart!"); + ntrap--; + } + } + break; + + case 167: + #line 1110 "lev_comp.y" + { + int x, y, dir; + + tmpdb[ndb] = New(drawbridge); + x = tmpdb[ndb]->x = current_coord.x; + y = tmpdb[ndb]->y = current_coord.y; + /* convert dir from a DIRECTION to a DB_DIR */ + dir = yyvsp[-2].i; + switch(dir) { + case W_NORTH: dir = DB_NORTH; y--; break; + case W_SOUTH: dir = DB_SOUTH; y++; break; + case W_EAST: dir = DB_EAST; x++; break; + case W_WEST: dir = DB_WEST; x--; break; + default: + yyerror("Invalid drawbridge direction"); + break; + } + tmpdb[ndb]->dir = dir; + if (current_coord.x >= 0 && current_coord.y >= 0 && + !IS_WALL(tmpmap[y][x])) { + char ebuf[60]; + Sprintf(ebuf, + "Wall needed for drawbridge (%02d, %02d)", + current_coord.x, current_coord.y); + yyerror(ebuf); + } + + if ( yyvsp[0].i == D_ISOPEN ) + tmpdb[ndb]->db_open = 1; + else if ( yyvsp[0].i == D_CLOSED ) + tmpdb[ndb]->db_open = 0; + else + yyerror("A drawbridge can only be open or closed!"); + ndb++; + if (ndb >= MAX_OF_TYPE) { + yyerror("Too many drawbridges in mazepart!"); + ndb--; + } + } + break; + + case 168: + #line 1152 "lev_comp.y" + { + tmpwalk[nwalk] = New(walk); + tmpwalk[nwalk]->x = current_coord.x; + tmpwalk[nwalk]->y = current_coord.y; + tmpwalk[nwalk]->dir = yyvsp[0].i; + nwalk++; + if (nwalk >= MAX_OF_TYPE) { + yyerror("Too many mazewalks in mazepart!"); + nwalk--; + } + } + break; + + case 169: + #line 1166 "lev_comp.y" + { + wallify_map(); + } + break; + + case 170: + #line 1172 "lev_comp.y" + { + tmplad[nlad] = New(lad); + tmplad[nlad]->x = current_coord.x; + tmplad[nlad]->y = current_coord.y; + tmplad[nlad]->up = yyvsp[0].i; + if (!in_room) + check_coord(current_coord.x, current_coord.y, + "Ladder"); + nlad++; + if (nlad >= MAX_OF_TYPE) { + yyerror("Too many ladders in mazepart!"); + nlad--; + } + } + break; + + case 171: + #line 1189 "lev_comp.y" + { + tmpstair[nstair] = New(stair); + tmpstair[nstair]->x = current_coord.x; + tmpstair[nstair]->y = current_coord.y; + tmpstair[nstair]->up = yyvsp[0].i; + if (!in_room) + check_coord(current_coord.x, current_coord.y, + "Stairway"); + nstair++; + if (nstair >= MAX_OF_TYPE) { + yyerror("Too many stairs in room or mazepart!"); + nstair--; + } + } + break; + + case 172: + #line 1206 "lev_comp.y" + { + tmplreg[nlreg] = New(lev_region); + tmplreg[nlreg]->in_islev = yyvsp[0].i; + tmplreg[nlreg]->inarea.x1 = current_region.x1; + tmplreg[nlreg]->inarea.y1 = current_region.y1; + tmplreg[nlreg]->inarea.x2 = current_region.x2; + tmplreg[nlreg]->inarea.y2 = current_region.y2; + } + break; + + case 173: + #line 1215 "lev_comp.y" + { + tmplreg[nlreg]->del_islev = yyvsp[-2].i; + tmplreg[nlreg]->delarea.x1 = current_region.x1; + tmplreg[nlreg]->delarea.y1 = current_region.y1; + tmplreg[nlreg]->delarea.x2 = current_region.x2; + tmplreg[nlreg]->delarea.y2 = current_region.y2; + if(yyvsp[0].i) + tmplreg[nlreg]->rtype = LR_UPSTAIR; + else + tmplreg[nlreg]->rtype = LR_DOWNSTAIR; + tmplreg[nlreg]->rname.str = 0; + nlreg++; + if (nlreg >= MAX_OF_TYPE) { + yyerror("Too many levregions in mazepart!"); + nlreg--; + } + } + break; + + case 174: + #line 1235 "lev_comp.y" + { + if ((unsigned) yyvsp[-3].i != nrndlreg) + yyerror("Wrong random region number!"); + tmprndlreg[nrndlreg] = New(lev_region); + tmprndlreg[nrndlreg]->in_islev = yyvsp[0].i; + tmprndlreg[nrndlreg]->inarea.x1 = current_region.x1; + tmprndlreg[nrndlreg]->inarea.y1 = current_region.y1; + tmprndlreg[nrndlreg]->inarea.x2 = current_region.x2; + tmprndlreg[nrndlreg]->inarea.y2 = current_region.y2; + } + break; + + case 175: + #line 1246 "lev_comp.y" + { + tmprndlreg[nrndlreg]->del_islev = yyvsp[0].i; + tmprndlreg[nrndlreg]->delarea.x1 = current_region.x1; + tmprndlreg[nrndlreg]->delarea.y1 = current_region.y1; + tmprndlreg[nrndlreg]->delarea.x2 = current_region.x2; + tmprndlreg[nrndlreg]->delarea.y2 = current_region.y2; + tmprndlreg[nrndlreg]->rtype = 0; + tmprndlreg[nrndlreg]->rname.str = (char *)0; + nrndlreg++; + if (nrndlreg >= MAX_REGISTERS) { + yyerror("Too many random regions!"); + nrndlreg--; + } + } + break; + + case 176: + #line 1263 "lev_comp.y" + { + tmplreg[nlreg] = New(lev_region); + tmplreg[nlreg]->in_islev = yyvsp[0].i; + tmplreg[nlreg]->inarea.x1 = current_region.x1; + tmplreg[nlreg]->inarea.y1 = current_region.y1; + tmplreg[nlreg]->inarea.x2 = current_region.x2; + tmplreg[nlreg]->inarea.y2 = current_region.y2; + } + break; + + case 177: + #line 1272 "lev_comp.y" + { + tmplreg[nlreg]->del_islev = yyvsp[-2].i; + tmplreg[nlreg]->delarea.x1 = current_region.x1; + tmplreg[nlreg]->delarea.y1 = current_region.y1; + tmplreg[nlreg]->delarea.x2 = current_region.x2; + tmplreg[nlreg]->delarea.y2 = current_region.y2; + tmplreg[nlreg]->rtype = LR_PORTAL; + tmplreg[nlreg]->rname.str = yyvsp[0].map; + nlreg++; + if (nlreg >= MAX_OF_TYPE) { + yyerror("Too many levregions in mazepart!"); + nlreg--; + } + } + break; + + case 178: + #line 1289 "lev_comp.y" + { + tmplreg[nlreg] = New(lev_region); + tmplreg[nlreg]->in_islev = yyvsp[0].i; + tmplreg[nlreg]->inarea.x1 = current_region.x1; + tmplreg[nlreg]->inarea.y1 = current_region.y1; + tmplreg[nlreg]->inarea.x2 = current_region.x2; + tmplreg[nlreg]->inarea.y2 = current_region.y2; + } + break; + + case 179: + #line 1298 "lev_comp.y" + { + tmplreg[nlreg]->del_islev = yyvsp[0].i; + tmplreg[nlreg]->delarea.x1 = current_region.x1; + tmplreg[nlreg]->delarea.y1 = current_region.y1; + tmplreg[nlreg]->delarea.x2 = current_region.x2; + tmplreg[nlreg]->delarea.y2 = current_region.y2; + } + break; + + case 180: + #line 1306 "lev_comp.y" + { + switch(yyvsp[0].i) { + case -1: tmplreg[nlreg]->rtype = LR_TELE; break; + case 0: tmplreg[nlreg]->rtype = LR_DOWNTELE; break; + case 1: tmplreg[nlreg]->rtype = LR_UPTELE; break; + } + tmplreg[nlreg]->rname.str = 0; + nlreg++; + if (nlreg >= MAX_OF_TYPE) { + yyerror("Too many levregions in mazepart!"); + nlreg--; + } + } + break; + + case 181: + #line 1322 "lev_comp.y" + { + tmplreg[nlreg] = New(lev_region); + tmplreg[nlreg]->in_islev = yyvsp[0].i; + tmplreg[nlreg]->inarea.x1 = current_region.x1; + tmplreg[nlreg]->inarea.y1 = current_region.y1; + tmplreg[nlreg]->inarea.x2 = current_region.x2; + tmplreg[nlreg]->inarea.y2 = current_region.y2; + } + break; + + case 182: + #line 1331 "lev_comp.y" + { + tmplreg[nlreg]->del_islev = yyvsp[0].i; + tmplreg[nlreg]->delarea.x1 = current_region.x1; + tmplreg[nlreg]->delarea.y1 = current_region.y1; + tmplreg[nlreg]->delarea.x2 = current_region.x2; + tmplreg[nlreg]->delarea.y2 = current_region.y2; + tmplreg[nlreg]->rtype = LR_BRANCH; + tmplreg[nlreg]->rname.str = 0; + nlreg++; + if (nlreg >= MAX_OF_TYPE) { + yyerror("Too many levregions in mazepart!"); + nlreg--; + } + } + break; + + case 183: + #line 1348 "lev_comp.y" + { + yyval.i = -1; + } + break; + + case 184: + #line 1352 "lev_comp.y" + { + yyval.i = yyvsp[0].i; + } + break; + + case 185: + #line 1358 "lev_comp.y" + { + yyval.i = 0; + } + break; + + case 186: + #line 1362 "lev_comp.y" + { + /* This series of if statements is a hack for MSC 5.1. It seems that its + tiny little brain cannot compile if these are all one big if statement. */ + if (yyvsp[-7].i <= 0 || yyvsp[-7].i >= COLNO) + yyerror("Region out of level range!"); + else if (yyvsp[-5].i < 0 || yyvsp[-5].i >= ROWNO) + yyerror("Region out of level range!"); + else if (yyvsp[-3].i <= 0 || yyvsp[-3].i >= COLNO) + yyerror("Region out of level range!"); + else if (yyvsp[-1].i < 0 || yyvsp[-1].i >= ROWNO) + yyerror("Region out of level range!"); + current_region.x1 = yyvsp[-7].i; + current_region.y1 = yyvsp[-5].i; + current_region.x2 = yyvsp[-3].i; + current_region.y2 = yyvsp[-1].i; + yyval.i = 1; + } + break; + + case 187: + #line 1382 "lev_comp.y" + { + tmpfountain[nfountain] = New(fountain); + tmpfountain[nfountain]->x = current_coord.x; + tmpfountain[nfountain]->y = current_coord.y; + if (!in_room) + check_coord(current_coord.x, current_coord.y, + "Fountain"); + nfountain++; + if (nfountain >= MAX_OF_TYPE) { + yyerror("Too many fountains in room or mazepart!"); + nfountain--; + } + } + break; + + case 188: + #line 1398 "lev_comp.y" + { + tmpsink[nsink] = New(sink); + tmpsink[nsink]->x = current_coord.x; + tmpsink[nsink]->y = current_coord.y; + nsink++; + if (nsink >= MAX_OF_TYPE) { + yyerror("Too many sinks in room!"); + nsink--; + } + } + break; + + case 189: + #line 1411 "lev_comp.y" + { + tmppool[npool] = New(pool); + tmppool[npool]->x = current_coord.x; + tmppool[npool]->y = current_coord.y; + npool++; + if (npool >= MAX_OF_TYPE) { + yyerror("Too many pools in room!"); + npool--; + } + } + break; + + case 190: + #line 1424 "lev_comp.y" + { + tmpdig[ndig] = New(digpos); + tmpdig[ndig]->x1 = current_region.x1; + tmpdig[ndig]->y1 = current_region.y1; + tmpdig[ndig]->x2 = current_region.x2; + tmpdig[ndig]->y2 = current_region.y2; + ndig++; + if (ndig >= MAX_OF_TYPE) { + yyerror("Too many diggables in mazepart!"); + ndig--; + } + } + break; + + case 191: + #line 1439 "lev_comp.y" + { + tmppass[npass] = New(digpos); + tmppass[npass]->x1 = current_region.x1; + tmppass[npass]->y1 = current_region.y1; + tmppass[npass]->x2 = current_region.x2; + tmppass[npass]->y2 = current_region.y2; + npass++; + if (npass >= 32) { + yyerror("Too many passwalls in mazepart!"); + npass--; + } + } + break; + + case 192: + #line 1454 "lev_comp.y" + { + tmpreg[nreg] = New(region); + tmpreg[nreg]->x1 = current_region.x1; + tmpreg[nreg]->y1 = current_region.y1; + tmpreg[nreg]->x2 = current_region.x2; + tmpreg[nreg]->y2 = current_region.y2; + tmpreg[nreg]->rlit = yyvsp[-3].i; + tmpreg[nreg]->rtype = yyvsp[-1].i; + if(yyvsp[0].i & 1) tmpreg[nreg]->rtype += MAXRTYPE+1; + tmpreg[nreg]->rirreg = ((yyvsp[0].i & 2) != 0); + if(current_region.x1 > current_region.x2 || + current_region.y1 > current_region.y2) + yyerror("Region start > end!"); + if(tmpreg[nreg]->rtype == VAULT && + (tmpreg[nreg]->rirreg || + (tmpreg[nreg]->x2 - tmpreg[nreg]->x1 != 1) || + (tmpreg[nreg]->y2 - tmpreg[nreg]->y1 != 1))) + yyerror("Vaults must be exactly 2x2!"); + if(want_warnings && !tmpreg[nreg]->rirreg && + current_region.x1 > 0 && current_region.y1 > 0 && + current_region.x2 < (int)max_x_map && + current_region.y2 < (int)max_y_map) { + /* check for walls in the room */ + char ebuf[60]; + register int x, y, nrock = 0; + + for(y=current_region.y1; y<=current_region.y2; y++) + for(x=current_region.x1; + x<=current_region.x2; x++) + if(IS_ROCK(tmpmap[y][x]) || + IS_DOOR(tmpmap[y][x])) nrock++; + if(nrock) { + Sprintf(ebuf, + "Rock in room (%02d,%02d,%02d,%02d)?!", + current_region.x1, current_region.y1, + current_region.x2, current_region.y2); + yywarning(ebuf); + } + if ( + !IS_ROCK(tmpmap[current_region.y1-1][current_region.x1-1]) || + !IS_ROCK(tmpmap[current_region.y2+1][current_region.x1-1]) || + !IS_ROCK(tmpmap[current_region.y1-1][current_region.x2+1]) || + !IS_ROCK(tmpmap[current_region.y2+1][current_region.x2+1])) { + Sprintf(ebuf, + "NonRock edge in room (%02d,%02d,%02d,%02d)?!", + current_region.x1, current_region.y1, + current_region.x2, current_region.y2); + yywarning(ebuf); + } + } else if(tmpreg[nreg]->rirreg && + !IS_ROOM(tmpmap[current_region.y1][current_region.x1])) { + char ebuf[60]; + Sprintf(ebuf, + "Rock in irregular room (%02d,%02d)?!", + current_region.x1, current_region.y1); + yyerror(ebuf); + } + nreg++; + if (nreg >= MAX_OF_TYPE) { + yyerror("Too many regions in mazepart!"); + nreg--; + } + } + break; + + case 193: + #line 1520 "lev_comp.y" + { + tmpaltar[naltar] = New(altar); + tmpaltar[naltar]->x = current_coord.x; + tmpaltar[naltar]->y = current_coord.y; + tmpaltar[naltar]->align = yyvsp[-2].i; + tmpaltar[naltar]->shrine = yyvsp[0].i; + if (!in_room) + check_coord(current_coord.x, current_coord.y, + "Altar"); + naltar++; + if (naltar >= MAX_OF_TYPE) { + yyerror("Too many altars in room or mazepart!"); + naltar--; + } + } + break; + + case 194: + #line 1538 "lev_comp.y" + { + tmpgold[ngold] = New(gold); + tmpgold[ngold]->x = current_coord.x; + tmpgold[ngold]->y = current_coord.y; + tmpgold[ngold]->amount = yyvsp[-2].i; + if (!in_room) + check_coord(current_coord.x, current_coord.y, + "Gold"); + ngold++; + if (ngold >= MAX_OF_TYPE) { + yyerror("Too many golds in room or mazepart!"); + ngold--; + } + } + break; + + case 195: + #line 1555 "lev_comp.y" + { + tmpengraving[nengraving] = New(engraving); + tmpengraving[nengraving]->x = current_coord.x; + tmpengraving[nengraving]->y = current_coord.y; + tmpengraving[nengraving]->engr.str = yyvsp[0].map; + tmpengraving[nengraving]->etype = yyvsp[-2].i; + if (!in_room) + check_coord(current_coord.x, current_coord.y, + "Engraving"); + nengraving++; + if (nengraving >= MAX_OF_TYPE) { + yyerror("Too many engravings in room or mazepart!"); + nengraving--; + } + } + break; + + case 197: + #line 1574 "lev_comp.y" + { + yyval.i = - MAX_REGISTERS - 1; + } + break; + + case 200: + #line 1582 "lev_comp.y" + { + yyval.i = - MAX_REGISTERS - 1; + } + break; + + case 203: + #line 1590 "lev_comp.y" + { + yyval.map = (char *) 0; + } + break; + + case 205: + #line 1597 "lev_comp.y" + { + yyval.map = (char *) 0; + } + break; + + case 206: + #line 1603 "lev_comp.y" + { + int token = get_trap_type(yyvsp[0].map); + if (token == ERR) + yyerror("Unknown trap type!"); + yyval.i = token; + Free(yyvsp[0].map); + } + break; + + case 208: + #line 1614 "lev_comp.y" + { + int token = get_room_type(yyvsp[0].map); + if (token == ERR) { + yywarning("Unknown room type! Making ordinary room..."); + yyval.i = OROOM; + } else + yyval.i = token; + Free(yyvsp[0].map); + } + break; + + case 210: + #line 1627 "lev_comp.y" + { + yyval.i = 0; + } + break; + + case 211: + #line 1631 "lev_comp.y" + { + yyval.i = yyvsp[0].i; + } + break; + + case 212: + #line 1635 "lev_comp.y" + { + yyval.i = yyvsp[-2].i + (yyvsp[0].i << 1); + } + break; + + case 216: + #line 1644 "lev_comp.y" + { + current_coord.x = current_coord.y = -MAX_REGISTERS-2; + } + break; + + case 223: + #line 1660 "lev_comp.y" + { + yyval.i = - MAX_REGISTERS - 1; + } + break; + + case 226: + #line 1670 "lev_comp.y" + { + if ( yyvsp[-1].i >= MAX_REGISTERS ) + yyerror("Register Index overflow!"); + else { + current_coord.x = -1; + current_coord.y = - yyvsp[-1].i - 1; + } + } + break; + + case 227: + #line 1679 "lev_comp.y" + { + if ( yyvsp[-4].i >= MAX_REGISTERS || yyvsp[-1].i >= MAX_REGISTERS ) + yyerror("Register Index overflow!"); + else { + current_coord.x = - yyvsp[-4].i - 1; + current_coord.y = - yyvsp[-1].i - 1; + } + } + break; + + case 228: + #line 1690 "lev_comp.y" + { + if ( yyvsp[-1].i < 0 || yyvsp[-1].i >= nrndlreg ) + yyerror("Register Index overflow!"); + else { + current_coord.x = -MAX_REGISTERS-1; + current_coord.y = - yyvsp[-1].i - 1; + } + } + break; + + case 229: + #line 1701 "lev_comp.y" + { + if ( yyvsp[-1].i >= MAX_REGISTERS ) + yyerror("Register Index overflow!"); + else + yyval.i = - yyvsp[-1].i - 1; + } + break; + + case 230: + #line 1710 "lev_comp.y" + { + if ( yyvsp[-1].i >= MAX_REGISTERS ) + yyerror("Register Index overflow!"); + else + yyval.i = - yyvsp[-1].i - 1; + } + break; + + case 231: + #line 1719 "lev_comp.y" + { + if ( yyvsp[-1].i >= 3 ) + yyerror("Register Index overflow!"); + else + yyval.i = - yyvsp[-1].i - 1; + } + break; + + case 233: + #line 1729 "lev_comp.y" + { + current_coord.x = (char)-1; + current_coord.y = (char)-1; + } + break; + + case 234: + #line 1736 "lev_comp.y" + { + if (check_monster_char((char) yyvsp[0].i)) + yyval.i = yyvsp[0].i ; + else { + yyerror("Unknown monster class!"); + yyval.i = ERR; + } + } + break; + + case 235: + #line 1747 "lev_comp.y" + { + char c = yyvsp[0].i; + if (check_object_char(c)) + yyval.i = c; + else { + yyerror("Unknown char class!"); + yyval.i = ERR; + } + } + break; + + case 239: + #line 1766 "lev_comp.y" + { + yyval.i = 100; /* default is 100% */ + } + break; + + case 240: + #line 1770 "lev_comp.y" + { + if (yyvsp[0].i <= 0 || yyvsp[0].i > 100) + yyerror("Expected percentile chance."); + yyval.i = yyvsp[0].i; + } + break; + + case 243: + #line 1782 "lev_comp.y" + { + if (!in_room && !init_lev.init_present && + (yyvsp[-3].i < 0 || yyvsp[-3].i > (int)max_x_map || + yyvsp[-1].i < 0 || yyvsp[-1].i > (int)max_y_map)) + yyerror("Coordinates out of map range!"); + current_coord.x = yyvsp[-3].i; + current_coord.y = yyvsp[-1].i; + } + break; + + case 244: + #line 1793 "lev_comp.y" + { + /* This series of if statements is a hack for MSC 5.1. It seems that its + tiny little brain cannot compile if these are all one big if statement. */ + if (yyvsp[-7].i < 0 || yyvsp[-7].i > (int)max_x_map) + yyerror("Region out of map range!"); + else if (yyvsp[-5].i < 0 || yyvsp[-5].i > (int)max_y_map) + yyerror("Region out of map range!"); + else if (yyvsp[-3].i < 0 || yyvsp[-3].i > (int)max_x_map) + yyerror("Region out of map range!"); + else if (yyvsp[-1].i < 0 || yyvsp[-1].i > (int)max_y_map) + yyerror("Region out of map range!"); + current_region.x1 = yyvsp[-7].i; + current_region.y1 = yyvsp[-5].i; + current_region.x2 = yyvsp[-3].i; + current_region.y2 = yyvsp[-1].i; + } + break; + + + } + + /* Line 1010 of yacc.c. */ + #line 3462 "y.tab.c" + + yyvsp -= yylen; + yyssp -= yylen; + + + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + + /*------------------------------------. + | yyerrlab -- here on detecting error | + `------------------------------------*/ + yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + #if YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (YYPACT_NINF < yyn && yyn < YYLAST) + { + YYSIZE_T yysize = 0; + int yytype = YYTRANSLATE (yychar); + const char* yyprefix; + char *yymsg; + int yyx; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 0; + + yyprefix = ", expecting "; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); + yycount += 1; + if (yycount == 5) + { + yysize = 0; + break; + } + } + yysize += (sizeof ("syntax error, unexpected ") + + yystrlen (yytname[yytype])); + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg != 0) + { + char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); + yyp = yystpcpy (yyp, yytname[yytype]); + + if (yycount < 5) + { + yyprefix = ", expecting "; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + yyp = yystpcpy (yyp, yyprefix); + yyp = yystpcpy (yyp, yytname[yyx]); + yyprefix = " or "; + } + } + yyerror (yymsg); + YYSTACK_FREE (yymsg); + } + else + yyerror ("syntax error; also virtual memory exhausted"); + } + else + #endif /* YYERROR_VERBOSE */ + yyerror ("syntax error"); + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* If at end of input, pop the error token, + then the rest of the stack, then return failure. */ + if (yychar == YYEOF) + for (;;) + { + YYPOPSTACK; + if (yyssp == yyss) + YYABORT; + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + yydestruct (yystos[*yyssp], yyvsp); + } + } + else + { + YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); + yydestruct (yytoken, &yylval); + yychar = YYEMPTY; + + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + + #ifdef __GNUC__ + /* Pacify GCC when the user code never invokes YYERROR and the label + yyerrorlab therefore never appears in user code. */ + if (0) + goto yyerrorlab; + #endif + + yyvsp -= yylen; + yyssp -= yylen; + yystate = *yyssp; + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + yydestruct (yystos[yystate], yyvsp); + YYPOPSTACK; + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + YYDPRINTF ((stderr, "Shifting error token, ")); + + *++yyvsp = yylval; + + + yystate = yyn; + goto yynewstate; + + + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ + yyacceptlab: + yyresult = 0; + goto yyreturn; + + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ + yyabortlab: + yyresult = 1; + goto yyreturn; + + #ifndef yyoverflow + /*----------------------------------------------. + | yyoverflowlab -- parser overflow comes here. | + `----------------------------------------------*/ + yyoverflowlab: + yyerror ("parser stack overflow"); + yyresult = 2; + /* Fall through. */ + #endif + + yyreturn: + #ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); + #endif + return yyresult; + } + + + #line 1811 "lev_comp.y" + + + /*lev_comp.y*/ + diff -rN -c slashem-0.0.7E7F2/util/makedefs.c geekslashem-0.0.7E7F2/util/makedefs.c *** slashem-0.0.7E7F2/util/makedefs.c 2005-12-04 23:58:27.000000000 +0900 --- geekslashem-0.0.7E7F2/util/makedefs.c 2006-04-25 01:38:50.000000000 +0900 *************** *** 65,71 **** #define ORACLE_FILE "oracles" #define DATA_FILE "data" #define RUMOR_FILE "rumors" ! #define DGN_I_FILE "dungeon.def" #define DGN_O_FILE "dungeon.pdf" #define MON_STR_C "monstr.c" #define QTXT_I_FILE "quest.txt" --- 65,75 ---- #define ORACLE_FILE "oracles" #define DATA_FILE "data" #define RUMOR_FILE "rumors" ! #ifdef GEEK ! # define DGN_I_FILE "Gdungeon.def" ! #else ! # define DGN_I_FILE "dungeon.def" ! #endif /* GEEK */ #define DGN_O_FILE "dungeon.pdf" #define MON_STR_C "monstr.c" #define QTXT_I_FILE "quest.txt" *************** *** 736,741 **** --- 740,748 ---- #ifdef MFLOPPY "floppy drive support", #endif + #ifdef GEEK + "geek", + #endif #ifdef GOLDOBJ "gold object in inventories", #endif