player_ptr->exit_bldg = FALSE;
reset_tim_flags(player_ptr);
-
- /* Save the surface floor as saved floor */
prepare_change_floor_mode(player_ptr, CFM_SAVE_FLOORS);
player_ptr->current_floor_ptr->inside_arena = TRUE;
deck[i] = i;
}
- /* shuffle cards */
for (int i = 0; i < 53; i++) {
int tmp1 = randint0(53 - i) + i;
int tmp2 = deck[i];
bool joker_is_used = FALSE;
bool straight = FALSE;
- /* get lowest */
for (int i = 0; i < 5; i++)
{
if (NUM_OF(cards[i]) < lowest && !IS_JOKER(cards[i]))
lowest = NUM_OF(cards[i]);
}
- /* Check Royal Straight Flush */
if (poker_hand_check_flush())
{
int i;
}
}
- if (i == 4) return 3; /* Wow! Royal Straight Flush!!! */
+ if (i == 4) return 3;
}
if (lowest == 9)
break;
}
- if (i == 3 && have_joker()) return 3; /* Wow! Royal Straight Flush!!! */
+ if (i == 3 && have_joker()) return 3;
}
}
joker_is_used = FALSE;
- /* Straight Only Check */
- /* (10 - J - Q - K)[JOKER] - A */
if (lowest == 0)
{
int i;
if (have_joker() && !joker_is_used)
joker_is_used = TRUE;
else
- break; /* None */
+ break;
}
}
else col = TERM_WHITE;
c_put_str(col, _("決定", "Sure"), 16, 38);
- /* Hilite current option */
if (hoge < 5) move_cursor(14, 5 + hoge * 16);
else move_cursor(16, 38);
}
*/
static int do_poker(void)
{
- int is_put[5]; /* 0:kaenai 1:kaeru */
+ int is_put[5];
bool done = FALSE;
bool decision = TRUE;
if (cmd == BACT_GAMBLE_RULES)
{
- /* Peruse the gambling help file */
(void)show_file(player_ptr, TRUE, _("jgambling.txt", "gambling.txt"), NULL, 0, 0);
screen_load();
return TRUE;
}
- /* No money */
if (player_ptr->au < 1)
{
msg_print(_("おい!おまえ一文なしじゃないか!こっから出ていけ!",
}
clear_bldg(5, 23);
-
maxbet = player_ptr->lev * 200;
-
- /* We can't bet more than we have */
maxbet = MIN(maxbet, player_ptr->au);
- /* Get the wager */
strcpy(out_val, "");
sprintf(tmp_str, _("賭け金 (1-%ld)?", "Your wager (1-%ld) ? "), (long int)maxbet);
return TRUE;
}
- /* Strip spaces */
for (p = out_val; *p == ' '; p++);
- /* Get the wager */
wager = atol(p);
-
if (wager > player_ptr->au)
{
msg_print(_("おい!金が足りないじゃないか!出ていけ!", "Hey! You don't have the gold - get out of here!"));
return FALSE;
}
- int i;
-
clear_bldg(4, 10);
prt(_("モンスター 倍率",
"Monsters Odds"), 4, 4);
- for (i = 0; i < 4; i++)
+ for (int i = 0; i < 4; i++)
{
char buf[80];
monster_race *r_ptr = &r_info[battle_mon[i]];
prt(_("どれに賭けますか:", "Which monster: "), 0, 0);
while (TRUE)
{
- i = inkey();
+ int i = inkey();
if (i == ESCAPE)
{
}
clear_bldg(4, 4);
- for (i = 0; i < 4; i++)
+ for (int i = 0; i < 4; i++)
if (i != sel_monster) clear_bldg(i + 5, i + 5);
maxbet = player_ptr->lev * 200;
return FALSE;
}
- /* Strip spaces */
for (p = out_val; *p == ' '; p++);
- /* Get the wager */
wager = atol(p);
-
if (wager > player_ptr->au)
{
msg_print(_("おい!金が足りないじゃないか!出ていけ!", "Hey! You don't have the gold - get out of here!"));
player_ptr->au -= wager;
reset_tim_flags(player_ptr);
- /* Save the surface floor as saved floor */
prepare_change_floor_mode(player_ptr, CFM_SAVE_FLOORS);
player_ptr->phase_out = TRUE;
GAME_TEXT o_name[MAX_NLEN];
object_type *o_ptr;
- /* Loop for inventory and right/left arm */
for (INVENTORY_IDX i = 0; i <= INVEN_LARM; i++)
{
o_ptr = &player_ptr->inventory_list[i];
-
- /* Living Tsuchinoko worthes $1000000 */
if ((o_ptr->tval == TV_CAPTURE) && (o_ptr->pval == MON_TSUCHINOKO))
{
char buf[MAX_NLEN + 20];
player_ptr->redraw |= (PR_GOLD);
vary_item(player_ptr, i, -o_ptr->number);
}
+
change = TRUE;
}
}
for (INVENTORY_IDX i = 0; i < INVEN_PACK; i++)
{
o_ptr = &player_ptr->inventory_list[i];
-
- /* Corpse of Tsuchinoko worthes $200000 */
if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_CORPSE) && (o_ptr->pval == MON_TSUCHINOKO))
{
char buf[MAX_NLEN + 20];
player_ptr->redraw |= (PR_GOLD);
vary_item(player_ptr, i, -o_ptr->number);
}
+
change = TRUE;
}
}
for (INVENTORY_IDX i = 0; i < INVEN_PACK; i++)
{
o_ptr = &player_ptr->inventory_list[i];
-
- /* Bones of Tsuchinoko worthes $100000 */
if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_SKELETON) && (o_ptr->pval == MON_TSUCHINOKO))
{
char buf[MAX_NLEN + 20];
player_ptr->redraw |= (PR_GOLD);
vary_item(player_ptr, i, -o_ptr->number);
}
+
change = TRUE;
}
}
sprintf(buf, _("%sを渡しますか?", "Hand %s over? "), o_name);
if (!get_check(buf)) continue;
- /* Hand it first */
vary_item(player_ptr, i, -o_ptr->number);
-
chg_virtue(player_ptr, V_JUSTICE, 5);
current_world_ptr->bounty_r_idx[j] += 10000;
- /* Count number of unique corpses already handed */
for (num = 0, k = 0; k < MAX_BOUNTY; k++)
{
if (current_world_ptr->bounty_r_idx[k] >= 10000) num++;
msg_format(_("これで合計 %d ポイント獲得しました。", "You earned %d point%s total."), num, (num > 1 ? "s" : ""));
- /* Prepare to make a prize */
object_prep(&forge, lookup_kind(prize_list[num - 1].tval, prize_list[num - 1].sval));
apply_magic(player_ptr, &forge, player_ptr->current_floor_ptr->object_level, AM_NO_FIXED_ART);
* there is at least one empty slot.
*/
item_new = inven_carry(player_ptr, &forge);
-
object_desc(player_ptr, o_name, &forge, 0);
msg_format(_("%s(%c)を貰った。", "You get %s (%c). "), o_name, index_to_label(item_new));
- /* Auto-inscription */
autopick_alter_item(player_ptr, item_new, FALSE);
handle_stuff(player_ptr);
-
change = TRUE;
}
}
{
msg_print(_("眠りに就くと恐ろしい光景が心をよぎった。", "Horrible visions flit through your mind as you sleep."));
- /* Have some nightmares */
while (TRUE)
{
sanity_blast(customer_ptr, NULL, FALSE);
quest_text_line = 0;
- /* Set the quest number temporary */
floor_type *floor_ptr = player_ptr->current_floor_ptr;
QUEST_IDX old_quest = floor_ptr->inside_quest;
floor_ptr->inside_quest = questnum;
- /* Get the quest text */
init_flags = INIT_SHOW_TEXT;
if (do_init) init_flags |= INIT_ASSIGN;
process_dungeon_file(player_ptr, "q_info.txt", 0, 0, 0, 0);
-
- /* Reset the old quest number */
floor_ptr->inside_quest = old_quest;
- /* Print the quest info */
GAME_TEXT tmp_str[80];
sprintf(tmp_str, _("クエスト情報 (危険度: %d 階相当)", "Quest Information (Danger level: %d)"), (int)quest[questnum].level);
-
prt(tmp_str, 5, 0);
-
prt(quest[questnum].name, 7, 0);
for (int i = 0; i < 10; i++)
if (q_ptr->r_idx == 0)
{
- /* Random monster at least 5 - 10 levels out of deep */
q_ptr->r_idx = get_mon_num(player_ptr, q_ptr->level + 4 + randint1(6));
}
monster_race *r_ptr;
r_ptr = &r_info[q_ptr->r_idx];
-
while ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->rarity != 1))
{
q_ptr->r_idx = get_mon_num(player_ptr, q_ptr->level) + 4 + randint1(6);
if (q_ptr->max_num == 0)
{
- /* Random monster number */
if (randint1(10) > 7)
q_ptr->max_num = 1;
else
bool force = FALSE;
bool dokubari = FALSE;
- /* Effective dices */
int eff_dd = o_ptr->dd + owner_ptr->to_dd[0];
int eff_ds = o_ptr->ds + owner_ptr->to_ds[0];
int vorpal_div = 1;
int dmg_bonus = o_ptr->to_d + owner_ptr->to_d[0];
-
- /* Get the flags of the weapon */
object_flags(o_ptr, flgs);
-
if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_POISON_NEEDLE)) dokubari = TRUE;
-
- /* Show Critical Damage*/
mindam = calc_expect_crit(owner_ptr, o_ptr->weight, o_ptr->to_h, mindice, owner_ptr->to_h[0], dokubari);
maxdam = calc_expect_crit(owner_ptr, o_ptr->weight, o_ptr->to_h, maxdice, owner_ptr->to_h[0], dokubari);
-
show_weapon_dmg(r++, col, mindam, maxdam, blow, dmg_bonus, _("会心:", "Critical:"), TERM_L_RED);
-
-
- /* Vorpal Hit*/
if ((have_flag(flgs, TR_VORPAL) || hex_spelling(owner_ptr, HEX_RUNESWORD)))
{
if ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD))
show_weapon_dmg(r++, col, mindam, maxdam, blow, dmg_bonus, _("理力:", "Force :"), TERM_L_BLUE);
}
- /* Print the relevant lines */
if (have_flag(flgs, TR_KILL_ANIMAL))
{
mindam = calc_expect_dice(owner_ptr, mindice, 4, 1, force, o_ptr->weight, o_ptr->to_h, owner_ptr->to_h[0], dokubari, vorpal_mult, vorpal_div);
DICE_SID eff_ds = o_ptr->ds + player_ptr->to_ds[0];
HIT_RELIABILITY reli = player_ptr->skill_thn + (player_ptr->to_h[0] + o_ptr->to_h) * BTH_PLUS_ADJ;
- /* Print the weapon name */
object_desc(player_ptr, o_name, o_ptr, OD_NAME_ONLY);
c_put_str(TERM_YELLOW, o_name, row, col);
-
- /* Print the player's number of blows */
sprintf(tmp_str, _("攻撃回数: %d", "Number of Blows: %d"), player_ptr->num_blow[0]);
put_str(tmp_str, row + 1, col);
- /* Print to_hit and to_dam of the weapon */
sprintf(tmp_str, _("命中率: 0 50 100 150 200 (敵のAC)", "To Hit: 0 50 100 150 200 (AC)"));
put_str(tmp_str, row + 2, col);
-
- /* Print the weapons base damage dice */
sprintf(tmp_str, " %2d %2d %2d %2d %2d (%%)",
(int)hit_chance(player_ptr, reli, 0),
(int)hit_chance(player_ptr, reli, 50),
put_str(tmp_str, row + 3, col);
c_put_str(TERM_YELLOW, _("可能なダメージ:", "Possible Damage:"), row + 5, col);
- /* Damage for one blow (if it hits) */
sprintf(tmp_str, _("攻撃一回につき %d-%d", "One Strike: %d-%d damage"),
(int)(eff_dd + o_ptr->to_d + player_ptr->to_d[0]),
(int)(eff_ds * eff_dd + o_ptr->to_d + player_ptr->to_d[0]));
put_str(tmp_str, row + 6, col + 1);
- /* Damage for the complete attack (if all blows hit) */
sprintf(tmp_str, _("1ターンにつき %d-%d", "One Attack: %d-%d damage"),
(int)(player_ptr->num_blow[0] * (eff_dd + o_ptr->to_d + player_ptr->to_d[0])),
(int)(player_ptr->num_blow[0] * (eff_ds * eff_dd + o_ptr->to_d + player_ptr->to_d[0])));
screen_save();
clear_bldg(0, 22);
-
- /* Store copy of original wielded weapon */
i_ptr = &customer_ptr->inventory_list[INVEN_RARM];
object_copy(&orig_weapon, i_ptr);
item_tester_hook = item_tester_hook_orthodox_melee_weapons;
-
- /* Get the first weapon */
concptr q = _("第一の武器は?", "What is your first weapon? ");
concptr s = _("比べるものがありません。", "You have nothing to compare.");
while (TRUE)
{
clear_bldg(0, 22);
-
- /* Only compare melee weapons */
item_tester_hook = item_tester_hook_orthodox_melee_weapons;
-
- /* Hack -- prevent "icky" message */
current_world_ptr->character_xtra = TRUE;
-
- /* Diaplay selected weapon's infomation */
for (int i = 0; i < n; i++)
{
int col = (wid * i + mgn);
-
- /* Copy i-th weapon into the weapon slot (if it's not already there) */
if (o_ptr[i] != i_ptr) object_copy(i_ptr, o_ptr[i]);
customer_ptr->update |= PU_BONUS;
handle_stuff(customer_ptr);
- /* List the new values */
list_weapon(customer_ptr, o_ptr[i], row, col);
compare_weapon_aux(customer_ptr, o_ptr[i], col, row + 8);
-
- /* Copy back the original weapon into the weapon slot */
object_copy(i_ptr, &orig_weapon);
}
- /* Reset the values for the old weapon */
customer_ptr->update |= PU_BONUS;
handle_stuff(customer_ptr);
current_world_ptr->character_xtra = old_character_xtra;
-
#ifdef JP
put_str(format("[ 比較対象: 's'で変更 ($%d) ]", cost), 1, (wid + mgn));
put_str("(一番高いダメージが適用されます。複数の倍打効果は足し算されません。)", row + 4, 0);
flush();
ch = inkey();
-
if (ch != 's') break;
if (total + cost > customer_ptr->au)
q = _("第二の武器は?", "What is your second weapon? ");
s = _("比べるものがありません。", "You have nothing to compare.");
-
- /* Get the second weapon */
OBJECT_IDX item2;
o_ptr[1] = choose_object(customer_ptr, &item2, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
if (!o_ptr[1]) continue;
cost = bcost / 2;
n = 2;
}
- screen_load();
+ screen_load();
return total;
}
DEPTH lvl;
char buf[80 * 20], *t;
- /* AC lower than zero has no effect */
if (iAC < 0) iAC = 0;
- /* ダメージ軽減率を計算 */
protection = 100 * MIN(iAC, 150) / 250;
-
screen_save();
clear_bldg(0, 22);
put_str(format("%3d", average), row + 2, col);
}
- /* Display note */
roff_to_buf(memo, 70, buf, sizeof(buf));
for (t = buf; t[0]; t += strlen(t) + 1)
put_str(t, (row++) + 4, 4);
concptr q = _("どの折れた武器を修復しますか?", "Repair which broken weapon? ");
concptr s = _("修復できる折れた武器がありません。", "You have no broken weapon to repair.");
-
- /* Only forge broken weapons */
item_tester_hook = item_tester_hook_broken_weapon;
OBJECT_IDX item;
o_ptr = choose_object(player_ptr, &item, q, s, (USE_INVEN | USE_EQUIP), 0);
if (!o_ptr) return 0;
- /* It is worthless */
if (!object_is_ego(o_ptr) && !object_is_artifact(o_ptr))
{
msg_format(_("それは直してもしょうがないぜ。", "It is worthless to repair."));
return 0;
}
- /* They are too many */
if (o_ptr->number > 1)
{
msg_format(_("一度に複数を修復することはできません!", "They are too many to repair at once!"));
return 0;
}
- /* Display item name */
char basenm[MAX_NLEN];
object_desc(player_ptr, basenm, o_ptr, OD_NAME_ONLY);
prt(format(_("修復する武器 : %s", "Repairing: %s"), basenm), row + 3, 2);
q = _("材料となる武器は?", "Which weapon for material? ");
s = _("材料となる武器がありません。", "You have no material to repair.");
- /* Only forge broken weapons */
item_tester_hook = item_tester_hook_orthodox_melee_weapons;
-
OBJECT_IDX mater;
object_type *mo_ptr;
mo_ptr = choose_object(player_ptr, &mater, q, s, (USE_INVEN | USE_EQUIP), 0);
return 0;
}
- /* Display item name */
object_desc(player_ptr, basenm, mo_ptr, OD_NAME_ONLY);
prt(format(_("材料とする武器: %s", "Material : %s"), basenm), row + 4, 2);
-
- /* Get the value of one of the items (except curses) */
PRICE cost = bcost + object_value_real(o_ptr) * 2;
-
if (!get_check(format(_("$%dかかりますがよろしいですか? ", "Costs %d gold, okay? "), cost))) return 0;
- /* Check if the player has enough money */
if (player_ptr->au < cost)
{
object_desc(player_ptr, basenm, o_ptr, OD_NAME_ONLY);
}
player_ptr->total_weight -= o_ptr->weight;
-
KIND_OBJECT_IDX k_idx;
if (o_ptr->sval == SV_BROKEN_DAGGER)
{
- KIND_OBJECT_IDX j;
int n = 1;
-
- /* Suppress compiler warning */
k_idx = 0;
-
- for (j = 1; j < max_k_idx; j++)
+ for (KIND_OBJECT_IDX j = 1; j < max_k_idx; j++)
{
object_kind *k_aux_ptr = &k_info[j];
}
}
}
- else /* TV_BROKEN_SWORD */
+ else
{
- /* Repair to a sword or sometimes material's type weapon */
OBJECT_TYPE_VALUE tval = (one_in_(5) ? mo_ptr->tval : TV_SWORD);
-
while (TRUE)
{
object_kind *ck_ptr;
-
k_idx = lookup_kind(tval, SV_ANY);
ck_ptr = &k_info[k_idx];
}
}
- /* Calculate dice bonuses */
int dd_bonus = o_ptr->dd - k_info[o_ptr->k_idx].dd;
int ds_bonus = o_ptr->ds - k_info[o_ptr->k_idx].ds;
dd_bonus += mo_ptr->dd - k_info[mo_ptr->k_idx].dd;
ds_bonus += mo_ptr->ds - k_info[mo_ptr->k_idx].ds;
- /* Change base object */
object_kind *k_ptr;
k_ptr = &k_info[k_idx];
o_ptr->k_idx = k_idx;
o_ptr->dd = k_ptr->dd;
o_ptr->ds = k_ptr->ds;
- /* Copy base object's ability */
for (int i = 0; i < TR_FLAG_SIZE; i++) o_ptr->art_flags[i] |= k_ptr->flags[i];
if (k_ptr->pval) o_ptr->pval = MAX(o_ptr->pval, randint1(k_ptr->pval));
if (have_flag(k_ptr->flags, TR_ACTIVATE)) o_ptr->xtra2 = (byte_hack)k_ptr->act_idx;
o_ptr->pval = MIN(o_ptr->pval, bmax);
}
- /* Add one random ability from material weapon */
give_one_ability_of_object(o_ptr, mo_ptr);
-
- /* Add to-dam, to-hit and to-ac from material weapon */
o_ptr->to_d += MAX(0, (mo_ptr->to_d / 3));
o_ptr->to_h += MAX(0, (mo_ptr->to_h / 3));
o_ptr->to_a += MAX(0, (mo_ptr->to_a));
(object_is_random_artifact(o_ptr) && one_in_(1)) ||
(object_is_ego(o_ptr) && one_in_(7)))
{
- /* Forge it */
if (object_is_ego(o_ptr))
{
add_flag(o_ptr->art_flags, TR_IGNORE_FIRE);
add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
}
- /* Add one random ability from material weapon */
give_one_ability_of_object(o_ptr, mo_ptr);
-
- /* Add one random activation */
if (!activation_index(o_ptr)) one_activation(o_ptr);
- /* Narsil */
if (o_ptr->name1 == ART_NARSIL)
{
one_high_resistance(o_ptr);
msg_format("Repaired into %s for %d gold.", basenm, cost);
#endif
msg_print(NULL);
-
- /* Remove BROKEN flag */
o_ptr->ident &= ~(IDENT_BROKEN);
-
- /* Add repaired flag */
o_ptr->discount = 99;
player_ptr->total_weight += o_ptr->weight;
calc_android_exp(player_ptr);
-
- /* Decrease material object */
inven_item_increase(player_ptr, mater, -1);
inven_item_optimize(player_ptr, mater);
o_ptr = choose_object(player_ptr, &item, q, s, (USE_INVEN | USE_EQUIP | IGNORE_BOTHHAND_SLOT), item_tester_tval);
if (!o_ptr) return FALSE;
- /* Check if the player has enough money */
char tmp_str[MAX_NLEN];
if (player_ptr->au < (cost * o_ptr->number))
{
return FALSE;
}
- /* Enchant to hit */
bool okay = FALSE;
for (int i = 0; i < to_hit; i++)
{
}
}
- /* Enchant to damage */
for (int i = 0; i < to_dam; i++)
{
if ((o_ptr->to_d < maxenchant) && enchant(player_ptr, o_ptr, 1, (ENCH_TODAM | ENCH_FORCE)))
}
}
- /* Enchant to AC */
for (int i = 0; i < to_ac; i++)
{
if ((o_ptr->to_a < maxenchant) && enchant(player_ptr, o_ptr, 1, (ENCH_TOAC | ENCH_FORCE)))
}
}
- /* Failure */
if (!okay)
{
if (flush_failure) flush();
object_desc(player_ptr, tmp_str, o_ptr, 0);
msg_format(_("%s です。", "You have: %s."), tmp_str);
- /* Auto-inscription */
autopick_alter_item(player_ptr, item, FALSE);
-
- /* Update the gold display */
building_prt_gold(player_ptr);
}
return;
}
- /* Extract the object "level" */
DEPTH lev = k_info[o_ptr->k_idx].level;
PRICE price;
if (o_ptr->tval == TV_ROD)
{
if (o_ptr->timeout > 0)
{
- /* Fully recharge */
price = (lev * 50 * o_ptr->timeout) / k_ptr->pval;
}
else
{
- /* No recharge necessary */
price = 0;
msg_format(_("それは再充填する必要はありません。", "That doesn't need to be recharged."));
return;
price = MAX(10, price);
}
- /* Limit the number of charges for wands and staffs */
if (o_ptr->tval == TV_WAND
&& (o_ptr->pval / o_ptr->number >= k_ptr->pval))
{
return;
}
- /* Check if the player has enough money */
if (player_ptr->au < price)
{
object_desc(player_ptr, tmp_str, o_ptr, OD_NAME_ONLY);
#endif
{
- /* Recharge fully */
o_ptr->timeout = 0;
}
else
else
max_charges = o_ptr->number * k_ptr->pval - o_ptr->pval;
- /* Get the quantity for staves and wands */
charges = (PARAMETER_VALUE)get_quantity(format(_("一回分$%d で何回分充填しますか?", "Add how many charges for %d gold? "), price),
MIN(player_ptr->au / price, max_charges));
- /* Do nothing */
if (charges < 1) return;
price *= charges;
object_type *o_ptr;
o_ptr = &player_ptr->inventory_list[i];
- /* skip non magic device */
if (o_ptr->tval < TV_STAFF || o_ptr->tval > TV_ROD) continue;
-
- /* need identified */
if (!object_is_known(o_ptr)) total_cost += 50;
- /* Extract the object "level" */
DEPTH lev = k_info[o_ptr->k_idx].level;
object_kind *k_ptr;
k_ptr = &k_info[o_ptr->k_idx];
break;
case TV_STAFF:
- /* Price per charge ( = double the price paid by shopkeepers for the charge) */
price = (k_info[o_ptr->k_idx].cost / 10) * o_ptr->number;
-
- /* Pay at least 10 gold per charge */
price = MAX(10, price);
-
- /* Fully charge */
price = (k_ptr->pval - o_ptr->pval) * price;
break;
case TV_WAND:
- /* Price per charge ( = double the price paid by shopkeepers for the charge) */
price = (k_info[o_ptr->k_idx].cost / 10);
-
- /* Pay at least 10 gold per charge */
price = MAX(10, price);
-
- /* Fully charge */
price = (o_ptr->number * k_ptr->pval - o_ptr->pval) * price;
break;
}
- /* if price <= 0 then item have enough charge */
if (price > 0) total_cost += price;
}
return;
}
- /* Check if the player has enough money */
if (player_ptr->au < total_cost)
{
msg_format(_("すべてのアイテムを再充填するには$%d 必要です!", "You need %d gold to recharge all items!"), total_cost);
object_kind *k_ptr;
k_ptr = &k_info[o_ptr->k_idx];
- /* skip non magic device */
if (o_ptr->tval < TV_STAFF || o_ptr->tval > TV_ROD) continue;
if (!object_is_known(o_ptr))
{
identify_item(player_ptr, o_ptr);
-
- /* Auto-inscription */
autopick_alter_item(player_ptr, i, FALSE);
}
- /* Recharge */
switch (o_ptr->tval)
{
case TV_ROD:
break;
case TV_STAFF:
if (o_ptr->pval < k_ptr->pval) o_ptr->pval = k_ptr->pval;
- /* We no longer think the item is empty */
+
o_ptr->ident &= ~(IDENT_EMPTY);
break;
case TV_WAND:
if (o_ptr->pval < o_ptr->number * k_ptr->pval)
o_ptr->pval = o_ptr->number * k_ptr->pval;
- /* We no longer think the item is empty */
+
o_ptr->ident &= ~(IDENT_EMPTY);
break;
}
player_ptr->au -= total_cost;
}
+
/*!
* @brief 施設でモンスターの情報を知るメインルーチン / research_mon -KMW-
* @param player_ptr プレーヤーへの参照ポインタ
u16b why = 0;
MONSTER_IDX *who;
- /* XTRA HACK WHATSEARCH */
bool all = FALSE;
bool uniq = FALSE;
bool norm = FALSE;
char temp[80] = "";
- /* XTRA HACK REMEMBER_IDX */
static int old_sym = '\0';
static IDX old_i = 0;
-
screen_save();
- /* Get a character, or abort */
char sym;
if (!get_com(_("モンスターの文字を入力して下さい(記号 or ^A全,^Uユ,^N非ユ,^M名前):",
"Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): "), &sym, FALSE))
return FALSE;
}
- /* Find that character info, and describe it */
IDX i;
for (i = 0; ident_info[i]; ++i)
{
C_MAKE(who, max_r_idx, MONRACE_IDX);
/* Collect matching monsters */
- int n;
- for (n = 0, i = 1; i < max_r_idx; i++)
+ int n = 0;
+ for (i = 1; i < max_r_idx; i++)
{
monster_race *r_ptr = &r_info[i];
}
}
- /* Nothing to recall */
- if (!n)
+ if (n == 0)
{
- /* Free the "who" array */
C_KILL(who, max_r_idx, MONRACE_IDX);
screen_load();
return FALSE;
}
- /* Sort by level */
why = 2;
char query = 'y';
- /* Sort if needed */
if (why)
{
ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
}
- /* Start at the end */
- /* XTRA HACK REMEMBER_IDX */
if (old_sym == sym && old_i < n) i = old_i;
else i = n - 1;
notpicked = TRUE;
-
- /* Scan the monster memory */
MONRACE_IDX r_idx;
while (notpicked)
{
r_idx = who[i];
-
- /* Hack -- Begin the prompt */
roff_top(r_idx);
-
- /* Hack -- Complete the prompt */
Term_addstr(-1, TERM_WHITE, _(" ['r'思い出, ' 'で続行, ESC]", " [(r)ecall, ESC, space to continue]"));
-
- /* Interact */
while (TRUE)
{
if (recall)
{
- /*** Recall on screen ***/
-
- /* Get maximal info about this monster */
lore_do_probe(player_ptr, r_idx);
-
- /* Save this monster ID */
monster_race_track(player_ptr, r_idx);
handle_stuff(player_ptr);
-
- /* know every thing mode */
screen_roff(player_ptr, r_idx, 0x01);
notpicked = FALSE;
-
- /* XTRA HACK REMEMBER_IDX */
old_sym = sym;
old_i = i;
}
query = inkey();
-
- /* Normal commands */
if (query != 'r') break;
recall = !recall;
}
- /* Stop scanning */
if (query == ESCAPE) break;
- /* Move to "prev" monster */
if (query == '-')
{
if (++i == n)
return;
}
- /* check gold (HACK - Recharge uses variable costs) */
BACT_IDX bact = bldg->actions[i];
if ((bact != BACT_RECHARGE) &&
(((bldg->member_costs[i] > player_ptr->au) && is_owner(player_ptr, bldg)) ||
case BACT_RECHARGE_ALL:
building_recharge_all(player_ptr);
break;
- case BACT_IDENTS: /* needs work */
+ case BACT_IDENTS:
if (!get_check(_("持ち物を全て鑑定してよろしいですか?", "Do you pay for identify all your possession? "))) break;
identify_pack(player_ptr);
msg_print(_(" 持ち物全てが鑑定されました。", "Your possessions have been identified."));
paid = TRUE;
break;
- case BACT_IDENT_ONE: /* needs work */
+ case BACT_IDENT_ONE:
paid = ident_spell(player_ptr, FALSE);
break;
case BACT_LEARN:
do_cmd_study(player_ptr);
break;
- case BACT_HEALING: /* needs work */
+ case BACT_HEALING:
paid = cure_critical_wounds(player_ptr, 200);
break;
- case BACT_RESTORE: /* needs work */
+ case BACT_RESTORE:
paid = restore_all_status(player_ptr);
break;
case BACT_ENCHANT_ARROWS:
building_type *bldg;
bldg = &building[which];
- /* Don't re-init the wilderness */
reinit_wilderness = FALSE;
if ((which == 2) && (player_ptr->arena_number < 0))
}
else
{
- /* Don't save the arena as saved floor */
prepare_change_floor_mode(player_ptr, CFM_SAVE_FLOORS | CFM_NO_RETURN);
-
player_ptr->current_floor_ptr->inside_arena = FALSE;
player_ptr->leaving = TRUE;
-
- /* Re-enter the arena */
command_new = SPECIAL_KEY_BUILDING;
-
- /* No energy needed to re-enter the arena */
free_turn(player_ptr);
}
}
else if (player_ptr->phase_out)
{
- /* Don't save the arena as saved floor */
prepare_change_floor_mode(player_ptr, CFM_SAVE_FLOORS | CFM_NO_RETURN);
-
player_ptr->leaving = TRUE;
player_ptr->phase_out = FALSE;
-
- /* Re-enter the monster arena */
command_new = SPECIAL_KEY_BUILDING;
-
- /* No energy needed to re-enter the arena */
free_turn(player_ptr);
-
return;
}
else
forget_lite(player_ptr->current_floor_ptr);
forget_view(player_ptr->current_floor_ptr);
-
- /* Hack -- Increase "icky" depth */
current_world_ptr->character_icky++;
command_arg = 0;
show_building(player_ptr, bldg);
player_ptr->leave_bldg = FALSE;
-
play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD);
bool validcmd;
msg_flag = FALSE;
msg_erase();
- /* Reinit wilderness to activate quests ... */
if (reinit_wilderness) player_ptr->leaving = TRUE;
- /* Hack -- Decrease "icky" depth */
current_world_ptr->character_icky--;
-
Term_clear();
player_ptr->update |= (PU_VIEW | PU_MONSTERS | PU_BONUS | PU_LITE | PU_MON_LITE);
}
}
- /* Sort them */
for (int i = 0; i < MAX_BOUNTY - 1; i++)
{
for (int j = i; j < MAX_BOUNTY; j++)