#endif
}
-
- /* Message (p_ptr->inventory_list) */
else
{
#ifdef JP
* @brief 1プレイヤーターン毎に武器、防具の擬似鑑定が行われるかを判定する。
* @return なし
* @details
- * Sense the p_ptr->inventory_list\n
+ * Sense the inventory\n
*\n
* Class 0 = Warrior --> fast and heavy\n
* Class 1 = Mage --> slow and light\n
}
else if (get_check(_("通常テレポート?", "Normal teleport? ")))
{
- teleport_player(200, 0L);
+ teleport_player(creature_ptr, 200, 0L);
return;
}
else
if (record_stair) exe_write_diary(creature_ptr, NIKKI_PAT_TELE, 0, NULL);
- creature_ptr->inside_quest = 0;
+ creature_ptr->current_floor_ptr->inside_quest = 0;
free_turn(creature_ptr);
/*
(void)restore_level(creature_ptr);
(void)cure_critical_wounds(creature_ptr, 1000);
- cave_set_feat(creature_ptr->y, creature_ptr->x, feat_pattern_old);
+ cave_set_feat(creature_ptr->current_floor_ptr, creature_ptr->y, creature_ptr->x, feat_pattern_old);
msg_print(_("「パターン」のこの部分は他の部分より強力でないようだ。", "This section of the Pattern looks less powerful."));
/*
break;
case PATTERN_TILE_WRECKED:
- if (!IS_INVULN())
+ if (!IS_INVULN(creature_ptr))
take_hit(creature_ptr, DAMAGE_NOESCAPE, 200, _("壊れた「パターン」を歩いたダメージ", "walking the corrupted Pattern"), -1);
break;
default:
if (PRACE_IS_(creature_ptr, RACE_AMBERITE) && !one_in_(2))
return TRUE;
- else if (!IS_INVULN())
+ else if (!IS_INVULN(creature_ptr))
take_hit(creature_ptr, DAMAGE_NOESCAPE, damroll(1, 3), _("「パターン」を歩いたダメージ", "walking the Pattern"), -1);
break;
}
* @param percent 回復比率
* @return なし
*/
-static void regenhp(int percent)
+static void regenhp(player_type *creature_ptr, int percent)
{
HIT_POINT new_chp;
u32b new_chp_frac;
HIT_POINT old_chp;
- if (p_ptr->special_defense & KATA_KOUKIJIN) return;
- if (p_ptr->action == ACTION_HAYAGAKE) return;
+ if (creature_ptr->special_defense & KATA_KOUKIJIN) return;
+ if (creature_ptr->action == ACTION_HAYAGAKE) return;
/* Save the old hitpoints */
- old_chp = p_ptr->chp;
+ old_chp = creature_ptr->chp;
/*
* Extract the new hitpoints
* 'percent' is the Regen factor in unit (1/2^16)
*/
new_chp = 0;
- new_chp_frac = (p_ptr->mhp * percent + PY_REGEN_HPBASE);
+ new_chp_frac = (creature_ptr->mhp * percent + PY_REGEN_HPBASE);
/* Convert the unit (1/2^16) to (1/2^32) */
s64b_LSHIFT(new_chp, new_chp_frac, 16);
/* Regenerating */
- s64b_add(&(p_ptr->chp), &(p_ptr->chp_frac), new_chp, new_chp_frac);
+ s64b_add(&(creature_ptr->chp), &(creature_ptr->chp_frac), new_chp, new_chp_frac);
/* Fully healed */
- if (0 < s64b_cmp(p_ptr->chp, p_ptr->chp_frac, p_ptr->mhp, 0))
+ if (0 < s64b_cmp(creature_ptr->chp, creature_ptr->chp_frac, creature_ptr->mhp, 0))
{
- p_ptr->chp = p_ptr->mhp;
- p_ptr->chp_frac = 0;
+ creature_ptr->chp = creature_ptr->mhp;
+ creature_ptr->chp_frac = 0;
}
/* Notice changes */
- if (old_chp != p_ptr->chp)
+ if (old_chp != creature_ptr->chp)
{
- p_ptr->redraw |= (PR_HP);
- p_ptr->window |= (PW_PLAYER);
+ creature_ptr->redraw |= (PR_HP);
+ creature_ptr->window |= (PW_PLAYER);
wild_regen = 20;
}
}
* @brief プレイヤーの歌に関する継続処理
* @return なし
*/
-static void check_music(player_type *creature_ptr)
+static void check_music(player_type *caster_ptr)
{
const magic_type *s_ptr;
int spell;
u32b need_mana_frac;
/* Music singed by player */
- if (creature_ptr->pclass != CLASS_BARD) return;
- if (!SINGING_SONG_EFFECT(creature_ptr) && !INTERUPTING_SONG_EFFECT(creature_ptr)) return;
+ if (caster_ptr->pclass != CLASS_BARD) return;
+ if (!SINGING_SONG_EFFECT(caster_ptr) && !INTERUPTING_SONG_EFFECT(caster_ptr)) return;
- if (creature_ptr->anti_magic)
+ if (caster_ptr->anti_magic)
{
- stop_singing(creature_ptr);
+ stop_singing(caster_ptr);
return;
}
- spell = SINGING_SONG_ID(creature_ptr);
+ spell = SINGING_SONG_ID(caster_ptr);
s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC][spell];
need_mana = mod_need_mana(s_ptr->smana, spell, REALM_MUSIC);
/* Divide by 2 */
s64b_RSHIFT(need_mana, need_mana_frac, 1);
- if (s64b_cmp(creature_ptr->csp, creature_ptr->csp_frac, need_mana, need_mana_frac) < 0)
+ if (s64b_cmp(caster_ptr->csp, caster_ptr->csp_frac, need_mana, need_mana_frac) < 0)
{
- stop_singing(creature_ptr);
+ stop_singing(caster_ptr);
return;
}
else
{
- s64b_sub(&(creature_ptr->csp), &(creature_ptr->csp_frac), need_mana, need_mana_frac);
+ s64b_sub(&(caster_ptr->csp), &(caster_ptr->csp_frac), need_mana, need_mana_frac);
- creature_ptr->redraw |= PR_MANA;
- if (INTERUPTING_SONG_EFFECT(creature_ptr))
+ caster_ptr->redraw |= PR_MANA;
+ if (INTERUPTING_SONG_EFFECT(caster_ptr))
{
- SINGING_SONG_EFFECT(creature_ptr) = INTERUPTING_SONG_EFFECT(creature_ptr);
- INTERUPTING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
+ SINGING_SONG_EFFECT(caster_ptr) = INTERUPTING_SONG_EFFECT(caster_ptr);
+ INTERUPTING_SONG_EFFECT(caster_ptr) = MUSIC_NONE;
msg_print(_("歌を再開した。", "You restart singing."));
- creature_ptr->action = ACTION_SING;
- creature_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
- creature_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
- creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ caster_ptr->action = ACTION_SING;
+ caster_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
+ caster_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
+ caster_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
}
}
- 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) && (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) && ((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) && ((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; }
+ if (caster_ptr->spell_exp[spell] < SPELL_EXP_BEGINNER)
+ caster_ptr->spell_exp[spell] += 5;
+ else if(caster_ptr->spell_exp[spell] < SPELL_EXP_SKILLED)
+ { if (one_in_(2) && (caster_ptr->current_floor_ptr->dun_level > 4) && ((caster_ptr->current_floor_ptr->dun_level + 10) > caster_ptr->lev)) caster_ptr->spell_exp[spell] += 1; }
+ else if(caster_ptr->spell_exp[spell] < SPELL_EXP_EXPERT)
+ { if (one_in_(5) && ((caster_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && ((caster_ptr->current_floor_ptr->dun_level + 5) > s_ptr->slevel)) caster_ptr->spell_exp[spell] += 1; }
+ else if(caster_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
+ { if (one_in_(5) && ((caster_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && (caster_ptr->current_floor_ptr->dun_level > s_ptr->slevel)) caster_ptr->spell_exp[spell] += 1; }
/* Do any effects of continual song */
- exe_spell(creature_ptr, REALM_MUSIC, spell, SPELL_CONT);
+ exe_spell(caster_ptr, REALM_MUSIC, spell, SPELL_CONT);
}
/*!
/* Calculate damage */
HIT_POINT dam = (PY_FOOD_STARVE - creature_ptr->food) / 10;
- if (!IS_INVULN()) take_hit(creature_ptr, DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
+ if (!IS_INVULN(creature_ptr)) take_hit(creature_ptr, DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
}
}
}
/*** Damage over Time ***/
/* Take damage from poison */
- if (creature_ptr->poisoned && !IS_INVULN())
+ if (creature_ptr->poisoned && !IS_INVULN(creature_ptr))
{
take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, _("毒", "poison"), -1);
}
/* Take damage from cuts */
- if (creature_ptr->cut && !IS_INVULN())
+ if (creature_ptr->cut && !IS_INVULN(creature_ptr))
{
HIT_POINT dam;
/* (Vampires) Take damage from sunlight */
if (PRACE_IS_(creature_ptr, RACE_VAMPIRE) || (creature_ptr->mimic_form == MIMIC_VAMPIRE))
{
- if (!creature_ptr->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(creature_ptr) && is_daytime())
{
if ((creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
{
object_desc(o_name, o_ptr, OD_NAME_ONLY);
sprintf(ouch, _("%sを装備したダメージ", "wielding %s"), o_name);
- if (!IS_INVULN()) take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, ouch, -1);
+ if (!IS_INVULN(creature_ptr)) take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, ouch, -1);
}
}
- if (have_flag(f_ptr->flags, FF_LAVA) && !IS_INVULN() && !creature_ptr->immune_fire)
+ if (have_flag(f_ptr->flags, FF_LAVA) && !IS_INVULN(creature_ptr) && !creature_ptr->immune_fire)
{
int damage = 0;
}
}
- if (have_flag(f_ptr->flags, FF_COLD_PUDDLE) && !IS_INVULN() && !creature_ptr->immune_cold)
+ if (have_flag(f_ptr->flags, FF_COLD_PUDDLE) && !IS_INVULN(creature_ptr) && !creature_ptr->immune_cold)
{
int damage = 0;
}
}
- if (have_flag(f_ptr->flags, FF_ELEC_PUDDLE) && !IS_INVULN() && !creature_ptr->immune_elec)
+ if (have_flag(f_ptr->flags, FF_ELEC_PUDDLE) && !IS_INVULN(creature_ptr) && !creature_ptr->immune_elec)
{
int damage = 0;
}
}
- if (have_flag(f_ptr->flags, FF_ACID_PUDDLE) && !IS_INVULN() && !creature_ptr->immune_acid)
+ if (have_flag(f_ptr->flags, FF_ACID_PUDDLE) && !IS_INVULN(creature_ptr) && !creature_ptr->immune_acid)
{
int damage = 0;
}
}
- if (have_flag(f_ptr->flags, FF_POISON_PUDDLE) && !IS_INVULN())
+ if (have_flag(f_ptr->flags, FF_POISON_PUDDLE) && !IS_INVULN(creature_ptr))
{
int damage = 0;
*/
if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY))
{
- if (!IS_INVULN() && !creature_ptr->wraith_form && !creature_ptr->kabenuke && ((creature_ptr->chp > (creature_ptr->lev / 5)) || !creature_ptr->pass_wall))
+ if (!IS_INVULN(creature_ptr) && !creature_ptr->wraith_form && !creature_ptr->kabenuke && ((creature_ptr->chp > (creature_ptr->lev / 5)) || !creature_ptr->pass_wall))
{
concptr dam_desc;
cave_no_regen = TRUE;
/* Regenerate Hit Points if needed */
if ((creature_ptr->chp < creature_ptr->mhp) && !cave_no_regen)
{
- regenhp(regen_amount);
+ regenhp(creature_ptr, regen_amount);
}
}
disturb(creature_ptr, FALSE, TRUE);
msg_print(_("あなたの位置は突然ひじょうに不確定になった...", "Your position suddenly seems very uncertain..."));
msg_print(NULL);
- teleport_player(40, TELEPORT_PASSIVE);
+ teleport_player(creature_ptr, 40, TELEPORT_PASSIVE);
}
}
disturb(creature_ptr, FALSE, TRUE);
msg_print(_("ブゥーーッ!おっと。", "BRRAAAP! Oops."));
msg_print(NULL);
- fire_ball(GF_POIS, 0, creature_ptr->lev, 3);
+ fire_ball(creature_ptr, GF_POIS, 0, creature_ptr->lev, 3);
}
if ((creature_ptr->muta2 & MUT2_PROD_MANA) &&
flush();
msg_print(NULL);
(void)get_hack_dir(&dire);
- fire_ball(GF_MANA, dire, creature_ptr->lev * 2, 3);
+ fire_ball(creature_ptr, GF_MANA, dire, creature_ptr->lev * 2, 3);
}
if ((creature_ptr->muta2 & MUT2_ATT_DEMON) && !creature_ptr->anti_magic && (randint1(6666) == 666))
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, p_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, mode))
+ if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, creature_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 (!p_ptr->current_floor_ptr->dun_level && creature_ptr->town_num)
+ if (!creature_ptr->current_floor_ptr->dun_level && creature_ptr->town_num)
{
int n;
msg_print(NULL);
/* Absorb light from the current possition */
- if ((p_ptr->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)
{
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, p_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, mode))
+ if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, mode))
{
msg_print(_("動物を引き寄せた!", "You have attracted an animal!"));
disturb(creature_ptr, FALSE, TRUE);
msg_print(_("周りの空間が歪んでいる気がする!", "You feel the world warping around you!"));
msg_print(NULL);
- fire_ball(GF_CHAOS, 0, creature_ptr->lev, 8);
+ fire_ball(creature_ptr, GF_CHAOS, 0, creature_ptr->lev, 8);
}
if ((creature_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
{
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, p_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON, mode))
+ if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON, mode))
{
msg_print(_("ドラゴンを引き寄せた!", "You have attracted a dragon!"));
disturb(creature_ptr, FALSE, TRUE);
msg_print(NULL);
set_food(creature_ptr, PY_FOOD_WEAK);
if (music_singing_any(creature_ptr)) stop_singing(creature_ptr);
- if (hex_spelling_any(creature_ptr)) stop_hex_spell_all();
+ if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
}
- if ((creature_ptr->muta2 & MUT2_WALK_SHAD) && !creature_ptr->anti_magic && one_in_(12000) && !creature_ptr->inside_arena)
+ if ((creature_ptr->muta2 & MUT2_WALK_SHAD) && !creature_ptr->anti_magic && one_in_(12000) && !creature_ptr->current_floor_ptr->inside_arena)
{
- alter_reality();
+ reserve_alter_reality(creature_ptr);
}
if ((creature_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
int danger_amount = 0;
MONSTER_IDX monster;
- for (monster = 0; monster < p_ptr->current_floor_ptr->m_max; monster++)
+ for (monster = 0; monster < creature_ptr->current_floor_ptr->m_max; monster++)
{
- monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[monster];
+ monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[monster];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (!monster_is_valid(m_ptr)) continue;
if (get_check_strict(_("テレポートしますか?", "Teleport? "), CHECK_OKAY_CANCEL))
{
disturb(creature_ptr, FALSE, TRUE);
- teleport_player(50, 0L);
+ teleport_player(creature_ptr, 50, 0L);
}
else
{
if ((creature_ptr->cursed & TRC_TY_CURSE) && one_in_(TY_CURSE_CHANCE))
{
int count = 0;
- (void)activate_ty_curse(FALSE, &count);
+ (void)activate_ty_curse(creature_ptr, FALSE, &count);
}
/* Handle experience draining */
if (creature_ptr->prace != RACE_ANDROID && ((creature_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4)))
/* Call animal */
if ((creature_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500))
{
- 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)))
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_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, p_ptr->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, creature_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, p_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON,
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_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, p_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD,
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD,
(PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
GAME_TEXT o_name[MAX_NLEN];
disturb(creature_ptr, FALSE, TRUE);
/* Teleport player */
- teleport_player(40, TELEPORT_PASSIVE);
+ teleport_player(creature_ptr, 40, TELEPORT_PASSIVE);
}
/* Handle HP draining */
if ((creature_ptr->cursed & TRC_DRAIN_HP) && one_in_(666))
/*
* Recharge rods. Rods now use timeout to control charging status,
* and each charging rod in a stack decreases the stack's timeout by
- * one per current_world_ptr->game_turn. -LM-
+ * one per turn. -LM-
*/
for (changed = FALSE, i = 0; i < INVEN_PACK; i++)
{
disturb(creature_ptr, FALSE, TRUE);
/* Determine the level */
- if (floor_ptr->dun_level || creature_ptr->inside_quest || creature_ptr->enter_dungeon)
+ if (floor_ptr->dun_level || creature_ptr->current_floor_ptr->inside_quest || creature_ptr->enter_dungeon)
{
msg_print(_("上に引っ張りあげられる感じがする!", "You feel yourself yanked upwards!"));
leave_quest_check();
leave_tower_check();
- creature_ptr->inside_quest = 0;
+ creature_ptr->current_floor_ptr->inside_quest = 0;
creature_ptr->leaving = TRUE;
}
* / Handle certain things once every 10 game turns
* @return なし
*/
-static void process_world(void)
+static void process_world(player_type *player_ptr)
{
int day, hour, min;
extract_day_hour_min(&day, &hour, &min);
/* Update dungeon feeling, and announce it if changed */
- update_dungeon_feeling(p_ptr, p_ptr->current_floor_ptr);
+ update_dungeon_feeling(player_ptr, player_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))
+ if (ironman_downward && (player_ptr->dungeon_idx != DUNGEON_ANGBAND && player_ptr->dungeon_idx != 0))
{
- p_ptr->current_floor_ptr->dun_level = 0;
- p_ptr->dungeon_idx = 0;
+ player_ptr->current_floor_ptr->dun_level = 0;
+ player_ptr->dungeon_idx = 0;
prepare_change_floor_mode(CFM_FIRST_FLOOR | CFM_RAND_PLACE);
- p_ptr->inside_arena = FALSE;
- p_ptr->wild_mode = FALSE;
- p_ptr->leaving = TRUE;
+ player_ptr->current_floor_ptr->inside_arena = FALSE;
+ player_ptr->wild_mode = FALSE;
+ player_ptr->leaving = TRUE;
}
/*** Check monster arena ***/
- if (p_ptr->phase_out && !p_ptr->leaving)
+ if (player_ptr->phase_out && !player_ptr->leaving)
{
int i2, j2;
int win_m_idx = 0;
int number_mon = 0;
/* Count all hostile monsters */
- for (i2 = 0; i2 < p_ptr->current_floor_ptr->width; ++i2)
- for (j2 = 0; j2 < p_ptr->current_floor_ptr->height; j2++)
+ for (i2 = 0; i2 < player_ptr->current_floor_ptr->width; ++i2)
+ for (j2 = 0; j2 < player_ptr->current_floor_ptr->height; j2++)
{
- grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[j2][i2];
+ grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[j2][i2];
- if ((g_ptr->m_idx > 0) && (g_ptr->m_idx != p_ptr->riding))
+ if ((g_ptr->m_idx > 0) && (g_ptr->m_idx != player_ptr->riding))
{
number_mon++;
win_m_idx = g_ptr->m_idx;
{
msg_print(_("相打ちに終わりました。", "They have kill each other at the same time."));
msg_print(NULL);
- p_ptr->energy_need = 0;
+ player_ptr->energy_need = 0;
update_gambling_monsters();
}
else if ((number_mon-1) == 0)
GAME_TEXT m_name[MAX_NLEN];
monster_type *wm_ptr;
- wm_ptr = &p_ptr->current_floor_ptr->m_list[win_m_idx];
+ wm_ptr = &player_ptr->current_floor_ptr->m_list[win_m_idx];
monster_desc(m_name, wm_ptr, 0);
msg_format(_("%sが勝利した!", "%s is winner!"), m_name);
{
msg_print(_("おめでとうございます。", "Congratulations."));
msg_format(_("%d$を受け取った。", "You received %d gold."), battle_odds);
- p_ptr->au += battle_odds;
+ player_ptr->au += battle_odds;
}
else
{
msg_print(_("残念でした。", "You lost gold."));
}
msg_print(NULL);
- p_ptr->energy_need = 0;
+ player_ptr->energy_need = 0;
update_gambling_monsters();
}
- else if (current_world_ptr->game_turn - p_ptr->current_floor_ptr->generated_turn == 150 * TURNS_PER_TICK)
+ else if (current_world_ptr->game_turn - player_ptr->current_floor_ptr->generated_turn == 150 * TURNS_PER_TICK)
{
msg_print(_("申し分けありませんが、この勝負は引き分けとさせていただきます。", "This battle have ended in a draw."));
- p_ptr->au += kakekin;
+ player_ptr->au += kakekin;
msg_print(NULL);
- p_ptr->energy_need = 0;
+ player_ptr->energy_need = 0;
update_gambling_monsters();
}
}
if (current_world_ptr->game_turn % TURNS_PER_TICK) return;
/*** Attempt timed autosave ***/
- if (autosave_t && autosave_freq && !p_ptr->phase_out)
+ if (autosave_t && autosave_freq && !player_ptr->phase_out)
{
if (!(current_world_ptr->game_turn % ((s32b)autosave_freq * TURNS_PER_TICK)))
do_cmd_save_game(TRUE);
}
- if (p_ptr->current_floor_ptr->monster_noise && !ignore_unview)
+ if (player_ptr->current_floor_ptr->monster_noise && !ignore_unview)
{
msg_print(_("何かが聞こえた。", "You hear noise."));
}
/*** Handle the wilderness/town (sunshine) ***/
/* While in town/wilderness */
- if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)
+ if (!player_ptr->current_floor_ptr->dun_level && !player_ptr->current_floor_ptr->inside_quest && !player_ptr->phase_out && !player_ptr->current_floor_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(p_ptr->current_floor_ptr);
- else night_falls(p_ptr->current_floor_ptr);
+ if (dawn) day_break(player_ptr->current_floor_ptr);
+ else night_falls(player_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)) && p_ptr->current_floor_ptr->dun_level)
+ else if ((vanilla_town || (lite_town && !player_ptr->current_floor_ptr->inside_quest && !player_ptr->phase_out && !player_ptr->current_floor_ptr->inside_arena)) && player_ptr->current_floor_ptr->dun_level)
{
/*** Shuffle the Storekeepers ***/
/*** Process the monsters ***/
/* Check for creature generation. */
- if (one_in_(d_info[p_ptr->dungeon_idx].max_m_alloc_chance) &&
- !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->phase_out)
+ if (one_in_(d_info[player_ptr->dungeon_idx].max_m_alloc_chance) &&
+ !player_ptr->current_floor_ptr->inside_arena && !player_ptr->current_floor_ptr->inside_quest && !player_ptr->phase_out)
{
/* Make a new monster */
(void)alloc_monster(MAX_SIGHT + 5, 0);
}
/* Hack -- Check for creature regeneration */
- if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 10)) && !p_ptr->phase_out) regen_monsters();
+ if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 10)) && !player_ptr->phase_out) regen_monsters();
if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 3))) regen_captured_monsters();
- if (!p_ptr->leaving)
+ if (!player_ptr->leaving)
{
int i;
/* Hack -- Process the counters of monsters if needed */
for (i = 0; i < MAX_MTIMED; i++)
{
- if (p_ptr->current_floor_ptr->mproc_max[i] > 0) process_monsters_mtimed(i);
+ if (player_ptr->current_floor_ptr->mproc_max[i] > 0) process_monsters_mtimed(i);
}
}
{
if (min != prev_min)
{
- exe_write_diary(p_ptr, NIKKI_HIGAWARI, 0, NULL);
+ exe_write_diary(player_ptr, NIKKI_HIGAWARI, 0, NULL);
determine_today_mon(FALSE);
}
}
/* Every 15 minutes after 11:00 pm */
if ((hour == 23) && !(min % 15))
{
- disturb(p_ptr, FALSE, TRUE);
+ disturb(player_ptr, FALSE, TRUE);
switch (min / 15)
{
if (!hour && !min)
{
- disturb(p_ptr, TRUE, TRUE);
+ disturb(player_ptr, TRUE, TRUE);
msg_print(_("遠くで鐘が何回も鳴り、死んだような静けさの中へ消えていった。", "A distant bell tolls many times, fading into an deathly silence."));
- if (p_ptr->wild_mode)
+ if (player_ptr->wild_mode)
{
/* Go into large wilderness view */
- p_ptr->oldpy = randint1(MAX_HGT - 2);
- p_ptr->oldpx = randint1(MAX_WID - 2);
- change_wild_mode(p_ptr, TRUE);
+ player_ptr->oldpy = randint1(MAX_HGT - 2);
+ player_ptr->oldpx = randint1(MAX_WID - 2);
+ change_wild_mode(player_ptr, TRUE);
/* Give first move to monsters */
- take_turn(p_ptr, 100);
+ take_turn(player_ptr, 100);
}
- p_ptr->invoking_midnight_curse = TRUE;
+ player_ptr->invoking_midnight_curse = TRUE;
}
}
- 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(p_ptr);
- sense_inventory2(p_ptr);
- process_world_aux_movement(p_ptr);
+ process_world_aux_digestion(player_ptr);
+ process_world_aux_hp_and_sp(player_ptr);
+ process_world_aux_timeout(player_ptr);
+ process_world_aux_light(player_ptr);
+ process_world_aux_mutation(player_ptr);
+ process_world_aux_curse(player_ptr);
+ process_world_aux_recharge(player_ptr);
+ sense_inventory1(player_ptr);
+ sense_inventory2(player_ptr);
+ process_world_aux_movement(player_ptr);
}
/*!
static bool enter_wizard_mode(void)
{
/* Ask first time */
- if (!p_ptr->noscore)
+ if (!current_world_ptr->noscore)
{
/* Wizard mode is not permitted */
if (!allow_debug_opts || arg_wizard)
exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, _("ウィザードモードに突入してスコアを残せなくなった。", "give up recording score to enter wizard mode."));
/* Mark savefile */
- p_ptr->noscore |= 0x0002;
+ current_world_ptr->noscore |= 0x0002;
}
/* Success */
static bool enter_debug_mode(void)
{
/* Ask first time */
- if (!p_ptr->noscore)
+ if (!current_world_ptr->noscore)
{
/* Debug mode is not permitted */
if (!allow_debug_opts)
exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, _("デバッグモードに突入してスコアを残せなくなった。", "give up sending score to use debug commands."));
/* Mark savefile */
- p_ptr->noscore |= 0x0008;
+ current_world_ptr->noscore |= 0x0008;
}
/* Success */
static bool enter_borg_mode(void)
{
/* Ask first time */
- if (!(p_ptr->noscore & 0x0010))
+ if (!(current_world_ptr->noscore & 0x0010))
{
/* Mention effects */
msg_print(_("ボーグ・コマンドはデバッグと実験のためのコマンドです。 ", "The borg commands are for debugging and experimenting."));
exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, _("ボーグ・コマンドを使用してスコアを残せなくなった。", "give up recording score to use borg commands."));
/* Mark savefile */
- p_ptr->noscore |= 0x0010;
+ current_world_ptr->noscore |= 0x0010;
}
/* Success */
/* Go up staircase */
case '<':
{
- if (!creature_ptr->wild_mode && !p_ptr->current_floor_ptr->dun_level && !creature_ptr->inside_arena && !creature_ptr->inside_quest)
+ if (!creature_ptr->wild_mode && !p_ptr->current_floor_ptr->dun_level && !creature_ptr->current_floor_ptr->inside_arena && !creature_ptr->current_floor_ptr->inside_quest)
{
if (vanilla_town) break;
(creature_ptr->pclass == CLASS_NINJA) ||
(creature_ptr->pclass == CLASS_MIRROR_MASTER)
)
- do_cmd_mind();
+ do_cmd_mind(creature_ptr);
else if (creature_ptr->pclass == CLASS_IMITATOR)
do_cmd_mane(creature_ptr, FALSE);
else if (creature_ptr->pclass == CLASS_MAGIC_EATER)
/* Look around */
case 'l':
{
- do_cmd_look();
+ do_cmd_look(creature_ptr);
break;
}
/* Target monster or location */
case '*':
{
- do_cmd_target();
+ do_cmd_target(creature_ptr);
break;
}
/* Check artifacts, uniques, objects */
case '~':
{
- do_cmd_knowledge();
+ do_cmd_knowledge(creature_ptr);
break;
}
/* Make random artifact list */
case KTRL('V'):
{
- spoil_random_artifact("randifact.txt");
+ spoil_random_artifact(creature_ptr, "randifact.txt");
break;
}
* @brief アイテムの所持種類数が超えた場合にアイテムを床に落とす処理 / Hack -- Pack Overflow
* @return なし
*/
-static void pack_overflow(void)
+static void pack_overflow(player_type *owner_ptr)
{
- if (p_ptr->inventory_list[INVEN_PACK].k_idx)
+ if (owner_ptr->inventory_list[INVEN_PACK].k_idx)
{
GAME_TEXT o_name[MAX_NLEN];
object_type *o_ptr;
/* Is auto-destroy done? */
- update_creature(p_ptr);
- if (!p_ptr->inventory_list[INVEN_PACK].k_idx) return;
+ update_creature(owner_ptr);
+ if (!owner_ptr->inventory_list[INVEN_PACK].k_idx) return;
/* Access the slot to be dropped */
- o_ptr = &p_ptr->inventory_list[INVEN_PACK];
+ o_ptr = &owner_ptr->inventory_list[INVEN_PACK];
- disturb(p_ptr, FALSE, TRUE);
+ disturb(owner_ptr, FALSE, TRUE);
/* Warning */
msg_print(_("ザックからアイテムがあふれた!", "Your pack overflows!"));
msg_format(_("%s(%c)を落とした。", "You drop %s (%c)."), o_name, index_to_label(INVEN_PACK));
/* Drop it (carefully) near the player */
- (void)drop_near(o_ptr, 0, p_ptr->y, p_ptr->x);
-
- /* Modify, Describe, Optimize */
- inven_item_increase(INVEN_PACK, -255);
- inven_item_describe(INVEN_PACK);
- inven_item_optimize(INVEN_PACK);
+ (void)drop_near(o_ptr, 0, owner_ptr->y, owner_ptr->x);
+ vary_item(INVEN_PACK, -255);
handle_stuff();
}
}
* @brief プレイヤーの行動エネルギーが充填される(=プレイヤーのターンが回る)毎に行われる処理 / process the effects per 100 energy at player speed.
* @return なし
*/
-static void process_upkeep_with_speed(void)
+static void process_upkeep_with_speed(player_type *creature_ptr)
{
/* Give the player some energy */
- if (!load && p_ptr->enchant_energy_need > 0 && !p_ptr->leaving)
+ if (!load && creature_ptr->enchant_energy_need > 0 && !creature_ptr->leaving)
{
- p_ptr->enchant_energy_need -= SPEED_TO_ENERGY(p_ptr->pspeed);
+ creature_ptr->enchant_energy_need -= SPEED_TO_ENERGY(creature_ptr->pspeed);
}
- /* No current_world_ptr->game_turn yet */
- if (p_ptr->enchant_energy_need > 0) return;
+ /* No turn yet */
+ if (creature_ptr->enchant_energy_need > 0) return;
- while (p_ptr->enchant_energy_need <= 0)
+ while (creature_ptr->enchant_energy_need <= 0)
{
/* Handle the player song */
- if (!load) check_music(p_ptr);
+ if (!load) check_music(creature_ptr);
/* Hex - Handle the hex spells */
- if (!load) check_hex();
- if (!load) revenge_spell();
+ if (!load) check_hex(creature_ptr);
+ if (!load) revenge_spell(creature_ptr);
/* There is some randomness of needed energy */
- p_ptr->enchant_energy_need += ENERGY_NEED();
+ creature_ptr->enchant_energy_need += ENERGY_NEED();
}
}
-static void process_fishing(void)
+static void process_fishing(player_type *creature_ptr)
{
Term_xtra(TERM_XTRA_DELAY, 10);
if (one_in_(1000))
MONRACE_IDX r_idx;
bool success = FALSE;
get_mon_num_prep(monster_is_fishing_target, NULL);
- 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);
+ r_idx = get_mon_num(creature_ptr->current_floor_ptr->dun_level ? creature_ptr->current_floor_ptr->dun_level : wilderness[creature_ptr->wilderness_y][creature_ptr->wilderness_x].level);
msg_print(NULL);
if (r_idx && one_in_(2))
{
POSITION y, x;
- y = p_ptr->y + ddy[p_ptr->fishing_dir];
- x = p_ptr->x + ddx[p_ptr->fishing_dir];
+ y = creature_ptr->y + ddy[creature_ptr->fishing_dir];
+ x = creature_ptr->x + ddx[creature_ptr->fishing_dir];
if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
{
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[y][x].m_idx], 0);
+ monster_desc(m_name, &creature_ptr->current_floor_ptr->m_list[creature_ptr->current_floor_ptr->grid_array[y][x].m_idx], 0);
msg_format(_("%sが釣れた!", "You have a good catch!"), m_name);
success = TRUE;
}
{
msg_print(_("餌だけ食われてしまった!くっそ~!", "Damn! The fish stole your bait!"));
}
- disturb(p_ptr, FALSE, TRUE);
+ disturb(creature_ptr, FALSE, TRUE);
}
}
if (creature_ptr->invoking_midnight_curse)
{
int count = 0;
- activate_ty_curse(FALSE, &count);
+ activate_ty_curse(creature_ptr, FALSE, &count);
creature_ptr->invoking_midnight_curse = FALSE;
}
if (!monster_is_valid(m_ptr)) continue;
m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
- update_monster(m_idx, FALSE);
+ update_monster(creature_ptr, m_idx, FALSE);
}
prt_time();
}
creature_ptr->energy_need -= SPEED_TO_ENERGY(creature_ptr->pspeed);
}
- /* No current_world_ptr->game_turn yet */
+ /* No turn yet */
if (creature_ptr->energy_need > 0) return;
if (!command_rep) prt_time();
}
}
- if (creature_ptr->action == ACTION_FISH) process_fishing();
+ if (creature_ptr->action == ACTION_FISH) process_fishing(creature_ptr);
/* Handle "abort" */
if (check_abort)
if (fresh_before) Term_fresh();
/* Hack -- Pack Overflow */
- pack_overflow();
+ pack_overflow(creature_ptr);
/* Hack -- cancel "lurking browse mode" */
if (!command_new) command_see = FALSE;
- /* Assume free current_world_ptr->game_turn */
+ /* Assume free turn */
free_turn(creature_ptr);
if (creature_ptr->phase_out)
else if (travel.run)
{
/* Take a step */
- travel_step();
+ travel_step(creature_ptr);
}
#endif
}
/* Hack -- Pack Overflow */
- pack_overflow();
+ pack_overflow(creature_ptr);
/*** Clean up ***/
/* Assume invisible */
m_ptr->ml = FALSE;
- update_monster(m_idx, FALSE);
+ update_monster(creature_ptr, m_idx, FALSE);
if (creature_ptr->health_who == m_idx) creature_ptr->redraw |= (PR_HEALTH);
if (creature_ptr->riding == m_idx) creature_ptr->redraw |= (PR_UHEALTH);
}
/* Update scent trail */
- update_smell(creature_ptr->current_floor_ptr);
+ update_smell(creature_ptr->current_floor_ptr, creature_ptr);
}
/*!
* the user dies, or the game is terminated.\n
* </p>
*/
-static void dungeon(bool load_game)
+static void dungeon(player_type *player_ptr, bool load_game)
{
int quest_num = 0;
/* Set the base level */
- p_ptr->current_floor_ptr->base_level = p_ptr->current_floor_ptr->dun_level;
+ player_ptr->current_floor_ptr->base_level = player_ptr->current_floor_ptr->dun_level;
/* Reset various flags */
current_world_ptr->is_loading_now = FALSE;
/* Not leaving */
- p_ptr->leaving = FALSE;
+ player_ptr->leaving = FALSE;
/* Reset the "command" vars */
command_cmd = 0;
/* Cancel the target */
target_who = 0;
- p_ptr->pet_t_m_idx = 0;
- p_ptr->riding_t_m_idx = 0;
- p_ptr->ambush_flag = FALSE;
+ player_ptr->pet_t_m_idx = 0;
+ player_ptr->riding_t_m_idx = 0;
+ player_ptr->ambush_flag = FALSE;
/* Cancel the health bar */
health_track(0);
repair_objects = TRUE;
- disturb(p_ptr, TRUE, TRUE);
+ disturb(player_ptr, TRUE, TRUE);
/* Get index of current quest (if any) */
- quest_num = quest_number(p_ptr->current_floor_ptr->dun_level);
+ quest_num = quest_number(player_ptr->current_floor_ptr->dun_level);
/* Inside a quest? */
if (quest_num)
}
/* Track maximum player level */
- if (p_ptr->max_plv < p_ptr->lev)
+ if (player_ptr->max_plv < player_ptr->lev)
{
- p_ptr->max_plv = p_ptr->lev;
+ player_ptr->max_plv = player_ptr->lev;
}
/* Track maximum dungeon level (if not in quest -KMW-) */
- if ((max_dlv[p_ptr->dungeon_idx] < p_ptr->current_floor_ptr->dun_level) && !p_ptr->inside_quest)
+ if ((max_dlv[player_ptr->dungeon_idx] < player_ptr->current_floor_ptr->dun_level) && !player_ptr->current_floor_ptr->inside_quest)
{
- 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);
+ max_dlv[player_ptr->dungeon_idx] = player_ptr->current_floor_ptr->dun_level;
+ if (record_maxdepth) exe_write_diary(player_ptr, NIKKI_MAXDEAPTH, player_ptr->current_floor_ptr->dun_level, NULL);
}
- (void)calculate_upkeep(p_ptr);
+ (void)calculate_upkeep(player_ptr);
/* Validate the panel */
panel_bounds_center();
/* Enter "xtra" mode */
current_world_ptr->character_xtra = TRUE;
- p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER | PW_MONSTER | PW_OVERHEAD | PW_DUNGEON);
- p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY | PR_MAP);
- p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS | PU_VIEW | PU_LITE | PU_MON_LITE | PU_TORCH | PU_MONSTERS | PU_DISTANCE | PU_FLOW);
+ player_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER | PW_MONSTER | PW_OVERHEAD | PW_DUNGEON);
+ player_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY | PR_MAP);
+ player_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS | PU_VIEW | PU_LITE | PU_MON_LITE | PU_TORCH | PU_MONSTERS | PU_DISTANCE | PU_FLOW);
handle_stuff();
/* Leave "xtra" mode */
current_world_ptr->character_xtra = FALSE;
- p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
- p_ptr->update |= (PU_COMBINE | PU_REORDER);
+ player_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
+ player_ptr->update |= (PU_COMBINE | PU_REORDER);
handle_stuff();
Term_fresh();
if (quest_num && (is_fixed_quest_idx(quest_num) &&
!((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) ||
- !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling(p_ptr);
+ !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling(player_ptr);
- if (p_ptr->phase_out)
+ if (player_ptr->phase_out)
{
if (load_game)
{
- p_ptr->energy_need = 0;
+ player_ptr->energy_need = 0;
update_gambling_monsters();
}
else
}
}
- if ((p_ptr->pclass == CLASS_BARD) && (SINGING_SONG_EFFECT(p_ptr) > MUSIC_DETECT))
- SINGING_SONG_EFFECT(p_ptr) = MUSIC_DETECT;
+ if ((player_ptr->pclass == CLASS_BARD) && (SINGING_SONG_EFFECT(player_ptr) > MUSIC_DETECT))
+ SINGING_SONG_EFFECT(player_ptr) = MUSIC_DETECT;
/* Hack -- notice death or departure */
- if (!p_ptr->playing || p_ptr->is_dead) return;
+ if (!player_ptr->playing || player_ptr->is_dead) return;
/* Print quest message if appropriate */
- if (!p_ptr->inside_quest && (p_ptr->dungeon_idx == DUNGEON_ANGBAND))
+ if (!player_ptr->current_floor_ptr->inside_quest && (player_ptr->dungeon_idx == DUNGEON_ANGBAND))
{
- 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);
+ quest_discovery(random_quest_number(player_ptr->current_floor_ptr->dun_level));
+ player_ptr->current_floor_ptr->inside_quest = random_quest_number(player_ptr->current_floor_ptr->dun_level);
}
- if ((p_ptr->current_floor_ptr->dun_level == d_info[p_ptr->dungeon_idx].maxdepth) && d_info[p_ptr->dungeon_idx].final_guardian)
+ if ((player_ptr->current_floor_ptr->dun_level == d_info[player_ptr->dungeon_idx].maxdepth) && d_info[player_ptr->dungeon_idx].final_guardian)
{
- if (r_info[d_info[p_ptr->dungeon_idx].final_guardian].max_num)
+ if (r_info[d_info[player_ptr->dungeon_idx].final_guardian].max_num)
#ifdef JP
msg_format("この階には%sの主である%sが棲んでいる。",
- d_name+d_info[p_ptr->dungeon_idx].name,
- r_name+r_info[d_info[p_ptr->dungeon_idx].final_guardian].name);
+ d_name+d_info[player_ptr->dungeon_idx].name,
+ r_name+r_info[d_info[player_ptr->dungeon_idx].final_guardian].name);
#else
msg_format("%^s lives in this level as the keeper of %s.",
- r_name+r_info[d_info[p_ptr->dungeon_idx].final_guardian].name,
- d_name+d_info[p_ptr->dungeon_idx].name);
+ r_name+r_info[d_info[player_ptr->dungeon_idx].final_guardian].name,
+ d_name+d_info[player_ptr->dungeon_idx].name);
#endif
}
- if (!load_game && (p_ptr->special_defense & NINJA_S_STEALTH)) set_superstealth(p_ptr, FALSE);
+ if (!load_game && (player_ptr->special_defense & NINJA_S_STEALTH)) set_superstealth(player_ptr, FALSE);
/*** Process this dungeon level ***/
/* Reset the monster generation level */
- p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level;
+ player_ptr->current_floor_ptr->monster_level = player_ptr->current_floor_ptr->base_level;
/* Reset the object generation level */
- p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
+ player_ptr->current_floor_ptr->object_level = player_ptr->current_floor_ptr->base_level;
current_world_ptr->is_loading_now = TRUE;
- if (p_ptr->energy_need > 0 && !p_ptr->phase_out &&
- (p_ptr->current_floor_ptr->dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
- p_ptr->energy_need = 0;
+ if (player_ptr->energy_need > 0 && !player_ptr->phase_out &&
+ (player_ptr->current_floor_ptr->dun_level || player_ptr->leaving_dungeon || player_ptr->current_floor_ptr->inside_arena))
+ player_ptr->energy_need = 0;
/* Not leaving dungeon */
- p_ptr->leaving_dungeon = FALSE;
+ player_ptr->leaving_dungeon = FALSE;
/* Initialize monster process */
mproc_init();
while (TRUE)
{
/* Hack -- Compact the monster list occasionally */
- if ((p_ptr->current_floor_ptr->m_cnt + 32 > current_world_ptr->max_m_idx) && !p_ptr->phase_out) compact_monsters(64);
+ if ((player_ptr->current_floor_ptr->m_cnt + 32 > current_world_ptr->max_m_idx) && !player_ptr->phase_out) compact_monsters(64);
/* Hack -- Compress the monster list occasionally */
- if ((p_ptr->current_floor_ptr->m_cnt + 32 < p_ptr->current_floor_ptr->m_max) && !p_ptr->phase_out) compact_monsters(0);
+ if ((player_ptr->current_floor_ptr->m_cnt + 32 < player_ptr->current_floor_ptr->m_max) && !player_ptr->phase_out) compact_monsters(0);
/* Hack -- Compact the object list occasionally */
- if (p_ptr->current_floor_ptr->o_cnt + 32 > current_world_ptr->max_o_idx) compact_objects(64);
+ if (player_ptr->current_floor_ptr->o_cnt + 32 > current_world_ptr->max_o_idx) compact_objects(player_ptr->current_floor_ptr, 64);
/* Hack -- Compress the object list occasionally */
- if (p_ptr->current_floor_ptr->o_cnt + 32 < p_ptr->current_floor_ptr->o_max) compact_objects(0);
+ if (player_ptr->current_floor_ptr->o_cnt + 32 < player_ptr->current_floor_ptr->o_max) compact_objects(player_ptr->current_floor_ptr, 0);
/* Process the player */
- process_player(p_ptr);
- process_upkeep_with_speed();
+ process_player(player_ptr);
+ process_upkeep_with_speed(player_ptr);
handle_stuff();
/* Hack -- Hilite the player */
- move_cursor_relative(p_ptr->y, p_ptr->x);
+ move_cursor_relative(player_ptr->y, player_ptr->x);
/* Optional fresh */
if (fresh_after) Term_fresh();
/* Hack -- Notice death or departure */
- if (!p_ptr->playing || p_ptr->is_dead) break;
+ if (!player_ptr->playing || player_ptr->is_dead) break;
/* Process all of the monsters */
process_monsters();
handle_stuff();
/* Hack -- Hilite the player */
- move_cursor_relative(p_ptr->y, p_ptr->x);
+ move_cursor_relative(player_ptr->y, player_ptr->x);
/* Optional fresh */
if (fresh_after) Term_fresh();
/* Hack -- Notice death or departure */
- if (!p_ptr->playing || p_ptr->is_dead) break;
+ if (!player_ptr->playing || player_ptr->is_dead) break;
/* Process the world */
- process_world();
+ process_world(player_ptr);
handle_stuff();
/* Hack -- Hilite the player */
- move_cursor_relative(p_ptr->y, p_ptr->x);
+ move_cursor_relative(player_ptr->y, player_ptr->x);
/* Optional fresh */
if (fresh_after) Term_fresh();
/* Hack -- Notice death or departure */
- if (!p_ptr->playing || p_ptr->is_dead) break;
+ if (!player_ptr->playing || player_ptr->is_dead) break;
/* Count game turns */
current_world_ptr->game_turn++;
if (current_world_ptr->dungeon_turn < current_world_ptr->dungeon_turn_limit)
{
- if (!p_ptr->wild_mode || wild_regen) current_world_ptr->dungeon_turn++;
- else if (p_ptr->wild_mode && !(current_world_ptr->game_turn % ((MAX_HGT + MAX_WID) / 2))) current_world_ptr->dungeon_turn++;
+ if (!player_ptr->wild_mode || wild_regen) current_world_ptr->dungeon_turn++;
+ else if (player_ptr->wild_mode && !(current_world_ptr->game_turn % ((MAX_HGT + MAX_WID) / 2))) current_world_ptr->dungeon_turn++;
}
prevent_turn_overflow();
/* Handle "leaving" */
- if (p_ptr->leaving) break;
+ if (player_ptr->leaving) break;
if (wild_regen) wild_regen--;
}
}
/* Not save-and-quit and not dead? */
- if (p_ptr->playing && !p_ptr->is_dead)
+ if (player_ptr->playing && !player_ptr->is_dead)
{
/*
* Maintain Unique monsters and artifact, save current
* floor, then prepare next floor
*/
- leave_floor(p_ptr);
+ leave_floor(player_ptr);
/* Forget the flag */
reinit_wilderness = FALSE;
* savefile, we will commit suicide, if necessary, to allow the
* player to start a new game.
*/
-void play_game(bool new_game)
+void play_game(player_type *player_ptr, bool new_game)
{
MONSTER_IDX i;
bool load_game = TRUE;
return;
}
- p_ptr->hack_mutation = FALSE;
+ player_ptr->hack_mutation = FALSE;
/* Hack -- Character is "icky" */
current_world_ptr->character_icky = TRUE;
}
}
- /* Hack -- current_world_ptr->game_turn off the cursor */
+ /* Hack -- turn off the cursor */
(void)Term_set_cursor(0);
extract_option_vars();
/* Report waited score */
- if (p_ptr->wait_report_score)
+ if (player_ptr->wait_report_score)
{
char buf[1024];
bool success;
if (!get_check_strict(_("待機していたスコア登録を今行ないますか?", "Do you register score now? "), CHECK_NO_HISTORY))
quit(0);
- p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
- update_creature(p_ptr);
+ player_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
+ update_creature(player_ptr);
- p_ptr->is_dead = TRUE;
+ player_ptr->is_dead = TRUE;
current_world_ptr->start_time = (u32b)time(NULL);
}
else
{
- p_ptr->wait_report_score = FALSE;
- top_twenty();
+ player_ptr->wait_report_score = FALSE;
+ top_twenty(player_ptr);
if (!save_player()) msg_print(_("セーブ失敗!", "death save failed!"));
}
/* Shut the high score file */
current_world_ptr->character_dungeon = FALSE;
/* Start in town */
- p_ptr->current_floor_ptr->dun_level = 0;
- p_ptr->inside_quest = 0;
- p_ptr->inside_arena = FALSE;
- p_ptr->phase_out = FALSE;
+ player_ptr->current_floor_ptr->dun_level = 0;
+ player_ptr->current_floor_ptr->inside_quest = 0;
+ player_ptr->current_floor_ptr->inside_arena = FALSE;
+ player_ptr->phase_out = FALSE;
write_level = TRUE;
current_world_ptr->seed_town = randint0(0x10000000);
/* Roll up a new character */
- player_birth(p_ptr);
+ player_birth(player_ptr);
counts_write(2,0);
- p_ptr->count = 0;
+ player_ptr->count = 0;
load = FALSE;
determine_today_mon(FALSE);
/* Initialize object array */
- wipe_o_list();
+ wipe_o_list(player_ptr->current_floor_ptr);
}
else
{
write_level = FALSE;
- exe_write_diary(p_ptr, NIKKI_GAMESTART, 1,
+ exe_write_diary(player_ptr, NIKKI_GAMESTART, 1,
_(" ----ゲーム再開----",
" ---- Restart Game ----"));
/*
- * 1.0.9 以前はセーブ前に p_ptr->riding = -1 としていたので、再設定が必要だった。
+ * 1.0.9 以前はセーブ前に player_ptr->riding = -1 としていたので、再設定が必要だった。
* もう不要だが、以前のセーブファイルとの互換のために残しておく。
*/
- if (p_ptr->riding == -1)
+ if (player_ptr->riding == -1)
{
- p_ptr->riding = 0;
- for (i = p_ptr->current_floor_ptr->m_max; i > 0; i--)
+ player_ptr->riding = 0;
+ for (i = player_ptr->current_floor_ptr->m_max; i > 0; i--)
{
- if (player_bold(p_ptr->current_floor_ptr->m_list[i].fy, p_ptr->current_floor_ptr->m_list[i].fx))
+ if (player_bold(player_ptr, player_ptr->current_floor_ptr->m_list[i].fy, player_ptr->current_floor_ptr->m_list[i].fx))
{
- p_ptr->riding = i;
+ player_ptr->riding = i;
break;
}
}
current_world_ptr->creating_savefile = FALSE;
- p_ptr->teleport_town = FALSE;
- p_ptr->sutemi = FALSE;
+ player_ptr->teleport_town = FALSE;
+ player_ptr->sutemi = FALSE;
current_world_ptr->timewalk_m_idx = 0;
- p_ptr->now_damaged = FALSE;
+ player_ptr->now_damaged = FALSE;
now_message = 0;
current_world_ptr->start_time = time(NULL) - 1;
record_o_name[0] = '\0';
/* Reset map panel */
- panel_row_min = p_ptr->current_floor_ptr->height;
- panel_col_min = p_ptr->current_floor_ptr->width;
+ panel_row_min = player_ptr->current_floor_ptr->height;
+ panel_col_min = player_ptr->current_floor_ptr->width;
/* Sexy gal gets bonus to maximum weapon skill of whip */
- if (p_ptr->pseikaku == SEIKAKU_SEXY)
- s_info[p_ptr->pclass].w_max[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_MASTER;
+ if (player_ptr->pseikaku == SEIKAKU_SEXY)
+ s_info[player_ptr->pclass].w_max[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_MASTER;
/* Fill the arrays of floors and walls in the good proportions */
- set_floor_and_wall(p_ptr->dungeon_idx);
+ set_floor_and_wall(player_ptr->dungeon_idx);
/* Flavor the objects */
flavor_init();
{
current_world_ptr->wizard = TRUE;
- if (p_ptr->is_dead || !p_ptr->y || !p_ptr->x)
+ if (player_ptr->is_dead || !player_ptr->y || !player_ptr->x)
{
/* Initialize the saved floors data */
init_saved_floors(TRUE);
/* Avoid crash */
- p_ptr->inside_quest = 0;
+ player_ptr->current_floor_ptr->inside_quest = 0;
/* Avoid crash in update_view() */
- p_ptr->y = p_ptr->x = 10;
+ player_ptr->y = player_ptr->x = 10;
}
}
- else if (p_ptr->is_dead)
+ else if (player_ptr->is_dead)
{
quit("Already dead.");
}
}
/* Initialize the town-buildings if necessary */
- if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_quest)
+ if (!player_ptr->current_floor_ptr->dun_level && !player_ptr->current_floor_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(p_ptr);
+ select_floor_music(player_ptr);
}
/* Generate a dungeon level if needed */
if (!current_world_ptr->character_dungeon)
{
- change_floor(p_ptr);
+ change_floor(player_ptr);
}
else
{
/* HACK -- Restore from panic-save */
- if (p_ptr->panic_save)
+ if (player_ptr->panic_save)
{
/* No player? -- Try to regenerate floor */
- if (!p_ptr->y || !p_ptr->x)
+ if (!player_ptr->y || !player_ptr->x)
{
msg_print(_("プレイヤーの位置がおかしい。フロアを再生成します。", "What a strange player location. Regenerate the dungeon floor."));
- change_floor(p_ptr);
+ change_floor(player_ptr);
}
/* Still no player? -- Try to locate random place */
- if (!p_ptr->y || !p_ptr->x) p_ptr->y = p_ptr->x = 10;
+ if (!player_ptr->y || !player_ptr->x) player_ptr->y = player_ptr->x = 10;
/* No longer in panic */
- p_ptr->panic_save = 0;
+ player_ptr->panic_save = 0;
}
}
{
char buf[80];
sprintf(buf, _("%sに降り立った。", "You are standing in the %s."), map_name());
- exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, buf);
+ exe_write_diary(player_ptr, NIKKI_BUNSHOU, 0, buf);
}
/* Start game */
- p_ptr->playing = TRUE;
+ player_ptr->playing = TRUE;
/* Reset the visual mappings */
reset_visuals();
/* Give startup outfit (after loading pref files) */
if (new_game)
{
- player_outfit(p_ptr);
+ player_outfit(player_ptr);
}
/* React to changes */
Term_xtra(TERM_XTRA_REACT, 0);
- p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
- p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
+ player_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
+ player_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
handle_stuff();
/* Set or clear "rogue_like_commands" if requested */
if (arg_force_roguelike) rogue_like_commands = TRUE;
/* Hack -- Enforce "delayed death" */
- if (p_ptr->chp < 0) p_ptr->is_dead = TRUE;
+ if (player_ptr->chp < 0) player_ptr->is_dead = TRUE;
- if (p_ptr->prace == RACE_ANDROID) calc_android_exp(p_ptr);
+ if (player_ptr->prace == RACE_ANDROID) calc_android_exp(player_ptr);
- if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER)))
+ if (new_game && ((player_ptr->pclass == CLASS_CAVALRY) || (player_ptr->pclass == CLASS_BEASTMASTER)))
{
monster_type *m_ptr;
- MONRACE_IDX pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
+ MONRACE_IDX pet_r_idx = ((player_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
monster_race *r_ptr = &r_info[pet_r_idx];
- place_monster_aux(0, p_ptr->y, p_ptr->x - 1, pet_r_idx,
+ place_monster_aux(0, player_ptr->y, player_ptr->x - 1, pet_r_idx,
(PM_FORCE_PET | PM_NO_KAGE));
- m_ptr = &p_ptr->current_floor_ptr->m_list[hack_m_idx_ii];
+ m_ptr = &player_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(p_ptr);
+ select_floor_music(player_ptr);
/* Process */
while (TRUE)
{
/* Process the level */
- dungeon(load_game);
+ dungeon(player_ptr, load_game);
/* Hack -- prevent "icky" message */
current_world_ptr->character_xtra = TRUE;
/* Cancel the health bar */
health_track(0);
- forget_lite(p_ptr->current_floor_ptr);
- forget_view();
- clear_mon_lite(p_ptr->current_floor_ptr);
+ forget_lite(player_ptr->current_floor_ptr);
+ forget_view(player_ptr->current_floor_ptr);
+ clear_mon_lite(player_ptr->current_floor_ptr);
/* Handle "quit and save" */
- if (!p_ptr->playing && !p_ptr->is_dead) break;
+ if (!player_ptr->playing && !player_ptr->is_dead) break;
- /* Erase the old p_ptr->current_floor_ptr->grid_array */
- wipe_o_list();
- if (!p_ptr->is_dead) wipe_m_list();
+ wipe_o_list(player_ptr->current_floor_ptr);
+ if (!player_ptr->is_dead) wipe_m_list();
msg_print(NULL);
load_game = FALSE;
/* Accidental Death */
- if (p_ptr->playing && p_ptr->is_dead)
+ if (player_ptr->playing && player_ptr->is_dead)
{
- if (p_ptr->inside_arena)
+ if (player_ptr->current_floor_ptr->inside_arena)
{
- p_ptr->inside_arena = FALSE;
- if (p_ptr->arena_number > MAX_ARENA_MONS)
- p_ptr->arena_number++;
+ player_ptr->current_floor_ptr->inside_arena = FALSE;
+ if (player_ptr->arena_number > MAX_ARENA_MONS)
+ player_ptr->arena_number++;
else
- p_ptr->arena_number = -1 - p_ptr->arena_number;
- p_ptr->is_dead = FALSE;
- p_ptr->chp = 0;
- p_ptr->chp_frac = 0;
- p_ptr->exit_bldg = TRUE;
- reset_tim_flags(p_ptr);
+ player_ptr->arena_number = -1 - player_ptr->arena_number;
+ player_ptr->is_dead = FALSE;
+ player_ptr->chp = 0;
+ player_ptr->chp_frac = 0;
+ player_ptr->exit_bldg = TRUE;
+ reset_tim_flags(player_ptr);
/* Leave through the exit */
prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_RAND_CONNECT);
/* prepare next floor */
- leave_floor(p_ptr);
+ leave_floor(player_ptr);
}
else
{
/* Mega-Hack -- Allow player to cheat death */
if ((current_world_ptr->wizard || cheat_live) && !get_check(_("死にますか? ", "Die? ")))
{
- cheat_death(p_ptr);
+ cheat_death(player_ptr);
}
}
}
/* Handle "death" */
- if (p_ptr->is_dead) break;
+ if (player_ptr->is_dead) break;
/* Make a new level */
- change_floor(p_ptr);
+ change_floor(player_ptr);
}
/* Close stuff */
if (p_ptr->is_dead)
{
/* Handle retirement */
- if (p_ptr->total_winner) kingly(p_ptr);
+ if (current_world_ptr->total_winner) kingly(p_ptr);
/* Save memories */
if (!cheat_save || get_check(_("死んだデータをセーブしますか? ", "Save death? ")))
}
}
if (!p_ptr->wait_report_score)
- (void)top_twenty();
+ (void)top_twenty(p_ptr);
}
else if (highscore_fd >= 0)
{
void handle_stuff(void)
{
if (p_ptr->update) update_creature(p_ptr);
- if (p_ptr->redraw) redraw_stuff();
+ if (p_ptr->redraw) redraw_stuff(p_ptr);
if (p_ptr->window) window_stuff();
}
void update_output(void)
{
- if (p_ptr->redraw) redraw_stuff();
+ if (p_ptr->redraw) redraw_stuff(p_ptr);
if (p_ptr->window) window_stuff();
}