static struct panel *get_panel_combat(void) { struct panel *p = panel_allocate(9); struct object *obj; int bth, dam, hit; /* AC */ panel_line(p, TERM_L_BLUE, "Armor", "[%d,%+d]", p_ptr->state.dis_ac, p_ptr->state.dis_to_a); /* Melee */ obj = &p_ptr->inventory[INVEN_WIELD]; bth = (p_ptr->state.skills[SKILL_TO_HIT_MELEE] * 10) / BTH_PLUS_ADJ; dam = p_ptr->state.dis_to_d + (object_attack_plusses_are_visible(obj) ? obj->to_d : 0); hit = p_ptr->state.dis_to_h + (object_attack_plusses_are_visible(obj) ? obj->to_h : 0); panel_space(p); panel_line(p, TERM_L_BLUE, "Melee", "%dd%d,%+d", obj->dd, obj->ds, dam); panel_line(p, TERM_L_BLUE, "To-hit", "%d,%+d", bth / 10, hit); panel_line(p, TERM_L_BLUE, "Blows", "%d.%d/turn", p_ptr->state.num_blows / 100, (p_ptr->state.num_blows / 10 % 10)); /* Ranged */ obj = &p_ptr->inventory[INVEN_BOW]; bth = (p_ptr->state.skills[SKILL_TO_HIT_BOW] * 10) / BTH_PLUS_ADJ; hit = p_ptr->state.dis_to_h + (object_attack_plusses_are_visible(obj) ? obj->to_h : 0); dam = object_attack_plusses_are_visible(obj) ? obj->to_d : 0; panel_space(p); panel_line(p, TERM_L_BLUE, "Shoot to-dam", "%+d", dam); panel_line(p, TERM_L_BLUE, "To-hit", "%d,%+d", bth / 10, hit); panel_line(p, TERM_L_BLUE, "Shots", "%d/turn", p_ptr->state.num_shots); return p; }
static struct panel *get_panel_combat(void) { struct panel *p = panel_allocate(9); int bth; /* AC */ panel_line(p, TERM_L_BLUE, "Armor", "[%d,%+d]", p_ptr->state.dis_ac, p_ptr->state.dis_to_a); /* Melee */ bth = (p_ptr->state.skills[SKILL_TO_HIT_MELEE] * 10) / BTH_PLUS_ADJ; panel_space(p); panel_line(p, TERM_L_BLUE, "Melee", "%s", show_melee_weapon(&p_ptr->inventory[INVEN_WIELD])); panel_line(p, TERM_L_BLUE, "Blows", "%d.%d/turn", p_ptr->state.num_blows / 100, (p_ptr->state.num_blows / 10 % 10)); panel_line(p, TERM_L_BLUE, "Base to-hit", "%.1f", bth / 10.0); /* Ranged */ bth = (p_ptr->state.skills[SKILL_TO_HIT_BOW] * 10) / BTH_PLUS_ADJ; panel_space(p); panel_line(p, TERM_L_BLUE, "Shoot", "%s", show_missile_weapon(&p_ptr->inventory[INVEN_BOW])); panel_line(p, TERM_L_BLUE, "Shots", "%d/turn", p_ptr->state.num_shots); panel_line(p, TERM_L_BLUE, "Base to-hit", "%.1f", bth / 10.0); return p; }
static struct panel *get_panel_combat(void) { struct panel *p = panel_allocate(9); struct object *obj; int bth, dam, hit; int melee_dice = 1, melee_sides = 1; /* AC */ panel_line(p, COLOUR_L_BLUE, "Armor", "[%d,%+d]", player->known_state.ac, player->known_state.to_a); /* Melee */ obj = equipped_item_by_slot_name(player, "weapon"); bth = (player->state.skills[SKILL_TO_HIT_MELEE] * 10) / BTH_PLUS_ADJ; dam = player->known_state.to_d + (obj ? obj->known->to_d : 0); hit = player->known_state.to_h + (obj ? obj->known->to_h : 0); panel_space(p); if (obj) { melee_dice = obj->dd; melee_sides = obj->ds; } panel_line(p, COLOUR_L_BLUE, "Melee", "%dd%d,%+d", melee_dice, melee_sides, dam); panel_line(p, COLOUR_L_BLUE, "To-hit", "%d,%+d", bth / 10, hit); panel_line(p, COLOUR_L_BLUE, "Blows", "%d.%d/turn", player->state.num_blows / 100, (player->state.num_blows / 10 % 10)); /* Ranged */ obj = equipped_item_by_slot_name(player, "shooting"); bth = (player->state.skills[SKILL_TO_HIT_BOW] * 10) / BTH_PLUS_ADJ; hit = player->known_state.to_h + (obj ? obj->known->to_h : 0); dam = obj ? obj->known->to_d : 0; panel_space(p); panel_line(p, COLOUR_L_BLUE, "Shoot to-dam", "%+d", dam); panel_line(p, COLOUR_L_BLUE, "To-hit", "%d,%+d", bth / 10, hit); panel_line(p, COLOUR_L_BLUE, "Shots", "%d.%d/turn", player->state.num_shots / 10, player->state.num_shots % 10); return p; }
static struct panel *get_panel_midleft(void) { struct panel *p = panel_allocate(9); panel_line(p, max_color(p_ptr->lev, p_ptr->max_lev), "Level", "%d", p_ptr->lev); panel_line(p, max_color(p_ptr->exp, p_ptr->max_exp), "Cur Exp", "%d", p_ptr->exp); panel_line(p, TERM_L_GREEN, "Max Exp", "%d", p_ptr->max_exp); panel_line(p, TERM_L_GREEN, "Adv Exp", "%s", show_adv_exp()); panel_space(p); panel_line(p, TERM_L_GREEN, "Gold", "%d", p_ptr->au); panel_line(p, TERM_L_GREEN, "Burden", "%.1f lbs", p_ptr->total_weight / 10.0F); panel_line(p, TERM_L_GREEN, "Speed", "%s", show_speed()); panel_line(p, TERM_L_GREEN, "Max Depth", "%s", show_depth()); return p; }
static struct panel *get_panel_midleft(void) { struct panel *p = panel_allocate(9); int diff = weight_remaining(player); byte attr = diff < 0 ? COLOUR_L_RED : COLOUR_L_GREEN; panel_line(p, max_color(player->lev, player->max_lev), "Level", "%d", player->lev); panel_line(p, max_color(player->exp, player->max_exp), "Cur Exp", "%d", player->exp); panel_line(p, COLOUR_L_GREEN, "Max Exp", "%d", player->max_exp); panel_line(p, COLOUR_L_GREEN, "Adv Exp", "%s", show_adv_exp()); panel_space(p); panel_line(p, COLOUR_L_GREEN, "Gold", "%d", player->au); panel_line(p, attr, "Burden", "%.1f lb", player->upkeep->total_weight / 10.0F); panel_line(p, attr, "Overweight", "%d.%d lb", -diff / 10, abs(diff) % 10); panel_line(p, COLOUR_L_GREEN, "Max Depth", "%s", show_depth()); return p; }