#include "angband.h"
#include "chest.h"
+#include "floor.h"
+#include "melee.h"
#include "object-hook.h"
+#include "projection.h"
/*!
* @brief フロア脱出時に出戻りが不可能だった場合に警告を加える処理
{
/* Set repeat count */
command_rep = command_arg - 1;
-
- /* Redraw the state */
p_ptr->redraw |= (PR_STATE);
/* Cancel the arg */
static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
{
cave_type *c_ptr = &cave[y][x];
-
OBJECT_IDX this_o_idx, next_o_idx = 0;
-
/* Scan all objects in the grid */
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 */
next_o_idx = o_ptr->next_o_idx;
/* Skip unknown chests XXX XXX */
return (this_o_idx);
}
}
-
- /* No chest */
return (0);
}
/* Let the Chest drop items */
chest_death(FALSE, y, x, o_idx);
}
-
- /* Result */
return (more);
}
-
-#if defined(ALLOW_EASY_DISARM) /* TNB */
-
/*!
* @brief 地形は開くものであって、かつ開かれているかを返す /
* Attempt to open the given chest at the given location
return d[dx + 1][dy + 1];
}
-#endif /* defined(ALLOW_EASY_DISARM) -- TNB */
-
-
/*!
* @brief 「開ける」動作コマンドのサブルーチン /
* Perform the basic "open" command on doors
sound(SOUND_OPENDOOR);
}
-
- /* Result */
return (more);
}
bool more = FALSE;
+ if (p_ptr->wild_mode) return;
+
if (p_ptr->special_defense & KATA_MUSOU)
{
set_action(ACTION_NONE);
{
/* Set repeat count */
command_rep = command_arg - 1;
-
- /* Redraw the state */
p_ptr->redraw |= (PR_STATE);
/* Cancel the arg */
else if (c_ptr->m_idx && p_ptr->riding != c_ptr->m_idx)
{
p_ptr->energy_use = 100;
-
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
-
- /* Attack */
py_attack(y, x, 0);
}
*/
static bool do_cmd_close_aux(POSITION y, POSITION x)
{
- /* Get grid and contents */
cave_type *c_ptr = &cave[y][x];
FEAT_IDX old_feat = c_ptr->feat;
bool more = FALSE;
}
}
}
-
- /* Result */
return (more);
}
bool more = FALSE;
+ if (p_ptr->wild_mode) return;
+
if (p_ptr->special_defense & KATA_MUSOU)
{
set_action(ACTION_NONE);
{
/* Set repeat count */
command_rep = command_arg - 1;
-
- /* Redraw the state */
p_ptr->redraw |= (PR_STATE);
/* Cancel the arg */
cave_type *c_ptr;
FEAT_IDX feat;
- /* Get requested location */
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
-
- /* Get grid and contents */
c_ptr = &cave[y][x];
/* Feature code (applying "mimic" field) */
cave_type *c_ptr;
feature_type *f_ptr, *mimic_f_ptr;
int power;
- cptr name;
+ concptr name;
bool more = FALSE;
/* Verify legality */
/* Occasional Search XXX XXX */
if (randint0(100) < 25) search();
}
-
- /* Result */
return more;
}
{
/* Set repeat count */
command_rep = command_arg - 1;
-
- /* Redraw the state */
p_ptr->redraw |= (PR_STATE);
/* Cancel the arg */
sound(SOUND_OPENDOOR);
}
-
- /* Result */
return (TRUE);
}
sound(SOUND_FAIL);
chest_trap(y, x, o_idx);
}
-
- /* Result */
return (more);
}
* Returns TRUE if repeated commands may continue
* </pre>
*/
-#ifdef ALLOW_EASY_DISARM /* TNB */
bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir)
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-static bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir)
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
{
- /* Get grid and contents */
cave_type *c_ptr = &cave[y][x];
/* Get feature */
feature_type *f_ptr = &f_info[c_ptr->feat];
/* Access trap name */
- cptr name = (f_name + f_ptr->name);
+ concptr name = (f_name + f_ptr->name);
/* Extract trap "power" */
int power = f_ptr->power;
/* Remove the trap */
cave_alter_feat(y, x, FF_DISARM);
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
/* Move the player onto the trap */
move_player(dir, easy_disarm, FALSE);
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
- /* move the player onto the trap grid */
- move_player(dir, FALSE, FALSE);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
}
/* Failure -- Keep trying */
else
{
msg_format(_("%sを作動させてしまった!", "You set off the %s!"), name);
-
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
/* Move the player onto the trap */
move_player(dir, easy_disarm, FALSE);
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
- /* Move the player onto the trap */
- move_player(dir, FALSE, FALSE);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
}
-
- /* Result */
return (more);
}
{
POSITION y, x;
DIRECTION dir;
- s16b o_idx;
+ OBJECT_IDX o_idx;
bool more = FALSE;
+ if (p_ptr->wild_mode) return;
+
if (p_ptr->special_defense & KATA_MUSOU)
{
set_action(ACTION_NONE);
}
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
/* Option: Pick a direction */
if (easy_disarm)
{
}
}
-#endif /* ALLOW_EASY_DISARM -- TNB */
/* Allow repeated command */
if (command_arg)
{
/* Set repeat count */
command_rep = command_arg - 1;
-
- /* Redraw the state */
p_ptr->redraw |= (PR_STATE);
/* Cancel the arg */
cave_type *c_ptr;
FEAT_IDX feat;
- /* Get location */
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
-
- /* Get grid and contents */
c_ptr = &cave[y][x];
/* Feature code (applying "mimic" field) */
/* Disarm chest */
else if (o_idx)
{
- /* Disarm the chest */
more = do_cmd_disarm_chest(y, x, o_idx);
}
/* Disarm trap */
else
{
- /* Disarm the trap */
more = do_cmd_disarm_aux(y, x, dir);
}
}
bool more = FALSE;
- cptr name = f_name + f_info[get_feat_mimic(c_ptr)].name;
+ concptr name = f_name + f_info[get_feat_mimic(c_ptr)].name;
p_ptr->energy_use = 100;
/* Hack -- Lose balance ala paralysis */
(void)set_paralyzed(p_ptr->paralyzed + 2 + randint0(2));
}
-
- /* Result */
return (more);
}
*/
void do_cmd_bash(void)
{
- int y, x, dir;
-
+ int y, x, dir;
cave_type *c_ptr;
-
bool more = FALSE;
+ if (p_ptr->wild_mode) return;
if (p_ptr->special_defense & KATA_MUSOU)
{
{
/* Set repeat count */
command_rep = command_arg - 1;
-
- /* Redraw the state */
p_ptr->redraw |= (PR_STATE);
/* Cancel the arg */
*/
void do_cmd_alter(void)
{
- int y, x, dir;
-
- cave_type *c_ptr;
-
- bool more = FALSE;
-
+ POSITION y, x;
+ DIRECTION dir;
+ cave_type *c_ptr;
+ bool more = FALSE;
if (p_ptr->special_defense & KATA_MUSOU)
{
{
/* Set repeat count */
command_rep = command_arg - 1;
-
- /* Redraw the state */
p_ptr->redraw |= (PR_STATE);
/* Cancel the arg */
FEAT_IDX feat;
feature_type *f_ptr;
- /* Get location */
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
p_ptr->energy_use = 100;
- /* Attack monsters */
if (c_ptr->m_idx)
{
- /* Attack */
py_attack(y, x, 0);
}
{
DIRECTION dir;
+ if (p_ptr->wild_mode) return;
+
if (p_ptr->special_defense & KATA_MUSOU)
{
set_action(ACTION_NONE);
}
/* Get a "repeated" direction */
- if (get_rep_dir(&dir,FALSE))
+ if (get_rep_dir(&dir, FALSE))
{
POSITION y, x;
INVENTORY_IDX item;
cave_type *c_ptr;
FEAT_IDX feat;
- /* Get location */
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
-
- /* Get grid and contents */
c_ptr = &cave[y][x];
/* Feature code (applying "mimic" field) */
{
/* Set repeat count */
command_rep = command_arg - 1;
-
- /* Redraw the state */
p_ptr->redraw |= (PR_STATE);
/* Cancel the arg */
{
/* Set repeat count */
command_rep = command_arg - 1;
-
- /* Redraw the state */
p_ptr->redraw |= (PR_STATE);
/* Cancel the arg */
/* Prompt for time if needed */
if (command_arg <= 0)
{
- cptr p = _("休憩 (0-9999, '*' で HP/MP全快, '&' で必要なだけ): ",
+ concptr p = _("休憩 (0-9999, '*' で HP/MP全快, '&' で必要なだけ): ",
"Rest (0-9999, '*' for HP/SP, '&' as needed): ");
p_ptr->energy_use = 100;
/* The sin of sloth */
- if (command_arg > 100)
- chg_virtue(V_DILIGENCE, -1);
+ if (command_arg > 100) chg_virtue(V_DILIGENCE, -1);
/* Why are you sleeping when there's no need? WAKE UP!*/
if ((p_ptr->chp == p_ptr->mhp) &&
/* Save the rest code */
resting = command_arg;
p_ptr->action = ACTION_REST;
-
- /* Recalculate bonuses */
p_ptr->update |= (PU_BONUS);
+ update_creature(p_ptr);
- /* Redraw the state */
p_ptr->redraw |= (PR_STATE);
+ update_output();
- /* Handle stuff */
- handle_stuff();
-
- /* Refresh */
Term_fresh();
}
monster_race *r_ptr = &r_info[m_ptr->r_idx];
BIT_FLAGS flgs[TR_FLAG_SIZE];
-
- /* Extract the flags */
object_flags(o_ptr, flgs);
/* Some "weapons" and "ammo" do extra damage */
case TV_ARROW:
case TV_BOLT:
{
- /* Slay Animal */
- if ((have_flag(flgs, TR_SLAY_ANIMAL)) &&
- (r_ptr->flags3 & RF3_ANIMAL))
+ if ((have_flag(flgs, TR_SLAY_ANIMAL)) && (r_ptr->flags3 & RF3_ANIMAL))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_ANIMAL;
}
-
if (mult < 17) mult = 17;
}
- /* Kill Animal */
- if ((have_flag(flgs, TR_KILL_ANIMAL)) &&
- (r_ptr->flags3 & RF3_ANIMAL))
+ if ((have_flag(flgs, TR_KILL_ANIMAL)) && (r_ptr->flags3 & RF3_ANIMAL))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_ANIMAL;
}
-
if (mult < 27) mult = 27;
}
- /* Slay Evil */
- if ((have_flag(flgs, TR_SLAY_EVIL)) &&
- (r_ptr->flags3 & RF3_EVIL))
+ if ((have_flag(flgs, TR_SLAY_EVIL)) && (r_ptr->flags3 & RF3_EVIL))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_EVIL;
}
-
if (mult < 15) mult = 15;
}
- /* Kill Evil */
- if ((have_flag(flgs, TR_KILL_EVIL)) &&
- (r_ptr->flags3 & RF3_EVIL))
+ if ((have_flag(flgs, TR_KILL_EVIL)) && (r_ptr->flags3 & RF3_EVIL))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_EVIL;
}
-
if (mult < 25) mult = 25;
}
- /* Slay Human */
- if ((have_flag(flgs, TR_SLAY_HUMAN)) &&
- (r_ptr->flags2 & RF2_HUMAN))
+ if ((have_flag(flgs, TR_SLAY_HUMAN)) && (r_ptr->flags2 & RF2_HUMAN))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags2 |= RF2_HUMAN;
}
-
if (mult < 17) mult = 17;
}
- /* Kill Human */
- if ((have_flag(flgs, TR_KILL_HUMAN)) &&
- (r_ptr->flags2 & RF2_HUMAN))
+ if ((have_flag(flgs, TR_KILL_HUMAN)) && (r_ptr->flags2 & RF2_HUMAN))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags2 |= RF2_HUMAN;
}
-
if (mult < 27) mult = 27;
}
- /* Slay Undead */
- if ((have_flag(flgs, TR_SLAY_UNDEAD)) &&
- (r_ptr->flags3 & RF3_UNDEAD))
+ if ((have_flag(flgs, TR_SLAY_UNDEAD)) && (r_ptr->flags3 & RF3_UNDEAD))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_UNDEAD;
}
-
if (mult < 20) mult = 20;
}
- /* Kill Undead */
- if ((have_flag(flgs, TR_KILL_UNDEAD)) &&
- (r_ptr->flags3 & RF3_UNDEAD))
+ if ((have_flag(flgs, TR_KILL_UNDEAD)) && (r_ptr->flags3 & RF3_UNDEAD))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_UNDEAD;
}
-
if (mult < 30) mult = 30;
}
- /* Slay Demon */
- if ((have_flag(flgs, TR_SLAY_DEMON)) &&
- (r_ptr->flags3 & RF3_DEMON))
+ if ((have_flag(flgs, TR_SLAY_DEMON)) && (r_ptr->flags3 & RF3_DEMON))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_DEMON;
}
-
if (mult < 20) mult = 20;
}
- /* Kill Demon */
- if ((have_flag(flgs, TR_KILL_DEMON)) &&
- (r_ptr->flags3 & RF3_DEMON))
+ if ((have_flag(flgs, TR_KILL_DEMON)) && (r_ptr->flags3 & RF3_DEMON))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_DEMON;
}
-
if (mult < 30) mult = 30;
}
- /* Slay Orc */
- if ((have_flag(flgs, TR_SLAY_ORC)) &&
- (r_ptr->flags3 & RF3_ORC))
+ if ((have_flag(flgs, TR_SLAY_ORC)) && (r_ptr->flags3 & RF3_ORC))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_ORC;
}
-
if (mult < 20) mult = 20;
}
- /* Kill Orc */
- if ((have_flag(flgs, TR_KILL_ORC)) &&
- (r_ptr->flags3 & RF3_ORC))
+ if ((have_flag(flgs, TR_KILL_ORC)) && (r_ptr->flags3 & RF3_ORC))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_ORC;
}
-
if (mult < 30) mult = 30;
}
- /* Slay Troll */
- if ((have_flag(flgs, TR_SLAY_TROLL)) &&
- (r_ptr->flags3 & RF3_TROLL))
+ if ((have_flag(flgs, TR_SLAY_TROLL)) && (r_ptr->flags3 & RF3_TROLL))
{
if (is_original_ap_and_seen(m_ptr))
{
if (mult < 20) mult = 20;
}
- /* Kill Troll */
- if ((have_flag(flgs, TR_KILL_TROLL)) &&
- (r_ptr->flags3 & RF3_TROLL))
+ if ((have_flag(flgs, TR_KILL_TROLL)) && (r_ptr->flags3 & RF3_TROLL))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_TROLL;
}
-
if (mult < 30) mult = 30;
}
- /* Slay Giant */
- if ((have_flag(flgs, TR_SLAY_GIANT)) &&
- (r_ptr->flags3 & RF3_GIANT))
+ if ((have_flag(flgs, TR_SLAY_GIANT)) && (r_ptr->flags3 & RF3_GIANT))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_GIANT;
}
-
if (mult < 20) mult = 20;
}
- /* Kill Giant */
- if ((have_flag(flgs, TR_KILL_GIANT)) &&
- (r_ptr->flags3 & RF3_GIANT))
+ if ((have_flag(flgs, TR_KILL_GIANT)) && (r_ptr->flags3 & RF3_GIANT))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_GIANT;
}
-
if (mult < 30) mult = 30;
}
- /* Slay Dragon */
- if ((have_flag(flgs, TR_SLAY_DRAGON)) &&
- (r_ptr->flags3 & RF3_DRAGON))
+ if ((have_flag(flgs, TR_SLAY_DRAGON)) && (r_ptr->flags3 & RF3_DRAGON))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_DRAGON;
}
-
if (mult < 20) mult = 20;
}
- /* Execute Dragon */
- if ((have_flag(flgs, TR_KILL_DRAGON)) &&
- (r_ptr->flags3 & RF3_DRAGON))
+ if ((have_flag(flgs, TR_KILL_DRAGON)) && (r_ptr->flags3 & RF3_DRAGON))
{
if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_DRAGON;
}
-
if (mult < 30) mult = 30;
-
- if ((o_ptr->name1 == ART_BARD_ARROW) &&
- (m_ptr->r_idx == MON_SMAUG) &&
+ if ((o_ptr->name1 == ART_BARD_ARROW) && (m_ptr->r_idx == MON_SMAUG) &&
(inventory[INVEN_BOW].name1 == ART_BARD))
mult *= 5;
}
- /* Brand (Acid) */
if (have_flag(flgs, TR_BRAND_ACID))
{
/* Notice immunity */
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK);
}
}
-
- /* Otherwise, take the damage */
else
{
if (mult < 17) mult = 17;
}
}
- /* Brand (Elec) */
if (have_flag(flgs, TR_BRAND_ELEC))
{
/* Notice immunity */
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK);
}
}
-
- /* Otherwise, take the damage */
else
{
if (mult < 17) mult = 17;
}
}
- /* Brand (Fire) */
if (have_flag(flgs, TR_BRAND_FIRE))
{
/* Notice immunity */
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK);
}
}
-
/* Otherwise, take the damage */
else
{
}
}
- /* Brand (Cold) */
if (have_flag(flgs, TR_BRAND_COLD))
{
/* Notice immunity */
}
}
- /* Brand (Poison) */
if (have_flag(flgs, TR_BRAND_POIS))
{
/* Notice immunity */
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK);
}
}
-
/* Otherwise, take the damage */
else
{
bool hit_body = FALSE;
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
u16b path_g[512]; /* For calcuration of path length */
/* Sniper - Cannot shot a single arrow twice */
if ((snipe_type == SP_DOUBLE) && (o_ptr->number < 2)) snipe_type = SP_NONE;
- /* Describe the object */
object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
/* Use the proper number of shots */
/* Start at the player */
y = p_ptr->y;
x = p_ptr->x;
-
- /* Get local object */
q_ptr = &forge;
/* Obtain a local object */
}
sound(SOUND_SHOOT);
-
- /* Hack -- Handle stuff */
handle_stuff();
/* Save the old location */
if (c_ptr->info & (CAVE_MARK)) msg_print(_("岩が砕け散った。", "Wall rocks were shattered."));
/* Forget the wall */
c_ptr->info &= ~(CAVE_MARK);
-
p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
/* Destroy the wall */
if (snipe_type == SP_LITE)
{
cave[ny][nx].info |= (CAVE_GLOW);
-
note_spot(ny, nx);
-
- /* Redraw */
lite_spot(ny, nx);
}
if (snipe_type == SP_EVILNESS)
{
cave[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK);
-
note_spot(ny, nx);
-
- /* Redraw */
lite_spot(ny, nx);
}
x = nx;
y = ny;
-
/* Monster here, Try to hit it */
if (cave[y][x].m_idx)
{
/* Handle visible monster */
else
{
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
/* Get "the monster" or "it" */
monster_desc(m_name, m_ptr, 0);
if (m_ptr->ml)
{
- /* Hack -- Track this monster race */
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
-
- /* Hack -- Track this monster */
health_track(c_mon_ptr->m_idx);
}
}
if ((randint1(randint1(r_ptr->level / (3 + p_ptr->concent)) + (8 - p_ptr->concent)) == 1)
&& !(r_ptr->flags1 & RF1_UNIQUE) && !(r_ptr->flags7 & RF7_UNIQUE2))
{
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
/* Get "the monster" or "it" */
monster_desc(m_name, m_ptr, 0);
if (snipe_type == SP_HOLYNESS)
{
cave[ny][nx].info |= (CAVE_GLOW);
-
note_spot(ny, nx);
-
- /* Redraw */
lite_spot(ny, nx);
}
/* Hit the monster, check for death */
- if (mon_take_hit(c_mon_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_ptr(m_ptr))))
+ if (mon_take_hit(c_mon_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_idx(m_ptr))))
{
/* Dead monster */
}
if (object_is_fixed_artifact(q_ptr) &&
(p_ptr->pclass != CLASS_SNIPER || p_ptr->concent == 0))
{
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, 0);
/* Anger the monster */
if (tdam > 0) anger_monster(m_ptr);
- /* Take note */
if (fear && m_ptr->ml)
{
- char m_name[80];
-
+ GAME_TEXT m_name[MAX_NLEN];
sound(SOUND_FLEE);
-
- /* Get the monster name (or "it") */
monster_desc(m_name, m_ptr, 0);
-
msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
}
m_ptr->fx = nx;
m_ptr->fy = ny;
- /* Update the monster (new location) */
- update_mon(c_mon_ptr->m_idx, TRUE);
+ update_monster(c_mon_ptr->m_idx, TRUE);
lite_spot(ny, nx);
lite_spot(oy, ox);
void do_cmd_fire(void)
{
OBJECT_IDX item;
- object_type *j_ptr;
- cptr q, s;
+ object_type *j_ptr, *ammo_ptr;
+ concptr q, s;
+
+ if(p_ptr->wild_mode) return;
is_fired = FALSE; /* not fired yet */
q = _("どれを撃ちますか? ", "Fire which item? ");
s = _("発射されるアイテムがありません。", "You have nothing to fire.");
- if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR)))
+
+
+ ammo_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
+ if (!ammo_ptr)
{
flush();
return;
object_type forge;
object_type *q_ptr;
-
object_type *o_ptr;
bool hit_body = FALSE;
bool equiped_item = FALSE;
bool return_when_thrown = FALSE;
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
int msec = delay_factor * delay_factor * delay_factor;
BIT_FLAGS flgs[TR_FLAG_SIZE];
- cptr q, s;
+ concptr q, s;
bool come_back = FALSE;
bool do_drop = TRUE;
+ if (p_ptr->wild_mode) return FALSE;
if (p_ptr->special_defense & KATA_MUSOU)
{
if (shuriken >= 0)
{
item = shuriken;
+ o_ptr = &inventory[item];
}
else if (boomerang)
{
item_tester_hook = item_tester_hook_boomerang;
q = _("どの武器を投げますか? ", "Throw which item? ");
s = _("投げる武器がない。", "You have nothing to throw.");
- if (!get_item(&item, q, s, (USE_EQUIP)))
+ o_ptr = choose_object(&item, q, s, (USE_EQUIP));
+ if (!o_ptr)
{
flush();
return FALSE;
}
}
- else if (buki_motteruka(INVEN_LARM)) item = INVEN_LARM;
- else item = INVEN_RARM;
+ else if (buki_motteruka(INVEN_LARM))
+ {
+ item = INVEN_LARM;
+ o_ptr = &inventory[item];
+ }
+ else
+ {
+ item = INVEN_RARM;
+ o_ptr = &inventory[item];
+ }
}
else
{
q = _("どのアイテムを投げますか? ", "Throw which item? ");
s = _("投げるアイテムがない。", "You have nothing to throw.");
- if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR | USE_EQUIP)))
+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | USE_EQUIP));
+ if (!o_ptr)
{
flush();
return FALSE;
}
}
- /* Access the item (if in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
- else
- {
- o_ptr = &o_list[0 - item];
- }
-
/* Item is cursed */
if (object_is_cursed(o_ptr) && (item >= INVEN_RARM))
{
}
}
-
- /* Get local object */
q_ptr = &forge;
/* Obtain a local object */
/* Single object */
q_ptr->number = 1;
- /* Description */
object_desc(o_name, q_ptr, OD_OMIT_PREFIX);
if (p_ptr->mighty_throw) mult += 3;
y = p_ptr->y;
x = p_ptr->x;
-
- /* Hack -- Handle stuff */
handle_stuff();
if ((p_ptr->pclass == CLASS_NINJA) && ((q_ptr->tval == TV_SPIKE) || ((have_flag(flgs, TR_THROW)) && (q_ptr->tval == TV_SWORD)))) shuriken = TRUE;
/* The player can see the (on screen) missile */
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);
+ SYMBOL_CODE c = object_char(q_ptr);
+ TERM_COLOR a = object_attr(q_ptr);
/* Draw, Hilite, Fresh, Pause, Erase */
print_rel(c, a, ny[cur_dis], nx[cur_dis]);
/* Handle visible monster */
else
{
- char m_name[80];
-
- /* Get "the monster" or "it" */
+ GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, 0);
-
msg_format(_("%sが%sに命中した。", "The %s hits %s."), o_name, m_name);
if (m_ptr->ml)
{
- /* Hack -- Track this monster race */
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
-
- /* Hack -- Track this monster */
health_track(c_ptr->m_idx);
}
}
tdam, m_ptr->hp - tdam, m_ptr->maxhp, m_ptr->max_maxhp);
/* Hit the monster, check for death */
- if (mon_take_hit(c_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_ptr(m_ptr))))
+ if (mon_take_hit(c_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_idx(m_ptr))))
{
/* Dead monster */
}
if ((tdam > 0) && !object_is_potion(q_ptr))
anger_monster(m_ptr);
- /* Take note */
if (fear && m_ptr->ml)
{
- char m_name[80];
-
sound(SOUND_FLEE);
-
- /* Get the monster name (or "it") */
+ GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, 0);
-
msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
}
}
{
j = 100;
- if (!(summon_named_creature(0, y, x, q_ptr->pval,
- !(object_is_cursed(q_ptr)) ? PM_FORCE_PET : 0L)))
+ if (!(summon_named_creature(0, y, x, q_ptr->pval, !(object_is_cursed(q_ptr)) ? PM_FORCE_PET : 0L)))
msg_print(_("人形は捻じ曲がり砕け散ってしまった!", "The Figurine writhes and then shatters."));
else if (object_is_cursed(q_ptr))
msg_print(_("これはあまり良くない気がする。", "You have a bad feeling about this."));
is_friendly(&m_list[cave[y][x].m_idx]) &&
!MON_INVULNER(m_ptr))
{
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
msg_format(_("%sは怒った!", "%^s gets angry!"), m_name);
set_hostile(&m_list[cave[y][x].m_idx]);
/* Wear the new stuff */
object_copy(o_ptr, q_ptr);
- /* Increase the weight */
p_ptr->total_weight += q_ptr->weight;
/* Increment the equip counter by hand */
equip_cnt++;
- /* Recalculate bonuses */
- p_ptr->update |= (PU_BONUS);
-
/* Recalculate torch */
- p_ptr->update |= (PU_TORCH);
-
- /* Recalculate mana XXX */
- p_ptr->update |= (PU_MANA);
-
+ p_ptr->update |= (PU_BONUS | PU_TORCH | PU_MANA);
p_ptr->window |= (PW_EQUIP);
}
else
calc_android_exp();
}
- /* Drop (or break) near that location */
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);
}
}
void forget_travel_flow(void)
{
POSITION x, y;
-
- /* Check the entire dungeon */
+ /* Check the entire dungeon / Forget the old data */
for (y = 0; y < cur_hgt; y++)
{
for (x = 0; x < cur_wid; x++)
{
- /* Forget the old data */
+
travel.cost[y][x] = MAX_SHORT;
}
}
-
travel.y = travel.x = 0;
}
{
POSITION x, y;
int i;
- int dx, dy, sx, sy;
+ POSITION dx, dy, sx, sy;
feature_type *f_ptr;
if (travel.x != 0 && travel.y != 0 &&