X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fcore.c;h=7e00354f8223049c4743e3a45d023efaf09ef000;hb=63f0bdca84552d06e8fd91daef73639a50a920b7;hp=bdfc721287a67f821fd07ccae952282138f24f14;hpb=4e3a2b80d56f983dbef74c15f066b0590def1dc0;p=hengband%2Fhengband.git diff --git a/src/core.c b/src/core.c index bdfc72128..7e00354f8 100644 --- a/src/core.c +++ b/src/core.c @@ -426,7 +426,7 @@ static void sense_inventory1(void) } } - if (compare_virtue(V_KNOWLEDGE, 100, VIRTUE_LARGE)) heavy = TRUE; + if (compare_virtue(p_ptr, V_KNOWLEDGE, 100, VIRTUE_LARGE)) heavy = TRUE; /*** Sense everything ***/ @@ -698,7 +698,7 @@ static bool pattern_effect(void) if ((PRACE_IS_(p_ptr, RACE_AMBERITE)) && (p_ptr->cut > 0) && one_in_(10)) { - wreck_the_pattern(); + wreck_the_pattern(p_ptr); } pattern_type = f_info[current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat].subtype; @@ -708,7 +708,7 @@ static bool pattern_effect(void) case PATTERN_TILE_END: (void)set_image(p_ptr, 0); (void)restore_all_status(); - (void)restore_level(); + (void)restore_level(p_ptr); (void)cure_critical_wounds(1000); cave_set_feat(p_ptr->y, p_ptr->x, feat_pattern_old); @@ -732,14 +732,14 @@ static bool pattern_effect(void) case PATTERN_TILE_WRECKED: if (!IS_INVULN()) - take_hit(DAMAGE_NOESCAPE, 200, _("壊れた「パターン」を歩いたダメージ", "walking the corrupted Pattern"), -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, 200, _("壊れた「パターン」を歩いたダメージ", "walking the corrupted Pattern"), -1); break; default: if (PRACE_IS_(p_ptr, RACE_AMBERITE) && !one_in_(2)) return TRUE; else if (!IS_INVULN()) - take_hit(DAMAGE_NOESCAPE, damroll(1, 3), _("「パターン」を歩いたダメージ", "walking the Pattern"), -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(1, 3), _("「パターン」を歩いたダメージ", "walking the Pattern"), -1); break; } @@ -1272,7 +1272,7 @@ static void process_world_aux_digestion(void) if (p_ptr->food >= PY_FOOD_MAX) { /* Digest a lot of food */ - (void)set_food(p_ptr->food - 100); + (void)set_food(p_ptr, p_ptr->food - 100); } /* Digest normally -- Every 50 game turns */ @@ -1299,7 +1299,7 @@ static void process_world_aux_digestion(void) if (digestion > 100) digestion = 100; /* Digest some food */ - (void)set_food(p_ptr->food - digestion); + (void)set_food(p_ptr, p_ptr->food - digestion); } @@ -1322,7 +1322,7 @@ static void process_world_aux_digestion(void) /* Calculate damage */ HIT_POINT dam = (PY_FOOD_STARVE - p_ptr->food) / 10; - if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1); + if (!IS_INVULN()) take_hit(p_ptr, DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1); } } } @@ -1348,7 +1348,7 @@ static void process_world_aux_hp_and_sp(void) /* Take damage from poison */ if (p_ptr->poisoned && !IS_INVULN()) { - take_hit(DAMAGE_NOESCAPE, 1, _("毒", "poison"), -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, 1, _("毒", "poison"), -1); } /* Take damage from cuts */ @@ -1394,7 +1394,7 @@ static void process_world_aux_hp_and_sp(void) dam = 1; } - take_hit(DAMAGE_NOESCAPE, dam, _("致命傷", "a fatal wound"), -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, dam, _("致命傷", "a fatal wound"), -1); } /* (Vampires) Take damage from sunlight */ @@ -1405,7 +1405,7 @@ static void process_world_aux_hp_and_sp(void) if ((current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) { msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!")); - take_hit(DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1); cave_no_regen = TRUE; } } @@ -1427,7 +1427,7 @@ static void process_world_aux_hp_and_sp(void) object_desc(o_name, o_ptr, OD_NAME_ONLY); sprintf(ouch, _("%sを装備したダメージ", "wielding %s"), o_name); - if (!IS_INVULN()) take_hit(DAMAGE_NOESCAPE, 1, ouch, -1); + if (!IS_INVULN()) take_hit(p_ptr, DAMAGE_NOESCAPE, 1, ouch, -1); } } @@ -1456,14 +1456,14 @@ static void process_world_aux_hp_and_sp(void) if (p_ptr->levitation) { msg_print(_("熱で火傷した!", "The heat burns you!")); - take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), + take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1); } else { concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name; msg_format(_("%sで火傷した!", "The %s burns you!"), name); - take_hit(DAMAGE_NOESCAPE, damage, name, -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1); } cave_no_regen = TRUE; @@ -1494,14 +1494,14 @@ static void process_world_aux_hp_and_sp(void) if (p_ptr->levitation) { msg_print(_("冷気に覆われた!", "The cold engulfs you!")); - take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), + take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1); } else { concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name; msg_format(_("%sに凍えた!", "The %s frostbites you!"), name); - take_hit(DAMAGE_NOESCAPE, damage, name, -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1); } cave_no_regen = TRUE; @@ -1532,14 +1532,14 @@ static void process_world_aux_hp_and_sp(void) if (p_ptr->levitation) { msg_print(_("電撃を受けた!", "The electric shocks you!")); - take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), + take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1); } else { concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name; msg_format(_("%sに感電した!", "The %s shocks you!"), name); - take_hit(DAMAGE_NOESCAPE, damage, name, -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1); } cave_no_regen = TRUE; @@ -1570,14 +1570,14 @@ static void process_world_aux_hp_and_sp(void) if (p_ptr->levitation) { msg_print(_("酸が飛び散った!", "The acid melt you!")); - take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), + take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1); } else { concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name; msg_format(_("%sに溶かされた!", "The %s melts you!"), name); - take_hit(DAMAGE_NOESCAPE, damage, name, -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1); } cave_no_regen = TRUE; @@ -1608,7 +1608,7 @@ static void process_world_aux_hp_and_sp(void) if (p_ptr->levitation) { msg_print(_("毒気を吸い込んだ!", "The gas poisons you!")); - take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), + take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1); if (p_ptr->resist_pois) (void)set_poisoned(p_ptr, p_ptr->poisoned + 1); } @@ -1616,7 +1616,7 @@ static void process_world_aux_hp_and_sp(void) { concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name; msg_format(_("%sに毒された!", "The %s poisons you!"), name); - take_hit(DAMAGE_NOESCAPE, damage, name, -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1); if (p_ptr->resist_pois) (void)set_poisoned(p_ptr, p_ptr->poisoned + 3); } @@ -1627,10 +1627,10 @@ static void process_world_aux_hp_and_sp(void) if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) && !p_ptr->levitation && !p_ptr->can_swim && !p_ptr->resist_water) { - if (p_ptr->total_weight > weight_limit()) + if (p_ptr->total_weight > weight_limit(p_ptr)) { msg_print(_("溺れている!", "You are drowning!")); - take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), _("溺れ", "drowning"), -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, randint1(p_ptr->lev), _("溺れ", "drowning"), -1); cave_no_regen = TRUE; } } @@ -1645,7 +1645,7 @@ static void process_world_aux_hp_and_sp(void) if (p_ptr->resist_fire) damage = damage / 3; if (IS_OPPOSE_FIRE()) damage = damage / 3; msg_print(_("熱い!", "It's hot!")); - take_hit(DAMAGE_NOESCAPE, damage, _("炎のオーラ", "Fire aura"), -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, damage, _("炎のオーラ", "Fire aura"), -1); } if ((r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec) { @@ -1654,7 +1654,7 @@ static void process_world_aux_hp_and_sp(void) if (p_ptr->resist_elec) damage = damage / 3; if (IS_OPPOSE_ELEC()) damage = damage / 3; msg_print(_("痛い!", "It hurts!")); - take_hit(DAMAGE_NOESCAPE, damage, _("電気のオーラ", "Elec aura"), -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, damage, _("電気のオーラ", "Elec aura"), -1); } if ((r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !p_ptr->immune_cold) { @@ -1662,7 +1662,7 @@ static void process_world_aux_hp_and_sp(void) if (p_ptr->resist_cold) damage = damage / 3; if (IS_OPPOSE_COLD()) damage = damage / 3; msg_print(_("冷たい!", "It's cold!")); - take_hit(DAMAGE_NOESCAPE, damage, _("冷気のオーラ", "Cold aura"), -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, damage, _("冷気のオーラ", "Cold aura"), -1); } } @@ -1691,7 +1691,7 @@ static void process_world_aux_hp_and_sp(void) dam_desc = _("硬い岩", "solid rock"); } - take_hit(DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1); } } @@ -1839,7 +1839,7 @@ static void process_world_aux_timeout(void) /* Timed esp */ if (p_ptr->tim_esp) { - (void)set_tim_esp(p_ptr->tim_esp - 1, TRUE); + (void)set_tim_esp(p_ptr, p_ptr->tim_esp - 1, TRUE); } /* Timed temporary elemental brands. -LM- */ @@ -1848,7 +1848,7 @@ static void process_world_aux_timeout(void) p_ptr->ele_attack--; /* Clear all temporary elemental brands. */ - if (!p_ptr->ele_attack) set_ele_attack(0, 0); + if (!p_ptr->ele_attack) set_ele_attack(p_ptr, 0, 0); } /* Timed temporary elemental immune. -LM- */ @@ -1857,7 +1857,7 @@ static void process_world_aux_timeout(void) p_ptr->ele_immune--; /* Clear all temporary elemental brands. */ - if (!p_ptr->ele_immune) set_ele_immune(0, 0); + if (!p_ptr->ele_immune) set_ele_immune(p_ptr, 0, 0); } /* Timed infra-vision */ @@ -1905,7 +1905,7 @@ static void process_world_aux_timeout(void) /* Timed resist-magic */ if (p_ptr->resist_magic) { - (void)set_resist_magic(p_ptr->resist_magic - 1, TRUE); + (void)set_resist_magic(p_ptr, p_ptr->resist_magic - 1, TRUE); } /* Timed regeneration */ @@ -1917,37 +1917,37 @@ static void process_world_aux_timeout(void) /* Timed resist nether */ if (p_ptr->tim_res_nether) { - (void)set_tim_res_nether(p_ptr->tim_res_nether - 1, TRUE); + (void)set_tim_res_nether(p_ptr, p_ptr->tim_res_nether - 1, TRUE); } /* Timed resist time */ if (p_ptr->tim_res_time) { - (void)set_tim_res_time(p_ptr->tim_res_time - 1, TRUE); + (void)set_tim_res_time(p_ptr, p_ptr->tim_res_time - 1, TRUE); } /* Timed reflect */ if (p_ptr->tim_reflect) { - (void)set_tim_reflect(p_ptr->tim_reflect - 1, TRUE); + (void)set_tim_reflect(p_ptr, p_ptr->tim_reflect - 1, TRUE); } /* Multi-shadow */ if (p_ptr->multishadow) { - (void)set_multishadow(p_ptr->multishadow - 1, TRUE); + (void)set_multishadow(p_ptr, p_ptr->multishadow - 1, TRUE); } /* Timed Robe of dust */ if (p_ptr->dustrobe) { - (void)set_dustrobe(p_ptr->dustrobe - 1, TRUE); + (void)set_dustrobe(p_ptr, p_ptr->dustrobe - 1, TRUE); } /* Timed infra-vision */ if (p_ptr->kabenuke) { - (void)set_kabenuke(p_ptr->kabenuke - 1, TRUE); + (void)set_kabenuke(p_ptr, p_ptr->kabenuke - 1, TRUE); } /* Paralysis */ @@ -1995,7 +1995,7 @@ static void process_world_aux_timeout(void) /* Wraith form */ if (p_ptr->wraith_form) { - (void)set_wraith_form(p_ptr->wraith_form - 1, TRUE); + (void)set_wraith_form(p_ptr, p_ptr->wraith_form - 1, TRUE); } /* Heroism */ @@ -2037,42 +2037,42 @@ static void process_world_aux_timeout(void) /* Tsuyoshi */ if (p_ptr->tsuyoshi) { - (void)set_tsuyoshi(p_ptr->tsuyoshi - 1, TRUE); + (void)set_tsuyoshi(p_ptr, p_ptr->tsuyoshi - 1, TRUE); } /* Oppose Acid */ if (p_ptr->oppose_acid) { - (void)set_oppose_acid(p_ptr->oppose_acid - 1, TRUE); + (void)set_oppose_acid(p_ptr, p_ptr->oppose_acid - 1, TRUE); } /* Oppose Lightning */ if (p_ptr->oppose_elec) { - (void)set_oppose_elec(p_ptr->oppose_elec - 1, TRUE); + (void)set_oppose_elec(p_ptr, p_ptr->oppose_elec - 1, TRUE); } /* Oppose Fire */ if (p_ptr->oppose_fire) { - (void)set_oppose_fire(p_ptr->oppose_fire - 1, TRUE); + (void)set_oppose_fire(p_ptr, p_ptr->oppose_fire - 1, TRUE); } /* Oppose Cold */ if (p_ptr->oppose_cold) { - (void)set_oppose_cold(p_ptr->oppose_cold - 1, TRUE); + (void)set_oppose_cold(p_ptr, p_ptr->oppose_cold - 1, TRUE); } /* Oppose Poison */ if (p_ptr->oppose_pois) { - (void)set_oppose_pois(p_ptr->oppose_pois - 1, TRUE); + (void)set_oppose_pois(p_ptr, p_ptr->oppose_pois - 1, TRUE); } if (p_ptr->ult_res) { - (void)set_ultimate_res(p_ptr->ult_res - 1, TRUE); + (void)set_ultimate_res(p_ptr, p_ptr->ult_res - 1, TRUE); } /*** Poison and Stun and Cut ***/ @@ -2092,7 +2092,7 @@ static void process_world_aux_timeout(void) int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1; /* Apply some healing */ - (void)set_stun(p_ptr->stun - adjust); + (void)set_stun(p_ptr, p_ptr->stun - adjust); } /* Cut */ @@ -2104,7 +2104,7 @@ static void process_world_aux_timeout(void) if (p_ptr->cut > 1000) adjust = 0; /* Apply some healing */ - (void)set_cut(p_ptr->cut - adjust); + (void)set_cut(p_ptr,p_ptr->cut - adjust); } } @@ -2204,7 +2204,7 @@ static void process_world_aux_mutation(void) if (one_in_(20)) { msg_print(NULL); - if (one_in_(3)) lose_all_info(); + if (one_in_(3)) lose_all_info(p_ptr); else wiz_dark(); (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE); wiz_dark(); @@ -2388,7 +2388,7 @@ static void process_world_aux_mutation(void) } if ((p_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000)) { - if (!lose_mutation(0)) + if (!lose_mutation(p_ptr, 0)) msg_print(_("奇妙なくらい普通になった気がする。", "You feel oddly normal.")); } if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000)) @@ -2397,11 +2397,11 @@ static void process_world_aux_mutation(void) msg_print(_("非物質化した!", "You feel insubstantial!")); msg_print(NULL); - set_wraith_form(randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE); + set_wraith_form(p_ptr, randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE); } if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000)) { - do_poly_wounds(); + do_poly_wounds(p_ptr); } if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000)) { @@ -2460,12 +2460,12 @@ static void process_world_aux_mutation(void) if (p_ptr->tim_esp > 0) { msg_print(_("精神にもやがかかった!", "Your mind feels cloudy!")); - set_tim_esp(0, TRUE); + set_tim_esp(p_ptr, 0, TRUE); } else { msg_print(_("精神が広がった!", "Your mind expands!")); - set_tim_esp(p_ptr->lev, FALSE); + set_tim_esp(p_ptr, p_ptr->lev, FALSE); } } if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest && one_in_(9000)) @@ -2473,9 +2473,9 @@ static void process_world_aux_mutation(void) disturb(FALSE, TRUE); msg_print(_("胃が痙攣し、食事を失った!", "Your stomach roils, and you lose your lunch!")); msg_print(NULL); - set_food(PY_FOOD_WEAK); - if (music_singing_any()) stop_singing(p_ptr); - if (hex_spelling_any()) stop_hex_spell_all(); + set_food(p_ptr, PY_FOOD_WEAK); + if (music_singing_any(p_ptr)) stop_singing(p_ptr); + if (hex_spelling_any(p_ptr)) stop_hex_spell_all(); } if ((p_ptr->muta2 & MUT2_WALK_SHAD) && !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena) @@ -2548,7 +2548,7 @@ static void process_world_aux_mutation(void) p_ptr->csp += healing; p_ptr->redraw |= (PR_HP | PR_MANA); - take_hit(DAMAGE_LOSELIFE, healing, _("頭に昇った血", "blood rushing to the head"), -1); + take_hit(p_ptr, DAMAGE_LOSELIFE, healing, _("頭に昇った血", "blood rushing to the head"), -1); } } @@ -2559,21 +2559,21 @@ static void process_world_aux_mutation(void) disturb(FALSE, TRUE); msg_print(_("足がもつれて転んだ!", "You trip over your own feet!")); - take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), _("転倒", "tripping"), -1); + take_hit(p_ptr, DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), _("転倒", "tripping"), -1); msg_print(NULL); - if (has_melee_weapon(INVEN_RARM)) + if (has_melee_weapon(p_ptr, INVEN_RARM)) { slot = INVEN_RARM; o_ptr = &p_ptr->inventory_list[INVEN_RARM]; - if (has_melee_weapon(INVEN_LARM) && one_in_(2)) + if (has_melee_weapon(p_ptr, INVEN_LARM) && one_in_(2)) { o_ptr = &p_ptr->inventory_list[INVEN_LARM]; slot = INVEN_LARM; } } - else if (has_melee_weapon(INVEN_LARM)) + else if (has_melee_weapon(p_ptr, INVEN_LARM)) { o_ptr = &p_ptr->inventory_list[INVEN_LARM]; slot = INVEN_LARM; @@ -2662,7 +2662,7 @@ static void process_world_aux_curse(void) if (p_ptr->exp < 0) p_ptr->exp = 0; p_ptr->max_exp -= (p_ptr->lev + 1) / 2; if (p_ptr->max_exp < 0) p_ptr->max_exp = 0; - check_experience(); + check_experience(p_ptr); } /* Add light curse (Later) */ if ((p_ptr->cursed & TRC_ADD_L_CURSE) && one_in_(2000)) @@ -2783,7 +2783,7 @@ static void process_world_aux_curse(void) object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), (OD_OMIT_PREFIX | OD_NAME_ONLY)); msg_format(_("%sはあなたの体力を吸収した!", "Your %s drains HP from you!"), o_name); - take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev*2, 100), o_name, -1); + take_hit(p_ptr, DAMAGE_LOSELIFE, MIN(p_ptr->lev*2, 100), o_name, -1); } /* Handle mana draining */ if ((p_ptr->cursed & TRC_DRAIN_MANA) && p_ptr->csp && one_in_(666)) @@ -2813,7 +2813,7 @@ static void process_world_aux_curse(void) msg_print(_("『審判の宝石』はあなたの体力を吸収した!", "The Jewel of Judgement drains life from you!")); else msg_print(_("なにかがあなたの体力を吸収した!", "Something drains life from you!")); - take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), _("審判の宝石", "the Jewel of Judgement"), -1); + take_hit(p_ptr, DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), _("審判の宝石", "the Jewel of Judgement"), -1); } } } @@ -3530,8 +3530,6 @@ static void process_command(void) } /*** Wizard Commands ***/ - - /* Toggle Wizard Mode */ case KTRL('W'): { if (p_ptr->wizard) @@ -3636,10 +3634,9 @@ static void process_command(void) break; } - /* Hack -- toggle windows */ case KTRL('I'): { - toggle_inven_equip(); + toggle_inven_equip(p_ptr); break; } @@ -3712,11 +3709,10 @@ static void process_command(void) break; } - /* Toggle search mode */ case 'S': { - if (p_ptr->action == ACTION_SEARCH) set_action(ACTION_NONE); - else set_action(ACTION_SEARCH); + if (p_ptr->action == ACTION_SEARCH) set_action(p_ptr, ACTION_NONE); + else set_action(p_ptr, ACTION_SEARCH); break; } @@ -4274,7 +4270,7 @@ static void process_command(void) if (!p_ptr->wild_mode) do_cmd_travel(); if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } break; } @@ -4466,7 +4462,7 @@ static void process_player(void) if ((p_ptr->chp == p_ptr->mhp) && (p_ptr->csp >= p_ptr->msp)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } } @@ -4483,7 +4479,7 @@ static void process_player(void) !p_ptr->image && !p_ptr->word_recall && !p_ptr->alter_reality) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } } } @@ -4592,7 +4588,7 @@ static void process_player(void) /* Mana run out */ p_ptr->csp = 0; p_ptr->csp_frac = 0; - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } else { @@ -4608,7 +4604,7 @@ static void process_player(void) { if (p_ptr->csp < 3) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } else { @@ -4671,7 +4667,7 @@ static void process_player(void) /* Reduce rest count */ p_ptr->resting--; - if (!p_ptr->resting) set_action(ACTION_NONE); + if (!p_ptr->resting) set_action(p_ptr, ACTION_NONE); p_ptr->redraw |= (PR_STATE); } @@ -5038,7 +5034,7 @@ static void dungeon(bool load_game) #endif } - if (!load_game && (p_ptr->special_defense & NINJA_S_STEALTH)) set_superstealth(FALSE); + if (!load_game && (p_ptr->special_defense & NINJA_S_STEALTH)) set_superstealth(p_ptr, FALSE); /*** Process this dungeon level ***/ @@ -5408,7 +5404,7 @@ void play_game(bool new_game) current_world_ptr->seed_town = randint0(0x10000000); /* Roll up a new character */ - player_birth(); + player_birth(p_ptr); counts_write(2,0); p_ptr->count = 0; @@ -5565,7 +5561,7 @@ void play_game(bool new_game) /* Give startup outfit (after loading pref files) */ if (new_game) { - player_outfit(); + player_outfit(p_ptr); } /* React to changes */ @@ -5582,7 +5578,7 @@ void play_game(bool new_game) /* Hack -- Enforce "delayed death" */ if (p_ptr->chp < 0) p_ptr->is_dead = TRUE; - if (p_ptr->prace == RACE_ANDROID) calc_android_exp(); + if (p_ptr->prace == RACE_ANDROID) calc_android_exp(p_ptr); if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER))) { @@ -5654,7 +5650,7 @@ void play_game(bool new_game) p_ptr->chp = 0; p_ptr->chp_frac = 0; p_ptr->exit_bldg = TRUE; - reset_tim_flags(); + reset_tim_flags(p_ptr); /* Leave through the exit */ prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_RAND_CONNECT);