diff -c3 angband-/src/cave.c src/cave.c *** angband-/src/cave.c Sun Apr 14 08:46:22 1996 --- src/cave.c Tue Aug 20 16:50:54 1996 *************** *** 2968,2980 **** /* * Determine if a bolt spell cast from (y1,x1) to (y2,x2) will arrive * at the final destination, assuming no monster gets in the way. * * This is slightly (but significantly) different from "los(y1,x1,y2,x2)". */ bool projectable(int y1, int x1, int y2, int x2) { int dist, y, x; ! /* Start at the initial location */ y = y1, x = x1; --- 2968,2986 ---- /* * Determine if a bolt spell cast from (y1,x1) to (y2,x2) will arrive * at the final destination, assuming no monster gets in the way. + * WDT: if the bolt would arrive, BUT the player would never see it, + * return 2 instead of TRUE. This has the same effect, but gives a + * little more info to clued-in routines. * * This is slightly (but significantly) different from "los(y1,x1,y2,x2)". */ bool projectable(int y1, int x1, int y2, int x2) { int dist, y, x; ! #ifdef WDT_TRACK_OPTIONS ! int value = 2; /* start by assuming the player can't see. */ ! #endif ! /* Start at the initial location */ y = y1, x = x1; *************** *** 2984,2991 **** --- 2990,3004 ---- /* Never pass through walls */ if (dist && !floor_grid_bold(y, x)) break; + #ifdef WDT_TRACK_OPTIONS + if ( player_has_los_bold(y, x) ) value = TRUE; + + /* Check for arrival at "final target" */ + if ((x == x2) && (y == y2)) return value; + #else /* Check for arrival at "final target" */ if ((x == x2) && (y == y2)) return (TRUE); + #endif /* Calculate the new location */ mmove2(&y, &x, y1, x1, y2, x2); diff -c3 angband-/src/config.h src/config.h *** angband-/src/config.h Sat Apr 13 15:24:28 1996 --- src/config.h Tue Aug 20 14:47:14 1996 *************** *** 178,184 **** /* * OPTION: Hack -- Compile in support for "Wizard Commands" */ ! /* #define ALLOW_WIZARD */ /* * OPTION: Hack -- Compile in support for "Spoiler Generation" --- 178,184 ---- /* * OPTION: Hack -- Compile in support for "Wizard Commands" */ ! #define ALLOW_WIZARD /* * OPTION: Hack -- Compile in support for "Spoiler Generation" *************** *** 280,296 **** /* * Allow "Wizards" to yield "high scores" */ ! /* #define SCORE_WIZARDS */ /* * Allow "Borgs" to yield "high scores" */ ! /* #define SCORE_BORGS */ /* * Allow "Cheaters" to yield "high scores" */ ! /* #define SCORE_CHEATERS */ --- 280,296 ---- /* * Allow "Wizards" to yield "high scores" */ ! #define SCORE_WIZARDS /* * Allow "Borgs" to yield "high scores" */ ! #define SCORE_BORGS /* * Allow "Cheaters" to yield "high scores" */ ! #define SCORE_CHEATERS *************** *** 343,349 **** * the current version because it is being rewritten by Billy, and * until it is ready, it will not work. Do not define this option. */ ! /* #define WDT_TRACK_OPTIONS */ --- 343,349 ---- * the current version because it is being rewritten by Billy, and * until it is ready, it will not work. Do not define this option. */ ! #define WDT_TRACK_OPTIONS diff -c3 angband-/src/main-ibm.c src/main-ibm.c *** angband-/src/main-ibm.c Sat Apr 13 15:28:24 1996 --- src/main-ibm.c Mon Aug 19 18:40:26 1996 *************** *** 52,60 **** */ #define USE_VIRTUAL ! #include #include #ifdef USE_WAT --- 52,61 ---- */ #define USE_VIRTUAL ! #define delay I_DONT_WANT_THIS #include #include + #undef delay #ifdef USE_WAT *************** *** 1101,1106 **** --- 1102,1110 ---- term *t = &term_screen_body; union REGS r; + + /* Fix a faulty assumption about file mode */ + _fmode = O_BINARY; /* Check for "Windows" */ if (getenv("windir")) diff -c3 angband-/src/makefile.ibm src/makefile.ibm *** angband-/src/makefile.ibm Sat Apr 13 15:30:26 1996 --- src/makefile.ibm Tue Aug 20 14:46:12 1996 *************** *** 5,10 **** --- 5,13 ---- # Note: Rename to "Makefile" before using # Added extra targets: mrmarcel@eos.ncsu.edu (Mike Marcelais) + #BORG = borg1.o borg2.o borg3.o borg4.o borg5.o borg6.o \ + # borg7.o + OBJS = \ z-util.o z-virt.o z-form.o z-rand.o z-term.o \ variable.o tables.o util.o cave.o \ *************** *** 14,20 **** cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o \ store.o birth.o wizard1.o wizard2.o \ generate.o dungeon.o init1.o init2.o \ ! main-ibm.o main.o # Compiler --- 17,23 ---- cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o \ store.o birth.o wizard1.o wizard2.o \ generate.o dungeon.o init1.o init2.o \ ! main-ibm.o main.o $(BORG) # Compiler diff -c3 angband-/src/melee2.c src/melee2.c *** angband-/src/melee2.c Sat Apr 13 20:49:22 1996 --- src/melee2.c Tue Aug 20 17:04:10 1996 *************** *** 334,341 **** --- 334,355 ---- { int flg = PROJECT_STOP | PROJECT_KILL; + #ifdef WDT_TRACK_OPTIONS + monster_type *m_ptr = &m_list[m_idx]; + char x,y; + + if (track_target && m_ptr->t_dur) + { + x = m_ptr->tx; + y = m_ptr->ty; + } + else x = px, y = py; + /* Hit the target with a bolt attack */ + (void)project(m_idx, 0, m_ptr->ty, m_ptr->tx, dam_hp, typ, flg); + #else /* Target the player with a bolt attack */ (void)project(m_idx, 0, py, px, dam_hp, typ, flg); + #endif } *************** *** 346,352 **** */ static void breath(int m_idx, int typ, int dam_hp) { ! int rad; int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; --- 360,366 ---- */ static void breath(int m_idx, int typ, int dam_hp) { ! int rad,x,y; int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; *************** *** 356,361 **** --- 370,385 ---- /* Determine the radius of the blast */ rad = (r_ptr->flags2 & RF2_POWERFUL) ? 3 : 2; + #ifdef WDT_TRACK_OPTIONS + if (track_target && m_ptr->t_dur) + { + x = m_ptr->tx; + y = m_ptr->ty; + } + else x = px, y = py; + /* Target the player with a ball attack */ + (void)project(m_idx, rad, y, x, dam_hp, typ, flg); + #endif /* Target the player with a ball attack */ (void)project(m_idx, rad, py, px, dam_hp, typ, flg); } *************** *** 466,483 **** /* XXX XXX XXX Handle "track_target" option (?) */ ! ! /* Hack -- require projectable player */ ! if (normal) ! { ! /* Check range */ ! if (m_ptr->cdis > MAX_RANGE) return (FALSE); ! ! /* Check path */ ! if (!projectable(m_ptr->fy, m_ptr->fx, py, px)) return (FALSE); ! } ! /* Extract the monster level */ rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1); --- 490,521 ---- /* XXX XXX XXX Handle "track_target" option (?) */ + /* No longer a (?), Ben-- we'll see about the XXX es, though. :) + */ + #ifdef WDT_TRACK_OPTIONS + if (track_target && m_ptr->t_dur) + { + x = m_ptr->tx; + y = m_ptr->ty; + if ( x == px && y == py ) + direct = TRUE; + else direct = FALSE; + } + #endif ! /* Hack -- require projectable target and visible player */ ! /* Check range */ ! if (m_ptr->cdis > MAX_RANGE) return (FALSE); ! ! /* Check path */ ! normal = projectable(m_ptr->fy, m_ptr->fx, y, x); ! if ((direct && !normal) || normal == 2) ! { ! return (FALSE); ! } ! /* If there was no path to the target, or the path found was ! * lacking in certain respects (the player must be able to ! * see some part of the path), give up. */ /* Extract the monster level */ rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1); *************** *** 1825,1831 **** int y2 = py; int x2 = px; ! #ifdef MONSTER_FLOW /* Flow towards the player */ if (flow_by_sound) --- 1863,1875 ---- int y2 = py; int x2 = px; ! #ifdef WDT_TRACK_OPTIONS ! if (track_follow && m_ptr->t_dur) ! { ! x2 = m_ptr->tx; ! y2 = m_ptr->ty; ! } ! #endif #ifdef MONSTER_FLOW /* Flow towards the player */ if (flow_by_sound) *************** *** 2917,2923 **** /* Use up "some" energy */ m_ptr->energy -= 100; - /* Hack -- Require proximity */ if (m_ptr->cdis >= 100) continue; --- 2961,2966 ---- *************** *** 2966,2971 **** --- 3009,3039 ---- /* Do nothing */ if (!test) continue; + + #ifdef WDT_TRACK_OPTIONS + /* But if we can sense the player, take targetting + * into account */ + if (track_follow || track_target) + { + if (m_ptr->t_dur > 0) + m_ptr->t_dur--; + + /* HACK-- assume that if the player could see us, + * we could see them, and thus we could set the + * target. */ + if (player_has_los_bold(fy, fx)) + { + m_ptr->t_dur = r_ptr->aaf; + m_ptr->tx = px; + m_ptr->ty = py; + } + + /* if we've reached the same place as the player had been, + * stop searching. */ + if ( fy == m_ptr->ty && fx == m_ptr->tx ) + m_ptr->t_dur = 0; + } + #endif /* Process the monster */ process_monster(i);