#include "angband.h"
#include "grid.h"
#include "trap.h"
+#include "monsterrace-hook.h"
+#include "melee.h"
+#include "world.h"
/*!
*/
static bool detect_feat_flag(POSITION range, int flag, bool known)
{
- int x, y;
- bool detect = FALSE;
+ POSITION x, y;
+ bool detect = FALSE;
cave_type *c_ptr;
if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
{
int dist = distance(p_ptr->y, p_ptr->x, y, x);
if (dist > range) continue;
-
- /* Access the grid */
c_ptr = &cave[y][x];
/* Hack -- Safe */
c_ptr->info &= ~(CAVE_UNSAFE);
- /* Redraw */
lite_spot(y, x);
}
}
/* Hack -- Memorize */
c_ptr->info |= (CAVE_MARK);
- /* Redraw */
lite_spot(y, x);
- /* Obvious */
detect = TRUE;
}
}
}
-
- /* Result */
return detect;
}
if (known) p_ptr->dtrap = TRUE;
if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
-
- /* Describe */
if (detect)
{
msg_print(_("トラップの存在を感じとった!", "You sense the presence of traps!"));
}
-
- /* Result */
return detect;
}
bool detect = detect_feat_flag(range, FF_DOOR, TRUE);
if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
-
- /* Describe */
if (detect)
{
msg_print(_("ドアの存在を感じとった!", "You sense the presence of doors!"));
}
-
- /* Result */
return detect;
}
bool detect = detect_feat_flag(range, FF_STAIRS, TRUE);
if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
-
- /* Describe */
if (detect)
{
msg_print(_("階段の存在を感じとった!", "You sense the presence of stairs!"));
}
-
- /* Result */
return detect;
}
bool detect = detect_feat_flag(range, FF_HAS_GOLD, TRUE);
if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
-
- /* Describe */
if (detect)
{
msg_print(_("埋蔵された財宝の存在を感じとった!", "You sense the presence of buried treasure!"));
}
-
- /* Result */
return detect;
}
*/
bool detect_objects_gold(POSITION range)
{
- int i, y, x;
+ OBJECT_IDX i;
+ POSITION y, x;
POSITION range2 = range;
bool detect = FALSE;
/* Skip held objects */
if (o_ptr->held_m_idx) continue;
- /* Location */
y = o_ptr->iy;
x = o_ptr->ix;
/* Detect "gold" objects */
if (o_ptr->tval == TV_GOLD)
{
- /* Hack -- memorize it */
o_ptr->marked |= OM_FOUND;
-
- /* Redraw */
lite_spot(y, x);
-
- /* Detect */
detect = TRUE;
}
}
if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
-
- /* Describe */
if (detect)
{
msg_print(_("財宝の存在を感じとった!", "You sense the presence of treasure!"));
{
detect = TRUE;
}
-
- /* Result */
return (detect);
}
*/
bool detect_objects_normal(POSITION range)
{
- int i, y, x;
+ OBJECT_IDX i;
+ POSITION y, x;
POSITION range2 = range;
bool detect = FALSE;
/* Skip held objects */
if (o_ptr->held_m_idx) continue;
- /* Location */
y = o_ptr->iy;
x = o_ptr->ix;
/* Detect "real" objects */
if (o_ptr->tval != TV_GOLD)
{
- /* Hack -- memorize it */
o_ptr->marked |= OM_FOUND;
-
- /* Redraw */
lite_spot(y, x);
-
- /* Detect */
detect = TRUE;
}
}
if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
-
- /* Describe */
if (detect)
{
msg_print(_("アイテムの存在を感じとった!", "You sense the presence of objects!"));
{
detect = TRUE;
}
-
- /* Result */
return (detect);
}
*/
bool detect_objects_magic(POSITION range)
{
- int i, y, x, tv;
+ OBJECT_TYPE_VALUE tv;
+ OBJECT_IDX i;
+ POSITION y, x;
bool detect = FALSE;
/* Skip held objects */
if (o_ptr->held_m_idx) continue;
- /* Location */
y = o_ptr->iy;
x = o_ptr->ix;
{
/* Memorize the item */
o_ptr->marked |= OM_FOUND;
-
- /* Redraw */
lite_spot(y, x);
-
- /* Detect */
detect = TRUE;
}
}
-
- /* Describe */
if (detect)
{
msg_print(_("魔法のアイテムの存在を感じとった!", "You sense the presence of magic objects!"));
{
MONSTER_IDX i;
POSITION y, x;
-
bool flag = FALSE;
if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
- /* Scan monsters */
for (i = 1; i < m_max; i++)
{
monster_type *m_ptr = &m_list[i];
/* Skip dead monsters */
if (!m_ptr->r_idx) continue;
- /* Location */
y = m_ptr->fy;
x = m_ptr->fx;
/* Repair visibility later */
repair_monsters = TRUE;
- /* Hack -- Detect monster */
m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
- /* Update the monster */
- update_mon(i, FALSE);
-
- /* Detect */
+ update_monster(i, FALSE);
flag = TRUE;
}
}
if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
-
- /* Describe */
if (flag)
{
- /* Describe result */
msg_print(_("モンスターの存在を感じとった!", "You sense the presence of monsters!"));
}
-
- /* Result */
return (flag);
}
if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
- /* Scan monsters */
for (i = 1; i < m_max; i++)
{
monster_type *m_ptr = &m_list[i];
/* Skip dead monsters */
if (!m_ptr->r_idx) continue;
- /* Location */
y = m_ptr->fy;
x = m_ptr->fx;
/* Update monster recall window */
if (p_ptr->monster_race_idx == m_ptr->r_idx)
{
- /* Window stuff */
p_ptr->window |= (PW_MONSTER);
}
/* Repair visibility later */
repair_monsters = TRUE;
- /* Hack -- Detect monster */
m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
- /* Update the monster */
- update_mon(i, FALSE);
-
- /* Detect */
+ update_monster(i, FALSE);
flag = TRUE;
}
}
if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
-
- /* Describe */
if (flag)
{
- /* Describe result */
msg_print(_("透明な生物の存在を感じとった!", "You sense the presence of invisible creatures!"));
}
-
- /* Result */
return (flag);
}
if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
- /* Scan monsters */
for (i = 1; i < m_max; i++)
{
monster_type *m_ptr = &m_list[i];
/* Skip dead monsters */
if (!m_ptr->r_idx) continue;
- /* Location */
y = m_ptr->fy;
x = m_ptr->fx;
/* Update monster recall window */
if (p_ptr->monster_race_idx == m_ptr->r_idx)
{
- /* Window stuff */
p_ptr->window |= (PW_MONSTER);
}
}
/* Repair visibility later */
repair_monsters = TRUE;
- /* Hack -- Detect monster */
m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
- /* Update the monster */
- update_mon(i, FALSE);
-
- /* Detect */
+ update_monster(i, FALSE);
flag = TRUE;
}
}
-
- /* Describe */
if (flag)
{
- /* Describe result */
msg_print(_("邪悪なる生物の存在を感じとった!", "You sense the presence of evil creatures!"));
}
-
- /* Result */
return (flag);
}
if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
- /* Scan monsters */
for (i = 1; i < m_max; i++)
{
monster_type *m_ptr = &m_list[i];
- monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Skip dead monsters */
if (!m_ptr->r_idx) continue;
- /* Location */
y = m_ptr->fy;
x = m_ptr->fx;
if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
/* Detect non-living monsters */
- if (!monster_living(r_ptr))
+ if (!monster_living(m_ptr->r_idx))
{
/* Update monster recall window */
if (p_ptr->monster_race_idx == m_ptr->r_idx)
{
- /* Window stuff */
p_ptr->window |= (PW_MONSTER);
}
/* Repair visibility later */
repair_monsters = TRUE;
- /* Hack -- Detect monster */
m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
- /* Update the monster */
- update_mon(i, FALSE);
-
- /* Detect */
+ update_monster(i, FALSE);
flag = TRUE;
}
}
-
- /* Describe */
if (flag)
{
- /* Describe result */
msg_print(_("自然でないモンスターの存在を感じた!", "You sense the presence of unnatural beings!"));
}
-
- /* Result */
return (flag);
}
{
MONSTER_IDX i;
POSITION y, x;
- bool flag = FALSE;
+ bool flag = FALSE;
if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
- /* Scan monsters */
for (i = 1; i < m_max; i++)
{
monster_type *m_ptr = &m_list[i];
/* Skip dead monsters */
if (!m_ptr->r_idx) continue;
- /* Location */
y = m_ptr->fy;
x = m_ptr->fx;
/* Update monster recall window */
if (p_ptr->monster_race_idx == m_ptr->r_idx)
{
- /* Window stuff */
p_ptr->window |= (PW_MONSTER);
}
/* Repair visibility later */
repair_monsters = TRUE;
- /* Hack -- Detect monster */
m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
- /* Update the monster */
- update_mon(i, FALSE);
-
- /* Detect */
+ update_monster(i, FALSE);
flag = TRUE;
}
}
-
- /* Describe */
if (flag)
{
- /* Describe result */
msg_print(_("殺気を感じとった!", "You sense the presence of someone's mind!"));
}
-
- /* Result */
return (flag);
}
if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
- /* Scan monsters */
for (i = 1; i < m_max; i++)
{
monster_type *m_ptr = &m_list[i];
/* Skip dead monsters */
if (!m_ptr->r_idx) continue;
- /* Location */
y = m_ptr->fy;
x = m_ptr->fx;
/* Update monster recall window */
if (p_ptr->monster_race_idx == m_ptr->r_idx)
{
- /* Window stuff */
p_ptr->window |= (PW_MONSTER);
}
/* Repair visibility later */
repair_monsters = TRUE;
- /* Hack -- Detect monster */
m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
- /* Update the monster */
- update_mon(i, FALSE);
-
- /* Detect */
+ update_monster(i, FALSE);
flag = TRUE;
}
}
if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
-
- /* Describe */
if (flag)
{
- /* Describe result */
msg_print(_("モンスターの存在を感じとった!", "You sense the presence of monsters!"));
}
-
- /* Result */
return (flag);
}
if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
- /* Scan monsters */
for (i = 1; i < m_max; i++)
{
monster_type *m_ptr = &m_list[i];
/* Skip dead monsters */
if (!m_ptr->r_idx) continue;
- /* Location */
y = m_ptr->fy;
x = m_ptr->fx;
/* Update monster recall window */
if (p_ptr->monster_race_idx == m_ptr->r_idx)
{
- /* Window stuff */
p_ptr->window |= (PW_MONSTER);
}
}
/* Repair visibility later */
repair_monsters = TRUE;
- /* Hack -- Detect monster */
m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
- /* Update the monster */
- update_mon(i, FALSE);
-
- /* Detect */
+ update_monster(i, FALSE);
flag = TRUE;
}
}
-
- /* Describe */
if (flag)
{
switch (match_flag)
break;
}
- /* Describe result */
msg_format(_("%sの存在を感じとった!", "You sense the presence of %s!"), desc_monsters);
msg_print(NULL);
}
-
- /* Result */
return (flag);
}
if (detect_objects_normal(range)) detect = TRUE;
if (detect_monsters_invis(range)) detect = TRUE;
if (detect_monsters_normal(range)) detect = TRUE;
-
- /* Result */
return (detect);
}
* this is done in two passes. -- JDL
* </pre>
*/
-bool project_hack(EFFECT_ID typ, HIT_POINT dam)
+bool project_all_los(EFFECT_ID typ, HIT_POINT dam)
{
- int i, x, y;
- int flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE;
- bool obvious = FALSE;
+ MONSTER_IDX i;
+ POSITION x, y;
+ BIT_FLAGS flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE;
+ bool obvious = FALSE;
/* Mark all (nearby) monsters */
/* Paranoia -- Skip dead monsters */
if (!m_ptr->r_idx) continue;
- /* Location */
y = m_ptr->fy;
x = m_ptr->fx;
/* Remove mark */
m_ptr->mflag &= ~(MFLAG_TEMP);
- /* Location */
y = m_ptr->fy;
x = m_ptr->fx;
/* Jump directly to the target monster */
if (project(0, 0, y, x, dam, typ, flg, -1)) obvious = TRUE;
}
-
- /* Result */
return (obvious);
}
*/
bool speed_monsters(void)
{
- return (project_hack(GF_OLD_SPEED, p_ptr->lev));
+ return (project_all_los(GF_OLD_SPEED, p_ptr->lev));
}
/*!
*/
bool slow_monsters(int power)
{
- return (project_hack(GF_OLD_SLOW, power));
+ return (project_all_los(GF_OLD_SLOW, power));
}
/*!
*/
bool sleep_monsters(int power)
{
- return (project_hack(GF_OLD_SLEEP, power));
+ return (project_all_los(GF_OLD_SLEEP, power));
}
/*!
*/
bool banish_evil(int dist)
{
- return (project_hack(GF_AWAY_EVIL, dist));
+ return (project_all_los(GF_AWAY_EVIL, dist));
}
/*!
*/
bool turn_undead(void)
{
- bool tester = (project_hack(GF_TURN_UNDEAD, p_ptr->lev));
+ bool tester = (project_all_los(GF_TURN_UNDEAD, p_ptr->lev));
if (tester)
chg_virtue(V_UNLIFE, -1);
return tester;
*/
bool dispel_undead(HIT_POINT dam)
{
- bool tester = (project_hack(GF_DISP_UNDEAD, dam));
+ bool tester = (project_all_los(GF_DISP_UNDEAD, dam));
if (tester)
chg_virtue(V_UNLIFE, -2);
return tester;
*/
bool dispel_evil(HIT_POINT dam)
{
- return (project_hack(GF_DISP_EVIL, dam));
+ return (project_all_los(GF_DISP_EVIL, dam));
}
/*!
*/
bool dispel_good(HIT_POINT dam)
{
- return (project_hack(GF_DISP_GOOD, dam));
+ return (project_all_los(GF_DISP_GOOD, dam));
}
/*!
*/
bool dispel_monsters(HIT_POINT dam)
{
- return (project_hack(GF_DISP_ALL, dam));
+ return (project_all_los(GF_DISP_ALL, dam));
}
/*!
*/
bool dispel_living(HIT_POINT dam)
{
- return (project_hack(GF_DISP_LIVING, dam));
+ return (project_all_los(GF_DISP_LIVING, dam));
}
/*!
*/
bool dispel_demons(HIT_POINT dam)
{
- return (project_hack(GF_DISP_DEMON, dam));
+ return (project_all_los(GF_DISP_DEMON, dam));
}
/*!
*/
bool crusade(void)
{
- return (project_hack(GF_CRUSADE, p_ptr->lev*4));
+ return (project_all_los(GF_CRUSADE, p_ptr->lev*4));
}
/*!
bool sleep = FALSE;
bool speed = FALSE;
-
/* Aggravate everyone nearby */
for (i = 1; i < m_max; i++)
{
- monster_type *m_ptr = &m_list[i];
-/* monster_race *r_ptr = &r_info[m_ptr->r_idx]; */
+ monster_type *m_ptr = &m_list[i];
/* Paranoia -- Skip dead monsters */
if (!m_ptr->r_idx) continue;
}
}
- /* Messages */
-#ifdef JP
- if (speed) msg_print("付近で何かが突如興奮したような感じを受けた!");
- else if (sleep) msg_print("何かが突如興奮したような騒々しい音が遠くに聞こえた!");
-#else
- if (speed) msg_print("You feel a sudden stirring nearby!");
- else if (sleep) msg_print("You hear a sudden stirring in the distance!");
-#endif
+ if (speed) msg_print(_("付近で何かが突如興奮したような感じを受けた!", "You feel a sudden stirring nearby!"));
+ else if (sleep) msg_print(_("何かが突如興奮したような騒々しい音が遠くに聞こえた!", "You hear a sudden stirring in the distance!"));
if (p_ptr->riding) p_ptr->update |= PU_BONUS;
}
/* Hack -- Skip Unique Monsters or Quest Monsters */
if (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) resist = TRUE;
-
else if (r_ptr->flags7 & RF7_UNIQUE2) resist = TRUE;
-
else if (m_idx == p_ptr->riding) resist = TRUE;
-
else if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) resist = TRUE;
-
else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE;
-
else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE;
- /* Delete the monster */
+
else
{
if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
{
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name);
if (resist && player_cast)
{
bool see_m = is_seen(m_ptr);
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, 0);
if (see_m)
if (player_cast)
{
- /* Take damage */
take_hit(DAMAGE_GENO, randint1(dam_side), format(_("%^sの呪文を唱えた疲労", "the strain of casting %^s"), spell_name), -1);
}
/* Visual feedback */
move_cursor_relative(p_ptr->y, p_ptr->x);
- /* Redraw */
p_ptr->redraw |= (PR_HP);
-
- /* Window stuff */
p_ptr->window |= (PW_PLAYER);
- /* Handle */
handle_stuff();
-
- /* Fresh */
Term_fresh();
- /* Delay */
Term_xtra(TERM_XTRA_DELAY, msec);
return !resist;
/* Skip "wrong" monsters */
if (r_ptr->d_char != typ) continue;
- /* Take note */
result |= genocide_aux(i, power, player_cast, 4, _("抹殺", "Genocide"));
}
*/
bool probing(void)
{
- int i, speed;
+ int i;
+ int speed; /* TODO */
bool_hack cu, cv;
bool probe = FALSE;
char buf[256];
/* Probe visible monsters */
if (m_ptr->ml)
{
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
/* Start the message */
if (!probe)
if (ironman_nightmare) speed += 5;
/* Get the monster's alignment */
-#ifdef JP
- if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = "善悪";
- else if (r_ptr->flags3 & RF3_EVIL) align = "邪悪";
- else if (r_ptr->flags3 & RF3_GOOD) align = "善良";
- else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) align = "中立(善悪)";
- else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = "中立(邪悪)";
- else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = "中立(善良)";
- else align = "中立";
-#else
- if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = "good&evil";
- else if (r_ptr->flags3 & RF3_EVIL) align = "evil";
- else if (r_ptr->flags3 & RF3_GOOD) align = "good";
- else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) align = "neutral(good&evil)";
- else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = "neutral(evil)";
- else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = "neutral(good)";
- else align = "neutral";
-#endif
+ if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = _("善悪", "good&evil");
+ else if (r_ptr->flags3 & RF3_EVIL) align = _("邪悪", "evil");
+ else if (r_ptr->flags3 & RF3_GOOD) align = _("善良", "good");
+ else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) _(align = "中立(善悪)", "neutral(good&evil)");
+ else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = _("中立(邪悪)", "neutral(evil)");
+ else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = _("中立(善良)", "neutral(good)");
+ else align = _("中立", "neutral");
/* Describe the monster */
sprintf(buf,_("%s ... 属性:%s HP:%d/%d AC:%d 速度:%s%d 経験:", "%s ... align:%s HP:%d/%d AC:%d speed:%s%d exp:"),
strcat(buf, "xxx ");
}
-#ifdef JP
- if (MON_CSLEEP(m_ptr)) strcat(buf,"睡眠 ");
- if (MON_STUNNED(m_ptr)) strcat(buf,"朦朧 ");
- if (MON_MONFEAR(m_ptr)) strcat(buf,"恐怖 ");
- if (MON_CONFUSED(m_ptr)) strcat(buf,"混乱 ");
- if (MON_INVULNER(m_ptr)) strcat(buf,"無敵 ");
-#else
- if (MON_CSLEEP(m_ptr)) strcat(buf,"sleeping ");
- if (MON_STUNNED(m_ptr)) strcat(buf,"stunned ");
- if (MON_MONFEAR(m_ptr)) strcat(buf,"scared ");
- if (MON_CONFUSED(m_ptr)) strcat(buf,"confused ");
- if (MON_INVULNER(m_ptr)) strcat(buf,"invulnerable ");
-#endif
+ if (MON_CSLEEP(m_ptr)) strcat(buf,_("睡眠 ", "sleeping "));
+ if (MON_STUNNED(m_ptr)) strcat(buf, _("朦朧 ", "stunned "));
+ if (MON_MONFEAR(m_ptr)) strcat(buf, _("恐怖 ", "scared "));
+ if (MON_CONFUSED(m_ptr)) strcat(buf, _("混乱 ", "confused "));
+ if (MON_INVULNER(m_ptr)) strcat(buf, _("無敵 ", "invulnerable "));
buf[strlen(buf)-1] = '\0';
- prt(buf,0,0);
+ prt(buf, 0, 0);
/* HACK : Add the line to message buffer */
message_add(buf);
+
p_ptr->window |= (PW_MESSAGE);
- window_stuff();
+ handle_stuff();
if (m_ptr->ml) move_cursor_relative(m_ptr->fy, m_ptr->fx);
inkey();
Term->scr->cv = cv;
Term_fresh();
- /* Done */
if (probe)
{
chg_virtue(V_KNOWLEDGE, 1);
msg_print(_("これで全部です。", "That's all."));
}
-
- /* Result */
return (probe);
}
POSITION y, x;
int k, t;
cave_type *c_ptr;
- bool flag = FALSE;
+ bool flag = FALSE;
/* Prevent destruction of quest levels and town */
if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
/* Stay in the circle of death */
if (k > r) continue;
-
- /* Access the grid */
c_ptr = &cave[y][x];
/* Lose room and vault */
{
if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
{
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_DESTROY, m_name);
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[this_o_idx];
/* Acquire next object */
if (in_generate && cheat_peek)
{
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE));
msg_format(_("伝説のアイテム (%s) は生成中に*破壊*された。", "Artifact (%s) was *destroyed* during generation."), o_name);
}
/* Stay in the circle of death */
if (k > r) continue;
-
- /* Access the grid */
c_ptr = &cave[y][x];
if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
/* Hack -- Affect player */
if (flag)
{
- /* Message */
msg_print(_("燃えるような閃光が発生した!", "There is a searing blast of light!"));
/* Blind the player */
/* Mega-Hack -- Forget the view and lite */
p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
- /* Update stuff */
p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
- /* Window stuff */
p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
if (p_ptr->special_defense & NINJA_S_STEALTH)
*/
bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
{
- int i, t;
+ DIRECTION i;
+ int t;
POSITION y, x, yy, xx, dy, dx;
int damage = 0;
int sn = 0;
/* Skip distant grids */
if (distance(cy, cx, yy, xx) > r) continue;
-
- /* Access the grid */
c_ptr = &cave[yy][xx];
/* Lose room and vault */
/* Important -- no wall on player */
map[16+p_ptr->y-cy][16+p_ptr->x-cx] = FALSE;
- /* Take some damage */
if (damage)
{
cptr killer;
if (m_idx)
{
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
monster_type *m_ptr = &m_list[m_idx];
/* Get the monster's real name */
/* Skip unaffected grids */
if (!map[16+yy-cy][16+xx-cx]) continue;
-
- /* Access the grid */
c_ptr = &cave[yy][xx];
if (c_ptr->m_idx == p_ptr->riding) continue;
if (!(r_ptr->flags2 & (RF2_KILL_WALL)) &&
!(r_ptr->flags2 & (RF2_PASS_WALL)))
{
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
/* Assume not safe */
sn = 0;
/* Look for safety */
for (i = 0; i < 8; i++)
{
- /* Access the grid */
y = yy + ddy_ddd[i];
x = xx + ddx_ddd[i];
/* Delete (not kill) "dead" monsters */
if (m_ptr->hp < 0)
{
- /* Message */
if (!ignore_unview || is_seen(m_ptr))
msg_format(_("%^sは岩石に埋もれてしまった!", "%^s is embedded in the rock!"), m_name);
{
if (record_named_pet && is_pet(&m_list[c_ptr->m_idx]) && m_list[c_ptr->m_idx].nickname)
{
- char m2_name[80];
+ char m2_name[MAX_NLEN];
monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_EARTHQUAKE, m2_name);
}
}
- /* Delete the monster */
delete_monster(yy, xx);
/* No longer safe */
m_ptr->fy = sy;
m_ptr->fx = sx;
- /* Update the monster (new location) */
- update_mon(m_idx, TRUE);
-
- /* Redraw the old grid */
+ update_monster(m_idx, TRUE);
lite_spot(yy, xx);
-
- /* Redraw the new grid */
lite_spot(sy, sx);
}
}
/* Skip distant grids */
if (distance(cy, cx, yy, xx) > r) continue;
-
- /* Access the grid */
c_ptr = &cave[yy][xx];
if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
/* Mega-Hack -- Forget the view and lite */
p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
- /* Update stuff */
p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
/* Update the health bar */
p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
- /* Window stuff */
p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
if (p_ptr->special_defense & NINJA_S_STEALTH)
/* Uniques resist discharging */
if (r_ptr->flags1 & RF1_UNIQUE)
{
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, 0x00);
msg_format(_("%sは爆破されるのを嫌がり、勝手に自分の世界へと帰った。", "%^s resists to be blasted, and run away."), m_name);
delete_monster_idx(i);
if (record_named_pet && m_ptr->nickname)
{
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_BLAST, m_name);
if (c_ptr->m_idx)
{
int chance = 25;
-
monster_type *m_ptr = &m_list[c_ptr->m_idx];
-
monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
- /* Update the monster */
- update_mon(c_ptr->m_idx, FALSE);
+ update_monster(c_ptr->m_idx, FALSE);
/* Stupid monsters rarely wake up */
if (r_ptr->flags2 & (RF2_STUPID)) chance = 10;
/* Notice the "waking up" */
if (m_ptr->ml)
{
- 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 wakes up."), m_name);
}
}
/* Note */
note_spot(y, x);
- /* Redraw */
lite_spot(y, x);
update_local_illumination(y, x);
/* Forget the grid */
if (!view_torch_grids) c_ptr->info &= ~(CAVE_MARK);
- /* Notice */
note_spot(y, x);
}
/* Process affected monsters */
if (c_ptr->m_idx)
{
- /* Update the monster */
- update_mon(c_ptr->m_idx, FALSE);
+ update_monster(c_ptr->m_idx, FALSE);
}
- /* Redraw */
lite_spot(y, x);
update_local_illumination(y, x);
static int next_to_open(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION))
{
int i;
-
POSITION y, x;
-
int len = 0;
int blen = 0;
*/
bool fire_rocket(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
{
- int tx, ty;
-
+ POSITION tx, ty;
BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
/* Use the given direction */
*/
bool fire_ball_hide(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
{
- int tx, ty;
-
+ POSITION tx, ty;
BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE;
/* Use the given direction */
*/
bool fire_blast(EFFECT_ID typ, DIRECTION dir, int dd, int ds, int num, int dev)
{
- int ly, lx, ld;
- int ty, tx, y, x;
+ POSITION ly, lx;
+ int ld;
+ POSITION ty, tx, y, x;
int i;
BIT_FLAGS flg = PROJECT_FAST | PROJECT_THRU | PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE | PROJECT_GRID;
bool dummy = (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_STONE_WALL, flg, -1));
- /* Update stuff */
p_ptr->update |= (PU_FLOW);
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
return dummy;
/*!
* @brief 死者復活処理(起点より周囲5マス)
- * @param who è¡\93è\80\85ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ID(0ã\81ªã\82\89ã\81°ã\83\97ã\83¬ã\82¤ã\82\84ー)
+ * @param who è¡\93è\80\85ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ID(0ã\81ªã\82\89ã\81°ã\83\97ã\83¬ã\82¤ã\83¤ー)
* @param y 起点Y座標
* @param x 起点X座標
* @return 作用が実際にあった場合TRUEを返す
(*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
if (!one_in_(6)) break;
case 7: case 8: case 9: case 18:
- (*count) += summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+ (*count) += summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
if (!one_in_(6)) break;
case 10: case 11: case 12:
msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
switch (randint1(25) + (dun_level / 20))
{
case 1: case 2:
- count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode);
+ count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode, '\0');
break;
case 3: case 4:
- count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode);
+ count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode, '\0');
break;
case 5: case 6:
- count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode);
+ count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode, '\0');
break;
case 7: case 8:
- count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode);
+ count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode, '\0');
break;
case 9: case 10:
- count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode);
+ count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode, '\0');
break;
case 11: case 12:
- count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode);
+ count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode, '\0');
break;
case 13: case 14:
- count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode);
+ count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode, '\0');
break;
case 15: case 16:
- count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode);
+ count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode, '\0');
break;
case 17:
if (can_pet) break;
- count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
+ count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE), '\0');
break;
case 18: case 19:
if (can_pet) break;
- count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE));
+ count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE), '\0');
break;
case 20: case 21:
if (!can_pet) mode |= PM_ALLOW_UNIQUE;
- count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode);
+ count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode, '\0');
break;
case 22: case 23:
if (!can_pet) mode |= PM_ALLOW_UNIQUE;
- count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode);
+ count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode, '\0');
break;
case 24:
- count += summon_specific((pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode);
+ count += summon_specific((pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode, '\0');
break;
default:
if (!can_pet) mode |= PM_ALLOW_UNIQUE;
- count += summon_specific((pet ? -1 : 0), y, x,pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode);
+ count += summon_specific((pet ? -1 : 0), y, x,pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode, '\0');
}
}
for (i = 0; i < max_cyber; i++)
{
- count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode);
+ count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode, '\0');
}
return count;
*/
bool confuse_monsters(HIT_POINT dam)
{
- return (project_hack(GF_OLD_CONF, dam));
+ return (project_all_los(GF_OLD_CONF, dam));
}
*/
bool charm_monsters(HIT_POINT dam)
{
- return (project_hack(GF_CHARM, dam));
+ return (project_all_los(GF_CHARM, dam));
}
*/
bool charm_animals(HIT_POINT dam)
{
- return (project_hack(GF_CONTROL_ANIMAL, dam));
+ return (project_all_los(GF_CONTROL_ANIMAL, dam));
}
*/
bool stun_monsters(HIT_POINT dam)
{
- return (project_hack(GF_STUN, dam));
+ return (project_all_los(GF_STUN, dam));
}
*/
bool stasis_monsters(HIT_POINT dam)
{
- return (project_hack(GF_STASIS, dam));
+ return (project_all_los(GF_STASIS, dam));
}
*/
bool mindblast_monsters(HIT_POINT dam)
{
- return (project_hack(GF_PSI, dam));
+ return (project_all_los(GF_PSI, dam));
}
*/
bool banish_monsters(int dist)
{
- return (project_hack(GF_AWAY_ALL, dist));
+ return (project_all_los(GF_AWAY_ALL, dist));
}
*/
bool turn_evil(HIT_POINT dam)
{
- return (project_hack(GF_TURN_EVIL, dam));
+ return (project_all_los(GF_TURN_EVIL, dam));
}
*/
bool turn_monsters(HIT_POINT dam)
{
- return (project_hack(GF_TURN_ALL, dam));
+ return (project_all_los(GF_TURN_ALL, dam));
}
*/
bool deathray_monsters(void)
{
- return (project_hack(GF_DEATH_RAY, p_ptr->lev * 200));
+ return (project_all_los(GF_DEATH_RAY, p_ptr->lev * 200));
}
/*!
{
object_type forge;
object_type *q_ptr = &forge;
- int y, x;
+ POSITION y, x;
if (p_ptr->is_dead) return FALSE;
if (p_ptr->confused || p_ptr->blind || p_ptr->paralyzed || p_ptr->image) return FALSE;
/* Move player before updating the monster */
if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
-
- /* Update the monster */
- update_mon(cave[ny][nx].m_idx, TRUE);
+ update_monster(cave[ny][nx].m_idx, TRUE);
/* Found a monster */
m_ptr = &m_list[cave[ny][nx].m_idx];
else if (!player_bold(ty, tx))
{
/* Hold the monster name */
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
/* Get the monster name (BEFORE polymorphing) */
monster_desc(m_name, m_ptr, 0);
case 1:
case 2:
{
- /* Message */
msg_print(_("あなたは悪性のオーラに包み込まれた。", "You are surrounded by a malignant aura."));
sound(SOUND_EVIL);
case 3:
{
- /* Message */
msg_print(_("あなたは強力なオーラに包み込まれた。", "You are surrounded by a powerful aura."));
/* Dispel monsters */
case 35:
while (counter++ < 8)
{
- (void)summon_specific(0, p_ptr->y, p_ptr->x, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
+ (void)summon_specific(0, p_ptr->y, p_ptr->x, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET), '\0');
}
break;
case 36:
msg_print(_("なんてこった!あなたの周りの地面から朽ちた人影が立ち上がってきた!",
"Oh no! Mouldering forms rise from the earth around you!"));
- (void)summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+ (void)summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
chg_virtue(V_UNLIFE, 1);
}
else if (die < 14)
else if (die < 14)
{
msg_print(_("なんてこった!《悪魔》だ!", "Oh no! It's the Devil!"));
- summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+ summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
}
else if (die < 18)
{
(void)set_cut(0);
(void)restore_all_status();
(void)set_shero(0, TRUE);
- update_stuff();
+ handle_stuff();
hp_player(5000);
return TRUE;
}
/* Only works on adjacent monsters */
- if (!get_rep_dir2(&dir)) return FALSE;
+ if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
c_ptr = &cave[y][x];
DIRECTION dir;
POSITION x, y;
- if (!get_rep_dir2(&dir)) return FALSE;
+ if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
if (cave[y][x].m_idx)
{
OBJECT_IDX item;
object_type *o_ptr;
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
byte feel;
cptr q, s;
bool okay = FALSE;
- item_tester_no_ryoute = TRUE;
- /* Get an item */
q = _("どのアイテムを調べますか?", "Meditate on which item? ");
s = _("調べるアイテムがありません。", "You have nothing appropriate.");
- if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
+ if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT))) return (FALSE);
/* Get the item (in the pack) */
if (item >= 0)
/* Combine / Reorder the pack (later) */
p_ptr->notice |= (PN_COMBINE | PN_REORDER);
- /* Window stuff */
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
/* Valid "tval" codes */