Only in src-280: A-mac-h.c Only in src-280: A-mac-h.pch Only in src-280: A-win-h.pch Only in src-280: Makefile Only in src-280: Makefile.acn Only in src-280: Makefile.ami Only in src-280: Makefile.emx Only in src-280: Makefile.ibm Only in src-280: Makefile.lsl Only in src-280: Makefile.old Only in src-280: Makefile.wat Only in src-280: Makefile.win Only in src-280: angband.h diff -r src-280/birth.c mangband-000/src/server/birth.c 12a13,14 > #define SERVER > 43c45 < static birther prev; --- > /*static birther prev;*/ 290c292,293 < static void save_prev_data(void) --- > #if 0 > static void save_prev_data(int Ind) 291a295 > player_type *p_ptr = Players[Ind]; 313c317 < strcpy(prev.history[i], history[i]); --- > strcpy(prev.history[i], p_ptr->history[i]); 315a320 > #endif 321c326,327 < static void load_prev_data(void) --- > #if 0 > static void load_prev_data(int Ind) 322a329 > player_type *p_ptr = Players[Ind]; 346c353 < strcpy(temp.history[i], history[i]); --- > strcpy(temp.history[i], p_ptr->history[i]); 369c376 < strcpy(history[i], prev.history[i]); --- > strcpy(p_ptr->history[i], prev.history[i]); 393a401 > #endif 401c409,410 < static void choose_sex(void) --- > #if 0 > static void choose_sex(int Ind) 402a412 > player_type *p_ptr = Players[Ind]; 412c422 < c = inkey(); --- > c = inkey(Ind); 437a448 > #endif 443c454,455 < static void choose_race(void) --- > #if 0 > static void choose_race(int Ind) 444a457 > player_type *p_ptr = Players[Ind]; 473c486 < c = inkey(); --- > c = inkey(Ind); 494a508 > #endif 501c515,516 < static void choose_class(void) --- > #if 0 > static void choose_class(int Ind) 502a518 > player_type *p_ptr = Players[Ind]; 543c559 < c = inkey(); --- > c = inkey(Ind); 567a584 > #endif 579c596 < static int adjust_stat(int value, s16b amount, int auto_roll) --- > static int adjust_stat(int int value, s16b amount, int auto_roll) 580a598 > player_type *p_ptr = Players[Ind]; 645c663 < static void get_stats(void) --- > static void get_stats(int Ind) 646a665 > player_type *p_ptr = Players[Ind]; 709c728 < static void get_extra(void) --- > static void get_extra(int Ind) 710a730 > player_type *p_ptr = Players[Ind]; 736c756 < player_hp[0] = p_ptr->hitdie; --- > p_ptr->player_hp[0] = p_ptr->hitdie; 745c765 < player_hp[i] = player_hp[i-1] + j; --- > p_ptr->player_hp[i] = p_ptr->player_hp[i-1] + j; 751,752c771,772 < if (player_hp[PY_MAX_LEVEL-1] < min_value) continue; < if (player_hp[PY_MAX_LEVEL-1] > max_value) continue; --- > if (p_ptr->player_hp[PY_MAX_LEVEL-1] < min_value) continue; > if (p_ptr->player_hp[PY_MAX_LEVEL-1] > max_value) continue; 763c783 < static void get_history(void) --- > static void get_history(int Ind) 764a785 > player_type *p_ptr = Players[Ind]; 774c795 < for (i = 0; i < 4; i++) history[i][0] = '\0'; --- > for (i = 0; i < 4; i++) p_ptr->history[i][0] = '\0'; 899c920 < strcpy(history[i++], s); --- > strcpy(p_ptr->history[i++], s); 915c936 < strcpy(history[i++], s); --- > strcpy(p_ptr->history[i++], s); 926c947 < static void get_ahw(void) --- > static void get_ahw(int Ind) 927a949,950 > player_type *p_ptr = Players[Ind]; > 952c975 < static void get_money(void) --- > static void get_money(int Ind) 953a977 > player_type *p_ptr = Players[Ind]; 1025c1049 < static void player_wipe(void) --- > static void player_wipe(int Ind) 1026a1051,1052 > player_type *p_ptr = Players[Ind]; > object_type *old_inven; 1029a1056,1058 > /* Hack -- save the inventory pointer */ > old_inven = p_ptr->inventory; > 1032a1062,1064 > /* Hack -- reset the inventory pointer */ > p_ptr->inventory = old_inven; > 1036c1068 < strcpy(history[i], ""); --- > strcpy(p_ptr->history[i], ""); 1039d1070 < 1041c1072 < total_weight = 0; --- > p_ptr->total_weight = 0; 1044,1045c1075,1076 < inven_cnt = 0; < equip_cnt = 0; --- > p_ptr->inven_cnt = 0; > p_ptr->equip_cnt = 0; 1050c1081 < invwipe(&inventory[i]); --- > invwipe(&p_ptr->inventory[i]); 1054,1110d1084 < /* Start with no artifacts made yet */ < for (i = 0; i < MAX_A_IDX; i++) < { < artifact_type *a_ptr = &a_info[i]; < a_ptr->cur_num = 0; < } < < < /* Start with no quests */ < for (i = 0; i < MAX_Q_IDX; i++) < { < q_list[i].level = 0; < } < < /* Add a special quest */ < q_list[0].level = 99; < < /* Add a second quest */ < q_list[1].level = 100; < < < /* Reset the "objects" */ < for (i = 1; i < MAX_K_IDX; i++) < { < object_kind *k_ptr = &k_info[i]; < < /* Reset "tried" */ < k_ptr->tried = FALSE; < < /* Reset "aware" */ < k_ptr->aware = FALSE; < } < < < /* Reset the "monsters" */ < for (i = 1; i < MAX_R_IDX; i++) < { < monster_race *r_ptr = &r_info[i]; < < /* Hack -- Reset the counter */ < r_ptr->cur_num = 0; < < /* Hack -- Reset the max counter */ < r_ptr->max_num = 100; < < /* Hack -- Reset the max counter */ < if (r_ptr->flags1 & RF1_UNIQUE) r_ptr->max_num = 1; < < /* Clear player kills */ < r_ptr->r_pkills = 0; < } < < < /* Hack -- no ghosts */ < r_info[MAX_R_IDX-1].max_num = 0; < < 1116,1119c1090,1093 < spell_learned1 = spell_learned2 = 0L; < spell_worked1 = spell_worked2 = 0L; < spell_forgotten1 = spell_forgotten2 = 0L; < for (i = 0; i < 64; i++) spell_order[i] = 99; --- > p_ptr->spell_learned1 = p_ptr->spell_learned2 = 0L; > p_ptr->spell_worked1 = p_ptr->spell_worked2 = 0L; > p_ptr->spell_forgotten1 = p_ptr->spell_forgotten2 = 0L; > for (i = 0; i < 64; i++) p_ptr->spell_order[i] = 99; 1131c1105 < total_winner = FALSE; --- > p_ptr->total_winner = FALSE; 1137c1111 < noscore = 0; --- > p_ptr->noscore = 0; 1200c1174 < static void player_outfit(void) --- > static void player_outfit(int Ind) 1201a1176 > player_type *p_ptr = Players[Ind]; 1234a1210,1213 > static void player_location(int Ind) > { > player_type *p_ptr = Players[Ind]; > int y, x, i, d; 1235a1215,1220 > /* Memorize the town */ > for (y = 0; y < SCREEN_HGT; y++) > { > for (x = 0; x < SCREEN_WID; x++) > { > byte *w_ptr = &p_ptr->cave_flag[y][x]; 1236a1222,1297 > *w_ptr |= CAVE_MARK; > } > } > > /* Place the player correctly in the town */ > for (i = 0; i < 35; i++) > { > d = (i + 4) / 35; > > /* Pick a location */ > scatter(0, &y, &x, level_start_y[0], level_start_x[0], d, 0); > > if (!cave_naked_bold(0, y, x)) continue; > > break; > } > > #ifdef 0 > while (TRUE) > { > p_ptr->px = rand_range(3, SCREEN_WID - 4); > p_ptr->py = rand_range(3, SCREEN_HGT - 4); > > /* Require a "naked" floor grid */ > if (cave_naked_bold(0, p_ptr->py, p_ptr->px)) break; > } > #endif > > /* Set the player's location */ > p_ptr->py = y; > p_ptr->px = x; > > /* Update the location's player index */ > cave[0][p_ptr->py][p_ptr->px].p_idx = Ind; > > /* Show him to everybody */ > everyone_lite_spot(0, p_ptr->py, p_ptr->px); > > /* Set his "current activities" variables */ > p_ptr->current_spell = p_ptr->current_rod = p_ptr->current_activation = -1; > > /* Set the player's "panel" information */ > p_ptr->max_panel_rows = 0; > p_ptr->max_panel_cols = 0; > > p_ptr->panel_row = p_ptr->max_panel_rows; > p_ptr->panel_col = p_ptr->max_panel_cols; > > p_ptr->cur_hgt = SCREEN_HGT; > p_ptr->cur_wid = SCREEN_WID; > > /* Set the rest of the panel information */ > panel_bounds(Ind); > > /* Update the players on each depth info */ > players_on_depth[0]++; > > /* Tell the server to redraw the player's display */ > p_ptr->redraw |= PR_MAP; > p_ptr->redraw |= PR_BASIC; > > /* Update his bonuses and torch radius */ > p_ptr->update |= (PU_BONUS | PU_TORCH); > > /* Update his inventory, equipment, and spell info */ > p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL); > > /* This guy is alive now */ > p_ptr->alive = TRUE; > > /* Update his viewing area */ > update_view(Ind); > } > > > 1247c1308 < void player_birth(void) --- > bool player_birth(int cptr name, cptr pass, int conn, int race, int class, int sex) 1249c1310 < int n, i; --- > player_type *p_ptr; 1253,1254d1313 < bool flag; < 1258d1316 < char buf[80]; 1259a1318 > MAKE(Players[Ind], player_type); 1261c1320 < start_over: --- > C_MAKE(Players[Ind]->inventory, INVEN_TOTAL, object_type); 1262a1322,1323 > if (Players[Ind]->inventory == NULL) > quit("ERROR: Player inventory pointer is NULL!"); 1263a1325,1326 > p_ptr = Players[Ind]; > 1265c1328 < player_wipe(); --- > player_wipe(Ind); 1266a1330,1337 > /* Copy his name and connection info */ > strcpy(p_ptr->name, name); > strcpy(p_ptr->pass, pass); > p_ptr->conn = conn; > > /* Verify his name and create a savefile name */ > process_player_name(TRUE); > 1270a1342,1343 > /* Attempt to load from a savefile */ > character_loaded = FALSE; 1271a1345,1379 > if (!load_player(Ind)) > { > /* Loading failed badly */ > return FALSE; > } > > if (character_loaded) > { > /* Loading succeeded */ > player_location(Ind); > return TRUE; > } > > /* Else, loading failed, but we just create a new character */ > > /* Hack -- rewipe the player info if load failed */ > player_wipe(Ind); > > /* Copy his name and connection info */ > strcpy(p_ptr->name, name); > strcpy(p_ptr->pass, pass); > p_ptr->conn = conn; > > /* Reprocess his name */ > process_player_name(TRUE); > > p_ptr->prace = race; > p_ptr->pclass = class; > p_ptr->male = sex; > > rp_ptr = &race_info[race]; > cp_ptr = &class_info[class]; > mp_ptr = &magic_info[class]; > > #if 0 1282c1390 < c_put_str(TERM_L_BLUE, player_name, 2, 15); --- > c_put_str(TERM_L_BLUE, p_ptr->name, 2, 15); 1289c1397 < choose_sex(); --- > choose_sex(Ind); 1293c1401 < choose_race(); --- > choose_race(Ind); 1297c1405 < choose_class(); --- > choose_class(Ind); 1304c1412 < c = inkey(); --- > c = inkey(Ind); 1324c1432 < c = inkey(); --- > c = inkey(Ind); 1337a1446 > #endif 1346c1455 < c = inkey(); --- > c = inkey(Ind); 1565c1674 < if (inkey()) break; --- > if (inkey(Ind)) break; 1575c1684 < get_stats(); --- > get_stats(Ind); 1583c1692 < get_extra(); --- > get_extra(Ind); 1586c1695 < get_ahw(); --- > get_ahw(Ind); 1589c1698 < get_history(); --- > get_history(Ind); 1592c1701 < get_money(); --- > get_money(Ind); 1593a1703 > #if 0 1598c1708 < p_ptr->update |= (PU_BONUS | PU_HP); --- > /*p_ptr->update |= (PU_BONUS | PU_HP);*/ 1601c1711 < update_stuff(); --- > /*update_stuff(Ind);*/ 1604c1714 < display_player(use_history); --- > /*display_player(use_history);*/ 1615c1725 < c = inkey(); --- > c = inkey(Ind); 1626c1736 < load_prev_data(); --- > load_prev_data(Ind); 1652a1763 > #endif 1656a1768 > #if 0 1658c1770,1771 < save_prev_data(); --- > save_prev_data(Ind); > #endif 1661a1775,1777 > > /* We're always done */ > break; 1663a1780 > #if 0 1669c1786 < get_name(); --- > get_name(Ind); 1675c1792 < c = inkey(); --- > c = inkey(Ind); 1690a1808 > #endif 1693c1811 < player_outfit(); --- > player_outfit(Ind); 1694a1813,1814 > /* Set his location, panel, etc. */ > player_location(Ind); 1696,1707c1816,1817 < /* Shops */ < for (n = 0; n < MAX_STORES; n++) < { < /* Initialize */ < store_init(n); < < /* Ignore home */ < if (n == MAX_STORES - 1) continue; < < /* Maintain the shop (ten times) */ < for (i = 0; i < 10; i++) store_maint(n); < } --- > /* Success */ > return TRUE; diff -r src-280/cave.c mangband-000/src/server/cave.c 4a5 > #define SERVER 71c72 < bool los(int y1, int x1, int y2, int x2) --- > bool los(int Depth, int y1, int x1, int y2, int x2) 120c121 < if (!cave_floor_bold(ty, x1)) return (FALSE); --- > if (!cave_floor_bold(Depth, ty, x1)) return (FALSE); 129c130 < if (!cave_floor_bold(ty, x1)) return (FALSE); --- > if (!cave_floor_bold(Depth, ty, x1)) return (FALSE); 145c146 < if (!cave_floor_bold(y1, tx)) return (FALSE); --- > if (!cave_floor_bold(Depth, y1, tx)) return (FALSE); 154c155 < if (!cave_floor_bold(y1, tx)) return (FALSE); --- > if (!cave_floor_bold(Depth, y1, tx)) return (FALSE); 173c174 < if (cave_floor_bold(y1 + sy, x1)) return (TRUE); --- > if (cave_floor_bold(Depth, y1 + sy, x1)) return (TRUE); 182c183 < if (cave_floor_bold(y1, x1 + sx)) return (TRUE); --- > if (cave_floor_bold(Depth, y1, x1 + sx)) return (TRUE); 218c219 < if (!cave_floor_bold(ty, tx)) return (FALSE); --- > if (!cave_floor_bold(Depth, ty, tx)) return (FALSE); 229c230 < if (!cave_floor_bold(ty, tx)) return (FALSE); --- > if (!cave_floor_bold(Depth, ty, tx)) return (FALSE); 265c266 < if (!cave_floor_bold(ty, tx)) return (FALSE); --- > if (!cave_floor_bold(Depth, ty, tx)) return (FALSE); 276c277 < if (!cave_floor_bold(ty, tx)) return (FALSE); --- > if (!cave_floor_bold(Depth, ty, tx)) return (FALSE); 330c331 < bool player_can_see_bold(int y, int x) --- > bool player_can_see_bold(int int y, int x) 331a333,334 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 334a338 > byte *w_ptr; 340c344,345 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; > w_ptr = &p_ptr->cave_flag[y][x]; 343c348 < if (c_ptr->info & CAVE_LITE) return (TRUE); --- > if (*w_ptr & CAVE_LITE) return (TRUE); 352c357 < if (cave_floor_bold(y, x)) return (TRUE); --- > if (cave_floor_bold(Depth, y, x)) return (TRUE); 355,356c360,361 < yy = (y < py) ? (y + 1) : (y > py) ? (y - 1) : y; < xx = (x < px) ? (x + 1) : (x > px) ? (x - 1) : x; --- > yy = (y < p_ptr->py) ? (y + 1) : (y > p_ptr->py) ? (y - 1) : y; > xx = (x < p_ptr->px) ? (x + 1) : (x > p_ptr->px) ? (x - 1) : x; 359c364 < if (cave[yy][xx].info & CAVE_GLOW) --- > if (cave[Depth][yy][xx].info & CAVE_GLOW) 374c379 < bool no_lite(void) --- > bool no_lite(int Ind) 376c381,382 < return (!player_can_see_bold(py, px)); --- > player_type *p_ptr = Players[Ind]; > return (!player_can_see_bold(p_ptr->py, p_ptr->px)); 391c397 < "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; --- > "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 447a454,459 > /* > * Return the correct "color" of another player > */ > static byte player_color(int Ind) > { > player_type *p_ptr = Players[Ind]; 448a461,486 > if (!strcmp(Players[Ind]->name, "BEAST")) > { > return (randint(14) + 1); > } > > switch (p_ptr->pclass) > { > case CLASS_WARRIOR: > return TERM_UMBER; > case CLASS_MAGE: > return TERM_RED; > case CLASS_PRIEST: > return TERM_GREEN; > case CLASS_ROGUE: > return TERM_BLUE; > case CLASS_RANGER: > return TERM_L_WHITE; > case CLASS_PALADIN: > return TERM_L_BLUE; > } > > /* Oops */ > return TERM_WHITE; > } > > 570c608 < void map_info(int y, int x, byte *ap, char *cp) --- > void map_info(int int y, int x, byte *ap, char *cp) 571a610,612 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 572a614 > byte *w_ptr; 583c625,626 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; > w_ptr = &p_ptr->cave_flag[y][x]; 593,594c636,637 < if ((c_ptr->info & CAVE_MARK) || < (((c_ptr->info & CAVE_LITE) || --- > if ((*w_ptr & CAVE_MARK) || > (((*w_ptr & CAVE_LITE) || 596c639 < (c_ptr->info & CAVE_VIEW))) && --- > (*w_ptr & CAVE_VIEW))) && 603c646 < (*cp) = f_ptr->z_char; --- > (*cp) = f_ptr->f_char; 606c649 < a = f_ptr->z_attr; --- > a = f_ptr->f_attr; 609c652 < if (view_special_lite && (a == TERM_WHITE)) --- > if (/*view_special_lite && */(a == TERM_WHITE)) 619c662 < else if (c_ptr->info & CAVE_LITE) --- > else if (*w_ptr & CAVE_LITE) 622c665 < if (view_yellow_lite) --- > if (/*view_yellow_lite*/ TRUE) 637c680 < else if (!(c_ptr->info & CAVE_VIEW)) --- > else if (!(*w_ptr & CAVE_VIEW)) 659c702 < (*ap) = f_ptr->z_attr; --- > (*ap) = f_ptr->f_attr; 662c705 < (*cp) = f_ptr->z_char; --- > (*cp) = f_ptr->f_char; 670c713 < if (c_ptr->info & CAVE_MARK) --- > if (*w_ptr & CAVE_MARK) 679c722 < (*cp) = f_ptr->z_char; --- > (*cp) = f_ptr->f_char; 682c725 < a = f_ptr->z_attr; --- > a = f_ptr->f_attr; 695c738 < else if (c_ptr->info & CAVE_LITE) --- > else if (*w_ptr & CAVE_LITE) 709c752 < if (!(c_ptr->info & CAVE_VIEW)) --- > if (!(*w_ptr & CAVE_VIEW)) 728,729c771,772 < yy = (y < py) ? (y + 1) : (y > py) ? (y - 1) : y; < xx = (x < px) ? (x + 1) : (x > px) ? (x - 1) : x; --- > yy = (y < p_ptr->py) ? (y + 1) : (y > p_ptr->py) ? (y - 1) : y; > xx = (x < p_ptr->px) ? (x + 1) : (x > p_ptr->px) ? (x - 1) : x; 732c775 < if (!(cave[yy][xx].info & CAVE_GLOW)) --- > if (!(cave[Depth][yy][xx].info & CAVE_GLOW)) 752c795 < (*ap) = f_ptr->z_attr; --- > (*ap) = f_ptr->f_attr; 755c798 < (*cp) = f_ptr->z_char; --- > (*cp) = f_ptr->f_char; 774c817 < if (o_ptr->marked) --- > if (p_ptr->obj_vis[c_ptr->o_idx]) 794c837 < if (m_ptr->ml) --- > if (p_ptr->mon_vis[c_ptr->m_idx]) 879a923,949 > > if (c_ptr->p_idx) > { > int p2x, p2y; > > /* Second player's location */ > p2x = Players[c_ptr->p_idx]->px; > p2y = Players[c_ptr->p_idx]->py; > > /* Is that player visible? */ > if (player_has_los_bold(p2y, p2x) || p_ptr->telepathy) > { > c = '@'; > > a = player_color(c_ptr->p_idx); > > (*cp) = c; > > (*ap) = a; > > if (p_ptr->image) > { > /* Change the other player into a hallucination */ > image_monster(ap, cp); > } > } > } 885a956,957 > * > * Don't like this --KLJ-- 890,891c962,963 < row -= panel_row_prt; < col -= panel_col_prt; --- > /*row -= panel_row_prt; > col -= panel_col_prt;*/ 894c966 < Term_gotoxy(col, row); --- > /*Term_gotoxy(col, row);*/ 900a973,974 > * > * Don't like this either --KLJ-- 905,906c979,980 < if (panel_contains(y, x)) < { --- > /*if (panel_contains(y, x)) > {*/ 908c982 < if (!use_color) a = TERM_WHITE; --- > /* if (!use_color) a = TERM_WHITE;*/ 911,912c985,986 < Term_draw(x-panel_col_prt, y-panel_row_prt, a, c); < } --- > /*Term_draw(x-panel_col_prt, y-panel_row_prt, a, c); > }*/ 944c1018 < void note_spot(int y, int x) --- > void note_spot(int int y, int x) 946c1020,1023 < cave_type *c_ptr = &cave[y][x]; --- > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > cave_type *c_ptr = &cave[Depth][y][x]; > byte *w_ptr = &p_ptr->cave_flag[y][x]; 952,953d1028 < object_type *o_ptr = &o_list[c_ptr->o_idx]; < 955c1030 < if (!(o_ptr->marked)) --- > if (!(p_ptr->obj_vis[c_ptr->o_idx])) 961c1036,1037 < o_ptr->marked = TRUE; --- > p_ptr->obj_vis[c_ptr->o_idx] = TRUE; > 968c1044 < if (!(c_ptr->info & CAVE_MARK)) --- > if (!(*w_ptr & CAVE_MARK)) 977c1053 < c_ptr->info |= CAVE_MARK; --- > *w_ptr |= CAVE_MARK; 984c1060 < c_ptr->info |= CAVE_MARK; --- > *w_ptr |= CAVE_MARK; 991c1067 < c_ptr->info |= CAVE_MARK; --- > *w_ptr |= CAVE_MARK; 997a1074,1109 > void note_spot_depth(int Depth, int y, int x) > { > int i; > > for (i = 1; i < NumPlayers + 1; i++) > { > if (Players[i]->conn == NOT_CONNECTED) > continue; > > if (Players[i]->dun_depth == Depth) > { > note_spot(i, y, x); > } > } > } > > void everyone_lite_spot(int Depth, int y, int x) > { > int i; > > /* Check everyone */ > for (i = 1; i < NumPlayers + 1; i++) > { > /* If he's not playing, skip him */ > if (Players[i]->conn == NOT_CONNECTED) > continue; > > /* If he's not here, skip him */ > if (Players[i]->dun_depth != Depth) > continue; > > /* Actually lite that spot for that player */ > lite_spot(i, y, x); > } > } > 998a1111,1133 > * Wipe the "CAVE_MARK" bit in everyone's array > */ > void everyone_forget_spot(int Depth, int y, int x) > { > int i; > > /* Check everyone */ > for (i = 1; i < NumPlayers + 1; i++) > { > /* If he's not playing, skip him */ > if (Players[i]->conn == NOT_CONNECTED) > continue; > > /* If he's not here, skip him */ > if (Players[i]->dun_depth != Depth) > continue; > > /* Forget the spot */ > Players[i]->cave_flag[y][x] &= ~CAVE_MARK; > } > } > > /* 1001c1136 < void lite_spot(int y, int x) --- > void lite_spot(int int y, int x) 1002a1138,1141 > player_type *p_ptr = Players[Ind]; > > int dispx, dispy; > 1010c1149 < if ((y == py) && (x == px)) --- > if ((y == p_ptr->py) && (x == p_ptr->px)) 1015c1154 < a = r_ptr->x_attr; --- > a = r_ptr->d_attr; 1018c1157 < c = r_ptr->x_char; --- > c = r_ptr->d_char; 1030a1170,1172 > dispx = x - p_ptr->panel_col_prt; > dispy = y - p_ptr->panel_row_prt; > 1032c1174,1186 < Term_draw(x-panel_col_prt, y-panel_row_prt, a, c); --- > /*Term_draw(x-panel_col_prt, y-panel_row_prt, a, c);*/ > if (p_ptr->scr_info[dispy][dispx].c != c || p_ptr->scr_info[dispy][dispx].a != a || (x == p_ptr->px && y==p_ptr->py)) > { > if (dispx < 0 || dispx > 80) > printf("dispx = %d.\n", dispx); > if (dispy < 0 || dispy > 25) > printf("dispy = %d.\n", dispy); > > p_ptr->scr_info[dispy][dispx].c = c; > p_ptr->scr_info[dispy][dispx].a = a; > > (void)Send_char(dispx, dispy, a, c); > } 1046c1200 < void prt_map(void) --- > void prt_map(int Ind) 1047a1202,1203 > player_type *p_ptr = Players[Ind]; > 1048a1205 > int dispx, dispy; 1050,1051d1206 < int v; < 1053c1208 < (void)Term_get_cursor(&v); --- > /*(void)Term_get_cursor(&v);*/ 1056c1211 < (void)Term_set_cursor(0); --- > /*(void)Term_set_cursor(0);*/ 1059c1214 < for (y = panel_row_min; y <= panel_row_max; y++) --- > for (y = p_ptr->panel_row_min; y <= p_ptr->panel_row_max; y++) 1062c1217 < for (x = panel_col_min; x <= panel_col_max; x++) --- > for (x = p_ptr->panel_col_min; x <= p_ptr->panel_col_max; x++) 1072a1228,1230 > dispx = x - p_ptr->panel_col_prt; > dispy = y - p_ptr->panel_row_prt; > 1074c1232,1238 < Term_draw(x-panel_col_prt, y-panel_row_prt, a, c); --- > if (p_ptr->scr_info[dispy][dispx].c != c || p_ptr->scr_info[dispy][dispx].a != a) > { > p_ptr->scr_info[dispy][dispx].c = c; > p_ptr->scr_info[dispy][dispx].a = a; > > (void)Send_char(dispx, dispy, a, c); > } 1079c1243 < lite_spot(py, px); --- > lite_spot(p_ptr->py, p_ptr->px); 1082c1246 < (void)Term_set_cursor(v); --- > /*(void)Term_set_cursor(v);*/ 1191c1355 < void display_map(int *cy, int *cx) --- > void display_map(int int *cy, int *cx) 1192a1357,1358 > player_type *p_ptr = Players[Ind]; > 1233c1399 < for (i = 0; i < cur_wid; ++i) --- > for (i = 0; i < p_ptr->cur_wid; ++i) 1235c1401 < for (j = 0; j < cur_hgt; ++j) --- > for (j = 0; j < p_ptr->cur_hgt; ++j) 1281c1447 < Term_gotoxy(0, y); --- > /*Term_gotoxy(0, y);*/ 1293c1459,1467 < Term_addch(ta, tc); --- > /* Efficiency -- Redraw that grid of the map */ > > if (p_ptr->scr_info[y][x].c != tc || p_ptr->scr_info[y][x].a != ta) > { > p_ptr->scr_info[y][x].c = tc; > p_ptr->scr_info[y][x].a = ta; > > (void)Send_char(x, y, ta, tc); > } 1299,1300c1473,1474 < (*cy) = py / RATIO + 1; < (*cx) = px / RATIO + 1; --- > (*cy) = p_ptr->py / RATIO + 1; > (*cx) = p_ptr->px / RATIO + 1; 1314c1488 < void do_cmd_view_map(void) --- > void do_cmd_view_map(int Ind) 1315a1490 > player_type *p_ptr = Players[Ind]; 1319c1494 < character_icky = TRUE; --- > /*character_icky = TRUE;*/ 1322c1497 < Term_save(); --- > /*Term_save();*/ 1325c1500 < prt("Please wait...", 0, 0); --- > /*prt("Please wait...", 0, 0);*/ 1328c1503 < Term_fresh(); --- > /*Term_fresh();*/ 1331c1506 < Term_clear(); --- > /*Term_clear();*/ 1337c1512 < put_str("Hit any key to continue", 23, 23); --- > /*put_str("Hit any key to continue", 23, 23);*/ 1358c1533,1539 < Term_draw(cx, cy, a, c); --- > if (p_ptr->scr_info[cy][cx].c != c || p_ptr->scr_info[cy][cx].a != a) > { > p_ptr->scr_info[cy][cx].c = c; > p_ptr->scr_info[cy][cx].a = a; > > (void)Send_char(cx, cy, a, c); > } 1362c1543 < move_cursor(cy, cx); --- > /*move_cursor(cy, cx);*/ 1365c1546 < inkey(); --- > /*inkey();*/ 1368c1549 < Term_load(); --- > /*Term_load();*/ 1371c1552 < character_icky = FALSE; --- > /*character_icky = FALSE;*/ 1599c1780 < void forget_lite(void) --- > void forget_lite(int Ind) 1600a1782,1784 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 1604c1788 < if (!lite_n) return; --- > if (!(p_ptr->lite_n)) return; 1607c1791 < for (i = 0; i < lite_n; i++) --- > for (i = 0; i < p_ptr->lite_n; i++) 1609,1610c1793,1794 < y = lite_y[i]; < x = lite_x[i]; --- > y = p_ptr->lite_y[i]; > x = p_ptr->lite_x[i]; 1613c1797 < cave[y][x].info &= ~CAVE_LITE; --- > p_ptr->cave_flag[y][x] &= ~CAVE_LITE; 1616c1800 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 1620c1804 < lite_n = 0; --- > p_ptr->lite_n = 0; 1630a1815,1818 > * > * Note that I'm assuming that we can use "p_ptr", because this macro > * should only be called from functions that have it defined at the > * top. --KLJ-- 1633,1636c1821,1824 < cave[Y][X].info |= CAVE_LITE; \ < lite_y[lite_n] = (Y); \ < lite_x[lite_n] = (X); \ < lite_n++ --- > p_ptr->cave_flag[Y][X] |= CAVE_LITE; \ > p_ptr->lite_y[p_ptr->lite_n] = (Y); \ > p_ptr->lite_x[p_ptr->lite_n] = (X); \ > p_ptr->lite_n++ 1667c1855 < void update_lite(void) --- > void update_lite(int Ind) 1668a1857,1858 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 1678c1868 < forget_lite(); --- > forget_lite(Ind); 1681c1871 < lite_spot(py, px); --- > lite_spot(p_ptr->py, p_ptr->px); 1691c1881 < for (i = 0; i < lite_n; i++) --- > for (i = 0; i < p_ptr->lite_n; i++) 1693,1694c1883,1884 < y = lite_y[i]; < x = lite_x[i]; --- > y = p_ptr->lite_y[i]; > x = p_ptr->lite_x[i]; 1697c1887 < cave[y][x].info &= ~CAVE_LITE; --- > p_ptr->cave_flag[y][x] &= ~CAVE_LITE; 1700c1890 < cave[y][x].info |= CAVE_TEMP; --- > cave[Depth][y][x].info |= CAVE_TEMP; 1703,1705c1893,1895 < temp_y[temp_n] = y; < temp_x[temp_n] = x; < temp_n++; --- > p_ptr->temp_y[p_ptr->temp_n] = y; > p_ptr->temp_x[p_ptr->temp_n] = x; > p_ptr->temp_n++; 1709c1899 < lite_n = 0; --- > p_ptr->lite_n = 0; 1715c1905 < cave_lite_hack(py, px); --- > cave_lite_hack(p_ptr->py, p_ptr->px); 1721,1724c1911,1914 < cave_lite_hack(py+1, px); < cave_lite_hack(py-1, px); < cave_lite_hack(py, px+1); < cave_lite_hack(py, px-1); --- > cave_lite_hack(p_ptr->py+1, p_ptr->px); > cave_lite_hack(p_ptr->py-1, p_ptr->px); > cave_lite_hack(p_ptr->py, p_ptr->px+1); > cave_lite_hack(p_ptr->py, p_ptr->px-1); 1727,1730c1917,1920 < cave_lite_hack(py+1, px+1); < cave_lite_hack(py+1, px-1); < cave_lite_hack(py-1, px+1); < cave_lite_hack(py-1, px-1); --- > cave_lite_hack(p_ptr->py+1, p_ptr->px+1); > cave_lite_hack(p_ptr->py+1, p_ptr->px-1); > cave_lite_hack(p_ptr->py-1, p_ptr->px+1); > cave_lite_hack(p_ptr->py-1, p_ptr->px-1); 1737c1927 < if (cave_floor_bold(py+1, px)) --- > if (cave_floor_bold(Depth, p_ptr->py+1, p_ptr->px)) 1739,1741c1929,1931 < cave_lite_hack(py+2, px); < cave_lite_hack(py+2, px+1); < cave_lite_hack(py+2, px-1); --- > cave_lite_hack(p_ptr->py+2, p_ptr->px); > cave_lite_hack(p_ptr->py+2, p_ptr->px+1); > cave_lite_hack(p_ptr->py+2, p_ptr->px-1); 1745c1935 < if (cave_floor_bold(py-1, px)) --- > if (cave_floor_bold(Depth, p_ptr->py-1, p_ptr->px)) 1747,1749c1937,1939 < cave_lite_hack(py-2, px); < cave_lite_hack(py-2, px+1); < cave_lite_hack(py-2, px-1); --- > cave_lite_hack(p_ptr->py-2, p_ptr->px); > cave_lite_hack(p_ptr->py-2, p_ptr->px+1); > cave_lite_hack(p_ptr->py-2, p_ptr->px-1); 1753c1943 < if (cave_floor_bold(py, px+1)) --- > if (cave_floor_bold(Depth, p_ptr->py, p_ptr->px+1)) 1755,1757c1945,1947 < cave_lite_hack(py, px+2); < cave_lite_hack(py+1, px+2); < cave_lite_hack(py-1, px+2); --- > cave_lite_hack(p_ptr->py, p_ptr->px+2); > cave_lite_hack(p_ptr->py+1, p_ptr->px+2); > cave_lite_hack(p_ptr->py-1, p_ptr->px+2); 1761c1951 < if (cave_floor_bold(py, px-1)) --- > if (cave_floor_bold(Depth, p_ptr->py, p_ptr->px-1)) 1763,1765c1953,1955 < cave_lite_hack(py, px-2); < cave_lite_hack(py+1, px-2); < cave_lite_hack(py-1, px-2); --- > cave_lite_hack(p_ptr->py, p_ptr->px-2); > cave_lite_hack(p_ptr->py+1, p_ptr->px-2); > cave_lite_hack(p_ptr->py-1, p_ptr->px-2); 1781c1971 < if (cave_floor_bold(py+1, px+1)) --- > if (cave_floor_bold(Depth, p_ptr->py+1, p_ptr->px+1)) 1783c1973 < cave_lite_hack(py+2, px+2); --- > cave_lite_hack(p_ptr->py+2, p_ptr->px+2); 1787c1977 < if (cave_floor_bold(py+1, px-1)) --- > if (cave_floor_bold(Depth, p_ptr->py+1, p_ptr->px-1)) 1789c1979 < cave_lite_hack(py+2, px-2); --- > cave_lite_hack(p_ptr->py+2, p_ptr->px-2); 1793c1983 < if (cave_floor_bold(py-1, px+1)) --- > if (cave_floor_bold(Depth, p_ptr->py-1, p_ptr->px+1)) 1795c1985 < cave_lite_hack(py-2, px+2); --- > cave_lite_hack(p_ptr->py-2, p_ptr->px+2); 1799c1989 < if (cave_floor_bold(py-1, px-1)) --- > if (cave_floor_bold(Depth, p_ptr->py-1, p_ptr->px-1)) 1801c1991 < cave_lite_hack(py-2, px-2); --- > cave_lite_hack(p_ptr->py-2, p_ptr->px-2); 1805c1995 < min_y = py - p; --- > min_y = p_ptr->py - p; 1809,1810c1999,2000 < max_y = py + p; < if (max_y > cur_hgt-1) max_y = cur_hgt-1; --- > max_y = p_ptr->py + p; > if (max_y > p_ptr->cur_hgt-1) max_y = p_ptr->cur_hgt-1; 1813c2003 < min_x = px - p; --- > min_x = p_ptr->px - p; 1817,1818c2007,2008 < max_x = px + p; < if (max_x > cur_wid-1) max_x = cur_wid-1; --- > max_x = p_ptr->px + p; > if (max_x > p_ptr->cur_wid-1) max_x = p_ptr->cur_wid-1; 1825,1826c2015,2016 < int dy = (py > y) ? (py - y) : (y - py); < int dx = (px > x) ? (px - x) : (x - px); --- > int dy = (p_ptr->py > y) ? (p_ptr->py - y) : (y - p_ptr->py); > int dx = (p_ptr->px > x) ? (p_ptr->px - x) : (x - p_ptr->px); 1851c2041 < for (i = 0; i < lite_n; i++) --- > for (i = 0; i < p_ptr->lite_n; i++) 1853,1854c2043,2044 < y = lite_y[i]; < x = lite_x[i]; --- > y = p_ptr->lite_y[i]; > x = p_ptr->lite_x[i]; 1857c2047 < if (cave[y][x].info & CAVE_TEMP) continue; --- > if (cave[Depth][y][x].info & CAVE_TEMP) continue; 1863c2053 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 1867c2057 < for (i = 0; i < temp_n; i++) --- > for (i = 0; i < p_ptr->temp_n; i++) 1869,1870c2059,2060 < y = temp_y[i]; < x = temp_x[i]; --- > y = p_ptr->temp_y[i]; > x = p_ptr->temp_x[i]; 1873c2063 < cave[y][x].info &= ~CAVE_TEMP; --- > cave[Depth][y][x].info &= ~CAVE_TEMP; 1876c2066 < if (cave[y][x].info & CAVE_LITE) continue; --- > if (p_ptr->cave_flag[y][x] & CAVE_LITE) continue; 1879c2069 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 1883c2073 < temp_n = 0; --- > p_ptr->temp_n = 0; 1895c2085 < void forget_view(void) --- > void forget_view(int Ind) 1896a2087,2088 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 1899c2091 < cave_type *c_ptr; --- > byte *w_ptr; 1902c2094 < if (!view_n) return; --- > if (!(p_ptr->view_n)) return; 1905c2097 < for (i = 0; i < view_n; i++) --- > for (i = 0; i < p_ptr->view_n; i++) 1907,1908c2099,2100 < int y = view_y[i]; < int x = view_x[i]; --- > int y = p_ptr->view_y[i]; > int x = p_ptr->view_x[i]; 1911c2103 < c_ptr = &cave[y][x]; --- > w_ptr = &p_ptr->cave_flag[y][x]; 1914c2106 < c_ptr->info &= ~CAVE_VIEW; --- > *w_ptr &= ~CAVE_VIEW; 1917c2109 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 1921c2113 < view_n = 0; --- > p_ptr->view_n = 0; 1930a2123,2124 > * > * I'm again assuming that using p_ptr is OK (see above) --KLJ-- 1932,1936c2126,2130 < #define cave_view_hack(C,Y,X) \ < (C)->info |= CAVE_VIEW; \ < view_y[view_n] = (Y); \ < view_x[view_n] = (X); \ < view_n++ --- > #define cave_view_hack(W,Y,X) \ > (*(W)) |= CAVE_VIEW; \ > p_ptr->view_y[p_ptr->view_n] = (Y); \ > p_ptr->view_x[p_ptr->view_n] = (X); \ > p_ptr->view_n++ 1957c2151 < static bool update_view_aux(int y, int x, int y1, int x1, int y2, int x2) --- > static bool update_view_aux(int int y, int x, int y1, int x1, int y2, int x2) 1958a2153,2154 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 1961a2158 > byte *w_ptr; 1965a2163,2164 > byte *g1_w_ptr; > byte *g2_w_ptr; 1968,1969c2167,2168 < g1_c_ptr = &cave[y1][x1]; < g2_c_ptr = &cave[y2][x2]; --- > g1_c_ptr = &cave[Depth][y1][x1]; > g2_c_ptr = &cave[Depth][y2][x2]; 1970a2170,2171 > g1_w_ptr = &p_ptr->cave_flag[y1][x1]; > g2_w_ptr = &p_ptr->cave_flag[y2][x2]; 1971a2173 > 1981,1982c2183,2184 < v1 = (f1 && (g1_c_ptr->info & CAVE_VIEW)); < v2 = (f2 && (g2_c_ptr->info & CAVE_VIEW)); --- > v1 = (f1 && (*(g1_w_ptr) & CAVE_VIEW)); > v2 = (f2 && (*(g2_w_ptr) & CAVE_VIEW)); 1989c2191,2192 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; > w_ptr = &p_ptr->cave_flag[y][x]; 2005c2208 < cave_view_hack(c_ptr, y, x); --- > cave_view_hack(w_ptr, y, x); 2013c2216 < cave_view_hack(c_ptr, y, x); --- > cave_view_hack(w_ptr, y, x); 2024c2227 < cave_view_hack(c_ptr, y, x); --- > cave_view_hack(w_ptr, y, x); 2033c2236 < cave_view_hack(c_ptr, y, x); --- > cave_view_hack(w_ptr, y, x); 2040c2243 < if (los(py, px, y, x)) --- > if (los(Depth, p_ptr->py, p_ptr->px, y, x)) 2042c2245 < cave_view_hack(c_ptr, y, x); --- > cave_view_hack(w_ptr, y, x); 2143a2347,2349 > * > * Well, I for one don't understand it, so I'm hoping I didn't screw anything > * up while trying to do this. --KLJ-- 2145c2351 < void update_view(void) --- > void update_view(int Ind) 2146a2353,2355 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 2153,2154c2362,2363 < int y_max = cur_hgt - 1; < int x_max = cur_wid - 1; --- > int y_max = p_ptr->cur_hgt - 1; > int x_max = p_ptr->cur_wid - 1; 2156a2366 > byte *w_ptr; 2162c2372 < if (view_reduce_view && !dun_level) --- > if (view_reduce_view && !Depth) 2185c2395 < for (n = 0; n < view_n; n++) --- > for (n = 0; n < p_ptr->view_n; n++) 2187,2188c2397,2398 < y = view_y[n]; < x = view_x[n]; --- > y = p_ptr->view_y[n]; > x = p_ptr->view_x[n]; 2191c2401,2402 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; > w_ptr = &p_ptr->cave_flag[y][x]; 2194c2405 < c_ptr->info &= ~(CAVE_VIEW); --- > *w_ptr &= ~(CAVE_VIEW); 2200,2202c2411,2413 < temp_y[temp_n] = y; < temp_x[temp_n] = x; < temp_n++; --- > p_ptr->temp_y[p_ptr->temp_n] = y; > p_ptr->temp_x[p_ptr->temp_n] = x; > p_ptr->temp_n++; 2206c2417 < view_n = 0; --- > p_ptr->view_n = 0; 2212,2213c2423,2424 < y = py; < x = px; --- > y = p_ptr->py; > x = p_ptr->px; 2216c2427,2428 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; > w_ptr = &p_ptr->cave_flag[y][x]; 2222c2434 < cave_view_hack(c_ptr, y, x); --- > cave_view_hack(w_ptr, y, x); 2233c2445,2446 < c_ptr = &cave[y+d][x+d]; --- > c_ptr = &cave[Depth][y+d][x+d]; > w_ptr = &p_ptr->cave_flag[y+d][x+d]; 2235c2448 < cave_view_hack(c_ptr, y+d, x+d); --- > cave_view_hack(w_ptr, y+d, x+d); 2242c2455,2456 < c_ptr = &cave[y+d][x-d]; --- > c_ptr = &cave[Depth][y+d][x-d]; > w_ptr = &p_ptr->cave_flag[y+d][x-d]; 2244c2458 < cave_view_hack(c_ptr, y+d, x-d); --- > cave_view_hack(w_ptr, y+d, x-d); 2251c2465,2466 < c_ptr = &cave[y-d][x+d]; --- > c_ptr = &cave[Depth][y-d][x+d]; > w_ptr = &p_ptr->cave_flag[y-d][x+d]; 2253c2468 < cave_view_hack(c_ptr, y-d, x+d); --- > cave_view_hack(w_ptr, y-d, x+d); 2260c2475,2476 < c_ptr = &cave[y-d][x-d]; --- > c_ptr = &cave[Depth][y-d][x-d]; > w_ptr = &p_ptr->cave_flag[y-d][x-d]; 2262c2478 < cave_view_hack(c_ptr, y-d, x-d); --- > cave_view_hack(w_ptr, y-d, x-d); 2272c2488,2489 < c_ptr = &cave[y+d][x]; --- > c_ptr = &cave[Depth][y+d][x]; > w_ptr = &p_ptr->cave_flag[y+d][x]; 2274c2491 < cave_view_hack(c_ptr, y+d, x); --- > cave_view_hack(w_ptr, y+d, x); 2284c2501,2502 < c_ptr = &cave[y-d][x]; --- > c_ptr = &cave[Depth][y-d][x]; > w_ptr = &p_ptr->cave_flag[y-d][x]; 2286c2504 < cave_view_hack(c_ptr, y-d, x); --- > cave_view_hack(w_ptr, y-d, x); 2296c2514,2515 < c_ptr = &cave[y][x+d]; --- > c_ptr = &cave[Depth][y][x+d]; > w_ptr = &p_ptr->cave_flag[y][x+d]; 2298c2517 < cave_view_hack(c_ptr, y, x+d); --- > cave_view_hack(w_ptr, y, x+d); 2308c2527,2528 < c_ptr = &cave[y][x-d]; --- > c_ptr = &cave[Depth][y][x-d]; > w_ptr = &p_ptr->cave_flag[y][x-d]; 2310c2530 < cave_view_hack(c_ptr, y, x-d); --- > cave_view_hack(w_ptr, y, x-d); 2559c2779 < for (n = 0; n < view_n; n++) --- > for (n = 0; n < p_ptr->view_n; n++) 2561,2562c2781,2782 < y = view_y[n]; < x = view_x[n]; --- > y = p_ptr->view_y[n]; > x = p_ptr->view_x[n]; 2565c2785 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; 2577c2797 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 2581c2801 < for (n = 0; n < temp_n; n++) --- > for (n = 0; n < p_ptr->temp_n; n++) 2583,2584c2803,2804 < y = temp_y[n]; < x = temp_x[n]; --- > y = p_ptr->temp_y[n]; > x = p_ptr->temp_x[n]; 2587c2807,2808 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; > w_ptr = &p_ptr->cave_flag[y][x]; 2593c2814 < if (c_ptr->info & CAVE_VIEW) continue; --- > if (*w_ptr & CAVE_VIEW) continue; 2596c2817 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 2600c2821,2826 < temp_n = 0; --- > p_ptr->temp_n = 0; > > /* XXX XXX XXX Mega-Hack -- Redraw player's spot every time */ > /* This keeps the network connection "active" even if nothing is */ > /* happening -- KLJ */ > lite_spot(p_ptr->py, p_ptr->px); 2622c2848 < static int flow_n = 0; --- > /*static int flow_n = 0;*/ 2795c3021 < void map_area(void) --- > void map_area(int Ind) 2796a3023,3024 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 2799a3028 > byte *w_ptr; 2803,2806c3032,3035 < y1 = panel_row_min - randint(10); < y2 = panel_row_max + randint(10); < x1 = panel_col_min - randint(20); < x2 = panel_col_max + randint(20); --- > y1 = p_ptr->panel_row_min - randint(10); > y2 = p_ptr->panel_row_max + randint(10); > x1 = p_ptr->panel_col_min - randint(20); > x2 = p_ptr->panel_col_max + randint(20); 2810c3039 < if (y2 > cur_hgt-2) y2 = cur_hgt-2; --- > if (y2 > p_ptr->cur_hgt-2) y2 = p_ptr->cur_hgt-2; 2812c3041 < if (x2 > cur_wid-2) x2 = cur_wid-2; --- > if (x2 > p_ptr->cur_wid-2) x2 = p_ptr->cur_wid-2; 2819c3048,3049 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; > w_ptr = &p_ptr->cave_flag[y][x]; 2828c3058 < c_ptr->info |= CAVE_MARK; --- > *w_ptr |= CAVE_MARK; 2834c3064,3065 < c_ptr = &cave[y+ddy_ddd[i]][x+ddx_ddd[i]]; --- > c_ptr = &cave[Depth][y+ddy_ddd[i]][x+ddx_ddd[i]]; > w_ptr = &p_ptr->cave_flag[y+ddy_ddd[i]][x+ddx_ddd[i]]; 2840c3071 < c_ptr->info |= CAVE_MARK; --- > *w_ptr |= CAVE_MARK; 2872c3103 < void wiz_lite(void) --- > void wiz_lite(int Ind) 2873a3105,3106 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 2876a3110 > byte *w_ptr; 2880c3114 < for (y = 1; y < cur_hgt-1; y++) --- > for (y = 1; y < p_ptr->cur_hgt-1; y++) 2883c3117 < for (x = 1; x < cur_wid-1; x++) --- > for (x = 1; x < p_ptr->cur_wid-1; x++) 2886c3120,3121 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; > w_ptr = &p_ptr->cave_flag[y][x]; 2891,2892d3125 < object_type *o_ptr = &o_list[c_ptr->o_idx]; < 2894c3127 < o_ptr->marked = TRUE; --- > p_ptr->obj_vis[c_ptr->o_idx]= TRUE; 2907c3140,3141 < c_ptr = &cave[yy][xx]; --- > c_ptr = &cave[Depth][yy][xx]; > w_ptr = &p_ptr->cave_flag[yy][xx]; 2916c3150 < c_ptr->info |= CAVE_MARK; --- > *w_ptr |= CAVE_MARK; 2923c3157 < c_ptr->info |= CAVE_MARK; --- > *w_ptr |= CAVE_MARK; 2944c3178 < void wiz_dark(void) --- > void wiz_dark(int Ind) 2945a3180,3181 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 2950c3186 < for (y = 0; y < cur_hgt; y++) --- > for (y = 0; y < p_ptr->cur_hgt; y++) 2952c3188 < for (x = 0; x < cur_wid; x++) --- > for (x = 0; x < p_ptr->cur_wid; x++) 2954c3190,3191 < cave_type *c_ptr = &cave[y][x]; --- > cave_type *c_ptr = &cave[Depth][y][x]; > byte *w_ptr = &p_ptr->cave_flag[y][x]; 2957c3194 < c_ptr->info &= ~CAVE_MARK; --- > *w_ptr &= ~CAVE_MARK; 2962,2963d3198 < object_type *o_ptr = &o_list[c_ptr->o_idx]; < 2965c3200 < o_ptr->marked = FALSE; --- > p_ptr->obj_vis[c_ptr->o_idx] = FALSE; 3097c3332 < bool projectable(int y1, int x1, int y2, int x2) --- > bool projectable(int Depth, int y1, int x1, int y2, int x2) 3108c3343 < if (dist && !cave_floor_bold(y, x)) break; --- > if (dist && !cave_floor_bold(Depth, y, x)) break; 3135c3370 < void scatter(int *yp, int *xp, int y, int x, int d, int m) --- > void scatter(int Depth, int *yp, int *xp, int y, int x, int d, int m) 3150c3385,3386 < if (!in_bounds(y, x)) continue; --- > if (!in_bounds(Depth, y, x)) continue; > 3156c3392 < if (los(y, x, ny, nx)) break; --- > if (los(Depth, y, x, ny, nx)) break; 3168a3405,3406 > * > * This is currently disabled --KLJ-- 3173c3411 < health_who = m_idx; --- > /*health_who = m_idx;*/ 3176c3414 < p_ptr->redraw |= (PR_HEALTH); --- > /*p_ptr->redraw |= (PR_HEALTH);*/ 3182a3421,3422 > * > * Monster recall is disabled for now --KLJ-- 3187c3427 < recent_idx = r_idx; --- > /*recent_idx = r_idx;*/ 3190c3430 < p_ptr->window |= (PW_MONSTER); --- > /*p_ptr->window |= (PW_MONSTER);*/ 3205c3445 < void disturb(int stop_search, int unused_flag) --- > void disturb(int int stop_search, int unused_flag) 3206a3447,3448 > player_type *p_ptr = Players[Ind]; > 3212a3455 > #if 0 3221a3465 > #endif 3234c3478 < if (running) --- > if (p_ptr->running) 3237c3481 < running = 0; --- > p_ptr->running = 0; diff -r src-280/cmd1.c mangband-000/src/server/cmd1.c 12a13,14 > #define SERVER > 80c82 < s16b critical_shot(int weight, int plus, int dam) --- > s16b critical_shot(int int weight, int plus, int dam) 81a84,85 > player_type *p_ptr = Players[Ind]; > 119c123 < s16b critical_norm(int weight, int plus, int dam) --- > s16b critical_norm(int int weight, int plus, int dam) 120a125,126 > player_type *p_ptr = Players[Ind]; > 198c204 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_ANIMAL; --- > /*if (m_ptr->ml) r_ptr->r_flags3 |= RF3_ANIMAL;*/ 207c213 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_EVIL; --- > /*if (m_ptr->ml) r_ptr->r_flags3 |= RF3_EVIL;*/ 216c222 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_UNDEAD; --- > /*if (m_ptr->ml) r_ptr->r_flags3 |= RF3_UNDEAD;*/ 225c231 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_DEMON; --- > /*if (m_ptr->ml) r_ptr->r_flags3 |= RF3_DEMON;*/ 234c240 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_ORC; --- > /*if (m_ptr->ml) r_ptr->r_flags3 |= RF3_ORC;*/ 243c249 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_TROLL; --- > /*if (m_ptr->ml) r_ptr->r_flags3 |= RF3_TROLL;*/ 252c258 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_GIANT; --- > /*if (m_ptr->ml) r_ptr->r_flags3 |= RF3_GIANT;*/ 261c267 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_DRAGON; --- > /*if (m_ptr->ml) r_ptr->r_flags3 |= RF3_DRAGON;*/ 270c276 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_DRAGON; --- > /*if (m_ptr->ml) r_ptr->r_flags3 |= RF3_DRAGON;*/ 282c288 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_IM_ACID; --- > /*if (m_ptr->ml) r_ptr->r_flags3 |= RF3_IM_ACID;*/ 298c304 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_IM_ELEC; --- > /*if (m_ptr->ml) r_ptr->r_flags3 |= RF3_IM_ELEC;*/ 314c320 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_IM_FIRE; --- > /*if (m_ptr->ml) r_ptr->r_flags3 |= RF3_IM_FIRE;*/ 330c336 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_IM_COLD; --- > /*if (m_ptr->ml) r_ptr->r_flags3 |= RF3_IM_COLD;*/ 353c359 < void search(void) --- > void search(int Ind) 354a361,363 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 365c374 < if (p_ptr->blind || no_lite()) chance = chance / 10; --- > if (p_ptr->blind || no_lite(Ind)) chance = chance / 10; 369c378 < for (y = (py - 1); y <= (py + 1); y++) --- > for (y = (p_ptr->py - 1); y <= (p_ptr->py + 1); y++) 371c380 < for (x = (px - 1); x <= (px + 1); x++) --- > for (x = (p_ptr->px - 1); x <= (p_ptr->px + 1); x++) 377c386 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; 386c395 < pick_trap(y, x); --- > pick_trap(Depth, y, x); 408c417 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 443c452 < void carry(int pickup) --- > void carry(int int pickup) 445c454,455 < cave_type *c_ptr = &cave[py][px]; --- > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 446a457,458 > cave_type *c_ptr = &cave[Depth][p_ptr->py][p_ptr->px]; > 481c493 < delete_object(py, px); --- > delete_object(Depth, p_ptr->py, p_ptr->px); 506a519 > #if 0 513a527 > #endif 524c538 < o_ptr = &inventory[slot]; --- > o_ptr = &(p_ptr->inventory[slot]); 533c547 < delete_object(py, px); --- > delete_object(Depth, p_ptr->py, p_ptr->px); 548c562 < static int check_hit(int power) --- > static int check_hit(int int power) 549a564,565 > player_type *p_ptr = Players[Ind]; > 576c592 < static void hit_trap(void) --- > static void hit_trap(int Ind) 577a594,596 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 580a600 > byte *w_ptr; 589c609,610 < c_ptr = &cave[py][px]; --- > c_ptr = &cave[Depth][p_ptr->py][p_ptr->px]; > w_ptr = &p_ptr->cave_flag[p_ptr->py][p_ptr->px]; 606,607c627,642 < new_level_flag = TRUE; < dun_level++; --- > p_ptr->new_level_flag = TRUE; > > /* The player is gone */ > cave[p_ptr->dun_depth][p_ptr->py][p_ptr->px].p_idx = 0; > > /* Show everyone that he's left */ > everyone_lite_spot(p_ptr->dun_depth, p_ptr->py, p_ptr->px); > > /* Reduce the number of players on this depth */ > players_on_depth[p_ptr->dun_depth]--; > > p_ptr->dun_depth++; > > /* Increase the number of players on this next depth */ > players_on_depth[p_ptr->dun_depth]++; > 702,704c737,739 < c_ptr->info &= ~CAVE_MARK; < note_spot(py, px); < lite_spot(py, px); --- > *w_ptr &= ~CAVE_MARK; > note_spot(p_ptr->py, p_ptr->px); > everyone_lite_spot(Depth, p_ptr->py, p_ptr->px); 708c743 < (void)summon_specific(py, px, dun_level, 0); --- > (void)summon_specific(Depth, p_ptr->py, p_ptr->px, Depth, 0); 849c884 < void py_attack(int y, int x) --- > void py_attack(int int y, int x) 850a886,888 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 853c891 < cave_type *c_ptr = &cave[y][x]; --- > cave_type *c_ptr = &cave[Depth][y][x]; 880c918 < if (m_ptr->ml) recent_track(m_ptr->r_idx); --- > if (p_ptr->mon_vis[c_ptr->m_idx]) recent_track(m_ptr->r_idx); 883c921 < if (m_ptr->ml) health_track(c_ptr->m_idx); --- > if (p_ptr->mon_vis[c_ptr->m_idx]) health_track(c_ptr->m_idx); 898c936 < o_ptr = &inventory[INVEN_WIELD]; --- > o_ptr = &(p_ptr->inventory[INVEN_WIELD]); 909c947 < if (test_hit_norm(chance, r_ptr->ac, m_ptr->ml)) --- > if (test_hit_norm(chance, r_ptr->ac, p_ptr->mon_vis[c_ptr->m_idx])) 957c995 < if (m_ptr->ml) r_ptr->r_flags3 |= RF3_NO_CONF; --- > if (p_ptr->mon_vis[c_ptr->m_idx]) r_ptr->r_flags3 |= RF3_NO_CONF; 985c1023 < if (fear && m_ptr->ml) --- > if (fear && p_ptr->mon_vis[c_ptr->m_idx]) 996c1034 < if (do_quake) earthquake(py, px, 10); --- > if (do_quake) earthquake(p_ptr->dun_depth, p_ptr->py, p_ptr->px, 10); 1012c1050 < void move_player(int dir, int do_pickup) --- > void move_player(int int dir, int do_pickup) 1013a1052,1054 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 1018a1060 > byte *w_ptr; 1022,1023c1064,1065 < y = py + ddy[dir]; < x = px + ddx[dir]; --- > y = p_ptr->py + ddy[dir]; > x = p_ptr->px + ddx[dir]; 1026c1068,1069 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; > w_ptr = &p_ptr->cave_flag[y][x]; 1034a1078,1088 > /* Bump into other players */ > if (c_ptr->p_idx) > { > msg_format("You bump into %s.", Players[c_ptr->p_idx]->name); > msg_format(c_ptr->p_idx, "%s bumps into you.", p_ptr->name); > > /* Disturb both parties */ > disturb(1, 0); > disturb(c_ptr->p_idx, 1, 0); > } > 1036c1090 < if (c_ptr->m_idx) --- > else if (c_ptr->m_idx) 1043c1097 < else if (!cave_floor_bold(y, x)) --- > else if (!cave_floor_bold(Depth, y, x)) 1049,1050c1103,1104 < if (!(c_ptr->info & CAVE_MARK) && < (p_ptr->blind || !(c_ptr->info & CAVE_LITE))) --- > if (!(*w_ptr & CAVE_MARK) && > (p_ptr->blind || !(*w_ptr & CAVE_LITE))) 1056,1057c1110,1111 < c_ptr->info |= CAVE_MARK; < lite_spot(y, x); --- > *w_ptr |= CAVE_MARK; > everyone_lite_spot(Depth, y, x); 1064,1065c1118,1119 < c_ptr->info |= CAVE_MARK; < lite_spot(y, x); --- > *w_ptr |= CAVE_MARK; > everyone_lite_spot(Depth, y, x); 1072,1073c1126,1127 < c_ptr->info |= CAVE_MARK; < lite_spot(y, x); --- > *w_ptr |= CAVE_MARK; > everyone_lite_spot(Depth, y, x); 1106,1107c1160,1161 < oy = py; < ox = px; --- > oy = p_ptr->py; > ox = p_ptr->px; 1110,1111c1164,1165 < py = y; < px = x; --- > p_ptr->py = y; > p_ptr->px = x; 1112a1167,1170 > /* Update the player indices */ > cave[Depth][oy][ox].p_idx = 0; > cave[Depth][y][x].p_idx = Ind; > 1114c1172 < lite_spot(py, px); --- > everyone_lite_spot(Depth, p_ptr->py, p_ptr->px); 1117c1175 < lite_spot(oy, ox); --- > everyone_lite_spot(Depth, oy, ox); 1120c1178 < verify_panel(); --- > verify_panel(Ind); 1136c1194 < search(); --- > search(Ind); 1142c1200 < search(); --- > search(Ind); 1169c1227 < pick_trap(py, px); --- > pick_trap(p_ptr->dun_depth, p_ptr->py, p_ptr->px); 1172c1230 < hit_trap(); --- > hit_trap(Ind); 1183c1241 < hit_trap(); --- > hit_trap(Ind); 1192c1250 < static int see_wall(int dir, int y, int x) --- > static int see_wall(int int dir, int y, int x) 1193a1252,1254 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 1199c1260 < if (!in_bounds2(y, x)) return (FALSE); --- > if (!in_bounds2(Depth, y, x)) return (FALSE); 1202c1263 < if (cave_floor_bold(y, x)) return (FALSE); --- > if (cave_floor_bold(Depth, y, x)) return (FALSE); 1205c1266 < if (!(cave[y][x].info & CAVE_MARK)) return (FALSE); --- > if (!(p_ptr->cave_flag[y][x] & CAVE_MARK)) return (FALSE); 1215c1276 < static int see_nothing(int dir, int y, int x) --- > static int see_nothing(int dir, int int y, int x) 1216a1278,1280 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 1222c1286 < if (!in_bounds2(y, x)) return (TRUE); --- > if (!in_bounds2(Depth, y, x)) return (TRUE); 1225c1289 < if (cave[y][x].info & CAVE_MARK) return (FALSE); --- > if (p_ptr->cave_flag[y][x] & CAVE_MARK) return (FALSE); 1228c1292 < if (!cave_floor_bold(y, x)) return (TRUE); --- > if (!cave_floor_bold(Depth, y, x)) return (TRUE); 1387c1451 < static byte find_current; --- > /*static byte find_current;*/ 1392c1456 < static byte find_prevdir; --- > /*static byte find_prevdir;*/ 1397c1461 < static bool find_openarea; --- > /*static bool find_openarea;*/ 1402,1403c1466,1467 < static bool find_breakright; < static bool find_breakleft; --- > /*static bool find_breakright; > static bool find_breakleft;*/ 1421c1485 < static void run_init(int dir) --- > static void run_init(int int dir) 1422a1487,1488 > player_type *p_ptr = Players[Ind]; > 1428c1494 < find_current = dir; --- > p_ptr->find_current = dir; 1431c1497 < find_prevdir = dir; --- > p_ptr->find_prevdir = dir; 1434c1500 < find_openarea = TRUE; --- > p_ptr->find_openarea = TRUE; 1437c1503 < find_breakright = find_breakleft = FALSE; --- > p_ptr->find_breakright = p_ptr->find_breakleft = FALSE; 1444,1445c1510,1511 < row = py + ddy[dir]; < col = px + ddx[dir]; --- > row = p_ptr->py + ddy[dir]; > col = p_ptr->px + ddx[dir]; 1451c1517 < if (see_wall(cycle[i+1], py, px)) --- > if (see_wall(cycle[i+1], p_ptr->py, p_ptr->px)) 1453c1519 < find_breakleft = TRUE; --- > p_ptr->find_breakleft = TRUE; 1458c1524 < find_breakleft = TRUE; --- > p_ptr->find_breakleft = TRUE; 1463c1529 < if (see_wall(cycle[i-1], py, px)) --- > if (see_wall(cycle[i-1], p_ptr->py, p_ptr->px)) 1465c1531 < find_breakright = TRUE; --- > p_ptr->find_breakright = TRUE; 1470c1536 < find_breakright = TRUE; --- > p_ptr->find_breakright = TRUE; 1475c1541 < if (find_breakleft && find_breakright) --- > if (p_ptr->find_breakleft && p_ptr->find_breakright) 1478c1544 < find_openarea = FALSE; --- > p_ptr->find_openarea = FALSE; 1485c1551 < find_prevdir = cycle[i - 1]; --- > p_ptr->find_prevdir = cycle[i - 1]; 1489c1555 < find_prevdir = cycle[i + 1]; --- > p_ptr->find_prevdir = cycle[i + 1]; 1498c1564 < find_prevdir = cycle[i - 2]; --- > p_ptr->find_prevdir = cycle[i - 2]; 1502c1568 < find_prevdir = cycle[i + 2]; --- > p_ptr->find_prevdir = cycle[i + 2]; 1514c1580 < static bool run_test(void) --- > static bool run_test(int Ind) 1515a1582,1584 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 1522a1592 > byte *w_ptr; 1530c1600 < prev_dir = find_prevdir; --- > prev_dir = p_ptr->find_prevdir; 1542,1543c1612,1613 < row = py + ddy[new_dir]; < col = px + ddx[new_dir]; --- > row = p_ptr->py + ddy[new_dir]; > col = p_ptr->px + ddx[new_dir]; 1545c1615,1616 < c_ptr = &cave[row][col]; --- > c_ptr = &cave[Depth][row][col]; > w_ptr = &p_ptr->cave_flag[row][col]; 1551,1552d1621 < monster_type *m_ptr = &m_list[c_ptr->m_idx]; < 1554c1623 < if (m_ptr->ml) return (TRUE); --- > if (p_ptr->mon_vis[c_ptr->m_idx]) return (TRUE); 1560,1561d1628 < object_type *o_ptr = &o_list[c_ptr->o_idx]; < 1563c1630 < if (o_ptr->marked) return (TRUE); --- > if (p_ptr->obj_vis[c_ptr->o_idx]) return (TRUE); 1571c1638 < if (c_ptr->info & CAVE_MARK) --- > if (*w_ptr & CAVE_MARK) 1643c1710 < if (inv || cave_floor_bold(row, col)) --- > if (inv || cave_floor_bold(Depth, row, col)) 1646c1713 < if (find_openarea) --- > if (p_ptr->find_openarea) 1688c1755 < if (find_openarea) --- > if (p_ptr->find_openarea) 1693c1760 < find_breakright = TRUE; --- > p_ptr->find_breakright = TRUE; 1699c1766 < find_breakleft = TRUE; --- > p_ptr->find_breakleft = TRUE; 1707c1774 < if (find_openarea) --- > if (p_ptr->find_openarea) 1714,1715c1781,1782 < row = py + ddy[new_dir]; < col = px + ddx[new_dir]; --- > row = p_ptr->py + ddy[new_dir]; > col = p_ptr->px + ddx[new_dir]; 1718c1785 < if (!(cave[row][col].info & CAVE_MARK) || cave_floor_bold(row, col)) --- > if (!(p_ptr->cave_flag[row][col] & CAVE_MARK) || cave_floor_bold(Depth, row, col)) 1721c1788 < if (find_breakright) --- > if (p_ptr->find_breakright) 1731c1798 < if (find_breakleft) --- > if (p_ptr->find_breakleft) 1743,1744c1810,1811 < row = py + ddy[new_dir]; < col = px + ddx[new_dir]; --- > row = p_ptr->py + ddy[new_dir]; > col = p_ptr->px + ddx[new_dir]; 1747c1814 < if (!(cave[row][col].info & CAVE_MARK) || cave_floor_bold(row, col)) --- > if (!(p_ptr->cave_flag[row][col] & CAVE_MARK) || cave_floor_bold(Depth, row, col)) 1750c1817 < if (find_breakleft) --- > if (p_ptr->find_breakleft) 1760c1827 < if (find_breakright) --- > if (p_ptr->find_breakright) 1782c1849 < find_current = option; --- > p_ptr->find_current = option; 1785c1852 < find_prevdir = option; --- > p_ptr->find_prevdir = option; 1792c1859 < find_current = option; --- > p_ptr->find_current = option; 1795c1862 < find_prevdir = option2; --- > p_ptr->find_prevdir = option2; 1802,1803c1869,1870 < row = py + ddy[option]; < col = px + ddx[option]; --- > row = p_ptr->py + ddy[option]; > col = p_ptr->px + ddx[option]; 1816,1817c1883,1884 < find_current = option; < find_prevdir = option2; --- > p_ptr->find_current = option; > p_ptr->find_prevdir = option2; 1830,1831c1897,1898 < find_current = option2; < find_prevdir = option2; --- > p_ptr->find_current = option2; > p_ptr->find_prevdir = option2; 1838,1839c1905,1906 < find_current = option; < find_prevdir = option2; --- > p_ptr->find_current = option; > p_ptr->find_prevdir = option2; 1846c1913 < if (see_wall(find_current, py, px)) --- > if (see_wall(p_ptr->find_current, p_ptr->py, p_ptr->px)) 1861c1928 < void run_step(int dir) --- > void run_step(int int dir) 1862a1930,1931 > player_type *p_ptr = Players[Ind]; > 1867c1936 < if (see_wall(dir, py, px)) --- > if (see_wall(dir, p_ptr->py, p_ptr->px)) 1890c1959 < if (run_test()) --- > if (run_test(Ind)) 1901c1970 < if (--running <= 0) return; --- > if (--(p_ptr->running) <= 0) return; 1904d1972 < energy_use = 100; 1905a1974,1978 > /* To make running more efficient in exploring the dungeon, people can > * now run twice as fast as normal --KLJ-- > */ > p_ptr->energy_use = 20; > 1907c1980 < move_player(find_current, always_pickup); --- > move_player(p_ptr->find_current, always_pickup); diff -r src-280/cmd2.c mangband-000/src/server/cmd2.c 12a13,14 > #define SERVER > 20c22 < void do_cmd_go_up(void) --- > void do_cmd_go_up(int Ind) 21a24,26 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 25c30 < c_ptr = &cave[py][px]; --- > c_ptr = &cave[Depth][p_ptr->py][p_ptr->px]; 33a39,48 > /* Remove the player from the old location */ > c_ptr->p_idx = 0; > > /* Show everyone that's he left */ > everyone_lite_spot(Depth, p_ptr->py, p_ptr->px); > > /* Forget his lite and viewing area */ > forget_lite(Ind); > forget_view(Ind); > 35c50 < energy_use = 100; --- > p_ptr->energy_use = 100; 39a55,57 > /* A player has left this depth */ > players_on_depth[p_ptr->dun_depth]--; > 41,42c59 < dun_level--; < new_level_flag = TRUE; --- > p_ptr->dun_depth--; 43a61,65 > /* And another player has entered this depth */ > players_on_depth[p_ptr->dun_depth]++; > > p_ptr->new_level_flag = TRUE; > 52c74 < void do_cmd_go_down(void) --- > void do_cmd_go_down(int Ind) 53a76,78 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 57c82 < c_ptr = &cave[py][px]; --- > c_ptr = &cave[Depth][p_ptr->py][p_ptr->px]; 65a91,100 > /* Remove the player from the old location */ > c_ptr->p_idx = 0; > > /* Show everyone that's he left */ > everyone_lite_spot(Depth, p_ptr->py, p_ptr->px); > > /* Forget his lite and viewing area */ > forget_lite(Ind); > forget_view(Ind); > 67c102 < energy_use = 100; --- > p_ptr->energy_use = 100; 71a107,109 > /* A player has left this depth */ > players_on_depth[p_ptr->dun_depth]--; > 73,74c111 < dun_level++; < new_level_flag = TRUE; --- > p_ptr->dun_depth++; 75a113,117 > /* Another player has entered this depth */ > players_on_depth[p_ptr->dun_depth]++; > > p_ptr->new_level_flag = TRUE; > 85c127 < void do_cmd_search(void) --- > void do_cmd_search(int Ind) 86a129,130 > player_type *p_ptr = Players[Ind]; > 91c135 < command_rep = command_arg - 1; --- > /*command_rep = command_arg - 1;*/ 101c145 < energy_use = 100; --- > p_ptr->energy_use = 100; 104c148 < search(); --- > search(Ind); 111c155 < void do_cmd_toggle_search(void) --- > void do_cmd_toggle_search(int Ind) 112a157,158 > player_type *p_ptr = Players[Ind]; > 153c199 < static void chest_death(int y, int x, object_type *o_ptr) --- > static void chest_death(int int y, int x, object_type *o_ptr) 154a201,203 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 181c230 < scatter(&ny, &nx, y, x, d, 0); --- > scatter(Depth, &ny, &nx, y, x, d, 0); 184c233 < if (!cave_clean_bold(ny, nx)) continue; --- > if (!cave_clean_bold(Depth, ny, nx)) continue; 195c244 < place_gold(ny, nx); --- > place_gold(Depth, ny, nx); 201c250 < place_object(ny, nx, FALSE, FALSE); --- > place_object(Depth, ny, nx, FALSE, FALSE); 205c254 < object_level = dun_level; --- > object_level = Depth; 214c263 < lite_spot(ny, nx); --- > everyone_lite_spot(Depth, ny, nx); 217c266 < if ((ny == py) && (nx == px)) --- > if ((ny == p_ptr->py) && (nx == p_ptr->px)) 242c291 < static void chest_trap(int y, int x, object_type *o_ptr) --- > static void chest_trap(int int y, int x, object_type *o_ptr) 243a293,294 > player_type *p_ptr = Players[Ind]; > 299c350 < (void)summon_specific(y, x, dun_level, 0); --- > (void)summon_specific(p_ptr->dun_depth, y, x, p_ptr->dun_depth, 0); 322c373 < void do_cmd_open(void) --- > void do_cmd_open(int int dir) 324c375,378 < int y, x, i, j, dir; --- > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > > int y, x, i, j; 337c391 < command_rep = command_arg - 1; --- > /*command_rep = command_arg - 1;*/ 347c401 < if (get_rep_dir(&dir)) --- > if (dir) 350,351c404,405 < y = py + ddy[dir]; < x = px + ddx[dir]; --- > y = p_ptr->py + ddy[dir]; > x = p_ptr->px + ddx[dir]; 354c408 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; 372c426 < energy_use = 100; --- > p_ptr->energy_use = 100; 385c439 < energy_use = 100; --- > p_ptr->energy_use = 100; 400c454 < if (p_ptr->blind || no_lite()) i = i / 10; --- > if (p_ptr->blind || no_lite(Ind)) i = i / 10; 442c496 < energy_use = 100; --- > p_ptr->energy_use = 100; 452c506 < energy_use = 100; --- > p_ptr->energy_use = 100; 458c512 < if (p_ptr->blind || no_lite()) i = i / 10; --- > if (p_ptr->blind || no_lite(Ind)) i = i / 10; 486c540 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 516c570 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 531c585 < void do_cmd_close(void) --- > void do_cmd_close(int int dir) 533c587,590 < int y, x, dir; --- > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > > int y, x; 543c600 < command_rep = command_arg - 1; --- > /*command_rep = command_arg - 1;*/ 553c610 < if (get_rep_dir(&dir)) --- > if (dir) 556,557c613,614 < y = py + ddy[dir]; < x = px + ddx[dir]; --- > y = p_ptr->py + ddy[dir]; > x = p_ptr->px + ddx[dir]; 560c617 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; 580c637 < energy_use = 100; --- > p_ptr->energy_use = 100; 593c650 < energy_use = 100; --- > p_ptr->energy_use = 100; 602c659 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 624c681 < static bool twall(int y, int x) --- > static bool twall(int int y, int x) 626c683,684 < cave_type *c_ptr = &cave[y][x]; --- > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 627a686,688 > cave_type *c_ptr = &cave[Depth][y][x]; > byte *w_ptr = &p_ptr->cave_flag[y][x]; > 629c690 < if (cave_floor_bold(y, x)) return (FALSE); --- > if (cave_floor_bold(Depth, y, x)) return (FALSE); 635c696 < c_ptr->info &= ~CAVE_MARK; --- > *w_ptr &= ~CAVE_MARK; 641c702 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 662c723 < void do_cmd_tunnel(void) --- > void do_cmd_tunnel(int int dir) 664c725,726 < int y, x, dir; --- > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 665a728,729 > int y, x; > 677c741 < command_rep = command_arg - 1; --- > /*command_rep = command_arg - 1;*/ 687c751 < if (get_rep_dir(&dir)) --- > if (dir) 690,691c754,755 < y = py + ddy[dir]; < x = px + ddx[dir]; --- > y = p_ptr->py + ddy[dir]; > x = p_ptr->px + ddx[dir]; 694c758 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; 697c761 < old_floor = cave_floor_bold(y, x); --- > old_floor = cave_floor_bold(Depth, y, x); 700c764 < if (cave_floor_bold(y, x)) --- > if (cave_floor_bold(Depth, y, x)) 717c781 < energy_use = 100; --- > p_ptr->energy_use = 100; 730c794 < energy_use = 100; --- > p_ptr->energy_use = 100; 788c852 < place_gold(y, x); --- > place_gold(Depth, y, x); 794c858 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 837c901 < place_object(y, x, FALSE, FALSE); --- > place_object(Depth, y, x, FALSE, FALSE); 848c912 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 867c931 < search(); --- > search(Ind); 872c936 < if (old_floor != cave_floor_bold(y, x)) --- > if (old_floor != cave_floor_bold(Depth, y, x)) 887c951 < void do_cmd_disarm(void) --- > void do_cmd_disarm(int int dir) 889c953,954 < int y, x, i, j, dir, power; --- > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 890a956,957 > int y, x, i, j, power; > 891a959 > byte *w_ptr; 901c969 < command_rep = command_arg - 1; --- > /*command_rep = command_arg - 1;*/ 911c979 < if (get_rep_dir(&dir)) --- > if (dir) 914,915c982,983 < y = py + ddy[dir]; < x = px + ddx[dir]; --- > y = p_ptr->py + ddy[dir]; > x = p_ptr->px + ddx[dir]; 918c986,987 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; > w_ptr = &p_ptr->cave_flag[y][x]; 936c1005 < energy_use = 100; --- > p_ptr->energy_use = 100; 949c1018 < energy_use = 100; --- > p_ptr->energy_use = 100; 955c1024 < if (p_ptr->blind || no_lite()) i = i / 10; --- > if (p_ptr->blind || no_lite(Ind)) i = i / 10; 1013c1082 < energy_use = 100; --- > p_ptr->energy_use = 100; 1019c1088 < if (p_ptr->blind || no_lite()) i = i / 10; --- > if (p_ptr->blind || no_lite(Ind)) i = i / 10; 1046c1115 < c_ptr->info &= ~CAVE_MARK; --- > *w_ptr &= ~CAVE_MARK; 1052c1121 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 1105c1174 < void do_cmd_bash(void) --- > void do_cmd_bash(int int dir) 1107c1176,1177 < int y, x, dir; --- > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 1108a1179,1180 > int y, x; > 1120c1192 < command_rep = command_arg - 1; --- > /*command_rep = command_arg - 1;*/ 1130c1202 < if (get_rep_dir(&dir)) --- > if (dir) 1133,1134c1205,1206 < y = py + ddy[dir]; < x = px + ddx[dir]; --- > y = p_ptr->py + ddy[dir]; > x = p_ptr->px + ddx[dir]; 1137c1209 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; 1151c1223 < energy_use = 100; --- > p_ptr->energy_use = 100; 1164c1236 < energy_use = 100; --- > p_ptr->energy_use = 100; 1204c1276 < lite_spot(y, x); --- > everyone_lite_spot(Depth, y, x); 1248c1320 < static bool get_spike(int *ip) --- > static bool get_spike(int int *ip) 1249a1322,1323 > player_type *p_ptr = Players[Ind]; > 1255c1329 < object_type *o_ptr = &inventory[i]; --- > object_type *o_ptr = &(p_ptr->inventory[i]); 1279c1353 < void do_cmd_spike(void) --- > void do_cmd_spike(int int dir) 1281c1355,1356 < int y, x, dir, item; --- > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 1282a1358,1359 > int y, x, item; > 1287c1364 < if (get_rep_dir(&dir)) --- > if (dir) 1290,1291c1367,1368 < y = py + ddy[dir]; < x = px + ddx[dir]; --- > y = p_ptr->py + ddy[dir]; > x = p_ptr->px + ddx[dir]; 1294c1371 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; 1315c1392 < energy_use = 100; --- > p_ptr->energy_use = 100; 1328c1405 < energy_use = 100; --- > p_ptr->energy_use = 100; 1352c1429 < void do_cmd_walk(int pickup) --- > void do_cmd_walk(int int dir, int pickup) 1354c1431 < int dir; --- > player_type *p_ptr = Players[Ind]; 1363c1440 < command_rep = command_arg - 1; --- > /*command_rep = command_arg - 1;*/ 1373c1450 < if (get_rep_dir(&dir)) --- > if (dir) 1376c1453 < energy_use = 100; --- > p_ptr->energy_use = 100; 1394c1471 < void do_cmd_run(void) --- > void do_cmd_run(int int dir) 1396c1473 < int dir; --- > player_type *p_ptr = Players[Ind]; 1397a1475,1476 > /*printf("Starting run for player %d with direction %d.\n", dir);*/ > 1406c1485 < if (get_rep_dir(&dir)) --- > if (dir) 1409c1488 < running = (command_arg ? command_arg : 1000); --- > p_ptr->running = (command_arg ? command_arg : 1000); 1412a1492,1494 > > /* Reset player's energy */ > p_ptr->energy = 0; 1422c1504 < void do_cmd_stay(int pickup) --- > void do_cmd_stay(int int pickup) 1424c1506,1507 < cave_type *c_ptr = &cave[py][px]; --- > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 1425a1509 > cave_type *c_ptr = &cave[Depth][p_ptr->py][p_ptr->px]; 1426a1511 > 1431c1516 < command_rep = command_arg - 1; --- > /*command_rep = command_arg - 1;*/ 1442c1527 < energy_use = 100; --- > p_ptr->energy_use = 100; 1448c1533 < search(); --- > search(Ind); 1454c1539 < search(); --- > search(Ind); 1481a1567 > #if 0 1542a1629 > #endif 1621c1708 < void do_cmd_fire(void) --- > void do_cmd_fire(int int dir, int item) 1623c1710,1712 < int dir, item; --- > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 1641c1730 < int msec = delay_factor * delay_factor * delay_factor; --- > /*int msec = delay_factor * delay_factor * delay_factor;*/ 1645c1734 < j_ptr = &inventory[INVEN_BOW]; --- > j_ptr = &(p_ptr->inventory[INVEN_BOW]); 1658,1664d1746 < /* Get an item (from inven or floor) */ < if (!get_item(&item, "Fire which item? ", FALSE, TRUE, TRUE)) < { < if (item == -2) msg_print("You have nothing to fire."); < return; < } < 1668c1750 < o_ptr = &inventory[item]; --- > o_ptr = &(p_ptr->inventory[item]); 1676,1677c1758,1762 < /* Get a direction (or cancel) */ < if (!get_aim_dir(&dir)) return; --- > if (o_ptr->tval != p_ptr->tval_ammo) > { > msg_print("You cannot fire that!"); > return; > } 1776c1861 < energy_use = (100 / thits); --- > p_ptr->energy_use = (100 / thits); 1780,1781c1865,1866 < y = py; < x = px; --- > y = p_ptr->py; > x = p_ptr->px; 1784,1785c1869,1870 < tx = px + 99 * ddx[dir]; < ty = py + 99 * ddy[dir]; --- > tx = p_ptr->px + 99 * ddx[dir]; > ty = p_ptr->py + 99 * ddy[dir]; 1788c1873 < if ((dir == 5) && target_okay()) --- > if ((dir == 5) && target_okay(Ind)) 1790,1791c1875,1876 < tx = target_col; < ty = target_row; --- > tx = p_ptr->target_col; > ty = p_ptr->target_row; 1796c1881 < handle_stuff(); --- > handle_stuff(Ind); 1808c1893 < mmove2(&ny, &nx, py, px, ty, tx); --- > mmove2(&ny, &nx, p_ptr->py, p_ptr->px, ty, tx); 1811c1896 < if (!cave_floor_bold(ny, nx)) break; --- > if (!cave_floor_bold(Depth, ny, nx)) break; 1825c1910,1911 < print_rel(missile_char, missile_attr, y, x); --- > /* Sorry, this will come back later --KLJ-- */ > /*print_rel(missile_char, missile_attr, y, x); 1830c1916 < Term_fresh(); --- > Term_fresh();*/ 1837c1923 < Term_xtra(TERM_XTRA_DELAY, msec); --- > /*Term_xtra(TERM_XTRA_DELAY, msec);*/ 1842c1928 < if (cave[y][x].m_idx) --- > if (cave[Depth][y][x].m_idx) 1844c1930 < cave_type *c_ptr = &cave[y][x]; --- > cave_type *c_ptr = &cave[Depth][y][x]; 1850c1936 < visible = m_ptr->ml; --- > visible = p_ptr->mon_vis[c_ptr->m_idx]; 1856c1942 < if (test_hit_fire(chance - cur_dis, r_ptr->ac, m_ptr->ml)) --- > if (test_hit_fire(chance - cur_dis, r_ptr->ac, visible)) 1893c1979 < if (m_ptr->ml) recent_track(m_ptr->r_idx); --- > if (visible) recent_track(m_ptr->r_idx); 1896c1982 < if (m_ptr->ml) health_track(c_ptr->m_idx); --- > if (visible) health_track(c_ptr->m_idx); 1926c2012 < if (fear && m_ptr->ml) --- > if (fear && visible) 1951c2037 < drop_near(o_ptr, j, y, x); --- > drop_near(o_ptr, j, Depth, y, x); 1965c2051 < void do_cmd_throw(void) --- > void do_cmd_throw(int int dir, int item) 1967c2053,2055 < int dir, item; --- > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 1983c2071 < int msec = delay_factor * delay_factor * delay_factor; --- > /*int msec = delay_factor * delay_factor * delay_factor;*/ 1986,1992d2073 < /* Get an item (from inven or floor) */ < if (!get_item(&item, "Throw which item? ", FALSE, TRUE, TRUE)) < { < if (item == -2) msg_print("You have nothing to throw."); < return; < } < 1996c2077 < o_ptr = &inventory[item]; --- > o_ptr = &(p_ptr->inventory[item]); 2004,2005d2084 < /* Get a direction (or cancel) */ < if (!get_aim_dir(&dir)) return; 2007d2085 < 2058c2136 < energy_use = 100; --- > p_ptr->energy_use = 100; 2062,2063c2140,2141 < y = py; < x = px; --- > y = p_ptr->py; > x = p_ptr->px; 2066,2067c2144,2145 < tx = px + 99 * ddx[dir]; < ty = py + 99 * ddy[dir]; --- > tx = p_ptr->px + 99 * ddx[dir]; > ty = p_ptr->py + 99 * ddy[dir]; 2070c2148 < if ((dir == 5) && target_okay()) --- > if ((dir == 5) && target_okay(Ind)) 2072,2073c2150,2151 < tx = target_col; < ty = target_row; --- > tx = p_ptr->target_col; > ty = p_ptr->target_row; 2078c2156 < handle_stuff(); --- > handle_stuff(Ind); 2090c2168 < mmove2(&ny, &nx, py, px, ty, tx); --- > mmove2(&ny, &nx, p_ptr->py, p_ptr->px, ty, tx); 2107c2185 < print_rel(missile_char, missile_attr, y, x); --- > /*print_rel(missile_char, missile_attr, y, x); 2112c2190 < Term_fresh(); --- > Term_fresh();*/ 2119c2197 < Term_xtra(TERM_XTRA_DELAY, msec); --- > /*Term_xtra(TERM_XTRA_DELAY, msec);*/ 2124c2202 < if (cave[y][x].m_idx) --- > if (cave[Depth][y][x].m_idx) 2126c2204 < cave_type *c_ptr = &cave[y][x]; --- > cave_type *c_ptr = &cave[Depth][y][x]; 2132c2210 < visible = m_ptr->ml; --- > visible = p_ptr->mon_vis[c_ptr->m_idx]; 2138c2216 < if (test_hit_fire(chance - cur_dis, r_ptr->ac, m_ptr->ml)) --- > if (test_hit_fire(chance - cur_dis, r_ptr->ac, visible)) 2175c2253 < if (m_ptr->ml) recent_track(m_ptr->r_idx); --- > if (visible) recent_track(m_ptr->r_idx); 2178c2256 < if (m_ptr->ml) health_track(c_ptr->m_idx); --- > if (visible) health_track(c_ptr->m_idx); 2208c2286 < if (fear && m_ptr->ml) --- > if (fear && visible) 2233c2311 < drop_near(o_ptr, j, y, x); --- > drop_near(o_ptr, j, Depth, y, x); diff -r src-280/cmd3.c mangband-000/src/server/cmd3.c 12a13,14 > #define SERVER > 24c26 < static void inven_takeoff(int item, int amt) --- > static void inven_takeoff(int int item, int amt) 25a28,29 > player_type *p_ptr = Players[Ind]; > 37c41 < o_ptr = &inventory[item]; --- > o_ptr = &(p_ptr->inventory[item]); 82a87,89 > > /* Window stuff */ > p_ptr->window |= (PW_EQUIP); 91c98 < static void inven_drop(int item, int amt) --- > static void inven_drop(int int item, int amt) 92a100,101 > player_type *p_ptr = Players[Ind]; > 102c111 < o_ptr = &inventory[item]; --- > o_ptr = &(p_ptr->inventory[item]); 150c159 < drop_near(&tmp_obj, 0, py, px); --- > drop_near(&tmp_obj, 0, p_ptr->dun_depth, p_ptr->py, p_ptr->px); 163a173,174 > * > * This is handled by the client now --KLJ-- 167c178 < char out_val[160]; --- > /*char out_val[160];*/ 171c182 < command_wrk = FALSE; --- > /*command_wrk = FALSE;*/ 175c186 < Term_save(); --- > /*Term_save();*/ 178c189 < item_tester_full = TRUE; --- > /*item_tester_full = TRUE;*/ 181c192 < show_inven(); --- > /*show_inven();*/ 184c195 < item_tester_full = FALSE; --- > /*item_tester_full = FALSE;*/ 187,188c198,199 < sprintf(out_val, "Inventory (carrying %d.%d pounds). Command: ", < total_weight / 10, total_weight % 10); --- > /*sprintf(out_val, "Inventory (carrying %d.%d pounds). Command: ", > total_weight / 10, total_weight % 10);*/ 191c202 < prt(out_val, 0, 0); --- > /*prt(out_val, 0, 0);*/ 194c205 < command_new = inkey(); --- > /*command_new = inkey();*/ 197c208 < Term_load(); --- > /*Term_load();*/ 201,202c212,213 < if (command_new == ESCAPE) < { --- > /*if (command_new == ESCAPE) > {*/ 204c215 < command_new = 0; --- > /*command_new = 0; 206c217 < } --- > }*/ 209,210c220,221 < else < { --- > /*else > {*/ 212,213c223,224 < command_see = TRUE; < } --- > /*command_see = TRUE; > }*/ 218a230,231 > * > * This is handled be the client --KLJ-- 222c235 < char out_val[160]; --- > /*char out_val[160];*/ 226c239 < command_wrk = TRUE; --- > /*command_wrk = TRUE;*/ 230c243 < Term_save(); --- > /*Term_save();*/ 233c246 < item_tester_full = TRUE; --- > /*item_tester_full = TRUE;*/ 236c249 < show_equip(); --- > /*show_equip();*/ 239c252 < item_tester_full = FALSE; --- > /*item_tester_full = FALSE;*/ 242,243c255,256 < sprintf(out_val, "Equipment (carrying %d.%d pounds). Command: ", < total_weight / 10, total_weight % 10); --- > /*sprintf(out_val, "Equipment (carrying %d.%d pounds). Command: ", > total_weight / 10, total_weight % 10);*/ 246c259 < prt(out_val, 0, 0); --- > /*prt(out_val, 0, 0);*/ 249c262 < command_new = inkey(); --- > /*command_new = inkey();*/ 252c265 < Term_load(); --- > /*Term_load();*/ 256,257c269,270 < if (command_new == ESCAPE) < { --- > /*if (command_new == ESCAPE) > {*/ 259c272 < command_new = 0; --- > /*command_new = 0; 261c274 < } --- > }*/ 264,265c277,278 < else < { --- > /*else > {*/ 267,268c280,281 < command_see = TRUE; < } --- > /*command_see = TRUE; > }*/ 275c288 < static bool item_tester_hook_wear(object_type *o_ptr) --- > static bool item_tester_hook_wear(int object_type *o_ptr) 288c301 < void do_cmd_wield(void) --- > void do_cmd_wield(int int item) 290c303,305 < int item, slot; --- > player_type *p_ptr = Players[Ind]; > > int slot; 300c315 < item_tester_hook = item_tester_hook_wear; --- > /*item_tester_hook = item_tester_hook_wear;*/ 302,307d316 < /* Get an item (from inven or floor) */ < if (!get_item(&item, "Wear/Wield which item? ", FALSE, TRUE, TRUE)) < { < if (item == -2) msg_print("You have nothing you can wear or wield."); < return; < } 312c321 < o_ptr = &inventory[item]; --- > o_ptr = &(p_ptr->inventory[item]); 321a331,336 > if (!item_tester_hook_wear(o_ptr)) > { > msg_print("You may not wield that item."); > return; > } > 326c341 < if (cursed_p(&inventory[slot])) --- > if (cursed_p(&(p_ptr->inventory[slot]))) 329c344 < object_desc(o_name, &inventory[slot], FALSE, 0); --- > object_desc(o_name, &(p_ptr->inventory[slot]), FALSE, 0); 338a354 > #if 0 340c356 < if ((inven_cnt >= INVEN_PACK) && --- > if ((p_ptr->inven_cnt >= INVEN_PACK) && 346a363 > #endif 350c367 < energy_use = 100; --- > p_ptr->energy_use = 100; 371c388 < o_ptr = &inventory[slot]; --- > o_ptr = &(p_ptr->inventory[slot]); 374c391 < if (inventory[slot].k_idx) inven_takeoff(slot, 255); --- > if (p_ptr->inventory[slot].k_idx) inven_takeoff(slot, 255); 382c399 < total_weight += o_ptr->weight; --- > p_ptr->total_weight += o_ptr->weight; 385c402 < equip_cnt++; --- > p_ptr->equip_cnt++; 439c456 < void do_cmd_takeoff(void) --- > void do_cmd_takeoff(int int item) 441c458 < int item; --- > player_type *p_ptr = Players[Ind]; 445a463 > #if 0 447c465 < if (inven_cnt >= INVEN_PACK) --- > if (p_ptr->inven_cnt >= INVEN_PACK) 452a471 > #endif 455,461d473 < /* Get an item (from equip) */ < if (!get_item(&item, "Take off which item? ", TRUE, FALSE, FALSE)) < { < if (item == -2) msg_print("You are not wearing anything to take off."); < return; < } < 465c477 < o_ptr = &inventory[item]; --- > o_ptr = &(p_ptr->inventory[item]); 487c499 < energy_use = 50; --- > p_ptr->energy_use = 50; 497c509 < void do_cmd_drop(void) --- > void do_cmd_drop(int int item, int quantity) 499c511 < int item, amt = 1; --- > player_type *p_ptr = Players[Ind]; 504,510d515 < /* Get an item (from equip or inven) */ < if (!get_item(&item, "Drop which item? ", TRUE, TRUE, FALSE)) < { < if (item == -2) msg_print("You have nothing to drop."); < return; < } < 514c519 < o_ptr = &inventory[item]; --- > o_ptr = &(p_ptr->inventory[item]); 535,539d539 < /* See how many items */ < if (o_ptr->number > 1) < { < /* Get a quantity */ < amt = get_quantity(NULL, o_ptr->number); 541,545c541 < /* Allow user abort */ < if (amt <= 0) return; < } < < --- > #if 0 547c543 < if (cave[py][px].o_idx) --- > if (cave[p_ptr->dun_depth][p_ptr->py][p_ptr->px].o_idx) 552a549 > #endif 556c553 < energy_use = 50; --- > p_ptr->energy_use = 50; 559c556 < inven_drop(item, amt); --- > inven_drop(item, quantity); 567c564 < void do_cmd_destroy(void) --- > void do_cmd_destroy(int int item, int quantity) 569c566,567 < int item, amt = 1; --- > player_type *p_ptr = Players[Ind]; > 578d575 < char out_val[160]; 580d576 < 585,591d580 < /* Get an item (from inven or floor) */ < if (!get_item(&item, "Destroy which item? ", FALSE, TRUE, TRUE)) < { < if (item == -2) msg_print("You have nothing to destroy."); < return; < } < 595c584 < o_ptr = &inventory[item]; --- > o_ptr = &(p_ptr->inventory[item]); 605,615d593 < /* See how many items */ < if (o_ptr->number > 1) < { < /* Get a quantity */ < amt = get_quantity(NULL, o_ptr->number); < < /* Allow user abort */ < if (amt <= 0) return; < } < < 618c596 < o_ptr->number = amt; --- > o_ptr->number = quantity; 621a600 > #if 0 628a608 > #endif 631c611 < energy_use = 100; --- > p_ptr->energy_use = 100; 666c646 < inven_item_increase(item, -amt); --- > inven_item_increase(item, -quantity); 674c654 < floor_item_increase(0 - item, -amt); --- > floor_item_increase(0 - item, -quantity); 684c664 < void do_cmd_observe(void) --- > void do_cmd_observe(int int item) 686c666 < int item; --- > player_type *p_ptr = Players[Ind]; 693,699d672 < /* Get an item (from equip or inven or floor) */ < if (!get_item(&item, "Examine which item? ", TRUE, TRUE, TRUE)) < { < if (item == -2) msg_print("You have nothing to examine."); < return; < } < 703c676 < o_ptr = &inventory[item]; --- > o_ptr = &(p_ptr->inventory[item]); 726a700 > #if 0 728a703 > #endif 737c712 < void do_cmd_uninscribe(void) --- > void do_cmd_uninscribe(int int item) 739c714 < int item; --- > player_type *p_ptr = Players[Ind]; 744,750d718 < /* Get an item (from equip or inven or floor) */ < if (!get_item(&item, "Un-inscribe which item? ", TRUE, TRUE, TRUE)) < { < if (item == -2) msg_print("You have nothing to un-inscribe."); < return; < } < 754c722 < o_ptr = &inventory[item]; --- > o_ptr = &(p_ptr->inventory[item]); 787c755 < void do_cmd_inscribe(void) --- > void do_cmd_inscribe(int int item, cptr inscription) 789c757 < int item; --- > player_type *p_ptr = Players[Ind]; 795d762 < char out_val[80]; 797,804d763 < < /* Get an item (from equip or inven or floor) */ < if (!get_item(&item, "Inscribe which item? ", TRUE, TRUE, TRUE)) < { < if (item == -2) msg_print("You have nothing to inscribe."); < return; < } < 808c767 < o_ptr = &inventory[item]; --- > o_ptr = &(p_ptr->inventory[item]); 824,825c783,784 < /* Start with nothing */ < strcpy(out_val, ""); --- > /* Save the inscription */ > o_ptr->note = quark_add(inscription); 827,832c786,787 < /* Use old inscription */ < if (o_ptr->note) < { < /* Start with the old inscription */ < strcpy(out_val, quark_str(o_ptr->note)); < } --- > /* Combine the pack */ > p_ptr->notice |= (PN_COMBINE); 834,845c789,790 < /* Get a new inscription (possibly empty) */ < if (get_string("Inscription: ", out_val, 80)) < { < /* Save the inscription */ < o_ptr->note = quark_add(out_val); < < /* Combine the pack */ < p_ptr->notice |= (PN_COMBINE); < < /* Window stuff */ < p_ptr->window |= (PW_INVEN | PW_EQUIP); < } --- > /* Window stuff */ > p_ptr->window |= (PW_INVEN | PW_EQUIP); 870c815 < static void do_cmd_refill_lamp(void) --- > static void do_cmd_refill_lamp(int int item) 872c817 < int item; --- > player_type *p_ptr = Players[Ind]; 881,887d825 < /* Get an item (from inven or floor) */ < if (!get_item(&item, "Refill with which flask? ", FALSE, TRUE, TRUE)) < { < if (item == -2) msg_print("You have no flasks of oil."); < return; < } < 891c829 < o_ptr = &inventory[item]; --- > o_ptr = &(p_ptr->inventory[item]); 899a838,842 > if (!item_tester_hook(o_ptr)) > { > msg_print("You cannot refill with that!"); > return; > } 900a844 > 902c846 < energy_use = 50; --- > p_ptr->energy_use = 50; 905c849 < j_ptr = &inventory[INVEN_LITE]; --- > j_ptr = &(p_ptr->inventory[INVEN_LITE]); 959c903 < static void do_cmd_refill_torch(void) --- > static void do_cmd_refill_torch(int int item) 961c905 < int item; --- > player_type *p_ptr = Players[Ind]; 970,976d913 < /* Get an item (from inven or floor) */ < if (!get_item(&item, "Refuel with which torch? ", FALSE, TRUE, TRUE)) < { < if (item == -2) msg_print("You have no extra torches."); < return; < } < 980c917 < o_ptr = &inventory[item]; --- > o_ptr = &(p_ptr->inventory[item]); 988a926,930 > if (!item_tester_hook(o_ptr)) > { > msg_print("You cannot refill with that!"); > return; > } 989a932 > 991c934 < energy_use = 50; --- > p_ptr->energy_use = 50; 994c937 < j_ptr = &inventory[INVEN_LITE]; --- > j_ptr = &(p_ptr->inventory[INVEN_LITE]); 1041c984 < void do_cmd_refill(void) --- > void do_cmd_refill(int int item) 1042a986,987 > player_type *p_ptr = Players[Ind]; > 1046c991 < o_ptr = &inventory[INVEN_LITE]; --- > o_ptr = &(p_ptr->inventory[INVEN_LITE]); 1057c1002 < do_cmd_refill_lamp(); --- > do_cmd_refill_lamp(item); 1063c1008 < do_cmd_refill_torch(); --- > do_cmd_refill_torch(item); 1081c1026 < void do_cmd_target(void) --- > void do_cmd_target(int int dir) 1084c1029 < if (target_set()) --- > if (target_set(dir)) 1090c1035 < msg_print("Target Aborted."); --- > /*msg_print("Target Aborted.");*/ 1114c1059 < static int do_cmd_look_aux(int y, int x) --- > static int do_cmd_look_aux(int int y, int x) 1116c1061,1062 < cave_type *c_ptr = &cave[y][x]; --- > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; 1117a1064,1066 > cave_type *c_ptr = &cave[Depth][y][x]; > byte *w_ptr = &p_ptr->cave_flag[y][x]; > 1140c1089 < if ((y == py) && (x == px)) --- > if ((y == p_ptr->py) && (x == p_ptr->px)) 1150c1099 < if (!(c_ptr->info & CAVE_MARK)) feat = FEAT_NONE; --- > if (!(*w_ptr & CAVE_MARK)) feat = FEAT_NONE; 1155c1104 < if (c_ptr->m_idx && m_ptr->ml) --- > if (c_ptr->m_idx && p_ptr->mon_vis[c_ptr->m_idx]) 1167c1116 < handle_stuff(); --- > handle_stuff(Ind); 1170c1119,1120 < sprintf(out_val, "%s%s%s (%s) [(r)ecall]", --- > /* No prompt for recall --KLJ-- */ > sprintf(out_val, "%s%s%s (%s)", 1172d1121 < prt(out_val, 0, 0); 1173a1123,1125 > /* Send this as a message to player --KLJ--*/ > msg_print(out_val); > 1175,1176c1127,1129 < move_cursor_relative(y, x); < query = inkey(); --- > /* Nope --KLJ-- */ > /*move_cursor_relative(y, x); > query = inkey();*/ 1178,1195d1130 < /* Recall as needed */ < while (query == 'r') < { < /* Recall */ < Term_save(); < screen_roff(m_ptr->r_idx); < Term_addstr(-1, TERM_WHITE, " --pause--"); < query = inkey(); < Term_load(); < < /* Continue if desired */ < if (query != ' ') return (query); < < /* Get a new command */ < move_cursor_relative(y, x); < query = inkey(); < } < 1218c1153 < if (c_ptr->o_idx && o_ptr->marked) --- > if (c_ptr->o_idx && p_ptr->obj_vis[c_ptr->o_idx]) 1224,1227c1159,1161 < sprintf(out_val, "%s%s%s. --pause--", s1, s2, o_name); < prt(out_val, 0, 0); < move_cursor_relative(y, x); < query = inkey(); --- > sprintf(out_val, "%s%s%s.", s1, s2, o_name); > /* Send a message instead --KLJ-- */ > msg_print(out_val); 1228a1163,1165 > /*move_cursor_relative(y, x); > query = inkey();*/ > 1268,1271c1205 < sprintf(out_val, "%s%s%s%s. --pause--", s1, p1, p2, name); < prt(out_val, 0, 0); < move_cursor_relative(y, x); < query = inkey(); --- > sprintf(out_val, "%s%s%s%s.", s1, p1, p2, name); 1272a1207,1209 > /* Send a message to the player --KLJ-- */ > msg_print(out_val); > 1286c1223 < * Hack -- determine if a given location is "interesting" --- > * Hack -- determine if a given location is "interesting" to a player 1288c1225 < static bool do_cmd_look_accept(int y, int x) --- > static bool do_cmd_look_accept(int int y, int x) 1289a1227,1229 > player_type *p_ptr = Players[Ind]; > int Depth = p_ptr->dun_depth; > 1290a1231 > byte *w_ptr; 1294c1235 < if ((y == py) && (x == px)) return (TRUE); --- > if ((y == p_ptr->py) && (x == p_ptr->px)) return (TRUE); 1298c1239,1240 < c_ptr = &cave[y][x]; --- > c_ptr = &cave[Depth][y][x]; > w_ptr = &p_ptr->cave_flag[y][x]; 1303,1304d1244 < monster_type *m_ptr = &m_list[c_ptr->m_idx]; < 1306c1246 < if (m_ptr->ml) return (TRUE); --- > if (p_ptr->mon_vis[c_ptr->m_idx]) return (TRUE); 1312,1313d1251 < object_type *o_ptr = &o_list[c_ptr->o_idx]; < 1315c1253 < if (o_ptr->marked) return (TRUE); --- > if (p_ptr->obj_vis[c_ptr->o_idx]) return (TRUE); 1319c1257 < if (c_ptr->info & CAVE_MARK) --- > if (*w_ptr & CAVE_MARK) 1366c1304 < void do_cmd_look(void) --- > void do_cmd_look(int int dir) 1368c1306 < int y, x, i, d, m; --- > player_type *p_ptr = Players[Ind]; 1370c1308 < bool done = FALSE; --- > int y, x, i; 1391,1394c1329,1330 < temp_n = 0; < < /* Scan the current panel */ < for (y = panel_row_min; y <= panel_row_max; y++) --- > /* Only if this is the first time, or if we've been asked to reset */ > if (dir == 0) 1396,1399c1332 < for (x = panel_col_min; x <= panel_col_max; x++) < { < /* Require line of sight, unless "look" is "expanded" */ < if (!expand_look && !player_has_los_bold(y, x)) continue; --- > p_ptr->temp_n = 0; 1401,1440c1334,1335 < /* Require interesting contents */ < if (!do_cmd_look_accept(y, x)) continue; < < /* Save the location */ < temp_x[temp_n] = x; < temp_y[temp_n] = y; < temp_n++; < } < } < < /* Paranoia */ < if (!temp_n) < { < msg_print("You see nothing special."); < return; < } < < < /* Set the sort hooks */ < ang_sort_comp = ang_sort_comp_distance; < ang_sort_swap = ang_sort_swap_distance; < < /* Sort the positions */ < ang_sort(temp_x, temp_y, temp_n); < < < /* Start near the player */ < m = 0; < < /* Interact */ < while (!done) < { < /* Describe and Prompt */ < query = do_cmd_look_aux(temp_y[m], temp_x[m]); < < /* Assume no "direction" */ < d = 0; < < /* Analyze (non "recall") command */ < switch (query) --- > /* Scan the current panel */ > for (y = p_ptr->panel_row_min; y <= p_ptr->panel_row_max; y++) 1442,1443c1337 < case ESCAPE: < case 'q': --- > for (x = p_ptr->panel_col_min; x <= p_ptr->panel_col_max; x++) 1445,1446c1339,1348 < done = TRUE; < break; --- > /* Require line of sight, unless "look" is "expanded" */ > if (!expand_look && !player_has_los_bold(y, x)) continue; > > /* Require interesting contents */ > if (!do_cmd_look_accept(y, x)) continue; > > /* Save the location */ > p_ptr->temp_x[p_ptr->temp_n] = x; > p_ptr->temp_y[p_ptr->temp_n] = y; > p_ptr->temp_n++; 1447a1350 > } 1449,1459c1352,1353 < case '*': < case '+': < case ' ': < { < if (++m == temp_n) < { < m = 0; < if (!expand_list) done = TRUE; < } < break; < } --- > /* Start near the player */ > p_ptr->look_index = 0; 1461,1476c1355,1359 < case '-': < { < if (m-- == 0) < { < m = temp_n - 1; < if (!expand_list) done = TRUE; < } < break; < } < < default: < { < d = keymap_dirs[query & 0x7F]; < if (!d) bell(); < break; < } --- > /* Paranoia */ > if (!p_ptr->temp_n) > { > msg_print("You see nothing special."); > return; 1477a1361,1369 > > > /* Set the sort hooks */ > ang_sort_comp = ang_sort_comp_distance; > ang_sort_swap = ang_sort_swap_distance; > > /* Sort the positions */ > ang_sort(p_ptr->temp_x, p_ptr->temp_y, p_ptr->temp_n); > } 1479,1483c1371,1375 < /* Motion */ < if (d) < { < /* Find a new grid if possible */ < i = target_pick(temp_y[m], temp_x[m], ddy[d], ddx[d]); --- > /* Motion */ > if (dir) > { > /* Find a new grid if possible */ > i = target_pick(p_ptr->temp_y[p_ptr->look_index], p_ptr->temp_x[p_ptr->look_index], ddy[dir], ddx[dir]); 1485,1487c1377,1378 < /* Use that grid */ < if (i >= 0) m = i; < } --- > /* Use that grid */ > if (i >= 0) p_ptr->look_index = i; 1490,1491c1381,1382 < /* Clear the prompt */ < prt("", 0, 0); --- > /* Describe and Prompt */ > query = do_cmd_look_aux(p_ptr->temp_y[p_ptr->look_index], p_ptr->temp_x[p_ptr->look_index]); 1500c1391 < void do_cmd_locate(void) --- > void do_cmd_locate(int int dir) 1502c1393 < int dir, y1, x1, y2, x2; --- > player_type *p_ptr = Players[Ind]; 1503a1395,1396 > int y1, x1, y2, x2; > 1510,1511c1403,1404 < y2 = y1 = panel_row; < x2 = x1 = panel_col; --- > y2 = y1 = p_ptr->panel_row; > x2 = x1 = p_ptr->panel_col; 1513,1514c1406,1407 < /* Show panels until done */ < while (1) --- > /* Describe the location */ > if ((y2 == y1) && (x2 == x1)) 1516,1526c1409,1416 < /* Describe the location */ < if ((y2 == y1) && (x2 == x1)) < { < tmp_val[0] = '\0'; < } < else < { < sprintf(tmp_val, "%s%s of", < ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""), < ((x2 < x1) ? " West" : (x2 > x1) ? " East" : "")); < } --- > tmp_val[0] = '\0'; > } > else > { > sprintf(tmp_val, "%s%s of", > ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""), > ((x2 < x1) ? " West" : (x2 > x1) ? " East" : "")); > } 1528,1531c1418,1421 < /* Prepare to ask which way to look */ < sprintf(out_val, < "Map sector [%d,%d], which is%s your sector. Direction?", < y2, x2, tmp_val); --- > /* Prepare to ask which way to look */ > sprintf(out_val, > "Map sector [%d,%d], which is%s your sector. Direction?", > y2, x2, tmp_val); 1533,1534c1423 < /* Assume no direction */ < dir = 0; --- > msg_print(out_val); 1536,1539c1425,1426 < /* Get a direction */ < while (!dir) < { < char command; --- > /* No direction */ > if (!dir) return; 1541,1542c1428,1430 < /* Get a command (or Cancel) */ < if (!get_com(out_val, &command)) break; --- > /* Apply the motion */ > y2 += ddy[dir]; > x2 += ddx[dir]; 1544,1545c1432,1434 < /* Extract direction */ < dir = keymap_dirs[command & 0x7F]; --- > /* Verify the row */ > if (y2 > p_ptr->max_panel_rows) y2 = p_ptr->max_panel_rows; > else if (y2 < 0) y2 = 0; 1547,1549c1436,1438 < /* Error */ < if (!dir) bell(); < } --- > /* Verify the col */ > if (x2 > p_ptr->max_panel_cols) x2 = p_ptr->max_panel_cols; > else if (x2 < 0) x2 = 0; 1551,1587d1439 < /* No direction */ < if (!dir) break; < < /* Apply the motion */ < y2 += ddy[dir]; < x2 += ddx[dir]; < < /* Verify the row */ < if (y2 > max_panel_rows) y2 = max_panel_rows; < else if (y2 < 0) y2 = 0; < < /* Verify the col */ < if (x2 > max_panel_cols) x2 = max_panel_cols; < else if (x2 < 0) x2 = 0; < < /* Handle "changes" */ < if ((y2 != panel_row) || (x2 != panel_col)) < { < /* Save the new panel info */ < panel_row = y2; < panel_col = x2; < < /* Recalculate the boundaries */ < panel_bounds(); < < /* Update stuff */ < p_ptr->update |= (PU_MONSTERS); < < /* Redraw map */ < p_ptr->redraw |= (PR_MAP); < < /* Handle stuff */ < handle_stuff(); < } < } < < 1589c1441 < verify_panel(); --- > verify_panel(Ind); 1601c1453 < handle_stuff(); --- > handle_stuff(Ind); 1721c1573,1574 < static bool ang_sort_comp_hook(vptr u, vptr v, int a, int b) --- > #if 0 > static bool ang_sort_comp_hook(int vptr u, vptr v, int a, int b) 1731a1585 > Ind = Ind; 1787a1642 > #endif 1796c1651,1652 < static void ang_sort_swap_hook(vptr u, vptr v, int a, int b) --- > #if 0 > static void ang_sort_swap_hook(int vptr u, vptr v, int a, int b) 1804a1661,1662 > Ind = Ind; > 1809a1668 > #endif 1812d1670 < 1814,1865c1672 < * Hack -- Display the "name" and "attr/chars" of a monster race < */ < static void roff_top(int r_idx) < { < monster_race *r_ptr = &r_info[r_idx]; < < byte a1, a2; < char c1, c2; < < < /* Access the chars */ < c1 = r_ptr->d_char; < c2 = r_ptr->x_char; < < /* Access the attrs */ < a1 = r_ptr->d_attr; < a2 = r_ptr->x_attr; < < /* Hack -- fake monochrome */ < if (!use_color) a1 = TERM_WHITE; < if (!use_color) a2 = TERM_WHITE; < < < /* Clear the top line */ < Term_erase(0, 0, 255); < < /* Reset the cursor */ < Term_gotoxy(0, 0); < < /* A title (use "The" for non-uniques) */ < if (!(r_ptr->flags1 & RF1_UNIQUE)) < { < Term_addstr(-1, TERM_WHITE, "The "); < } < < /* Dump the name */ < Term_addstr(-1, TERM_WHITE, (r_name + r_ptr->name)); < < /* Append the "standard" attr/char info */ < Term_addstr(-1, TERM_WHITE, " ('"); < Term_addch(a1, c1); < Term_addstr(-1, TERM_WHITE, "')"); < < /* Append the "optional" attr/char info */ < Term_addstr(-1, TERM_WHITE, "/('"); < Term_addch(a2, c2); < Term_addstr(-1, TERM_WHITE, "'):"); < } < < < /* < * Identify a character, allow recall of monsters --- > * Identify a character 1867,1873d1673 < * Several "special" responses recall "mulitple" monsters: < * ^A (all monsters) < * ^U (all unique monsters) < * ^N (all non-unique monsters) < * < * The responses may be sorted in several ways, see below. < * 1876c1676 < void do_cmd_query_symbol(void) --- > void do_cmd_query_symbol(int char sym) 1878,1879c1678 < int i, n, r_idx; < char sym, query; --- > int i; 1882,1884d1680 < bool all = FALSE; < bool uniq = FALSE; < bool norm = FALSE; 1886c1682,1684 < bool recall = FALSE; --- > /* If no symbol, abort --KLJ-- */ > if (!sym) > return; 1888,1894d1685 < u16b why = 0; < u16b who[MAX_R_IDX]; < < < /* Get a character, or abort */ < if (!get_com("Enter character to be identified: ", &sym)) return; < 1902c1693 < if (sym == KTRL('A')) --- > if (ident_info[i]) 1904,1918d1694 < all = TRUE; < strcpy(buf, "Full monster list."); < } < else if (sym == KTRL('U')) < { < all = uniq = TRUE; < strcpy(buf, "Unique monster list."); < } < else if (sym == KTRL('N')) < { < all = norm = TRUE; < strcpy(buf, "Non-unique monster list."); < } < else if (ident_info[i]) < { 1927,2072c1703 < prt(buf, 0, 0); < < < /* Collect matching monsters */ < for (n = 0, i = 1; i < MAX_R_IDX-1; i++) < { < monster_race *r_ptr = &r_info[i]; < < /* Nothing to recall */ < if (!cheat_know && !r_ptr->r_sights) continue; < < /* Require non-unique monsters if needed */ < if (norm && (r_ptr->flags1 & RF1_UNIQUE)) continue; < < /* Require unique monsters if needed */ < if (uniq && !(r_ptr->flags1 & RF1_UNIQUE)) continue; < < /* Collect "appropriate" monsters */ < if (all || (r_ptr->d_char == sym)) who[n++] = i; < } < < /* Nothing to recall */ < if (!n) return; < < < /* Prompt XXX XXX XXX */ < put_str("Recall details? (k/p/y/n): ", 0, 40); < < /* Query */ < query = inkey(); < < /* Restore */ < prt(buf, 0, 0); < < < /* Sort by kills (and level) */ < if (query == 'k') < { < why = 4; < query = 'y'; < } < < /* Sort by level */ < if (query == 'p') < { < why = 2; < query = 'y'; < } < < /* Catch "escape" */ < if (query != 'y') return; < < < /* Sort if needed */ < if (why) < { < /* Select the sort method */ < ang_sort_comp = ang_sort_comp_hook; < ang_sort_swap = ang_sort_swap_hook; < < /* Sort the array */ < ang_sort(who, &why, n); < } < < < /* Start at the end */ < i = n - 1; < < /* Scan the monster memory */ < while (1) < { < /* Extract a race */ < r_idx = who[i]; < < /* Hack -- Auto-recall */ < recent_track(r_idx); < < /* Hack -- Handle stuff */ < handle_stuff(); < < /* Hack -- Begin the prompt */ < roff_top(r_idx); < < /* Hack -- Complete the prompt */ < Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]"); < < /* Interact */ < while (1) < { < /* Recall */ < if (recall) < { < /* Save the screen */ < Term_save(); < < /* Recall on screen */ < screen_roff(who[i]); < < /* Hack -- Complete the prompt (again) */ < Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]"); < } < < /* Command */ < query = inkey(); < < /* Unrecall */ < if (recall) < { < /* Restore */ < Term_load(); < } < < /* Normal commands */ < if (query != 'r') break; < < /* Toggle recall */ < recall = !recall; < } < < /* Stop scanning */ < if (query == ESCAPE) break; < < /* Move to "prev" monster */ < if (query == '-') < { < if (++i == n) < { < i = 0; < if (!expand_list) break; < } < } < < /* Move to "next" monster */ < else < { < if (i-- == 0) < { < i = n - 1; < if (!expand_list) break; < } < } < } < < < /* Re-display the identity */ < prt(buf, 0, 0); --- > msg_print(buf); diff -r src-280/cmd4.c mangband-000/src/server/cmd4.c 12a13,14 > #define SERVER > 22a25,26 > * > * This doesn't need to be in the server --KLJ-- 26,88d29 < int j; < < term *old = Term; < < < /* Hack -- react to changes */ < Term_xtra(TERM_XTRA_REACT, 0); < < < /* Verify the keymap */ < keymap_init(); < < < /* Combine and Reorder the pack (later) */ < p_ptr->notice |= (PN_COMBINE | PN_REORDER); < < < /* Update torch */ < p_ptr->update |= (PU_TORCH); < < /* Update stuff */ < p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS); < < /* Forget lite/view */ < p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE); < < /* Update lite/view */ < p_ptr->update |= (PU_VIEW | PU_LITE); < < /* Update monsters */ < p_ptr->update |= (PU_MONSTERS); < < /* Redraw everything */ < p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP); < < /* Window stuff */ < p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER); < < /* Window stuff */ < p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_MONSTER | PW_OBJECT); < < /* Hack -- update */ < handle_stuff(); < < < /* Redraw every window */ < for (j = 0; j < 8; j++) < { < /* Dead window */ < if (!ang_term[j]) continue; < < /* Activate */ < Term_activate(ang_term[j]); < < /* Redraw */ < Term_redraw(); < < /* Refresh */ < Term_fresh(); < < /* Restore */ < Term_activate(old); < } 93a35,36 > * > * This isn't allowed anymore --KLJ-- 97,180d39 < char c; < < bool flag; < < bool history = FALSE; < < char tmp[160]; < < < /* Enter "icky" mode */ < character_icky = TRUE; < < /* Save the screen */ < Term_save(); < < /* Get command */ < for (flag = FALSE; !flag; ) < { < /* Display the player */ < display_player(history); < < /* Prompt */ < prt("['C' to change name, 'F' to dump file, 'H' for history, or ESCAPE]", 21, 2); < < /* Query */ < c = inkey(); < < /* Handle */ < switch (c) < { < case 'C': < case 'c': < { < get_name(); < flag = TRUE; < break; < } < < case 'F': < case 'f': < { < sprintf(tmp, "%s.txt", player_base); < if (get_string("File name: ", tmp, 80)) < { < if (tmp[0] && (tmp[0] != ' ')) < { < file_character(tmp, FALSE); < } < } < break; < } < < case 'H': < case 'h': < { < history = !history; < break; < } < < case ESCAPE: < case ' ': < case '\n': < case '\r': < { < flag = TRUE; < break; < } < < default: < { < bell(); < break; < } < } < < /* Flush messages */ < msg_print(NULL); < } < < /* Restore the screen */ < Term_load(); < < /* Leave "icky" mode */ < character_icky = FALSE; 185a45,46 > * > * This should be handled by the client --KLJ-- 189,190d49 < /* Recall one message XXX XXX XXX */ < prt(format("> %s", message_str(0)), 0, 0); 207a67,68 > * > * This is in the client code --KLJ-- 211,383d71 < int i, j, k, n, q; < < char shower[80] = ""; < char finder[80] = ""; < < < /* Total messages */ < n = message_num(); < < /* Start on first message */ < i = 0; < < /* Start at leftmost edge */ < q = 0; < < < /* Enter "icky" mode */ < character_icky = TRUE; < < /* Save the screen */ < Term_save(); < < /* Process requests until done */ < while (1) < { < /* Clear screen */ < Term_clear(); < < /* Dump up to 20 lines of messages */ < for (j = 0; (j < 20) && (i + j < n); j++) < { < byte a = TERM_WHITE; < < cptr str = message_str(i+j); < < /* Apply horizontal scroll */ < str = (strlen(str) >= q) ? (str + q) : ""; < < /* Handle "shower" */ < if (shower[0] && strstr(str, shower)) a = TERM_YELLOW; < < /* Dump the messages, bottom to top */ < Term_putstr(0, 21-j, -1, a, str); < } < < /* Display header XXX XXX XXX */ < prt(format("Message Recall (%d-%d of %d), Offset %d", < i, i+j-1, n, q), 0, 0); < < /* Display prompt (not very informative) */ < prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", 23, 0); < < /* Get a command */ < k = inkey(); < < /* Exit on Escape */ < if (k == ESCAPE) break; < < /* Hack -- Save the old index */ < j = i; < < /* Horizontal scroll */ < if (k == '4') < { < /* Scroll left */ < q = (q >= 40) ? (q - 40) : 0; < < /* Success */ < continue; < } < < /* Horizontal scroll */ < if (k == '6') < { < /* Scroll right */ < q = q + 40; < < /* Success */ < continue; < } < < /* Hack -- handle show */ < if (k == '=') < { < /* Prompt */ < prt("Show: ", 23, 0); < < /* Get a "shower" string, or continue */ < if (!askfor_aux(shower, 80)) continue; < < /* Okay */ < continue; < } < < /* Hack -- handle find */ < if (k == '/') < { < int z; < < /* Prompt */ < prt("Find: ", 23, 0); < < /* Get a "finder" string, or continue */ < if (!askfor_aux(finder, 80)) continue; < < /* Scan messages */ < for (z = i + 1; z < n; z++) < { < cptr str = message_str(z); < < /* Handle "shower" */ < if (strstr(str, finder)) < { < /* New location */ < i = z; < < /* Done */ < break; < } < } < } < < /* Recall 1 older message */ < if ((k == '8') || (k == '\n') || (k == '\r')) < { < /* Go newer if legal */ < if (i + 1 < n) i += 1; < } < < /* Recall 10 older messages */ < if (k == '+') < { < /* Go older if legal */ < if (i + 10 < n) i += 10; < } < < /* Recall 20 older messages */ < if ((k == 'p') || (k == KTRL('P')) || (k == ' ')) < { < /* Go older if legal */ < if (i + 20 < n) i += 20; < } < < /* Recall 20 newer messages */ < if ((k == 'n') || (k == KTRL('N'))) < { < /* Go newer (if able) */ < i = (i >= 20) ? (i - 20) : 0; < } < < /* Recall 10 newer messages */ < if (k == '-') < { < /* Go newer (if able) */ < i = (i >= 10) ? (i - 10) : 0; < } < < /* Recall 1 newer messages */ < if (k == '2') < { < /* Go newer (if able) */ < i = (i >= 1) ? (i - 1) : 0; < } < < /* Hack -- Error of some kind */ < if (i == j) bell(); < } < < /* Restore the screen */ < Term_load(); < < /* Leave "icky" mode */ < character_icky = FALSE; 387d74 < 389,798d75 < * Number of cheating options < */ < #define CHEAT_MAX 6 < < /* < * Cheating options < */ < static option_type cheat_info[CHEAT_MAX] = < { < { &cheat_peek, FALSE, 255, 0x01, 0x00, < "cheat_peek", "Peek into object creation" }, < < { &cheat_hear, FALSE, 255, 0x02, 0x00, < "cheat_hear", "Peek into monster creation" }, < < { &cheat_room, FALSE, 255, 0x04, 0x00, < "cheat_room", "Peek into dungeon creation" }, < < { &cheat_xtra, FALSE, 255, 0x08, 0x00, < "cheat_xtra", "Peek into something else" }, < < { &cheat_know, FALSE, 255, 0x10, 0x00, < "cheat_know", "Know complete monster info" }, < < { &cheat_live, FALSE, 255, 0x20, 0x00, < "cheat_live", "Allow player to avoid death" } < }; < < < /* < * Interact with some options for cheating < */ < static void do_cmd_options_cheat(cptr info) < { < char ch; < < int i, k = 0, n = CHEAT_MAX; < < char buf[80]; < < < /* Clear screen */ < Term_clear(); < < /* Interact with the player */ < while (TRUE) < { < /* Prompt XXX XXX XXX */ < sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info); < prt(buf, 0, 0); < < /* Display the options */ < for (i = 0; i < n; i++) < { < byte a = TERM_WHITE; < < /* Color current option */ < if (i == k) a = TERM_L_BLUE; < < /* Display the option text */ < sprintf(buf, "%-48s: %s (%s)", < cheat_info[i].o_desc, < (*cheat_info[i].o_var ? "yes" : "no "), < cheat_info[i].o_text); < c_prt(a, buf, i + 2, 0); < } < < /* Hilite current option */ < move_cursor(k + 2, 50); < < /* Get a key */ < ch = inkey(); < < /* Analyze */ < switch (ch) < { < case ESCAPE: < { < return; < } < < case '-': < case '8': < { < k = (n + k - 1) % n; < break; < } < < case ' ': < case '\n': < case '\r': < case '2': < { < k = (k + 1) % n; < break; < } < < case 'y': < case 'Y': < case '6': < { < noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit); < (*cheat_info[k].o_var) = TRUE; < k = (k + 1) % n; < break; < } < < case 'n': < case 'N': < case '4': < { < (*cheat_info[k].o_var) = FALSE; < k = (k + 1) % n; < break; < } < < default: < { < bell(); < break; < } < } < } < } < < < /* < * Interact with some options < */ < static void do_cmd_options_aux(int page, cptr info) < { < char ch; < < int i, k = 0, n = 0; < < int opt[24]; < < char buf[80]; < < < /* Lookup the options */ < for (i = 0; i < 24; i++) opt[i] = 0; < < /* Scan the options */ < for (i = 0; option_info[i].o_desc; i++) < { < /* Notice options on this "page" */ < if (option_info[i].o_page == page) opt[n++] = i; < } < < < /* Clear screen */ < Term_clear(); < < /* Interact with the player */ < while (TRUE) < { < /* Prompt XXX XXX XXX */ < sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info); < prt(buf, 0, 0); < < /* Display the options */ < for (i = 0; i < n; i++) < { < byte a = TERM_WHITE; < < /* Color current option */ < if (i == k) a = TERM_L_BLUE; < < /* Display the option text */ < sprintf(buf, "%-48s: %s (%s)", < option_info[opt[i]].o_desc, < (*option_info[opt[i]].o_var ? "yes" : "no "), < option_info[opt[i]].o_text); < c_prt(a, buf, i + 2, 0); < } < < /* Hilite current option */ < move_cursor(k + 2, 50); < < /* Get a key */ < ch = inkey(); < < /* Analyze */ < switch (ch) < { < case ESCAPE: < { < return; < } < < case '-': < case '8': < { < k = (n + k - 1) % n; < break; < } < < case ' ': < case '\n': < case '\r': < case '2': < { < k = (k + 1) % n; < break; < } < < case 'y': < case 'Y': < case '6': < { < (*option_info[opt[k]].o_var) = TRUE; < k = (k + 1) % n; < break; < } < < case 'n': < case 'N': < case '4': < { < (*option_info[opt[k]].o_var) = FALSE; < k = (k + 1) % n; < break; < } < < default: < { < bell(); < break; < } < } < } < } < < < /* < * Modify the "window" options < */ < static void do_cmd_options_win(void) < { < int i, j, d; < < int y = 0; < int x = 0; < < char ch; < < bool go = TRUE; < < u32b old_flag[8]; < < < /* Memorize old flags */ < for (j = 0; j < 8; j++) < { < /* Acquire current flags */ < old_flag[j] = window_flag[j]; < } < < < /* Clear screen */ < Term_clear(); < < /* Interact */ < while (go) < { < /* Prompt XXX XXX XXX */ < prt("Window flags (, t, y, n, ESC) ", 0, 0); < < /* Display the windows */ < for (j = 0; j < 8; j++) < { < byte a = TERM_WHITE; < < cptr s = ang_term_name[j]; < < /* Use color */ < if (use_color && (j == x)) a = TERM_L_BLUE; < < /* Window name, staggered, centered */ < Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s); < } < < /* Display the options */ < for (i = 0; i < 16; i++) < { < byte a = TERM_WHITE; < < cptr str = window_flag_desc[i]; < < /* Use color */ < if (use_color && (i == y)) a = TERM_L_BLUE; < < /* Unused option */ < if (!str) str = "(Unused option)"; < < /* Flag name */ < Term_putstr(0, i + 5, -1, a, str); < < /* Display the windows */ < for (j = 0; j < 8; j++) < { < byte a = TERM_WHITE; < < char c = '.'; < < /* Use color */ < if (use_color && (i == y) && (j == x)) a = TERM_L_BLUE; < < /* Active flag */ < if (window_flag[j] & (1L << i)) c = 'X'; < < /* Flag value */ < Term_putch(35 + j * 5, i + 5, a, c); < } < } < < /* Place Cursor */ < Term_gotoxy(35 + x * 5, y + 5); < < /* Get key */ < ch = inkey(); < < /* Analyze */ < switch (ch) < { < case ESCAPE: < { < go = FALSE; < break; < } < < case 'T': < case 't': < { < /* Clear windows */ < for (j = 0; j < 8; j++) < { < window_flag[j] &= ~(1L << y); < } < < /* Clear flags */ < for (i = 0; i < 16; i++) < { < window_flag[x] &= ~(1L << i); < } < < /* Fall through */ < } < < case 'y': < case 'Y': < { < /* Ignore screen */ < if (x == 0) break; < < /* Set flag */ < window_flag[x] |= (1L << y); < break; < } < < case 'n': < case 'N': < { < /* Clear flag */ < window_flag[x] &= ~(1L << y); < break; < } < < default: < { < d = keymap_dirs[ch & 0x7F]; < < x = (x + ddx[d] + 8) % 8; < y = (y + ddy[d] + 16) % 16; < < if (!d) bell(); < } < } < } < < /* Notice changes */ < for (j = 0; j < 8; j++) < { < term *old = Term; < < /* Dead window */ < if (!ang_term[j]) continue; < < /* Ignore non-changes */ < if (window_flag[j] == old_flag[j]) continue; < < /* Activate */ < Term_activate(ang_term[j]); < < /* Erase */ < Term_clear(); < < /* Refresh */ < Term_fresh(); < < /* Restore */ < Term_activate(old); < } < } < < < < < /* 802a80,81 > * > * Any options that can be changed will be client-only --KLJ-- 806,951d84 < int k; < < < /* Enter "icky" mode */ < character_icky = TRUE; < < /* Save the screen */ < Term_save(); < < < /* Interact */ < while (1) < { < /* Clear screen */ < Term_clear(); < < /* Why are we here */ < prt("Angband options", 2, 0); < < /* Give some choices */ < prt("(1) User Interface Options", 4, 5); < prt("(2) Disturbance Options", 5, 5); < prt("(3) Game-Play Options", 6, 5); < prt("(4) Efficiency Options", 7, 5); < < /* Cheating */ < if (can_be_wizard) prt("(C) Cheating Options", 8, 5); < < /* Window flags */ < prt("(W) Window flags", 9, 5); < < /* Special choices */ < prt("(D) Base Delay Factor", 11, 5); < prt("(H) Hitpoint Warning", 12, 5); < < /* Prompt */ < prt("Command: ", 14, 0); < < /* Get command */ < k = inkey(); < < /* Exit */ < if (k == ESCAPE) break; < < /* General Options */ < if (k == '1') < { < /* Process the general options */ < do_cmd_options_aux(1, "User Interface Options"); < } < < /* Disturbance Options */ < else if (k == '2') < { < /* Process the running options */ < do_cmd_options_aux(2, "Disturbance Options"); < } < < /* Inventory Options */ < else if (k == '3') < { < /* Process the running options */ < do_cmd_options_aux(3, "Game-Play Options"); < } < < /* Efficiency Options */ < else if (k == '4') < { < /* Process the efficiency options */ < do_cmd_options_aux(4, "Efficiency Options"); < } < < /* Cheating Options XXX XXX XXX */ < else if ((k == 'C') && can_be_wizard) < { < /* Process the cheating options */ < do_cmd_options_cheat("Cheaters never win"); < } < < /* Window flags */ < else if (k == 'W') < { < /* Spawn */ < do_cmd_options_win(); < } < < /* Hack -- Delay Speed */ < else if (k == 'D') < { < /* Prompt */ < prt("Command: Base Delay Factor", 14, 0); < < /* Get a new value */ < while (1) < { < int msec = delay_factor * delay_factor * delay_factor; < prt(format("Current base delay factor: %d (%d msec)", < delay_factor, msec), 18, 0); < prt("Delay Factor (0-9 or ESC to accept): ", 16, 0); < k = inkey(); < if (k == ESCAPE) break; < if (isdigit(k)) delay_factor = D2I(k); < else bell(); < } < } < < /* Hack -- hitpoint warning factor */ < else if (k == 'H') < { < /* Prompt */ < prt("Command: Hitpoint Warning", 14, 0); < < /* Get a new value */ < while (1) < { < prt(format("Current hitpoint warning: %d0%%", < hitpoint_warn), 18, 0); < prt("Hitpoint Warning (0-9 or ESC to accept): ", 16, 0); < k = inkey(); < if (k == ESCAPE) break; < if (isdigit(k)) hitpoint_warn = D2I(k); < else bell(); < } < } < < /* Unknown option */ < else < { < /* Oops */ < bell(); < } < < /* Flush messages */ < msg_print(NULL); < } < < < /* Restore the screen */ < Term_load(); < < /* Leave "icky" mode */ < character_icky = FALSE; < < < /* Verify the keymap */ < keymap_init(); 959a93,94 > * > * This is client-side --KLJ-- 963,972d97 < char buf[80]; < < /* Default */ < strcpy(buf, ""); < < /* Ask for a "user pref command" */ < if (!get_string("Pref: ", buf, 80)) return; < < /* Process that pref command */ < (void)process_pref_file_aux(buf); 976,977d100 < #ifdef ALLOW_MACROS < 979,1102d101 < * Hack -- append all current macros to the given file < */ < static errr macro_dump(cptr fname) < { < int i; < < FILE *fff; < < char buf[1024]; < < < /* Build the filename */ < path_build(buf, 1024, ANGBAND_DIR_USER, fname); < < /* File type is "TEXT" */ < FILE_TYPE(FILE_TYPE_TEXT); < < /* Append to the file */ < fff = my_fopen(buf, "a"); < < /* Failure */ < if (!fff) return (-1); < < < /* Skip space */ < fprintf(fff, "\n\n"); < < /* Start dumping */ < fprintf(fff, "# Automatic macro dump\n\n"); < < /* Dump them */ < for (i = 0; i < macro__num; i++) < { < /* Start the macro */ < fprintf(fff, "# Macro '%d'\n\n", i); < < /* Extract the action */ < ascii_to_text(buf, macro__act[i]); < < /* Dump the macro */ < fprintf(fff, "A:%s\n", buf); < < /* Extract the action */ < ascii_to_text(buf, macro__pat[i]); < < /* Dump command macros */ < if (macro__cmd[i]) fprintf(fff, "C:%s\n", buf); < < /* Dump normal macros */ < else fprintf(fff, "P:%s\n", buf); < < /* End the macro */ < fprintf(fff, "\n\n"); < } < < /* Start dumping */ < fprintf(fff, "\n\n\n\n"); < < < /* Close */ < my_fclose(fff); < < /* Success */ < return (0); < } < < < /* < * Hack -- ask for a "trigger" (see below) < * < * Note the complex use of the "inkey()" function from "util.c". < * < * Note that both "flush()" calls are extremely important. < */ < static void do_cmd_macro_aux(char *buf) < { < int i, n = 0; < < char tmp[1024]; < < < /* Flush */ < flush(); < < /* Do not process macros */ < inkey_base = TRUE; < < /* First key */ < i = inkey(); < < /* Read the pattern */ < while (i) < { < /* Save the key */ < buf[n++] = i; < < /* Do not process macros */ < inkey_base = TRUE; < < /* Do not wait for keys */ < inkey_scan = TRUE; < < /* Attempt to read a key */ < i = inkey(); < } < < /* Terminate */ < buf[n] = '\0'; < < /* Flush */ < flush(); < < < /* Convert the trigger */ < ascii_to_text(tmp, buf); < < /* Hack -- display the trigger */ < Term_addstr(-1, TERM_WHITE, tmp); < } < < #endif < < < /* 1107a107,108 > * > * Macros are handled by the client --KLJ-- 1111,1378d111 < int i; < < char tmp[160]; < < char buf[1024]; < < < /* File type is "TEXT" */ < FILE_TYPE(FILE_TYPE_TEXT); < < < /* Enter "icky" mode */ < character_icky = TRUE; < < /* Save the screen */ < Term_save(); < < /* Process requests until done */ < while (1) < { < /* Clear screen */ < Term_clear(); < < /* Describe */ < Term_putstr(0, 2, -1, TERM_WHITE, "Interact with Macros"); < < < /* Describe that action */ < Term_putstr(0, 18, -1, TERM_WHITE, "Current action (if any) shown below:"); < < /* Analyze the current action */ < ascii_to_text(buf, macro__buf); < < /* Display the current action */ < Term_putstr(0, 20, -1, TERM_WHITE, buf); < < < /* Selections */ < Term_putstr(5, 4, -1, TERM_WHITE, "(1) Load a user pref file"); < #ifdef ALLOW_MACROS < Term_putstr(5, 5, -1, TERM_WHITE, "(2) Dump macros"); < Term_putstr(5, 6, -1, TERM_WHITE, "(3) Enter a new action"); < Term_putstr(5, 7, -1, TERM_WHITE, "(4) Query a macro action"); < Term_putstr(5, 8, -1, TERM_WHITE, "(5) Create a command macro"); < Term_putstr(5, 9, -1, TERM_WHITE, "(6) Create a normal macro"); < Term_putstr(5, 10, -1, TERM_WHITE, "(7) Create an identity macro"); < Term_putstr(5, 11, -1, TERM_WHITE, "(8) Create an empty macro"); < Term_putstr(5, 12, -1, TERM_WHITE, "(9) Define a special keymap"); < #endif /* ALLOW_MACROS */ < < /* Prompt */ < Term_putstr(0, 14, -1, TERM_WHITE, "Command: "); < < /* Get a command */ < i = inkey(); < < /* Leave */ < if (i == ESCAPE) break; < < /* Load a 'macro' file */ < else if (i == '1') < { < /* Prompt */ < Term_putstr(0, 14, -1, TERM_WHITE, "Command: Load a user pref file"); < < /* Get a filename, handle ESCAPE */ < Term_putstr(0, 16, -1, TERM_WHITE, "File: "); < < /* Default filename */ < sprintf(tmp, "user-%s.prf", ANGBAND_SYS); < < /* Ask for a file */ < if (!askfor_aux(tmp, 70)) continue; < < /* Process the given filename */ < (void)process_pref_file(tmp); < } < < #ifdef ALLOW_MACROS < < /* Save a 'macro' file */ < else if (i == '2') < { < /* Prompt */ < Term_putstr(0, 14, -1, TERM_WHITE, "Command: Save a macro file"); < < /* Get a filename, handle ESCAPE */ < Term_putstr(0, 16, -1, TERM_WHITE, "File: "); < < /* Default filename */ < sprintf(tmp, "user-%s.prf", ANGBAND_SYS); < < /* Ask for a file */ < if (!askfor_aux(tmp, 70)) continue; < < /* Drop priv's */ < safe_setuid_drop(); < < /* Dump the macros */ < (void)macro_dump(tmp); < < /* Grab priv's */ < safe_setuid_grab(); < } < < /* Enter a new action */ < else if (i == '3') < { < /* Prompt */ < Term_putstr(0, 14, -1, TERM_WHITE, "Command: Enter a new action"); < < /* Go to the correct location */ < Term_gotoxy(0, 20); < < /* Hack -- limit the value */ < tmp[80] = '\0'; < < /* Get an encoded action */ < if (!askfor_aux(buf, 80)) continue; < < /* Extract an action */ < text_to_ascii(macro__buf, buf); < } < < /* Query a macro action */ < else if (i == '4') < { < < #if 0 < /* Prompt */ < Term_putstr(0, 14, -1, TERM_WHITE, "Command: Query a macro action"); < < /* Prompt */ < Term_putstr(0, 16, -1, TERM_WHITE, "Enter a macro trigger: "); < < /* Get a macro trigger */ < do_cmd_macro_aux(buf); < #endif < < /* XXX XXX XXX */ < msg_print("Command not ready."); < } < < /* Create a command macro */ < else if (i == '5') < { < /* Prompt */ < Term_putstr(0, 14, -1, TERM_WHITE, "Command: Create a command macro"); < < /* Prompt */ < Term_putstr(0, 16, -1, TERM_WHITE, "Trigger: "); < < /* Get a macro trigger */ < do_cmd_macro_aux(buf); < < /* Link the macro */ < macro_add(buf, macro__buf, TRUE); < < /* Message */ < msg_print("Created a new command macro."); < } < < /* Create a normal macro */ < else if (i == '6') < { < /* Prompt */ < Term_putstr(0, 14, -1, TERM_WHITE, "Command: Create a normal macro"); < < /* Prompt */ < Term_putstr(0, 16, -1, TERM_WHITE, "Trigger: "); < < /* Get a macro trigger */ < do_cmd_macro_aux(buf); < < /* Link the macro */ < macro_add(buf, macro__buf, FALSE); < < /* Message */ < msg_print("Created a new normal macro."); < } < < /* Create an identity macro */ < else if (i == '7') < { < /* Prompt */ < Term_putstr(0, 14, -1, TERM_WHITE, "Command: Create an identity macro"); < < /* Prompt */ < Term_putstr(0, 16, -1, TERM_WHITE, "Trigger: "); < < /* Get a macro trigger */ < do_cmd_macro_aux(buf); < < /* Link the macro */ < macro_add(buf, buf, FALSE); < < /* Message */ < msg_print("Created a new identity macro."); < } < < /* Create an empty macro */ < else if (i == '8') < { < /* Prompt */ < Term_putstr(0, 14, -1, TERM_WHITE, "Command: Create an empty macro"); < < /* Prompt */ < Term_putstr(0, 16, -1, TERM_WHITE, "Trigger: "); < < /* Get a macro trigger */ < do_cmd_macro_aux(buf); < < /* Link the macro */ < macro_add(buf, "", FALSE); < < /* Message */ < msg_print("Created a new empty macro."); < } < < /* Define a keymap */ < else if (i == '9') < { < char i1, i2, i3; < < /* Flush the input */ < flush(); < < /* Get the trigger */ < if (get_com("Type the trigger keypress: ", &i1) && < get_com("Type the resulting keypress: ", &i2) && < get_com("Type a direction (or zero): ", &i3)) < { < /* Acquire the array index */ < int k = (i1 & 0x7F); < int r = (i2 & 0x7F); < int d = (i3 & 0x7F); < < /* Analyze the result key */ < keymap_cmds[k] = r; < < /* Hack -- Analyze the "direction" (always allow numbers) */ < keymap_dirs[k] = (isdigit(d) ? (d - '0') : keymap_dirs[d]); < < /* Success */ < msg_format("Keypress 0x%02x mapped to 0x%02x (direction %d)", < k, keymap_cmds[k], keymap_dirs[k]); < } < } < < #endif /* ALLOW_MACROS */ < < /* Oops */ < else < { < /* Oops */ < bell(); < } < < /* Flush messages */ < msg_print(NULL); < } < < < /* Load the screen */ < Term_load(); < < /* Leave "icky" mode */ < character_icky = FALSE; 1384a118,119 > * > * This is (of course) a client-side thing --KLJ-- 1388,1833d122 < int i; < < FILE *fff; < < char tmp[160]; < < char buf[1024]; < < < /* File type is "TEXT" */ < FILE_TYPE(FILE_TYPE_TEXT); < < < /* Enter "icky" mode */ < character_icky = TRUE; < < /* Save the screen */ < Term_save(); < < < /* Interact until done */ < while (1) < { < /* Clear screen */ < Term_clear(); < < /* Ask for a choice */ < prt("Interact with Visuals", 2, 0); < < /* Give some choices */ < prt("(1) Load a user pref file", 4, 5); < #ifdef ALLOW_VISUALS < prt("(2) Dump monster attr/chars", 5, 5); < prt("(3) Dump object attr/chars", 6, 5); < prt("(4) Dump feature attr/chars", 7, 5); < prt("(5) (unused)", 8, 5); < prt("(6) Change monster attr/chars", 9, 5); < prt("(7) Change object attr/chars", 10, 5); < prt("(8) Change feature attr/chars", 11, 5); < prt("(9) (unused)", 12, 5); < #endif < prt("(0) Reset visuals", 13, 5); < < /* Prompt */ < prt("Command: ", 15, 0); < < /* Prompt */ < i = inkey(); < < /* Done */ < if (i == ESCAPE) break; < < /* Load a 'pref' file */ < else if (i == '1') < { < /* Prompt */ < prt("Command: Load a user pref file", 15, 0); < < /* Prompt */ < prt("File: ", 17, 0); < < /* Default filename */ < sprintf(tmp, "user-%s.prf", ANGBAND_SYS); < < /* Query */ < if (!askfor_aux(tmp, 70)) continue; < < /* Process the given filename */ < (void)process_pref_file(tmp); < } < < #ifdef ALLOW_VISUALS < < /* Dump monster attr/chars */ < else if (i == '2') < { < /* Prompt */ < prt("Command: Dump monster attr/chars", 15, 0); < < /* Prompt */ < prt("File: ", 17, 0); < < /* Default filename */ < sprintf(tmp, "user-%s.prf", ANGBAND_SYS); < < /* Get a filename */ < if (!askfor_aux(tmp, 70)) continue; < < /* Build the filename */ < path_build(buf, 1024, ANGBAND_DIR_USER, tmp); < < /* Drop priv's */ < safe_setuid_drop(); < < /* Append to the file */ < fff = my_fopen(buf, "a"); < < /* Grab priv's */ < safe_setuid_grab(); < < /* Failure */ < if (!fff) continue; < < /* Start dumping */ < fprintf(fff, "\n\n"); < fprintf(fff, "# Monster attr/char definitions\n\n"); < < /* Dump monsters */ < for (i = 0; i < MAX_R_IDX; i++) < { < monster_race *r_ptr = &r_info[i]; < < /* Skip non-entries */ < if (!r_ptr->name) continue; < < /* Dump a comment */ < fprintf(fff, "# %s\n", (r_name + r_ptr->name)); < < /* Dump the monster attr/char info */ < fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i, < (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char)); < } < < /* All done */ < fprintf(fff, "\n\n\n\n"); < < /* Close */ < my_fclose(fff); < < /* Message */ < msg_print("Dumped monster attr/chars."); < } < < /* Dump object attr/chars */ < else if (i == '3') < { < /* Prompt */ < prt("Command: Dump object attr/chars", 15, 0); < < /* Prompt */ < prt("File: ", 17, 0); < < /* Default filename */ < sprintf(tmp, "user-%s.prf", ANGBAND_SYS); < < /* Get a filename */ < if (!askfor_aux(tmp, 70)) continue; < < /* Build the filename */ < path_build(buf, 1024, ANGBAND_DIR_USER, tmp); < < /* Drop priv's */ < safe_setuid_drop(); < < /* Append to the file */ < fff = my_fopen(buf, "a"); < < /* Grab priv's */ < safe_setuid_grab(); < < /* Failure */ < if (!fff) continue; < < /* Start dumping */ < fprintf(fff, "\n\n"); < fprintf(fff, "# Object attr/char definitions\n\n"); < < /* Dump objects */ < for (i = 0; i < MAX_K_IDX; i++) < { < object_kind *k_ptr = &k_info[i]; < < /* Skip non-entries */ < if (!k_ptr->name) continue; < < /* Dump a comment */ < fprintf(fff, "# %s\n", (k_name + k_ptr->name)); < < /* Dump the object attr/char info */ < fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i, < (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char)); < } < < /* All done */ < fprintf(fff, "\n\n\n\n"); < < /* Close */ < my_fclose(fff); < < /* Message */ < msg_print("Dumped object attr/chars."); < } < < /* Dump feature attr/chars */ < else if (i == '4') < { < /* Prompt */ < prt("Command: Dump feature attr/chars", 15, 0); < < /* Prompt */ < prt("File: ", 17, 0); < < /* Default filename */ < sprintf(tmp, "user-%s.prf", ANGBAND_SYS); < < /* Get a filename */ < if (!askfor_aux(tmp, 70)) continue; < < /* Build the filename */ < path_build(buf, 1024, ANGBAND_DIR_USER, tmp); < < /* Drop priv's */ < safe_setuid_drop(); < < /* Append to the file */ < fff = my_fopen(buf, "a"); < < /* Grab priv's */ < safe_setuid_grab(); < < /* Failure */ < if (!fff) continue; < < /* Start dumping */ < fprintf(fff, "\n\n"); < fprintf(fff, "# Feature attr/char definitions\n\n"); < < /* Dump features */ < for (i = 0; i < MAX_F_IDX; i++) < { < feature_type *f_ptr = &f_info[i]; < < /* Skip non-entries */ < if (!f_ptr->name) continue; < < /* Dump a comment */ < fprin