bool old_mighty_throw = creature_ptr->mighty_throw;
/* Current feature under player. */
- feature_type *f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat];
+ floor_type *floor_ptr = floor_ptr;
+ feature_type *f_ptr = &f_info[floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat];
/* Save the old armor class */
ARMOUR_CLASS old_dis_ac = creature_ptr->dis_ac;
ARMOUR_CLASS old_dis_to_a = creature_ptr->dis_to_a;
-
-
+
/* Clear extra blows/shots */
extra_blows[0] = extra_blows[1] = 0;
{
creature_ptr->resist_neth = TRUE;
}
+
if (creature_ptr->tim_sh_fire)
{
creature_ptr->sh_fire = TRUE;
}
+
if (creature_ptr->tim_res_time)
{
creature_ptr->resist_time = TRUE;
new_speed += (creature_ptr->lev) / 10 + 5;
}
- if (music_singing(p_ptr, MUSIC_WALL))
+ if (music_singing(creature_ptr, MUSIC_WALL))
{
creature_ptr->kill_wall = TRUE;
}
creature_ptr->stat_add[i] += (tmp_rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i]);
}
-
/* I'm adding the mutations here for the lack of a better place... */
if (creature_ptr->muta3)
{
/* Hex bonuses */
if (creature_ptr->realm1 == REALM_HEX)
{
- if (hex_spelling_any(p_ptr)) creature_ptr->skill_stl -= (1 + CASTING_HEX_NUM(creature_ptr));
+ if (hex_spelling_any(creature_ptr)) creature_ptr->skill_stl -= (1 + CASTING_HEX_NUM(creature_ptr));
if (hex_spelling(HEX_DETECT_EVIL)) creature_ptr->esp_evil = TRUE;
if (hex_spelling(HEX_XTRA_MIGHT)) creature_ptr->stat_add[A_STR] += 4;
if (hex_spelling(HEX_BUILDING))
}
}
-
/* Apply temporary "stun" */
if (creature_ptr->stun > 50)
{
{
creature_ptr->resist_fear = TRUE;
}
-
-
+
/* Hack -- Telepathy Change */
if (creature_ptr->telepathy != old_telepathy)
{
}
else
{
- monster_type *riding_m_ptr = &p_ptr->current_floor_ptr->m_list[creature_ptr->riding];
+ monster_type *riding_m_ptr = &floor_ptr->m_list[creature_ptr->riding];
monster_race *riding_r_ptr = &r_info[riding_m_ptr->r_idx];
SPEED speed = riding_m_ptr->mspeed;
}
}
-
/* Actual Modifier Bonuses (Un-inflate stat bonuses) */
creature_ptr->to_a += ((int)(adj_dex_ta[creature_ptr->stat_ind[A_DEX]]) - 128);
creature_ptr->to_d[0] += ((int)(adj_str_td[creature_ptr->stat_ind[A_STR]]) - 128);
}
else
{
- penalty = r_info[p_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level - creature_ptr->skill_exp[GINOU_RIDING] / 80;
+ penalty = r_info[floor_ptr->m_list[creature_ptr->riding].r_idx].level - creature_ptr->skill_exp[GINOU_RIDING] / 80;
penalty += 30;
if (penalty < 30) penalty = 30;
}
}
else
{
- penalty = r_info[p_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level - creature_ptr->skill_exp[GINOU_RIDING] / 80;
+ penalty = r_info[floor_ptr->m_list[creature_ptr->riding].r_idx].level - creature_ptr->skill_exp[GINOU_RIDING] / 80;
penalty += 30;
if (penalty < 30) penalty = 30;
}
/* Affect Skill -- combat (throwing) (Level, by Class) */
creature_ptr->skill_tht += ((cp_ptr->x_thb * creature_ptr->lev / 10) + (ap_ptr->a_thb * creature_ptr->lev / 50));
-
if ((PRACE_IS_(creature_ptr, RACE_S_FAIRY)) && (creature_ptr->pseikaku != SEIKAKU_SEXY) && (creature_ptr->cursed & TRC_AGGRAVATE))
{
creature_ptr->cursed &= ~(TRC_AGGRAVATE);
if (creature_ptr->immune_elec) creature_ptr->resist_elec = TRUE;
if (creature_ptr->immune_fire) creature_ptr->resist_fire = TRUE;
if (creature_ptr->immune_cold) creature_ptr->resist_cold = TRUE;
-
-
+
/* Hack -- handle "xtra" mode */
if (current_world_ptr->character_xtra) return;
if ((creature_ptr->inventory_list[i].tval == TV_CRAFT_BOOK) && (creature_ptr->inventory_list[i].sval == 2)) have_kabe = TRUE;
}
- for (this_o_idx = p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
+ o_ptr = &floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
#if 0
creature_ptr->align = 0;
int i, j, neutral[2];
- for (m_idx = creature_ptr->current_floor_ptr->m_max - 1; m_idx >= 1; m_idx--)
+ floor_type *floor_ptr = creature_ptr->current_floor_ptr;
+ for (m_idx = floor_ptr->m_max - 1; m_idx >= 1; m_idx--)
{
monster_type *m_ptr;
monster_race *r_ptr;
- m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
+ m_ptr = &floor_ptr->m_list[m_idx];
if (!monster_is_valid(m_ptr)) continue;
r_ptr = &r_info[m_ptr->r_idx];
}
}
+
/*!
* @brief プレイヤーの最大HPを計算する /
* Calculate the players (maximal) hit points
}
}
+
/*!
* @brief プレイヤーの光源半径を計算する / Extract and set the current "lite radius"
* @return なし
}
}
+
/*!
* @brief プレイヤーの現在学習可能な魔法数を計算し、増減に応じて魔法の忘却、再学習を処置する。 /
* Calculate number of spells player should have, and forget,
}
#ifdef JP
- msg_format("%sの%sを忘れてしまった。", exe_spell(p_ptr, which, j % 32, SPELL_NAME), p);
+ msg_format("%sの%sを忘れてしまった。", exe_spell(creature_ptr, which, j % 32, SPELL_NAME), p);
#else
- msg_format("You have forgotten the %s of %s.", p, exe_spell(p_ptr, which, j % 32, SPELL_NAME));
+ msg_format("You have forgotten the %s of %s.", p, exe_spell(creature_ptr, which, j % 32, SPELL_NAME));
#endif
}
}
-
/* Forget spells if we know too many spells */
for (i = 63; i >= 0; i--)
{
}
#ifdef JP
- msg_format("%sの%sを忘れてしまった。", exe_spell(p_ptr, which, j % 32, SPELL_NAME), p);
+ msg_format("%sの%sを忘れてしまった。", exe_spell(creature_ptr, which, j % 32, SPELL_NAME), p);
#else
- msg_format("You have forgotten the %s of %s.", p, exe_spell(p_ptr, which, j % 32, SPELL_NAME));
+ msg_format("You have forgotten the %s of %s.", p, exe_spell(creature_ptr, which, j % 32, SPELL_NAME));
#endif
-
/* One more can be learned */
creature_ptr->new_spells++;
}
}
-
/* Check for spells to remember */
for (i = 0; i < 64; i++)
{
}
#ifdef JP
- msg_format("%sの%sを思い出した。", exe_spell(p_ptr, which, j % 32, SPELL_NAME), p);
+ msg_format("%sの%sを思い出した。", exe_spell(creature_ptr, which, j % 32, SPELL_NAME), p);
#else
- msg_format("You have remembered the %s of %s.", p, exe_spell(p_ptr, which, j % 32, SPELL_NAME));
+ msg_format("You have remembered the %s of %s.", p, exe_spell(creature_ptr, which, j % 32, SPELL_NAME));
#endif
-
/* One less can be learned */
creature_ptr->new_spells--;
}
}
}
+
/*!
* @brief プレイヤーの最大MPを計算する /
* Calculate maximum mana. You do not need to know any spells.
msp = (3 * msp) / 4;
}
}
-
-
+
/* Assume player not encumbered by armor */
creature_ptr->cumber_armor = FALSE;
}
}
+
/*!
* @brief 装備中の射撃武器の威力倍率を返す /
* calcurate the fire rate of target object
return (s16b)num;
}
+
/*!
* @brief プレイヤーの所持重量制限を計算する /
* Computes current weight limit.
return i;
}
+
/*!
* @brief プレイヤーが現在右手/左手に武器を持っているか判定する /
* @param i 判定する手のID(右手:0 左手:1)
return ((creature_ptr->inventory_list[i].k_idx && object_is_melee_weapon(&creature_ptr->inventory_list[i])) ? TRUE : FALSE);
}
+
/*!
* @brief プレイヤーの現在開いている手の状態を返す
* @param riding_control 乗馬中により片手を必要としている状態ならばTRUEを返す。
return (monk_arm_wgt > (100 + (creature_ptr->lev * 4)));
}
+
/*!
* @brief update のフラグに応じた更新をまとめて行う / Handle "update"
* @return なし
{
if (!creature_ptr->update) return;
- floor_type *floor_ptr = creature_ptr->current_floor_ptr;
+ floor_type *floor_ptr = floor_ptr;
if (creature_ptr->update & (PU_AUTODESTROY))
{
creature_ptr->update &= ~(PU_AUTODESTROY);
if (o_ptr->k_idx && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
}
- for (i = p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
+ floor_type *floor_ptr = creature_ptr->current_floor_ptr;
+ for (i = floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
{
- o_ptr = &p_ptr->current_floor_ptr->o_list[i];
+ o_ptr = &floor_ptr->o_list[i];
if (o_ptr->k_idx && (o_ptr->marked & OM_FOUND) && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
}
return TRUE;
}
+
void take_turn(player_type *creature_ptr, PERCENTAGE need_cost)
{
creature_ptr->energy_use = (ENERGY)need_cost;
}
+
void free_turn(player_type *creature_ptr)
{
creature_ptr->energy_use = 0;
}
+
/*!
* @brief プレイヤーを指定座標に配置する / Place the player in the dungeon XXX XXX
* @param x 配置先X座標
return TRUE;
}
+
/*!
* @brief 種族アンバライトが出血時パターンの上に乗った際のペナルティ処理
* @return なし
{
int to_ruin = 0;
POSITION r_y, r_x;
- int pattern_type = f_info[p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat].subtype;
+ floor_type *floor_ptr = floor_ptr;
+ int pattern_type = f_info[floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat].subtype;
if (pattern_type == PATTERN_TILE_WRECKED)
{
while (to_ruin--)
{
- scatter(p_ptr->current_floor_ptr, &r_y, &r_x, creature_ptr->y, creature_ptr->x, 4, 0);
+ scatter(floor_ptr, &r_y, &r_x, creature_ptr->y, creature_ptr->x, 4, 0);
if (pattern_tile(r_y, r_x) &&
- (f_info[p_ptr->current_floor_ptr->grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
+ (f_info[floor_ptr->grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
{
- cave_set_feat(p_ptr->current_floor_ptr, r_y, r_x, feat_pattern_corrupted);
+ cave_set_feat(floor_ptr, r_y, r_x, feat_pattern_corrupted);
}
}
- cave_set_feat(p_ptr->current_floor_ptr, creature_ptr->y, creature_ptr->x, feat_pattern_corrupted);
+ cave_set_feat(floor_ptr, creature_ptr->y, creature_ptr->x, feat_pattern_corrupted);
}
handle_stuff(creature_ptr);
}
+
/*!
* @brief プレイヤーの経験値について整合性のためのチェックと調整を行う /
* Advance experience levels and print experience
}
level_inc_stat = TRUE;
- exe_write_diary(p_ptr, NIKKI_LEVELUP, creature_ptr->lev, NULL);
+ exe_write_diary(creature_ptr, NIKKI_LEVELUP, creature_ptr->lev, NULL);
}
sound(SOUND_LEVEL);
if (old_lev != creature_ptr->lev) autopick_load_pref(creature_ptr, FALSE);
}
+
/*!
* @brief 現在の修正後能力値を3~17及び18/xxx形式に変換する / Converts stat num into a six-char (right justified) string
* @param val 能力値
}
}
+
/*!
* @brief 能力値現在値から3~17及び18/xxx様式に基づく加減算を行う。
* Modify a stat value by a "modifier", return new value
/* Hack -- Prevent starvation */
(void)set_food(creature_ptr, PY_FOOD_MAX - 1);
- p_ptr->current_floor_ptr->dun_level = 0;
- creature_ptr->current_floor_ptr->inside_arena = FALSE;
+ floor_type *floor_ptr = creature_ptr->current_floor_ptr;
+ floor_ptr->dun_level = 0;
+ floor_ptr->inside_arena = FALSE;
creature_ptr->phase_out = FALSE;
leaving_quest = 0;
- creature_ptr->current_floor_ptr->inside_quest = 0;
+ floor_ptr->inside_quest = 0;
if (creature_ptr->dungeon_idx) creature_ptr->recall_dungeon = creature_ptr->dungeon_idx;
creature_ptr->dungeon_idx = 0;
if (lite_town || vanilla_town)
creature_ptr->wild_mode = FALSE;
creature_ptr->leaving = TRUE;
- exe_write_diary(p_ptr, NIKKI_BUNSHOU, 1,
+ exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 1,
_(" しかし、生き返った。",
" but revived."));
/* Prepare next floor */
leave_floor(creature_ptr);
wipe_m_list();
-
}