X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Frealm-hex.c;h=0fc16eb0b633dc937ddfa9c7b76490f412542a09;hb=e70ba712cf4b753e7d3876f60980c87cfeec09e3;hp=7b157c3df381bc86f4ea79e53a69f8322f4e001c;hpb=fa04e1963f8146023efa8bd35dc57412a338648a;p=hengband%2Fhengband.git diff --git a/src/realm-hex.c b/src/realm-hex.c index 7b157c3df..0fc16eb0b 100644 --- a/src/realm-hex.c +++ b/src/realm-hex.c @@ -29,7 +29,7 @@ */ bool stop_hex_spell_all(void) { - int i; + SPELL_IDX i; for (i = 0; i < 32; i++) { @@ -39,10 +39,8 @@ bool stop_hex_spell_all(void) CASTING_HEX_FLAGS(p_ptr) = 0; CASTING_HEX_NUM(p_ptr) = 0; - /* Print message */ if (p_ptr->action == ACTION_SPELL) set_action(ACTION_NONE); - /* Redraw status */ p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS); p_ptr->redraw |= (PR_EXTRA | PR_HP | PR_MANA); @@ -56,7 +54,7 @@ bool stop_hex_spell_all(void) bool stop_hex_spell(void) { int spell; - char choice; + char choice = 0; char out_val[160]; bool flag = FALSE; TERM_LEN y = 1; @@ -76,13 +74,8 @@ bool stop_hex_spell(void) } else { -#ifdef JP - strnfmt(out_val, 78, "どの呪文の詠唱を中断しますか?(呪文 %c-%c, 'l'全て, ESC)", - I2A(0), I2A(CASTING_HEX_NUM(p_ptr) - 1)); -#else - strnfmt(out_val, 78, "Which spell do you stop casting? (Spell %c-%c, 'l' to all, ESC)", + strnfmt(out_val, 78, _("どの呪文の詠唱を中断しますか?(呪文 %c-%c, 'l'全て, ESC)", "Which spell do you stop casting? (Spell %c-%c, 'l' to all, ESC)"), I2A(0), I2A(CASTING_HEX_NUM(p_ptr) - 1)); -#endif screen_save(); @@ -90,7 +83,7 @@ bool stop_hex_spell(void) { int n = 0; Term_erase(x, y, 255); - prt(" 名前", y, x + 5); + prt(_(" 名前", " Name"), y, x + 5); for (spell = 0; spell < 32; spell++) { if (hex_spelling(spell)) @@ -125,7 +118,6 @@ bool stop_hex_spell(void) CASTING_HEX_NUM(p_ptr)--; } - /* Redraw status */ p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS); p_ptr->redraw |= (PR_EXTRA | PR_HP | PR_MANA); @@ -141,7 +133,7 @@ bool stop_hex_spell(void) void check_hex(void) { int spell; - s32b need_mana; + MANA_POINT need_mana; u32b need_mana_frac; bool res = FALSE; @@ -174,13 +166,11 @@ void check_hex(void) } } - /* Culcurates final mana cost */ need_mana_frac = 0; s64b_div(&need_mana, &need_mana_frac, 0, 3); /* Divide by 3 */ need_mana += (CASTING_HEX_NUM(p_ptr) - 1); - /* Not enough mana */ if (s64b_cmp(p_ptr->csp, p_ptr->csp_frac, need_mana, need_mana_frac) < 0) { @@ -196,22 +186,13 @@ void check_hex(void) p_ptr->redraw |= PR_MANA; if (res) { -#ifdef JP - msg_print("詠唱を再開した。"); -#else - msg_print("You restart spelling."); -#endif + msg_print(_("詠唱を再開した。", "You restart spelling.")); + p_ptr->action = ACTION_SPELL; - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS | PU_HP); - - /* Redraw map and status bar */ p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE); - - /* Update monsters */ p_ptr->update |= (PU_MONSTERS); - p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); } } @@ -252,14 +233,9 @@ void check_hex(void) bool hex_spell_fully(void) { int k_max = 0; - k_max = (p_ptr->lev / 15) + 1; - - /* Paranoia */ k_max = MIN(k_max, MAX_KEEP); - if (CASTING_HEX_NUM(p_ptr) < k_max) return FALSE; - return TRUE; } @@ -413,7 +389,7 @@ cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode) if (info) return info_damage(1, power, 0); if (cast || cont) { - project_hack(GF_POIS, randint1(power)); + project_all_los(GF_POIS, randint1(power)); } break; @@ -433,7 +409,7 @@ cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode) { OBJECT_IDX item; cptr q, s; - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; object_type *o_ptr; u32b f[TR_FLAG_SIZE]; @@ -609,7 +585,7 @@ cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode) if (info) return info_damage(1, power, 0); if (cast || cont) { - project_hack(GF_HYPODYNAMIA, randint1(power)); + project_all_los(GF_HYPODYNAMIA, randint1(power)); } break; @@ -729,7 +705,7 @@ cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode) { OBJECT_IDX item; cptr q, s; - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; object_type *o_ptr; u32b f[TR_FLAG_SIZE]; @@ -848,7 +824,7 @@ cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode) if (info) return info_damage(1, power, 0); if (cast || cont) { - project_hack(GF_PSI_DRAIN, randint1(power)); + project_all_los(GF_PSI_DRAIN, randint1(power)); } break; @@ -897,7 +873,7 @@ cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode) flag = TRUE; } - for (i = A_STR; i < 6; i++) + for (i = A_STR; i < A_MAX; i++) { if (p_ptr->stat_cur[i] < p_ptr->stat_max[i]) { @@ -908,8 +884,6 @@ cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode) if (p_ptr->stat_cur[i] > p_ptr->stat_max[i]) p_ptr->stat_cur[i] = p_ptr->stat_max[i]; - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); flag = TRUE; @@ -923,7 +897,6 @@ cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode) if (cont) CASTING_HEX_NUM(p_ptr)--; if (CASTING_HEX_NUM(p_ptr)) p_ptr->action = ACTION_NONE; - /* Redraw status */ p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS); p_ptr->redraw |= (PR_EXTRA); @@ -1136,7 +1109,6 @@ cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode) if (p_ptr->action != ACTION_SPELL) set_action(ACTION_SPELL); } - /* Redraw status */ if (!info) { p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);