X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fdungeon.c;h=eaf1c285590b6fa08ca5c9621f0d4dbe224a9bc6;hb=0dbae6f56c7024ac1985958dd99c5f9936b2116b;hp=16abf6323f5fea9bf22aa68b3a853d3b1544ddf7;hpb=c63d1fc0ae49483b09b0bb9b8058cee6559d074e;p=hengband%2Fhengband.git diff --git a/src/dungeon.c b/src/dungeon.c index 16abf6323..eaf1c2855 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -21,7 +21,22 @@ #include "cmd-zaprod.h" #include "cmd-zapwand.h" #include "cmd-pet.h" +#include "floor.h" #include "floor-events.h" +#include "object-curse.h" +#include "store.h" +#include "spells-summon.h" +#include "spells-object.h" +#include "spells-status.h" +#include "monsterrace-hook.h" +#include "world.h" +#include "mutation.h" +#include "quest.h" +#include "artifact.h" +#include "avatar.h" +#include "player-status.h" +#include "cmd-spell.h" +#include "realm-hex.h" static bool load = TRUE; /*!<ロード処理中の分岐フラグ*/ static int wild_regen = 20; /*!<広域マップ移動時の自然回復処理カウンタ(広域マップ1マス毎に20回処理を基本とする)*/ @@ -34,9 +49,9 @@ static int wild_regen = 20; /*!<広域マップ移動時の自然回復処理カ */ static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy) { - byte feel; + byte feel; object_type *o_ptr = &inventory[slot]; - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; /* We know about it already, do not tell us again */ if (o_ptr->ident & (IDENT_SENSE))return; @@ -100,7 +115,7 @@ static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy) } /* Stop everything */ - if (disturb_minor) disturb(0, 0); + if (disturb_minor) disturb(FALSE, FALSE); /* Get an object description */ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); @@ -135,7 +150,6 @@ static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy) } - /* We have "felt" it */ o_ptr->ident |= (IDENT_SENSE); /* Set the "inscription" */ @@ -143,11 +157,8 @@ static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy) /* Auto-inscription/destroy */ autopick_alter_item(slot, destroy_feeling); + p_ptr->update |= (PU_COMBINE | PU_REORDER); - /* Combine / Reorder the pack (later) */ - p_ptr->notice |= (PN_COMBINE | PN_REORDER); - - /* Window stuff */ p_ptr->window |= (PW_INVEN | PW_EQUIP); } @@ -193,7 +204,6 @@ static void sense_inventory1(void) /* Heavy sensing */ heavy = TRUE; - /* Done */ break; } @@ -205,7 +215,6 @@ static void sense_inventory1(void) /* Heavy sensing */ heavy = TRUE; - /* Done */ break; } @@ -217,7 +226,6 @@ static void sense_inventory1(void) /* Very bad (light) sensing */ if (0 != randint0(240000L / (plev + 5))) return; - /* Done */ break; } @@ -227,7 +235,6 @@ static void sense_inventory1(void) /* Good (light) sensing */ if (0 != randint0(10000L / (plev * plev + 40))) return; - /* Done */ break; } @@ -240,7 +247,6 @@ static void sense_inventory1(void) /* Heavy sensing */ heavy = TRUE; - /* Done */ break; } @@ -252,7 +258,6 @@ static void sense_inventory1(void) /* Changed! */ heavy = TRUE; - /* Done */ break; } @@ -265,7 +270,6 @@ static void sense_inventory1(void) /* Heavy sensing */ heavy = TRUE; - /* Done */ break; } @@ -275,7 +279,6 @@ static void sense_inventory1(void) /* Bad sensing */ if (0 != randint0(75000L / (plev * plev + 40))) return; - /* Done */ break; } @@ -287,7 +290,6 @@ static void sense_inventory1(void) /* Bad sensing */ if (0 != randint0(55000L / (plev * plev + 40))) return; - /* Done */ break; } @@ -299,7 +301,6 @@ static void sense_inventory1(void) /* Changed! */ heavy = TRUE; - /* Done */ break; } @@ -309,7 +310,6 @@ static void sense_inventory1(void) /* Okay sensing */ if (0 != randint0(20000L / (plev * plev + 40))) return; - /* Done */ break; } @@ -321,7 +321,6 @@ static void sense_inventory1(void) /* Heavy sensing */ heavy = TRUE; - /* Done */ break; } @@ -330,7 +329,6 @@ static void sense_inventory1(void) /* Bad sensing */ if (0 != randint0(65000L / (plev * plev + 40))) return; - /* Done */ break; } case CLASS_BERSERKER: @@ -338,7 +336,6 @@ static void sense_inventory1(void) /* Heavy sensing */ heavy = TRUE; - /* Done */ break; } } @@ -439,7 +436,6 @@ static void sense_inventory2(void) /* Very bad (light) sensing */ if (0 != randint0(240000L / (plev + 5))) return; - /* Done */ break; } @@ -451,7 +447,6 @@ static void sense_inventory2(void) /* Bad sensing */ if (0 != randint0(95000L / (plev * plev + 40))) return; - /* Done */ break; } @@ -464,7 +459,6 @@ static void sense_inventory2(void) /* Good sensing */ if (0 != randint0(20000L / (plev * plev + 40))) return; - /* Done */ break; } @@ -478,7 +472,6 @@ static void sense_inventory2(void) /* Good sensing */ if (0 != randint0(9000L / (plev * plev + 40))) return; - /* Done */ break; } @@ -487,7 +480,6 @@ static void sense_inventory2(void) /* Good sensing */ if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return; - /* Done */ break; } } @@ -539,15 +531,15 @@ static void pattern_teleport(void) /* Ask for level */ if (get_check(_("他の階にテレポートしますか?", "Teleport level? "))) { - char ppp[80]; - char tmp_val[160]; + char ppp[80]; + char tmp_val[160]; /* Only downward in ironman mode */ if (ironman_downward) min_level = dun_level; /* Maximum level */ - if (dungeon_type == DUNGEON_ANGBAND) + if (p_ptr->dungeon_idx == DUNGEON_ANGBAND) { if (dun_level > 100) max_level = MAX_DEPTH - 1; @@ -556,8 +548,8 @@ static void pattern_teleport(void) } else { - max_level = d_info[dungeon_type].maxdepth; - min_level = d_info[dungeon_type].mindepth; + max_level = d_info[p_ptr->dungeon_idx].maxdepth; + min_level = d_info[p_ptr->dungeon_idx].mindepth; } /* Prompt */ @@ -598,10 +590,10 @@ static void pattern_teleport(void) leave_quest_check(); - if (record_stair) do_cmd_write_nikki(NIKKI_PAT_TELE,0,NULL); + if (record_stair) do_cmd_write_nikki(NIKKI_PAT_TELE, 0, NULL); p_ptr->inside_quest = 0; - p_ptr->energy_use = 0; + free_turn(p_ptr); /* * Clear all saved floors @@ -632,9 +624,7 @@ static void wreck_the_pattern(void) msg_print(_("パターンを血で汚してしまった!", "You bleed on the Pattern!")); msg_print(_("何か恐ろしい事が起こった!", "Something terrible happens!")); - if (!IS_INVULN()) - take_hit(DAMAGE_NOESCAPE, damroll(10, 8), _("パターン損壊", "corrupting the Pattern"), -1); - + if (!IS_INVULN()) take_hit(DAMAGE_NOESCAPE, damroll(10, 8), _("パターン損壊", "corrupting the Pattern"), -1); to_ruin = randint1(45) + 35; while (to_ruin--) @@ -720,9 +710,9 @@ static bool pattern_effect(void) */ static void regenhp(int percent) { - s32b new_chp; + HIT_POINT new_chp; u32b new_chp_frac; - s32b old_chp; + HIT_POINT old_chp; if (p_ptr->special_defense & KATA_KOUKIJIN) return; if (p_ptr->action == ACTION_HAYAGAKE) return; @@ -755,12 +745,8 @@ static void regenhp(int percent) /* Notice changes */ if (old_chp != p_ptr->chp) { - /* Redraw */ p_ptr->redraw |= (PR_HP); - - /* Window stuff */ p_ptr->window |= (PW_PLAYER); - wild_regen = 20; } } @@ -772,9 +758,9 @@ static void regenhp(int percent) * @param regen_amount 回復量 * @return なし */ -static void regenmana(int upkeep_factor, int regen_amount) +static void regenmana(MANA_POINT upkeep_factor, MANA_POINT regen_amount) { - s32b old_csp = p_ptr->csp; + MANA_POINT old_csp = p_ptr->csp; s32b regen_rate = regen_amount * 100 - upkeep_factor * PY_REGEN_NORMAL; /* @@ -805,7 +791,7 @@ static void regenmana(int upkeep_factor, int regen_amount) else if (regen_rate > 0) { /* (percent/100) is the Regen factor in unit (1/2^16) */ - s32b new_mana = 0; + MANA_POINT new_mana = 0; u32b new_mana_frac = (p_ptr->msp * regen_rate / 100 + PY_REGEN_MNBASE); /* Convert the unit (1/2^16) to (1/2^32) */ @@ -844,17 +830,11 @@ static void regenmana(int upkeep_factor, int regen_amount) } } - - /* Redraw mana */ if (old_csp != p_ptr->csp) { - /* Redraw */ p_ptr->redraw |= (PR_MANA); - - /* Window stuff */ p_ptr->window |= (PW_PLAYER); p_ptr->window |= (PW_SPELL); - wild_regen = 20; } } @@ -866,7 +846,7 @@ static void regenmana(int upkeep_factor, int regen_amount) */ static void regenmagic(int regen_amount) { - s32b new_mana; + MANA_POINT new_mana; int i; int dev = 30; int mult = (dev + adj_mag_mana[p_ptr->stat_ind[A_INT]]); /* x1 to x2 speed bonus for recharging */ @@ -907,7 +887,7 @@ static void regenmagic(int regen_amount) /*! * @brief 100ゲームターン毎のモンスターのHP自然回復処理 / Regenerate the monsters (once per 100 game turns) * @return なし - * @note XXX XXX XXX Should probably be done during monster turns. + * @note Should probably be done during monster turns. */ static void regen_monsters(void) { @@ -954,7 +934,7 @@ static void regen_monsters(void) /*! * @brief 30ゲームターン毎のボール中モンスターのHP自然回復処理 / Regenerate the captured monsters (once per 30 game turns) * @return なし - * @note XXX XXX XXX Should probably be done during monster turns. + * @note Should probably be done during monster turns. */ static void regen_captured_monsters(void) { @@ -998,9 +978,7 @@ static void regen_captured_monsters(void) if (heal) { /* Combine pack */ - p_ptr->notice |= (PN_COMBINE); - - /* Window stuff */ + p_ptr->update |= (PU_COMBINE); p_ptr->window |= (PW_INVEN); p_ptr->window |= (PW_EQUIP); wild_regen = 20; @@ -1017,7 +995,6 @@ static void notice_lite_change(object_type *o_ptr) /* Hack -- notice interesting fuel steps */ if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100))) { - /* Window stuff */ p_ptr->window |= (PW_EQUIP); } @@ -1031,7 +1008,7 @@ static void notice_lite_change(object_type *o_ptr) /* The light is now out */ else if (o_ptr->xtra4 == 0) { - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("明かりが消えてしまった!", "Your light has gone out!")); /* Recalculate torch radius */ @@ -1047,7 +1024,7 @@ static void notice_lite_change(object_type *o_ptr) if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5)) && (turn % (TURNS_PER_TICK*2))) { - if (disturb_minor) disturb(0, 1); + if (disturb_minor) disturb(FALSE, TRUE); msg_print(_("明かりが微かになってきている。", "Your light is growing faint.")); } } @@ -1055,7 +1032,7 @@ static void notice_lite_change(object_type *o_ptr) /* The light is getting dim */ else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10))) { - if (disturb_minor) disturb(0, 1); + if (disturb_minor) disturb(FALSE, TRUE); msg_print(_("明かりが微かになってきている。", "Your light is growing faint.")); } } @@ -1078,7 +1055,7 @@ void leave_quest_check(void) (q_ptr->status == QUEST_STATUS_TAKEN)) { q_ptr->status = QUEST_STATUS_FAILED; - q_ptr->complev = (byte)p_ptr->lev; + q_ptr->complev = p_ptr->lev; update_playtime(); q_ptr->comptime = playtime; @@ -1087,7 +1064,7 @@ void leave_quest_check(void) { case QUEST_TYPE_TOWER: quest[QUEST_TOWER1].status = QUEST_STATUS_FAILED; - quest[QUEST_TOWER1].complev = (byte)p_ptr->lev; + quest[QUEST_TOWER1].complev = p_ptr->lev; break; case QUEST_TYPE_FIND_ARTIFACT: a_info[q_ptr->k_idx].gen_flags &= ~(TRG_QUESTITEM); @@ -1128,7 +1105,7 @@ void leave_tower_check(void) if(quest[leaving_quest].type == QUEST_TYPE_TOWER) { quest[QUEST_TOWER1].status = QUEST_STATUS_FAILED; - quest[QUEST_TOWER1].complev = (byte)p_ptr->lev; + quest[QUEST_TOWER1].complev = p_ptr->lev; update_playtime(); quest[QUEST_TOWER1].comptime = playtime; } @@ -1143,9 +1120,9 @@ void leave_tower_check(void) */ static void recharged_notice(object_type *o_ptr) { - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; - cptr s; + concptr s; /* No inscription */ if (!o_ptr->inscription) return; @@ -1172,7 +1149,7 @@ static void recharged_notice(object_type *o_ptr) msg_format("Your %s is recharged.", o_name); #endif - disturb(0, 0); + disturb(FALSE, FALSE); /* Done. */ return; @@ -1191,7 +1168,7 @@ static void check_music(void) { const magic_type *s_ptr; int spell; - s32b need_mana; + MANA_POINT need_mana; u32b need_mana_frac; /* Music singed by player */ @@ -1229,17 +1206,8 @@ static void check_music(void) INTERUPTING_SONG_EFFECT(p_ptr) = MUSIC_NONE; msg_print(_("歌を再開した。", "You restart singing.")); p_ptr->action = ACTION_SING; - - /* Recalculate bonuses */ - p_ptr->update |= (PU_BONUS | PU_HP); - - /* Redraw map and status bar */ + 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); - - /* Window stuff */ p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); } } @@ -1296,7 +1264,7 @@ static object_type *choose_cursed_obj_name(BIT_FLAGS flag) (flag == TRC_FAST_DIGEST) || (flag == TRC_SLOW_REGEN) ) { - u32b cf; + u32b cf = 0L; BIT_FLAGS flgs[TR_FLAG_SIZE]; object_flags(o_ptr, flgs); switch (flag) @@ -1374,9 +1342,8 @@ static void process_world_aux_digestion(void) /* Faint occasionally */ if (!p_ptr->paralyzed && (randint0(100) < 10)) { - /* Message */ msg_print(_("あまりにも空腹で気絶してしまった。", "You faint from the lack of food.")); - disturb(1, 1); + disturb(TRUE, TRUE); /* Hack -- faint (bypass free action) */ (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5)); @@ -1388,7 +1355,6 @@ static void process_world_aux_digestion(void) /* Calculate damage */ HIT_POINT dam = (PY_FOOD_STARVE - p_ptr->food) / 10; - /* Take damage */ if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1); } } @@ -1415,7 +1381,6 @@ static void process_world_aux_hp_and_sp(void) /* Take damage from poison */ if (p_ptr->poisoned && !IS_INVULN()) { - /* Take damage */ take_hit(DAMAGE_NOESCAPE, 1, _("毒", "poison"), -1); } @@ -1462,7 +1427,6 @@ static void process_world_aux_hp_and_sp(void) dam = 1; } - /* Take damage */ take_hit(DAMAGE_NOESCAPE, dam, _("致命傷", "a fatal wound"), -1); } @@ -1473,7 +1437,6 @@ static void process_world_aux_hp_and_sp(void) { if ((cave[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) { - /* Take damage */ msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!")); take_hit(DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1); cave_no_regen = TRUE; @@ -1484,7 +1447,7 @@ static void process_world_aux_hp_and_sp(void) !p_ptr->resist_lite) { object_type * o_ptr = &inventory[INVEN_LITE]; - char o_name [MAX_NLEN]; + GAME_TEXT o_name [MAX_NLEN]; char ouch [MAX_NLEN+40]; /* Get an object description */ @@ -1531,7 +1494,7 @@ static void process_world_aux_hp_and_sp(void) } else { - cptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name; + concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name; msg_format(_("%sで火傷した!", "The %s burns you!"), name); take_hit(DAMAGE_NOESCAPE, damage, name, -1); } @@ -1540,12 +1503,165 @@ static void process_world_aux_hp_and_sp(void) } } + if (have_flag(f_ptr->flags, FF_COLD_PUDDLE) && !IS_INVULN() && !p_ptr->immune_cold) + { + int damage = 0; + + if (have_flag(f_ptr->flags, FF_DEEP)) + { + damage = 6000 + randint0(4000); + } + else if (!p_ptr->levitation) + { + damage = 3000 + randint0(2000); + } + + if (damage) + { + if (p_ptr->resist_cold) damage = damage / 3; + if (IS_OPPOSE_COLD()) damage = damage / 3; + if (p_ptr->levitation) damage = damage / 5; + + damage = damage / 100 + (randint0(100) < (damage % 100)); + + if (p_ptr->levitation) + { + msg_print(_("冷気に覆われた!", "The cold engulfs you!")); + take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), + f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1); + } + else + { + concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name; + msg_format(_("%sに凍えた!", "The %s frostbites you!"), name); + take_hit(DAMAGE_NOESCAPE, damage, name, -1); + } + + cave_no_regen = TRUE; + } + } + + if (have_flag(f_ptr->flags, FF_ELEC_PUDDLE) && !IS_INVULN() && !p_ptr->immune_elec) + { + int damage = 0; + + if (have_flag(f_ptr->flags, FF_DEEP)) + { + damage = 6000 + randint0(4000); + } + else if (!p_ptr->levitation) + { + damage = 3000 + randint0(2000); + } + + if (damage) + { + if (p_ptr->resist_elec) damage = damage / 3; + if (IS_OPPOSE_ELEC()) damage = damage / 3; + if (p_ptr->levitation) damage = damage / 5; + + damage = damage / 100 + (randint0(100) < (damage % 100)); + + if (p_ptr->levitation) + { + msg_print(_("電撃を受けた!", "The electric shocks you!")); + take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), + f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1); + } + else + { + concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name; + msg_format(_("%sに感電した!", "The %s shocks you!"), name); + take_hit(DAMAGE_NOESCAPE, damage, name, -1); + } + + cave_no_regen = TRUE; + } + } + + if (have_flag(f_ptr->flags, FF_ACID_PUDDLE) && !IS_INVULN() && !p_ptr->immune_acid) + { + int damage = 0; + + if (have_flag(f_ptr->flags, FF_DEEP)) + { + damage = 6000 + randint0(4000); + } + else if (!p_ptr->levitation) + { + damage = 3000 + randint0(2000); + } + + if (damage) + { + if (p_ptr->resist_acid) damage = damage / 3; + if (IS_OPPOSE_ACID()) damage = damage / 3; + if (p_ptr->levitation) damage = damage / 5; + + damage = damage / 100 + (randint0(100) < (damage % 100)); + + if (p_ptr->levitation) + { + msg_print(_("酸が飛び散った!", "The acid melt you!")); + take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), + f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1); + } + else + { + concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name; + msg_format(_("%sに溶かされた!", "The %s melts you!"), name); + take_hit(DAMAGE_NOESCAPE, damage, name, -1); + } + + cave_no_regen = TRUE; + } + } + + if (have_flag(f_ptr->flags, FF_POISON_PUDDLE) && !IS_INVULN()) + { + int damage = 0; + + if (have_flag(f_ptr->flags, FF_DEEP)) + { + damage = 6000 + randint0(4000); + } + else if (!p_ptr->levitation) + { + damage = 3000 + randint0(2000); + } + + if (damage) + { + if (p_ptr->resist_pois) damage = damage / 3; + if (IS_OPPOSE_POIS()) damage = damage / 3; + if (p_ptr->levitation) damage = damage / 5; + + damage = damage / 100 + (randint0(100) < (damage % 100)); + + if (p_ptr->levitation) + { + msg_print(_("毒気を吸い込んだ!", "The gas poisons you!")); + take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), + f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1); + if (p_ptr->resist_pois) (void)set_poisoned(p_ptr->poisoned + 1); + } + else + { + concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name; + msg_format(_("%sに毒された!", "The %s poisons you!"), name); + take_hit(DAMAGE_NOESCAPE, damage, name, -1); + if (p_ptr->resist_pois) (void)set_poisoned(p_ptr->poisoned + 3); + } + + cave_no_regen = TRUE; + } + } + if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) && - !p_ptr->levitation && !p_ptr->can_swim) + !p_ptr->levitation && !p_ptr->can_swim && !p_ptr->resist_water) { if (p_ptr->total_weight > weight_limit()) { - /* Take damage */ msg_print(_("溺れている!", "You are drowning!")); take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), _("溺れ", "drowning"), -1); cave_no_regen = TRUE; @@ -1554,7 +1670,7 @@ static void process_world_aux_hp_and_sp(void) if (p_ptr->riding) { - int damage; + HIT_POINT damage; if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !p_ptr->immune_fire) { damage = r_info[m_list[p_ptr->riding].r_idx].level / 2; @@ -1594,7 +1710,7 @@ static void process_world_aux_hp_and_sp(void) { if (!IS_INVULN() && !p_ptr->wraith_form && !p_ptr->kabenuke && ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall)) { - cptr dam_desc; + concptr dam_desc; cave_no_regen = TRUE; if (p_ptr->pass_wall) @@ -2074,7 +2190,7 @@ static void process_world_aux_mutation(void) if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000)) { - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("ウガァァア!", "RAAAAGHH!")); msg_print(_("激怒の発作に襲われた!", "You feel a fit of rage coming over you!")); (void)set_shero(10 + randint1(p_ptr->lev), FALSE); @@ -2085,7 +2201,7 @@ static void process_world_aux_mutation(void) { if (!p_ptr->resist_fear) { - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("とても暗い... とても恐い!", "It's so dark... so scary!")); set_afraid(p_ptr->afraid + 13 + randint1(26)); } @@ -2095,7 +2211,7 @@ static void process_world_aux_mutation(void) { if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) && !p_ptr->anti_tele) { - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("あなたの位置は突然ひじょうに不確定になった...", "Your position suddenly seems very uncertain...")); msg_print(NULL); teleport_player(40, TELEPORT_PASSIVE); @@ -2106,7 +2222,7 @@ static void process_world_aux_mutation(void) { if (!p_ptr->resist_conf && !p_ptr->resist_chaos) { - disturb(0, 1); + disturb(FALSE, TRUE); p_ptr->redraw |= PR_EXTRA; msg_print(_("いひきがもーろーとひてきたきがふる...ヒック!", "You feel a SSSCHtupor cOmINg over yOu... *HIC*!")); } @@ -2143,7 +2259,7 @@ static void process_world_aux_mutation(void) { if (!p_ptr->resist_chaos) { - disturb(0, 1); + disturb(FALSE, TRUE); p_ptr->redraw |= PR_EXTRA; (void)set_image(p_ptr->image + randint0(50) + 20); } @@ -2151,7 +2267,7 @@ static void process_world_aux_mutation(void) if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13)) { - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("ブゥーーッ!おっと。", "BRRAAAP! Oops.")); msg_print(NULL); fire_ball(GF_POIS, 0, p_ptr->lev, 3); @@ -2161,7 +2277,7 @@ static void process_world_aux_mutation(void) !p_ptr->anti_magic && one_in_(9000)) { int dire = 0; - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("魔法のエネルギーが突然あなたの中に流れ込んできた!エネルギーを解放しなければならない!", "Magical energy flows through you! You must release it!")); @@ -2179,16 +2295,16 @@ static void process_world_aux_mutation(void) if (pet) mode |= PM_FORCE_PET; else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET); - if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, mode)) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, mode, '\0')) { msg_print(_("あなたはデーモンを引き寄せた!", "You have attracted a demon!")); - disturb(0, 1); + disturb(FALSE, TRUE); } } if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000)) { - disturb(0, 1); + disturb(FALSE, TRUE); if (one_in_(2)) { msg_print(_("精力的でなくなった気がする。", "You feel less energetic.")); @@ -2219,7 +2335,7 @@ static void process_world_aux_mutation(void) } if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000)) { - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("突然ほとんど孤独になった気がする。", "You suddenly feel almost lonely.")); banish_monsters(100); @@ -2288,16 +2404,16 @@ static void process_world_aux_mutation(void) if (pet) mode |= PM_FORCE_PET; else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET); - if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_ANIMAL, mode)) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_ANIMAL, mode, '\0')) { msg_print(_("動物を引き寄せた!", "You have attracted an animal!")); - disturb(0, 1); + disturb(FALSE, TRUE); } } if ((p_ptr->muta2 & MUT2_RAW_CHAOS) && !p_ptr->anti_magic && one_in_(8000)) { - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("周りの空間が歪んでいる気がする!", "You feel the world warping around you!")); msg_print(NULL); @@ -2310,7 +2426,7 @@ static void process_world_aux_mutation(void) } if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000)) { - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("非物質化した!", "You feel insubstantial!")); msg_print(NULL); @@ -2352,7 +2468,7 @@ static void process_world_aux_mutation(void) if (!sustained) { - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("自分が衰弱していくのが分かる!", "You can feel yourself wasting away!")); msg_print(NULL); (void)dec_stat(which_stat, randint1(6) + 6, one_in_(3)); @@ -2366,10 +2482,10 @@ static void process_world_aux_mutation(void) if (pet) mode |= PM_FORCE_PET; else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET); - if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_DRAGON, mode)) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_DRAGON, mode, '\0')) { msg_print(_("ドラゴンを引き寄せた!", "You have attracted a dragon!")); - disturb(0, 1); + disturb(FALSE, TRUE); } } if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic && one_in_(3000)) @@ -2387,7 +2503,7 @@ static void process_world_aux_mutation(void) } if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest && one_in_(9000)) { - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("胃が痙攣し、食事を失った!", "Your stomach roils, and you lose your lunch!")); msg_print(NULL); set_food(PY_FOOD_WEAK); @@ -2435,7 +2551,7 @@ static void process_world_aux_mutation(void) if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic && one_in_(5000)) { - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("無敵な気がする!", "You feel invincible!")); msg_print(NULL); (void)set_invuln(randint1(8) + 8, FALSE); @@ -2476,23 +2592,23 @@ static void process_world_aux_mutation(void) INVENTORY_IDX slot = 0; object_type *o_ptr = NULL; - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("足がもつれて転んだ!", "You trip over your own feet!")); take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), _("転倒", "tripping"), -1); msg_print(NULL); - if (buki_motteruka(INVEN_RARM)) + if (has_melee_weapon(INVEN_RARM)) { slot = INVEN_RARM; o_ptr = &inventory[INVEN_RARM]; - if (buki_motteruka(INVEN_LARM) && one_in_(2)) + if (has_melee_weapon(INVEN_LARM) && one_in_(2)) { o_ptr = &inventory[INVEN_LARM]; slot = INVEN_LARM; } } - else if (buki_motteruka(INVEN_LARM)) + else if (has_melee_weapon(INVEN_LARM)) { o_ptr = &inventory[INVEN_LARM]; slot = INVEN_LARM; @@ -2521,7 +2637,7 @@ static void process_world_aux_curse(void) */ if ((p_ptr->cursed & TRC_TELEPORT_SELF) && one_in_(200)) { - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; object_type *o_ptr; int i, i_keep = 0, count = 0; @@ -2553,14 +2669,14 @@ static void process_world_aux_curse(void) msg_format(_("%sがテレポートの能力を発動させようとしている。", "Your %s is activating teleportation."), o_name); if (get_check_strict(_("テレポートしますか?", "Teleport? "), CHECK_OKAY_CANCEL)) { - disturb(0, 1); + disturb(FALSE, TRUE); teleport_player(50, 0L); } else { msg_format(_("%sに{.}(ピリオド)と銘を刻むと発動を抑制できます。", "You can inscribe {.} on your %s to disable random teleportation. "), o_name); - disturb(1, 1); + disturb(TRUE, TRUE); } } /* Make a chainsword noise */ @@ -2589,7 +2705,7 @@ static void process_world_aux_curse(void) /* Add light curse (Later) */ if ((p_ptr->cursed & TRC_ADD_L_CURSE) && one_in_(2000)) { - u32b new_curse; + BIT_FLAGS new_curse; object_type *o_ptr; o_ptr = choose_cursed_obj_name(TRC_ADD_L_CURSE); @@ -2597,7 +2713,7 @@ static void process_world_aux_curse(void) new_curse = get_curse(0, o_ptr); if (!(o_ptr->curse_flags & new_curse)) { - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); @@ -2612,7 +2728,7 @@ static void process_world_aux_curse(void) /* Add heavy curse (Later) */ if ((p_ptr->cursed & TRC_ADD_H_CURSE) && one_in_(2000)) { - u32b new_curse; + BIT_FLAGS new_curse; object_type *o_ptr; o_ptr = choose_cursed_obj_name(TRC_ADD_H_CURSE); @@ -2620,7 +2736,7 @@ static void process_world_aux_curse(void) new_curse = get_curse(1, o_ptr); if (!(o_ptr->curse_flags & new_curse)) { - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); @@ -2634,59 +2750,58 @@ static void process_world_aux_curse(void) /* Call animal */ if ((p_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500)) { - if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_ANIMAL, - (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) + if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_ANIMAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0')) { - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; object_desc(o_name, choose_cursed_obj_name(TRC_CALL_ANIMAL), (OD_OMIT_PREFIX | OD_NAME_ONLY)); msg_format(_("%sが動物を引き寄せた!", "Your %s have attracted an animal!"), o_name); - disturb(0, 1); + disturb(FALSE, TRUE); } } /* Call demon */ if ((p_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111)) { - if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) + if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0')) { - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DEMON), (OD_OMIT_PREFIX | OD_NAME_ONLY)); msg_format(_("%sが悪魔を引き寄せた!", "Your %s have attracted a demon!"), o_name); - disturb(0, 1); + disturb(FALSE, TRUE); } } /* Call dragon */ if ((p_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800)) { if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_DRAGON, - (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) + (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0')) { - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DRAGON), (OD_OMIT_PREFIX | OD_NAME_ONLY)); msg_format(_("%sがドラゴンを引き寄せた!", "Your %s have attracted an dragon!"), o_name); - disturb(0, 1); + disturb(FALSE, TRUE); } } /* Call undead */ if ((p_ptr->cursed & TRC_CALL_UNDEAD) && one_in_(1111)) { if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_UNDEAD, - (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) + (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0')) { - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; object_desc(o_name, choose_cursed_obj_name(TRC_CALL_UNDEAD), (OD_OMIT_PREFIX | OD_NAME_ONLY)); msg_format(_("%sが死霊を引き寄せた!", "Your %s have attracted an undead!"), o_name); - disturb(0, 1); + disturb(FALSE, TRUE); } } if ((p_ptr->cursed & TRC_COWARDICE) && one_in_(1500)) { if (!p_ptr->resist_fear) { - disturb(0, 1); + disturb(FALSE, TRUE); msg_print(_("とても暗い... とても恐い!", "It's so dark... so scary!")); set_afraid(p_ptr->afraid + 13 + randint1(26)); } @@ -2694,7 +2809,7 @@ static void process_world_aux_curse(void) /* Teleport player */ if ((p_ptr->cursed & TRC_TELEPORT) && one_in_(200) && !p_ptr->anti_tele) { - disturb(0, 1); + disturb(FALSE, TRUE); /* Teleport player */ teleport_player(40, TELEPORT_PASSIVE); @@ -2702,7 +2817,7 @@ static void process_world_aux_curse(void) /* Handle HP draining */ if ((p_ptr->cursed & TRC_DRAIN_HP) && one_in_(666)) { - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), (OD_OMIT_PREFIX | OD_NAME_ONLY)); msg_format(_("%sはあなたの体力を吸収した!", "Your %s drains HP from you!"), o_name); @@ -2711,7 +2826,7 @@ static void process_world_aux_curse(void) /* Handle mana draining */ if ((p_ptr->cursed & TRC_DRAIN_MANA) && p_ptr->csp && one_in_(666)) { - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_MANA), (OD_OMIT_PREFIX | OD_NAME_ONLY)); msg_format(_("%sはあなたの魔力を吸収した!", "Your %s drains mana from you!"), o_name); @@ -2732,19 +2847,11 @@ static void process_world_aux_curse(void) if (o_ptr->name1 == ART_JUDGE) { -#ifdef JP - if (object_is_known(o_ptr)) - msg_print("『審判の宝石』はあなたの体力を吸収した!"); - else - msg_print("なにかがあなたの体力を吸収した!"); - take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "審判の宝石", -1); -#else if (object_is_known(o_ptr)) - msg_print("The Jewel of Judgement drains life from you!"); + msg_print(_("『審判の宝石』はあなたの体力を吸収した!", "The Jewel of Judgement drains life from you!")); else - msg_print("Something drains life from you!"); - take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "the Jewel of Judgement", -1); -#endif + msg_print(_("なにかがあなたの体力を吸収した!", "Something drains life from you!")); + take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), _("審判の宝石", "the Jewel of Judgement"), -1); } } } @@ -2787,7 +2894,6 @@ static void process_world_aux_recharge(void) /* Notice changes */ if (changed) { - /* Window stuff */ p_ptr->window |= (PW_EQUIP); wild_regen = 20; } @@ -2836,7 +2942,6 @@ static void process_world_aux_recharge(void) /* Notice changes */ if (changed) { - /* Window stuff */ p_ptr->window |= (PW_INVEN); wild_regen = 20; } @@ -2844,7 +2949,6 @@ static void process_world_aux_recharge(void) /* Process objects on floor */ for (i = 1; i < o_max; i++) { - /* Access object */ object_type *o_ptr = &o_list[i]; /* Skip dead objects */ @@ -2890,20 +2994,19 @@ static void process_world_aux_movement(void) if (!p_ptr->word_recall) { /* Disturbing! */ - disturb(0, 1); + disturb(FALSE, TRUE); /* Determine the level */ if (dun_level || p_ptr->inside_quest || p_ptr->enter_dungeon) { - msg_print(_("上に引っ張りあげられる感じがする!", - "You feel yourself yanked upwards!")); + msg_print(_("上に引っ張りあげられる感じがする!", "You feel yourself yanked upwards!")); - if (dungeon_type) p_ptr->recall_dungeon = dungeon_type; + if (p_ptr->dungeon_idx) p_ptr->recall_dungeon = p_ptr->dungeon_idx; if (record_stair) do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL); dun_level = 0; - dungeon_type = 0; + p_ptr->dungeon_idx = 0; leave_quest_check(); leave_tower_check(); @@ -2914,20 +3017,19 @@ static void process_world_aux_movement(void) } else { - msg_print(_("下に引きずり降ろされる感じがする!", - "You feel yourself yanked downwards!")); + msg_print(_("下に引きずり降ろされる感じがする!", "You feel yourself yanked downwards!")); - dungeon_type = p_ptr->recall_dungeon; + p_ptr->dungeon_idx = p_ptr->recall_dungeon; if (record_stair) do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL); /* New depth */ - dun_level = max_dlv[dungeon_type]; + dun_level = max_dlv[p_ptr->dungeon_idx]; if (dun_level < 1) dun_level = 1; /* Nightmare mode makes recall more dangerous */ - if (ironman_nightmare && !randint0(666) && (dungeon_type == DUNGEON_ANGBAND)) + if (ironman_nightmare && !randint0(666) && (p_ptr->dungeon_idx == DUNGEON_ANGBAND)) { if (dun_level < 50) { @@ -2939,7 +3041,7 @@ static void process_world_aux_movement(void) } else if (dun_level > 100) { - dun_level = d_info[dungeon_type].maxdepth - 1; + dun_level = d_info[p_ptr->dungeon_idx].maxdepth - 1; } } @@ -2965,7 +3067,7 @@ static void process_world_aux_movement(void) /* Leaving */ p_ptr->leaving = TRUE; - if (dungeon_type == DUNGEON_ANGBAND) + if (p_ptr->dungeon_idx == DUNGEON_ANGBAND) { int i; @@ -3008,7 +3110,7 @@ static void process_world_aux_movement(void) if (!p_ptr->alter_reality) { /* Disturbing! */ - disturb(0, 1); + disturb(FALSE, TRUE); /* Determine the level */ if (!quest_number(dun_level) && dun_level) @@ -3044,8 +3146,8 @@ static void process_world_aux_movement(void) static int get_monster_crowd_number(MONSTER_IDX m_idx) { monster_type *m_ptr = &m_list[m_idx]; - int my = m_ptr->fy; - int mx = m_ptr->fx; + POSITION my = m_ptr->fy; + POSITION mx = m_ptr->fx; int i; int count = 0; @@ -3164,7 +3266,7 @@ static byte get_dungeon_feeling(void) /* Artifacts */ if (object_is_artifact(o_ptr)) { - s32b cost = object_value_real(o_ptr); + PRICE cost = object_value_real(o_ptr); delta += 10 * base; if (cost > 10000L) delta += 10 * base; @@ -3176,27 +3278,16 @@ static byte get_dungeon_feeling(void) } if (o_ptr->tval == TV_DRAG_ARMOR) delta += 30 * base; - if (o_ptr->tval == TV_SHIELD && - o_ptr->sval == SV_DRAGON_SHIELD) delta += 5 * base; - if (o_ptr->tval == TV_GLOVES && - o_ptr->sval == SV_SET_OF_DRAGON_GLOVES) delta += 5 * base; - if (o_ptr->tval == TV_BOOTS && - o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE) delta += 5 * base; - if (o_ptr->tval == TV_HELM && - o_ptr->sval == SV_DRAGON_HELM) delta += 5 * base; - if (o_ptr->tval == TV_RING && - o_ptr->sval == SV_RING_SPEED && - !object_is_cursed(o_ptr)) delta += 25 * base; - if (o_ptr->tval == TV_RING && - o_ptr->sval == SV_RING_LORDLY && - !object_is_cursed(o_ptr)) delta += 15 * base; - if (o_ptr->tval == TV_AMULET && - o_ptr->sval == SV_AMULET_THE_MAGI && - !object_is_cursed(o_ptr)) delta += 15 * base; + if (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD) delta += 5 * base; + if (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES) delta += 5 * base; + if (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE) delta += 5 * base; + if (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM) delta += 5 * base; + if (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_SPEED && !object_is_cursed(o_ptr)) delta += 25 * base; + if (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY && !object_is_cursed(o_ptr)) delta += 15 * base; + if (o_ptr->tval == TV_AMULET && o_ptr->sval == SV_AMULET_THE_MAGI && !object_is_cursed(o_ptr)) delta += 15 * base; /* Out-of-depth objects */ - if (!object_is_cursed(o_ptr) && !object_is_broken(o_ptr) && - k_ptr->level > dun_level) + if (!object_is_cursed(o_ptr) && !object_is_broken(o_ptr) && k_ptr->level > dun_level) { /* Rating increase */ delta += (k_ptr->level - dun_level) * base; @@ -3271,8 +3362,7 @@ static void update_dungeon_feeling(void) /* Update the level indicator */ p_ptr->redraw |= (PR_DEPTH); - /* Disturb */ - if (disturb_minor) disturb(0, 0); + if (disturb_minor) disturb(FALSE, FALSE); } /*! @@ -3294,10 +3384,10 @@ static void process_world(void) update_dungeon_feeling(); /* 帰還無しモード時のレベルテレポバグ対策 / Fix for level teleport bugs on ironman_downward.*/ - if (ironman_downward && (dungeon_type != DUNGEON_ANGBAND && dungeon_type != 0)) + if (ironman_downward && (p_ptr->dungeon_idx != DUNGEON_ANGBAND && p_ptr->dungeon_idx != 0)) { dun_level = 0; - dungeon_type = 0; + p_ptr->dungeon_idx = 0; prepare_change_floor_mode(CFM_FIRST_FLOOR | CFM_RAND_PLACE); p_ptr->inside_arena = FALSE; p_ptr->wild_mode = FALSE; @@ -3333,7 +3423,7 @@ static void process_world(void) } else if ((number_mon-1) == 0) { - char m_name[80]; + GAME_TEXT m_name[MAX_NLEN]; monster_type *wm_ptr; wm_ptr = &m_list[win_m_idx]; @@ -3379,13 +3469,11 @@ static void process_world(void) /* Warning */ if (closing_flag <= 2) { - /* Disturb */ - disturb(0, 1); + disturb(FALSE, TRUE); /* Count warnings */ closing_flag++; - /* Message */ msg_print(_("アングバンドへの門が閉じかかっています...", "The gates to ANGBAND are closing...")); msg_print(_("ゲームを終了するかセーブするかして下さい。", "Please finish up and/or save your game.")); @@ -3394,7 +3482,6 @@ static void process_world(void) /* Slam the gate */ else { - /* Message */ msg_print(_("今、アングバンドへの門が閉ざされました。", "The gates to ANGBAND are now closed.")); /* Stop playing */ @@ -3473,7 +3560,6 @@ static void process_world(void) /* Verify store type */ if (f_ptr->subtype == n) { - /* Message */ if (cheat_xtra) msg_format(_("%sの店主をシャッフルします。", "Shuffle a Shopkeeper of %s."), f_name + f_ptr->name); /* Shuffle it */ @@ -3490,7 +3576,7 @@ static void process_world(void) /*** Process the monsters ***/ /* Check for creature generation. */ - if (one_in_(d_info[dungeon_type].max_m_alloc_chance) && + if (one_in_(d_info[p_ptr->dungeon_idx].max_m_alloc_chance) && !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle) { /* Make a new monster */ @@ -3535,7 +3621,7 @@ static void process_world(void) if ((hour == 23) && !(min % 15)) { /* Disturbing */ - disturb(0, 1); + disturb(FALSE, TRUE); switch (min / 15) { @@ -3561,7 +3647,7 @@ static void process_world(void) if (!hour && !min) { - disturb(1, 1); + disturb(TRUE, TRUE); msg_print(_("遠くで鐘が何回も鳴り、死んだような静けさの中へ消えていった。", "A distant bell tolls many times, fading into an deathly silence.")); if (p_ptr->wild_mode) @@ -3572,7 +3658,7 @@ static void process_world(void) change_wild_mode(); /* Give first move to monsters */ - p_ptr->energy_use = 100; + take_turn(p_ptr, 100);; /* HACk -- set the encouter flag for the wilderness generation */ generate_encounter = TRUE; @@ -3743,20 +3829,16 @@ extern void do_cmd_borg(void); /*! * @brief プレイヤーから受けた入力コマンドの分岐処理。 * / Parse and execute the current command Give "Warning" on illegal commands. - * @todo XXX XXX XXX Make some "blocks" + * @todo Make some "blocks" * @return なし */ static void process_command(void) { COMMAND_CODE old_now_message = now_message; -#ifdef ALLOW_REPEAT /* TNB */ - /* Handle repeating the last command */ repeat_check(); -#endif /* ALLOW_REPEAT -- TNB */ - now_message = 0; /* Sniper */ @@ -3795,8 +3877,6 @@ static void process_command(void) p_ptr->wizard = TRUE; msg_print(_("ウィザードモード突入。", "Wizard mode on.")); } - - /* Update monsters */ p_ptr->update |= (PU_MONSTERS); /* Redraw "title" */ @@ -3921,32 +4001,14 @@ static void process_command(void) /* Move (usually pick up things) */ case ';': { -#ifdef ALLOW_EASY_DISARM /* TNB */ - do_cmd_walk(FALSE); - -#else /* ALLOW_EASY_DISARM -- TNB */ - - do_cmd_walk(always_pickup); - -#endif /* ALLOW_EASY_DISARM -- TNB */ - break; } /* Move (usually do not pick up) */ case '-': { -#ifdef ALLOW_EASY_DISARM /* TNB */ - do_cmd_walk(TRUE); - -#else /* ALLOW_EASY_DISARM -- TNB */ - - do_cmd_walk(!always_pickup); - -#endif /* ALLOW_EASY_DISARM -- TNB */ - break; } @@ -4002,21 +4064,21 @@ static void process_command(void) /* Enter store */ case SPECIAL_KEY_STORE: { - if (!p_ptr->wild_mode) do_cmd_store(); + do_cmd_store(); break; } /* Enter building -KMW- */ case SPECIAL_KEY_BUILDING: { - if (!p_ptr->wild_mode) do_cmd_bldg(); + do_cmd_bldg(); break; } /* Enter quest level -KMW- */ case SPECIAL_KEY_QUEST: { - if (!p_ptr->wild_mode) do_cmd_quest(); + do_cmd_quest(); break; } @@ -4053,42 +4115,41 @@ static void process_command(void) change_wild_mode(); else do_cmd_go_down(); - break; } /* Open a door or chest */ case 'o': { - if (!p_ptr->wild_mode) do_cmd_open(); + do_cmd_open(); break; } /* Close a door */ case 'c': { - if (!p_ptr->wild_mode) do_cmd_close(); + do_cmd_close(); break; } /* Jam a door with spikes */ case 'j': { - if (!p_ptr->wild_mode) do_cmd_spike(); + do_cmd_spike(); break; } /* Bash a door */ case 'B': { - if (!p_ptr->wild_mode) do_cmd_bash(); + do_cmd_bash(); break; } /* Disarm a trap or chest */ case 'D': { - if (!p_ptr->wild_mode) do_cmd_disarm(); + do_cmd_disarm(); break; } @@ -4103,7 +4164,7 @@ static void process_command(void) else if (p_ptr->pclass == CLASS_SAMURAI) do_cmd_gain_hissatsu(); else if (p_ptr->pclass == CLASS_MAGIC_EATER) - gain_magic(); + import_magic_device(); else do_cmd_study(); break; @@ -4137,14 +4198,14 @@ static void process_command(void) { msg_print(_("呪文を唱えられない!", "You cannot cast spells!")); } - else if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH)) + else if (dun_level && (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH)) { msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!")); msg_print(NULL); } else if (p_ptr->anti_magic && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH)) { - cptr which_power = _("魔法", "magic"); + concptr which_power = _("魔法", "magic"); if (p_ptr->pclass == CLASS_MINDCRAFTER) which_power = _("超能力", "psionic powers"); else if (p_ptr->pclass == CLASS_IMITATOR) @@ -4159,12 +4220,12 @@ static void process_command(void) which_power = _("祈り", "prayer"); msg_format(_("反魔法バリアが%sを邪魔した!", "An anti-magic shell disrupts your %s!"), which_power); - p_ptr->energy_use = 0; + free_turn(p_ptr); } else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER)) { msg_format(_("狂戦士化していて頭が回らない!", "You cannot think directly!")); - p_ptr->energy_use = 0; + free_turn(p_ptr); } else { @@ -4196,7 +4257,7 @@ static void process_command(void) /* Issue a pet command */ case 'p': { - if (!p_ptr->wild_mode) do_cmd_pet(); + do_cmd_pet(); break; } @@ -4219,16 +4280,7 @@ static void process_command(void) /* Activate an artifact */ case 'A': { - if (!p_ptr->wild_mode) - { - if (!p_ptr->inside_arena) - do_cmd_activate(); - else - { - msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!")); - msg_print(NULL); - } - } + do_cmd_activate(); break; } @@ -4249,44 +4301,28 @@ static void process_command(void) /* Fire an item */ case 'f': { - if (!p_ptr->wild_mode) do_cmd_fire(); + do_cmd_fire(); break; } /* Throw an item */ case 'v': { - if (!p_ptr->wild_mode) do_cmd_throw(1, FALSE, -1); + do_cmd_throw(1, FALSE, -1); break; } /* Aim a wand */ case 'a': { - if (!p_ptr->wild_mode) - { - if (!p_ptr->inside_arena) - do_cmd_aim_wand(); - else - { - msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!")); - msg_print(NULL); - } - } + do_cmd_aim_wand(); break; } /* Zap a rod */ case 'z': { - if (!p_ptr->wild_mode) - { - if (p_ptr->inside_arena) - { - msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!")); - msg_print(NULL); - } - else if (use_command && rogue_like_commands) + if (use_command && rogue_like_commands) { do_cmd_use(); } @@ -4294,66 +4330,37 @@ static void process_command(void) { do_cmd_zap_rod(); } - } break; } /* Quaff a potion */ case 'q': { - if (!p_ptr->wild_mode) - { - if (!p_ptr->inside_arena) - do_cmd_quaff_potion(); - else - { - msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!")); - msg_print(NULL); - } - } + do_cmd_quaff_potion(); break; } /* Read a scroll */ case 'r': { - if (!p_ptr->wild_mode) - { - if (!p_ptr->inside_arena) - do_cmd_read_scroll(); - else - { - msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!")); - msg_print(NULL); - } - } + do_cmd_read_scroll(); break; } /* Use a staff */ case 'u': { - if (!p_ptr->wild_mode) - { - if (p_ptr->inside_arena) - { - msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!")); - msg_print(NULL); - } - else if (use_command && !rogue_like_commands) - { + if (use_command && !rogue_like_commands) do_cmd_use(); - } else do_cmd_use_staff(); - } break; } /* Use racial power */ case 'U': { - if (!p_ptr->wild_mode) do_cmd_racial_power(); + do_cmd_racial_power(); break; } @@ -4384,7 +4391,7 @@ static void process_command(void) /* Target monster or location */ case '*': { - if (!p_ptr->wild_mode) do_cmd_target(); + do_cmd_target(); break; } @@ -4493,7 +4500,7 @@ static void process_command(void) /* Repeat level feeling */ case KTRL('F'): { - if (!p_ptr->wild_mode) do_cmd_feeling(); + do_cmd_feeling(); break; } @@ -4635,22 +4642,6 @@ static void process_command(void) } /*! - * @brief モンスター種族が釣れる種族かどうかを判定する。 - * @param r_idx 判定したいモンスター種族のID - * @return 釣れる対象ならばTRUEを返す - */ -static bool monster_tsuri(MONRACE_IDX r_idx) -{ - monster_race *r_ptr = &r_info[r_idx]; - - if ((r_ptr->flags7 & RF7_AQUATIC) && !(r_ptr->flags1 & RF1_UNIQUE) && my_strchr("Jjlw", r_ptr->d_char)) - return TRUE; - else - return FALSE; -} - - -/*! * @brief アイテムの所持種類数が超えた場合にアイテムを床に落とす処理 / Hack -- Pack Overflow * @return なし */ @@ -4658,26 +4649,23 @@ static void pack_overflow(void) { if (inventory[INVEN_PACK].k_idx) { - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; object_type *o_ptr; /* Is auto-destroy done? */ - notice_stuff(); + update_creature(p_ptr); if (!inventory[INVEN_PACK].k_idx) return; /* Access the slot to be dropped */ o_ptr = &inventory[INVEN_PACK]; /* Disturbing */ - disturb(0, 1); + disturb(FALSE, TRUE); /* Warning */ msg_print(_("ザックからアイテムがあふれた!", "Your pack overflows!")); - - /* Describe */ object_desc(o_name, o_ptr, 0); - /* Message */ msg_format(_("%s(%c)を落とした。", "You drop %s (%c)."), o_name, index_to_label(INVEN_PACK)); /* Drop it (carefully) near the player */ @@ -4688,10 +4676,6 @@ static void pack_overflow(void) inven_item_describe(INVEN_PACK); inven_item_optimize(INVEN_PACK); - /* Handle "p_ptr->notice" */ - notice_stuff(); - - /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */ handle_stuff(); } } @@ -4762,11 +4746,8 @@ static void process_player(void) if (!m_ptr->r_idx) continue; - /* Hack -- Detect monster */ m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW); - - /* Update the monster */ - update_mon(i, FALSE); + update_monster(i, FALSE); } prt_time(); } @@ -4817,23 +4798,22 @@ static void process_player(void) if (p_ptr->action == ACTION_FISH) { - /* Delay */ Term_xtra(TERM_XTRA_DELAY, 10); if (one_in_(1000)) { MONRACE_IDX r_idx; bool success = FALSE; - get_mon_num_prep(monster_tsuri,NULL); + get_mon_num_prep(monster_is_fishing_target,NULL); r_idx = get_mon_num(dun_level ? dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level); msg_print(NULL); if (r_idx && one_in_(2)) { POSITION y, x; - y = p_ptr->y + ddy[tsuri_dir]; - x = p_ptr->x + ddx[tsuri_dir]; + y = p_ptr->y + ddy[p_ptr->fishing_dir]; + x = p_ptr->x + ddx[p_ptr->fishing_dir]; if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE)) { - char m_name[80]; + GAME_TEXT m_name[MAX_NLEN]; monster_desc(m_name, &m_list[cave[y][x].m_idx], 0); msg_format(_("%sが釣れた!", "You have a good catch!"), m_name); success = TRUE; @@ -4843,7 +4823,7 @@ static void process_player(void) { msg_print(_("餌だけ食われてしまった!くっそ~!", "Damn! The fish stole your bait!")); } - disturb(0, 1); + disturb(FALSE, TRUE); } } @@ -4861,8 +4841,7 @@ static void process_player(void) { flush(); /* Flush input */ - /* Disturb */ - disturb(0, 1); + disturb(FALSE, TRUE); /* Hack -- Show a Message */ msg_print(_("中断しました。", "Canceled.")); @@ -4877,12 +4856,10 @@ static void process_player(void) if (MON_CSLEEP(m_ptr)) { - char m_name[80]; + GAME_TEXT m_name[MAX_NLEN]; /* Recover fully */ (void)set_monster_csleep(p_ptr->riding, 0); - - /* Acquire the monster name */ monster_desc(m_name, m_ptr, 0); msg_format(_("%^sを起こした。", "You have waked %s up."), m_name); } @@ -4893,12 +4870,8 @@ static void process_player(void) if (set_monster_stunned(p_ptr->riding, (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_STUNNED(m_ptr) - 1))) { - char m_name[80]; - - /* Acquire the monster name */ + GAME_TEXT m_name[MAX_NLEN]; monster_desc(m_name, m_ptr, 0); - - /* Dump a message */ msg_format(_("%^sを朦朧状態から立ち直らせた。", "%^s is no longer stunned."), m_name); } } @@ -4909,12 +4882,8 @@ static void process_player(void) if (set_monster_confused(p_ptr->riding, (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_CONFUSED(m_ptr) - 1))) { - char m_name[80]; - - /* Acquire the monster name */ + GAME_TEXT m_name[MAX_NLEN]; monster_desc(m_name, m_ptr, 0); - - /* Dump a message */ msg_format(_("%^sを混乱状態から立ち直らせた。", "%^s is no longer confused."), m_name); } } @@ -4925,12 +4894,8 @@ static void process_player(void) if(set_monster_monfear(p_ptr->riding, (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_MONFEAR(m_ptr) - 1))) { - char m_name[80]; - - /* Acquire the monster name */ + GAME_TEXT m_name[MAX_NLEN]; monster_desc(m_name, m_ptr, 0); - - /* Dump a message */ msg_format(_("%^sを恐怖から立ち直らせた。", "%^s is no longer fear."), m_name); } } @@ -5001,10 +4966,6 @@ static void process_player(void) p_ptr->counter = FALSE; now_damaged = FALSE; - /* Handle "p_ptr->notice" */ - notice_stuff(); - - /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */ handle_stuff(); /* Place the cursor on the player */ @@ -5020,7 +4981,7 @@ static void process_player(void) if (!command_new) command_see = FALSE; /* Assume free turn */ - p_ptr->energy_use = 0; + free_turn(p_ptr); if (p_ptr->inside_battle) { @@ -5036,7 +4997,7 @@ static void process_player(void) /* Paralyzed or Knocked Out */ else if (p_ptr->paralyzed || (p_ptr->stun >= 100)) { - p_ptr->energy_use = 100; + take_turn(p_ptr, 100);; } /* Resting */ @@ -5049,18 +5010,16 @@ static void process_player(void) resting--; if (!resting) set_action(ACTION_NONE); - - /* Redraw the state */ p_ptr->redraw |= (PR_STATE); } - p_ptr->energy_use = 100; + take_turn(p_ptr, 100);; } /* Fishing */ else if (p_ptr->action == ACTION_FISH) { - p_ptr->energy_use = 100; + take_turn(p_ptr, 100);; } /* Running */ @@ -5085,11 +5044,8 @@ static void process_player(void) /* Count this execution */ command_rep--; - /* Redraw the state */ p_ptr->redraw |= (PR_STATE); - - /* Redraw stuff */ - redraw_stuff(); + handle_stuff(); /* Hack -- Assume messages were seen */ msg_flag = FALSE; @@ -5127,7 +5083,7 @@ static void process_player(void) if (p_ptr->energy_use) { /* Use some energy */ - if (world_player || p_ptr->energy_use > 400) + if (p_ptr->timewalk || p_ptr->energy_use > 400) { /* The Randomness is irrelevant */ p_ptr->energy_need += p_ptr->energy_use * TURNS_PER_TICK / 10; @@ -5224,9 +5180,7 @@ static void process_player(void) /* Assume invisible */ m_ptr->ml = FALSE; - - /* Update the monster */ - update_mon(i, FALSE); + update_monster(i, FALSE); if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH); if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH); @@ -5257,20 +5211,17 @@ static void process_player(void) p_ptr->redraw |= (PR_STATE); } - if (world_player && (p_ptr->energy_need > - 1000)) + if (p_ptr->timewalk && (p_ptr->energy_need > - 1000)) { - /* Redraw map */ - p_ptr->redraw |= (PR_MAP); - /* Update monsters */ + p_ptr->redraw |= (PR_MAP); p_ptr->update |= (PU_MONSTERS); - /* Window stuff */ p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); msg_print(_("「時は動きだす…」", "You feel time flowing around you once more.")); msg_print(NULL); - world_player = FALSE; + p_ptr->timewalk = FALSE; p_ptr->energy_need = ENERGY_NEED(); /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */ @@ -5281,7 +5232,7 @@ static void process_player(void) /* Hack -- notice death */ if (!p_ptr->playing || p_ptr->is_dead) { - world_player = FALSE; + p_ptr->timewalk = FALSE; break; } @@ -5350,8 +5301,7 @@ static void dungeon(bool load_game) repair_objects = TRUE; - /* Disturb */ - disturb(1, 1); + disturb(TRUE, TRUE); /* Get index of current quest (if any) */ quest_num = quest_number(dun_level); @@ -5371,9 +5321,9 @@ static void dungeon(bool load_game) /* Track maximum dungeon level (if not in quest -KMW-) */ - if ((max_dlv[dungeon_type] < dun_level) && !p_ptr->inside_quest) + if ((max_dlv[p_ptr->dungeon_idx] < dun_level) && !p_ptr->inside_quest) { - max_dlv[dungeon_type] = dun_level; + max_dlv[p_ptr->dungeon_idx] = dun_level; if (record_maxdepth) do_cmd_write_nikki(NIKKI_MAXDEAPTH, dun_level, NULL); } @@ -5385,29 +5335,23 @@ static void dungeon(bool load_game) /* Verify the panel */ verify_panel(); - /* Flush messages */ - msg_print(NULL); + msg_erase(); /* Enter "xtra" mode */ character_xtra = TRUE; - /* Window stuff */ p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER | PW_MONSTER | PW_OVERHEAD | PW_DUNGEON); /* Redraw dungeon */ p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY); - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - /* Update stuff */ p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS); /* Update lite/view */ p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE | PU_TORCH); - - /* Update monsters */ p_ptr->update |= (PU_MONSTERS | PU_DISTANCE | PU_FLOW); /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */ @@ -5416,19 +5360,9 @@ static void dungeon(bool load_game) /* Leave "xtra" mode */ character_xtra = FALSE; - /* Update stuff */ p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS); - - /* Combine / Reorder the pack */ - p_ptr->notice |= (PN_COMBINE | PN_REORDER); - - /* Handle "p_ptr->notice" */ - notice_stuff(); - - /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */ + p_ptr->update |= (PU_COMBINE | PU_REORDER); handle_stuff(); - - /* Refresh */ Term_fresh(); if (quest_num && (is_fixed_quest_idx(quest_num) && @@ -5456,22 +5390,22 @@ static void dungeon(bool load_game) if (!p_ptr->playing || p_ptr->is_dead) return; /* Print quest message if appropriate */ - if (!p_ptr->inside_quest && (dungeon_type == DUNGEON_ANGBAND)) + if (!p_ptr->inside_quest && (p_ptr->dungeon_idx == DUNGEON_ANGBAND)) { quest_discovery(random_quest_number(dun_level)); p_ptr->inside_quest = random_quest_number(dun_level); } - if ((dun_level == d_info[dungeon_type].maxdepth) && d_info[dungeon_type].final_guardian) + if ((dun_level == d_info[p_ptr->dungeon_idx].maxdepth) && d_info[p_ptr->dungeon_idx].final_guardian) { - if (r_info[d_info[dungeon_type].final_guardian].max_num) + if (r_info[d_info[p_ptr->dungeon_idx].final_guardian].max_num) #ifdef JP msg_format("この階には%sの主である%sが棲んでいる。", - d_name+d_info[dungeon_type].name, - r_name+r_info[d_info[dungeon_type].final_guardian].name); + d_name+d_info[p_ptr->dungeon_idx].name, + r_name+r_info[d_info[p_ptr->dungeon_idx].final_guardian].name); #else msg_format("%^s lives in this level as the keeper of %s.", - r_name+r_info[d_info[dungeon_type].final_guardian].name, - d_name+d_info[dungeon_type].name); + r_name+r_info[d_info[p_ptr->dungeon_idx].final_guardian].name, + d_name+d_info[p_ptr->dungeon_idx].name); #endif } @@ -5513,15 +5447,10 @@ static void dungeon(bool load_game) /* Hack -- Compress the object list occasionally */ if (o_cnt + 32 < o_max) compact_objects(0); - /* Process the player */ process_player(); - process_upkeep_with_speed(); - /* Handle "p_ptr->notice" */ - notice_stuff(); - /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */ handle_stuff(); @@ -5537,10 +5466,6 @@ static void dungeon(bool load_game) /* Process all of the monsters */ process_monsters(); - /* Handle "p_ptr->notice" */ - notice_stuff(); - - /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */ handle_stuff(); /* Hack -- Hilite the player */ @@ -5552,14 +5477,9 @@ static void dungeon(bool load_game) /* Hack -- Notice death or departure */ if (!p_ptr->playing || p_ptr->is_dead) break; - /* Process the world */ process_world(); - /* Handle "p_ptr->notice" */ - notice_stuff(); - - /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */ handle_stuff(); /* Hack -- Hilite the player */ @@ -5866,7 +5786,6 @@ void play_game(bool new_game) /* Attempt to load */ if (!load_player()) { - /* Oops */ quit(_("セーブファイルが壊れています", "broken savefile")); } @@ -5882,11 +5801,8 @@ void play_game(bool new_game) if (!get_check_strict(_("待機していたスコア登録を今行ないますか?", "Do you register score now? "), CHECK_NO_HISTORY)) quit(0); - /* Update stuff */ p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS); - - /* Update stuff */ - update_stuff(); + update_creature(p_ptr); p_ptr->is_dead = TRUE; @@ -6050,7 +5966,7 @@ void play_game(bool new_game) s_info[p_ptr->pclass].w_max[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_MASTER; /* Fill the arrays of floors and walls in the good proportions */ - set_floor_and_wall(dungeon_type); + set_floor_and_wall(p_ptr->dungeon_idx); /* Flavor the objects */ flavor_init(); @@ -6163,15 +6079,9 @@ void play_game(bool new_game) /* React to changes */ Term_xtra(TERM_XTRA_REACT, 0); - /* Window stuff */ p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER); - - /* Window stuff */ p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT); - - /* Window stuff */ - window_stuff(); - + handle_stuff(); /* Set or clear "rogue_like_commands" if requested */ if (arg_force_original) rogue_like_commands = FALSE; @@ -6209,13 +6119,9 @@ void play_game(bool new_game) /* Process the level */ dungeon(load_game); - /* Handle "p_ptr->notice" */ - notice_stuff(); - /* Hack -- prevent "icky" message */ character_xtra = TRUE; - /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */ handle_stuff(); character_xtra = FALSE; @@ -6226,14 +6132,8 @@ void play_game(bool new_game) /* Cancel the health bar */ health_track(0); - - /* Forget the lite */ forget_lite(); - - /* Forget the view */ forget_view(); - - /* Forget the view */ clear_mon_lite(); /* Handle "quit and save" */ @@ -6244,7 +6144,6 @@ void play_game(bool new_game) if (!p_ptr->is_dead) wipe_m_list(); - /* XXX XXX XXX */ msg_print(NULL); load_game = FALSE; @@ -6276,108 +6175,7 @@ void play_game(bool new_game) /* Mega-Hack -- Allow player to cheat death */ if ((p_ptr->wizard || cheat_live) && !get_check(_("死にますか? ", "Die? "))) { - /* Mark social class, reset age, if needed */ - if (p_ptr->sc) p_ptr->sc = p_ptr->age = 0; - - /* Increase age */ - p_ptr->age++; - - /* Mark savefile */ - p_ptr->noscore |= 0x0001; - - /* Message */ - msg_print(_("ウィザードモードに念を送り、死を欺いた。", "You invoke wizard mode and cheat death.")); - msg_print(NULL); - - (void)life_stream(FALSE, FALSE); - - if (p_ptr->pclass == CLASS_MAGIC_EATER) - { - int magic_idx; - for (magic_idx = 0; magic_idx < EATER_EXT*2; magic_idx++) - { - p_ptr->magic_num1[magic_idx] = p_ptr->magic_num2[magic_idx]*EATER_CHARGE; - } - for (; magic_idx < EATER_EXT*3; magic_idx++) - { - p_ptr->magic_num1[magic_idx] = 0; - } - } - - /* Restore spell points */ - p_ptr->csp = p_ptr->msp; - p_ptr->csp_frac = 0; - - /* Hack -- cancel recall */ - if (p_ptr->word_recall) - { - /* Message */ - msg_print(_("張りつめた大気が流れ去った...", "A tension leaves the air around you...")); - msg_print(NULL); - - /* Hack -- Prevent recall */ - p_ptr->word_recall = 0; - p_ptr->redraw |= (PR_STATUS); - } - - /* Hack -- cancel alter */ - if (p_ptr->alter_reality) - { - /* Hack -- Prevent alter */ - p_ptr->alter_reality = 0; - p_ptr->redraw |= (PR_STATUS); - } - - /* Note cause of death XXX XXX XXX */ - (void)strcpy(p_ptr->died_from, _("死の欺き", "Cheating death")); - - /* Do not die */ - p_ptr->is_dead = FALSE; - - /* Hack -- Prevent starvation */ - (void)set_food(PY_FOOD_MAX - 1); - - dun_level = 0; - p_ptr->inside_arena = FALSE; - p_ptr->inside_battle = FALSE; - leaving_quest = 0; - p_ptr->inside_quest = 0; - if (dungeon_type) p_ptr->recall_dungeon = dungeon_type; - dungeon_type = 0; - if (lite_town || vanilla_town) - { - p_ptr->wilderness_y = 1; - p_ptr->wilderness_x = 1; - if (vanilla_town) - { - p_ptr->oldpy = 10; - p_ptr->oldpx = 34; - } - else - { - p_ptr->oldpy = 33; - p_ptr->oldpx = 131; - } - } - else - { - p_ptr->wilderness_y = 48; - p_ptr->wilderness_x = 5; - p_ptr->oldpy = 33; - p_ptr->oldpx = 131; - } - - /* Leaving */ - p_ptr->wild_mode = FALSE; - p_ptr->leaving = TRUE; - - do_cmd_write_nikki(NIKKI_BUNSHOU, 1, - _(" しかし、生き返った。", - " but revived.")); - - /* Prepare next floor */ - leave_floor(); - wipe_m_list(); + cheat_death(p_ptr); } } }