• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision5620dec6c15f3043b45963f2a3d9b236aac0892f (tree)
Time2019-08-17 00:09:04
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd/cmd-magiceat.c
+++ b/src/cmd/cmd-magiceat.c
@@ -509,7 +509,7 @@ static OBJECT_SUBTYPE_VALUE select_magic_eater(player_type *creature_ptr, bool o
509509 * @param powerful 強力発動中の処理ならばTRUE
510510 * @return 実際にコマンドを実行したならばTRUEを返す。
511511 */
512-bool do_cmd_magic_eater(bool only_browse, bool powerful)
512+bool do_cmd_magic_eater(player_type *creature_ptr, bool only_browse, bool powerful)
513513 {
514514 OBJECT_SUBTYPE_VALUE item;
515515 PERCENTAGE chance;
@@ -519,12 +519,12 @@ bool do_cmd_magic_eater(bool only_browse, bool powerful)
519519 OBJECT_SUBTYPE_VALUE sval;
520520 bool use_charge = TRUE;
521521
522- if (cmd_limit_confused(p_ptr)) return FALSE;
522+ if (cmd_limit_confused(creature_ptr)) return FALSE;
523523
524- item = select_magic_eater(p_ptr, only_browse);
524+ item = select_magic_eater(creature_ptr, only_browse);
525525 if (item == -1)
526526 {
527- free_turn(p_ptr);
527+ free_turn(creature_ptr);
528528 return FALSE;
529529 }
530530 if (item >= EATER_EXT*2) {tval = TV_ROD;sval = item - EATER_EXT*2;}
@@ -534,17 +534,17 @@ bool do_cmd_magic_eater(bool only_browse, bool powerful)
534534
535535 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
536536 chance = level * 4 / 5 + 20;
537- chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
537+ chance -= 3 * (adj_mag_stat[creature_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
538538 level /= 2;
539- if (p_ptr->lev > level)
539+ if (creature_ptr->lev > level)
540540 {
541- chance -= 3 * (p_ptr->lev - level);
541+ chance -= 3 * (creature_ptr->lev - level);
542542 }
543543 chance = mod_spell_chance_1(chance);
544- chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
544+ chance = MAX(chance, adj_mag_fail[creature_ptr->stat_ind[mp_ptr->spell_stat]]);
545545 /* Stunning makes spells harder */
546- if (p_ptr->stun > 50) chance += 25;
547- else if (p_ptr->stun) chance += 15;
546+ if (creature_ptr->stun > 50) chance += 25;
547+ else if (creature_ptr->stun) chance += 15;
548548
549549 if (chance > 95) chance = 95;
550550
@@ -557,8 +557,8 @@ bool do_cmd_magic_eater(bool only_browse, bool powerful)
557557 msg_print(_("呪文をうまく唱えられなかった!", "You failed to get the magic off!"));
558558 sound(SOUND_FAIL);
559559 if (randint1(100) >= chance)
560- chg_virtue(p_ptr, V_CHANCE,-1);
561- take_turn(p_ptr, 100);
560+ chg_virtue(creature_ptr, V_CHANCE,-1);
561+ take_turn(creature_ptr, 100);
562562
563563 return TRUE;
564564 }
@@ -570,25 +570,25 @@ bool do_cmd_magic_eater(bool only_browse, bool powerful)
570570 {
571571 if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
572572 if (!get_aim_dir(&dir)) return FALSE;
573- rod_effect(p_ptr, sval, dir, &use_charge, powerful, TRUE);
573+ rod_effect(creature_ptr, sval, dir, &use_charge, powerful, TRUE);
574574 if (!use_charge) return FALSE;
575575 }
576576 else if (tval == TV_WAND)
577577 {
578578 if (!get_aim_dir(&dir)) return FALSE;
579- wand_effect(p_ptr, sval, dir, powerful, TRUE);
579+ wand_effect(creature_ptr, sval, dir, powerful, TRUE);
580580 }
581581 else
582582 {
583- staff_effect(p_ptr, sval, &use_charge, powerful, TRUE, TRUE);
583+ staff_effect(creature_ptr, sval, &use_charge, powerful, TRUE, TRUE);
584584 if (!use_charge) return FALSE;
585585 }
586586 if (randint1(100) < chance)
587- chg_virtue(p_ptr, V_CHANCE,1);
587+ chg_virtue(creature_ptr, V_CHANCE,1);
588588 }
589- take_turn(p_ptr, 100);
590- if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
591- else p_ptr->magic_num1[item] -= EATER_CHARGE;
589+ take_turn(creature_ptr, 100);
590+ if (tval == TV_ROD) creature_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
591+ else creature_ptr->magic_num1[item] -= EATER_CHARGE;
592592
593593 return TRUE;
594594 }
--- a/src/cmd/cmd-magiceat.h
+++ b/src/cmd/cmd-magiceat.h
@@ -4,4 +4,4 @@
44 #define EATER_CHARGE 0x10000L
55 #define EATER_ROD_CHARGE 0x10L
66
7-extern bool do_cmd_magic_eater(bool only_browse, bool powerful);
7+extern bool do_cmd_magic_eater(player_type *creature_ptr, bool only_browse, bool powerful);
--- a/src/core.c
+++ b/src/core.c
@@ -3839,7 +3839,7 @@ static void process_command(void)
38393839 else if (p_ptr->pclass == CLASS_SMITH)
38403840 do_cmd_kaji(TRUE);
38413841 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
3842- do_cmd_magic_eater(TRUE, FALSE);
3842+ do_cmd_magic_eater(p_ptr, TRUE, FALSE);
38433843 else if (p_ptr->pclass == CLASS_SNIPER)
38443844 do_cmd_snipe_browse();
38453845 else do_cmd_browse();
@@ -3896,7 +3896,7 @@ static void process_command(void)
38963896 else if (p_ptr->pclass == CLASS_IMITATOR)
38973897 do_cmd_mane(FALSE);
38983898 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
3899- do_cmd_magic_eater(FALSE, FALSE);
3899+ do_cmd_magic_eater(p_ptr, FALSE, FALSE);
39003900 else if (p_ptr->pclass == CLASS_SAMURAI)
39013901 do_cmd_hissatsu(p_ptr);
39023902 else if (p_ptr->pclass == CLASS_BLUE_MAGE)
--- a/src/racial.c
+++ b/src/racial.c
@@ -534,7 +534,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
534534 if (!import_magic_device()) return FALSE;
535535 } else if (command == -4) {
536536 if (cmd_limit_cast(creature_ptr)) return FALSE;
537- if (!do_cmd_magic_eater(FALSE, TRUE)) return FALSE;
537+ if (!do_cmd_magic_eater(creature_ptr, FALSE, TRUE)) return FALSE;
538538 }
539539 break;
540540 }
--- a/src/store.c
+++ b/src/store.c
@@ -5502,7 +5502,7 @@ static void store_process_command(void)
55025502 else if (p_ptr->pclass == CLASS_SMITH)
55035503 do_cmd_kaji(TRUE);
55045504 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
5505- do_cmd_magic_eater(TRUE, FALSE);
5505+ do_cmd_magic_eater(p_ptr, TRUE, FALSE);
55065506 else if (p_ptr->pclass == CLASS_SNIPER)
55075507 do_cmd_snipe_browse();
55085508 else do_cmd_browse();
Show on old repository browser