void frame::extract_right_eyebrow_feat(point neutral_ctrd) { float angle = atan( (r_eyebrow_landmks[5].y - r_eyebrow_landmks[8].y)/(r_eyebrow_landmks[5].x - r_eyebrow_landmks[8].x) ); matrix_mult(angle, r_eyebrow_landmks); point translate; translate.x = neutral_ctrd.x - r_centroid.x; translate.y = neutral_ctrd.y - r_centroid.y; add_translation(translate, r_eyebrow_landmks); right_feats = get_feats(r_eyebrow_landmks); }
/** * Bring up player actions */ void show_player(void) { int i, j, fy, fx; int adj_grid[9]; bool exist_rock = FALSE; bool exist_door = FALSE; bool exist_open_door = FALSE; bool exist_trap = FALSE; bool exist_mtrap = FALSE; bool exist_floor = FALSE; bool exist_monster = FALSE; feature_type *f_ptr; /* No commands yet */ poss = 0; /* Get surroundings */ get_feats(adj_grid); /* Analyze surroundings */ for (i = 0; i < 8; i++) { int yy = p_ptr->py + ddy_ddd[i]; int xx = p_ptr->px + ddx_ddd[i]; f_ptr = &f_info[adj_grid[i]]; if (cave_visible_trap(yy, xx)) exist_trap = TRUE; if (tf_has(f_ptr->flags, TF_DOOR_CLOSED)) exist_door = TRUE; if (tf_has(f_ptr->flags, TF_ROCK)) exist_rock = TRUE; if (cave_monster_trap(yy, xx)) exist_mtrap = TRUE; if (adj_grid[i] == FEAT_OPEN) exist_open_door = TRUE; if (cave_naked_bold(yy, xx)) exist_floor = TRUE; if (cave_m_idx[yy][xx] > 0) exist_monster = TRUE; } /* In a web? */ if (cave_web(p_ptr->py, p_ptr->px)) exist_trap = TRUE; /* Alter a grid */ if (exist_trap || exist_door || exist_rock || exist_mtrap || exist_open_door || count_chests(&fy, &fx, TRUE) || count_chests(&fy, &fx, FALSE) || (player_has(PF_TRAP) && exist_floor) || (player_has(PF_STEAL) && exist_monster && (!SCHANGE))) { comm[poss] = '+'; comm_code[poss] = CMD_ALTER; comm_descr[poss++] = "Alter"; } /* Dig a tunnel */ if (exist_door || exist_rock) { comm[poss] = 'T'; comm_code[poss] = CMD_TUNNEL; comm_descr[poss++] = "Tunnel"; } /* Begin Running -- Arg is Max Distance */ { comm[poss] = '.'; comm_code[poss] = CMD_RUN; comm_descr[poss++] = "Run"; } /* Hold still for a turn. Pickup objects if auto-pickup is true. */ { comm[poss] = ','; comm_code[poss] = CMD_HOLD; comm_descr[poss++] = "Stand still"; } /* Pick up objects. */ if (cave_o_idx[p_ptr->py][p_ptr->px]) { comm[poss] = 'g'; comm_code[poss] = CMD_PICKUP; comm_descr[poss++] = "Pick up"; } /* Rest -- Arg is time */ { comm[poss] = 'R'; comm_code[poss] = CMD_REST; comm_descr[poss++] = "Rest"; } /* Search for traps/doors */ { comm[poss] = 's'; comm_code[poss] = CMD_SEARCH; comm_descr[poss++] = "Search"; } /* Look around */ { comm[poss] = 'l'; comm_code[poss] = CMD_NULL; comm_descr[poss++] = "Look"; } /* Scroll the map */ { comm[poss] = 'L'; comm_code[poss] = CMD_NULL; comm_descr[poss++] = "Scroll map"; } /* Show the map */ { comm[poss] = 'M'; comm_code[poss] = CMD_NULL; comm_descr[poss++] = "Level map"; } /* Knowledge */ { comm[poss] = '~'; comm_code[poss] = CMD_NULL; comm_descr[poss++] = "Knowledge"; } /* Options */ { comm[poss] = '='; comm_code[poss] = CMD_NULL; comm_descr[poss++] = "Options"; } /* Toggle search mode */ { comm[poss] = 'S'; comm_code[poss] = CMD_TOGGLE_SEARCH; comm_descr[poss++] = "Toggle searching"; } /* Go up staircase */ if ((adj_grid[8] == FEAT_LESS) || ((adj_grid[8] >= FEAT_LESS_NORTH) && (!(adj_grid[8] % 2)))) { comm[poss] = '<'; comm_code[poss] = CMD_GO_UP; comm_descr[poss++] = "Take stair/path"; } /* Go down staircase */ if ((adj_grid[8] == FEAT_MORE) || ((adj_grid[8] >= FEAT_LESS_NORTH) && (adj_grid[8] % 2))) { comm[poss] = '>'; comm_code[poss] = CMD_GO_DOWN; comm_descr[poss++] = "Take stair/path"; } /* Open a door or chest */ if (exist_door || count_chests(&fy, &fx, TRUE) || count_chests(&fy, &fx, FALSE)) { comm[poss] = 'o'; comm_code[poss] = CMD_OPEN; comm_descr[poss++] = "Open"; } /* Close a door */ if (exist_open_door) { comm[poss] = 'c'; comm_code[poss] = CMD_CLOSE; comm_descr[poss++] = "Close"; } /* Jam a door with spikes */ if (exist_door) { comm[poss] = 'j'; comm_code[poss] = CMD_JAM; comm_descr[poss++] = "Jam"; } /* Bash a door */ if (exist_door) { comm[poss] = 'B'; comm_code[poss] = CMD_BASH; comm_descr[poss++] = "Bash"; } /* Disarm a trap or chest */ if (count_chests(&fy, &fx, TRUE) || exist_trap || exist_mtrap) { comm[poss] = 'D'; comm_code[poss] = CMD_DISARM; comm_descr[poss++] = "Disarm"; } /* Shapechange */ if ((SCHANGE) || (player_has(PF_BEARSKIN))) { comm[poss] = ']'; comm_code[poss] = CMD_NULL; comm_descr[poss++] = "Shapechange"; } /* Save screen */ screen_save(); /* Prompt */ put_str("Choose a command, or ESC:", 0, 0); /* Hack - delete exact graphics rows */ if (tile_height > 1) { j = poss + 1; while ((j % tile_height) && (j <= SCREEN_ROWS)) prt("", ++j, 0); } /* Get a choice */ (void) show_cmd_menu(FALSE); /* Load screen */ screen_load(); }