X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Feffects.c;h=2bb9f9509da00a665b1b9eab7ccbc9069f06f91f;hb=2c751de0350284cf64edd6a478436c11a3dfa243;hp=4d92ea2ad3a770663f75b149fb3ce0b4b66941d9;hpb=5b8ce0f629f5f3067f7f042ce7eaac11079e1f49;p=hengbandforosx%2Fhengbandosx.git diff --git a/src/effects.c b/src/effects.c index 4d92ea2ad..2bb9f9509 100644 --- a/src/effects.c +++ b/src/effects.c @@ -13,6 +13,16 @@ */ #include "angband.h" +#include "mutation.h" +#include "quest.h" +#include "avatar.h" +#include "player-status.h" +#include "spells-status.h" +#include "realm-hex.h" +#include "object-hook.h" +#include "wild.h" +#include "spells-floor.h" +#include "player-move.h" /*! * @brief プレイヤーの継続行動を設定する。 @@ -40,24 +50,24 @@ void set_action(ACTION_IDX typ) } case ACTION_REST: { - resting = 0; + p_ptr->resting = 0; break; } case ACTION_LEARN: { - msg_print(_("学習をやめた。", "You stop Learning")); + msg_print(_("学習をやめた。", "You stop learning.")); new_mane = FALSE; break; } case ACTION_KAMAE: { - msg_print(_("構えをといた。", "You stop assuming the posture.")); + msg_print(_("構えをといた。", "You stop assuming the special stance.")); p_ptr->special_defense &= ~(KAMAE_MASK); break; } case ACTION_KATA: { - msg_print(_("型を崩した。", "You stop assuming the posture.")); + msg_print(_("型を崩した。", "You stop assuming the special stance.")); p_ptr->special_defense &= ~(KATA_MASK); p_ptr->update |= (PU_MONSTERS); p_ptr->redraw |= (PR_STATUS); @@ -71,12 +81,12 @@ void set_action(ACTION_IDX typ) case ACTION_HAYAGAKE: { msg_print(_("足が重くなった。", "You are no longer walking extremely fast.")); - p_ptr->energy_use = 100; + take_turn(p_ptr, 100); break; } case ACTION_SPELL: { - msg_print(_("呪文の詠唱を中断した。", "You stopped spelling all spells.")); + msg_print(_("呪文の詠唱を中断した。", "You stopped casting.")); break; } } @@ -85,7 +95,7 @@ void set_action(ACTION_IDX typ) p_ptr->action = typ; /* If we are requested other action, stop singing */ - if (prev_typ == ACTION_SING) stop_singing(); + if (prev_typ == ACTION_SING) stop_singing(p_ptr); if (prev_typ == ACTION_SPELL) stop_hex_spell(); switch (p_ptr->action) @@ -98,7 +108,7 @@ void set_action(ACTION_IDX typ) } case ACTION_LEARN: { - msg_print(_("学習を始めた。", "You begin Learning")); + msg_print(_("学習を始めた。", "You begin learning")); break; } case ACTION_FISH: @@ -116,11 +126,7 @@ void set_action(ACTION_IDX typ) break; } } - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Redraw the state */ p_ptr->redraw |= (PR_STATE); } @@ -173,7 +179,6 @@ void reset_tim_flags(void) p_ptr->dustrobe = 0; p_ptr->action = ACTION_NONE; - p_ptr->oppose_acid = 0; /* Timed -- oppose acid */ p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */ p_ptr->oppose_fire = 0; /* Timed -- oppose heat */ @@ -190,7 +195,7 @@ void reset_tim_flags(void) p_ptr->special_defense = 0L; while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED(); - world_player = FALSE; + p_ptr->timewalk = FALSE; if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1; if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1; @@ -266,23 +271,15 @@ void dispel_player(void) if (music_singing_any() || hex_spelling_any()) { - cptr str = (music_singing_any()) ? _("歌", "singing") : _("呪文", "spelling"); + concptr str = (music_singing_any()) ? _("歌", "singing") : _("呪文", "casting"); INTERUPTING_SONG_EFFECT(p_ptr) = SINGING_SONG_EFFECT(p_ptr); SINGING_SONG_EFFECT(p_ptr) = MUSIC_NONE; msg_format(_("%sが途切れた。", "Your %s is interrupted."), str); - p_ptr->action = ACTION_NONE; - - /* Recalculate bonuses */ - p_ptr->update |= (PU_BONUS | PU_HP); - /* Redraw map */ + p_ptr->action = ACTION_NONE; + p_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS); p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE); - - /* Update monsters */ - p_ptr->update |= (PU_MONSTERS); - p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); - p_ptr->energy_need += ENERGY_NEED(); } } @@ -298,8 +295,6 @@ void dispel_player(void) bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -336,20 +331,14 @@ bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec) p_ptr->tim_mimic = v; /* Nothing to notice */ - if (!notice) - return (FALSE); + if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, TRUE); - /* Redraw title */ p_ptr->redraw |= (PR_BASIC | PR_STATUS); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS | PU_HP); handle_stuff(); - - /* Result */ return (TRUE); } @@ -366,8 +355,6 @@ bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec) bool set_blind(TIME_EFFECT v) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -411,27 +398,17 @@ bool set_blind(TIME_EFFECT v) /* Use the value */ p_ptr->blind = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); - if (disturb_state) disturb(FALSE, FALSE); /* Fully update the visuals */ p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE); - - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -444,8 +421,6 @@ bool set_blind(TIME_EFFECT v) bool set_confused(TIME_EFFECT v) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -459,7 +434,7 @@ bool set_confused(TIME_EFFECT v) if (p_ptr->action == ACTION_LEARN) { - msg_print(_("学習が続けられない!", "You cannot continue Learning!")); + msg_print(_("学習が続けられない!", "You cannot continue learning!")); new_mane = FALSE; p_ptr->redraw |= (PR_STATE); @@ -467,7 +442,7 @@ bool set_confused(TIME_EFFECT v) } if (p_ptr->action == ACTION_KAMAE) { - msg_print(_("構えがとけた。", "Your posture gets loose.")); + msg_print(_("構えがとけた。", "You lose your stance.")); p_ptr->special_defense &= ~(KAMAE_MASK); p_ptr->update |= (PU_BONUS); p_ptr->redraw |= (PR_STATE); @@ -475,7 +450,7 @@ bool set_confused(TIME_EFFECT v) } else if (p_ptr->action == ACTION_KATA) { - msg_print(_("型が崩れた。", "Your posture gets loose.")); + msg_print(_("型が崩れた。", "You lose your stance.")); p_ptr->special_defense &= ~(KATA_MASK); p_ptr->update |= (PU_BONUS); p_ptr->update |= (PU_MONSTERS); @@ -509,19 +484,13 @@ bool set_confused(TIME_EFFECT v) /* Use the value */ p_ptr->confused = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -534,8 +503,6 @@ bool set_confused(TIME_EFFECT v) bool set_poisoned(TIME_EFFECT v) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -562,19 +529,13 @@ bool set_poisoned(TIME_EFFECT v) /* Use the value */ p_ptr->poisoned = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -587,8 +548,6 @@ bool set_poisoned(TIME_EFFECT v) bool set_afraid(TIME_EFFECT v) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -602,7 +561,7 @@ bool set_afraid(TIME_EFFECT v) if (p_ptr->special_defense & KATA_MASK) { - msg_print(_("型が崩れた。", "Your posture gets loose.")); + msg_print(_("型が崩れた。", "You lose your stance.")); p_ptr->special_defense &= ~(KATA_MASK); p_ptr->update |= (PU_BONUS); p_ptr->update |= (PU_MONSTERS); @@ -629,19 +588,13 @@ bool set_afraid(TIME_EFFECT v) /* Use the value */ p_ptr->afraid = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -653,8 +606,6 @@ bool set_afraid(TIME_EFFECT v) bool set_paralyzed(TIME_EFFECT v) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -688,22 +639,14 @@ bool set_paralyzed(TIME_EFFECT v) /* Use the value */ p_ptr->paralyzed = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Redraw the state */ p_ptr->redraw |= (PR_STATE); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -716,11 +659,10 @@ bool set_paralyzed(TIME_EFFECT v) bool set_image(TIME_EFFECT v) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; + if (p_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0; /* Open */ @@ -751,8 +693,6 @@ bool set_image(TIME_EFFECT v) /* Use the value */ p_ptr->image = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ @@ -760,21 +700,10 @@ bool set_image(TIME_EFFECT v) if (disturb_state) disturb(FALSE, TRUE); - /* Redraw map */ - p_ptr->redraw |= (PR_MAP); - - /* Update the health bar */ - p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH); - - /* Update monsters */ + p_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH); p_ptr->update |= (PU_MONSTERS); - p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -787,8 +716,6 @@ bool set_image(TIME_EFFECT v) bool set_fast(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -826,14 +753,8 @@ bool set_fast(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -846,8 +767,6 @@ bool set_fast(TIME_EFFECT v, bool do_dec) bool set_lightspeed(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -863,7 +782,7 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec) } else if (!p_ptr->lightspeed) { - msg_print(_("非常に素早く動けるようになった!", "You feel yourself moving extremely faster!")); + msg_print(_("非常に素早く動けるようになった!", "You feel yourself moving extremely fast!")); notice = TRUE; chg_virtue(V_PATIENCE, -1); chg_virtue(V_DILIGENCE, 1); @@ -887,14 +806,8 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -907,8 +820,6 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec) bool set_slow(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -944,14 +855,8 @@ bool set_slow(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -965,8 +870,6 @@ bool set_slow(TIME_EFFECT v, bool do_dec) bool set_shield(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -997,22 +900,14 @@ bool set_shield(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->shield = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1026,8 +921,6 @@ bool set_shield(TIME_EFFECT v, bool do_dec) bool set_tsubureru(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1058,22 +951,14 @@ bool set_tsubureru(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->tsubureru = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1087,8 +972,6 @@ bool set_tsubureru(TIME_EFFECT v, bool do_dec) bool set_magicdef(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1119,22 +1002,14 @@ bool set_magicdef(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->magicdef = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1147,8 +1022,6 @@ bool set_magicdef(TIME_EFFECT v, bool do_dec) bool set_blessed(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1179,22 +1052,14 @@ bool set_blessed(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->blessed = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1208,8 +1073,6 @@ bool set_blessed(TIME_EFFECT v, bool do_dec) bool set_hero(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1240,25 +1103,17 @@ bool set_hero(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->hero = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Recalculate hitpoints */ p_ptr->update |= (PU_HP); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1271,8 +1126,6 @@ bool set_hero(TIME_EFFECT v, bool do_dec) bool set_shero(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1297,32 +1150,24 @@ bool set_shero(TIME_EFFECT v, bool do_dec) { if (p_ptr->shero) { - msg_print(_("野蛮な気持ちが消え失せた。", "You feel less Berserk.")); + msg_print(_("野蛮な気持ちが消え失せた。", "You feel less berserk.")); notice = TRUE; } } /* Use the value */ p_ptr->shero = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Recalculate hitpoints */ p_ptr->update |= (PU_HP); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1335,8 +1180,6 @@ bool set_shero(TIME_EFFECT v, bool do_dec) bool set_protevil(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1367,19 +1210,13 @@ bool set_protevil(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->protevil = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1392,8 +1229,6 @@ bool set_protevil(TIME_EFFECT v, bool do_dec) bool set_wraith_form(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1414,10 +1249,7 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec) chg_virtue(V_SACRIFICE, -2); chg_virtue(V_VALOUR, -5); - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - - /* Update monsters */ p_ptr->update |= (PU_MONSTERS); p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); @@ -1432,10 +1264,7 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec) msg_print(_("不透明になった感じがする。", "You feel opaque.")); notice = TRUE; - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - - /* Update monsters */ p_ptr->update |= (PU_MONSTERS); p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); @@ -1444,22 +1273,14 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->wraith_form = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1473,8 +1294,6 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec) bool set_invuln(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1496,10 +1315,7 @@ bool set_invuln(TIME_EFFECT v, bool do_dec) chg_virtue(V_SACRIFICE, -3); chg_virtue(V_VALOUR, -5); - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - - /* Update monsters */ p_ptr->update |= (PU_MONSTERS); p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); @@ -1514,10 +1330,7 @@ bool set_invuln(TIME_EFFECT v, bool do_dec) msg_print(_("無敵ではなくなった。", "The invulnerability wears off.")); notice = TRUE; - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - - /* Update monsters */ p_ptr->update |= (PU_MONSTERS); p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); @@ -1528,22 +1341,14 @@ bool set_invuln(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->invuln = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1556,8 +1361,6 @@ bool set_invuln(TIME_EFFECT v, bool do_dec) bool set_tim_esp(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1588,25 +1391,15 @@ bool set_tim_esp(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->tim_esp = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Update the monsters */ p_ptr->update |= (PU_MONSTERS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1619,8 +1412,6 @@ bool set_tim_esp(TIME_EFFECT v, bool do_dec) bool set_tim_invis(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1651,25 +1442,17 @@ bool set_tim_invis(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->tim_invis = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Update the monsters */ p_ptr->update |= (PU_MONSTERS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1682,8 +1465,6 @@ bool set_tim_invis(TIME_EFFECT v, bool do_dec) bool set_tim_infra(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1714,25 +1495,17 @@ bool set_tim_infra(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->tim_infra = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Update the monsters */ p_ptr->update |= (PU_MONSTERS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1745,8 +1518,6 @@ bool set_tim_infra(TIME_EFFECT v, bool do_dec) bool set_tim_regen(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1777,22 +1548,14 @@ bool set_tim_regen(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->tim_regen = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1805,8 +1568,6 @@ bool set_tim_regen(TIME_EFFECT v, bool do_dec) bool set_tim_stealth(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1837,22 +1598,14 @@ bool set_tim_stealth(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->tim_stealth = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1872,7 +1625,7 @@ bool set_superstealth(bool set) { if (!(p_ptr->special_defense & NINJA_S_STEALTH)) { - if (cave[p_ptr->y][p_ptr->x].info & CAVE_MNLT) + if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT) { msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes.")); p_ptr->monlite = p_ptr->old_monlite = TRUE; @@ -1905,13 +1658,9 @@ bool set_superstealth(bool set) /* Nothing to notice */ if (!notice) return (FALSE); - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); if (disturb_state) disturb(FALSE, FALSE); - - /* Result */ return (TRUE); } @@ -1924,8 +1673,6 @@ bool set_superstealth(bool set) bool set_tim_levitation(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1956,22 +1703,14 @@ bool set_tim_levitation(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->tim_levitation = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -1984,8 +1723,6 @@ bool set_tim_levitation(TIME_EFFECT v, bool do_dec) bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -1999,7 +1736,7 @@ bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec) } else if (!p_ptr->tim_sh_touki) { - msg_print(_("体が闘気のオーラで覆われた。", "You have enveloped by the aura of the Force!")); + msg_print(_("体が闘気のオーラで覆われた。", "You are enveloped by an aura of the Force!")); notice = TRUE; } } @@ -2009,26 +1746,20 @@ bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec) { if (p_ptr->tim_sh_touki) { - msg_print(_("闘気が消えた。", "Aura of the Force disappeared.")); + msg_print(_("闘気が消えた。", "The aura of the Force disappeared.")); notice = TRUE; } } /* Use the value */ p_ptr->tim_sh_touki = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2041,8 +1772,6 @@ bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec) bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -2056,7 +1785,7 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec) } else if (!p_ptr->tim_sh_fire) { - msg_print(_("体が炎のオーラで覆われた。", "You have enveloped by fiery aura!")); + msg_print(_("体が炎のオーラで覆われた。", "You are enveloped by a fiery aura!")); notice = TRUE; } } @@ -2066,29 +1795,21 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec) { if (p_ptr->tim_sh_fire) { - msg_print(_("炎のオーラが消えた。", "Fiery aura disappeared.")); + msg_print(_("炎のオーラが消えた。", "The fiery aura disappeared.")); notice = TRUE; } } /* Use the value */ p_ptr->tim_sh_fire = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2101,8 +1822,6 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec) bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -2116,7 +1835,7 @@ bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec) } else if (!p_ptr->tim_sh_holy) { - msg_print(_("体が聖なるオーラで覆われた。", "You have enveloped by holy aura!")); + msg_print(_("体が聖なるオーラで覆われた。", "You are enveloped by a holy aura!")); notice = TRUE; } } @@ -2126,29 +1845,21 @@ bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec) { if (p_ptr->tim_sh_holy) { - msg_print(_("聖なるオーラが消えた。", "Holy aura disappeared.")); + msg_print(_("聖なるオーラが消えた。", "The holy aura disappeared.")); notice = TRUE; } } /* Use the value */ p_ptr->tim_sh_holy = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2161,8 +1872,6 @@ bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec) bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -2193,22 +1902,14 @@ bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->tim_eyeeye = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2222,8 +1923,6 @@ bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec) bool set_resist_magic(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -2254,22 +1953,14 @@ bool set_resist_magic(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->resist_magic = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2282,8 +1973,6 @@ bool set_resist_magic(TIME_EFFECT v, bool do_dec) bool set_tim_reflect(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -2314,22 +2003,14 @@ bool set_tim_reflect(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->tim_reflect = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2340,8 +2021,6 @@ bool set_tim_reflect(TIME_EFFECT v, bool do_dec) bool set_multishadow(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -2372,22 +2051,14 @@ bool set_multishadow(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->multishadow = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2400,8 +2071,6 @@ bool set_multishadow(TIME_EFFECT v, bool do_dec) bool set_dustrobe(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -2432,22 +2101,14 @@ bool set_dustrobe(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->dustrobe = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2460,8 +2121,6 @@ bool set_dustrobe(TIME_EFFECT v, bool do_dec) bool set_kabenuke(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -2475,7 +2134,7 @@ bool set_kabenuke(TIME_EFFECT v, bool do_dec) } else if (!p_ptr->kabenuke) { - msg_print(_("体が半物質の状態になった。", "You became ethereal form.")); + msg_print(_("体が半物質の状態になった。", "You became ethereal.")); notice = TRUE; } } @@ -2485,29 +2144,21 @@ bool set_kabenuke(TIME_EFFECT v, bool do_dec) { if (p_ptr->kabenuke) { - msg_print(_("体が物質化した。", "You are no longer in an ethereal form.")); + msg_print(_("体が物質化した。", "You are no longer ethereal.")); notice = TRUE; } } /* Use the value */ p_ptr->kabenuke = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2520,8 +2171,6 @@ bool set_kabenuke(TIME_EFFECT v, bool do_dec) bool set_tsuyoshi(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -2546,7 +2195,7 @@ bool set_tsuyoshi(TIME_EFFECT v, bool do_dec) { if (p_ptr->tsuyoshi) { - msg_print(_("肉体が急速にしぼんでいった。", "Your body had quickly shriveled.")); + msg_print(_("肉体が急速にしぼんでいった。", "Your body has quickly shriveled.")); (void)dec_stat(A_CON, 20, TRUE); (void)dec_stat(A_STR, 20, TRUE); @@ -2558,25 +2207,17 @@ bool set_tsuyoshi(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->tsuyoshi = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Recalculate hitpoints */ p_ptr->update |= (PU_HP); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2588,7 +2229,6 @@ bool set_tsuyoshi(TIME_EFFECT v, bool do_dec) */ bool set_ele_attack(u32b attack_type, TIME_EFFECT v) { - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; /* Clear all elemental attacks (only one is allowed at a time). */ @@ -2626,7 +2266,6 @@ bool set_ele_attack(u32b attack_type, TIME_EFFECT v) /* Set duration. */ p_ptr->ele_attack = v; - /* Message. */ #ifdef JP msg_format("%sで攻撃できるようになった!", ((attack_type == ATTACK_ACID) ? "酸" : @@ -2647,13 +2286,9 @@ bool set_ele_attack(u32b attack_type, TIME_EFFECT v) } if (disturb_state) disturb(FALSE, FALSE); - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); return (TRUE); @@ -2667,7 +2302,6 @@ bool set_ele_attack(u32b attack_type, TIME_EFFECT v) */ bool set_ele_immune(u32b immune_type, TIME_EFFECT v) { - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; /* Clear all elemental attacks (only one is allowed at a time). */ @@ -2705,34 +2339,18 @@ bool set_ele_immune(u32b immune_type, TIME_EFFECT v) /* Set duration. */ p_ptr->ele_immune = v; - /* Message. */ -#ifdef JP - msg_format("%sの攻撃を受けつけなくなった!", - ((immune_type == DEFENSE_ACID) ? "酸" : - ((immune_type == DEFENSE_ELEC) ? "電撃" : - ((immune_type == DEFENSE_FIRE) ? "火炎" : - ((immune_type == DEFENSE_COLD) ? "冷気" : - ((immune_type == DEFENSE_POIS) ? "毒" : - "(なし)")))))); -#else - msg_format("For a while, You are immune to %s", - ((immune_type == DEFENSE_ACID) ? "acid!" : - ((immune_type == DEFENSE_ELEC) ? "electricity!" : - ((immune_type == DEFENSE_FIRE) ? "fire!" : - ((immune_type == DEFENSE_COLD) ? "cold!" : - ((immune_type == DEFENSE_POIS) ? "poison!" : - "do nothing special.")))))); -#endif + msg_format(_("%sの攻撃を受けつけなくなった!", "For a while, You are immune to %s"), + ((immune_type == DEFENSE_ACID) ? _("酸", "acid!") : + ((immune_type == DEFENSE_ELEC) ? _("電撃", "electricity!") : + ((immune_type == DEFENSE_FIRE) ? _("火炎", "fire!") : + ((immune_type == DEFENSE_COLD) ? _("冷気", "cold!") : + ((immune_type == DEFENSE_POIS) ? _("毒", "poison!") : + _("(なし)", "do nothing special."))))))); } if (disturb_state) disturb(FALSE, FALSE); - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); - p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); return (TRUE); @@ -2747,8 +2365,6 @@ bool set_ele_immune(u32b immune_type, TIME_EFFECT v) bool set_oppose_acid(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -2782,16 +2398,10 @@ bool set_oppose_acid(TIME_EFFECT v, bool do_dec) /* Nothing to notice */ if (!notice) return (FALSE); - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); if (disturb_state) disturb(FALSE, FALSE); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2804,8 +2414,6 @@ bool set_oppose_acid(TIME_EFFECT v, bool do_dec) bool set_oppose_elec(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -2839,16 +2447,10 @@ bool set_oppose_elec(TIME_EFFECT v, bool do_dec) /* Nothing to notice */ if (!notice) return (FALSE); - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); if (disturb_state) disturb(FALSE, FALSE); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2861,8 +2463,6 @@ bool set_oppose_elec(TIME_EFFECT v, bool do_dec) bool set_oppose_fire(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -2897,16 +2497,10 @@ bool set_oppose_fire(TIME_EFFECT v, bool do_dec) /* Nothing to notice */ if (!notice) return (FALSE); - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); if (disturb_state) disturb(FALSE, FALSE); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2919,8 +2513,6 @@ bool set_oppose_fire(TIME_EFFECT v, bool do_dec) bool set_oppose_cold(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -2954,16 +2546,10 @@ bool set_oppose_cold(TIME_EFFECT v, bool do_dec) /* Nothing to notice */ if (!notice) return (FALSE); - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); if (disturb_state) disturb(FALSE, FALSE); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -2976,8 +2562,6 @@ bool set_oppose_cold(TIME_EFFECT v, bool do_dec) bool set_oppose_pois(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1; @@ -3012,16 +2596,10 @@ bool set_oppose_pois(TIME_EFFECT v, bool do_dec) /* Nothing to notice */ if (!notice) return (FALSE); - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); if (disturb_state) disturb(FALSE, FALSE); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -3036,13 +2614,9 @@ bool set_stun(TIME_EFFECT v) { int old_aux, new_aux; bool notice = FALSE; - - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; - if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0; /* Knocked out */ @@ -3129,7 +2703,7 @@ bool set_stun(TIME_EFFECT v) } if (p_ptr->special_defense & KATA_MASK) { - msg_print(_("型が崩れた。", "Your posture gets loose.")); + msg_print(_("型が崩れた。", "You lose your stance.")); p_ptr->special_defense &= ~(KATA_MASK); p_ptr->update |= (PU_BONUS); p_ptr->update |= (PU_MONSTERS); @@ -3171,17 +2745,11 @@ bool set_stun(TIME_EFFECT v) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Redraw the "stun" */ p_ptr->redraw |= (PR_STUN); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -3197,8 +2765,6 @@ bool set_cut(TIME_EFFECT v) { int old_aux, new_aux; bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -3370,17 +2936,11 @@ bool set_cut(TIME_EFFECT v) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Redraw the "cut" */ p_ptr->redraw |= (PR_CUT); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -3415,8 +2975,6 @@ bool set_food(TIME_EFFECT v) int old_aux, new_aux; bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 20000) ? 20000 : (v < 0) ? 0 : v; /* Fainting / Starving */ @@ -3570,17 +3128,11 @@ bool set_food(TIME_EFFECT v) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Redraw hunger */ p_ptr->redraw |= (PR_HUNGER); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -3614,8 +3166,6 @@ bool inc_stat(int stat) { /* Approximate gain value */ gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2; - - /* Paranoia */ if (gain < 1) gain = 1; /* Apply the bonus */ @@ -3639,8 +3189,6 @@ bool inc_stat(int stat) { p_ptr->stat_max[stat] = value; } - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Success */ @@ -3701,8 +3249,6 @@ bool dec_stat(int stat, int amount, int permanent) /* and one-half of the stat bonus times the percentage, with a */ /* minimum damage of half the percentage. -CWS */ loss = (((cur-18) / 2 + 1) / 2 + 1); - - /* Paranoia */ if (loss < 1) loss = 1; /* Randomize the loss */ @@ -3772,10 +3318,7 @@ bool dec_stat(int stat, int amount, int permanent) p_ptr->stat_cur[stat] = cur; p_ptr->stat_max[stat] = max; - /* Redisplay the stats later */ p_ptr->redraw |= (PR_STATS); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); } @@ -3793,13 +3336,8 @@ bool res_stat(int stat) /* Restore if needed */ if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat]) { - /* Restore */ p_ptr->stat_cur[stat] = p_ptr->stat_max[stat]; - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Redisplay the stats later */ p_ptr->redraw |= (PR_STATS); /* Success */ @@ -3840,7 +3378,6 @@ bool hp_player(int num) p_ptr->chp_frac = 0; } - /* Redraw */ p_ptr->redraw |= (PR_HP); p_ptr->window |= (PW_PLAYER); @@ -3880,28 +3417,28 @@ bool hp_player(int num) /* * Array of stat "descriptions" */ -static cptr desc_stat_pos[] = +static concptr desc_stat_pos[] = { - _("強く", "strong"), - _("知的に", "smart"), - _("賢く", "wise"), - _("器用に", "dextrous"), - _("健康に", "healthy"), - _("美しく", "cute") + _("強く", "stronger"), + _("知的に", "smarter"), + _("賢く", "wiser"), + _("器用に", "more dextrous"), + _("健康に", "healthier"), + _("美しく", "cuter") }; /* * Array of stat "descriptions" */ -static cptr desc_stat_neg[] = +static concptr desc_stat_neg[] = { - _("弱く", "weak"), - _("無知に", "stupid"), - _("愚かに", "naive"), - _("不器用に", "clumsy"), - _("不健康に", "sickly"), - _("醜く", "ugly") + _("弱く", "weaker"), + _("無知に", "stupider"), + _("愚かに", "more naive"), + _("不器用に", "clumsier"), + _("不健康に", "more sickly"), + _("醜く", "uglier") }; @@ -3936,7 +3473,7 @@ bool do_dec_stat(int stat) /* Attempt to reduce the stat */ if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13)))) { - msg_format(_("ひどく%sなった気がする。", "You feel very %s."), desc_stat_neg[stat]); + msg_format(_("ひどく%sなった気がする。", "You feel %s."), desc_stat_neg[stat]); /* Notice effect */ return (TRUE); @@ -3955,7 +3492,7 @@ bool do_res_stat(int stat) /* Attempt to increase */ if (res_stat(stat)) { - msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]); + msg_format(_("元通りに%sなった気がする。", "You feel %s."), desc_stat_pos[stat]); return (TRUE); } @@ -3991,7 +3528,7 @@ bool do_inc_stat(int stat) else if (stat == A_CON) chg_virtue(V_VITALITY, 1); - msg_format(_("ワーオ!とても%sなった!", "Wow! You feel very %s!"), desc_stat_pos[stat]); + msg_format(_("ワーオ!とても%sなった!", "Wow! You feel %s!"), desc_stat_pos[stat]); return (TRUE); } @@ -3999,7 +3536,7 @@ bool do_inc_stat(int stat) /* Restoration worked */ if (res) { - msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]); + msg_format(_("元通りに%sなった気がする。", "You feel %s."), desc_stat_pos[stat]); return (TRUE); } @@ -4066,12 +3603,8 @@ bool lose_all_info(void) /* Hack -- Clear the "felt" flag */ o_ptr->ident &= ~(IDENT_SENSE); } - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Combine / Reorder the pack (later) */ - p_ptr->notice |= (PN_COMBINE | PN_REORDER); + p_ptr->update |= (PU_COMBINE | PU_REORDER); p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER); @@ -4111,9 +3644,9 @@ void do_poly_wounds(void) /* * Change player race */ -void change_race(CHARACTER_IDX new_race, cptr effect_msg) +void change_race(CHARACTER_IDX new_race, concptr effect_msg) { - cptr title = race_info[new_race].title; + concptr title = race_info[new_race].title; int old_race = p_ptr->prace; #ifdef JP @@ -4154,7 +3687,7 @@ void change_race(CHARACTER_IDX new_race, cptr effect_msg) else p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp; - do_cmd_rerate(FALSE); + roll_hitdice(p_ptr, 0L); /* The experience level may be modified */ check_experience(); @@ -4214,7 +3747,7 @@ void do_poly_self(void) /* Harmful deformity */ power -= 15; - while (tmp < 6) + while (tmp < A_MAX) { if (one_in_(2)) { @@ -4265,7 +3798,7 @@ void do_poly_self(void) power -= 20; msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), p_ptr->prace == RACE_ANDROID ? "機械" : "内臓"); - while (tmp < 6) + while (tmp < A_MAX) { (void)dec_stat(tmp, randint1(6) + 6, one_in_(3)); tmp++; @@ -4284,13 +3817,13 @@ void do_poly_self(void) power -= 10; get_max_stats(); - do_cmd_rerate(FALSE); + roll_hitdice(p_ptr, 0L); } while ((power > randint0(15)) && one_in_(3)) { power -= 7; - (void)gain_random_mutation(0); + (void)gain_mutation(p_ptr, 0); } if (power > randint0(5)) @@ -4302,7 +3835,7 @@ void do_poly_self(void) /* Note: earlier deductions may have left power < 0 already. */ while (power > 0) { - mutate_player(); + status_shuffle(); power--; } } @@ -4318,7 +3851,7 @@ void do_poly_self(void) * setting the player to "dead". */ -int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell) +int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell) { int old_chp = p_ptr->chp; @@ -4326,8 +3859,6 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell) char tmp[1024]; int warning = (p_ptr->mhp * hitpoint_warn / 10); - - /* Paranoia */ if (p_ptr->is_dead) return 0; if (p_ptr->sutemi) damage *= 2; @@ -4340,7 +3871,7 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell) disturb(TRUE, TRUE); if (auto_more) { - now_damaged = TRUE; + p_ptr->now_damaged = TRUE; } } @@ -4373,7 +3904,7 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell) } else if (damage_type == DAMAGE_ATTACK) { - msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!")); + msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, but you are unharmed!")); return 0; } } @@ -4432,8 +3963,6 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell) chg_virtue(V_SACRIFICE, 10); handle_stuff(); - - /* Leaving */ p_ptr->leaving = TRUE; /* Note death */ @@ -4441,14 +3970,14 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell) if (p_ptr->inside_arena) { - cptr m_name = r_name+r_info[arena_info[p_ptr->arena_number].r_idx].name; + concptr m_name = r_name+r_info[arena_info[p_ptr->arena_number].r_idx].name; msg_format(_("あなたは%sの前に敗れ去った。", "You are beaten by %s."), m_name); msg_print(NULL); if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, -1 - p_ptr->arena_number, m_name); } else { - QUEST_IDX q_idx = quest_number(dun_level); + QUEST_IDX q_idx = quest_number(current_floor_ptr->dun_level); bool seppuku = streq(hit_from, "Seppuku"); bool winning_seppuku = p_ptr->total_winner && seppuku; @@ -4491,13 +4020,13 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell) if (p_ptr->inside_arena) strcpy(buf,_("アリーナ", "in the Arena")); - else if (!dun_level) + else if (!current_floor_ptr->dun_level) strcpy(buf,_("地上", "on the surface")); else if (q_idx && (is_fixed_quest_idx(q_idx) && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT)))) strcpy(buf,_("クエスト", "in a quest")); else - sprintf(buf,_("%d階", "level %d"), (int)dun_level); + sprintf(buf,_("%d階", "level %d"), (int)current_floor_ptr->dun_level); sprintf(tmp, _("%sで%sに殺された。", "killed by %s %s."), buf, p_ptr->died_from); do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp); @@ -4569,7 +4098,7 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell) int h = Term->hgt; int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23}; int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4}; - cptr str; + concptr str; char* str2; Term_clear(); @@ -4646,7 +4175,7 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell) if (auto_more) { /* stop auto_more even if DAMAGE_USELIFE */ - now_damaged = TRUE; + p_ptr->now_damaged = TRUE; } msg_print(_("*** 警告:低ヒット・ポイント! ***", "*** LOW HITPOINT WARNING! ***")); @@ -4712,8 +4241,6 @@ void calc_android_exp(void) if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue; if (!o_ptr->k_idx) continue; - - /* Wipe the object */ object_wipe(q_ptr); object_copy(q_ptr, o_ptr); @@ -4780,7 +4307,7 @@ void calc_android_exp(void) if (value > 100000L) exp += (value - 100000L) / 4 * level; } - if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48; + if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(i))) || (i == INVEN_BOW)) total_exp += exp / 48; else total_exp += exp / 16; if (i == INVEN_BODY) total_exp += exp / 32; } @@ -4844,8 +4371,6 @@ bool drain_exp(s32b drain, s32b slip, int hold_exp_prob) bool set_ultimate_res(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -4876,30 +4401,20 @@ bool set_ultimate_res(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->ult_res = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } bool set_tim_res_nether(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -4930,30 +4445,20 @@ bool set_tim_res_nether(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->tim_res_nether = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } bool set_tim_res_time(TIME_EFFECT v, bool do_dec) { bool notice = FALSE; - - /* Hack -- Force good values */ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; if (p_ptr->is_dead) return FALSE; @@ -4984,22 +4489,14 @@ bool set_tim_res_time(TIME_EFFECT v, bool do_dec) /* Use the value */ p_ptr->tim_res_time = v; - - /* Redraw status bar */ p_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); - - /* Handle stuff */ handle_stuff(); - - /* Result */ return (TRUE); } @@ -5013,13 +4510,11 @@ bool choose_ele_attack(void) char choice; - if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM)) + if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM)) { msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon.")); return FALSE; } - - /* Save screen */ screen_save(); num = (p_ptr->lev - 20) / 5; @@ -5070,7 +4565,6 @@ bool choose_ele_attack(void) screen_load(); return FALSE; } - /* Load screen */ screen_load(); return TRUE; } @@ -5082,14 +4576,12 @@ bool choose_ele_attack(void) bool choose_ele_immune(TIME_EFFECT immune_turn) { char choice; - - /* Save screen */ screen_save(); - c_prt(TERM_RED, _(" a) 火炎", " a) Immune Fire"), 2, 14); - c_prt(TERM_L_WHITE,_(" b) 冷気", " b) Immune Cold"), 3, 14); - c_prt(TERM_L_DARK, _(" c) 酸", " c) Immune Acid"), 4, 14); - c_prt(TERM_BLUE, _(" d) 電撃", " d) Immune Elec"), 5, 14); + c_prt(TERM_RED, _(" a) 火炎", " a) Immunity to fire"), 2, 14); + c_prt(TERM_L_WHITE,_(" b) 冷気", " b) Immunity to cold"), 3, 14); + c_prt(TERM_L_DARK, _(" c) 酸", " c) Immunity to acid"), 4, 14); + c_prt(TERM_BLUE, _(" d) 電撃", " d) Immunity to elec"), 5, 14); prt("", 6, 14); prt("", 7, 14); @@ -5097,7 +4589,7 @@ bool choose_ele_immune(TIME_EFFECT immune_turn) prt("", 9, 14); prt("", 1, 0); - prt(_(" どの元素の免疫をつけますか?", " Choose a temporary elemental immune "), 1, 14); + prt(_(" どの元素の免疫をつけますか?", " Choose a temporary elemental immunity "), 1, 14); choice = inkey(); @@ -5111,11 +4603,10 @@ bool choose_ele_immune(TIME_EFFECT immune_turn) set_ele_immune(DEFENSE_ELEC, immune_turn); else { - msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immune.")); + msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immunity.")); screen_load(); return FALSE; } - /* Load screen */ screen_load(); return TRUE; }