More fixed limits (NOBJECTS, LOCSIZ) stop being fixed.
This commit is contained in:
parent
985137d9c7
commit
64035d0026
5 changed files with 8 additions and 15 deletions
2
Makefile
2
Makefile
|
@ -59,6 +59,8 @@ saveresume.o: advent.h database.h common.h newdb.h
|
||||||
|
|
||||||
common.o: common.h
|
common.o: common.h
|
||||||
|
|
||||||
|
dungeon.o: common.h newdb.h
|
||||||
|
|
||||||
newdb.o: newdb.c newdb.h
|
newdb.o: newdb.c newdb.h
|
||||||
$(CC) $(CCFLAGS) $(DBX) -c newdb.c
|
$(CC) $(CCFLAGS) $(DBX) -c newdb.c
|
||||||
|
|
||||||
|
|
3
common.h
3
common.h
|
@ -2,9 +2,6 @@
|
||||||
#define COMMON_H
|
#define COMMON_H
|
||||||
/* maximum size limits shared by dungeon compiler and runtime */
|
/* maximum size limits shared by dungeon compiler and runtime */
|
||||||
|
|
||||||
#define LOCSIZ 185
|
|
||||||
#define NOBJECTS 100
|
|
||||||
|
|
||||||
extern const char advent_to_ascii[128];
|
extern const char advent_to_ascii[128];
|
||||||
extern const char ascii_to_advent[128];
|
extern const char ascii_to_advent[128];
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include "newdb.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
// Global variables for use in functions below that can gradually disappear as code is cleaned up
|
// Global variables for use in functions below that can gradually disappear as code is cleaned up
|
||||||
|
|
13
init.c
13
init.c
|
@ -14,23 +14,13 @@
|
||||||
* 12600 words of message text (LINES, LINSIZ).
|
* 12600 words of message text (LINES, LINSIZ).
|
||||||
* 885 travel options (TRAVEL, TRVSIZ).
|
* 885 travel options (TRAVEL, TRVSIZ).
|
||||||
* 330 vocabulary words (KTAB, ATAB, TABSIZ).
|
* 330 vocabulary words (KTAB, ATAB, TABSIZ).
|
||||||
* 185 locations (KEY, COND, game.abbrev, game.atloc, LOCSIZ).
|
|
||||||
* 100 objects (PLAC, game.place, FIXD, game.fixed, game.link (twice),
|
|
||||||
* ogame.prop).
|
|
||||||
* 35 "action" verbs (ACTSPK, VRBSIZ).
|
* 35 "action" verbs (ACTSPK, VRBSIZ).
|
||||||
* 12 different player classifications (CTEXT, CVAL, CLSMAX).
|
|
||||||
* 20 hints (game.hintlc, game.hinted, HINTS, HNTSIZ).
|
|
||||||
* 5 "# of turns" threshholds (TRNSIZ).
|
|
||||||
* There are also limits which cannot be exceeded due to the structure of
|
* There are also limits which cannot be exceeded due to the structure of
|
||||||
* the database. (E.G., The vocabulary uses n/1000 to determine word type,
|
* the database. (E.G., The vocabulary uses n/1000 to determine word type,
|
||||||
* so there can't be more than 1000 words.) These upper limits are:
|
* so there can't be more than 1000 words.) These upper limits are:
|
||||||
* 1000 non-synonymous vocabulary words
|
* 1000 non-synonymous vocabulary words
|
||||||
* 300 locations
|
* 300 locations
|
||||||
* 100 objects
|
* 100 objects
|
||||||
* Note:
|
|
||||||
* - the object count limit has been abstracted as NOBJECTS
|
|
||||||
* - the random message limit has been abstracted as RTXSIZ
|
|
||||||
* - maximum locations limit has been abstracted as LOCSIZ
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Description of the database format
|
/* Description of the database format
|
||||||
|
@ -347,11 +337,10 @@ void initialise(void)
|
||||||
* game.iwest How many times he's said "west" instead of "w"
|
* game.iwest How many times he's said "west" instead of "w"
|
||||||
* game.knfloc 0 if no knife here, loc if knife here, -1 after caveat
|
* game.knfloc 0 if no knife here, loc if knife here, -1 after caveat
|
||||||
* game.limit Lifetime of lamp (not set here)
|
* game.limit Lifetime of lamp (not set here)
|
||||||
* NDEATHS Number of reincarnation messages available (up to 5)
|
|
||||||
* game.numdie Number of times killed so far
|
* game.numdie Number of times killed so far
|
||||||
* game.trnluz # points lost so far due to number of turns used
|
* game.trnluz # points lost so far due to number of turns used
|
||||||
* game.turns Tallies how many commands he's given (ignores yes/no)
|
* game.turns Tallies how many commands he's given (ignores yes/no)
|
||||||
* Logicals were explained earlier */
|
*/
|
||||||
game.turns = 0;
|
game.turns = 0;
|
||||||
game.trnluz = 0;
|
game.trnluz = 0;
|
||||||
game.lmwarn = false;
|
game.lmwarn = false;
|
||||||
|
|
|
@ -70,6 +70,8 @@ extern obituary_t obituaries[];
|
||||||
extern hint_t hints[];
|
extern hint_t hints[];
|
||||||
extern long conditions[];
|
extern long conditions[];
|
||||||
|
|
||||||
|
#define LOCSIZ {}
|
||||||
|
#define NOBJECTS {}
|
||||||
#define NHINTS {}
|
#define NHINTS {}
|
||||||
#define NCLASSES {}
|
#define NCLASSES {}
|
||||||
#define NDEATHS {}
|
#define NDEATHS {}
|
||||||
|
@ -338,6 +340,8 @@ if __name__ == "__main__":
|
||||||
)
|
)
|
||||||
|
|
||||||
h = h_template.format(
|
h = h_template.format(
|
||||||
|
len(db["locations"]),
|
||||||
|
len(db["object_descriptions"]),
|
||||||
len(db["hints"]),
|
len(db["hints"]),
|
||||||
len(db["classes"]),
|
len(db["classes"]),
|
||||||
len(db["obituaries"]),
|
len(db["obituaries"]),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue