OSDN Git Service

[Refactor] #37353 inside_quest を player_type から floor_type へ移動. / Move inside_quest...
[hengband/hengband.git] / src / birth.c
index f08cd8f..0e13817 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.",
 
@@ -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 */
@@ -1799,7 +1802,7 @@ static void player_wipe_without_name(player_type *creature_ptr)
 
        /* Assume no cheating */
        creature_ptr->noscore = 0;
-       creature_ptr->wizard = FALSE;
+       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;
        }
@@ -1831,7 +1834,7 @@ 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_quest = 0;
        for (i = 0; i < MAX_MANE; i++)
        {
                creature_ptr->mane_spell[i] = -1;
@@ -1883,11 +1886,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);
 
-       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 +1910,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);
 
        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);
 
        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 なし
  */
@@ -2212,7 +2215,7 @@ 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;
 
@@ -2224,7 +2227,7 @@ static void add_outfit(object_type *o_ptr)
        autopick_alter_item(slot, FALSE);
 
        /* Now try wielding everything */ 
-       wield_all(p_ptr); 
+       wield_all(creature_ptr); 
 }
 
 
@@ -2263,7 +2266,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;
@@ -2276,14 +2279,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;
 
@@ -2295,7 +2298,7 @@ void player_outfit(player_type *creature_ptr)
                apply_magic(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;
 
@@ -2304,7 +2307,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;
 
@@ -2315,7 +2318,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)
        {
@@ -2324,7 +2327,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;
 
@@ -2332,7 +2335,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))
@@ -2341,14 +2344,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)
        {
@@ -2356,7 +2359,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)
        {
@@ -2365,7 +2368,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)
        {
@@ -2376,7 +2379,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)
@@ -2387,33 +2390,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)
        {
@@ -2421,7 +2424,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)
        {
@@ -2429,7 +2432,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)
@@ -2472,7 +2475,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 */
@@ -3662,7 +3665,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);
@@ -4154,7 +4157,7 @@ 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 */
+       /* Reset turn; before auto-roll and after choosing race */
        init_turn(creature_ptr);
 
        /*** Generate ***/
@@ -4308,7 +4311,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);
@@ -4361,7 +4364,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);
@@ -4395,7 +4398,6 @@ static bool player_birth_aux(player_type *creature_ptr)
                                continue;
                        }
 
-                       /* Toggle the display */
                        if ((c == 'H') || (c == 'h'))
                        {
                                mode = ((mode != 0) ? 0 : 1);
@@ -4527,7 +4529,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];
@@ -4567,7 +4569,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 p_ptr->current_floor_ptr->m_list[].cur_num .
         */
        wipe_m_list();
 
@@ -4599,26 +4601,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(p_ptr, NIKKI_GAMESTART, 1, _("-------- 新規ゲーム開始 --------", "-------- Start New Game --------"));
+       exe_write_diary(p_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(p_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(p_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(p_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(p_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(p_ptr, NIKKI_BUNSHOU, 1, buf);
 
        /* Init the shops */
        for (i = 1; i < max_towns; i++)