OSDN Git Service

[Refactor] #38997 inven_item_increase()、inven_takeoff() にplayer_type *引数を追加&少し整形...
[hengband/hengband.git] / src / birth.c
index 72fd155..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.",
 
@@ -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,7 +1801,7 @@ static void player_wipe_without_name(player_type *creature_ptr)
        creature_ptr->panic_save = 0;
 
        /* Assume no cheating */
-       creature_ptr->noscore = 0;
+       current_world_ptr->noscore = 0;
        current_world_ptr->wizard = FALSE;
 
        /* Not waiting to report score */
@@ -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 なし
  */
@@ -1970,7 +1974,7 @@ static void wield_all(player_type *creature_ptr)
                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 (creature_ptr->inventory_list[slot].k_idx) continue; 
@@ -1982,7 +1986,7 @@ static void wield_all(player_type *creature_ptr)
                /* 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); 
                } 
  
@@ -2216,9 +2220,9 @@ 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);
@@ -2292,7 +2296,7 @@ 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(creature_ptr, q_ptr);
@@ -4154,7 +4158,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 ***/
@@ -4438,7 +4442,7 @@ 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);
@@ -4566,7 +4570,7 @@ void player_birth(player_type *creature_ptr)
 
        /* 
         * Wipe monsters in old dungeon
-        * This wipe destroys value of p_ptr->current_floor_ptr->m_list[].cur_num .
+        * This wipe destroys value of m_list[].cur_num .
         */
        wipe_m_list();
 
@@ -4598,26 +4602,26 @@ void player_birth(player_type *creature_ptr)
        message_add(" ");
        message_add("  ");
 
-       exe_write_diary(p_ptr, NIKKI_GAMESTART, 1, _("-------- 新規ゲーム開始 --------", "-------- Start New Game --------"));
-       exe_write_diary(p_ptr, 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);
-       exe_write_diary(p_ptr, 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);
-       exe_write_diary(p_ptr, 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);
-       exe_write_diary(p_ptr, 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]) : "");
-               exe_write_diary(p_ptr, NIKKI_BUNSHOU, 1, buf);
+               exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 1, buf);
        }
 
        sprintf(buf,_("                            性格に%sを選択した。", "                            choose %s."), seikaku_info[creature_ptr->pseikaku].title);
-       exe_write_diary(p_ptr, NIKKI_BUNSHOU, 1, buf);
+       exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 1, buf);
 
        /* Init the shops */
        for (i = 1; i < max_towns; i++)