if (o_ptr->pval == 0) continue;
/* No (known) traps here */
- if (trapped && (!object_known_p(o_ptr) ||
+ if (trapped && (!object_is_known(o_ptr) ||
!chest_traps[o_ptr->pval])) continue;
/* OK */
{
/* Stuck */
#ifdef JP
- msg_print("¥É¥¢¤Ï¤¬¤Ã¤Á¤ê¤ÈÊĤ¸¤é¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
+ msg_format("%s¤Ï¤¬¤Ã¤Á¤ê¤ÈÊĤ¸¤é¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£", f_name + f_info[get_feat_mimic(c_ptr)].name);
#else
- msg_print("The door appears to be stuck.");
+ msg_format("The %s appears to be stuck.", f_name + f_info[get_feat_mimic(c_ptr)].name);
#endif
}
/* Open the door */
cave_alter_feat(y, x, FF_OPEN);
- /* Update some things */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
-
/* Sound */
sound(SOUND_OPENDOOR);
/* Open the door */
cave_alter_feat(y, x, FF_OPEN);
- /* Update some things */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
-
/* Sound */
sound(SOUND_OPENDOOR);
}
o_idx = chest_check(y, x);
/* Nothing useful */
- if (!is_closed_door(feat) && !o_idx)
+ if (!have_flag(f_info[feat].flags, FF_OPEN) && !o_idx)
{
/* Message */
#ifdef JP
/* Open door */
if (have_flag(f_info[old_feat].flags, FF_CLOSE))
{
+ s16b closed_feat = feat_state(old_feat, FF_CLOSE);
+
/* Hack -- object in the way */
- if ((c_ptr->o_idx || (c_ptr->info & CAVE_OBJECT)) && (feat_state(old_feat, FF_CLOSE) != old_feat))
+ if ((c_ptr->o_idx || (c_ptr->info & CAVE_OBJECT)) &&
+ (closed_feat != old_feat) && !have_flag(f_info[closed_feat].flags, FF_DROP))
{
/* Message */
#ifdef JP
}
else
{
- /* Update some things */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
-
/* Sound */
sound(SOUND_SHUTDOOR);
}
}
/* Must be a wall/door/etc */
- if (!have_flag(f_flags_grid(c_ptr), FF_TUNNEL))
+ if (!cave_have_flag_grid(c_ptr, FF_TUNNEL))
{
/* Message */
#ifdef JP
static bool do_cmd_tunnel_aux(int y, int x)
{
cave_type *c_ptr;
- s16b mimic_feat;
feature_type *f_ptr, *mimic_f_ptr;
int power;
cptr name;
power = f_ptr->power;
/* Feature code (applying "mimic" field) */
- mimic_feat = get_feat_mimic(c_ptr);
- mimic_f_ptr = &f_info[mimic_feat];
+ mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
name = f_name + mimic_f_ptr->name;
if (have_flag(f_ptr->flags, FF_PERMANENT))
{
/* Titanium */
- if (!mimic_feat || have_flag(mimic_f_ptr->flags, FF_PERMANENT))
+ if (have_flag(mimic_f_ptr->flags, FF_PERMANENT))
{
#ifdef JP
msg_print("¤³¤Î´ä¤Ï¹Å¤¹¤®¤Æ·¡¤ì¤Ê¤¤¤è¤¦¤À¡£");
cave_alter_feat(y, x, FF_TUNNEL);
/* Update some things */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
+ p_ptr->update |= (PU_FLOW);
}
else
{
{
#ifdef JP
if (tree) msg_format("%s¤òÀÚ¤êʧ¤Ã¤¿¡£", name);
- else msg_print("·ê¤ò·¡¤ê½ª¤¨¤¿¡£");
+ else
+ {
+ msg_print("·ê¤ò·¡¤ê½ª¤¨¤¿¡£");
+ p_ptr->update |= (PU_FLOW);
+ }
#else
if (tree) msg_format("You have cleared away the %s.", name);
- else msg_print("You have finished the tunnel.");
+ else
+ {
+ msg_print("You have finished the tunnel.");
+ p_ptr->update |= (PU_FLOW);
+ }
#endif
/* Remove the feature */
cave_alter_feat(y, x, FF_TUNNEL);
- /* Update some things */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
-
chg_virtue(V_DILIGENCE, 1);
chg_virtue(V_NATURE, -1);
}
{
/* Stuck */
#ifdef JP
- msg_print("¥É¥¢¤Ï¤¬¤Ã¤Á¤ê¤ÈÊĤ¸¤é¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
+ msg_format("%s¤Ï¤¬¤Ã¤Á¤ê¤ÈÊĤ¸¤é¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£", f_name + f_info[get_feat_mimic(c_ptr)].name);
#else
- msg_print("The door appears to be stuck.");
+ msg_format("The %s appears to be stuck.", f_name + f_info[get_feat_mimic(c_ptr)].name);
#endif
}
msg_print("You have picked the lock.");
#endif
-
/* Open the door */
cave_alter_feat(y, x, FF_OPEN);
- /* Update some things */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
-
/* Sound */
sound(SOUND_OPENDOOR);
/* Open the door */
cave_alter_feat(y, x, FF_OPEN);
- /* Update some things */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
-
/* Sound */
sound(SOUND_OPENDOOR);
}
if (j < 2) j = 2;
/* Must find the trap first. */
- if (!object_known_p(o_ptr))
+ if (!object_is_known(o_ptr))
{
#ifdef JP
msg_print("¥È¥é¥Ã¥×¤¬¸«¤¢¤¿¤é¤Ê¤¤¡£");
{
/* Get grid */
cave_type *c_ptr = &cave[y][x];
- feature_type *f_ptr = &f_info[c_ptr->feat];
/* Hack -- Bash power based on strength */
/* (Ranges from 3 to 20 to 100 to 200) */
int bash = adj_str_blow[p_ptr->stat_ind[A_STR]];
/* Extract door power */
- int temp = f_ptr->power;
+ int temp = f_info[c_ptr->feat].power;
bool more = FALSE;
+ cptr name = f_name + f_info[get_feat_mimic(c_ptr)].name;
+
/* Take a turn */
energy_use = 100;
/* Message */
#ifdef JP
- msg_print("¥É¥¢¤ËÂÎÅö¤¿¤ê¤ò¤·¤¿¡ª");
+ msg_format("%s¤ËÂÎÅö¤¿¤ê¤ò¤·¤¿¡ª", name);
#else
- msg_print("You smash into the door!");
+ msg_format("You smash into the %s!", name);
#endif
/* Compare bash power to door power XXX XXX XXX */
{
/* Message */
#ifdef JP
- msg_print("¥É¥¢¤ò²õ¤·¤¿¡ª");
+ msg_format("%s¤ò²õ¤·¤¿¡ª", name);
#else
- msg_print("The door crashes open!");
+ msg_format("The %s crashes open!", name);
#endif
/* Break down the door */
- if (randint0(100) < 50)
+ if ((randint0(100) < 50) || (feat_state(c_ptr->feat, FF_OPEN) == c_ptr->feat))
{
cave_alter_feat(y, x, FF_BASH);
}
/* Hack -- Fall through the door */
move_player(dir, FALSE, FALSE);
-
- /* Update some things */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
- p_ptr->update |= (PU_DISTANCE);
}
/* Saving throw against stun */
{
/* Message */
#ifdef JP
- msg_print("¤³¤Î¥É¥¢¤Ï´è¾æ¤À¡£");
+ msg_format("¤³¤Î%s¤Ï´è¾æ¤À¡£", name);
#else
- msg_print("The door holds firm.");
+ msg_format("The %s holds firm.", name);
#endif
/* Successful jamming */
#ifdef JP
- msg_print("¥É¥¢¤Ë¤¯¤µ¤Ó¤òÂǤÁ¹þ¤ó¤À¡£");
+ msg_format("%s¤Ë¤¯¤µ¤Ó¤òÂǤÁ¹þ¤ó¤À¡£", f_name + f_info[feat].name);
#else
- msg_print("You jam the door with a spike.");
+ msg_format("You jam the %s with a spike.", f_name + f_info[feat].name);
#endif
cave_alter_feat(y, x, FF_SPIKE);
/*
* Support code for the "Walk" and "Jump" commands
*/
-void do_cmd_walk(int pickup)
+void do_cmd_walk(bool pickup)
{
int dir;
}
/* Hack again -- Is there a special encounter ??? */
- if (p_ptr->wild_mode && !have_flag(f_flags_bold(py, px), FF_TOWN))
+ if (p_ptr->wild_mode && !cave_have_flag_bold(py, px, FF_TOWN))
{
int tmp = 120 + p_ptr->lev*10 - wilderness[py][px].level + 5;
if (tmp < 1)
* Stay still. Search. Enter stores.
* Pick up treasure if "pickup" is true.
*/
-void do_cmd_stay(int pickup)
+void do_cmd_stay(bool pickup)
{
- cave_type *c_ptr = &cave[py][px];
- feature_type *f_ptr = &f_info[c_ptr->feat];
+ u32b mpe_mode = MPE_STAYING | MPE_ENERGY_USE;
/* Allow repeated command */
if (command_arg)
command_arg = 0;
}
-
/* Take a turn */
energy_use = 100;
-
- /* Spontaneous Searching */
- if ((p_ptr->skill_fos >= 50) || (0 == randint0(50 - p_ptr->skill_fos)))
- {
- search();
- }
-
- /* Continuous Searching */
- if (p_ptr->action == ACTION_SEARCH)
- {
- search();
- }
-
-
- /* Handle "objects" */
- carry(pickup);
-
-
- /* Hack -- enter a store if we are on one */
- if (have_flag(f_ptr->flags, FF_STORE))
- {
- /* Disturb */
- disturb(0, 0);
-
- energy_use = 0;
- /* Hack -- enter store */
- command_new = SPECIAL_KEY_STORE;
- }
-
- /* Hack -- enter a building if we are on one -KMW- */
- else if (have_flag(f_ptr->flags, FF_BLDG))
- {
- /* Disturb */
- disturb(0, 0);
-
- energy_use = 0;
- /* Hack -- enter building */
- command_new = SPECIAL_KEY_BUILDING;
- }
-
- /* Exit a quest if reach the quest exit */
- else if (have_flag(f_ptr->flags, FF_QUEST_EXIT))
- {
- int q_index = p_ptr->inside_quest;
-
- /* Was quest completed? */
- if (quest[q_index].type == QUEST_TYPE_FIND_EXIT)
- {
- quest[q_index].status = QUEST_STATUS_COMPLETED;
- quest[q_index].complev = (byte)p_ptr->lev;
-#ifdef JP
- msg_print("¥¯¥¨¥¹¥È¤ò´°Î»¤·¤¿¡ª");
-#else
- msg_print("You accomplished your quest!");
-#endif
-
- msg_print(NULL);
- }
-
- leave_quest_check();
-
- p_ptr->inside_quest = cave[py][px].special;
- dun_level = 0;
- p_ptr->oldpx = 0;
- p_ptr->oldpy = 0;
-
- p_ptr->leaving = TRUE;
- }
+ if (pickup) mpe_mode |= MPE_DO_PICKUP;
+ (void)move_player_effect(py, px, mpe_mode);
}
if ((have_flag(flgs, TR_SLAY_ANIMAL)) &&
(r_ptr->flags3 & RF3_ANIMAL))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_ANIMAL;
}
if ((have_flag(flgs, TR_KILL_ANIMAL)) &&
(r_ptr->flags3 & RF3_ANIMAL))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_ANIMAL;
}
if ((have_flag(flgs, TR_SLAY_EVIL)) &&
(r_ptr->flags3 & RF3_EVIL))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_EVIL;
}
if ((have_flag(flgs, TR_KILL_EVIL)) &&
(r_ptr->flags3 & RF3_EVIL))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_EVIL;
}
if ((have_flag(flgs, TR_SLAY_HUMAN)) &&
(r_ptr->flags2 & RF2_HUMAN))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags2 |= RF2_HUMAN;
}
if ((have_flag(flgs, TR_KILL_HUMAN)) &&
(r_ptr->flags2 & RF2_HUMAN))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags2 |= RF2_HUMAN;
}
if ((have_flag(flgs, TR_SLAY_UNDEAD)) &&
(r_ptr->flags3 & RF3_UNDEAD))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_UNDEAD;
}
if ((have_flag(flgs, TR_KILL_UNDEAD)) &&
(r_ptr->flags3 & RF3_UNDEAD))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_UNDEAD;
}
if ((have_flag(flgs, TR_SLAY_DEMON)) &&
(r_ptr->flags3 & RF3_DEMON))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_DEMON;
}
if ((have_flag(flgs, TR_KILL_DEMON)) &&
(r_ptr->flags3 & RF3_DEMON))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_DEMON;
}
if ((have_flag(flgs, TR_SLAY_ORC)) &&
(r_ptr->flags3 & RF3_ORC))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_ORC;
}
if ((have_flag(flgs, TR_KILL_ORC)) &&
(r_ptr->flags3 & RF3_ORC))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_ORC;
}
if ((have_flag(flgs, TR_SLAY_TROLL)) &&
(r_ptr->flags3 & RF3_TROLL))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_TROLL;
}
if ((have_flag(flgs, TR_KILL_TROLL)) &&
(r_ptr->flags3 & RF3_TROLL))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_TROLL;
}
if ((have_flag(flgs, TR_SLAY_GIANT)) &&
(r_ptr->flags3 & RF3_GIANT))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_GIANT;
}
if ((have_flag(flgs, TR_KILL_GIANT)) &&
(r_ptr->flags3 & RF3_GIANT))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_GIANT;
}
if ((have_flag(flgs, TR_SLAY_DRAGON)) &&
(r_ptr->flags3 & RF3_DRAGON))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_DRAGON;
}
if ((have_flag(flgs, TR_KILL_DRAGON)) &&
(r_ptr->flags3 & RF3_DRAGON))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_DRAGON;
}
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK)
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK);
}
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK)
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK);
}
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK);
}
if (r_ptr->flags3 & RF3_HURT_FIRE)
{
if (mult < 25) mult = 25;
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_HURT_FIRE;
}
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK)
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK);
}
if (r_ptr->flags3 & RF3_HURT_COLD)
{
if (mult < 25) mult = 25;
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_HURT_COLD;
}
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK)
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK);
}
void do_cmd_fire_aux(int item, object_type *j_ptr)
{
int dir;
- int j, y, x, ny, nx, ty, tx;
+ int j, y, x, ny, nx, ty, tx, prev_y, prev_x;
int tdam, tdis, thits, tmul;
int bonus, chance;
int cur_dis, visible;
return;
}
+ /* Start at the player */
+ y = py;
+ x = px;
+
+ /* Predict the "target" location */
+ tx = px + 99 * ddx[dir];
+ ty = py + 99 * ddy[dir];
+
+ /* Check for "target request" */
+ if ((dir == 5) && target_okay())
+ {
+ tx = target_col;
+ ty = target_row;
+ }
+
+ project_length = 0; /* reset to default */
+
+ /* Don't shoot at my feet */
+ if (tx == px && ty == py)
+ {
+ energy_use = 0;
+
+ /* project_length is already reset to 0 */
+
+ return;
+ }
+
+
/* Get local object */
q_ptr = &forge;
energy_use = (energy_use / thits);
- /* Start at the player */
- y = py;
- x = px;
-
- /* Predict the "target" location */
- tx = px + 99 * ddx[dir];
- ty = py + 99 * ddy[dir];
-
- /* Check for "target request" */
- if ((dir == 5) && target_okay())
- {
- tx = target_col;
- ty = target_row;
- }
-
- project_length = 0; /* reset to default */
-
/* Hack -- Handle stuff */
handle_stuff();
+ /* Save the old location */
+ prev_y = y;
+ prev_x = x;
/* Travel until stopped */
for (cur_dis = 0; cur_dis <= tdis; )
mmove2(&ny, &nx, py, px, ty, tx);
/* Stopped by walls/doors */
- if (!have_flag(f_flags_bold(ny, nx), FF_PROJECT) && !cave[ny][nx].m_idx) break;
+ if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !cave[ny][nx].m_idx) break;
/* Advance the distance */
cur_dis++;
Term_xtra(TERM_XTRA_DELAY, msec);
}
+ /* Save the old location */
+ prev_y = y;
+ prev_x = x;
+
/* Save the new location */
x = nx;
y = ny;
else
{
/* STICK TO */
- if (q_ptr->name1)
+ if (object_is_fixed_artifact(q_ptr))
{
char m_name[80];
/* Chance of breakage (during attacks) */
j = (hit_body ? breakage_chance(q_ptr) : 0);
- if(stick_to)
+ if (stick_to)
{
int m_idx = cave[y][x].m_idx;
monster_type *m_ptr = &m_list[m_idx];
int o_idx = o_pop();
if (!o_idx)
- {
+ {
#ifdef JP
- msg_format("%s¤Ï¤É¤³¤«¤Ø¹Ô¤Ã¤¿¡£", o_name);
+ msg_format("%s¤Ï¤É¤³¤«¤Ø¹Ô¤Ã¤¿¡£", o_name);
#else
- msg_format("The %s have gone to somewhere.", o_name);
+ msg_format("The %s have gone to somewhere.", o_name);
#endif
- if (q_ptr->name1)
- {
- a_info[j_ptr->name1].cur_num = 0;
- }
- return;
- }
-
- o_ptr = &o_list[ o_idx ];
+ if (object_is_fixed_artifact(q_ptr))
+ {
+ a_info[j_ptr->name1].cur_num = 0;
+ }
+ return;
+ }
+
+ o_ptr = &o_list[o_idx];
object_copy(o_ptr, q_ptr);
/* Forget mark */
/* Carry object */
m_ptr->hold_o_idx = o_idx;
-
}
- else
+ else if (cave_have_flag_bold(y, x, FF_PROJECT))
+ {
/* Drop (or break) near that location */
(void)drop_near(q_ptr, j, y, x);
+ }
+ else
+ {
+ /* Drop (or break) near that location */
+ (void)drop_near(q_ptr, j, prev_y, prev_x);
+ }
}
bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
{
int dir, item;
- int i, j, y, x, ty, tx;
+ int i, j, y, x, ty, tx, prev_y, prev_x;
int ny[19], nx[19];
int chance, tdam, tdis;
int mul, div;
}
else if (boomerang)
{
- if (buki_motteruka(INVEN_LARM))
+ if (buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
{
item_tester_hook = item_tester_hook_boomerang;
#ifdef JP
return FALSE;
}
}
- else
- {
- item = INVEN_RARM;
- }
+ else if (buki_motteruka(INVEN_LARM)) item = INVEN_LARM;
+ else item = INVEN_RARM;
}
else
{
/* Item is cursed */
- if (cursed_p(o_ptr) && (item >= INVEN_RARM))
+ if (object_is_cursed(o_ptr) && (item >= INVEN_RARM))
{
/* Oops */
#ifdef JP
if (shuriken) chance *= 2;
+ /* Save the old location */
+ prev_y = y;
+ prev_x = x;
+
/* Travel until stopped */
for (cur_dis = 0; cur_dis <= tdis; )
{
mmove2(&ny[cur_dis], &nx[cur_dis], py, px, ty, tx);
/* Stopped by walls/doors */
- if (!have_flag(f_flags_bold(ny[cur_dis], nx[cur_dis]), FF_PROJECT))
+ if (!cave_have_flag_bold(ny[cur_dis], nx[cur_dis], FF_PROJECT))
{
hit_wall = TRUE;
- break;
+ if ((q_ptr->tval == TV_FIGURINE) || object_is_potion(q_ptr) || !cave[ny[cur_dis]][nx[cur_dis]].m_idx) break;
}
- /* Advance the distance */
- cur_dis++;
-
/* The player can see the (on screen) missile */
- if (panel_contains(ny[cur_dis-1], nx[cur_dis-1]) && player_can_see_bold(ny[cur_dis-1], nx[cur_dis-1]))
+ if (panel_contains(ny[cur_dis], nx[cur_dis]) && player_can_see_bold(ny[cur_dis], nx[cur_dis]))
{
char c = object_char(q_ptr);
byte a = object_attr(q_ptr);
/* Draw, Hilite, Fresh, Pause, Erase */
- print_rel(c, a, ny[cur_dis-1], nx[cur_dis-1]);
- move_cursor_relative(ny[cur_dis-1], nx[cur_dis-1]);
+ print_rel(c, a, ny[cur_dis], nx[cur_dis]);
+ move_cursor_relative(ny[cur_dis], nx[cur_dis]);
Term_fresh();
Term_xtra(TERM_XTRA_DELAY, msec);
- lite_spot(ny[cur_dis-1], nx[cur_dis-1]);
+ lite_spot(ny[cur_dis], nx[cur_dis]);
Term_fresh();
}
Term_xtra(TERM_XTRA_DELAY, msec);
}
+ /* Save the old location */
+ prev_y = y;
+ prev_x = x;
+
/* Save the new location */
- x = nx[cur_dis-1];
- y = ny[cur_dis-1];
+ x = nx[cur_dis];
+ y = ny[cur_dis];
+ /* Advance the distance */
+ cur_dis++;
/* Monster here, Try to hit it */
if (cave[y][x].m_idx)
j = 100;
if (!(summon_named_creature(0, y, x, q_ptr->pval,
- !(cursed_p(q_ptr)) ? PM_FORCE_PET : 0L)))
+ !(object_is_cursed(q_ptr)) ? PM_FORCE_PET : 0L)))
#ifdef JP
msg_print("¿Í·Á¤ÏDZ¤¸¶Ê¤¬¤êºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
#else
msg_print("The Figurine writhes and then shatters.");
#endif
- else if (cursed_p(q_ptr))
+ else if (object_is_cursed(q_ptr))
#ifdef JP
msg_print("¤³¤ì¤Ï¤¢¤Þ¤êÎɤ¯¤Ê¤¤µ¤¤¬¤¹¤ë¡£");
#else
if((back_chance > 30) && (!one_in_(100) || super_boomerang))
{
- for (i = cur_dis-1;i>0;i--)
+ for (i = cur_dis - 1; i > 0; i--)
{
if (panel_contains(ny[i], nx[i]) && player_can_see_bold(ny[i], nx[i]))
{
}
/* Drop (or break) near that location */
- if (do_drop) (void)drop_near(q_ptr, j, y, x);
+ if (do_drop)
+ {
+ if (cave_have_flag_bold(y, x, FF_PROJECT))
+ {
+ /* Drop (or break) near that location */
+ (void)drop_near(q_ptr, j, y, x);
+ }
+ else
+ {
+ /* Drop (or break) near that location */
+ (void)drop_near(q_ptr, j, prev_y, prev_x);
+ }
+ }
return TRUE;
}