• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision38c18446a75f989396b7808f0023198a2f488a97 (tree)
Time2019-08-30 00:02:38
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 do_cmd_wiz_change_aux() に player_type * 引数を追加. / Add player_type * argument to do_cmd_wiz_change_aux().

Change Summary

Incremental Difference

--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -287,7 +287,7 @@ static void do_cmd_wiz_bamf(void)
287287 * Aux function for "do_cmd_wiz_change()". -RAK-
288288 * @return なし
289289 */
290-static void do_cmd_wiz_change_aux(void)
290+static void do_cmd_wiz_change_aux(player_type *creature_ptr)
291291 {
292292 int i, j;
293293 int tmp_int;
@@ -300,10 +300,10 @@ static void do_cmd_wiz_change_aux(void)
300300 for (i = 0; i < A_MAX; i++)
301301 {
302302 /* Prompt */
303- sprintf(ppp, "%s (3-%d): ", stat_names[i], p_ptr->stat_max_max[i]);
303+ sprintf(ppp, "%s (3-%d): ", stat_names[i], creature_ptr->stat_max_max[i]);
304304
305305 /* Default */
306- sprintf(tmp_val, "%d", p_ptr->stat_max[i]);
306+ sprintf(tmp_val, "%d", creature_ptr->stat_max[i]);
307307
308308 /* Query */
309309 if (!get_string(ppp, tmp_val, 3)) return;
@@ -312,11 +312,11 @@ static void do_cmd_wiz_change_aux(void)
312312 tmp_int = atoi(tmp_val);
313313
314314 /* Verify */
315- if (tmp_int > p_ptr->stat_max_max[i]) tmp_int = p_ptr->stat_max_max[i];
315+ if (tmp_int > creature_ptr->stat_max_max[i]) tmp_int = creature_ptr->stat_max_max[i];
316316 else if (tmp_int < 3) tmp_int = 3;
317317
318318 /* Save it */
319- p_ptr->stat_cur[i] = p_ptr->stat_max[i] = (BASE_STATUS)tmp_int;
319+ creature_ptr->stat_cur[i] = creature_ptr->stat_max[i] = (BASE_STATUS)tmp_int;
320320 }
321321
322322
@@ -337,24 +337,24 @@ static void do_cmd_wiz_change_aux(void)
337337 {
338338 for (i = 0;i < 64;i++)
339339 {
340- p_ptr->weapon_exp[j][i] = tmp_s16b;
341- if (p_ptr->weapon_exp[j][i] > s_info[p_ptr->pclass].w_max[j][i]) p_ptr->weapon_exp[j][i] = s_info[p_ptr->pclass].w_max[j][i];
340+ creature_ptr->weapon_exp[j][i] = tmp_s16b;
341+ if (creature_ptr->weapon_exp[j][i] > s_info[creature_ptr->pclass].w_max[j][i]) creature_ptr->weapon_exp[j][i] = s_info[creature_ptr->pclass].w_max[j][i];
342342 }
343343 }
344344
345345 for (j = 0; j < 10; j++)
346346 {
347- p_ptr->skill_exp[j] = tmp_s16b;
348- if (p_ptr->skill_exp[j] > s_info[p_ptr->pclass].s_max[j]) p_ptr->skill_exp[j] = s_info[p_ptr->pclass].s_max[j];
347+ creature_ptr->skill_exp[j] = tmp_s16b;
348+ if (creature_ptr->skill_exp[j] > s_info[creature_ptr->pclass].s_max[j]) creature_ptr->skill_exp[j] = s_info[creature_ptr->pclass].s_max[j];
349349 }
350350
351351 for (j = 0; j < 32; j++)
352- p_ptr->spell_exp[j] = (tmp_s16b > SPELL_EXP_MASTER ? SPELL_EXP_MASTER : tmp_s16b);
352+ creature_ptr->spell_exp[j] = (tmp_s16b > SPELL_EXP_MASTER ? SPELL_EXP_MASTER : tmp_s16b);
353353 for (; j < 64; j++)
354- p_ptr->spell_exp[j] = (tmp_s16b > SPELL_EXP_EXPERT ? SPELL_EXP_EXPERT : tmp_s16b);
354+ creature_ptr->spell_exp[j] = (tmp_s16b > SPELL_EXP_EXPERT ? SPELL_EXP_EXPERT : tmp_s16b);
355355
356356 /* Default */
357- sprintf(tmp_val, "%ld", (long)(p_ptr->au));
357+ sprintf(tmp_val, "%ld", (long)(creature_ptr->au));
358358
359359 /* Query */
360360 if (!get_string("Gold: ", tmp_val, 9)) return;
@@ -366,10 +366,10 @@ static void do_cmd_wiz_change_aux(void)
366366 if (tmp_long < 0) tmp_long = 0L;
367367
368368 /* Save */
369- p_ptr->au = tmp_long;
369+ creature_ptr->au = tmp_long;
370370
371371 /* Default */
372- sprintf(tmp_val, "%ld", (long)(p_ptr->max_exp));
372+ sprintf(tmp_val, "%ld", (long)(creature_ptr->max_exp));
373373
374374 /* Query */
375375 if (!get_string("Experience: ", tmp_val, 9)) return;
@@ -380,14 +380,14 @@ static void do_cmd_wiz_change_aux(void)
380380 /* Verify */
381381 if (tmp_long < 0) tmp_long = 0L;
382382
383- if (p_ptr->prace != RACE_ANDROID)
383+ if (creature_ptr->prace != RACE_ANDROID)
384384 {
385385 /* Save */
386- p_ptr->max_exp = tmp_long;
387- p_ptr->exp = tmp_long;
386+ creature_ptr->max_exp = tmp_long;
387+ creature_ptr->exp = tmp_long;
388388
389389 /* Update */
390- check_experience(p_ptr);
390+ check_experience(creature_ptr);
391391 }
392392 }
393393
@@ -400,7 +400,7 @@ static void do_cmd_wiz_change_aux(void)
400400 static void do_cmd_wiz_change(void)
401401 {
402402 /* Interact */
403- do_cmd_wiz_change_aux();
403+ do_cmd_wiz_change_aux(p_ptr);
404404 do_cmd_redraw(p_ptr);
405405 }
406406
Show on old repository browser