*/
#include "angband.h"
+#include "util.h"
+#include "term.h"
+
+#include "cmd-dump.h"
+#include "bldg.h"
#include "cmd-pet.h"
-#include "monsterrace-hook.h"
+#include "floor.h"
#include "objectkind-hook.h"
-#include "projection.h"
+#include "player-personality.h"
#include "monster.h"
+#include "monster-spell.h"
+#include "monsterrace-hook.h"
#include "spells-summon.h"
#include "patron.h"
#include "quest.h"
#include "artifact.h"
#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"
/*
bool known = (r_ptr->r_cast_spell == MAX_UCHAR)? TRUE: FALSE;
if (cheat_know || known) return (TRUE);
-
- /* Normal monsters */
if (kills > 304 / (4 + level)) return (TRUE);
-
- /* Skip non-uniques */
if (!(r_ptr->flags1 & RF1_UNIQUE)) return (FALSE);
-
- /* Unique monsters */
if (kills > 304 / (38 + (5 * level) / 4)) return (TRUE);
-
- /* Assume false */
return (FALSE);
}
s32b d = d1 * d2;
if (d >= ((4+level)*MAX_UCHAR)/80) d = ((4+level)*MAX_UCHAR-1)/80;
-
- /* Normal monsters */
if ((4 + level) * a > 80 * d) return (TRUE);
-
- /* Skip non-uniques */
if (!(r_ptr->flags1 & RF1_UNIQUE)) return (FALSE);
-
- /* Unique monsters */
if ((4 + level) * (2 * a) > 80 * d) return (TRUE);
/* Assume false */
/* Start a new line */
hooked_roff("\n");
}
-
- /* Normal monsters */
else
{
/* Killed some this life */
if (speed != 110) hooked_roff(_("、かつ", ", and"));
}
- /* Speed */
if (speed > 110)
{
if (speed > 139) hook_c_roff(TERM_RED, _("信じ難いほど", " incredibly"));
*/
void set_pet(monster_type *m_ptr)
{
- if (!is_pet(m_ptr)) check_pets_num_and_align(m_ptr, TRUE);
-
- /* Check for quest completion */
check_quest_completion(m_ptr);
m_ptr->smart |= SM_PET;
*/
void set_hostile(monster_type *m_ptr)
{
- if (p_ptr->inside_battle) return;
-
- if (is_pet(m_ptr)) check_pets_num_and_align(m_ptr, FALSE);
-
+ if (p_ptr->phase_out) return;
m_ptr->smart &= ~SM_PET;
m_ptr->smart &= ~SM_FRIENDLY;
}
*/
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];
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);
}
}
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;
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;
/* Notice changes in view */
if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
{
- /* Update some things */
p_ptr->update |= (PU_MON_LITE);
}
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! */
r_ptr = &r_info[m_ptr->r_idx];
}
- /* Check for quest completion */
check_quest_completion(m_ptr);
/* Handle the possibility of player vanquishing arena combatant -KMW- */
{
GAME_TEXT m_name[MAX_NLEN];
- /* Extract monster name */
- monster_desc(m_name, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
+ 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);
}
}
/* 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;
{
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;
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;
}
* 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))
{
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!"));
a_ptr = &a_info[a_idx];
} while (a_ptr->cur_num);
- /* Create the artifact */
if (create_named_art(a_idx, y, x))
{
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;
}
if (!a_ptr->cur_num)
{
- /* Create the artifact */
if (create_named_art(a_idx, y, x))
{
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;
}
if (!a_ptr->cur_num)
{
- /* Create the artifact */
if (create_named_art(a_idx, y, x))
{
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;
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;
q_ptr = &forge;
object_wipe(q_ptr);
- /* Make Gold */
if (do_gold && (!do_item || (randint0(100) < 50)))
{
- /* Make some gold */
if (!make_gold(q_ptr)) continue;
-
dump_gold++;
}
-
- /* Make Object */
else
{
- /* Make an object */
if (!make_object(q_ptr, mo_mode)) continue;
-
dump_item++;
}
(void)drop_near(q_ptr, -1, y, x);
/* 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)
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);
return _("は死んだ。", " dies.");
}
+
+/*
+ * Monster health description
+ */
+concptr look_mon_desc(monster_type *m_ptr, BIT_FLAGS mode)
+{
+ monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
+ bool living;
+ int perc;
+ concptr desc;
+ concptr attitude;
+ concptr clone;
+
+ /* Determine if the monster is "living" */
+ living = monster_living(m_ptr->ap_r_idx);
+
+ /* Calculate a health "percentage" */
+ perc = m_ptr->maxhp > 0 ? 100L * m_ptr->hp / m_ptr->maxhp : 0;
+
+ /* Healthy monsters */
+ if (m_ptr->hp >= m_ptr->maxhp)
+ {
+ desc = living ? _("無傷", "unhurt") : _("無ダメージ", "undamaged");
+ }
+
+ else if (perc >= 60)
+ {
+ desc = living ? _("軽傷", "somewhat wounded") : _("小ダメージ", "somewhat damaged");
+ }
+
+ else if (perc >= 25)
+ {
+ desc = living ? _("負傷", "wounded") : _("中ダメージ", "damaged");
+ }
+
+ else if (perc >= 10)
+ {
+ desc = living ? _("重傷", "badly wounded") : _("大ダメージ", "badly damaged");
+ }
+
+ else
+ {
+ desc = living ? _("半死半生", "almost dead") : _("倒れかけ", "almost destroyed");
+ }
+
+ /* Need attitude information? */
+ if (!(mode & 0x01))
+ {
+ /* Full information is not needed */
+ attitude = "";
+ }
+ else if (is_pet(m_ptr))
+ {
+ attitude = _(", ペット", ", pet");
+ }
+ else if (is_friendly(m_ptr))
+ {
+ attitude = _(", 友好的", ", friendly");
+ }
+ else
+ {
+ attitude = _("", "");
+ }
+
+ /* Clone monster? */
+ if (m_ptr->smart & SM_CLONED)
+ {
+ clone = ", clone";
+ }
+ else
+ {
+ clone = "";
+ }
+
+ /* Display monster's level --- idea borrowed from ToME */
+ if (ap_r_ptr->r_tkills && !(m_ptr->mflag2 & MFLAG2_KAGE))
+ {
+ return format(_("レベル%d, %s%s%s", "Level %d, %s%s%s"), ap_r_ptr->level, desc, attitude, clone);
+ }
+ else
+ {
+ return format(_("レベル???, %s%s%s", "Level ???, %s%s%s"), desc, attitude, clone);
+ }
+
+}
+