#include "cmd-pet.h"
#include "trap.h"
#include "object-curse.h"
+#include "player-damage.h"
+#include "monster-hook.h"
static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
* @param max 色IDの最大値
* @return 選択した色ID
*/
-static byte mh_attr(int max)
+static TERM_COLOR mh_attr(int max)
{
switch (randint1(max))
{
* @param type 魔法属性
* @return 対応する色ID
*/
-static byte spell_color(int type)
+static TERM_COLOR spell_color(int type)
{
/* Check if A.B.'s new graphics should be used (rr9) */
if (streq(ANGBAND_GRAF, "new") || streq(ANGBAND_GRAF, "ne2"))
/* Normal tiles or ASCII */
else
{
- byte a;
- char c;
+ TERM_COLOR a;
+ SYMBOL_CODE c;
/* Lookup the default colors for this type */
cptr s = quark_str(gf_color[type]);
byte k;
TERM_COLOR a;
- char c;
+ SYMBOL_CODE c;
/* No motion (*) */
if ((ny == y) && (nx == x)) base = 0x30;
*/
sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg)
{
- int y, x;
+ POSITION y, x;
int n = 0;
int k = 0;
/* Absolute */
- int ay, ax;
+ POSITION ay, ax;
/* Offsets */
- int sy, sx;
+ POSITION sy, sx;
/* Fractions */
int frac;
case GF_GRAVITY:
message = _("粉砕された", "was crushed."); break;
default:
- message = NULL;break;
+ message = NULL; break;
}
if (message)
{
if (!p_ptr->blind && player_has_los_bold(y, x))
{
c_ptr->info &= ~(CAVE_UNSAFE);
-
- /* Redraw */
lite_spot(y, x);
-
obvious = TRUE;
}
if (!p_ptr->blind && player_has_los_bold(y, x))
{
c_ptr->info &= ~(CAVE_UNSAFE);
-
- /* Redraw */
lite_spot(y, x);
-
obvious = TRUE;
}
feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
cave_alter_feat(y, x, FF_SPIKE);
-
c_ptr->mimic = old_mimic;
note_spot(y, x);
-
- /* Redraw */
lite_spot(y, x);
/* Check line of sight */
note_spot(y, x);
- /* Redraw */
lite_spot(y, x);
break;
if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
{
c_ptr->info |= (CAVE_GLOW);
-
note_spot(y, x);
-
- /* Redraw */
lite_spot(y, x);
-
update_local_illumination(y, x);
/* Observe */
/* Mega-Hack -- Update the monster in the affected grid */
/* This allows "spear of light" (etc) to work "correctly" */
- if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+ if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
note_spot(y, x);
}
- /* Redraw */
lite_spot(y, x);
update_local_illumination(y, x);
/* Mega-Hack -- Update the monster in the affected grid */
/* This allows "spear of light" (etc) to work "correctly" */
- if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+ if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
}
/* All done */
/* Scan all objects in the grid */
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- /* Acquire object */
object_type *o_ptr = &o_list[this_o_idx];
bool is_art = FALSE;
k_idx = o_ptr->k_idx;
is_potion = object_is_potion(o_ptr);
-
-
- /* Delete the object */
delete_object_idx(this_o_idx);
/* Potions produce effects when 'shattered' */
(void)potion_smash_effect(who, y, x, k_idx);
}
- /* Redraw */
lite_spot(y, x);
}
}
cptr note = NULL;
/* Assume a default death */
- cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
+ cptr note_dies = extract_note_dies(real_r_idx(m_ptr));
- int ty = m_ptr->fy;
- int tx = m_ptr->fx;
+ POSITION ty = m_ptr->fy;
+ POSITION tx = m_ptr->fx;
- int caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
+ DEPTH caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
/* Nobody here */
if (!c_ptr->m_idx) return (FALSE);
/* Get the monster possessive ("his"/"her"/"its") */
monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
- if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 1);
+ if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
/* Analyze the damage type */
switch (typ)
if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
break;
}
- if (!monster_living(r_ptr))
+ if (!monster_living(m_ptr->r_idx))
{
if (is_original_ap_and_seen(m_ptr))
{
if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
break;
}
- if (!monster_living(r_ptr))
+ if (!monster_living(m_ptr->r_idx))
{
if (is_original_ap_and_seen(m_ptr))
{
/* Attempt a saving throw */
if (common_saving_throw_charm(p_ptr, dam, m_ptr) ||
- !monster_living(r_ptr))
+ !monster_living(m_ptr->r_idx))
{
/* Resist */
/* No obvious effect */
if (!resists_tele)
{
- /* Obvious */
if (seen) obvious = TRUE;
/* Prepare to teleport */
/* Only affect undead */
if (r_ptr->flags3 & (RF3_UNDEAD))
{
- /* Obvious */
if (seen) obvious = TRUE;
/* Learn about type */
/* Only affect evil */
if (r_ptr->flags3 & (RF3_EVIL))
{
- /* Obvious */
if (seen) obvious = TRUE;
/* Learn about type */
skipped = TRUE;
break;
}
- /* Obvious */
if (seen) obvious = TRUE;
/* Apply some fear */
/* Only affect undead */
if (r_ptr->flags3 & (RF3_UNDEAD))
{
- /* Obvious */
if (seen) obvious = TRUE;
/* Learn about type */
/* Only affect evil */
if (r_ptr->flags3 & (RF3_EVIL))
{
- /* Obvious */
if (seen) obvious = TRUE;
/* Learn about type */
/* Only affect good */
if (r_ptr->flags3 & (RF3_GOOD))
{
- /* Obvious */
if (seen) obvious = TRUE;
/* Learn about type */
break;
}
/* Only affect non-undead */
- if (monster_living(r_ptr))
+ if (monster_living(m_ptr->r_idx))
{
- /* Obvious */
if (seen) obvious = TRUE;
note = _("は身震いした。", " shudders.");
/* Only affect demons */
if (r_ptr->flags3 & (RF3_DEMON))
{
- /* Obvious */
if (seen) obvious = TRUE;
/* Learn about type */
dam = 0;
break;
}
- /* Obvious */
if (seen) obvious = TRUE;
note = _("は身震いした。", " shudders.");
}
if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
- else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
+ else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(m_ptr->r_idx))
nokori_hp = m_ptr->maxhp * 3 / 10;
else
nokori_hp = m_ptr->maxhp * 3 / 20;
!(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
!(r_ptr->flags3 & RF3_NO_STUN))
{
- /* Obvious */
if (seen) obvious = TRUE;
/* Get stunned */
!(r_ptr->flags3 & RF3_NO_CONF) &&
!(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
{
- /* Obvious */
if (seen) obvious = TRUE;
/* Already partially confused */
if (do_time)
{
- /* Obvious */
if (seen) obvious = TRUE;
if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
{
if (polymorph_monster(y, x))
{
- /* Obvious */
if (seen) obvious = TRUE;
/* Monster polymorphs */
/* Handle "teleport" */
if (do_dist)
{
- /* Obvious */
if (seen) obvious = TRUE;
note = _("が消え去った!", " disappears!");
}
/* Verify this code */
-
- /* Update the monster */
- if (m_ptr->r_idx) update_mon(c_ptr->m_idx, FALSE);
+ if (m_ptr->r_idx) update_monster(c_ptr->m_idx, FALSE);
/* Redraw the monster grid */
lite_spot(y, x);
{
object_type *q_ptr;
object_type forge;
-
- /* Get local object */
q_ptr = &forge;
/* Prepare to make a Blade of Chaos */
project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
- disturb(1, 1);
+ disturb(TRUE, TRUE);
return TRUE;
}
}
- disturb(1, 1);
+ disturb(TRUE, TRUE);
if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
/* Calculate the projection path */
path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
-
- /* Hack -- Handle stuff */
handle_stuff();
/* Giga-Hack SEEKER & SUPER_RAY */