• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionc4f27014d2b4a7763bb2a36ec8b1a836d2ece0d6 (tree)
Time2019-08-12 23:32:47
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/racial.c
+++ b/src/racial.c
@@ -383,37 +383,37 @@ static int racial_aux(power_desc_type *pd_ptr)
383383 * @param command 発動するレイシャルのID
384384 * @return 処理を実際に実行した場合はTRUE、キャンセルした場合FALSEを返す。
385385 */
386-static bool cmd_racial_power_aux(s32b command)
386+static bool cmd_racial_power_aux(player_type *creature_ptr, s32b command)
387387 {
388- PLAYER_LEVEL plev = p_ptr->lev;
388+ PLAYER_LEVEL plev = creature_ptr->lev;
389389 DIRECTION dir = 0;
390390
391391 if (command <= -3)
392392 {
393- switch (p_ptr->pclass)
393+ switch (creature_ptr->pclass)
394394 {
395395 case CLASS_WARRIOR:
396396 {
397- return sword_dancing(p_ptr);
397+ return sword_dancing(creature_ptr);
398398 break;
399399 }
400400 case CLASS_HIGH_MAGE:
401- if (p_ptr->realm1 == REALM_HEX)
401+ if (creature_ptr->realm1 == REALM_HEX)
402402 {
403403 bool retval = stop_hex_spell();
404- if (retval) p_ptr->energy_use = 10;
404+ if (retval) creature_ptr->energy_use = 10;
405405 return (retval);
406406 }
407407 case CLASS_MAGE:
408408 /* case CLASS_HIGH_MAGE: */
409409 case CLASS_SORCERER:
410410 {
411- if (!eat_magic(p_ptr->lev * 2)) return FALSE;
411+ if (!eat_magic(creature_ptr->lev * 2)) return FALSE;
412412 break;
413413 }
414414 case CLASS_PRIEST:
415415 {
416- if (is_good_realm(p_ptr->realm1))
416+ if (is_good_realm(creature_ptr->realm1))
417417 {
418418 if (!bless_weapon()) return FALSE;
419419 }
@@ -440,7 +440,7 @@ static bool cmd_racial_power_aux(s32b command)
440440 case CLASS_PALADIN:
441441 {
442442 if (!get_aim_dir(&dir)) return FALSE;
443- fire_beam(is_good_realm(p_ptr->realm1) ? GF_HOLY_FIRE : GF_HELL_FIRE,
443+ fire_beam(is_good_realm(creature_ptr->realm1) ? GF_HOLY_FIRE : GF_HELL_FIRE,
444444 dir, plev * 3);
445445 break;
446446 }
@@ -448,27 +448,27 @@ static bool cmd_racial_power_aux(s32b command)
448448 {
449449 if (command == -3)
450450 {
451- return comvert_hp_to_mp(p_ptr);
451+ return comvert_hp_to_mp(creature_ptr);
452452 }
453453 else if (command == -4)
454454 {
455- return comvert_mp_to_hp(p_ptr);
455+ return comvert_mp_to_hp(creature_ptr);
456456 }
457457 break;
458458 }
459459 case CLASS_CHAOS_WARRIOR:
460460 {
461- return confusing_light(p_ptr);
461+ return confusing_light(creature_ptr);
462462 break;
463463 }
464464 case CLASS_MONK:
465465 {
466- if (!(empty_hands(p_ptr, TRUE) & EMPTY_HAND_RARM))
466+ if (!(empty_hands(creature_ptr, TRUE) & EMPTY_HAND_RARM))
467467 {
468468 msg_print(_("素手じゃないとできません。", "You need to be bare hand."));
469469 return FALSE;
470470 }
471- if (p_ptr->riding)
471+ if (creature_ptr->riding)
472472 {
473473 msg_print(_("乗馬中はできません。", "You need to get off a pet."));
474474 return FALSE;
@@ -476,19 +476,19 @@ static bool cmd_racial_power_aux(s32b command)
476476
477477 if (command == -3)
478478 {
479- if (!choose_kamae(p_ptr)) return FALSE;
480- p_ptr->update |= (PU_BONUS);
479+ if (!choose_kamae(creature_ptr)) return FALSE;
480+ creature_ptr->update |= (PU_BONUS);
481481 }
482482 else if (command == -4)
483483 {
484- return double_attack(p_ptr);
484+ return double_attack(creature_ptr);
485485 }
486486 break;
487487 }
488488 case CLASS_MINDCRAFTER:
489489 case CLASS_FORCETRAINER:
490490 {
491- return clear_mind(p_ptr);
491+ return clear_mind(creature_ptr);
492492 }
493493 case CLASS_TOURIST:
494494 {
@@ -515,11 +515,11 @@ static bool cmd_racial_power_aux(s32b command)
515515 if (command == -3)
516516 {
517517 if (!get_aim_dir(&dir)) return FALSE;
518- (void)fire_ball_hide(GF_CHARM_LIVING, dir, p_ptr->lev, 0);
518+ (void)fire_ball_hide(GF_CHARM_LIVING, dir, creature_ptr->lev, 0);
519519 }
520520 else if (command == -4)
521521 {
522- project_all_los(GF_CHARM_LIVING, p_ptr->lev);
522+ project_all_los(GF_CHARM_LIVING, creature_ptr->lev);
523523 }
524524 break;
525525 }
@@ -533,7 +533,7 @@ static bool cmd_racial_power_aux(s32b command)
533533 if (command == -3) {
534534 if (!import_magic_device()) return FALSE;
535535 } else if (command == -4) {
536- if (cmd_limit_cast(p_ptr)) return FALSE;
536+ if (cmd_limit_cast(creature_ptr)) return FALSE;
537537 if (!do_cmd_magic_eater(FALSE, TRUE)) return FALSE;
538538 }
539539 break;
@@ -541,19 +541,19 @@ static bool cmd_racial_power_aux(s32b command)
541541 case CLASS_BARD:
542542 {
543543 /* Singing is already stopped */
544- if (!SINGING_SONG_EFFECT(p_ptr) && !INTERUPTING_SONG_EFFECT(p_ptr)) return FALSE;
544+ if (!SINGING_SONG_EFFECT(creature_ptr) && !INTERUPTING_SONG_EFFECT(creature_ptr)) return FALSE;
545545
546- stop_singing(p_ptr);
547- p_ptr->energy_use = 10;
546+ stop_singing(creature_ptr);
547+ creature_ptr->energy_use = 10;
548548 break;
549549 }
550550 case CLASS_RED_MAGE:
551551 {
552- if (cmd_limit_cast(p_ptr)) return FALSE;
552+ if (cmd_limit_cast(creature_ptr)) return FALSE;
553553 handle_stuff();
554554 do_cmd_cast();
555555 handle_stuff();
556- if (!p_ptr->paralyzed && !cmd_limit_cast(p_ptr))
556+ if (!creature_ptr->paralyzed && !cmd_limit_cast(creature_ptr))
557557 do_cmd_cast();
558558 break;
559559 }
@@ -561,45 +561,45 @@ static bool cmd_racial_power_aux(s32b command)
561561 {
562562 if (command == -3)
563563 {
564- concentration(p_ptr);
564+ concentration(creature_ptr);
565565 }
566566 else if (command == -4)
567567 {
568- if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
568+ if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM))
569569 {
570570 msg_print(_("武器を持たないといけません。", "You need to wield a weapon."));
571571 return FALSE;
572572 }
573- if (!choose_kata(p_ptr)) return FALSE;
574- p_ptr->update |= (PU_BONUS);
573+ if (!choose_kata(creature_ptr)) return FALSE;
574+ creature_ptr->update |= (PU_BONUS);
575575 }
576576 break;
577577 }
578578 case CLASS_BLUE_MAGE:
579579 {
580- if (p_ptr->action == ACTION_LEARN)
580+ if (creature_ptr->action == ACTION_LEARN)
581581 {
582- set_action(p_ptr, ACTION_NONE);
582+ set_action(creature_ptr, ACTION_NONE);
583583 }
584584 else
585585 {
586- set_action(p_ptr, ACTION_LEARN);
586+ set_action(creature_ptr, ACTION_LEARN);
587587 }
588- free_turn(p_ptr);
588+ free_turn(creature_ptr);
589589 break;
590590 }
591591 case CLASS_CAVALRY:
592592 {
593- return rodeo(p_ptr);
593+ return rodeo(creature_ptr);
594594 }
595595 case CLASS_BERSERKER:
596596 {
597- if (!recall_player(p_ptr, randint0(21) + 15)) return FALSE;
597+ if (!recall_player(creature_ptr, randint0(21) + 15)) return FALSE;
598598 break;
599599 }
600600 case CLASS_SMITH:
601601 {
602- if (p_ptr->lev > 29)
602+ if (creature_ptr->lev > 29)
603603 {
604604 if (!identify_fully(TRUE)) return FALSE;
605605 }
@@ -618,23 +618,23 @@ static bool cmd_racial_power_aux(s32b command)
618618 }
619619 else if (command == -4)
620620 {
621- return mirror_concentration(p_ptr);
621+ return mirror_concentration(creature_ptr);
622622 }
623623 break;
624624 }
625625 case CLASS_NINJA:
626- hayagake(p_ptr);
626+ hayagake(creature_ptr);
627627 break;
628628 }
629629 }
630- else if (p_ptr->mimic_form)
630+ else if (creature_ptr->mimic_form)
631631 {
632- switch (p_ptr->mimic_form)
632+ switch (creature_ptr->mimic_form)
633633 {
634634 case MIMIC_DEMON:
635635 case MIMIC_DEMON_LORD:
636636 {
637- return demonic_breath(p_ptr);
637+ return demonic_breath(creature_ptr);
638638 }
639639 case MIMIC_VAMPIRE:
640640 vampirism();
@@ -645,7 +645,7 @@ static bool cmd_racial_power_aux(s32b command)
645645 else
646646 {
647647
648- switch (p_ptr->prace)
648+ switch (creature_ptr->prace)
649649 {
650650 case RACE_DWARF:
651651 msg_print(_("周囲を調べた。", "You examine your surroundings."));
@@ -655,7 +655,7 @@ static bool cmd_racial_power_aux(s32b command)
655655 break;
656656
657657 case RACE_HOBBIT:
658- return create_ration(p_ptr);
658+ return create_ration(creature_ptr);
659659 break;
660660
661661 case RACE_GNOME:
@@ -665,7 +665,7 @@ static bool cmd_racial_power_aux(s32b command)
665665
666666 case RACE_HALF_ORC:
667667 msg_print(_("勇気を出した。", "You play tough."));
668- (void)set_afraid(p_ptr, 0);
668+ (void)set_afraid(creature_ptr, 0);
669669 break;
670670
671671 case RACE_HALF_TROLL:
@@ -685,7 +685,7 @@ static bool cmd_racial_power_aux(s32b command)
685685
686686 (void)true_healing(0);
687687 (void)restore_all_status();
688- (void)restore_level(p_ptr);
688+ (void)restore_level(creature_ptr);
689689 }
690690 break;
691691
@@ -750,7 +750,7 @@ static bool cmd_racial_power_aux(s32b command)
750750 break;
751751
752752 case RACE_DRACONIAN:
753- return draconian_breath(p_ptr);
753+ return draconian_breath(creature_ptr);
754754 break;
755755
756756 case RACE_MIND_FLAYER:
@@ -774,13 +774,13 @@ static bool cmd_racial_power_aux(s32b command)
774774 break;
775775
776776 case RACE_GOLEM:
777- (void)set_shield(p_ptr, randint1(20) + 30, FALSE);
777+ (void)set_shield(creature_ptr, randint1(20) + 30, FALSE);
778778 break;
779779
780780 case RACE_SKELETON:
781781 case RACE_ZOMBIE:
782782 msg_print(_("あなたは失ったエネルギーを取り戻そうと試みた。", "You attempt to restore your lost energies."));
783- (void)restore_level(p_ptr);
783+ (void)restore_level(creature_ptr);
784784 break;
785785
786786 case RACE_VAMPIRE:
@@ -801,20 +801,20 @@ static bool cmd_racial_power_aux(s32b command)
801801 break;
802802
803803 case RACE_DEMON:
804- return demonic_breath(p_ptr);
804+ return demonic_breath(creature_ptr);
805805 break;
806806
807807 case RACE_KUTAR:
808- (void)set_tsubureru(p_ptr, randint1(20) + 30, FALSE);
808+ (void)set_tsubureru(creature_ptr, randint1(20) + 30, FALSE);
809809 break;
810810
811811 case RACE_ANDROID:
812- return android_inside_weapon(p_ptr);
812+ return android_inside_weapon(creature_ptr);
813813 break;
814814
815815 default:
816816 msg_print(_("この種族は特殊な能力を持っていません。", "This race has no bonus power."));
817- free_turn(p_ptr);
817+ free_turn(creature_ptr);
818818 }
819819 }
820820 return TRUE;
@@ -1999,7 +1999,7 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
19991999 {
20002000 case 1:
20012001 if (power_desc[i].number < 0)
2002- cast = cmd_racial_power_aux(power_desc[i].number);
2002+ cast = cmd_racial_power_aux(p_ptr, power_desc[i].number);
20032003 else
20042004 cast = mutation_power_aux(p_ptr, power_desc[i].number);
20052005 break;
Show on old repository browser