projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9b53140
)
Magic number removal.
author
Eric S. Raymond
<esr@thyrsus.com>
Wed, 5 Apr 2023 22:02:47 +0000
(18:02 -0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Wed, 5 Apr 2023 22:02:47 +0000
(18:02 -0400)
advent.h
patch
|
blob
|
history
main.c
patch
|
blob
|
history
diff --git
a/advent.h
b/advent.h
index 805b7a7b3fc73ce7b90b4c30884c7b9df03855ef..3afeb8ea407b20a4d52c5912dec02578979ec498 100644
(file)
--- a/
advent.h
+++ b/
advent.h
@@
-34,6
+34,7
@@
#define BATTERYLIFE 2500 // turn limit increment from batteries
#define WORD_NOT_FOUND -1 // "Word not found" flag value for the vocab hash functions.
#define WORD_EMPTY 0 // "Word empty" flag value for the vocab hash functions
#define BATTERYLIFE 2500 // turn limit increment from batteries
#define WORD_NOT_FOUND -1 // "Word not found" flag value for the vocab hash functions.
#define WORD_EMPTY 0 // "Word empty" flag value for the vocab hash functions
+#define PIT_KILL_PROB 35 // Percentage probability of dying from fall in pit.
#define CARRIED -1 // Player is toting it
#define READ_MODE "rb" // b is not needed for POSIX but harmless
#define WRITE_MODE "wb" // b is not needed for POSIX but harmless
#define CARRIED -1 // Player is toting it
#define READ_MODE "rb" // b is not needed for POSIX but harmless
#define WRITE_MODE "wb" // b is not needed for POSIX but harmless
diff --git
a/main.c
b/main.c
index acbabb65027cece7668515d90655fd065ad3cfc5..ef7d392c882fe416f5cd5fff683bd9456642e615 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-1069,7
+1069,7
@@
static bool do_move(void)
/* The easiest way to get killed is to fall into a pit in
* pitch darkness. */
/* The easiest way to get killed is to fall into a pit in
* pitch darkness. */
- if (!FORCED(game.loc) && DARK(game.loc) && game.wzdark && PCT(
35)) { // FIXME: magic number
+ if (!FORCED(game.loc) && DARK(game.loc) && game.wzdark && PCT(
PIT_KILL_PROB)) {
rspeak(PIT_FALL);
game.oldlc2 = game.loc;
croak();
rspeak(PIT_FALL);
game.oldlc2 = game.loc;
croak();