• R/O
  • SSH
  • HTTPS

junnethack: Commit


Commit MetaInfo

Revisión398 (tree)
Tiempo2011-03-13 15:39:24
Autorso-miya

Log Message

UnNetHack SVN版rev.761, 762を適用した。
r761
New dungeon feature: dead tree (from NetHack Brass)
新迷宮設備:枯れ木(NetHack brassより)

r762
Adjust checks for dead trees and trees
枯れ木林と林のチェックを修正

Cambiar Resumen

Diferencia incremental

--- junnethack/trunk/include/rm.h (revision 397)
+++ junnethack/trunk/include/rm.h (revision 398)
@@ -45,6 +45,7 @@
4545 TRWALL,
4646 DBWALL,
4747 TREE, /* KMH */
48+ DEADTREE, /* youkan */
4849 SDOOR,
4950 SCORR,
5051 POOL,
@@ -82,6 +83,8 @@
8283 #define IS_DOOR(typ) ((typ) == DOOR)
8384 #define IS_TREE(typ) ((typ) == TREE || \
8485 (level.flags.arboreal && (typ) == STONE))
86+#define IS_DEADTREE(typ) ((typ) == DEADTREE)
87+#define IS_TREES(typ) (IS_TREE(typ) || IS_DEADTREE(typ))
8588 #define ACCESSIBLE(typ) ((typ) >= DOOR) /* good position */
8689 #define IS_ROOM(typ) ((typ) >= ROOM) /* ROOM, STAIRS, furniture.. */
8790 #define ZAP_POS(typ) ((typ) >= POOL)
@@ -125,6 +128,7 @@
125128 S_hcdoor, /* closed door, horizontal wall */
126129 S_bars, /* KMH -- iron bars */
127130 S_tree, /* KMH */
131+ S_deadtree, /* youkan */
128132 S_room,
129133 S_darkroom,
130134 S_corr,
--- junnethack/trunk/src/display.c (revision 397)
+++ junnethack/trunk/src/display.c (revision 398)
@@ -1621,6 +1621,7 @@
16211621 break;
16221622 case IRONBARS: idx = S_bars; break;
16231623 case TREE: idx = S_tree; break;
1624+ case DEADTREE: idx = S_deadtree; break;
16241625 case POOL:
16251626 case MOAT: idx = S_pool; break;
16261627 case STAIRS:
@@ -1746,12 +1747,12 @@
17461747 "STONE", "VWALL", "HWALL", "TLCORNER",
17471748 "TRCORNER", "BLCORNER", "BRCORNER", "CROSSWALL",
17481749 "TUWALL", "TDWALL", "TLWALL", "TRWALL",
1749- "DBWALL", "SDOOR", "SCORR", "POOL",
1750- "MOAT", "WATER", "DRAWBRIDGE_UP","LAVAPOOL",
1751- "DOOR", "CORR", "ROOM", "STAIRS",
1752- "LADDER", "FOUNTAIN", "THRONE", "SINK",
1753- "ALTAR", "ICE", "DRAWBRIDGE_DOWN","AIR",
1754- "CLOUD"
1750+ "DBWALL", "TREE", "SDOOR", "SCORR",
1751+ "POOL", "MOAT", "WATER", "DRAWBRIDGE_UP",
1752+ "LAVAPOOL", "IRONBARS", "DEADTREE", "DOOR",
1753+ "CORR", "ROOM", "STAIRS", "LADDER",
1754+ "FOUNTAIN", "THRONE", "SINK", "ALTAR",
1755+ "ICE", "DRAWBRIDGE_DOWN","AIR", "CLOUD"
17551756 };
17561757
17571758
--- junnethack/trunk/src/drawing.c (revision 397)
+++ junnethack/trunk/src/drawing.c (revision 398)
@@ -239,6 +239,7 @@
239239 {'+', "closed door", C(CLR_BROWN)}, /* hcdoor */
240240 {'#', "iron bars", C(HI_METAL)}, /* bars */
241241 {'#', "tree", C(CLR_GREEN)}, /* tree */
242+ {'#', "dead tree", C(CLR_BLACK)}, /* dead tree */
242243 {'.', "floor of a room",C(CLR_GRAY)}, /* room */
243244 {'.', "dark part of a room",C(CLR_BLACK)}, /* dark room */
244245 /*20*/ {'#', "corridor", C(CLR_GRAY)}, /* dark corr */
@@ -356,6 +357,7 @@
356357 g_FILLER(S_hcdoor),
357358 240, /* S_bars: equivalence symbol */
358359 241, /* S_tree: plus or minus symbol */
360+ 241, /* S_deadtree: plus or minus symbol */
359361 0xfa, /* S_room: meta-z, centered dot */
360362 g_FILLER(S_stone), /* S_darkroom: meta-z, centered dot */
361363 /*20*/ 0xb0, /* S_corr: meta-0, light shading */
@@ -457,6 +459,7 @@
457459 g_FILLER(S_hcdoor),
458460 0xfb, /* S_bars: meta-{, small pi */
459461 0xe7, /* S_tree: meta-g, plus-or-minus */
462+ 0xe7, /* S_deadtree: meta-g, plus-or-minus */
460463 0xfe, /* S_room: meta-~, centered dot */
461464 g_FILLER(S_stone), /* S_darkroom: meta-~, centered dot */
462465 /*20*/ g_FILLER(S_corr),
@@ -555,6 +558,7 @@
555558 0xef, /* S_hcdoor */
556559 0xf0, /* S_bars: equivalency symbol */
557560 0xf1, /* S_tree: plus-or-minus */
561+ 0xf1, /* S_deadtree: plus-or-minus */
558562 g_FILLER(S_Room),
559563 g_FILLER(S_stone), /* S_darkroom */
560564 /*20*/ 0xB0, /* S_corr */
@@ -655,6 +659,7 @@
655659 g_FILLER(S_hcdoor),
656660 0x2261, /* S_bars: GREEK CAPITAL LETTER PI */
657661 0x03a8, /* S_tree: GREEK CAPITAL LETTER PSI */
662+ 0x03a8, /* S_deadtree: GREEK CAPITAL LETTER PSI */
658663 0x00b7, /* S_room: MIDDLE DOT */
659664 g_FILLER(S_stone), /* S_darkroom: meta-~, centered dot */
660665 g_FILLER(S_corr),
--- junnethack/trunk/src/dig.c (revision 397)
+++ junnethack/trunk/src/dig.c (revision 398)
@@ -157,7 +157,7 @@
157157 return (ispick && sobj_at(STATUE, x, y) ? DIGTYP_STATUE :
158158 ispick && sobj_at(BOULDER, x, y) ? DIGTYP_BOULDER :
159159 closed_door(x, y) ? DIGTYP_DOOR :
160- IS_TREE(levl[x][y].typ) ?
160+ IS_TREES(levl[x][y].typ) ?
161161 (ispick ? DIGTYP_UNDIGGABLE : DIGTYP_TREE) :
162162 ispick && IS_ROCK(levl[x][y].typ) &&
163163 (!level.flags.arboreal || IS_WALL(levl[x][y].typ)) ?
@@ -278,7 +278,7 @@
278278 if (digging.down) {
279279 if(!dig_check(BY_YOU, TRUE, u.ux, u.uy)) return(0);
280280 } else { /* !digging.down */
281- if (IS_TREE(lev->typ) && !may_dig(dpx,dpy) &&
281+ if (IS_TREES(lev->typ) && !may_dig(dpx,dpy) &&
282282 dig_typ(uwep, dpx, dpy) == DIGTYP_TREE) {
283283 /*JP
284284 pline("This tree seems to be petrified.");
@@ -349,6 +349,8 @@
349349 uwep->spe - greatest_erosion(uwep) + u.udaminc;
350350 if (Race_if(PM_DWARF))
351351 digging.effort *= 2;
352+ if (lev->typ == DEADTREE)
353+ digging.effort *= 2;
352354 if (digging.down) {
353355 register struct trap *ttmp;
354356
@@ -406,7 +408,7 @@
406408 */
407409 digtxt = "岩はこなごなになった。";
408410 } else if (lev->typ == STONE || lev->typ == SCORR ||
409- IS_TREE(lev->typ)) {
411+ IS_TREES(lev->typ)) {
410412 if(Is_earthlevel(&u.uz)) {
411413 if(uwep->blessed && !rn2(3)) {
412414 mkcavearea(FALSE);
@@ -417,7 +419,7 @@
417419 goto cleanup;
418420 }
419421 }
420- if (IS_TREE(lev->typ)) {
422+ if (IS_TREES(lev->typ)) {
421423 /*JP
422424 digtxt = "You cut down the tree.";
423425 */
@@ -1196,7 +1198,7 @@
11961198 */
11971199 pline("ガツン!");
11981200 wake_nearby();
1199- } else if (IS_TREE(lev->typ))
1201+ } else if (IS_TREES(lev->typ))
12001202 /*JP
12011203 You("need an axe to cut down a tree.");
12021204 */
--- junnethack/trunk/src/sp_lev.c (revision 397)
+++ junnethack/trunk/src/sp_lev.c (revision 398)
@@ -716,7 +716,7 @@
716716
717717 for(y = y1; y <= y2; y++)
718718 for(x = x1; x <= x2; x++)
719- if(IS_STWALL(levl[x][y].typ))
719+ if(IS_STWALL(levl[x][y].typ) || IS_TREES(levl[x][y].typ))
720720 levl[x][y].wall_info |= prop;
721721 }
722722
--- junnethack/trunk/src/invent.c (revision 397)
+++ junnethack/trunk/src/invent.c (revision 398)
@@ -2689,6 +2689,8 @@
26892689 dfeature = "set of iron bars";
26902690 */
26912691 dfeature = "鉄の棒";
2692+ else if (ltyp == DEADTREE)
2693+ cmap = S_deadtree;
26922694
26932695 #if 0 /*JP*/
26942696 if (cmap >= 0) dfeature = defsyms[cmap].explanation;
--- junnethack/trunk/src/dokick.c (revision 397)
+++ junnethack/trunk/src/dokick.c (revision 398)
@@ -822,6 +822,10 @@
822822 */
823823 else if (IS_ROCK(maploc->typ)) what = "岩";
824824 /*JP
825+ else if (IS_DEADTREE(maploc->typ)) what = "a dead tree";
826+*/
827+ else if (IS_DEADTREE(maploc->typ)) what = "枯れ木";
828+/*JP
825829 else if (IS_THRONE(maploc->typ)) what = "a throne";
826830 */
827831 else if (IS_THRONE(maploc->typ)) what = "玉座";
@@ -1298,6 +1302,39 @@
12981302 }
12991303 goto ouch;
13001304 }
1305+ if(IS_DEADTREE(maploc->typ)) {
1306+ if(Levitation) goto dumb;
1307+/*JP
1308+ You("kick %s.", Blind ? something : "the dead tree");
1309+*/
1310+ You("%sを蹴った。", Blind ? something : "枯れ木");
1311+ switch (rn2(4)) {
1312+ case 0: goto ouch;
1313+/*JP
1314+ case 1: pline("The tree is tottering...");
1315+*/
1316+ case 1: pline("木は揺れ動いた...");
1317+ break;
1318+/*JP
1319+ case 2: pline("Some branches are swinging...");
1320+*/
1321+ case 2: pline("枝が不気味に揺れた...");
1322+ break;
1323+ case 3: if (!may_dig(x,y)) goto ouch;
1324+/*JP
1325+ pline("The dead tree falls down.");
1326+*/
1327+ pline("枯れ木は倒壊した。");
1328+ maploc->typ = ROOM;
1329+ if (Blind)
1330+ feel_location(x,y); /* we know it's gone */
1331+ else
1332+ newsym(x,y);
1333+ unblock_point(x,y); /* vision */
1334+ break;
1335+ }
1336+ return(1);
1337+ }
13011338 #ifdef SINKS
13021339 if(IS_SINK(maploc->typ)) {
13031340 int gend = poly_gender();
--- junnethack/trunk/src/hack.c (revision 397)
+++ junnethack/trunk/src/hack.c (revision 398)
@@ -778,10 +778,10 @@
778778 if (!boulder && IS_ROCK(lev->typ) && !may_dig(x,y)) {
779779 #if 0 /*JP*/
780780 You("hurt your teeth on the %s.",
781- IS_TREE(lev->typ) ? "tree" : "hard stone");
781+ IS_TREES(lev->typ) ? "tree" : "hard stone");
782782 #else
783783 You("%sで歯を痛めた。",
784- IS_TREE(lev->typ) ? "木" : "固い岩");
784+ IS_TREES(lev->typ) ? "木" : "固い岩");
785785 #endif
786786 nomul(0, 0);
787787 return 1;
@@ -795,16 +795,16 @@
795795 assign_level(&digging.level, &u.uz);
796796 /* solid rock takes more work & time to dig through */
797797 digging.effort =
798- (IS_ROCK(lev->typ) && !IS_TREE(lev->typ) ? 30 : 60) + u.udaminc;
798+ (IS_ROCK(lev->typ) && !IS_TREES(lev->typ) ? 30 : 60) + u.udaminc;
799799 #if 0 /*JP*/
800800 You("start chewing %s %s.",
801- (boulder || IS_TREE(lev->typ)) ? "on a" : "a hole in the",
801+ (boulder || IS_TREES(lev->typ)) ? "on a" : "a hole in the",
802802 boulder ? "boulder" :
803803 IS_TREE(lev->typ) ? "tree" : IS_ROCK(lev->typ) ? "rock" : "door");
804804 #else
805805 You("%s%sはじめた。",
806806 boulder ? "岩" :
807- IS_TREE(lev->typ) ? "木" : IS_ROCK(lev->typ) ? "石" : "扉",
807+ IS_TREES(lev->typ) ? "木" : IS_ROCK(lev->typ) ? "石" : "扉",
808808 boulder ? "を噛み" : "に穴をあけ");
809809 #endif
810810 watch_dig((struct monst *)0, x, y, FALSE);
@@ -815,12 +815,12 @@
815815 You("%s chewing on the %s.",
816816 digging.chew ? "continue" : "begin",
817817 boulder ? "boulder" :
818- IS_TREE(lev->typ) ? "tree" :
818+ IS_TREES(lev->typ) ? "tree" :
819819 IS_ROCK(lev->typ) ? "rock" : "door");
820820 #else
821821 You("%sを噛み%s。",
822822 boulder ? "岩" :
823- IS_TREE(lev->typ) ? "木" :
823+ IS_TREES(lev->typ) ? "木" :
824824 IS_ROCK(lev->typ) ? "石" : "扉",
825825 digging.chew ? "続けた" : "はじめた");
826826 #endif
@@ -1034,7 +1034,7 @@
10341034 register xchar x,y;
10351035 /* intended to be called only on ROCKs */
10361036 {
1037- return (boolean)(!(IS_STWALL(levl[x][y].typ) &&
1037+ return (boolean)(!((IS_STWALL(levl[x][y].typ) || IS_TREES(levl[x][y].typ)) &&
10381038 (levl[x][y].wall_info & W_NONDIGGABLE)));
10391039 }
10401040
@@ -1042,7 +1042,7 @@
10421042 may_passwall(x,y)
10431043 register xchar x,y;
10441044 {
1045- return (boolean)(!(IS_STWALL(levl[x][y].typ) &&
1045+ return (boolean)(!((IS_STWALL(levl[x][y].typ) || IS_TREES(levl[x][y].typ)) &&
10461046 (levl[x][y].wall_info & W_NONPASSWALL)));
10471047 }
10481048
--- junnethack/trunk/src/objnam.c (revision 397)
+++ junnethack/trunk/src/objnam.c (revision 398)
@@ -3450,6 +3450,14 @@
34503450 return(&zeroobj);
34513451 }
34523452
3453+ if(!BSTRCMP(bp, p-9, "dead tree")) {
3454+ levl[u.ux][u.uy].typ = DEADTREE;
3455+ pline("A dead tree.");
3456+ newsym(u.ux, u.uy);
3457+ block_point(u.ux, u.uy);
3458+ return &zeroobj;
3459+ }
3460+
34533461 if(!BSTRCMP(bp, p-4, "tree")) {
34543462 levl[u.ux][u.uy].typ = TREE;
34553463 pline("A tree.");
--- junnethack/trunk/src/dothrow.c (revision 397)
+++ junnethack/trunk/src/dothrow.c (revision 398)
@@ -529,7 +529,7 @@
529529 pline("Ouch!");
530530 */
531531 pline("いてっ!");
532- if (IS_TREE(levl[x][y].typ))
532+ if (IS_TREES(levl[x][y].typ))
533533 /*JP
534534 s = "bumping into a tree";
535535 */
--- junnethack/trunk/src/apply.c (revision 397)
+++ junnethack/trunk/src/apply.c (revision 398)
@@ -2367,10 +2367,10 @@
23672367 if (!quietly)
23682368 #if 0 /*JP*/
23692369 You("cannot place a figurine in %s!",
2370- IS_TREE(levl[x][y].typ) ? "a tree" : "solid rock");
2370+ IS_TREES(levl[x][y].typ) ? "a tree" : "solid rock");
23712371 #else
23722372 pline("%sの中には人形を置けない!",
2373- IS_TREE(levl[x][y].typ) ? "木" : "固い石");
2373+ IS_TREES(levl[x][y].typ) ? "木" : "固い石");
23742374 #endif
23752375 return FALSE;
23762376 }
--- junnethack/trunk/src/zap.c (revision 397)
+++ junnethack/trunk/src/zap.c (revision 398)
@@ -4057,6 +4057,19 @@
40574057 nomul(0, 0);
40584058 }
40594059
4060+ if(lev->typ == TREE && abstype == ZT_DEATH && abs(type) != ZT_BREATH(ZT_DEATH)) {
4061+ lev->typ = DEADTREE;
4062+ if (cansee(sx,sy)) {
4063+/*JP
4064+ pline("The tree withers!");
4065+*/
4066+ pline("木は枯れた!");
4067+ newsym(sx,sy);
4068+ }
4069+ range = 0;
4070+ break;
4071+ }
4072+
40604073 if(!ZAP_POS(lev->typ) || (closed_door(sx, sy) && (range >= 0))) {
40614074 int bounce;
40624075 uchar rmn;
--- junnethack/trunk/ChangeLog (revision 397)
+++ junnethack/trunk/ChangeLog (revision 398)
@@ -9,6 +9,9 @@
99 - New category menu option: "Unidentified items"
1010 - 'X' toggles twoweaponing, explore mode is on alt-x resp. #xplore
1111
12+ * new dungeon features:
13+ - dead trees (from NetHack Brass)
14+
1215 * vanilla bug fixes:
1316 - C343-198
1417
--- junnethack/trunk/util/lev_main.c (revision 397)
+++ junnethack/trunk/util/lev_main.c (revision 398)
@@ -941,8 +941,9 @@
941941 case 'L' : return(LAVAPOOL);
942942 case 'I' : return(ICE);
943943 case 'W' : return(WATER);
944- case 'T' : return (TREE);
945- case 'F' : return (IRONBARS); /* Fe = iron */
944+ case 'T' : return(TREE);
945+ case 't' : return(DEADTREE);
946+ case 'F' : return(IRONBARS); /* Fe = iron */
946947 case 'x' : return(MAX_TYPE); /* 'see-through' */
947948 }
948949 return(INVALID_TYPE);
--- junnethack/trunk/util/lev_comp.l (revision 397)
+++ junnethack/trunk/util/lev_comp.l (revision 398)
@@ -104,7 +104,7 @@
104104 map_cnt = 0;
105105 return MAP_ID;
106106 }
107-<MAPC>[-|}{+xABCISHKPLWTF\\#. 0123456789]*\r?\n {
107+<MAPC>[-|}{+xABCISHKPLWTtF\\#. 0123456789]*\r?\n {
108108 int len = yyleng;
109109 /* convert \r\n to \n */
110110 if (len >= 2 && yytext[len - 2] == '\r') len -= 1;
Show on old repository browser