projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
28f9fd5
)
Magic-number elimination. Fix possible glitch in troll-bridge death.
author
Eric S. Raymond
<esr@thyrsus.com>
Mon, 19 Jun 2017 15:00:23 +0000
(11:00 -0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Mon, 19 Jun 2017 15:00:23 +0000
(11:00 -0400)
advent.h
patch
|
blob
|
history
main.c
patch
|
blob
|
history
diff --git
a/advent.h
b/advent.h
index 3e89be0a87e5e04060c1cdb896e54d658d623a5a..1efde8328811c21fa09ca466fb4f7f6bf03b1bf2 100644
(file)
--- a/
advent.h
+++ b/
advent.h
@@
-5,17
+5,18
@@
#include "common.h"
#define LINESIZE 100
#include "common.h"
#define LINESIZE 100
-#define NDWARVES 6
+#define NDWARVES 6
/* number of dwarves */
#define PIRATE NDWARVES /* must be NDWARVES-1 when zero-origin */
#define DALTLC LOC_NUGGET /* alternate dwarf location */
#define PIRATE NDWARVES /* must be NDWARVES-1 when zero-origin */
#define DALTLC LOC_NUGGET /* alternate dwarf location */
-#define MINTRS 50
-#define MAXTRS 79
-#define MAXPARMS 25
-#define INVLIMIT 7
+#define MINTRS 50
/* index of lowest reasure */
+#define MAXTRS 79
/* index of highest reasure */
+#define MAXPARMS 25
/* Max parameters for speak() */
+#define INVLIMIT 7
/* inverntory limit (# of objects) */
#define INTRANSITIVE -1 /* illegal object number */
#define SPECIALBASE 300 /* base number of special rooms */
#define WARNTIME 30 /* late game starts at game.limit-this */
#define PANICTIME 15 /* time left after closing */
#define INTRANSITIVE -1 /* illegal object number */
#define SPECIALBASE 300 /* base number of special rooms */
#define WARNTIME 30 /* late game starts at game.limit-this */
#define PANICTIME 15 /* time left after closing */
+#define BATTERYLIFE 2500 /* turn limit increment from batteries */
typedef long token_t; /* word token - someday this will be char[TOKLEN+1] */
typedef long vocab_t; /* index into a vocabulary array */
typedef long token_t; /* word token - someday this will be char[TOKLEN+1] */
typedef long vocab_t; /* index into a vocabulary array */
diff --git
a/main.c
b/main.c
index 16d8f915f5660e9b8415168f9a32a82b499763ba..9fc8fa97ad827e24e15511e2fbcf621acbab1f8b 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-619,7
+619,7
@@
static bool playermove(token_t verb, int motion)
do {
/*
* (ESR) This special-travel loop may have to be repeated if it includes
do {
/*
* (ESR) This special-travel loop may have to be repeated if it includes
- * the plover passage. Same deal for any future cases w
gerw we b
eed to
+ * the plover passage. Same deal for any future cases w
here we n
eed to
* block travel and then redo it once the blocking condition has been
* removed.
*/
* block travel and then redo it once the blocking condition has been
* removed.
*/
@@
-652,7
+652,7
@@
static bool playermove(token_t verb, int motion)
if (!SPECIAL(game.newloc))
return true;
if (game.newloc <= 500) {
if (!SPECIAL(game.newloc))
return true;
if (game.newloc <= 500) {
- game.newloc
= game.newloc -
SPECIALBASE;
+ game.newloc
-=
SPECIALBASE;
switch (game.newloc) {
case 1:
/* Travel 301. Plover-alcove passage. Can carry only
switch (game.newloc) {
case 1:
/* Travel 301. Plover-alcove passage. Can carry only
@@
-711,6
+711,7
@@
static bool playermove(token_t verb, int motion)
game.prop[BEAR] = 3;
game.oldlc2 = game.newloc;
croak();
game.prop[BEAR] = 3;
game.oldlc2 = game.newloc;
croak();
+ return true;
}
}
BUG(SPECIAL_TRAVEL_500_GT_L_GT_300_EXCEEDS_GOTO_LIST);
}
}
BUG(SPECIAL_TRAVEL_500_GT_L_GT_300_EXCEEDS_GOTO_LIST);
@@
-856,7
+857,7
@@
static void lampcheck(void)
game.prop[BATTERY] = 1;
if (TOTING(BATTERY))
DROP(BATTERY, game.loc);
game.prop[BATTERY] = 1;
if (TOTING(BATTERY))
DROP(BATTERY, game.loc);
- game.limit
= game.limit + 2500
;
+ game.limit
+= BATTERYLIFE
;
game.lmwarn = false;
} else if (game.limit == 0) {
game.limit = -1;
game.lmwarn = false;
} else if (game.limit == 0) {
game.limit = -1;