• R/O
  • SSH
  • HTTPS

xangband: コミット


コミットメタ情報

リビジョン1885 (tree)
日時2013-03-15 16:07:52
作者iks

ログメッセージ

Remove TINY_MAX_DEPTH macro and replace to MAX_DEPTH

変更サマリ

差分

--- TinyAngband/trunk/src/wizard2.c (revision 1884)
+++ TinyAngband/trunk/src/wizard2.c (revision 1885)
@@ -2103,7 +2103,7 @@
21032103 char tmp_val[160];
21042104
21052105 /* Prompt */
2106- sprintf(ppp, "Jump to level (0-%d): ", TINY_MAX_DEPTH-1);
2106+ sprintf(ppp, "Jump to level (0-%d): ", MAX_DEPTH-1);
21072107
21082108 /* Default */
21092109 sprintf(tmp_val, "%d", dun_level);
@@ -2119,7 +2119,7 @@
21192119 if (command_arg < 0) command_arg = 0;
21202120
21212121 /* Paranoia */
2122- if (command_arg > TINY_MAX_DEPTH - 1) command_arg = TINY_MAX_DEPTH - 1;
2122+ if (command_arg > MAX_DEPTH - 1) command_arg = MAX_DEPTH - 1;
21232123
21242124 /* Accept request */
21252125 msg_format("You jump to dungeon level %d.", command_arg);
--- TinyAngband/trunk/src/dungeon.c (revision 1884)
+++ TinyAngband/trunk/src/dungeon.c (revision 1885)
@@ -261,7 +261,7 @@
261261 static void pattern_teleport(void)
262262 {
263263 int min_level = 0;
264- int max_level = TINY_MAX_DEPTH - 1;
264+ int max_level = MAX_DEPTH - 1;
265265
266266 /* Ask for level */
267267 #ifdef JP
--- TinyAngband/trunk/src/spells3.c (revision 1884)
+++ TinyAngband/trunk/src/spells3.c (revision 1885)
@@ -522,7 +522,7 @@
522522 /* Leaving */
523523 p_ptr->leaving = TRUE;
524524 }
525- else if (quest_number(dun_level) || (dun_level >= TINY_MAX_DEPTH - 1))
525+ else if (quest_number(dun_level) || (dun_level >= MAX_DEPTH - 1))
526526 {
527527 #ifdef JP
528528 msg_print("あなたは天井を突き破って宙へ浮いていく。");
@@ -1582,7 +1582,7 @@
15821582 /* Town/wilderness or Ironman */
15831583 cave_set_feat(py, px, FEAT_MORE);
15841584 }
1585- else if (quest_number(dun_level) || (dun_level >= TINY_MAX_DEPTH - 1))
1585+ else if (quest_number(dun_level) || (dun_level >= MAX_DEPTH - 1))
15861586 {
15871587 /* Quest level */
15881588 cave_set_feat(py, px, FEAT_LESS);
--- TinyAngband/trunk/src/grid.c (revision 1884)
+++ TinyAngband/trunk/src/grid.c (revision 1885)
@@ -73,7 +73,7 @@
7373 up_stairs = FALSE;
7474
7575 /* Bottom */
76- if (dun_level >= TINY_MAX_DEPTH - 1)
76+ if (dun_level >= MAX_DEPTH - 1)
7777 down_stairs = FALSE;
7878
7979 /* Quest-level */
--- TinyAngband/trunk/src/defines.h (revision 1884)
+++ TinyAngband/trunk/src/defines.h (revision 1885)
@@ -258,10 +258,11 @@
258258 * involving object and monster creation. It must be at least 100.
259259 * Setting it below 128 may prevent the creation of some objects.
260260 */
261-#define MAX_DEPTH 128
262261 #ifdef TINYANGBAND
263-#define TINY_MAX_DEPTH 40
262+#define MAX_DEPTH 40
264263 #define MORGOTH_DEPTH 27
264+#else
265+#define MAX_DEPTH 128
265266 #endif
266267
267268
--- TinyAngband/trunk/src/object2.c (revision 1884)
+++ TinyAngband/trunk/src/object2.c (revision 1885)
@@ -1807,17 +1807,17 @@
18071807
18081808
18091809 /* Paranoia -- enforce maximal "level" */
1810- if (level > TINY_MAX_DEPTH - 1) level = TINY_MAX_DEPTH - 1;
1810+ if (level > MAX_DEPTH - 1) level = MAX_DEPTH - 1;
18111811
18121812
18131813 /* The "bonus" moves towards the max */
1814- bonus = ((max * level) / TINY_MAX_DEPTH);
1814+ bonus = ((max * level) / MAX_DEPTH);
18151815
18161816 /* Hack -- determine fraction of error */
1817- extra = ((max * level) % TINY_MAX_DEPTH);
1817+ extra = ((max * level) % MAX_DEPTH);
18181818
18191819 /* Hack -- simulate floating point computations */
1820- if (randint0(TINY_MAX_DEPTH) < extra) bonus++;
1820+ if (randint0(MAX_DEPTH) < extra) bonus++;
18211821
18221822
18231823 /* The "stand" is equal to one quarter of the max */
@@ -2260,7 +2260,7 @@
22602260 else if (power < -1)
22612261 {
22622262 /* Roll for ego-item */
2263- if ((randint0(TINY_MAX_DEPTH) < level) || (power < -2))
2263+ if ((randint0(MAX_DEPTH) < level) || (power < -2))
22642264 {
22652265 while (1)
22662266 {
@@ -2340,7 +2340,7 @@
23402340 else if (power < -1)
23412341 {
23422342 /* Roll for ego-item */
2343- if ((randint0(TINY_MAX_DEPTH) < level) || (power < -2))
2343+ if ((randint0(MAX_DEPTH) < level) || (power < -2))
23442344 {
23452345 o_ptr->name2 = get_random_ego(INVEN_AMMO, FALSE, level);
23462346 }
@@ -3361,7 +3361,7 @@
33613361 int i, rolls, f1, f2, power;
33623362
33633363 /* Maximum "level" for various things */
3364- if (lev > TINY_MAX_DEPTH - 1) lev = TINY_MAX_DEPTH - 1;
3364+ if (lev > MAX_DEPTH - 1) lev = MAX_DEPTH - 1;
33653365
33663366
33673367 /* Base chance of being "good" */
@@ -4492,7 +4492,7 @@
44924492 if (p_ptr->inside_arena || quest_number(dun_level)) continue;
44934493
44944494 /* Hack -- no trap doors on the deepest level */
4495- if (dun_level >= TINY_MAX_DEPTH-1) continue;
4495+ if (dun_level >= MAX_DEPTH-1) continue;
44964496
44974497 break;
44984498 }
--- TinyAngband/trunk/src/init1.c (revision 1884)
+++ TinyAngband/trunk/src/init1.c (revision 1885)
@@ -1441,24 +1441,26 @@
14411441 /* Process 'A' for "Allocation" (one line only) */
14421442 else if (buf[0] == 'A')
14431443 {
1444- int i;
1444+ int i, l;
14451445
14461446 /* XXX XXX XXX Simply read each number following a colon */
14471447 for (i = 0, s = buf+1; s && (s[0] == ':') && s[1]; ++i)
14481448 {
1449- /* Default chance */
1449+ /* Default chance */
14501450 k_ptr->chance[i] = 1;
14511451
1452- /* Store the attack damage index */
1453- k_ptr->locale[i] = atoi(s+1);
1452+ /* Store the attack damage index */
1453+ l = atoi(s+1);
1454+ if (l >= MAX_DEPTH) return (1);
1455+ k_ptr->locale[i] = l;
14541456
1455- /* Find the slash */
1457+ /* Find the slash */
14561458 t = my_strchr(s+1, '/');
14571459
1458- /* Find the next colon */
1460+ /* Find the next colon */
14591461 s = my_strchr(s+1, ':');
14601462
1461- /* If the slash is "nearby", use it */
1463+ /* If the slash is "nearby", use it */
14621464 if (t && (!s || t < s))
14631465 {
14641466 int chance = atoi(t+1);
--- TinyAngband/trunk/src/generate.c (revision 1884)
+++ TinyAngband/trunk/src/generate.c (revision 1885)
@@ -139,9 +139,9 @@
139139 if ((dun_level > 1) && quest_number(dun_level)) return TRUE;
140140
141141 /* No downstairs at the bottom */
142- if (dun_level >= TINY_MAX_DEPTH - 1) return TRUE;
142+ if (dun_level >= MAX_DEPTH - 1) return TRUE;
143143
144- if ((dun_level < TINY_MAX_DEPTH - 2) && !quest_number(dun_level + 1))
144+ if ((dun_level < MAX_DEPTH - 2) && !quest_number(dun_level + 1))
145145 more_num = (randint1(num) + 1) / 2;
146146 }
147147
@@ -694,7 +694,7 @@
694694 int feat1, feat2;
695695
696696 /* Choose water or lava */
697- if (randint1(TINY_MAX_DEPTH) - 1 > dun_level)
697+ if (randint1(MAX_DEPTH) - 1 > dun_level)
698698 {
699699 feat1 = FEAT_DEEP_WATER;
700700 feat2 = FEAT_SHAL_WATER;
旧リポジトリブラウザで表示