変愚蛮怒のメインリポジトリです
Revision | 8620c39af3503155b45750511c88d1a4569e7c1f (tree) |
---|---|
Time | 2019-01-12 22:16:48 |
Author | Deskull <deskull@user...> |
Commiter | Deskull |
[Refactor] #37917 word_of_recall() と recall_player() を整理。 / Refactor word_of_recall() and recall_player().
@@ -4110,7 +4110,7 @@ static void bldg_process_command(building_type *bldg, int i) | ||
4110 | 4110 | break; |
4111 | 4111 | |
4112 | 4112 | case BACT_RECALL: |
4113 | - if (recall_player(1)) paid = TRUE; | |
4113 | + if (recall_player(p_ptr, 1)) paid = TRUE; | |
4114 | 4114 | break; |
4115 | 4115 | |
4116 | 4116 | case BACT_TELEPORT_LEVEL: |
@@ -1361,7 +1361,7 @@ bool activate_artifact(object_type *o_ptr) | ||
1361 | 1361 | case ACT_RECALL: |
1362 | 1362 | { |
1363 | 1363 | msg_print(_("やわらかな白色に輝いている...", "It glows soft white...")); |
1364 | - if (!word_of_recall()) return FALSE; | |
1364 | + if (!recall_player(p_ptr, randint0(21) + 15)) return FALSE; | |
1365 | 1365 | break; |
1366 | 1366 | } |
1367 | 1367 |
@@ -1381,7 +1381,7 @@ bool activate_artifact(object_type *o_ptr) | ||
1381 | 1381 | |
1382 | 1382 | if (get_check(_("帰還の力を使いますか?", "Activate recall? "))) |
1383 | 1383 | { |
1384 | - (void)word_of_recall(); | |
1384 | + (void)recall_player(p_ptr, randint0(21) + 15); | |
1385 | 1385 | } |
1386 | 1386 | |
1387 | 1387 | break; |
@@ -185,7 +185,7 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known) | ||
185 | 185 | |
186 | 186 | case SV_SCROLL_WORD_OF_RECALL: |
187 | 187 | { |
188 | - if (!word_of_recall()) used_up = FALSE; | |
188 | + if (!recall_player(p_ptr, randint0(21) + 15)) used_up = FALSE; | |
189 | 189 | ident = TRUE; |
190 | 190 | break; |
191 | 191 | } |
@@ -49,7 +49,7 @@ int rod_effect(OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool *use_charge, bool | ||
49 | 49 | |
50 | 50 | case SV_ROD_RECALL: |
51 | 51 | { |
52 | - if (!word_of_recall()) *use_charge = FALSE; | |
52 | + if (!recall_player(p_ptr, randint0(21) + 15)) *use_charge = FALSE; | |
53 | 53 | ident = TRUE; |
54 | 54 | break; |
55 | 55 | } |
@@ -523,8 +523,8 @@ static void pattern_teleport(void) | ||
523 | 523 | /* Ask for level */ |
524 | 524 | if (get_check(_("他の階にテレポートしますか?", "Teleport level? "))) |
525 | 525 | { |
526 | - char ppp[80]; | |
527 | - char tmp_val[160]; | |
526 | + char ppp[80]; | |
527 | + char tmp_val[160]; | |
528 | 528 | |
529 | 529 | /* Only downward in ironman mode */ |
530 | 530 | if (ironman_downward) |
@@ -582,7 +582,7 @@ static void pattern_teleport(void) | ||
582 | 582 | |
583 | 583 | leave_quest_check(); |
584 | 584 | |
585 | - if (record_stair) do_cmd_write_nikki(NIKKI_PAT_TELE,0,NULL); | |
585 | + if (record_stair) do_cmd_write_nikki(NIKKI_PAT_TELE, 0, NULL); | |
586 | 586 | |
587 | 587 | p_ptr->inside_quest = 0; |
588 | 588 | p_ptr->energy_use = 0; |
@@ -616,9 +616,7 @@ static void wreck_the_pattern(void) | ||
616 | 616 | msg_print(_("パターンを血で汚してしまった!", "You bleed on the Pattern!")); |
617 | 617 | msg_print(_("何か恐ろしい事が起こった!", "Something terrible happens!")); |
618 | 618 | |
619 | - if (!IS_INVULN()) | |
620 | - take_hit(DAMAGE_NOESCAPE, damroll(10, 8), _("パターン損壊", "corrupting the Pattern"), -1); | |
621 | - | |
619 | + if (!IS_INVULN()) take_hit(DAMAGE_NOESCAPE, damroll(10, 8), _("パターン損壊", "corrupting the Pattern"), -1); | |
622 | 620 | to_ruin = randint1(45) + 35; |
623 | 621 | |
624 | 622 | while (to_ruin--) |
@@ -1019,9 +1019,8 @@ extern void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode); | ||
1019 | 1019 | extern void teleport_away_followable(MONSTER_IDX m_idx); |
1020 | 1020 | extern void teleport_level(MONSTER_IDX m_idx); |
1021 | 1021 | extern DUNGEON_IDX choose_dungeon(cptr note, POSITION y, POSITION x); |
1022 | -extern bool recall_player(TIME_EFFECT turns); | |
1022 | +extern bool recall_player(player_type *creature_ptr, TIME_EFFECT turns); | |
1023 | 1023 | extern bool free_level_recall(player_type *creature_ptr); |
1024 | -extern bool word_of_recall(void); | |
1025 | 1024 | extern bool reset_recall(void); |
1026 | 1025 | extern bool apply_disenchant(BIT_FLAGS mode); |
1027 | 1026 | extern void mutate_player(void); |
@@ -1441,7 +1441,7 @@ static bool cast_mirror_spell(int spell) | ||
1441 | 1441 | |
1442 | 1442 | /* mirror of recall */ |
1443 | 1443 | case 17: |
1444 | - return word_of_recall(); | |
1444 | + return recall_player(p_ptr, randint0(21) + 15); | |
1445 | 1445 | /* multi-shadow */ |
1446 | 1446 | case 18: |
1447 | 1447 | set_multishadow(6 + randint1(6), FALSE); |
@@ -2269,7 +2269,7 @@ bool mutation_power_aux(int power) | ||
2269 | 2269 | break; |
2270 | 2270 | |
2271 | 2271 | case MUT1_RECALL: |
2272 | - if (!word_of_recall()) return FALSE; | |
2272 | + if (!recall_player(p_ptr, randint0(21) + 15)) return FALSE; | |
2273 | 2273 | break; |
2274 | 2274 | |
2275 | 2275 | case MUT1_BANISH: |
@@ -1054,7 +1054,7 @@ static bool cmd_racial_power_aux(s32b command) | ||
1054 | 1054 | } |
1055 | 1055 | case CLASS_BERSERKER: |
1056 | 1056 | { |
1057 | - if (!word_of_recall()) return FALSE; | |
1057 | + if (!recall_player(p_ptr, randint0(21) + 15)) return FALSE; | |
1058 | 1058 | break; |
1059 | 1059 | } |
1060 | 1060 | case CLASS_SMITH: |
@@ -517,7 +517,7 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode) | ||
517 | 517 | |
518 | 518 | if (cast) |
519 | 519 | { |
520 | - if (!word_of_recall()) return NULL; | |
520 | + if (!recall_player(p_ptr, randint0(21) + 15)) return NULL; | |
521 | 521 | } |
522 | 522 | } |
523 | 523 | break; |
@@ -320,7 +320,7 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode) | ||
320 | 320 | |
321 | 321 | if (cast) |
322 | 322 | { |
323 | - if (!word_of_recall()) return NULL; | |
323 | + if (!recall_player(p_ptr, randint0(21) + 15)) return NULL; | |
324 | 324 | } |
325 | 325 | } |
326 | 326 | break; |
@@ -386,7 +386,7 @@ cptr do_sorcery_spell(SPELL_IDX spell, BIT_FLAGS mode) | ||
386 | 386 | |
387 | 387 | if (cast) |
388 | 388 | { |
389 | - if (!word_of_recall()) return NULL; | |
389 | + if (!recall_player(p_ptr, randint0(21) + 15)) return NULL; | |
390 | 390 | } |
391 | 391 | } |
392 | 392 | break; |
@@ -298,7 +298,7 @@ cptr do_trump_spell(SPELL_IDX spell, BIT_FLAGS mode) | ||
298 | 298 | |
299 | 299 | if (cast) |
300 | 300 | { |
301 | - if (!word_of_recall()) return NULL; | |
301 | + if (!recall_player(p_ptr, randint0(21) + 15)) return NULL; | |
302 | 302 | } |
303 | 303 | } |
304 | 304 | break; |
@@ -823,7 +823,7 @@ DUNGEON_IDX choose_dungeon(cptr note, POSITION y, POSITION x) | ||
823 | 823 | * @param turns 発動までのターン数 |
824 | 824 | * @return 常にTRUEを返す |
825 | 825 | */ |
826 | -bool recall_player(TIME_EFFECT turns) | |
826 | +bool recall_player(player_type *creature_ptr, TIME_EFFECT turns) | |
827 | 827 | { |
828 | 828 | /* |
829 | 829 | * TODO: Recall the player to the last |
@@ -831,13 +831,13 @@ bool recall_player(TIME_EFFECT turns) | ||
831 | 831 | */ |
832 | 832 | |
833 | 833 | /* Ironman option */ |
834 | - if (p_ptr->inside_arena || ironman_downward) | |
834 | + if (creature_ptr->inside_arena || ironman_downward) | |
835 | 835 | { |
836 | 836 | msg_print(_("何も起こらなかった。", "Nothing happens.")); |
837 | 837 | return TRUE; |
838 | 838 | } |
839 | 839 | |
840 | - if (dun_level && (max_dlv[dungeon_type] > dun_level) && !p_ptr->inside_quest && !p_ptr->word_recall) | |
840 | + if (dun_level && (max_dlv[dungeon_type] > dun_level) && !creature_ptr->inside_quest && !creature_ptr->word_recall) | |
841 | 841 | { |
842 | 842 | if (get_check(_("ここは最深到達階より浅い階です。この階に戻って来ますか? ", "Reset recall depth? "))) |
843 | 843 | { |
@@ -847,24 +847,24 @@ bool recall_player(TIME_EFFECT turns) | ||
847 | 847 | } |
848 | 848 | |
849 | 849 | } |
850 | - if (!p_ptr->word_recall) | |
850 | + if (!creature_ptr->word_recall) | |
851 | 851 | { |
852 | 852 | if (!dun_level) |
853 | 853 | { |
854 | 854 | DUNGEON_IDX select_dungeon; |
855 | 855 | select_dungeon = choose_dungeon(_("に帰還", "recall"), 2, 14); |
856 | 856 | if (!select_dungeon) return FALSE; |
857 | - p_ptr->recall_dungeon = select_dungeon; | |
857 | + creature_ptr->recall_dungeon = select_dungeon; | |
858 | 858 | } |
859 | - p_ptr->word_recall = turns; | |
859 | + creature_ptr->word_recall = turns; | |
860 | 860 | msg_print(_("回りの大気が張りつめてきた...", "The air about you becomes charged...")); |
861 | - p_ptr->redraw |= (PR_STATUS); | |
861 | + creature_ptr->redraw |= (PR_STATUS); | |
862 | 862 | } |
863 | 863 | else |
864 | 864 | { |
865 | - p_ptr->word_recall = 0; | |
865 | + creature_ptr->word_recall = 0; | |
866 | 866 | msg_print(_("張りつめた大気が流れ去った...", "A tension leaves the air around you...")); |
867 | - p_ptr->redraw |= (PR_STATUS); | |
867 | + creature_ptr->redraw |= (PR_STATUS); | |
868 | 868 | } |
869 | 869 | return TRUE; |
870 | 870 | } |
@@ -908,15 +908,6 @@ bool free_level_recall(player_type *creature_ptr) | ||
908 | 908 | |
909 | 909 | |
910 | 910 | /*! |
911 | - * @brief 帰還用メインルーチン | |
912 | - * @return 常にTRUEを返す | |
913 | - */ | |
914 | -bool word_of_recall(void) | |
915 | -{ | |
916 | - return(recall_player(randint0(21) + 15)); | |
917 | -} | |
918 | - | |
919 | -/*! | |
920 | 911 | * @brief フロア・リセット処理 |
921 | 912 | * @return リセット処理が実際に行われたらTRUEを返す |
922 | 913 | */ |