• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisionea662951d3816b5df609458095ab9b0c1a445856 (tree)
Time2019-07-04 20:25:20
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 player_birth_aux() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/birth.c
+++ b/src/birth.c
@@ -3853,7 +3853,7 @@ static void edit_history(void)
38533853 * expensive CPU wise. And it cuts down on player stupidity.
38543854 * @return なし
38553855 */
3856-static bool player_birth_aux(void)
3856+static bool player_birth_aux(player_type *creature_ptr)
38573857 {
38583858 int i, k, n, cs, os;
38593859
@@ -3887,7 +3887,7 @@ static bool player_birth_aux(void)
38873887 put_str(_("職業 :", "Class :"), 5, 1);
38883888
38893889 /* Dump the default name */
3890- c_put_str(TERM_L_BLUE, p_ptr->name, 1, 34);
3890+ c_put_str(TERM_L_BLUE, creature_ptr->name, 1, 34);
38913891
38923892 /*** Instructions ***/
38933893
@@ -4005,8 +4005,8 @@ static bool player_birth_aux(void)
40054005 }
40064006
40074007 /* Set sex */
4008- p_ptr->psex = (byte_hack)k;
4009- sp_ptr = &sex_info[p_ptr->psex];
4008+ creature_ptr->psex = (byte_hack)k;
4009+ sp_ptr = &sex_info[creature_ptr->psex];
40104010
40114011 /* Display */
40124012 c_put_str(TERM_L_BLUE, sp_ptr->title, 3, 15);
@@ -4015,7 +4015,7 @@ static bool player_birth_aux(void)
40154015 clear_from(10);
40164016
40174017 /* Choose the players race */
4018- p_ptr->prace = 0;
4018+ creature_ptr->prace = 0;
40194019 while(1)
40204020 {
40214021 char temp[80*10];
@@ -4025,7 +4025,7 @@ static bool player_birth_aux(void)
40254025
40264026 clear_from(10);
40274027
4028- roff_to_buf(race_jouhou[p_ptr->prace], 74, temp, sizeof(temp));
4028+ roff_to_buf(race_jouhou[creature_ptr->prace], 74, temp, sizeof(temp));
40294029 t = temp;
40304030
40314031 for (i = 0; i< 10; i++)
@@ -4051,7 +4051,7 @@ static bool player_birth_aux(void)
40514051 clear_from(10);
40524052
40534053 /* Choose the players class */
4054- p_ptr->pclass = 0;
4054+ creature_ptr->pclass = 0;
40554055 while(1)
40564056 {
40574057 char temp[80*9];
@@ -4060,7 +4060,7 @@ static bool player_birth_aux(void)
40604060 if (!get_player_class()) return FALSE;
40614061
40624062 clear_from(10);
4063- roff_to_buf(class_jouhou[p_ptr->pclass], 74, temp, sizeof(temp));
4063+ roff_to_buf(class_jouhou[creature_ptr->pclass], 74, temp, sizeof(temp));
40644064 t = temp;
40654065
40664066 for (i = 0; i< 9; i++)
@@ -4083,10 +4083,10 @@ static bool player_birth_aux(void)
40834083 }
40844084
40854085 /* Choose the magic realms */
4086- if (!get_player_realms(p_ptr)) return FALSE;
4086+ if (!get_player_realms(creature_ptr)) return FALSE;
40874087
40884088 /* Choose the players seikaku */
4089- p_ptr->pseikaku = 0;
4089+ creature_ptr->pseikaku = 0;
40904090 while(1)
40914091 {
40924092 char temp[80*8];
@@ -4095,7 +4095,7 @@ static bool player_birth_aux(void)
40954095 if (!get_player_seikaku()) return FALSE;
40964096
40974097 clear_from(10);
4098- roff_to_buf(seikaku_jouhou[p_ptr->pseikaku], 74, temp, sizeof(temp));
4098+ roff_to_buf(seikaku_jouhou[creature_ptr->pseikaku], 74, temp, sizeof(temp));
40994099 t = temp;
41004100
41014101 for (i = 0; i< A_MAX; i++)
@@ -4113,8 +4113,8 @@ static bool player_birth_aux(void)
41134113 #else
41144114 if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y)) break;
41154115 #endif
4116- c_put_str(TERM_L_BLUE, p_ptr->name, 1, 34);
4117- prt("", 1, 34+strlen(p_ptr->name));
4116+ c_put_str(TERM_L_BLUE, creature_ptr->name, 1, 34);
4117+ prt("", 1, 34+strlen(creature_ptr->name));
41184118 }
41194119
41204120 /* Clean up */
@@ -4193,13 +4193,13 @@ static bool player_birth_aux(void)
41934193 else
41944194 {
41954195 /* Get a new character */
4196- get_stats(p_ptr);
4196+ get_stats(creature_ptr);
41974197
41984198 /* Roll for age/height/weight */
41994199 get_ahw();
42004200
42014201 /* Roll for social class */
4202- get_history(p_ptr);
4202+ get_history(creature_ptr);
42034203 }
42044204
42054205 /* Feedback */
@@ -4255,7 +4255,7 @@ static bool player_birth_aux(void)
42554255 bool accept = TRUE;
42564256
42574257 /* Get a new character */
4258- get_stats(p_ptr);
4258+ get_stats(creature_ptr);
42594259
42604260 /* Advance the round */
42614261 auto_round++;
@@ -4280,7 +4280,7 @@ static bool player_birth_aux(void)
42804280 for (i = 0; i < A_MAX; i++)
42814281 {
42824282 /* This stat is okay */
4283- if (p_ptr->stat_max[i] >= stat_limit[i])
4283+ if (creature_ptr->stat_max[i] >= stat_limit[i])
42844284 {
42854285 stat_match[i]++;
42864286 }
@@ -4300,14 +4300,14 @@ static bool player_birth_aux(void)
43004300 get_ahw();
43014301
43024302 /* Roll for social class */
4303- get_history(p_ptr);
4303+ get_history(creature_ptr);
43044304
43054305 if (autochara)
43064306 {
4307- if ((p_ptr->age < chara_limit.agemin) || (p_ptr->age > chara_limit.agemax)) accept = FALSE;
4308- if ((p_ptr->ht < chara_limit.htmin) || (p_ptr->ht > chara_limit.htmax)) accept = FALSE;
4309- if ((p_ptr->wt < chara_limit.wtmin) || (p_ptr->wt > chara_limit.wtmax)) accept = FALSE;
4310- if ((p_ptr->sc < chara_limit.scmin) || (p_ptr->sc > chara_limit.scmax)) accept = FALSE;
4307+ if ((creature_ptr->age < chara_limit.agemin) || (creature_ptr->age > chara_limit.agemax)) accept = FALSE;
4308+ if ((creature_ptr->ht < chara_limit.htmin) || (creature_ptr->ht > chara_limit.htmax)) accept = FALSE;
4309+ if ((creature_ptr->wt < chara_limit.wtmin) || (creature_ptr->wt > chara_limit.wtmax)) accept = FALSE;
4310+ if ((creature_ptr->sc < chara_limit.scmin) || (creature_ptr->sc > chara_limit.scmax)) accept = FALSE;
43114311 }
43124312 if (accept) break;
43134313 }
@@ -4342,7 +4342,7 @@ static bool player_birth_aux(void)
43424342 get_ahw();
43434343
43444344 /* Roll for social class */
4345- get_history(p_ptr);
4345+ get_history(creature_ptr);
43464346
43474347 break;
43484348 }
@@ -4358,23 +4358,23 @@ static bool player_birth_aux(void)
43584358 mode = 0;
43594359
43604360 /* Roll for base hitpoints */
4361- get_extra(p_ptr, TRUE);
4361+ get_extra(creature_ptr, TRUE);
43624362
43634363 /* Roll for gold */
43644364 get_money();
43654365
43664366 /* Hack -- get a chaos patron even if you are not a chaos warrior */
4367- p_ptr->chaos_patron = (s16b)randint0(MAX_PATRON);
4367+ creature_ptr->chaos_patron = (s16b)randint0(MAX_PATRON);
43684368
43694369 /* Input loop */
43704370 while (TRUE)
43714371 {
43724372 /* Calculate the bonuses and hitpoints */
4373- p_ptr->update |= (PU_BONUS | PU_HP);
4374- update_creature(p_ptr);
4373+ creature_ptr->update |= (PU_BONUS | PU_HP);
4374+ update_creature(creature_ptr);
43754375
4376- p_ptr->chp = p_ptr->mhp;
4377- p_ptr->csp = p_ptr->msp;
4376+ creature_ptr->chp = creature_ptr->mhp;
4377+ creature_ptr->csp = creature_ptr->msp;
43784378
43794379 display_player(mode);
43804380
@@ -4443,7 +4443,7 @@ static bool player_birth_aux(void)
44434443 if (c == '\r' || c == '\n' || c == ESCAPE) break;
44444444
44454445 /* Save this for the "previous" character */
4446- save_prev_data(p_ptr, &previous_char);
4446+ save_prev_data(creature_ptr, &previous_char);
44474447 previous_char.quick_ok = FALSE;
44484448
44494449 /* Note that a previous roll exists */
@@ -4464,9 +4464,9 @@ static bool player_birth_aux(void)
44644464
44654465 /*** Finish up ***/
44664466
4467- get_max_stats(p_ptr);
4467+ get_max_stats(creature_ptr);
44684468
4469- get_virtues(p_ptr);
4469+ get_virtues(creature_ptr);
44704470
44714471 /* Prompt for it */
44724472 #ifdef JP
@@ -4490,7 +4490,7 @@ static bool player_birth_aux(void)
44904490 init_dungeon_quests();
44914491
44924492 /* Save character data for quick start */
4493- save_prev_data(p_ptr, &previous_char);
4493+ save_prev_data(creature_ptr, &previous_char);
44944494 previous_char.quick_ok = TRUE;
44954495
44964496 /* Accept */
@@ -4600,7 +4600,7 @@ void player_birth(player_type *creature_ptr)
46004600 while (1)
46014601 {
46024602 /* Roll up a new character */
4603- if (player_birth_aux()) break;
4603+ if (player_birth_aux(p_ptr)) break;
46044604
46054605 /* Wipe the player */
46064606 player_wipe_without_name();
Show on old repository browser