OSDN Git Service

[Refactor] #38997 inven_item_increase()、inven_takeoff() にplayer_type *引数を追加&少し整形...
[hengband/hengband.git] / src / birth.c
index f46c842..d2dd46b 100644 (file)
@@ -238,7 +238,7 @@ static concptr race_jouhou[MAX_RACES] =
 
 "A Kutar is an expressionless animal-like living creature.  The word 'kuta' means 'absentmindedly' or 'vacantly'.  Their absentmindedness hurts their searching and perception skills, but renders them incapable of being confused.  Their unearthly calmness and serenity make them among the most stealthy of any race.  Kutars, although expressionless, are beautiful and so have a high charisma.  Members of this race can learn to expand their body horizontally.  This increases armour class, but renders them vulnerable to magical attacks.",
 
-"An android is a artificial creation with a body of machinery.  They are poor at spell casting, but they make excellent warriors.  They don't acquire experience like other races, but rather gain in power as they attach new equipment to their frame.  Rings, amulets, and lights do not influence growth.  Androids are resistant to poison, can move freely, and are immune to exp-draining attacks.  Moreover, because of their hard metallic bodies, they get a bonus to AC.  Androids have electronic circuits throughout their body and must beware of electric shocks.  They gain very little nutrition from the food of mortals, but they can use flasks of oil as their energy source."
+"An android is a artificial creation with a body of machinery.  They are poor at spell casting, but they make excellent warriors.  They don't acquire experience like other races, but rather gain in power as they attach new equipment to their frame.  Rings, amulets, and lights do not influence growth.  Androids are resistant to poison, can move freely, and are immune to exp-draining attacks.  Moreover, because of their hard metallic bodies, they get a bonus to AC.  Androids have electronic circuits throughout their body and must beware of electric shocks.  They gain very little nutrition from the food of mortals, but they can use flasks of oil as their energy source.",
 
 "Merfolk implementing.",
 
@@ -315,7 +315,7 @@ static concptr class_jouhou[MAX_CLASS] =
 
 "A Rogue is a character that prefers to live by his cunning, but is capable of fighting his way out of a tight spot.  Rogues are good at locating hidden traps and doors and are the masters of disarming traps and picking locks.  A rogue has a high stealth allowing him to sneak around many creatures without having to fight, or to get in a telling first blow.  A rogue may also backstab a fleeing monster.  Intelligence determines a Rogue's spell casting ability.",
 
-"A Ranger is a combination of a warrior and a mage who has developed a special affinity for the natural world around him.  He is a good fighter and also good about a missile weapon such as a bow.  A ranger has a good stealth, good perception, good searching, a good saving throw and is good with magical devices.  Intelligence determines a Ranger's spell casting ability.",
+"A Ranger is a combination of a warrior and a mage who has developed a special affinity for the natural world.  He or she is a good fighter and also good with missile weapons such as bows.  A ranger has good stealth, good perception, good searching, good saving throws and is good with magical devices.  Intelligence determines a Ranger's spell casting ability.",
 
 "A Paladin is a combination of a warrior and a priest.  Paladins are very good fighters, but not very good at missile weapons.  A paladin lacks much in the way of abilities.  He is poor at stealth, perception, searching, and magical devices but has a decent saving throw due to his divine alliance.  Wisdom determines a Paladin's success at praying to his deity.",
 
@@ -422,7 +422,7 @@ static concptr seikaku_jouhou[MAX_SEIKAKU] =
 
 "\"munchkin\" is a personality for beginners.  It raises all your stats and skills.  With this personality, you can win the game easily, but gain little honor in doing so.",
 
-"\ChargeMan\" is crazy killer. It render you powerfull strength and constitution, but poor intelligence.you are not confused and seen the illusion because this you go mad from the beginning.",
+"\"ChargeMan\" is crazy killer. It render you powerfull strength and constitution, but poor intelligence.you are not confused and seen the illusion because this you go mad from the beginning.",
 
 #endif
 };
@@ -1585,10 +1585,10 @@ static void get_money(player_type *creature_ptr)
 
 /*!
  * @brief put_stats()のサブルーチンとして、オートロール中のステータスを表示する / Display stat values, subset of "put_stats()"
- * @details See 'display_player()' for screen layout constraints.
+ * @details See 'display_player(p_ptr, )' for screen layout constraints.
  * @return なし
  */
-static void birth_put_stats(void)
+static void birth_put_stats(player_type *creature_ptr)
 {
        int i, j, m, p;
        int col;
@@ -1606,7 +1606,7 @@ static void birth_put_stats(void)
                        j = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
 
                        /* Obtain the current stat */
-                       m = adjust_stat(p_ptr->stat_max[i], j);
+                       m = adjust_stat(creature_ptr->stat_max[i], j);
 
                        /* Put the stat */
                        cnv_stat(m, buf);
@@ -1682,6 +1682,9 @@ static void player_wipe_without_name(player_type *creature_ptr)
        /* Hack -- zero the struct */
        (void)WIPE(creature_ptr, player_type);
 
+       //TODO: キャラ作成からゲーム開始までに  current_floor_ptr を参照しなければならない処理は今後整理して外す。
+       creature_ptr->current_floor_ptr = &floor_info;
+
        C_MAKE(creature_ptr->inventory_list, INVEN_TOTAL, object_type);
 
        /* Wipe the history */
@@ -1790,7 +1793,7 @@ static void player_wipe_without_name(player_type *creature_ptr)
        cheat_turn = FALSE;
 
        /* Assume no winning game */
-       creature_ptr->total_winner = FALSE;
+       current_world_ptr->total_winner = FALSE;
 
        creature_ptr->timewalk = FALSE;
 
@@ -1798,8 +1801,8 @@ static void player_wipe_without_name(player_type *creature_ptr)
        creature_ptr->panic_save = 0;
 
        /* Assume no cheating */
-       creature_ptr->noscore = 0;
-       creature_ptr->wizard = FALSE;
+       current_world_ptr->noscore = 0;
+       current_world_ptr->wizard = FALSE;
 
        /* Not waiting to report score */
        creature_ptr->wait_report_score = FALSE;
@@ -1809,7 +1812,7 @@ static void player_wipe_without_name(player_type *creature_ptr)
        creature_ptr->pet_extra_flags = (PF_TELEPORT | PF_ATTACK_SPELL | PF_SUMMON_SPELL);
 
        /* Wipe the recall depths */
-       for (i = 0; i < max_d_idx; i++)
+       for (i = 0; i < current_world_ptr->max_d_idx; i++)
        {
                max_dlv[i] = 0;
        }
@@ -1830,8 +1833,8 @@ static void player_wipe_without_name(player_type *creature_ptr)
 
        /* Initialize arena and rewards information -KMW- */
        creature_ptr->arena_number = 0;
-       creature_ptr->inside_arena = FALSE;
-       creature_ptr->inside_quest = 0;
+       creature_ptr->current_floor_ptr->inside_arena = FALSE;
+       creature_ptr->current_floor_ptr->inside_quest = 0;
        for (i = 0; i < MAX_MANE; i++)
        {
                creature_ptr->mane_spell[i] = -1;
@@ -1874,6 +1877,7 @@ static void player_wipe_without_name(player_type *creature_ptr)
 
 /*!
  * @brief ダンジョン内部のクエストを初期化する / Initialize random quests and final quests
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @return なし
  */
 static void init_dungeon_quests(player_type *creature_ptr)
@@ -1883,11 +1887,11 @@ static void init_dungeon_quests(player_type *creature_ptr)
 
        /* Init the random quests */
        init_flags = INIT_ASSIGN;
-       creature_ptr->inside_quest = MIN_RANDOM_QUEST;
+       creature_ptr->current_floor_ptr->inside_quest = MIN_RANDOM_QUEST;
 
-       process_dungeon_file("q_info.txt", 0, 0, 0, 0);
+       process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
 
-       creature_ptr->inside_quest = 0;
+       creature_ptr->current_floor_ptr->inside_quest = 0;
 
        /* Generate quests */
        for (i = MIN_RANDOM_QUEST + number_of_quests - 1; i >= MIN_RANDOM_QUEST; i--)
@@ -1907,22 +1911,22 @@ static void init_dungeon_quests(player_type *creature_ptr)
 
        /* Init the two main quests (Oberon + Serpent) */
        init_flags = INIT_ASSIGN;
-       creature_ptr->inside_quest = QUEST_OBERON;
+       creature_ptr->current_floor_ptr->inside_quest = QUEST_OBERON;
 
-       process_dungeon_file("q_info.txt", 0, 0, 0, 0);
+       process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
 
        quest[QUEST_OBERON].status = QUEST_STATUS_TAKEN;
 
-       creature_ptr->inside_quest = QUEST_SERPENT;
+       creature_ptr->current_floor_ptr->inside_quest = QUEST_SERPENT;
 
-       process_dungeon_file("q_info.txt", 0, 0, 0, 0);
+       process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
 
        quest[QUEST_SERPENT].status = QUEST_STATUS_TAKEN;
-       creature_ptr->inside_quest = 0;
+       creature_ptr->current_floor_ptr->inside_quest = 0;
 }
 
 /*!
- * @brief ゲームターンを初期化する / Reset current_world_ptr->game_turn
+ * @brief ゲームターンを初期化する / Reset turn
  * @details アンデッド系種族は開始時刻を夜からにする。
  * @return なし
  */
@@ -1950,10 +1954,9 @@ static void init_turn(player_type *creature_ptr)
 
 /*!
  * @brief 所持状態にあるアイテムの中から一部枠の装備可能なものを装備させる。
- * @details アンデッド系種族は開始時刻を夜からにする。
  * @return なし
  */
-static void wield_all(void
+static void wield_all(player_type *creature_ptr
 { 
        object_type *o_ptr; 
        object_type *i_ptr; 
@@ -1965,16 +1968,16 @@ static void wield_all(void)
        /* Scan through the slots backwards */ 
        for (item = INVEN_PACK - 1; item >= 0; item--) 
        { 
-               o_ptr = &p_ptr->inventory_list[item]; 
+               o_ptr = &creature_ptr->inventory_list[item]; 
  
                /* Skip non-objects */ 
                if (!o_ptr->k_idx) continue; 
  
                /* Make sure we can wield it and that there's nothing else in that slot */ 
-               slot = wield_slot(o_ptr); 
+               slot = wield_slot(creature_ptr, o_ptr); 
                if (slot < INVEN_RARM) continue; 
                if (slot == INVEN_LITE) continue; /* Does not wield toaches because buys a lantern soon */
-               if (p_ptr->inventory_list[slot].k_idx) continue; 
+               if (creature_ptr->inventory_list[slot].k_idx) continue; 
  
                i_ptr = &object_type_body; 
                object_copy(i_ptr, o_ptr); 
@@ -1983,7 +1986,7 @@ static void wield_all(void)
                /* Decrease the item (from the pack) */ 
                if (item >= 0) 
                { 
-                       inven_item_increase(item, -1); 
+                       inven_item_increase(creature_ptr, item, -1); 
                        inven_item_optimize(item); 
                } 
  
@@ -1994,12 +1997,12 @@ static void wield_all(void)
                        floor_item_optimize(0 - item); 
                } 
  
-               o_ptr = &p_ptr->inventory_list[slot]; 
+               o_ptr = &creature_ptr->inventory_list[slot]; 
                object_copy(o_ptr, i_ptr); 
-               p_ptr->total_weight += i_ptr->weight; 
+               creature_ptr->total_weight += i_ptr->weight; 
  
                /* Increment the equip counter by hand */ 
-               p_ptr->equip_cnt++;
+               creature_ptr->equip_cnt++;
 
        } 
        return; 
@@ -2213,19 +2216,19 @@ static byte player_init[MAX_CLASS][3][2] =
  * @param o_ptr 処理したいオブジェクト構造体の参照ポインタ
  * @return なし
  */
-static void add_outfit(object_type *o_ptr)
+static void add_outfit(player_type *creature_ptr, object_type *o_ptr)
 {
        s16b slot;
 
-       object_aware(o_ptr);
+       object_aware(creature_ptr, o_ptr);
        object_known(o_ptr);
-       slot = inven_carry(o_ptr);
+       slot = inven_carry(creature_ptr, o_ptr);
 
        /* Auto-inscription */
        autopick_alter_item(slot, FALSE);
 
        /* Now try wielding everything */ 
-       wield_all(); 
+       wield_all(creature_ptr); 
 }
 
 
@@ -2264,7 +2267,7 @@ void player_outfit(player_type *creature_ptr)
                        if(q_ptr->pval)
                        {
                                q_ptr->number = 1;
-                               add_outfit(q_ptr);
+                               add_outfit(creature_ptr, q_ptr);
                        }
                }
                break;
@@ -2277,14 +2280,14 @@ void player_outfit(player_type *creature_ptr)
                object_prep(q_ptr, lookup_kind(TV_STAFF, SV_STAFF_NOTHING));
                q_ptr->number = 1;
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
                break;
 
        case RACE_ENT:
                /* Potions of Water */
                object_prep(q_ptr, lookup_kind(TV_POTION, SV_POTION_WATER));
                q_ptr->number = (ITEM_NUMBER)rand_range(15, 23);
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
 
                break;
 
@@ -2293,10 +2296,10 @@ void player_outfit(player_type *creature_ptr)
                object_prep(q_ptr, lookup_kind(TV_FLASK, SV_ANY));
 
                /* Fuel with oil (move pval to xtra4) */
-               apply_magic(q_ptr, 1, AM_NO_FIXED_ART);
+               apply_magic(creature_ptr, q_ptr, 1, AM_NO_FIXED_ART);
 
                q_ptr->number = (ITEM_NUMBER)rand_range(7, 12);
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
 
                break;
 
@@ -2305,7 +2308,7 @@ void player_outfit(player_type *creature_ptr)
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
                q_ptr->number = (ITEM_NUMBER)rand_range(3, 7);
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
        }
        q_ptr = &forge;
 
@@ -2316,7 +2319,7 @@ void player_outfit(player_type *creature_ptr)
 
                q_ptr->number = (ITEM_NUMBER)rand_range(2, 5);
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
        }
        else if (creature_ptr->pclass != CLASS_NINJA)
        {
@@ -2325,7 +2328,7 @@ void player_outfit(player_type *creature_ptr)
                q_ptr->number = (ITEM_NUMBER)rand_range(3, 7);
                q_ptr->xtra4 = rand_range(3, 7) * 500;
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
        }
        q_ptr = &forge;
 
@@ -2333,7 +2336,7 @@ void player_outfit(player_type *creature_ptr)
        {
                object_prep(q_ptr, lookup_kind(TV_RING, SV_RING_LEVITATION_FALL));
                q_ptr->number = 1;
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
        }
 
        if ((creature_ptr->pclass == CLASS_RANGER) || (creature_ptr->pclass == CLASS_CAVALRY))
@@ -2342,14 +2345,14 @@ void player_outfit(player_type *creature_ptr)
                object_prep(q_ptr, lookup_kind(TV_ARROW, SV_AMMO_NORMAL));
                q_ptr->number = (byte)rand_range(15, 20);
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
        }
        if (creature_ptr->pclass == CLASS_RANGER)
        {
                /* Hack -- Give the player some arrows */
                object_prep(q_ptr, lookup_kind(TV_BOW, SV_SHORT_BOW));
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
        }
        else if (creature_ptr->pclass == CLASS_ARCHER)
        {
@@ -2357,7 +2360,7 @@ void player_outfit(player_type *creature_ptr)
                object_prep(q_ptr, lookup_kind(TV_ARROW, SV_AMMO_NORMAL));
                q_ptr->number = (ITEM_NUMBER)rand_range(15, 20);
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
        }
        else if (creature_ptr->pclass == CLASS_HIGH_MAGE)
        {
@@ -2366,7 +2369,7 @@ void player_outfit(player_type *creature_ptr)
                q_ptr->number = 1;
                q_ptr->pval = (PARAMETER_VALUE)rand_range(25, 30);
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
        }
        else if (creature_ptr->pclass == CLASS_SORCERER)
        {
@@ -2377,7 +2380,7 @@ void player_outfit(player_type *creature_ptr)
                        object_prep(q_ptr, lookup_kind(book_tval, 0));
                        q_ptr->number = 1;
 
-                       add_outfit(q_ptr);
+                       add_outfit(creature_ptr, q_ptr);
                }
        }
        else if (creature_ptr->pclass == CLASS_TOURIST)
@@ -2388,33 +2391,33 @@ void player_outfit(player_type *creature_ptr)
                        object_prep(q_ptr, lookup_kind(TV_SHOT, SV_AMMO_LIGHT));
                        q_ptr->number = rand_range(15, 20);
 
-                       add_outfit(q_ptr);
+                       add_outfit(creature_ptr, q_ptr);
                }
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_BISCUIT));
                q_ptr->number = rand_range(2, 4);
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_WAYBREAD));
                q_ptr->number = rand_range(2, 4);
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_JERKY));
                q_ptr->number = rand_range(1, 3);
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_PINT_OF_ALE));
                q_ptr->number = rand_range(2, 4);
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_PINT_OF_WINE));
                q_ptr->number = rand_range(2, 4);
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
        }
        else if (creature_ptr->pclass == CLASS_NINJA)
        {
@@ -2422,7 +2425,7 @@ void player_outfit(player_type *creature_ptr)
                object_prep(q_ptr, lookup_kind(TV_SPIKE, 0));
                q_ptr->number = rand_range(15, 20);
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
        }
        else if (creature_ptr->pclass == CLASS_SNIPER)
        {
@@ -2430,7 +2433,7 @@ void player_outfit(player_type *creature_ptr)
                object_prep(q_ptr, lookup_kind(TV_BOLT, SV_AMMO_NORMAL));
                q_ptr->number = rand_range(15, 20);
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
        }
 
        if(creature_ptr->pseikaku == SEIKAKU_SEXY)
@@ -2473,7 +2476,7 @@ void player_outfit(player_type *creature_ptr)
                        q_ptr->name2 = EGO_BRAND_POIS;
                }
 
-               add_outfit(q_ptr);
+               add_outfit(creature_ptr, q_ptr);
        }
 
        /* Hack -- make aware of the water */
@@ -2484,7 +2487,7 @@ void player_outfit(player_type *creature_ptr)
  * @brief プレイヤーの種族選択を行う / Player race
  * @return なし
  */
-static bool get_player_race(void)
+static bool get_player_race(player_type *creature_ptr)
 {
        int     k, n, cs, os;
        concptr    str;
@@ -2519,7 +2522,7 @@ static bool get_player_race(void)
 
        /* Choose */
        k = -1;
-       cs = p_ptr->prace;
+       cs = creature_ptr->prace;
        os = MAX_RACES;
        while (1)
        {
@@ -2627,9 +2630,9 @@ static bool get_player_race(void)
        }
 
        /* Set race */
-       p_ptr->prace = (byte_hack)k;
+       creature_ptr->prace = (byte_hack)k;
 
-       rp_ptr = &race_info[p_ptr->prace];
+       rp_ptr = &race_info[creature_ptr->prace];
 
        /* Display */
        c_put_str(TERM_L_BLUE, rp_ptr->title, 4, 15);
@@ -2643,7 +2646,7 @@ static bool get_player_race(void)
  * @brief プレイヤーの職業選択を行う / Player class
  * @return なし
  */
-static bool get_player_class(void)
+static bool get_player_class(player_type *creature_ptr)
 {
        int     k, n, cs, os;
        char    c;
@@ -2687,7 +2690,7 @@ static bool get_player_class(void)
 
        /* Get a class */
        k = -1;
-       cs = p_ptr->pclass;
+       cs = creature_ptr->pclass;
        os = MAX_CLASS_CHOICE;
        while (1)
        {
@@ -2799,9 +2802,9 @@ static bool get_player_class(void)
        }
 
        /* Set class */
-       p_ptr->pclass = (byte_hack)k;
-       cp_ptr = &class_info[p_ptr->pclass];
-       mp_ptr = &m_info[p_ptr->pclass];
+       creature_ptr->pclass = (byte_hack)k;
+       cp_ptr = &class_info[creature_ptr->pclass];
+       mp_ptr = &m_info[creature_ptr->pclass];
 
        /* Display */
        c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 15);
@@ -3547,7 +3550,7 @@ void add_history_from_pref_line(concptr t)
  * @brief 生い立ちメッセージをファイルからロードする。
  * @return なし
  */
-static bool do_cmd_histpref(void)
+static bool do_cmd_histpref(player_type *creature_ptr)
 {
        char buf[80];
        errr err;
@@ -3563,9 +3566,9 @@ static bool do_cmd_histpref(void)
        histpref_buf = histbuf;
 
 #ifdef JP
-       sprintf(buf, "histedit-%s.prf", p_ptr->base_name);
+       sprintf(buf, "histedit-%s.prf", creature_ptr->base_name);
 #else
-       sprintf(buf, "histpref-%s.prf", p_ptr->base_name);
+       sprintf(buf, "histpref-%s.prf", creature_ptr->base_name);
 #endif
        err = process_histpref_file(buf);
 
@@ -3602,7 +3605,7 @@ static bool do_cmd_histpref(void)
        }
 
        /* Clear the previous history strings */
-       for (i = 0; i < 4; i++) p_ptr->history[i][0] = '\0';
+       for (i = 0; i < 4; i++) creature_ptr->history[i][0] = '\0';
 
        /* Skip leading spaces */
        for (s = histpref_buf; *s == ' '; s++) /* loop */;
@@ -3620,7 +3623,7 @@ static bool do_cmd_histpref(void)
                if (t[0] == 0) break;
                else
                {
-                       strcpy(p_ptr->history[i], t);
+                       strcpy(creature_ptr->history[i], t);
                        t += strlen(t) + 1;
                }
        }
@@ -3628,10 +3631,10 @@ static bool do_cmd_histpref(void)
        /* Fill the remaining spaces */
        for (i = 0; i < 4; i++)
        {
-               for (j = 0; p_ptr->history[i][j]; j++) /* loop */;
+               for (j = 0; creature_ptr->history[i][j]; j++) /* loop */;
 
-               for (; j < 59; j++) p_ptr->history[i][j] = ' ';
-               p_ptr->history[i][59] = '\0';
+               for (; j < 59; j++) creature_ptr->history[i][j] = ' ';
+               creature_ptr->history[i][59] = '\0';
        }
 
        /* Kill the buffer */
@@ -3663,7 +3666,7 @@ static void edit_history(player_type *creature_ptr)
                for (; j < 59; j++) creature_ptr->history[i][j] = ' ';
                creature_ptr->history[i][59] = '\0';
        }
-       display_player(1);
+       display_player(p_ptr, 1);
 #ifdef JP
        c_put_str(TERM_L_GREEN, "(キャラクターの生い立ち - 編集モード)", 11, 20);
        put_str("[ カーソルキーで移動、Enterで終了、Ctrl-Aでファイル読み込み ]", 17, 10);
@@ -3772,7 +3775,7 @@ static void edit_history(player_type *creature_ptr)
                }
                else if (c == KTRL('A'))
                {
-                       if (do_cmd_histpref())
+                       if (do_cmd_histpref(creature_ptr))
                        {
 #ifdef JP
                                if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1))) x--;
@@ -4021,7 +4024,7 @@ static bool player_birth_aux(player_type *creature_ptr)
                char temp[80*10];
                concptr t;
 
-               if (!get_player_race()) return FALSE;
+               if (!get_player_race(creature_ptr)) return FALSE;
 
                clear_from(10);
 
@@ -4057,7 +4060,7 @@ static bool player_birth_aux(player_type *creature_ptr)
                char temp[80*9];
                concptr t;
 
-               if (!get_player_class()) return FALSE;
+               if (!get_player_class(creature_ptr)) return FALSE;
 
                clear_from(10);
                roff_to_buf(class_jouhou[creature_ptr->pclass], 74, temp, sizeof(temp));
@@ -4155,8 +4158,8 @@ static bool player_birth_aux(player_type *creature_ptr)
 #endif /* ALLOW_AUTOROLLER */
        clear_from(10);
 
-       /* Reset current_world_ptr->game_turn; before auto-roll and after choosing race */
-       init_turn(p_ptr);
+       /* Reset turn; before auto-roll and after choosing race */
+       init_turn(creature_ptr);
 
        /*** Generate ***/
 
@@ -4309,7 +4312,7 @@ static bool player_birth_aux(player_type *creature_ptr)
                        if (flag)
                        {
                                /* Dump data */
-                               birth_put_stats();
+                               birth_put_stats(creature_ptr);
 
                                /* Dump round */
                                put_str(format("%10ld", auto_round), 10, col+20);
@@ -4362,7 +4365,7 @@ static bool player_birth_aux(player_type *creature_ptr)
                        creature_ptr->chp = creature_ptr->mhp;
                        creature_ptr->csp = creature_ptr->msp;
 
-                       display_player(mode);
+                       display_player(p_ptr, mode);
 
                        /* Prepare a prompt (must squeeze everything in) */
                        Term_gotoxy(2, 23);
@@ -4396,7 +4399,6 @@ static bool player_birth_aux(player_type *creature_ptr)
                                continue;
                        }
 
-                       /* Toggle the display */
                        if ((c == 'H') || (c == 'h'))
                        {
                                mode = ((mode != 0) ? 0 : 1);
@@ -4440,13 +4442,13 @@ static bool player_birth_aux(player_type *creature_ptr)
        clear_from(23);
 
        /* Get a name, recolor it, prepare savefile */
-       get_name();
+       get_name(creature_ptr);
 
        /* Process the player name */
        process_player_name(current_world_ptr->creating_savefile);
 
        /*** Edit character background ***/
-       edit_history(p_ptr);
+       edit_history(creature_ptr);
 
        /*** Finish up ***/
 
@@ -4473,7 +4475,7 @@ static bool player_birth_aux(player_type *creature_ptr)
 
 
        /* Initialize random quests */
-       init_dungeon_quests(p_ptr);
+       init_dungeon_quests(creature_ptr);
 
        /* Save character data for quick start */
        save_prev_data(creature_ptr, &previous_char);
@@ -4528,7 +4530,7 @@ static bool ask_quick_start(player_type *creature_ptr)
        }
 
        load_prev_data(creature_ptr, FALSE);
-       init_turn(p_ptr);
+       init_turn(creature_ptr);
        init_dungeon_quests(creature_ptr);
 
        sp_ptr = &sex_info[creature_ptr->psex];
@@ -4568,7 +4570,7 @@ void player_birth(player_type *creature_ptr)
 
        /* 
         * Wipe monsters in old dungeon
-        * This wipe destroys value of current_floor_ptr->m_list[].cur_num .
+        * This wipe destroys value of m_list[].cur_num .
         */
        wipe_m_list();
 
@@ -4600,26 +4602,26 @@ void player_birth(player_type *creature_ptr)
        message_add(" ");
        message_add("  ");
 
-       do_cmd_write_nikki(NIKKI_GAMESTART, 1, _("-------- 新規ゲーム開始 --------", "-------- Start New Game --------"));
-       do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
+       exe_write_diary(creature_ptr, NIKKI_GAMESTART, 1, _("-------- 新規ゲーム開始 --------", "-------- Start New Game --------"));
+       exe_write_diary(creature_ptr, NIKKI_HIGAWARI, 0, NULL);
 
        sprintf(buf,_("                            性別に%sを選択した。", "                            choose %s personality."), sex_info[creature_ptr->psex].title);
-       do_cmd_write_nikki(NIKKI_BUNSHOU, 1, buf);
+       exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 1, buf);
 
        sprintf(buf,_("                            種族に%sを選択した。", "                            choose %s race."), race_info[creature_ptr->prace].title);
-       do_cmd_write_nikki(NIKKI_BUNSHOU, 1, buf);
+       exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 1, buf);
 
        sprintf(buf,_("                            職業に%sを選択した。", "                            choose %s class."), class_info[creature_ptr->pclass].title);
-       do_cmd_write_nikki(NIKKI_BUNSHOU, 1, buf);
+       exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 1, buf);
 
        if (creature_ptr->realm1)
        {
                sprintf(buf,_("                            魔法の領域に%s%sを選択した。", "                            choose %s%s realm."),realm_names[creature_ptr->realm1], creature_ptr->realm2 ? format("と%s",realm_names[creature_ptr->realm2]) : "");
-               do_cmd_write_nikki(NIKKI_BUNSHOU, 1, buf);
+               exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 1, buf);
        }
 
        sprintf(buf,_("                            性格に%sを選択した。", "                            choose %s."), seikaku_info[creature_ptr->pseikaku].title);
-       do_cmd_write_nikki(NIKKI_BUNSHOU, 1, buf);
+       exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 1, buf);
 
        /* Init the shops */
        for (i = 1; i < max_towns; i++)