* Class 4 = Ranger --> slow but heavy (changed!)\n
* Class 5 = Paladin --> slow but heavy\n
*/
-static void sense_inventory1(void)
+static void sense_inventory1(player_type *creature_ptr)
{
INVENTORY_IDX i;
- PLAYER_LEVEL plev = p_ptr->lev;
+ PLAYER_LEVEL plev = creature_ptr->lev;
bool heavy = FALSE;
object_type *o_ptr;
/*** Check for "sensing" ***/
/* No sensing when confused */
- if (p_ptr->confused) return;
+ if (creature_ptr->confused) return;
/* Analyze the class */
- switch (p_ptr->pclass)
+ switch (creature_ptr->pclass)
{
case CLASS_WARRIOR:
case CLASS_ARCHER:
}
}
- if (compare_virtue(p_ptr, V_KNOWLEDGE, 100, VIRTUE_LARGE)) heavy = TRUE;
+ if (compare_virtue(creature_ptr, V_KNOWLEDGE, 100, VIRTUE_LARGE)) heavy = TRUE;
/*** Sense everything ***/
{
bool okay = FALSE;
- o_ptr = &p_ptr->inventory_list[i];
+ o_ptr = &creature_ptr->inventory_list[i];
/* Skip empty slots */
if (!o_ptr->k_idx) continue;
/* Skip non-sense machines */
if (!okay) continue;
- /* Occasional failure on p_ptr->inventory_list items */
+ /* Occasional failure on creature_ptr->inventory_list items */
if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
/* Good luck */
- if ((p_ptr->muta3 & MUT3_GOOD_LUCK) && !randint0(13))
+ if ((creature_ptr->muta3 & MUT3_GOOD_LUCK) && !randint0(13))
{
heavy = TRUE;
}
* @brief 1プレイヤーターン毎に武器、防具以外の擬似鑑定が行われるかを判定する。
* @return なし
*/
-static void sense_inventory2(void)
+static void sense_inventory2(player_type *creature_ptr)
{
INVENTORY_IDX i;
- PLAYER_LEVEL plev = p_ptr->lev;
+ PLAYER_LEVEL plev = creature_ptr->lev;
object_type *o_ptr;
/*** Check for "sensing" ***/
/* No sensing when confused */
- if (p_ptr->confused) return;
+ if (creature_ptr->confused) return;
/* Analyze the class */
- switch (p_ptr->pclass)
+ switch (creature_ptr->pclass)
{
case CLASS_WARRIOR:
case CLASS_ARCHER:
{
bool okay = FALSE;
- o_ptr = &p_ptr->inventory_list[i];
+ o_ptr = &creature_ptr->inventory_list[i];
/* Skip empty slots */
if (!o_ptr->k_idx) continue;
/* Skip non-sense machines */
if (!okay) continue;
- /* Occasional failure on p_ptr->inventory_list items */
+ /* Occasional failure on creature_ptr->inventory_list items */
if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
sense_inventory_aux(i, TRUE);
/* Only downward in ironman mode */
if (ironman_downward)
- min_level = current_floor_ptr->dun_level;
+ min_level = p_ptr->current_floor_ptr->dun_level;
/* Maximum level */
if (p_ptr->dungeon_idx == DUNGEON_ANGBAND)
{
- if (current_floor_ptr->dun_level > 100)
+ if (p_ptr->current_floor_ptr->dun_level > 100)
max_level = MAX_DEPTH - 1;
- else if (current_floor_ptr->dun_level == 100)
+ else if (p_ptr->current_floor_ptr->dun_level == 100)
max_level = 100;
}
else
sprintf(ppp, _("テレポート先:(%d-%d)", "Teleport to level (%d-%d): "), (int)min_level, (int)max_level);
/* Default */
- sprintf(tmp_val, "%d", (int)current_floor_ptr->dun_level);
+ sprintf(tmp_val, "%d", (int)p_ptr->current_floor_ptr->dun_level);
/* Ask for a level */
if (!get_string(ppp, tmp_val, 10)) return;
if (autosave_l) do_cmd_save_game(TRUE);
/* Change level */
- current_floor_ptr->dun_level = command_arg;
+ p_ptr->current_floor_ptr->dun_level = command_arg;
leave_quest_check();
* @brief 各種パターン地形上の特別な処理 / Returns TRUE if we are on the Pattern...
* @return 実際にパターン地形上にプレイヤーが居た場合はTRUEを返す。
*/
-static bool pattern_effect(void)
+static bool pattern_effect(player_type *creature_ptr)
{
int pattern_type;
- if (!pattern_tile(p_ptr->y, p_ptr->x)) return FALSE;
+ if (!pattern_tile(creature_ptr->y, creature_ptr->x)) return FALSE;
- if ((PRACE_IS_(p_ptr, RACE_AMBERITE)) &&
- (p_ptr->cut > 0) && one_in_(10))
+ if ((PRACE_IS_(creature_ptr, RACE_AMBERITE)) &&
+ (creature_ptr->cut > 0) && one_in_(10))
{
- wreck_the_pattern(p_ptr);
+ wreck_the_pattern(creature_ptr);
}
- pattern_type = f_info[current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat].subtype;
+ pattern_type = f_info[p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat].subtype;
switch (pattern_type)
{
case PATTERN_TILE_END:
- (void)set_image(p_ptr, 0);
+ (void)set_image(creature_ptr, 0);
(void)restore_all_status();
- (void)restore_level(p_ptr);
- (void)cure_critical_wounds(1000);
+ (void)restore_level(creature_ptr);
+ (void)cure_critical_wounds(creature_ptr, 1000);
- cave_set_feat(p_ptr->y, p_ptr->x, feat_pattern_old);
+ cave_set_feat(creature_ptr->y, creature_ptr->x, feat_pattern_old);
msg_print(_("「パターン」のこの部分は他の部分より強力でないようだ。", "This section of the Pattern looks less powerful."));
/*
case PATTERN_TILE_WRECKED:
if (!IS_INVULN())
- take_hit(p_ptr, DAMAGE_NOESCAPE, 200, _("壊れた「パターン」を歩いたダメージ", "walking the corrupted Pattern"), -1);
+ take_hit(creature_ptr, DAMAGE_NOESCAPE, 200, _("壊れた「パターン」を歩いたダメージ", "walking the corrupted Pattern"), -1);
break;
default:
- if (PRACE_IS_(p_ptr, RACE_AMBERITE) && !one_in_(2))
+ if (PRACE_IS_(creature_ptr, RACE_AMBERITE) && !one_in_(2))
return TRUE;
else if (!IS_INVULN())
- take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(1, 3), _("「パターン」を歩いたダメージ", "walking the Pattern"), -1);
+ take_hit(creature_ptr, DAMAGE_NOESCAPE, damroll(1, 3), _("「パターン」を歩いたダメージ", "walking the Pattern"), -1);
break;
}
* @param regen_amount 回復量
* @return なし
*/
-static void regenmana(MANA_POINT upkeep_factor, MANA_POINT regen_amount)
+static void regenmana(player_type *creature_ptr, MANA_POINT upkeep_factor, MANA_POINT regen_amount)
{
- MANA_POINT old_csp = p_ptr->csp;
+ MANA_POINT old_csp = creature_ptr->csp;
s32b regen_rate = regen_amount * 100 - upkeep_factor * PY_REGEN_NORMAL;
/*
* Excess mana will decay 32 times faster than normal
* regeneration rate.
*/
- if (p_ptr->csp > p_ptr->msp)
+ if (creature_ptr->csp > creature_ptr->msp)
{
/* PY_REGEN_NORMAL is the Regen factor in unit (1/2^16) */
s32b decay = 0;
- u32b decay_frac = (p_ptr->msp * 32 * PY_REGEN_NORMAL + PY_REGEN_MNBASE);
+ u32b decay_frac = (creature_ptr->msp * 32 * PY_REGEN_NORMAL + PY_REGEN_MNBASE);
/* Convert the unit (1/2^16) to (1/2^32) */
s64b_LSHIFT(decay, decay_frac, 16);
/* Decay */
- s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), decay, decay_frac);
+ s64b_sub(&(creature_ptr->csp), &(creature_ptr->csp_frac), decay, decay_frac);
/* Stop decaying */
- if (p_ptr->csp < p_ptr->msp)
+ if (creature_ptr->csp < creature_ptr->msp)
{
- p_ptr->csp = p_ptr->msp;
- p_ptr->csp_frac = 0;
+ creature_ptr->csp = creature_ptr->msp;
+ creature_ptr->csp_frac = 0;
}
}
{
/* (percent/100) is the Regen factor in unit (1/2^16) */
MANA_POINT new_mana = 0;
- u32b new_mana_frac = (p_ptr->msp * regen_rate / 100 + PY_REGEN_MNBASE);
+ u32b new_mana_frac = (creature_ptr->msp * regen_rate / 100 + PY_REGEN_MNBASE);
/* Convert the unit (1/2^16) to (1/2^32) */
s64b_LSHIFT(new_mana, new_mana_frac, 16);
/* Regenerate */
- s64b_add(&(p_ptr->csp), &(p_ptr->csp_frac), new_mana, new_mana_frac);
+ s64b_add(&(creature_ptr->csp), &(creature_ptr->csp_frac), new_mana, new_mana_frac);
/* Must set frac to zero even if equal */
- if (p_ptr->csp >= p_ptr->msp)
+ if (creature_ptr->csp >= creature_ptr->msp)
{
- p_ptr->csp = p_ptr->msp;
- p_ptr->csp_frac = 0;
+ creature_ptr->csp = creature_ptr->msp;
+ creature_ptr->csp_frac = 0;
}
}
{
/* PY_REGEN_NORMAL is the Regen factor in unit (1/2^16) */
s32b reduce_mana = 0;
- u32b reduce_mana_frac = (p_ptr->msp * (-1) * regen_rate / 100 + PY_REGEN_MNBASE);
+ u32b reduce_mana_frac = (creature_ptr->msp * (-1) * regen_rate / 100 + PY_REGEN_MNBASE);
/* Convert the unit (1/2^16) to (1/2^32) */
s64b_LSHIFT(reduce_mana, reduce_mana_frac, 16);
/* Reduce mana */
- s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), reduce_mana, reduce_mana_frac);
+ s64b_sub(&(creature_ptr->csp), &(creature_ptr->csp_frac), reduce_mana, reduce_mana_frac);
/* Check overflow */
- if (p_ptr->csp < 0)
+ if (creature_ptr->csp < 0)
{
- p_ptr->csp = 0;
- p_ptr->csp_frac = 0;
+ creature_ptr->csp = 0;
+ creature_ptr->csp_frac = 0;
}
}
- if (old_csp != p_ptr->csp)
+ if (old_csp != creature_ptr->csp)
{
- p_ptr->redraw |= (PR_MANA);
- p_ptr->window |= (PW_PLAYER);
- p_ptr->window |= (PW_SPELL);
+ creature_ptr->redraw |= (PR_MANA);
+ creature_ptr->window |= (PW_PLAYER);
+ creature_ptr->window |= (PW_SPELL);
wild_regen = 20;
}
}
* @param regen_amount 回復量
* @return なし
*/
-static void regenmagic(int regen_amount)
+static void regenmagic(player_type *creature_ptr, int regen_amount)
{
MANA_POINT new_mana;
int i;
int dev = 30;
- int mult = (dev + adj_mag_mana[p_ptr->stat_ind[A_INT]]); /* x1 to x2 speed bonus for recharging */
+ int mult = (dev + adj_mag_mana[creature_ptr->stat_ind[A_INT]]); /* x1 to x2 speed bonus for recharging */
for (i = 0; i < EATER_EXT*2; i++)
{
- if (!p_ptr->magic_num2[i]) continue;
- if (p_ptr->magic_num1[i] == ((long)p_ptr->magic_num2[i] << 16)) continue;
+ if (!creature_ptr->magic_num2[i]) continue;
+ if (creature_ptr->magic_num1[i] == ((long)creature_ptr->magic_num2[i] << 16)) continue;
/* Increase remaining charge number like float value */
- new_mana = (regen_amount * mult * ((long)p_ptr->magic_num2[i] + 13)) / (dev * 8);
- p_ptr->magic_num1[i] += new_mana;
+ new_mana = (regen_amount * mult * ((long)creature_ptr->magic_num2[i] + 13)) / (dev * 8);
+ creature_ptr->magic_num1[i] += new_mana;
/* Check maximum charge */
- if (p_ptr->magic_num1[i] > (p_ptr->magic_num2[i] << 16))
+ if (creature_ptr->magic_num1[i] > (creature_ptr->magic_num2[i] << 16))
{
- p_ptr->magic_num1[i] = ((long)p_ptr->magic_num2[i] << 16);
+ creature_ptr->magic_num1[i] = ((long)creature_ptr->magic_num2[i] << 16);
}
wild_regen = 20;
}
for (i = EATER_EXT*2; i < EATER_EXT*3; i++)
{
- if (!p_ptr->magic_num1[i]) continue;
- if (!p_ptr->magic_num2[i]) continue;
+ if (!creature_ptr->magic_num1[i]) continue;
+ if (!creature_ptr->magic_num2[i]) continue;
/* Decrease remaining period for charging */
- new_mana = (regen_amount * mult * ((long)p_ptr->magic_num2[i] + 10) * EATER_ROD_CHARGE)
+ new_mana = (regen_amount * mult * ((long)creature_ptr->magic_num2[i] + 10) * EATER_ROD_CHARGE)
/ (dev * 16 * PY_REGEN_NORMAL);
- p_ptr->magic_num1[i] -= new_mana;
+ creature_ptr->magic_num1[i] -= new_mana;
/* Check minimum remaining period for charging */
- if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
+ if (creature_ptr->magic_num1[i] < 0) creature_ptr->magic_num1[i] = 0;
wild_regen = 20;
}
}
/* Regenerate everyone */
- for (i = 1; i < current_floor_ptr->m_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
{
/* Check the i'th monster */
- monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (!monster_is_valid(m_ptr)) continue;
if (creature_ptr->spell_exp[spell] < SPELL_EXP_BEGINNER)
creature_ptr->spell_exp[spell] += 5;
else if(creature_ptr->spell_exp[spell] < SPELL_EXP_SKILLED)
- { if (one_in_(2) && (current_floor_ptr->dun_level > 4) && ((current_floor_ptr->dun_level + 10) > creature_ptr->lev)) creature_ptr->spell_exp[spell] += 1; }
+ { if (one_in_(2) && (p_ptr->current_floor_ptr->dun_level > 4) && ((p_ptr->current_floor_ptr->dun_level + 10) > creature_ptr->lev)) creature_ptr->spell_exp[spell] += 1; }
else if(creature_ptr->spell_exp[spell] < SPELL_EXP_EXPERT)
- { if (one_in_(5) && ((current_floor_ptr->dun_level + 5) > creature_ptr->lev) && ((current_floor_ptr->dun_level + 5) > s_ptr->slevel)) creature_ptr->spell_exp[spell] += 1; }
+ { if (one_in_(5) && ((p_ptr->current_floor_ptr->dun_level + 5) > creature_ptr->lev) && ((p_ptr->current_floor_ptr->dun_level + 5) > s_ptr->slevel)) creature_ptr->spell_exp[spell] += 1; }
else if(creature_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
- { if (one_in_(5) && ((current_floor_ptr->dun_level + 5) > creature_ptr->lev) && (current_floor_ptr->dun_level > s_ptr->slevel)) creature_ptr->spell_exp[spell] += 1; }
+ { if (one_in_(5) && ((p_ptr->current_floor_ptr->dun_level + 5) > creature_ptr->lev) && (p_ptr->current_floor_ptr->dun_level > s_ptr->slevel)) creature_ptr->spell_exp[spell] += 1; }
/* Do any effects of continual song */
exe_spell(creature_ptr, REALM_MUSIC, spell, SPELL_CONT);
return (&p_ptr->inventory_list[choices[randint0(number)]]);
}
-static void process_world_aux_digestion(void)
+static void process_world_aux_digestion(player_type *creature_ptr)
{
- if (!p_ptr->phase_out)
+ if (!creature_ptr->phase_out)
{
/* Digest quickly when gorged */
- if (p_ptr->food >= PY_FOOD_MAX)
+ if (creature_ptr->food >= PY_FOOD_MAX)
{
/* Digest a lot of food */
- (void)set_food(p_ptr, p_ptr->food - 100);
+ (void)set_food(creature_ptr, creature_ptr->food - 100);
}
/* Digest normally -- Every 50 game turns */
else if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 5)))
{
/* Basic digestion rate based on speed */
- int digestion = SPEED_TO_ENERGY(p_ptr->pspeed);
+ int digestion = SPEED_TO_ENERGY(creature_ptr->pspeed);
/* Regeneration takes more food */
- if (p_ptr->regenerate)
+ if (creature_ptr->regenerate)
digestion += 20;
- if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
+ if (creature_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
digestion += 20;
- if (p_ptr->cursed & TRC_FAST_DIGEST)
+ if (creature_ptr->cursed & TRC_FAST_DIGEST)
digestion += 30;
/* Slow digestion takes less food */
- if (p_ptr->slow_digest)
+ if (creature_ptr->slow_digest)
digestion -= 5;
/* Minimal digestion */
if (digestion > 100) digestion = 100;
/* Digest some food */
- (void)set_food(p_ptr, p_ptr->food - digestion);
+ (void)set_food(creature_ptr, creature_ptr->food - digestion);
}
/* Getting Faint */
- if ((p_ptr->food < PY_FOOD_FAINT))
+ if ((creature_ptr->food < PY_FOOD_FAINT))
{
/* Faint occasionally */
- if (!p_ptr->paralyzed && (randint0(100) < 10))
+ if (!creature_ptr->paralyzed && (randint0(100) < 10))
{
msg_print(_("あまりにも空腹で気絶してしまった。", "You faint from the lack of food."));
- disturb(p_ptr, TRUE, TRUE);
+ disturb(creature_ptr, TRUE, TRUE);
/* Hack -- faint (bypass free action) */
- (void)set_paralyzed(p_ptr, p_ptr->paralyzed + 1 + randint0(5));
+ (void)set_paralyzed(creature_ptr, creature_ptr->paralyzed + 1 + randint0(5));
}
/* Starve to death (slowly) */
- if (p_ptr->food < PY_FOOD_STARVE)
+ if (creature_ptr->food < PY_FOOD_STARVE)
{
/* Calculate damage */
- HIT_POINT dam = (PY_FOOD_STARVE - p_ptr->food) / 10;
+ HIT_POINT dam = (PY_FOOD_STARVE - creature_ptr->food) / 10;
- if (!IS_INVULN()) take_hit(p_ptr, DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
+ if (!IS_INVULN()) take_hit(creature_ptr, DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
}
}
}
*/
static void process_world_aux_hp_and_sp(player_type *creature_ptr)
{
- feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat];
+ feature_type *f_ptr = &f_info[creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat];
bool cave_no_regen = FALSE;
int upkeep_factor = 0;
/* (Vampires) Take damage from sunlight */
if (PRACE_IS_(creature_ptr, RACE_VAMPIRE) || (creature_ptr->mimic_form == MIMIC_VAMPIRE))
{
- if (!current_floor_ptr->dun_level && !creature_ptr->resist_lite && !IS_INVULN() && is_daytime())
+ if (!creature_ptr->current_floor_ptr->dun_level && !creature_ptr->resist_lite && !IS_INVULN() && is_daytime())
{
- if ((current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
+ if ((creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
{
msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1);
{
msg_print(_("熱で火傷した!", "The heat burns you!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
msg_format(_("%sで火傷した!", "The %s burns you!"), name);
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("冷気に覆われた!", "The cold engulfs you!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
msg_format(_("%sに凍えた!", "The %s frostbites you!"), name);
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("電撃を受けた!", "The electric shocks you!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
msg_format(_("%sに感電した!", "The %s shocks you!"), name);
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("酸が飛び散った!", "The acid melt you!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
msg_format(_("%sに溶かされた!", "The %s melts you!"), name);
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("毒気を吸い込んだ!", "The gas poisons you!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
if (creature_ptr->resist_pois) (void)set_poisoned(creature_ptr, creature_ptr->poisoned + 1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
msg_format(_("%sに毒された!", "The %s poisons you!"), name);
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
if (creature_ptr->resist_pois) (void)set_poisoned(creature_ptr, creature_ptr->poisoned + 3);
if (creature_ptr->riding)
{
HIT_POINT damage;
- if ((r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !creature_ptr->immune_fire)
+ if ((r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !creature_ptr->immune_fire)
{
- damage = r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
+ damage = r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
if (PRACE_IS_(creature_ptr, RACE_ENT)) damage += damage / 3;
if (creature_ptr->resist_fire) damage = damage / 3;
if (IS_OPPOSE_FIRE()) damage = damage / 3;
msg_print(_("熱い!", "It's hot!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, _("炎のオーラ", "Fire aura"), -1);
}
- if ((r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !creature_ptr->immune_elec)
+ if ((r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !creature_ptr->immune_elec)
{
- damage = r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
+ damage = r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
if (PRACE_IS_(creature_ptr, RACE_ANDROID)) damage += damage / 3;
if (creature_ptr->resist_elec) damage = damage / 3;
if (IS_OPPOSE_ELEC()) damage = damage / 3;
msg_print(_("痛い!", "It hurts!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, _("電気のオーラ", "Elec aura"), -1);
}
- if ((r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !creature_ptr->immune_cold)
+ if ((r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !creature_ptr->immune_cold)
{
- damage = r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
+ damage = r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
if (creature_ptr->resist_cold) damage = damage / 3;
if (IS_OPPOSE_COLD()) damage = damage / 3;
msg_print(_("冷たい!", "It's cold!"));
}
/* Are we walking the pattern? */
- if (pattern_effect())
+ if (pattern_effect(creature_ptr))
{
cave_no_regen = TRUE;
}
}
/* Regenerate the mana */
- regenmana(upkeep_factor, regen_amount);
+ regenmana(creature_ptr, upkeep_factor, regen_amount);
/* Recharge magic eater's power */
if (creature_ptr->pclass == CLASS_MAGIC_EATER)
{
- regenmagic(regen_amount);
+ regenmagic(creature_ptr, regen_amount);
}
if ((creature_ptr->csp == 0) && (creature_ptr->csp_frac == 0))
if (pet) mode |= PM_FORCE_PET;
else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
- if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_DEMON, mode))
+ if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, mode))
{
msg_print(_("あなたはデーモンを引き寄せた!", "You have attracted a demon!"));
disturb(creature_ptr, FALSE, TRUE);
msg_print(_("突然ほとんど孤独になった気がする。", "You suddenly feel almost lonely."));
banish_monsters(100);
- if (!current_floor_ptr->dun_level && creature_ptr->town_num)
+ if (!p_ptr->current_floor_ptr->dun_level && creature_ptr->town_num)
{
int n;
msg_print(NULL);
/* Absorb light from the current possition */
- if ((current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
+ if ((p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
{
hp_player(creature_ptr, 10);
}
if (pet) mode |= PM_FORCE_PET;
else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
- if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_ANIMAL, mode))
+ if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, mode))
{
msg_print(_("動物を引き寄せた!", "You have attracted an animal!"));
disturb(creature_ptr, FALSE, TRUE);
if (pet) mode |= PM_FORCE_PET;
else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
- if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_DRAGON, mode))
+ if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON, mode))
{
msg_print(_("ドラゴンを引き寄せた!", "You have attracted a dragon!"));
disturb(creature_ptr, FALSE, TRUE);
int danger_amount = 0;
MONSTER_IDX monster;
- for (monster = 0; monster < current_floor_ptr->m_max; monster++)
+ for (monster = 0; monster < p_ptr->current_floor_ptr->m_max; monster++)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[monster];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[monster];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (!monster_is_valid(m_ptr)) continue;
/* Call animal */
if ((creature_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500))
{
- if (summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_ANIMAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
GAME_TEXT o_name[MAX_NLEN];
/* Call demon */
if ((creature_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111))
{
- if (summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
GAME_TEXT o_name[MAX_NLEN];
/* Call dragon */
if ((creature_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800))
{
- if (summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_DRAGON,
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON,
(PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
GAME_TEXT o_name[MAX_NLEN];
/* Call undead */
if ((creature_ptr->cursed & TRC_CALL_UNDEAD) && one_in_(1111))
{
- if (summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_UNDEAD,
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD,
(PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
GAME_TEXT o_name[MAX_NLEN];
}
/* Process objects on floor */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[i];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
if (!OBJECT_IS_VALID(o_ptr)) continue;
* / Handle involuntary movement once every 10 game turns
* @return なし
*/
-static void process_world_aux_movement(void)
+static void process_world_aux_movement(player_type *creature_ptr)
{
+ floor_type *floor_ptr = creature_ptr->current_floor_ptr;
/* Delayed Word-of-Recall */
- if (p_ptr->word_recall)
+ if (creature_ptr->word_recall)
{
/*
* HACK: Autosave BEFORE resetting the recall counter (rr9)
* The player is yanked up/down as soon as
* he loads the autosaved game.
*/
- if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->phase_out)
+ if (autosave_l && (creature_ptr->word_recall == 1) && !creature_ptr->phase_out)
do_cmd_save_game(TRUE);
/* Count down towards recall */
- p_ptr->word_recall--;
+ creature_ptr->word_recall--;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->redraw |= (PR_STATUS);
/* Activate the recall */
- if (!p_ptr->word_recall)
+ if (!creature_ptr->word_recall)
{
/* Disturbing! */
- disturb(p_ptr, FALSE, TRUE);
+ disturb(creature_ptr, FALSE, TRUE);
/* Determine the level */
- if (current_floor_ptr->dun_level || p_ptr->inside_quest || p_ptr->enter_dungeon)
+ if (floor_ptr->dun_level || creature_ptr->inside_quest || creature_ptr->enter_dungeon)
{
msg_print(_("上に引っ張りあげられる感じがする!", "You feel yourself yanked upwards!"));
- if (p_ptr->dungeon_idx) p_ptr->recall_dungeon = p_ptr->dungeon_idx;
+ if (creature_ptr->dungeon_idx) creature_ptr->recall_dungeon = creature_ptr->dungeon_idx;
if (record_stair)
- exe_write_diary(p_ptr, NIKKI_RECALL, current_floor_ptr->dun_level, NULL);
+ exe_write_diary(creature_ptr, NIKKI_RECALL, floor_ptr->dun_level, NULL);
- current_floor_ptr->dun_level = 0;
- p_ptr->dungeon_idx = 0;
+ floor_ptr->dun_level = 0;
+ creature_ptr->dungeon_idx = 0;
leave_quest_check();
leave_tower_check();
- p_ptr->inside_quest = 0;
+ creature_ptr->inside_quest = 0;
- p_ptr->leaving = TRUE;
+ creature_ptr->leaving = TRUE;
}
else
{
msg_print(_("下に引きずり降ろされる感じがする!", "You feel yourself yanked downwards!"));
- p_ptr->dungeon_idx = p_ptr->recall_dungeon;
+ creature_ptr->dungeon_idx = creature_ptr->recall_dungeon;
if (record_stair)
- exe_write_diary(p_ptr, NIKKI_RECALL, current_floor_ptr->dun_level, NULL);
+ exe_write_diary(creature_ptr, NIKKI_RECALL, floor_ptr->dun_level, NULL);
/* New depth */
- current_floor_ptr->dun_level = max_dlv[p_ptr->dungeon_idx];
- if (current_floor_ptr->dun_level < 1) current_floor_ptr->dun_level = 1;
+ floor_ptr->dun_level = max_dlv[creature_ptr->dungeon_idx];
+ if (floor_ptr->dun_level < 1) floor_ptr->dun_level = 1;
/* Nightmare mode makes recall more dangerous */
- if (ironman_nightmare && !randint0(666) && (p_ptr->dungeon_idx == DUNGEON_ANGBAND))
+ if (ironman_nightmare && !randint0(666) && (creature_ptr->dungeon_idx == DUNGEON_ANGBAND))
{
- if (current_floor_ptr->dun_level < 50)
+ if (floor_ptr->dun_level < 50)
{
- current_floor_ptr->dun_level *= 2;
+ floor_ptr->dun_level *= 2;
}
- else if (current_floor_ptr->dun_level < 99)
+ else if (floor_ptr->dun_level < 99)
{
- current_floor_ptr->dun_level = (current_floor_ptr->dun_level + 99) / 2;
+ floor_ptr->dun_level = (floor_ptr->dun_level + 99) / 2;
}
- else if (current_floor_ptr->dun_level > 100)
+ else if (floor_ptr->dun_level > 100)
{
- current_floor_ptr->dun_level = d_info[p_ptr->dungeon_idx].maxdepth - 1;
+ floor_ptr->dun_level = d_info[creature_ptr->dungeon_idx].maxdepth - 1;
}
}
- if (p_ptr->wild_mode)
+ if (creature_ptr->wild_mode)
{
- p_ptr->wilderness_y = p_ptr->y;
- p_ptr->wilderness_x = p_ptr->x;
+ creature_ptr->wilderness_y = creature_ptr->y;
+ creature_ptr->wilderness_x = creature_ptr->x;
}
else
{
/* Save player position */
- p_ptr->oldpx = p_ptr->x;
- p_ptr->oldpy = p_ptr->y;
+ creature_ptr->oldpx = creature_ptr->x;
+ creature_ptr->oldpy = creature_ptr->y;
}
- p_ptr->wild_mode = FALSE;
+ creature_ptr->wild_mode = FALSE;
/*
* Clear all saved floors
* and create a first saved floor
*/
prepare_change_floor_mode(CFM_FIRST_FLOOR);
- p_ptr->leaving = TRUE;
+ creature_ptr->leaving = TRUE;
- if (p_ptr->dungeon_idx == DUNGEON_ANGBAND)
+ if (creature_ptr->dungeon_idx == DUNGEON_ANGBAND)
{
int i;
if ((q_ptr->type == QUEST_TYPE_RANDOM) &&
(q_ptr->status == QUEST_STATUS_TAKEN) &&
- (q_ptr->level < current_floor_ptr->dun_level))
+ (q_ptr->level < floor_ptr->dun_level))
{
q_ptr->status = QUEST_STATUS_FAILED;
- q_ptr->complev = (byte)p_ptr->lev;
+ q_ptr->complev = (byte)creature_ptr->lev;
update_playtime();
q_ptr->comptime = current_world_ptr->play_time;
r_info[q_ptr->r_idx].flags1 &= ~(RF1_QUESTOR);
/* Delayed Alter reality */
- if (p_ptr->alter_reality)
+ if (creature_ptr->alter_reality)
{
- if (autosave_l && (p_ptr->alter_reality == 1) && !p_ptr->phase_out)
+ if (autosave_l && (creature_ptr->alter_reality == 1) && !creature_ptr->phase_out)
do_cmd_save_game(TRUE);
/* Count down towards alter */
- p_ptr->alter_reality--;
+ creature_ptr->alter_reality--;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->redraw |= (PR_STATUS);
/* Activate the alter reality */
- if (!p_ptr->alter_reality)
+ if (!creature_ptr->alter_reality)
{
/* Disturbing! */
- disturb(p_ptr, FALSE, TRUE);
+ disturb(creature_ptr, FALSE, TRUE);
/* Determine the level */
- if (!quest_number(current_floor_ptr->dun_level) && current_floor_ptr->dun_level)
+ if (!quest_number(floor_ptr->dun_level) && floor_ptr->dun_level)
{
msg_print(_("世界が変わった!", "The world changes!"));
* and create a first saved floor
*/
prepare_change_floor_mode(CFM_FIRST_FLOOR);
- p_ptr->leaving = TRUE;
+ creature_ptr->leaving = TRUE;
}
else
{
extract_day_hour_min(&day, &hour, &min);
/* Update dungeon feeling, and announce it if changed */
- update_dungeon_feeling(current_floor_ptr);
+ update_dungeon_feeling(p_ptr, p_ptr->current_floor_ptr);
/* 帰還無しモード時のレベルテレポバグ対策 / Fix for level teleport bugs on ironman_downward.*/
if (ironman_downward && (p_ptr->dungeon_idx != DUNGEON_ANGBAND && p_ptr->dungeon_idx != 0))
{
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
p_ptr->dungeon_idx = 0;
prepare_change_floor_mode(CFM_FIRST_FLOOR | CFM_RAND_PLACE);
p_ptr->inside_arena = FALSE;
int number_mon = 0;
/* Count all hostile monsters */
- for (i2 = 0; i2 < current_floor_ptr->width; ++i2)
- for (j2 = 0; j2 < current_floor_ptr->height; j2++)
+ for (i2 = 0; i2 < p_ptr->current_floor_ptr->width; ++i2)
+ for (j2 = 0; j2 < p_ptr->current_floor_ptr->height; j2++)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[j2][i2];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[j2][i2];
if ((g_ptr->m_idx > 0) && (g_ptr->m_idx != p_ptr->riding))
{
GAME_TEXT m_name[MAX_NLEN];
monster_type *wm_ptr;
- wm_ptr = ¤t_floor_ptr->m_list[win_m_idx];
+ wm_ptr = &p_ptr->current_floor_ptr->m_list[win_m_idx];
monster_desc(m_name, wm_ptr, 0);
msg_format(_("%sが勝利した!", "%s is winner!"), m_name);
p_ptr->energy_need = 0;
update_gambling_monsters();
}
- else if (current_world_ptr->game_turn - current_floor_ptr->generated_turn == 150 * TURNS_PER_TICK)
+ else if (current_world_ptr->game_turn - p_ptr->current_floor_ptr->generated_turn == 150 * TURNS_PER_TICK)
{
msg_print(_("申し分けありませんが、この勝負は引き分けとさせていただきます。", "This battle have ended in a draw."));
p_ptr->au += kakekin;
do_cmd_save_game(TRUE);
}
- if (current_floor_ptr->monster_noise && !ignore_unview)
+ if (p_ptr->current_floor_ptr->monster_noise && !ignore_unview)
{
msg_print(_("何かが聞こえた。", "You hear noise."));
}
/*** Handle the wilderness/town (sunshine) ***/
/* While in town/wilderness */
- if (!current_floor_ptr->dun_level && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)
+ if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)
{
/* Hack -- Daybreak/Nighfall in town */
if (!(current_world_ptr->game_turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2)))
/* Check for dawn */
dawn = (!(current_world_ptr->game_turn % (TURNS_PER_TICK * TOWN_DAWN)));
- if (dawn) day_break(current_floor_ptr);
- else night_falls(current_floor_ptr);
+ if (dawn) day_break(p_ptr->current_floor_ptr);
+ else night_falls(p_ptr->current_floor_ptr);
}
}
/* While in the dungeon (vanilla_town or lite_town mode only) */
- else if ((vanilla_town || (lite_town && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)) && current_floor_ptr->dun_level)
+ else if ((vanilla_town || (lite_town && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)) && p_ptr->current_floor_ptr->dun_level)
{
/*** Shuffle the Storekeepers ***/
/* Hack -- Process the counters of monsters if needed */
for (i = 0; i < MAX_MTIMED; i++)
{
- if (current_floor_ptr->mproc_max[i] > 0) process_monsters_mtimed(i);
+ if (p_ptr->current_floor_ptr->mproc_max[i] > 0) process_monsters_mtimed(i);
}
}
}
}
- process_world_aux_digestion();
+ process_world_aux_digestion(p_ptr);
process_world_aux_hp_and_sp(p_ptr);
process_world_aux_timeout(p_ptr);
process_world_aux_light(p_ptr);
process_world_aux_mutation(p_ptr);
process_world_aux_curse(p_ptr);
process_world_aux_recharge(p_ptr);
- sense_inventory1();
- sense_inventory2();
- process_world_aux_movement();
+ sense_inventory1(p_ptr);
+ sense_inventory2(p_ptr);
+ process_world_aux_movement(p_ptr);
}
/*!
/*
* Hack -- Declare the Debug Routines
*/
-extern void do_cmd_debug(void);
+extern void do_cmd_debug(player_type *creature_ptr);
#endif /* ALLOW_WIZARD */
* @todo Make some "blocks"
* @return なし
*/
-static void process_command(void)
+static void process_command(player_type *creature_ptr)
{
COMMAND_CODE old_now_message = now_message;
now_message = 0;
/* Sniper */
- if ((p_ptr->pclass == CLASS_SNIPER) && (p_ptr->concent))
- p_ptr->reset_concent = TRUE;
+ if ((creature_ptr->pclass == CLASS_SNIPER) && (creature_ptr->concent))
+ creature_ptr->reset_concent = TRUE;
/* Parse the command */
switch (command_cmd)
current_world_ptr->wizard = TRUE;
msg_print(_("ウィザードモード突入。", "Wizard mode on."));
}
- p_ptr->update |= (PU_MONSTERS);
- p_ptr->redraw |= (PR_TITLE);
+ creature_ptr->update |= (PU_MONSTERS);
+ creature_ptr->redraw |= (PR_TITLE);
break;
}
{
if (enter_debug_mode())
{
- do_cmd_debug();
+ do_cmd_debug(creature_ptr);
}
break;
}
{
if (enter_borg_mode())
{
- if (!p_ptr->wild_mode) do_cmd_borg();
+ if (!creature_ptr->wild_mode) do_cmd_borg();
}
break;
}
/* Wear/wield equipment */
case 'w':
{
- if (!p_ptr->wild_mode) do_cmd_wield(p_ptr);
+ if (!creature_ptr->wild_mode) do_cmd_wield(creature_ptr);
break;
}
/* Take off equipment */
case 't':
{
- if (!p_ptr->wild_mode) do_cmd_takeoff(p_ptr);
+ if (!creature_ptr->wild_mode) do_cmd_takeoff(creature_ptr);
break;
}
/* Drop an item */
case 'd':
{
- if (!p_ptr->wild_mode) do_cmd_drop(p_ptr);
+ if (!creature_ptr->wild_mode) do_cmd_drop(creature_ptr);
break;
}
/* Destroy an item */
case 'k':
{
- do_cmd_destroy(p_ptr);
+ do_cmd_destroy(creature_ptr);
break;
}
/* Equipment list */
case 'e':
{
- do_cmd_equip(p_ptr);
+ do_cmd_equip(creature_ptr);
break;
}
/* Inventory list */
case 'i':
{
- do_cmd_inven(p_ptr);
+ do_cmd_inven(creature_ptr);
break;
}
/* Identify an object */
case 'I':
{
- do_cmd_observe(p_ptr);
+ do_cmd_observe(creature_ptr);
break;
}
case KTRL('I'):
{
- toggle_inven_equip(p_ptr);
+ toggle_inven_equip(creature_ptr);
break;
}
/* Alter a grid */
case '+':
{
- if (!p_ptr->wild_mode) do_cmd_alter(p_ptr);
+ if (!creature_ptr->wild_mode) do_cmd_alter(creature_ptr);
break;
}
/* Dig a tunnel */
case 'T':
{
- if (!p_ptr->wild_mode) do_cmd_tunnel(p_ptr);
+ if (!creature_ptr->wild_mode) do_cmd_tunnel(creature_ptr);
break;
}
/* Move (usually pick up things) */
case ';':
{
- do_cmd_walk(p_ptr, FALSE);
+ do_cmd_walk(creature_ptr, FALSE);
break;
}
/* Move (usually do not pick up) */
case '-':
{
- do_cmd_walk(p_ptr, TRUE);
+ do_cmd_walk(creature_ptr, TRUE);
break;
}
/* Begin Running -- Arg is Max Distance */
case '.':
{
- if (!p_ptr->wild_mode) do_cmd_run(p_ptr);
+ if (!creature_ptr->wild_mode) do_cmd_run(creature_ptr);
break;
}
/* Stay still (usually pick things up) */
case ',':
{
- do_cmd_stay(p_ptr, always_pickup);
+ do_cmd_stay(creature_ptr, always_pickup);
break;
}
/* Stay still (usually do not pick up) */
case 'g':
{
- do_cmd_stay(p_ptr, !always_pickup);
+ do_cmd_stay(creature_ptr, !always_pickup);
break;
}
/* Rest -- Arg is time */
case 'R':
{
- do_cmd_rest(p_ptr);
+ do_cmd_rest(creature_ptr);
break;
}
/* Search for traps/doors */
case 's':
{
- do_cmd_search(p_ptr);
+ do_cmd_search(creature_ptr);
break;
}
case 'S':
{
- if (p_ptr->action == ACTION_SEARCH) set_action(p_ptr, ACTION_NONE);
- else set_action(p_ptr, ACTION_SEARCH);
+ if (creature_ptr->action == ACTION_SEARCH) set_action(creature_ptr, ACTION_NONE);
+ else set_action(creature_ptr, ACTION_SEARCH);
break;
}
/* Go up staircase */
case '<':
{
- if (!p_ptr->wild_mode && !current_floor_ptr->dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
+ if (!creature_ptr->wild_mode && !p_ptr->current_floor_ptr->dun_level && !creature_ptr->inside_arena && !creature_ptr->inside_quest)
{
if (vanilla_town) break;
- if (p_ptr->ambush_flag)
+ if (creature_ptr->ambush_flag)
{
msg_print(_("襲撃から逃げるにはマップの端まで移動しなければならない。", "To flee the ambush you have to reach the edge of the map."));
break;
}
- if (p_ptr->food < PY_FOOD_WEAK)
+ if (creature_ptr->food < PY_FOOD_WEAK)
{
msg_print(_("その前に食事をとらないと。", "You must eat something here."));
break;
change_wild_mode(FALSE);
}
else
- do_cmd_go_up(p_ptr);
+ do_cmd_go_up(creature_ptr);
break;
}
/* Go down staircase */
case '>':
{
- if (p_ptr->wild_mode)
+ if (creature_ptr->wild_mode)
change_wild_mode(FALSE);
else
- do_cmd_go_down(p_ptr);
+ do_cmd_go_down(creature_ptr);
break;
}
/* Open a door or chest */
case 'o':
{
- do_cmd_open(p_ptr);
+ do_cmd_open(creature_ptr);
break;
}
/* Close a door */
case 'c':
{
- do_cmd_close(p_ptr);
+ do_cmd_close(creature_ptr);
break;
}
/* Jam a door with spikes */
case 'j':
{
- do_cmd_spike(p_ptr);
+ do_cmd_spike(creature_ptr);
break;
}
/* Bash a door */
case 'B':
{
- do_cmd_bash(p_ptr);
+ do_cmd_bash(creature_ptr);
break;
}
/* Disarm a trap or chest */
case 'D':
{
- do_cmd_disarm(p_ptr);
+ do_cmd_disarm(creature_ptr);
break;
}
/* Gain new spells/prayers */
case 'G':
{
- if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
+ if ((creature_ptr->pclass == CLASS_SORCERER) || (creature_ptr->pclass == CLASS_RED_MAGE))
msg_print(_("呪文を学習する必要はない!", "You don't have to learn spells!"));
- else if (p_ptr->pclass == CLASS_SAMURAI)
- do_cmd_gain_hissatsu(p_ptr);
- else if (p_ptr->pclass == CLASS_MAGIC_EATER)
- import_magic_device();
+ else if (creature_ptr->pclass == CLASS_SAMURAI)
+ do_cmd_gain_hissatsu(creature_ptr);
+ else if (creature_ptr->pclass == CLASS_MAGIC_EATER)
+ import_magic_device(creature_ptr);
else
- do_cmd_study(p_ptr);
+ do_cmd_study(creature_ptr);
break;
}
/* Browse a book */
case 'b':
{
- if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
- (p_ptr->pclass == CLASS_BERSERKER) ||
- (p_ptr->pclass == CLASS_NINJA) ||
- (p_ptr->pclass == CLASS_MIRROR_MASTER)
+ if ( (creature_ptr->pclass == CLASS_MINDCRAFTER) ||
+ (creature_ptr->pclass == CLASS_BERSERKER) ||
+ (creature_ptr->pclass == CLASS_NINJA) ||
+ (creature_ptr->pclass == CLASS_MIRROR_MASTER)
) do_cmd_mind_browse();
- else if (p_ptr->pclass == CLASS_SMITH)
- do_cmd_kaji(p_ptr, TRUE);
- else if (p_ptr->pclass == CLASS_MAGIC_EATER)
- do_cmd_magic_eater(p_ptr, TRUE, FALSE);
- else if (p_ptr->pclass == CLASS_SNIPER)
- do_cmd_snipe_browse(p_ptr);
- else do_cmd_browse(p_ptr);
+ else if (creature_ptr->pclass == CLASS_SMITH)
+ do_cmd_kaji(creature_ptr, TRUE);
+ else if (creature_ptr->pclass == CLASS_MAGIC_EATER)
+ do_cmd_magic_eater(creature_ptr, TRUE, FALSE);
+ else if (creature_ptr->pclass == CLASS_SNIPER)
+ do_cmd_snipe_browse(creature_ptr);
+ else do_cmd_browse(creature_ptr);
break;
}
case 'm':
{
/* -KMW- */
- if (!p_ptr->wild_mode)
+ if (!creature_ptr->wild_mode)
{
- if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_CAVALRY))
+ if ((creature_ptr->pclass == CLASS_WARRIOR) || (creature_ptr->pclass == CLASS_ARCHER) || (creature_ptr->pclass == CLASS_CAVALRY))
{
msg_print(_("呪文を唱えられない!", "You cannot cast spells!"));
}
- else if (current_floor_ptr->dun_level && (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
+ else if (p_ptr->current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH))
{
msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!"));
msg_print(NULL);
}
- else if (p_ptr->anti_magic && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
+ else if (creature_ptr->anti_magic && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH))
{
concptr which_power = _("魔法", "magic");
- if (p_ptr->pclass == CLASS_MINDCRAFTER)
+ if (creature_ptr->pclass == CLASS_MINDCRAFTER)
which_power = _("超能力", "psionic powers");
- else if (p_ptr->pclass == CLASS_IMITATOR)
+ else if (creature_ptr->pclass == CLASS_IMITATOR)
which_power = _("ものまね", "imitation");
- else if (p_ptr->pclass == CLASS_SAMURAI)
+ else if (creature_ptr->pclass == CLASS_SAMURAI)
which_power = _("必殺剣", "hissatsu");
- else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
+ else if (creature_ptr->pclass == CLASS_MIRROR_MASTER)
which_power = _("鏡魔法", "mirror magic");
- else if (p_ptr->pclass == CLASS_NINJA)
+ else if (creature_ptr->pclass == CLASS_NINJA)
which_power = _("忍術", "ninjutsu");
else if (mp_ptr->spell_book == TV_LIFE_BOOK)
which_power = _("祈り", "prayer");
msg_format(_("反魔法バリアが%sを邪魔した!", "An anti-magic shell disrupts your %s!"), which_power);
- free_turn(p_ptr);
+ free_turn(creature_ptr);
}
- else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER))
+ else if (creature_ptr->shero && (creature_ptr->pclass != CLASS_BERSERKER))
{
msg_format(_("狂戦士化していて頭が回らない!", "You cannot think directly!"));
- free_turn(p_ptr);
+ free_turn(creature_ptr);
}
else
{
- if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
- (p_ptr->pclass == CLASS_BERSERKER) ||
- (p_ptr->pclass == CLASS_NINJA) ||
- (p_ptr->pclass == CLASS_MIRROR_MASTER)
+ if ((creature_ptr->pclass == CLASS_MINDCRAFTER) ||
+ (creature_ptr->pclass == CLASS_BERSERKER) ||
+ (creature_ptr->pclass == CLASS_NINJA) ||
+ (creature_ptr->pclass == CLASS_MIRROR_MASTER)
)
do_cmd_mind();
- else if (p_ptr->pclass == CLASS_IMITATOR)
- do_cmd_mane(p_ptr, FALSE);
- else if (p_ptr->pclass == CLASS_MAGIC_EATER)
- do_cmd_magic_eater(p_ptr, FALSE, FALSE);
- else if (p_ptr->pclass == CLASS_SAMURAI)
- do_cmd_hissatsu(p_ptr);
- else if (p_ptr->pclass == CLASS_BLUE_MAGE)
+ else if (creature_ptr->pclass == CLASS_IMITATOR)
+ do_cmd_mane(creature_ptr, FALSE);
+ else if (creature_ptr->pclass == CLASS_MAGIC_EATER)
+ do_cmd_magic_eater(creature_ptr, FALSE, FALSE);
+ else if (creature_ptr->pclass == CLASS_SAMURAI)
+ do_cmd_hissatsu(creature_ptr);
+ else if (creature_ptr->pclass == CLASS_BLUE_MAGE)
do_cmd_cast_learned();
- else if (p_ptr->pclass == CLASS_SMITH)
- do_cmd_kaji(p_ptr, FALSE);
- else if (p_ptr->pclass == CLASS_SNIPER)
- do_cmd_snipe(p_ptr);
+ else if (creature_ptr->pclass == CLASS_SMITH)
+ do_cmd_kaji(creature_ptr, FALSE);
+ else if (creature_ptr->pclass == CLASS_SNIPER)
+ do_cmd_snipe(creature_ptr);
else
- do_cmd_cast(p_ptr);
+ do_cmd_cast(creature_ptr);
}
}
break;
/* Issue a pet command */
case 'p':
{
- do_cmd_pet(p_ptr);
+ do_cmd_pet(creature_ptr);
break;
}
/* Inscribe an object */
case '{':
{
- do_cmd_inscribe(p_ptr);
+ do_cmd_inscribe(creature_ptr);
break;
}
/* Uninscribe an object */
case '}':
{
- do_cmd_uninscribe(p_ptr);
+ do_cmd_uninscribe(creature_ptr);
break;
}
/* Activate an artifact */
case 'A':
{
- do_cmd_activate(p_ptr);
+ do_cmd_activate(creature_ptr);
break;
}
/* Eat some food */
case 'E':
{
- do_cmd_eat_food(p_ptr);
+ do_cmd_eat_food(creature_ptr);
break;
}
/* Fuel your lantern/torch */
case 'F':
{
- do_cmd_refill(p_ptr);
+ do_cmd_refill(creature_ptr);
break;
}
/* Fire an item */
case 'f':
{
- do_cmd_fire(p_ptr, SP_NONE);
+ do_cmd_fire(creature_ptr, SP_NONE);
break;
}
/* Throw an item */
case 'v':
{
- do_cmd_throw(p_ptr, 1, FALSE, -1);
+ do_cmd_throw(creature_ptr, 1, FALSE, -1);
break;
}
/* Aim a wand */
case 'a':
{
- do_cmd_aim_wand(p_ptr);
+ do_cmd_aim_wand(creature_ptr);
break;
}
{
if (use_command && rogue_like_commands)
{
- do_cmd_use(p_ptr);
+ do_cmd_use(creature_ptr);
}
else
{
- do_cmd_zap_rod(p_ptr);
+ do_cmd_zap_rod(creature_ptr);
}
break;
}
/* Quaff a potion */
case 'q':
{
- do_cmd_quaff_potion(p_ptr);
+ do_cmd_quaff_potion(creature_ptr);
break;
}
/* Read a scroll */
case 'r':
{
- do_cmd_read_scroll(p_ptr);
+ do_cmd_read_scroll(creature_ptr);
break;
}
case 'u':
{
if (use_command && !rogue_like_commands)
- do_cmd_use(p_ptr);
+ do_cmd_use(creature_ptr);
else
- do_cmd_use_staff(p_ptr);
+ do_cmd_use_staff(creature_ptr);
break;
}
/* Use racial power */
case 'U':
{
- do_cmd_racial_power(p_ptr);
+ do_cmd_racial_power(creature_ptr);
break;
}
/* Locate player on map */
case 'L':
{
- do_cmd_locate(p_ptr);
+ do_cmd_locate(creature_ptr);
break;
}
/* Character description */
case 'C':
{
- do_cmd_player_status(p_ptr);
+ do_cmd_player_status(creature_ptr);
break;
}
/* Interact with macros */
case '@':
{
- do_cmd_macros(p_ptr);
+ do_cmd_macros(creature_ptr);
break;
}
/* Interact with visuals */
case '%':
{
- do_cmd_visuals(p_ptr);
- do_cmd_redraw(p_ptr);
+ do_cmd_visuals(creature_ptr);
+ do_cmd_redraw(creature_ptr);
break;
}
/* Interact with colors */
case '&':
{
- do_cmd_colors(p_ptr);
- do_cmd_redraw(p_ptr);
+ do_cmd_colors(creature_ptr);
+ do_cmd_redraw(creature_ptr);
break;
}
{
do_cmd_options();
(void)combine_and_reorder_home(STORE_HOME);
- do_cmd_redraw(p_ptr);
+ do_cmd_redraw(creature_ptr);
break;
}
/* Repeat level feeling */
case KTRL('F'):
{
- do_cmd_feeling(p_ptr);
+ do_cmd_feeling(creature_ptr);
break;
}
case KTRL('R'):
{
now_message = old_now_message;
- do_cmd_redraw(p_ptr);
+ do_cmd_redraw(creature_ptr);
break;
}
/* Quit (commit suicide) */
case 'Q':
{
- do_cmd_suicide(p_ptr);
+ do_cmd_suicide(creature_ptr);
break;
}
#ifdef TRAVEL
case '`':
{
- if (!p_ptr->wild_mode) do_cmd_travel();
- if (p_ptr->special_defense & KATA_MUSOU)
+ if (!creature_ptr->wild_mode) do_cmd_travel(creature_ptr);
+ if (creature_ptr->special_defense & KATA_MUSOU)
{
- set_action(p_ptr, ACTION_NONE);
+ set_action(creature_ptr, ACTION_NONE);
}
break;
}
break;
}
}
- if (!p_ptr->energy_use && !now_message)
+ if (!creature_ptr->energy_use && !now_message)
now_message = old_now_message;
}
MONRACE_IDX r_idx;
bool success = FALSE;
get_mon_num_prep(monster_is_fishing_target, NULL);
- r_idx = get_mon_num(current_floor_ptr->dun_level ? current_floor_ptr->dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
+ r_idx = get_mon_num(p_ptr->current_floor_ptr->dun_level ? p_ptr->current_floor_ptr->dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
msg_print(NULL);
if (r_idx && one_in_(2))
{
if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
{
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx], 0);
+ monster_desc(m_name, &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[y][x].m_idx], 0);
msg_format(_("%sが釣れた!", "You have a good catch!"), m_name);
success = TRUE;
}
if (p_ptr->phase_out)
{
- for(m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
+ for(m_idx = 1; m_idx < p_ptr->current_floor_ptr->m_max; m_idx++)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
if (!monster_is_valid(m_ptr)) continue;
if (p_ptr->riding && !p_ptr->confused && !p_ptr->blind)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[p_ptr->riding];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->riding];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (MON_CSLEEP(m_ptr))
command_cmd = SPECIAL_KEY_BUILDING;
/* Process the command */
- process_command();
+ process_command(p_ptr);
}
/* Paralyzed or Knocked Out */
prt("", 0, 0);
/* Process the command */
- process_command();
+ process_command(p_ptr);
}
/* Normal command */
can_save = FALSE;
/* Process the command */
- process_command();
+ process_command(p_ptr);
}
/* Hack -- Pack Overflow */
if (p_ptr->image) p_ptr->redraw |= (PR_MAP);
/* Shimmer multi-hued monsters */
- for (m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
+ for (m_idx = 1; m_idx < p_ptr->current_floor_ptr->m_max; m_idx++)
{
monster_type *m_ptr;
monster_race *r_ptr;
- m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
if (!monster_is_valid(m_ptr)) continue;
/* Skip unseen monsters */
repair_monsters = FALSE;
/* Rotate detection flags */
- for (m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
+ for (m_idx = 1; m_idx < p_ptr->current_floor_ptr->m_max; m_idx++)
{
monster_type *m_ptr;
- m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
if (!monster_is_valid(m_ptr)) continue;
/* Nice monsters get mean */
int quest_num = 0;
/* Set the base level */
- current_floor_ptr->base_level = current_floor_ptr->dun_level;
+ p_ptr->current_floor_ptr->base_level = p_ptr->current_floor_ptr->dun_level;
/* Reset various flags */
current_world_ptr->is_loading_now = FALSE;
disturb(p_ptr, TRUE, TRUE);
/* Get index of current quest (if any) */
- quest_num = quest_number(current_floor_ptr->dun_level);
+ quest_num = quest_number(p_ptr->current_floor_ptr->dun_level);
/* Inside a quest? */
if (quest_num)
/* Track maximum dungeon level (if not in quest -KMW-) */
- if ((max_dlv[p_ptr->dungeon_idx] < current_floor_ptr->dun_level) && !p_ptr->inside_quest)
+ if ((max_dlv[p_ptr->dungeon_idx] < p_ptr->current_floor_ptr->dun_level) && !p_ptr->inside_quest)
{
- max_dlv[p_ptr->dungeon_idx] = current_floor_ptr->dun_level;
- if (record_maxdepth) exe_write_diary(p_ptr, NIKKI_MAXDEAPTH, current_floor_ptr->dun_level, NULL);
+ max_dlv[p_ptr->dungeon_idx] = p_ptr->current_floor_ptr->dun_level;
+ if (record_maxdepth) exe_write_diary(p_ptr, NIKKI_MAXDEAPTH, p_ptr->current_floor_ptr->dun_level, NULL);
}
(void)calculate_upkeep(p_ptr);
/* Print quest message if appropriate */
if (!p_ptr->inside_quest && (p_ptr->dungeon_idx == DUNGEON_ANGBAND))
{
- quest_discovery(random_quest_number(current_floor_ptr->dun_level));
- p_ptr->inside_quest = random_quest_number(current_floor_ptr->dun_level);
+ quest_discovery(random_quest_number(p_ptr->current_floor_ptr->dun_level));
+ p_ptr->inside_quest = random_quest_number(p_ptr->current_floor_ptr->dun_level);
}
- if ((current_floor_ptr->dun_level == d_info[p_ptr->dungeon_idx].maxdepth) && d_info[p_ptr->dungeon_idx].final_guardian)
+ if ((p_ptr->current_floor_ptr->dun_level == d_info[p_ptr->dungeon_idx].maxdepth) && d_info[p_ptr->dungeon_idx].final_guardian)
{
if (r_info[d_info[p_ptr->dungeon_idx].final_guardian].max_num)
#ifdef JP
/*** Process this dungeon level ***/
/* Reset the monster generation level */
- current_floor_ptr->monster_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level;
/* Reset the object generation level */
- current_floor_ptr->object_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
current_world_ptr->is_loading_now = TRUE;
if (p_ptr->energy_need > 0 && !p_ptr->phase_out &&
- (current_floor_ptr->dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
+ (p_ptr->current_floor_ptr->dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
p_ptr->energy_need = 0;
/* Not leaving dungeon */
while (TRUE)
{
/* Hack -- Compact the monster list occasionally */
- if ((current_floor_ptr->m_cnt + 32 > current_floor_ptr->max_m_idx) && !p_ptr->phase_out) compact_monsters(64);
+ if ((p_ptr->current_floor_ptr->m_cnt + 32 > current_world_ptr->max_m_idx) && !p_ptr->phase_out) compact_monsters(64);
/* Hack -- Compress the monster list occasionally */
- if ((current_floor_ptr->m_cnt + 32 < current_floor_ptr->m_max) && !p_ptr->phase_out) compact_monsters(0);
+ if ((p_ptr->current_floor_ptr->m_cnt + 32 < p_ptr->current_floor_ptr->m_max) && !p_ptr->phase_out) compact_monsters(0);
/* Hack -- Compact the object list occasionally */
- if (current_floor_ptr->o_cnt + 32 > current_floor_ptr->max_o_idx) compact_objects(64);
+ if (p_ptr->current_floor_ptr->o_cnt + 32 > current_world_ptr->max_o_idx) compact_objects(64);
/* Hack -- Compress the object list occasionally */
- if (current_floor_ptr->o_cnt + 32 < current_floor_ptr->o_max) compact_objects(0);
+ if (p_ptr->current_floor_ptr->o_cnt + 32 < p_ptr->current_floor_ptr->o_max) compact_objects(0);
/* Process the player */
process_player();
* Maintain Unique monsters and artifact, save current
* floor, then prepare next floor
*/
- leave_floor(p_ptr->change_floor_mode);
+ leave_floor(p_ptr);
/* Forget the flag */
reinit_wilderness = FALSE;
current_world_ptr->character_dungeon = FALSE;
/* Start in town */
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
p_ptr->inside_quest = 0;
p_ptr->inside_arena = FALSE;
p_ptr->phase_out = FALSE;
if (p_ptr->riding == -1)
{
p_ptr->riding = 0;
- for (i = current_floor_ptr->m_max; i > 0; i--)
+ for (i = p_ptr->current_floor_ptr->m_max; i > 0; i--)
{
- if (player_bold(current_floor_ptr->m_list[i].fy, current_floor_ptr->m_list[i].fx))
+ if (player_bold(p_ptr->current_floor_ptr->m_list[i].fy, p_ptr->current_floor_ptr->m_list[i].fx))
{
p_ptr->riding = i;
break;
record_o_name[0] = '\0';
/* Reset map panel */
- panel_row_min = current_floor_ptr->height;
- panel_col_min = current_floor_ptr->width;
+ panel_row_min = p_ptr->current_floor_ptr->height;
+ panel_col_min = p_ptr->current_floor_ptr->width;
/* Sexy gal gets bonus to maximum weapon skill of whip */
if (p_ptr->pseikaku == SEIKAKU_SEXY)
}
/* Initialize the town-buildings if necessary */
- if (!current_floor_ptr->dun_level && !p_ptr->inside_quest)
+ if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_quest)
{
process_dungeon_file("w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
init_flags = INIT_ONLY_BUILDINGS;
process_dungeon_file("t_info.txt", 0, 0, MAX_HGT, MAX_WID);
- select_floor_music();
+ select_floor_music(p_ptr);
}
/* Generate a dungeon level if needed */
monster_race *r_ptr = &r_info[pet_r_idx];
place_monster_aux(0, p_ptr->y, p_ptr->x - 1, pet_r_idx,
(PM_FORCE_PET | PM_NO_KAGE));
- m_ptr = ¤t_floor_ptr->m_list[hack_m_idx_ii];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[hack_m_idx_ii];
m_ptr->mspeed = r_ptr->speed;
m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2;
m_ptr->max_maxhp = m_ptr->maxhp;
(void)combine_and_reorder_home(STORE_HOME);
(void)combine_and_reorder_home(STORE_MUSEUM);
- select_floor_music();
+ select_floor_music(p_ptr);
/* Process */
while (TRUE)
/* Cancel the health bar */
health_track(0);
- forget_lite();
+ forget_lite(p_ptr->current_floor_ptr);
forget_view();
- clear_mon_lite(current_floor_ptr);
+ clear_mon_lite(p_ptr->current_floor_ptr);
/* Handle "quit and save" */
if (!p_ptr->playing && !p_ptr->is_dead) break;
- /* Erase the old current_floor_ptr->grid_array */
+ /* Erase the old p_ptr->current_floor_ptr->grid_array */
wipe_o_list();
if (!p_ptr->is_dead) wipe_m_list();
prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_RAND_CONNECT);
/* prepare next floor */
- leave_floor(p_ptr->change_floor_mode);
+ leave_floor(p_ptr);
}
else
{
if (current_world_ptr->game_turn > rollback_turns) current_world_ptr->game_turn -= rollback_turns;
else current_world_ptr->game_turn = 1;
- if (current_floor_ptr->generated_turn > rollback_turns) current_floor_ptr->generated_turn -= rollback_turns;
- else current_floor_ptr->generated_turn = 1;
+ if (p_ptr->current_floor_ptr->generated_turn > rollback_turns) p_ptr->current_floor_ptr->generated_turn -= rollback_turns;
+ else p_ptr->current_floor_ptr->generated_turn = 1;
if (current_world_ptr->arena_start_turn > rollback_turns) current_world_ptr->arena_start_turn -= rollback_turns;
else current_world_ptr->arena_start_turn = 1;
if (p_ptr->feeling_turn > rollback_turns) p_ptr->feeling_turn -= rollback_turns;