Merge branch 'paxed-new_lev_comp' of https://rodney.nethack.org:20040/git/NHsource into paxed-new_lev_comp

Conflicts:
	include/obj.h
	include/patchlevel.h
	src/topten.c
	src/trap.c
	sys/winnt/Makefile.msc
This commit is contained in:
Pasi Kallinen
2015-03-24 19:59:40 +02:00
13 changed files with 8508 additions and 3334 deletions

1
.gitignore vendored
View File

@@ -34,6 +34,7 @@ Makefile
# Win32-specific ignores
binary/
build/
ipch/
Nethack.sln
Nethack.sdf
Nethack.opensdf

View File

@@ -48,99 +48,141 @@ TRAP: random, random
TRAP: random, random
# A tragic accident has occurred in Frontier Town....
#
# Minetown variant 1
# "Frontier Town"
# Orcish Town - a variant of Frontier Town that has been
# overrun by orcs. Note the barricades (iron bars).
#
LEVEL: "minetn-1"
FLAGS:mazelevel
INIT_MAP:mines,'.',' ',true,true,random,true
GEOMETRY:center,center
MAP
.....................................
.----------------F------------------.
.|.................................|.
.|.-------------......------------.|.
.|.|...|...|...|......|..|...|...|.|.
.F.|...|...|...|......|..|...|...|.|.
.|.|...|...|...|......|..|...|...|.F.
.|.|...|...|----......------------.|.
.|.---------.......................|.
.|.................................|.
.|.---------.....--...--...........|.
.|.|...|...|----.|.....|.---------.|.
.|.|...|...|...|.|.....|.|..|....|.|.
.|.|...|...|...|.|.....|.|..|....|.|.
.|.|...|...|...|.|.....|.|..|....|.|.
.|.-------------.-------.---------.|.
.|.................................F.
.-----------F------------F----------.
.....................................
ENDMAP
ROOM: "ordinary" , lit, (3,3), (center,center), (31,15) {
FOUNTAIN: (13, 7)
FOUNTAIN: (20, 7)
# Don't let the player fall into his likely death
TELEPORT_REGION:levregion(01,01,20,19),levregion(20,00,70,19)
REGION:(00,00,36,16),lit,"ordinary"
STAIR:levregion(01,03,20,19),(00,00,36,15),up
STAIR:levregion(61,03,75,19),(00,00,36,15),down
# The Town Watch
MONSTER: ('@', "watchman"), random, peaceful
MONSTER: ('@', "watchman"), random, peaceful
MONSTER: ('@', "watchman"), random, peaceful
MONSTER: ('@', "watchman"), random, peaceful
MONSTER: ('@', "watch captain"), random, peaceful
# shame we can't make polluted fountains
FOUNTAIN:(16,09)
FOUNTAIN:(25,09)
SUBROOM: "shop" [90%] , lit, (2,2), (3,4) {
ROOMDOOR: false, closed, south, random
# the altar's defiled; useful for BUC but never coaligned
ALTAR:(20,13),noalign,shrine
# set up the shop doors; could be broken down
DOOR:random,(5,8)
DOOR:random,(9,8)
DOOR:random,(13,7)
DOOR:random,(22,5)
DOOR:random,(27,7)
DOOR:random,(31,7)
DOOR:random,(5,10)
DOOR:random,(9,10)
DOOR:random,(15,13)
DOOR:random,(25,13)
DOOR:random,(31,11)
# knock a few holes in the shop interior walls
REPLACE_TERRAIN:(07,04,11,06),'|','.',18%
REPLACE_TERRAIN:(25,04,29,06),'|','.',18%
REPLACE_TERRAIN:(07,12,11,14),'|','.',18%
REPLACE_TERRAIN:(28,12,28,14),'|','.',33%
# One spot each in most shops...
$place = { (05,04),(09,05),(13,04),(26,04),(31,05),(30,14),(05,14),(10,13),(26,14),(27,13) }
SHUFFLE:$place
# scatter some bodies
OBJECT:('%',"corpse"),(20,12),montype:"aligned priest"
OBJECT:('%',"corpse"),$place[0],montype:"shopkeeper"
OBJECT:('%',"corpse"),$place[1],montype:"shopkeeper"
OBJECT:('%',"corpse"),$place[2],montype:"shopkeeper"
OBJECT:('%',"corpse"),$place[3],montype:"shopkeeper"
OBJECT:('%',"corpse"),$place[4],montype:"shopkeeper"
OBJECT:('%',"corpse"),random,montype:"watchman"
OBJECT:('%',"corpse"),random,montype:"watchman"
OBJECT:('%',"corpse"),random,montype:"watchman"
OBJECT:('%',"corpse"),random,montype:"watchman"
OBJECT:('%',"corpse"),random,montype:"watch captain"
# Rubble!
LOOP [9 + 2d5] {
[90%]: OBJECT:('`',"boulder"),random
OBJECT:('*',"rock"),random
}
SUBROOM: "tool shop" [90%], lit, (2,9), (3,4) {
ROOMDOOR: false, closed, north, random
# Guarantee 7 candles since we won't have Izchak available
OBJECT:('(',"wax candle"),$place[0],quantity:1d2
OBJECT:('(',"wax candle"),$place[1],quantity:2d2
OBJECT:('(',"wax candle"),$place[2],quantity:1d2
OBJECT:('(',"tallow candle"),$place[3],quantity:1d3
OBJECT:('(',"tallow candle"),$place[2],quantity:1d2
OBJECT:('(',"tallow candle"),$place[0],quantity:1d2
# go ahead and leave a lamp next to one corpse to be suggestive
# and some empty wands...
OBJECT:('(',"oil lamp"),$place[2]
OBJECT:('/',"striking"),$place[1],uncursed,0
OBJECT:('/',"striking"),$place[3],uncursed,0
OBJECT:('/',"striking"),$place[4],uncursed,0
OBJECT:('/',"magic missile"),$place[4],uncursed,0
OBJECT:('/',"magic missile"),$place[0],uncursed,0
# the Orcish Army
$inside = selection: floodfill(18,8)
$near_temple = selection: filter(fillrect(17,8, 23,14), $inside)
LOOP [5 + 1d10] {
IF [50%] {
MONSTER: ('o', "orc-captain"), rndcoord($inside), hostile
} ELSE {
IF [80%] {
MONSTER: ('o', "Uruk-hai"), rndcoord($inside), hostile
} ELSE {
MONSTER: ('o', "Mordor orc"), rndcoord($inside), hostile
}
}
}
# shamans can be hanging out in/near the temple
LOOP [2d3] {
MONSTER: ('o', "orc shaman"), rndcoord($near_temple), hostile
}
# these are not such a big deal
# to run into outside the bars
LOOP [9 + 2d5] {
IF [90%] {
MONSTER: ('o', "hill orc"), random, hostile
} ELSE {
MONSTER: ('o', "goblin"), random, hostile
}
}
SUBROOM: "ordinary", unlit, (6,2), (3,4) {
ROOMDOOR: false, closed, south, random
}
SUBROOM: "ordinary", lit, (6,9), (3,4) {
ROOMDOOR: false, closed, north, random
}
SUBROOM: "food shop" [90%], lit, (10,2), (2,3) {
ROOMDOOR: false, closed, south, random
}
SUBROOM: "candle shop", lit, (22,2), (3,3) {
ROOMDOOR: false, closed, south, random
}
SUBROOM: "ordinary", unlit, (10,10), (2,3) {
ROOMDOOR: false, locked, east, random
MONSTER: ('G', "gnome"), random
}
SUBROOM: "ordinary", lit, (19,2), (2,3) {
ROOMDOOR: false, locked, west, random
MONSTER: ('G', "gnome"), random
}
SUBROOM: "temple", lit, (15,9), (4,4) {
ROOMDOOR: false, closed, north, random
ALTAR:(02,02),align[0],shrine
MONSTER: ('G', "gnomish wizard"), random
MONSTER: ('G', "gnomish wizard"), random
}
SUBROOM: "ordinary", lit, (22,10), (2,3) {
ROOMDOOR: false, locked, west, random
}
SUBROOM: "ordinary", lit, (26,2), (3,3) {
ROOMDOOR: false, closed, south, random
MONSTER: ('G', "gnome lord"), random
}
SUBROOM: "ordinary", unlit, (25,10), (4,3) {
ROOMDOOR: false, closed, north, random
}
}
ROOM: "ordinary" , random, random, random, random {
STAIR: random, up
}
ROOM: "ordinary" , random, random, random, random {
STAIR: random, down
TRAP: random, random
MONSTER: ('G', "gnome"), random
MONSTER: ('G', "gnome"), random
}
ROOM: "ordinary" , random, random, random, random {
MONSTER: ('h', "dwarf"), random
}
ROOM: "ordinary" , random, random, random, random {
TRAP: random, random
MONSTER: ('G', "gnome"), random
}
RANDOM_CORRIDORS
WALLIFY
# Minetown variant 2

View File

@@ -127,8 +127,15 @@ extern void FDECL(interject, (int));
#define strncmpi(a,b,c) strnicmp(a,b,c)
#endif
/* Visual Studio defines this in their own headers, which we don't use */
#ifndef snprintf
#define snprintf _snprintf
#pragma warning(disable:4996) /* deprecation warning suggesting snprintf_s */
#endif
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef __BORLANDC__
#undef randomize
#undef random

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 obj.h $NHDT-Date: 1426949157 2015/03/21 14:45:57 $ $NHDT-Branch: master $:$NHDT-Revision: 1.36 $ */
/* NetHack 3.5 obj.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 obj.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.31 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 patchlevel.h $NHDT-Date: 1426948844 2015/03/21 14:40:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.95 $ */
/* NetHack 3.5 patchlevel.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 patchlevel.h $Date: 2012/04/14 08:31:03 $ $Revision: 1.93 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

View File

@@ -3452,20 +3452,21 @@ line_dist_coord(x1,y1, x2,y2, x3,y3)
{
long px = x2-x1;
long py = y2-y1;
long s = px*px + py*py;
long x, y, dx, dy, dist = 0;
float u = 0;
if (x1 == x2 && y1 == y2) return isqrt(dist2(x1,y1, x3,y3));
long s = px*px + py*py;
float u = ((x3 - x1) * px + (y3 - y1) * py) / (float)s;
u = ((x3 - x1) * px + (y3 - y1) * py) / (float)s;
if (u > 1) u = 1;
else if (u < 0) u = 0;
long x = x1 + u * px;
long y = y1 + u * py;
long dx = x - x3;
long dy = y - y3;
long dist = isqrt(dx*dx + dy*dy);
x = x1 + u * px;
y = y1 + u * py;
dx = x - x3;
dy = y - y3;
dist = isqrt(dx*dx + dy*dy);
return dist;
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 topten.c $NHDT-Date: 1426731079 2015/03/19 02:11:19 $ $NHDT-Branch: harder_d8 $:$NHDT-Revision: 1.25 $ */
/* NetHack 3.5 topten.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 topten.c $Date: 2012/01/24 04:26:15 $ $Revision: 1.23 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 trap.c $NHDT-Date: 1426805491 2015/03/19 22:51:31 $ $NHDT-Branch: water_damage $:$NHDT-Revision: 1.198 $ */
/* NetHack 3.5 trap.c $NHDT-Date: 1426558928 2015/03/17 02:22:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.195 $ */
/* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

View File

@@ -1,79 +1,453 @@
#define CHAR 257
#define INTEGER 258
#define BOOLEAN 259
#define PERCENT 260
#define MESSAGE_ID 261
#define MAZE_ID 262
#define LEVEL_ID 263
#define LEV_INIT_ID 264
#define GEOMETRY_ID 265
#define NOMAP_ID 266
#define OBJECT_ID 267
#define COBJECT_ID 268
#define MONSTER_ID 269
#define TRAP_ID 270
#define DOOR_ID 271
#define DRAWBRIDGE_ID 272
#define MAZEWALK_ID 273
#define WALLIFY_ID 274
#define REGION_ID 275
#define FILLING 276
#define RANDOM_OBJECTS_ID 277
#define RANDOM_MONSTERS_ID 278
#define RANDOM_PLACES_ID 279
#define ALTAR_ID 280
#define LADDER_ID 281
#define STAIR_ID 282
#define NON_DIGGABLE_ID 283
#define NON_PASSWALL_ID 284
#define ROOM_ID 285
#define PORTAL_ID 286
#define TELEPRT_ID 287
#define BRANCH_ID 288
#define LEV 289
#define CHANCE_ID 290
#define CORRIDOR_ID 291
#define GOLD_ID 292
#define ENGRAVING_ID 293
#define FOUNTAIN_ID 294
#define POOL_ID 295
#define SINK_ID 296
#define NONE 297
#define RAND_CORRIDOR_ID 298
#define DOOR_STATE 299
#define LIGHT_STATE 300
#define CURSE_TYPE 301
#define ENGRAVING_TYPE 302
#define DIRECTION 303
#define RANDOM_TYPE 304
#define O_REGISTER 305
#define M_REGISTER 306
#define P_REGISTER 307
#define A_REGISTER 308
#define ALIGNMENT 309
#define LEFT_OR_RIGHT 310
#define CENTER 311
#define TOP_OR_BOT 312
#define ALTAR_TYPE 313
#define UP_OR_DOWN 314
#define SUBROOM_ID 315
#define NAME_ID 316
#define FLAGS_ID 317
#define FLAG_TYPE 318
#define MON_ATTITUDE 319
#define MON_ALERTNESS 320
#define MON_APPEARANCE 321
#define CONTAINED 322
#define STRING 323
#define MAP_ID 324
typedef union
/* A Bison parser, made by GNU Bison 3.0.2. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2013 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifndef YY_YY_Y_TAB_H_INCLUDED
# define YY_YY_Y_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
CHAR = 258,
INTEGER = 259,
BOOLEAN = 260,
PERCENT = 261,
SPERCENT = 262,
MINUS_INTEGER = 263,
PLUS_INTEGER = 264,
MAZE_GRID_ID = 265,
SOLID_FILL_ID = 266,
MINES_ID = 267,
ROGUELEV_ID = 268,
MESSAGE_ID = 269,
MAZE_ID = 270,
LEVEL_ID = 271,
LEV_INIT_ID = 272,
GEOMETRY_ID = 273,
NOMAP_ID = 274,
OBJECT_ID = 275,
COBJECT_ID = 276,
MONSTER_ID = 277,
TRAP_ID = 278,
DOOR_ID = 279,
DRAWBRIDGE_ID = 280,
object_ID = 281,
monster_ID = 282,
terrain_ID = 283,
MAZEWALK_ID = 284,
WALLIFY_ID = 285,
REGION_ID = 286,
FILLING = 287,
IRREGULAR = 288,
JOINED = 289,
ALTAR_ID = 290,
LADDER_ID = 291,
STAIR_ID = 292,
NON_DIGGABLE_ID = 293,
NON_PASSWALL_ID = 294,
ROOM_ID = 295,
PORTAL_ID = 296,
TELEPRT_ID = 297,
BRANCH_ID = 298,
LEV = 299,
MINERALIZE_ID = 300,
CORRIDOR_ID = 301,
GOLD_ID = 302,
ENGRAVING_ID = 303,
FOUNTAIN_ID = 304,
POOL_ID = 305,
SINK_ID = 306,
NONE = 307,
RAND_CORRIDOR_ID = 308,
DOOR_STATE = 309,
LIGHT_STATE = 310,
CURSE_TYPE = 311,
ENGRAVING_TYPE = 312,
DIRECTION = 313,
RANDOM_TYPE = 314,
RANDOM_TYPE_BRACKET = 315,
A_REGISTER = 316,
ALIGNMENT = 317,
LEFT_OR_RIGHT = 318,
CENTER = 319,
TOP_OR_BOT = 320,
ALTAR_TYPE = 321,
UP_OR_DOWN = 322,
SUBROOM_ID = 323,
NAME_ID = 324,
FLAGS_ID = 325,
FLAG_TYPE = 326,
MON_ATTITUDE = 327,
MON_ALERTNESS = 328,
MON_APPEARANCE = 329,
ROOMDOOR_ID = 330,
IF_ID = 331,
ELSE_ID = 332,
TERRAIN_ID = 333,
HORIZ_OR_VERT = 334,
REPLACE_TERRAIN_ID = 335,
EXIT_ID = 336,
SHUFFLE_ID = 337,
QUANTITY_ID = 338,
BURIED_ID = 339,
LOOP_ID = 340,
FOR_ID = 341,
TO_ID = 342,
SWITCH_ID = 343,
CASE_ID = 344,
BREAK_ID = 345,
DEFAULT_ID = 346,
ERODED_ID = 347,
TRAPPED_ID = 348,
RECHARGED_ID = 349,
INVIS_ID = 350,
GREASED_ID = 351,
FEMALE_ID = 352,
CANCELLED_ID = 353,
REVIVED_ID = 354,
AVENGE_ID = 355,
FLEEING_ID = 356,
BLINDED_ID = 357,
PARALYZED_ID = 358,
STUNNED_ID = 359,
CONFUSED_ID = 360,
SEENTRAPS_ID = 361,
ALL_ID = 362,
MONTYPE_ID = 363,
GRAVE_ID = 364,
ERODEPROOF_ID = 365,
FUNCTION_ID = 366,
MSG_OUTPUT_TYPE = 367,
COMPARE_TYPE = 368,
UNKNOWN_TYPE = 369,
rect_ID = 370,
fillrect_ID = 371,
line_ID = 372,
randline_ID = 373,
grow_ID = 374,
selection_ID = 375,
flood_ID = 376,
rndcoord_ID = 377,
circle_ID = 378,
ellipse_ID = 379,
filter_ID = 380,
complement_ID = 381,
gradient_ID = 382,
GRADIENT_TYPE = 383,
LIMITED = 384,
HUMIDITY_TYPE = 385,
STRING = 386,
MAP_ID = 387,
NQSTRING = 388,
VARSTRING = 389,
CFUNC = 390,
CFUNC_INT = 391,
CFUNC_STR = 392,
CFUNC_COORD = 393,
CFUNC_REGION = 394,
VARSTRING_INT = 395,
VARSTRING_INT_ARRAY = 396,
VARSTRING_STRING = 397,
VARSTRING_STRING_ARRAY = 398,
VARSTRING_VAR = 399,
VARSTRING_VAR_ARRAY = 400,
VARSTRING_COORD = 401,
VARSTRING_COORD_ARRAY = 402,
VARSTRING_REGION = 403,
VARSTRING_REGION_ARRAY = 404,
VARSTRING_MAPCHAR = 405,
VARSTRING_MAPCHAR_ARRAY = 406,
VARSTRING_MONST = 407,
VARSTRING_MONST_ARRAY = 408,
VARSTRING_OBJ = 409,
VARSTRING_OBJ_ARRAY = 410,
VARSTRING_SEL = 411,
VARSTRING_SEL_ARRAY = 412,
METHOD_INT = 413,
METHOD_INT_ARRAY = 414,
METHOD_STRING = 415,
METHOD_STRING_ARRAY = 416,
METHOD_VAR = 417,
METHOD_VAR_ARRAY = 418,
METHOD_COORD = 419,
METHOD_COORD_ARRAY = 420,
METHOD_REGION = 421,
METHOD_REGION_ARRAY = 422,
METHOD_MAPCHAR = 423,
METHOD_MAPCHAR_ARRAY = 424,
METHOD_MONST = 425,
METHOD_MONST_ARRAY = 426,
METHOD_OBJ = 427,
METHOD_OBJ_ARRAY = 428,
METHOD_SEL = 429,
METHOD_SEL_ARRAY = 430,
DICE = 431
};
#endif
/* Tokens. */
#define CHAR 258
#define INTEGER 259
#define BOOLEAN 260
#define PERCENT 261
#define SPERCENT 262
#define MINUS_INTEGER 263
#define PLUS_INTEGER 264
#define MAZE_GRID_ID 265
#define SOLID_FILL_ID 266
#define MINES_ID 267
#define ROGUELEV_ID 268
#define MESSAGE_ID 269
#define MAZE_ID 270
#define LEVEL_ID 271
#define LEV_INIT_ID 272
#define GEOMETRY_ID 273
#define NOMAP_ID 274
#define OBJECT_ID 275
#define COBJECT_ID 276
#define MONSTER_ID 277
#define TRAP_ID 278
#define DOOR_ID 279
#define DRAWBRIDGE_ID 280
#define object_ID 281
#define monster_ID 282
#define terrain_ID 283
#define MAZEWALK_ID 284
#define WALLIFY_ID 285
#define REGION_ID 286
#define FILLING 287
#define IRREGULAR 288
#define JOINED 289
#define ALTAR_ID 290
#define LADDER_ID 291
#define STAIR_ID 292
#define NON_DIGGABLE_ID 293
#define NON_PASSWALL_ID 294
#define ROOM_ID 295
#define PORTAL_ID 296
#define TELEPRT_ID 297
#define BRANCH_ID 298
#define LEV 299
#define MINERALIZE_ID 300
#define CORRIDOR_ID 301
#define GOLD_ID 302
#define ENGRAVING_ID 303
#define FOUNTAIN_ID 304
#define POOL_ID 305
#define SINK_ID 306
#define NONE 307
#define RAND_CORRIDOR_ID 308
#define DOOR_STATE 309
#define LIGHT_STATE 310
#define CURSE_TYPE 311
#define ENGRAVING_TYPE 312
#define DIRECTION 313
#define RANDOM_TYPE 314
#define RANDOM_TYPE_BRACKET 315
#define A_REGISTER 316
#define ALIGNMENT 317
#define LEFT_OR_RIGHT 318
#define CENTER 319
#define TOP_OR_BOT 320
#define ALTAR_TYPE 321
#define UP_OR_DOWN 322
#define SUBROOM_ID 323
#define NAME_ID 324
#define FLAGS_ID 325
#define FLAG_TYPE 326
#define MON_ATTITUDE 327
#define MON_ALERTNESS 328
#define MON_APPEARANCE 329
#define ROOMDOOR_ID 330
#define IF_ID 331
#define ELSE_ID 332
#define TERRAIN_ID 333
#define HORIZ_OR_VERT 334
#define REPLACE_TERRAIN_ID 335
#define EXIT_ID 336
#define SHUFFLE_ID 337
#define QUANTITY_ID 338
#define BURIED_ID 339
#define LOOP_ID 340
#define FOR_ID 341
#define TO_ID 342
#define SWITCH_ID 343
#define CASE_ID 344
#define BREAK_ID 345
#define DEFAULT_ID 346
#define ERODED_ID 347
#define TRAPPED_ID 348
#define RECHARGED_ID 349
#define INVIS_ID 350
#define GREASED_ID 351
#define FEMALE_ID 352
#define CANCELLED_ID 353
#define REVIVED_ID 354
#define AVENGE_ID 355
#define FLEEING_ID 356
#define BLINDED_ID 357
#define PARALYZED_ID 358
#define STUNNED_ID 359
#define CONFUSED_ID 360
#define SEENTRAPS_ID 361
#define ALL_ID 362
#define MONTYPE_ID 363
#define GRAVE_ID 364
#define ERODEPROOF_ID 365
#define FUNCTION_ID 366
#define MSG_OUTPUT_TYPE 367
#define COMPARE_TYPE 368
#define UNKNOWN_TYPE 369
#define rect_ID 370
#define fillrect_ID 371
#define line_ID 372
#define randline_ID 373
#define grow_ID 374
#define selection_ID 375
#define flood_ID 376
#define rndcoord_ID 377
#define circle_ID 378
#define ellipse_ID 379
#define filter_ID 380
#define complement_ID 381
#define gradient_ID 382
#define GRADIENT_TYPE 383
#define LIMITED 384
#define HUMIDITY_TYPE 385
#define STRING 386
#define MAP_ID 387
#define NQSTRING 388
#define VARSTRING 389
#define CFUNC 390
#define CFUNC_INT 391
#define CFUNC_STR 392
#define CFUNC_COORD 393
#define CFUNC_REGION 394
#define VARSTRING_INT 395
#define VARSTRING_INT_ARRAY 396
#define VARSTRING_STRING 397
#define VARSTRING_STRING_ARRAY 398
#define VARSTRING_VAR 399
#define VARSTRING_VAR_ARRAY 400
#define VARSTRING_COORD 401
#define VARSTRING_COORD_ARRAY 402
#define VARSTRING_REGION 403
#define VARSTRING_REGION_ARRAY 404
#define VARSTRING_MAPCHAR 405
#define VARSTRING_MAPCHAR_ARRAY 406
#define VARSTRING_MONST 407
#define VARSTRING_MONST_ARRAY 408
#define VARSTRING_OBJ 409
#define VARSTRING_OBJ_ARRAY 410
#define VARSTRING_SEL 411
#define VARSTRING_SEL_ARRAY 412
#define METHOD_INT 413
#define METHOD_INT_ARRAY 414
#define METHOD_STRING 415
#define METHOD_STRING_ARRAY 416
#define METHOD_VAR 417
#define METHOD_VAR_ARRAY 418
#define METHOD_COORD 419
#define METHOD_COORD_ARRAY 420
#define METHOD_REGION 421
#define METHOD_REGION_ARRAY 422
#define METHOD_MAPCHAR 423
#define METHOD_MAPCHAR_ARRAY 424
#define METHOD_MONST 425
#define METHOD_MONST_ARRAY 426
#define METHOD_OBJ 427
#define METHOD_OBJ_ARRAY 428
#define METHOD_SEL 429
#define METHOD_SEL_ARRAY 430
#define DICE 431
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE YYSTYPE;
union YYSTYPE
{
int i;
#line 148 "lev_comp.y" /* yacc.c:1909 */
long i;
char* map;
struct {
xchar room;
xchar wall;
xchar door;
long room;
long wall;
long door;
} corpos;
} YYSTYPE;
struct {
long area;
long x1;
long y1;
long x2;
long y2;
} lregn;
struct {
long x;
long y;
} crd;
struct {
long ter;
long lit;
} terr;
struct {
long height;
long width;
} sze;
struct {
long die;
long num;
} dice;
struct {
long cfunc;
char *varstr;
} meth;
#line 443 "y.tab.h" /* yacc.c:1909 */
};
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
extern YYSTYPE yylval;
int yyparse (void);
#endif /* !YY_YY_Y_TAB_H_INCLUDED */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -151,7 +151,7 @@ TARGET_CPU=x86
# -Zd - generate only public symbols and line numbers for debugging
# -GS - enable security checks
#
ccommon=-c $(CDBFLAG) -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c
ccommon=-c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c
lflags=/INCREMENTAL:NO /NOLOGO
!IF "$(TARGET_CPU)" == "x86"

View File

@@ -17,10 +17,14 @@
@echo LEXYYC set to $(LEXYYC)
!ENDIF
# these won't have an impact unless YACC/LEX are defined
YTABC = y.tab.c
YTABH = y.tab.h
LEXYYC = lex.yy.c
default: all
all: ..\util\lev_yacc.c ..\util\lev_lex.c
all: tools ..\util\lev_yacc.c ..\util\lev_lex.c
rebuild: clean all
@@ -29,15 +33,29 @@ clean:
-del ..\util\lev_yacc.c
-del ..\include\lev_comp.h
tools:
!IFDEF YACC
@echo Yacc-alike set to $(YACC)
@echo YTABC set to $(YTABC)
@echo YTABH set to $(YTABH)
!ENDIF
!IFDEF LEX
@echo Lex-alike set to $(LEX)
@echo LEXYYC set to $(LEXYYC)
!ENDIF
#==========================================
# Level Compiler Stuff
#==========================================
..\util\lev_yacc.c ..\include\lev_comp.h: ..\util\lev_comp.y
!IF "$(YACC)"==""
!IFNDEF YACC
@echo Using pre-built lev_yacc.c and lev_comp.h
@copy ..\sys\share\lev_yacc.c ..\util\lev_yacc.c
@copy ..\sys\share\lev_comp.h ..\include\lev_comp.h
!ELSE
@echo Generating lev_yacc.c and lev_comp.h
chdir ..\util
$(YACC) -d lev_comp.y
copy $(YTABC) $@
@@ -48,10 +66,11 @@ clean:
!ENDIF
..\util\lev_lex.c: ..\util\lev_comp.l
!IF "$(LEX)"==""
!IFNDEF LEX
@echo Using pre-built lev_lex.c
@copy ..\sys\share\lev_lex.c $@
!ELSE
@echo Generating lev_lex.c
chdir ..\util
$(LEX) lev_comp.l
copy $(LEXYYC) $@