X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fmonster1.c;h=0f46a4df890baad64fb1c7357d669cde06657da4;hb=26526abb3cf778918ac5d776df72639745136ad4;hp=7946b21294c5208d21b60f12f023209581d062cd;hpb=03f037a6e5730dac6ac4efd8a7e97b1769e78903;p=hengband%2Fhengband.git diff --git a/src/monster1.c b/src/monster1.c index 7946b2129..0f46a4df8 100644 --- a/src/monster1.c +++ b/src/monster1.c @@ -12,11 +12,14 @@ #include "angband.h" #include "util.h" +#include "term.h" +#include "cmd-dump.h" #include "bldg.h" #include "cmd-pet.h" #include "floor.h" #include "objectkind-hook.h" +#include "player-personality.h" #include "monster.h" #include "monster-spell.h" #include "monsterrace-hook.h" @@ -27,6 +30,13 @@ #include "avatar.h" #include "wild.h" #include "spells.h" +#include "dungeon.h" +#include "world.h" +#include "melee.h" +#include "japanese.h" +#include "view-mainwindow.h" +#include "player-class.h" +#include "english.h" /* @@ -2224,7 +2234,7 @@ void set_pet(monster_type *m_ptr) */ void set_hostile(monster_type *m_ptr) { - if (p_ptr->inside_battle) return; + if (p_ptr->phase_out) return; m_ptr->smart &= ~SM_PET; m_ptr->smart &= ~SM_FRIENDLY; } @@ -2238,7 +2248,7 @@ void set_hostile(monster_type *m_ptr) */ void anger_monster(monster_type *m_ptr) { - if (p_ptr->inside_battle) return; + if (p_ptr->phase_out) return; if (is_friendly(m_ptr)) { GAME_TEXT m_name[MAX_NLEN]; @@ -2248,10 +2258,10 @@ void anger_monster(monster_type *m_ptr) set_hostile(m_ptr); - chg_virtue(V_INDIVIDUALISM, 1); - chg_virtue(V_HONOUR, -1); - chg_virtue(V_JUSTICE, -1); - chg_virtue(V_COMPASSION, -1); + chg_virtue(p_ptr, V_INDIVIDUALISM, 1); + chg_virtue(p_ptr, V_HONOUR, -1); + chg_virtue(p_ptr, V_JUSTICE, -1); + chg_virtue(p_ptr, V_COMPASSION, -1); } } @@ -2397,7 +2407,7 @@ bool are_enemies(monster_type *m_ptr, monster_type *n_ptr) monster_race *r_ptr = &r_info[m_ptr->r_idx]; monster_race *s_ptr = &r_info[n_ptr->r_idx]; - if (p_ptr->inside_battle) + if (p_ptr->phase_out) { if (is_pet(m_ptr) || is_pet(n_ptr)) return FALSE; return TRUE; @@ -2531,7 +2541,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) object_type *q_ptr; bool drop_chosen_item = drop_item && !cloned && !p_ptr->inside_arena - && !p_ptr->inside_battle && !is_pet(m_ptr); + && !p_ptr->phase_out && !is_pet(m_ptr); /* The caster is dead? */ if (current_world_ptr->timewalk_m_idx && current_world_ptr->timewalk_m_idx == m_idx) current_world_ptr->timewalk_m_idx = 0; @@ -2550,7 +2560,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) GAME_TEXT m_name[MAX_NLEN]; monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE); - do_cmd_write_nikki(NIKKI_NAMED_PET, 3, m_name); + exe_write_diary(p_ptr, NIKKI_NAMED_PET, 3, m_name); } /* Let monsters explode! */ @@ -2609,7 +2619,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) monster_desc(m_name, m_ptr, MD_WRONGDOER_NAME); - do_cmd_write_nikki(NIKKI_ARENA, p_ptr->arena_number, m_name); + exe_write_diary(p_ptr, NIKKI_ARENA, p_ptr->arena_number, m_name); } } @@ -2624,7 +2634,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) /* Drop a dead corpse? */ if (one_in_(r_ptr->flags1 & RF1_UNIQUE ? 1 : 4) && (r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON)) && - !(p_ptr->inside_arena || p_ptr->inside_battle || cloned || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr)))) + !(p_ptr->inside_arena || p_ptr->phase_out || cloned || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr)))) { /* Assume skeleton */ bool corpse = FALSE; @@ -2672,7 +2682,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) { case MON_PINK_HORROR: /* Pink horrors are replaced with 2 Blue horrors */ - if (!(p_ptr->inside_arena || p_ptr->inside_battle)) + if (!(p_ptr->inside_arena || p_ptr->phase_out)) { bool notice = FALSE; @@ -2684,7 +2694,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) if (pet) mode |= PM_FORCE_PET; - if (summon_specific((pet ? -1 : m_idx), wy, wx, 100, SUMMON_BLUE_HORROR, mode, '\0')) + if (summon_specific((pet ? -1 : m_idx), wy, wx, 100, SUMMON_BLUE_HORROR, mode)) { if (player_can_see_bold(wy, wx)) notice = TRUE; } @@ -2731,7 +2741,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) * Mega^3-hack: killing a 'Warrior of the Dawn' is likely to * spawn another in the fallen one's place! */ - if (!p_ptr->inside_arena && !p_ptr->inside_battle) + if (!p_ptr->inside_arena && !p_ptr->phase_out) { if (!one_in_(7)) { @@ -2749,7 +2759,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) BIT_FLAGS mode = 0L; if (pet) mode |= PM_FORCE_PET; - if (summon_specific((pet ? -1 : m_idx), wy, wx, 100, SUMMON_DAWN, mode, '\0')) + if (summon_specific((pet ? -1 : m_idx), wy, wx, 100, SUMMON_DAWN, mode)) { if (player_can_see_bold(wy, wx)) msg_print(_("新たな戦士が現れた!", "A new warrior steps forth!")); @@ -2801,7 +2811,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) a_ptr->cur_num = 1; /* Hack -- Memorize location of artifact in saved floors */ - if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id; + if (current_world_ptr->character_dungeon) a_ptr->floor_id = p_ptr->floor_id; } else if (!preserve_mode) a_ptr->cur_num = 1; } @@ -2973,7 +2983,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) a_ptr->cur_num = 1; /* Hack -- Memorize location of artifact in saved floors */ - if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id; + if (current_world_ptr->character_dungeon) a_ptr->floor_id = p_ptr->floor_id; } else if (!preserve_mode) a_ptr->cur_num = 1; } @@ -2996,7 +3006,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) a_ptr->cur_num = 1; /* Hack -- Memorize location of artifact in saved floors */ - if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id; + if (current_world_ptr->character_dungeon) a_ptr->floor_id = p_ptr->floor_id; } else if (!preserve_mode) a_ptr->cur_num = 1; @@ -3030,7 +3040,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) if (cloned && !(r_ptr->flags1 & RF1_UNIQUE)) number = 0; /* Clones drop no stuff unless Cloning Pits */ - if (is_pet(m_ptr) || p_ptr->inside_battle || p_ptr->inside_arena) + if (is_pet(m_ptr) || p_ptr->phase_out || p_ptr->inside_arena) number = 0; /* Pets drop no stuff */ if (!drop_item && (r_ptr->d_char != '$')) number = 0; @@ -3078,7 +3088,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) /* Only process "Quest Monsters" */ if (!(r_ptr->flags1 & RF1_QUESTOR)) return; - if (p_ptr->inside_battle) return; + if (p_ptr->phase_out) return; /* Winner? */ if ((m_ptr->r_idx == MON_SERPENT) && !cloned) @@ -3091,7 +3101,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_FINAL_QUEST_CLEAR); - do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("見事に変愚蛮怒の勝利者となった!", "become *WINNER* of Hengband finely!")); + exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, _("見事に変愚蛮怒の勝利者となった!", "become *WINNER* of Hengband finely!")); admire_from_patron(p_ptr);