リビジョン | 372 (tree) |
---|---|
日時 | 2002-03-29 22:22:57 |
作者 | _nothere |
クエスト情報表示を変愚蛮怒と同様の情報量に増やした. この過程でセーブファイルに手が加わったため, Ver.を0.1.5に上げた上で枝とする.
@@ -1,6 +1,6 @@ | ||
1 | 1 | |
2 | 2 | *************************************** |
3 | - ** KantAngband 0.1.4 ** | |
3 | + ** KantAngband 0.1.5 ** | |
4 | 4 | *************************************** |
5 | 5 | Based on Moria: Copyright (c) 1985 Robert Alan Koeneke |
6 | 6 | and Umoria: Copyright (c) 1989 James E. Wilson |
@@ -2237,6 +2237,7 @@ | ||
2237 | 2237 | quest[i].type = 0; |
2238 | 2238 | quest[i].level = 0; |
2239 | 2239 | quest[i].r_idx = 0; |
2240 | + quest[i].complev = 0; | |
2240 | 2241 | } |
2241 | 2242 | |
2242 | 2243 | /* No weight */ |
@@ -3400,6 +3401,8 @@ | ||
3400 | 3401 | /* Accept Only Unique Monster */ |
3401 | 3402 | if(!(r_ptr->flags1 & RF1_UNIQUE)) continue; |
3402 | 3403 | |
3404 | + if (r_ptr->flags1 & RF1_QUESTOR) continue; | |
3405 | + | |
3403 | 3406 | /* |
3404 | 3407 | * Accept monsters that are 2 - 6 levels |
3405 | 3408 | * out of depth depending on the quest level |
@@ -1459,15 +1459,8 @@ | ||
1459 | 1459 | dun_level = command_arg; |
1460 | 1460 | |
1461 | 1461 | p_ptr->inside_arena = 0; |
1462 | - leaving_quest = p_ptr->inside_quest; | |
1463 | 1462 | |
1464 | - /* Leaving an 'only once' quest marks it as failed */ | |
1465 | - if (leaving_quest && | |
1466 | - (quest[leaving_quest].flags & QUEST_FLAG_ONCE) && | |
1467 | - (quest[leaving_quest].status == QUEST_STATUS_TAKEN)) | |
1468 | - { | |
1469 | - quest[leaving_quest].status = QUEST_STATUS_FAILED; | |
1470 | - } | |
1463 | + leave_quest_check(); | |
1471 | 1464 | |
1472 | 1465 | p_ptr->inside_quest = 0; |
1473 | 1466 | p_ptr->leftbldg = FALSE; |
@@ -34,18 +34,10 @@ | ||
34 | 34 | msg_print("You enter the up staircase."); |
35 | 35 | #endif |
36 | 36 | |
37 | + leave_quest_check(); | |
37 | 38 | |
38 | - leaving_quest = p_ptr->inside_quest; | |
39 | 39 | p_ptr->inside_quest = c_ptr->special; |
40 | 40 | |
41 | - /* Leaving an 'only once' quest marks it as failed */ | |
42 | - if (leaving_quest && | |
43 | - (quest[leaving_quest].flags & QUEST_FLAG_ONCE) && | |
44 | - (quest[leaving_quest].status == QUEST_STATUS_TAKEN)) | |
45 | - { | |
46 | - quest[leaving_quest].status = QUEST_STATUS_FAILED; | |
47 | - } | |
48 | - | |
49 | 41 | #ifdef USE_SCRIPT |
50 | 42 | if (cmd_go_up_callback()) return; |
51 | 43 | #endif /* USE_SCRIPT */ |
@@ -126,17 +118,9 @@ | ||
126 | 118 | |
127 | 119 | if (p_ptr->inside_quest) |
128 | 120 | { |
129 | - leaving_quest = p_ptr->inside_quest; | |
130 | - | |
131 | 121 | if(quest[leaving_quest].type != QUEST_TYPE_RANDOM) dun_level = 1; |
132 | 122 | |
133 | - /* Leaving an 'only once' quest marks it as failed */ | |
134 | - if (leaving_quest && | |
135 | - (quest[leaving_quest].flags & QUEST_FLAG_ONCE) && | |
136 | - (quest[leaving_quest].status == QUEST_STATUS_TAKEN)) | |
137 | - { | |
138 | - quest[leaving_quest].status = QUEST_STATUS_FAILED; | |
139 | - } | |
123 | + leave_quest_check(); | |
140 | 124 | |
141 | 125 | p_ptr->inside_quest = c_ptr->special; |
142 | 126 | } |
@@ -191,17 +175,8 @@ | ||
191 | 175 | msg_print("You enter the down staircase."); |
192 | 176 | #endif |
193 | 177 | |
178 | + leave_quest_check(); | |
194 | 179 | |
195 | - leaving_quest = p_ptr->inside_quest; | |
196 | - | |
197 | - /* Leaving an 'only once' quest marks it as failed */ | |
198 | - if (leaving_quest && | |
199 | - (quest[leaving_quest].flags & QUEST_FLAG_ONCE) && | |
200 | - (quest[leaving_quest].status == QUEST_STATUS_TAKEN)) | |
201 | - { | |
202 | - quest[leaving_quest].status = QUEST_STATUS_FAILED; | |
203 | - } | |
204 | - | |
205 | 180 | p_ptr->inside_quest = c_ptr->special; |
206 | 181 | |
207 | 182 | /* Activate the quest */ |
@@ -2777,8 +2752,9 @@ | ||
2777 | 2752 | if (quest[q_index].type == QUEST_TYPE_FIND_EXIT) |
2778 | 2753 | { |
2779 | 2754 | quest[q_index].status = QUEST_STATUS_COMPLETED; |
2755 | + quest[q_index].complev = (byte)p_ptr->lev; | |
2780 | 2756 | #ifdef JP |
2781 | - msg_print("クエストを完了した!"); | |
2757 | + msg_print("クエストを達成した!"); | |
2782 | 2758 | #else |
2783 | 2759 | msg_print("You accomplished your quest!"); |
2784 | 2760 | #endif |
@@ -2786,16 +2762,8 @@ | ||
2786 | 2762 | msg_print(NULL); |
2787 | 2763 | } |
2788 | 2764 | |
2789 | - leaving_quest = p_ptr->inside_quest; | |
2765 | + leave_quest_check(); | |
2790 | 2766 | |
2791 | - /* Leaving an 'only once' quest marks it as failed */ | |
2792 | - if (leaving_quest && | |
2793 | - (quest[leaving_quest].flags & QUEST_FLAG_ONCE) && | |
2794 | - (quest[leaving_quest].status == QUEST_STATUS_TAKEN)) | |
2795 | - { | |
2796 | - quest[leaving_quest].status = QUEST_STATUS_FAILED; | |
2797 | - } | |
2798 | - | |
2799 | 2767 | p_ptr->inside_quest = cave[py][px].special; |
2800 | 2768 | dun_level = 0; |
2801 | 2769 | p_ptr->oldpx = 0; |
@@ -4546,16 +4546,33 @@ | ||
4546 | 4546 | char name[80]; |
4547 | 4547 | monster_race *r_ptr; |
4548 | 4548 | int i; |
4549 | + int rand_level = 100; | |
4550 | + int total = 0; | |
4549 | 4551 | |
4550 | 4552 | /* Open a new file */ |
4551 | 4553 | fff = my_fopen_temp(file_name, 1024); |
4554 | + if (!fff) { | |
4555 | +#ifdef JP | |
4556 | + msg_format("一時ファイル %s を作成できませんでした。", file_name); | |
4557 | +#else | |
4558 | + msg_format("Failed to create temporary file %s.", file_name); | |
4559 | +#endif | |
4560 | + msg_print(NULL); | |
4561 | + return; | |
4562 | + } | |
4552 | 4563 | |
4564 | +#ifdef JP | |
4565 | + fprintf(fff, "《遂行中のクエスト》\n"); | |
4566 | +#else | |
4567 | + fprintf(fff, "< Current Quest >\n"); | |
4568 | +#endif | |
4569 | + | |
4553 | 4570 | for (i = 1; i < max_quests; i++) |
4554 | 4571 | { |
4555 | 4572 | /* No info from "silent" quests */ |
4556 | 4573 | if (quest[i].flags & QUEST_FLAG_SILENT) continue; |
4557 | 4574 | |
4558 | - if (quest[i].status == QUEST_STATUS_TAKEN) | |
4575 | + if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED) | |
4559 | 4576 | { |
4560 | 4577 | int old_quest; |
4561 | 4578 | int j; |
@@ -4568,6 +4585,8 @@ | ||
4568 | 4585 | |
4569 | 4586 | quest_text_line = 0; |
4570 | 4587 | |
4588 | + total++; | |
4589 | + | |
4571 | 4590 | /* Set the quest number temporary */ |
4572 | 4591 | old_quest = p_ptr->inside_quest; |
4573 | 4592 | p_ptr->inside_quest = i; |
@@ -4574,91 +4593,314 @@ | ||
4574 | 4593 | |
4575 | 4594 | /* Get the quest text */ |
4576 | 4595 | init_flags = INIT_SHOW_TEXT; |
4577 | -#ifdef JP | |
4596 | + | |
4578 | 4597 | process_dungeon_file("q_info_j.txt", 0, 0, 0, 0); |
4579 | -#else | |
4580 | - process_dungeon_file("q_info.txt", 0, 0, 0, 0); | |
4581 | -#endif | |
4582 | 4598 | |
4583 | - | |
4584 | 4599 | /* Reset the old quest number */ |
4585 | 4600 | p_ptr->inside_quest = old_quest; |
4586 | 4601 | |
4587 | 4602 | if (quest[i].type != QUEST_TYPE_RANDOM) |
4588 | 4603 | { |
4604 | + char note[80] = "\0"; | |
4605 | + | |
4606 | + if (quest[i].status == QUEST_STATUS_TAKEN) | |
4607 | + { | |
4608 | + if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL) | |
4609 | + { | |
4610 | + r_ptr = &r_info[quest[i].r_idx]; | |
4611 | + strcpy(name, r_name + r_ptr->name); | |
4612 | + if (quest[i].max_num > 1) | |
4613 | + { | |
4614 | +#ifdef JP | |
4615 | + sprintf(note," - %d 体の%sを倒す。(あと %d 体)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num); | |
4616 | +#else | |
4617 | + plural_aux(name); | |
4618 | + sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num); | |
4619 | +#endif | |
4620 | + } | |
4621 | + else | |
4622 | +#ifdef JP | |
4623 | + sprintf(note," - %sを倒す。",name); | |
4624 | +#else | |
4625 | + sprintf(note," - kill %s.",name); | |
4626 | +#endif | |
4627 | + } | |
4628 | + else if (quest[i].type == QUEST_TYPE_KILL_NUMBER) | |
4629 | + { | |
4630 | +#ifdef JP | |
4631 | + sprintf(note," - %d 体のモンスターを倒す。(あと %d 体)",quest[i].max_num, quest[i].max_num-quest[i].cur_num); | |
4632 | +#else | |
4633 | + sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num); | |
4634 | +#endif | |
4635 | + } | |
4636 | + else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT) | |
4637 | + { | |
4638 | + strcpy(name, a_name + a_info[quest[i].k_idx].name); | |
4639 | +#ifdef JP | |
4640 | + sprintf(note," - %sを見つけ出す。", name); | |
4641 | +#else | |
4642 | + sprintf(note," - Find out %s.", name); | |
4643 | +#endif | |
4644 | + } | |
4645 | + else if (quest[i].type == QUEST_TYPE_FIND_EXIT) | |
4646 | +#ifdef JP | |
4647 | + sprintf(note," - 探索する。"); | |
4648 | +#else | |
4649 | + sprintf(note," - Search."); | |
4650 | +#endif | |
4651 | + else if (quest[i].type == QUEST_TYPE_KILL_ALL) | |
4652 | +#ifdef JP | |
4653 | + sprintf(note," - 全てのモンスターを倒す。"); | |
4654 | +#else | |
4655 | + sprintf(note," - Kill all monsters."); | |
4656 | +#endif | |
4657 | + } | |
4658 | + | |
4589 | 4659 | /* Print the quest info */ |
4590 | 4660 | #ifdef JP |
4591 | - sprintf(tmp_str, "%s (危険度:%d階相当)\n", | |
4661 | + sprintf(tmp_str, "%s (危険度:%d階相当)%s\n", | |
4592 | 4662 | #else |
4593 | - sprintf(tmp_str, "%s (Danger level: %d)\n", | |
4663 | + sprintf(tmp_str, "%s (Danger level: %d)%s\n", | |
4594 | 4664 | #endif |
4595 | 4665 | |
4596 | - quest[i].name, quest[i].level); | |
4666 | + quest[i].name, quest[i].level, note); | |
4597 | 4667 | |
4598 | 4668 | fprintf(fff, tmp_str); |
4599 | 4669 | |
4600 | - j = 0; | |
4670 | + if (quest[i].status == QUEST_STATUS_COMPLETED) | |
4671 | + { | |
4672 | +#ifdef JP | |
4673 | + sprintf(tmp_str, " クエスト達成 - まだ報酬を受けとってない。\n"); | |
4674 | +#else | |
4675 | + sprintf(tmp_str, " Quest Completed - Unrewarded\n"); | |
4676 | +#endif | |
4601 | 4677 | |
4602 | - while (quest_text[j][0] && j<10 ) | |
4678 | + | |
4679 | + fprintf(fff, tmp_str); | |
4680 | + } | |
4681 | + else | |
4603 | 4682 | { |
4604 | - fprintf(fff, " %s\n", quest_text[j]); | |
4605 | - j++; | |
4683 | + j = 0; | |
4684 | + | |
4685 | + while (quest_text[j][0] && j < 10) | |
4686 | + { | |
4687 | + fprintf(fff, " %s\n", quest_text[j]); | |
4688 | + j++; | |
4689 | + } | |
4606 | 4690 | } |
4607 | 4691 | } |
4692 | + else if ((quest[i].type == QUEST_TYPE_RANDOM) && | |
4693 | + (quest[i].level < rand_level)) | |
4694 | + { | |
4695 | + /* New random */ | |
4696 | + rand_level = quest[i].level; | |
4697 | + | |
4698 | + if (p_ptr->max_dlv >= rand_level) | |
4699 | + { | |
4700 | + /* Print the quest info */ | |
4701 | + r_ptr = &r_info[quest[i].r_idx]; | |
4702 | + strcpy(name, r_name + r_ptr->name); | |
4703 | + | |
4704 | + if (quest[i].max_num > 1) | |
4705 | + { | |
4706 | +#ifdef JP | |
4707 | +sprintf(rand_tmp_str,"%s (%d 階) - %d 体の%sを倒す。(あと %d 体)\n", | |
4708 | + quest[i].name, quest[i].level, | |
4709 | + quest[i].max_num, name, quest[i].max_num-quest[i].cur_num); | |
4710 | +#else | |
4711 | + plural_aux(name); | |
4712 | + | |
4713 | + sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n", | |
4714 | + quest[i].name, quest[i].level, | |
4715 | + quest[i].max_num, name, quest[i].cur_num); | |
4716 | +#endif | |
4717 | + | |
4718 | + } | |
4719 | + else | |
4720 | + { | |
4721 | +#ifdef JP | |
4722 | +sprintf(rand_tmp_str,"%s (%d 階) - %sを倒す。\n", | |
4723 | +#else | |
4724 | + sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n", | |
4725 | +#endif | |
4726 | + | |
4727 | + quest[i].name, quest[i].level, name); | |
4728 | + } | |
4729 | + } | |
4730 | + } | |
4608 | 4731 | } |
4609 | - else if (quest[i].status == QUEST_STATUS_COMPLETED) | |
4732 | + } | |
4733 | + | |
4734 | + /* Print the current random quest */ | |
4735 | + if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str); | |
4736 | + | |
4737 | +#ifdef JP | |
4738 | + if (!total) fprintf(fff, "なし\n"); | |
4739 | +#else | |
4740 | + if (!total) fprintf(fff, "Nothing.\n"); | |
4741 | +#endif | |
4742 | + | |
4743 | +#ifdef JP | |
4744 | + fprintf(fff, "\n《達成したクエスト》\n"); | |
4745 | +#else | |
4746 | + fprintf(fff, "\n< Completed Quest >\n"); | |
4747 | +#endif | |
4748 | + total = 0; | |
4749 | + for (i = 1; i < max_quests; i++) | |
4750 | + { | |
4751 | + /* No info from "silent" quests */ | |
4752 | + if (quest[i].flags & QUEST_FLAG_SILENT) continue; | |
4753 | + | |
4754 | + if (quest[i].status == QUEST_STATUS_FINISHED) | |
4610 | 4755 | { |
4756 | + int old_quest; | |
4757 | + | |
4758 | + total++; | |
4759 | + | |
4760 | + if (i < MIN_RANDOM_QUEST) | |
4761 | + { | |
4762 | + /* Set the quest number temporary */ | |
4763 | + old_quest = p_ptr->inside_quest; | |
4764 | + p_ptr->inside_quest = i; | |
4765 | + | |
4766 | + /* Get the quest */ | |
4767 | + init_flags = INIT_ASSIGN; | |
4768 | + | |
4769 | + process_dungeon_file("q_info_j.txt", 0, 0, 0, 0); | |
4770 | + | |
4771 | + /* Reset the old quest number */ | |
4772 | + p_ptr->inside_quest = old_quest; | |
4773 | + } | |
4774 | + | |
4775 | + if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx) | |
4776 | + { | |
4777 | + /* Print the quest info */ | |
4611 | 4778 | #ifdef JP |
4612 | - sprintf(tmp_str, "クエスト達成 - まだ報酬を受けとってない。\n"); | |
4779 | + sprintf(tmp_str, "%s (%d階) - レベル%d\n", | |
4613 | 4780 | #else |
4614 | - sprintf(tmp_str, "Quest Completed - Unrewarded\n"); | |
4781 | + sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n", | |
4615 | 4782 | #endif |
4616 | 4783 | |
4784 | + r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev); | |
4785 | + } | |
4786 | + else | |
4787 | + { | |
4788 | + /* Print the quest info */ | |
4789 | +#ifdef JP | |
4790 | + sprintf(tmp_str, "%s (危険度:%d階相当) - レベル%d\n", | |
4791 | +#else | |
4792 | + sprintf(tmp_str, "%s (Danger level: %d) - level %d\n", | |
4793 | +#endif | |
4617 | 4794 | |
4795 | + quest[i].name, quest[i].level, quest[i].complev); | |
4796 | + } | |
4797 | + | |
4618 | 4798 | fprintf(fff, tmp_str); |
4619 | 4799 | } |
4620 | 4800 | } |
4801 | +#ifdef JP | |
4802 | + if (!total) fprintf(fff, "なし\n"); | |
4803 | +#else | |
4804 | + if (!total) fprintf(fff, "Nothing.\n"); | |
4805 | +#endif | |
4621 | 4806 | |
4622 | - /* Display Random Quest Info */ | |
4623 | - if(p_ptr->inside_quest && | |
4624 | - quest[p_ptr->inside_quest].type == QUEST_TYPE_RANDOM) | |
4807 | +#ifdef JP | |
4808 | + fprintf(fff, "\n《失敗したクエスト》\n"); | |
4809 | +#else | |
4810 | + fprintf(fff, "\n< Failed Quest >\n"); | |
4811 | +#endif | |
4812 | + total = 0; | |
4813 | + for (i = 1; i < max_quests; i++) | |
4625 | 4814 | { |
4626 | - quest_type *q_ptr = &quest[p_ptr->inside_quest]; | |
4815 | + /* No info from "silent" quests */ | |
4816 | + if (quest[i].flags & QUEST_FLAG_SILENT) continue; | |
4627 | 4817 | |
4628 | - /* Print the quest info */ | |
4629 | - r_ptr = &r_info[quest[p_ptr->inside_quest].r_idx]; | |
4630 | - strcpy(name, r_name + r_ptr->name); | |
4818 | + if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED)) | |
4819 | + { | |
4820 | + int old_quest; | |
4631 | 4821 | |
4632 | - if (q_ptr->max_num > 1) | |
4633 | - { | |
4822 | + total++; | |
4823 | + | |
4824 | + if (i < MIN_RANDOM_QUEST) | |
4825 | + { | |
4826 | + /* Set the quest number temporary */ | |
4827 | + old_quest = p_ptr->inside_quest; | |
4828 | + p_ptr->inside_quest = i; | |
4829 | + | |
4830 | + /* Get the quest text */ | |
4831 | + init_flags = INIT_ASSIGN; | |
4832 | + | |
4833 | + process_dungeon_file("q_info_j.txt", 0, 0, 0, 0); | |
4834 | + | |
4835 | + /* Reset the old quest number */ | |
4836 | + p_ptr->inside_quest = old_quest; | |
4837 | + } | |
4838 | + | |
4839 | + if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx) | |
4840 | + { | |
4841 | + /* Print the quest info */ | |
4634 | 4842 | #ifdef JP |
4635 | -sprintf(rand_tmp_str,"%s (%d 階) %d 体の%sを倒す。(あと %d 体)\n", | |
4636 | - q_ptr->name, q_ptr->level, | |
4637 | - q_ptr->max_num, name, q_ptr->max_num-q_ptr->cur_num); | |
4843 | + sprintf(tmp_str, "%s (%d階) - レベル%d\n", | |
4638 | 4844 | #else |
4639 | - plural_aux(name); | |
4845 | + sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n", | |
4846 | +#endif | |
4640 | 4847 | |
4641 | - sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n", | |
4642 | - q_ptr->name, q_ptr->level, | |
4643 | - q_ptr->max_num, name, q_ptr->cur_num); | |
4848 | + r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev); | |
4849 | + } | |
4850 | + else | |
4851 | + { | |
4852 | + /* Print the quest info */ | |
4853 | +#ifdef JP | |
4854 | + sprintf(tmp_str, "%s (危険度:%d階相当) - レベル%d\n", | |
4855 | +#else | |
4856 | + sprintf(tmp_str, "%s (Danger level: %d) - level %d\n", | |
4644 | 4857 | #endif |
4645 | 4858 | |
4859 | + quest[i].name, quest[i].level, quest[i].complev); | |
4860 | + } | |
4861 | + fprintf(fff, tmp_str); | |
4646 | 4862 | } |
4647 | - else | |
4863 | + } | |
4864 | +#ifdef JP | |
4865 | + if (!total) fprintf(fff, "なし\n"); | |
4866 | +#else | |
4867 | + if (!total) fprintf(fff, "Nothing.\n"); | |
4868 | +#endif | |
4869 | + | |
4870 | + if (wizard) { | |
4871 | +#ifdef JP | |
4872 | + fprintf(fff, "\n《残りのランダムクエスト》\n"); | |
4873 | +#else | |
4874 | + fprintf(fff, "\n< Remaining Random Quest >\n"); | |
4875 | +#endif | |
4876 | + total = 0; | |
4877 | + for (i = 1; i < max_quests; i++) | |
4878 | + { | |
4879 | + /* No info from "silent" quests */ | |
4880 | + if (quest[i].flags & QUEST_FLAG_SILENT) continue; | |
4881 | + | |
4882 | + if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN)) | |
4648 | 4883 | { |
4884 | + total++; | |
4885 | + | |
4886 | + /* Print the quest info */ | |
4649 | 4887 | #ifdef JP |
4650 | -sprintf(rand_tmp_str,"%s (%d 階) %sを倒す。\n", | |
4888 | + sprintf(tmp_str, "%s (%d階, %s)\n", | |
4651 | 4889 | #else |
4652 | - sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n", | |
4890 | + sprintf(tmp_str, "%s (%d, %s)\n", | |
4653 | 4891 | #endif |
4654 | 4892 | |
4655 | - q_ptr->name, q_ptr->level, name); | |
4893 | + quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name); | |
4894 | + fprintf(fff, tmp_str); | |
4656 | 4895 | } |
4657 | 4896 | } |
4897 | +#ifdef JP | |
4898 | + if (!total) fprintf(fff, "なし\n"); | |
4899 | +#else | |
4900 | + if (!total) fprintf(fff, "Nothing.\n"); | |
4901 | +#endif | |
4902 | + } | |
4658 | 4903 | |
4659 | - /* Print the current random quest */ | |
4660 | - fprintf(fff, rand_tmp_str); | |
4661 | - | |
4662 | 4904 | /* Close the file */ |
4663 | 4905 | my_fclose(fff); |
4664 | 4906 |
@@ -804,6 +804,24 @@ | ||
804 | 804 | } |
805 | 805 | |
806 | 806 | |
807 | +void leave_quest_check(void) | |
808 | +{ | |
809 | + /* Save quset number for dungeon pref file ($LEAVING_QUEST) */ | |
810 | + leaving_quest = p_ptr->inside_quest; | |
811 | + | |
812 | + /* Leaving an 'only once' quest marks it as failed */ | |
813 | + if (leaving_quest && | |
814 | + ((quest[leaving_quest].flags & QUEST_FLAG_ONCE) || (quest[leaving_quest].type == QUEST_TYPE_RANDOM)) && | |
815 | + (quest[leaving_quest].status == QUEST_STATUS_TAKEN)) | |
816 | + { | |
817 | + quest[leaving_quest].status = QUEST_STATUS_FAILED; | |
818 | + quest[leaving_quest].complev = (byte)p_ptr->lev; | |
819 | + if (quest[leaving_quest].type == QUEST_TYPE_RANDOM) | |
820 | + r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR); | |
821 | + } | |
822 | +} | |
823 | + | |
824 | + | |
807 | 825 | /* |
808 | 826 | * Forcibly pseudo-identify an object in the inventory |
809 | 827 | * (or on the floor) |
@@ -2719,19 +2737,10 @@ | ||
2719 | 2737 | msg_print("You feel yourself yanked upwards!"); |
2720 | 2738 | #endif |
2721 | 2739 | |
2722 | - | |
2723 | 2740 | dun_level = 0; |
2724 | 2741 | |
2725 | - leaving_quest = p_ptr->inside_quest; | |
2742 | + leave_quest_check(); | |
2726 | 2743 | |
2727 | - /* Leaving an 'only once' quest marks it as failed */ | |
2728 | - if (leaving_quest && | |
2729 | - (quest[leaving_quest].flags & QUEST_FLAG_ONCE) && | |
2730 | - (quest[leaving_quest].status == QUEST_STATUS_TAKEN)) | |
2731 | - { | |
2732 | - quest[leaving_quest].status = QUEST_STATUS_FAILED; | |
2733 | - } | |
2734 | - | |
2735 | 2744 | p_ptr->inside_quest = 0; |
2736 | 2745 | p_ptr->leaving = TRUE; |
2737 | 2746 | } |
@@ -527,6 +527,7 @@ | ||
527 | 527 | { |
528 | 528 | /* completed quest */ |
529 | 529 | quest[i].status = QUEST_STATUS_COMPLETED; |
530 | + quest[i].complev = (byte)p_ptr->lev; | |
530 | 531 | |
531 | 532 | if (!(quest[i].flags & QUEST_FLAG_SILENT)) |
532 | 533 | { |
@@ -564,6 +565,7 @@ | ||
564 | 565 | else |
565 | 566 | { |
566 | 567 | quest[i].status = QUEST_STATUS_COMPLETED; |
568 | + quest[i].complev = (byte)p_ptr->lev; | |
567 | 569 | #ifdef JP |
568 | 570 | msg_print("クエストを達成した!"); |
569 | 571 | #else |
@@ -587,6 +589,7 @@ | ||
587 | 589 | { |
588 | 590 | /* completed quest */ |
589 | 591 | quest[i].status = QUEST_STATUS_COMPLETED; |
592 | + quest[i].complev = (byte)p_ptr->lev; | |
590 | 593 | if (!(quest[i].flags & QUEST_FLAG_PRESET)) |
591 | 594 | { |
592 | 595 | p_ptr->inside_quest = 0; |
@@ -641,6 +644,7 @@ | ||
641 | 644 | { |
642 | 645 | /* completed quest */ |
643 | 646 | quest[i].status = QUEST_STATUS_COMPLETED; |
647 | + quest[i].complev = (byte)p_ptr->lev; | |
644 | 648 | |
645 | 649 | if (!(quest[i].flags & QUEST_FLAG_SILENT)) |
646 | 650 | { |
@@ -762,6 +762,8 @@ | ||
762 | 762 | s16b num_mon; /* number of monsters on level */ |
763 | 763 | |
764 | 764 | byte flags; /* quest flags */ |
765 | + | |
766 | + byte complev; /* Player level (complete) */ | |
765 | 767 | }; |
766 | 768 | |
767 | 769 |
@@ -70,51 +70,8 @@ | ||
70 | 70 | /* |
71 | 71 | * This function determines if the version of the savefile |
72 | 72 | * currently being read is older than version "x.y.z". |
73 | + * Adapted for Kantangband | |
73 | 74 | */ |
74 | -static bool older_than(byte x, byte y, byte z) | |
75 | -{ | |
76 | - /* Much older, or much more recent */ | |
77 | - if (sf_major < x) return (TRUE); | |
78 | - if (sf_major > x) return (FALSE); | |
79 | - | |
80 | - /* Distinctly older, or distinctly more recent */ | |
81 | - if (sf_minor < y) return (TRUE); | |
82 | - if (sf_minor > y) return (FALSE); | |
83 | - | |
84 | - /* Barely older, or barely more recent */ | |
85 | - if (sf_patch < z) return (TRUE); | |
86 | - if (sf_patch > z) return (FALSE); | |
87 | - | |
88 | - /* Identical versions */ | |
89 | - return (FALSE); | |
90 | -} | |
91 | - | |
92 | - | |
93 | -/* | |
94 | - * The above function, adapted for Zangband | |
95 | - */ | |
96 | -static bool z_older_than(byte x, byte y, byte z) | |
97 | -{ | |
98 | - /* Much older, or much more recent */ | |
99 | - if (z_major < x) return (TRUE); | |
100 | - if (z_major > x) return (FALSE); | |
101 | - | |
102 | - /* Distinctly older, or distinctly more recent */ | |
103 | - if (z_minor < y) return (TRUE); | |
104 | - if (z_minor > y) return (FALSE); | |
105 | - | |
106 | - /* Barely older, or barely more recent */ | |
107 | - if (z_patch < z) return (TRUE); | |
108 | - if (z_patch > z) return (FALSE); | |
109 | - | |
110 | - /* Identical versions */ | |
111 | - return (FALSE); | |
112 | -} | |
113 | - | |
114 | - | |
115 | -/* | |
116 | - * The above function, adapted for Kantangband | |
117 | - */ | |
118 | 75 | static bool k_older_than(byte x, byte y, byte z) |
119 | 76 | { |
120 | 77 | /* Much older, or much more recent */ |
@@ -313,18 +270,6 @@ | ||
313 | 270 | |
314 | 271 | |
315 | 272 | /* |
316 | - * Owner Conversion -- pre-2.7.8 to 2.7.8 | |
317 | - * Shop is column, Owner is Row, see "tables.c" | |
318 | - */ | |
319 | -static byte convert_owner[24] = | |
320 | -{ | |
321 | - 1, 3, 1, 0, 2, 3, 2, 0, | |
322 | - 0, 1, 3, 1, 0, 1, 1, 0, | |
323 | - 3, 2, 0, 2, 1, 2, 3, 0 | |
324 | -}; | |
325 | - | |
326 | - | |
327 | -/* | |
328 | 273 | * Old pre-2.7.4 inventory slot values |
329 | 274 | */ |
330 | 275 | #define OLD_INVEN_WIELD 22 |
@@ -553,81 +498,35 @@ | ||
553 | 498 | /* Special pval */ |
554 | 499 | rd_s16b(&o_ptr->pval); |
555 | 500 | |
556 | - /* Old method */ | |
557 | - if (older_than(2, 7, 8)) | |
558 | - { | |
559 | - rd_byte(&o_ptr->name1); | |
560 | - rd_byte(&o_ptr->name2); | |
561 | - rd_byte(&o_ptr->ident); | |
562 | - rd_byte(&o_ptr->number); | |
563 | - rd_s16b(&o_ptr->weight); | |
564 | - rd_s16b(&o_ptr->timeout); | |
501 | + rd_byte(&o_ptr->discount); | |
502 | + rd_byte(&o_ptr->number); | |
503 | + rd_s16b(&o_ptr->weight); | |
565 | 504 | |
566 | - rd_s16b(&o_ptr->to_h); | |
567 | - rd_s16b(&o_ptr->to_d); | |
568 | - rd_s16b(&o_ptr->to_a); | |
505 | + rd_byte(&o_ptr->name1); | |
506 | + rd_byte(&o_ptr->name2); | |
507 | + rd_s16b(&o_ptr->timeout); | |
569 | 508 | |
570 | - rd_s16b(&o_ptr->ac); | |
509 | + rd_s16b(&o_ptr->to_h); | |
510 | + rd_s16b(&o_ptr->to_d); | |
511 | + rd_s16b(&o_ptr->to_a); | |
571 | 512 | |
572 | - rd_byte(&old_dd); | |
573 | - rd_byte(&old_ds); | |
513 | + rd_s16b(&o_ptr->ac); | |
574 | 514 | |
575 | - strip_bytes(2); | |
515 | + rd_byte(&old_dd); | |
516 | + rd_byte(&old_ds); | |
576 | 517 | |
577 | - rd_s32b(&old_cost); | |
518 | + rd_byte(&o_ptr->ident); | |
578 | 519 | |
579 | - strip_bytes(4); | |
580 | - } | |
520 | + rd_byte(&o_ptr->marked); | |
581 | 521 | |
582 | - /* New method */ | |
583 | - else | |
584 | - { | |
585 | - rd_byte(&o_ptr->discount); | |
586 | - rd_byte(&o_ptr->number); | |
587 | - rd_s16b(&o_ptr->weight); | |
588 | - | |
589 | - rd_byte(&o_ptr->name1); | |
590 | - rd_byte(&o_ptr->name2); | |
591 | - rd_s16b(&o_ptr->timeout); | |
592 | - | |
593 | - rd_s16b(&o_ptr->to_h); | |
594 | - rd_s16b(&o_ptr->to_d); | |
595 | - rd_s16b(&o_ptr->to_a); | |
596 | - | |
597 | - rd_s16b(&o_ptr->ac); | |
598 | - | |
599 | - rd_byte(&old_dd); | |
600 | - rd_byte(&old_ds); | |
601 | - | |
602 | - rd_byte(&o_ptr->ident); | |
603 | - | |
604 | - rd_byte(&o_ptr->marked); | |
605 | - } | |
606 | - | |
607 | -#if 0 | |
608 | 522 | /* Old flags */ |
609 | - strip_bytes(12); | |
610 | -#else | |
611 | - /* Old flags */ | |
612 | 523 | rd_u32b(&o_ptr->art_flags1); |
613 | 524 | rd_u32b(&o_ptr->art_flags2); |
614 | 525 | rd_u32b(&o_ptr->art_flags3); |
615 | -#endif | |
616 | 526 | |
617 | - /* Old version */ | |
618 | - if (older_than(2, 8, 0)) | |
619 | - { | |
620 | - /* Old something */ | |
621 | - strip_bytes(2); | |
622 | - } | |
527 | + /* Monster holding object */ | |
528 | + rd_s16b(&o_ptr->held_m_idx); | |
623 | 529 | |
624 | - /* New version */ | |
625 | - else | |
626 | - { | |
627 | - /* Monster holding object */ | |
628 | - rd_s16b(&o_ptr->held_m_idx); | |
629 | - } | |
630 | - | |
631 | 530 | /* Special powers */ |
632 | 531 | rd_byte(&o_ptr->xtra1); |
633 | 532 | rd_byte(&o_ptr->xtra2); |
@@ -676,22 +575,11 @@ | ||
676 | 575 | } |
677 | 576 | |
678 | 577 | /* The Python object */ |
679 | - if (!z_older_than(2, 2, 4)) | |
680 | 578 | { |
681 | 579 | s32b tmp32s; |
682 | 580 | |
683 | 581 | rd_s32b(&tmp32s); |
684 | -#ifdef USE_SCRIPT | |
685 | - if (tmp32s) | |
686 | - { | |
687 | - char *python_object = (char*) malloc(tmp32s + 1); | |
688 | - rd_string(python_object, tmp32s + 1); | |
689 | - o_ptr->python = object_load_callback(python_object); | |
690 | - free(python_object); | |
691 | - } | |
692 | -#else /* USE_SCRIPT */ | |
693 | 582 | strip_bytes(tmp32s); |
694 | -#endif /* USE_SCRIPT */ | |
695 | 583 | } |
696 | 584 | |
697 | 585 | /* Mega-Hack -- handle "dungeon objects" later */ |
@@ -704,28 +592,9 @@ | ||
704 | 592 | o_ptr->tval = k_ptr->tval; |
705 | 593 | o_ptr->sval = k_ptr->sval; |
706 | 594 | |
707 | - /* For rod-stacking */ | |
708 | - if (z_older_than(2, 2, 5) && (o_ptr->tval == TV_ROD)) | |
709 | - { | |
710 | - o_ptr->timeout = o_ptr->pval * o_ptr->number; | |
711 | - o_ptr->pval = k_ptr->pval * o_ptr->number; | |
712 | - } | |
713 | - | |
714 | 595 | /* Hack -- notice "broken" items */ |
715 | 596 | if (k_ptr->cost <= 0) o_ptr->ident |= (IDENT_BROKEN); |
716 | 597 | |
717 | - | |
718 | - /* Hack -- the "gold" values changed in 2.7.8 */ | |
719 | - if (older_than(2, 7, 8) && (o_ptr->tval == TV_GOLD)) | |
720 | - { | |
721 | - /* Extract the value */ | |
722 | - o_ptr->pval = (s16b)old_cost; | |
723 | - | |
724 | - /* Done */ | |
725 | - return; | |
726 | - } | |
727 | - | |
728 | - | |
729 | 598 | /* Repair non "wearable" items */ |
730 | 599 | if (!wearable_p(o_ptr)) |
731 | 600 | { |
@@ -749,133 +618,9 @@ | ||
749 | 618 | return; |
750 | 619 | } |
751 | 620 | |
752 | - | |
753 | 621 | /* Extract the flags */ |
754 | 622 | object_flags(o_ptr, &f1, &f2, &f3); |
755 | 623 | |
756 | - /* The ego item indexes changed in 2.7.9 */ | |
757 | - if (older_than(2, 7, 9) && o_ptr->name2) | |
758 | - { | |
759 | - /* Convert the ego-item names */ | |
760 | - o_ptr->name2 = convert_ego_item[o_ptr->name2]; | |
761 | - | |
762 | - /* Hack -- fix some "Ammo" */ | |
763 | - if ((o_ptr->tval == TV_BOLT) || | |
764 | - (o_ptr->tval == TV_ARROW) || | |
765 | - (o_ptr->tval == TV_SHOT)) | |
766 | - { | |
767 | - /* Special ego-item indexes */ | |
768 | - if (o_ptr->name2 == EGO_BRAND_FIRE) | |
769 | - { | |
770 | - o_ptr->name2 = EGO_FLAME; | |
771 | - } | |
772 | - else if (o_ptr->name2 == EGO_SLAYING) | |
773 | - { | |
774 | - o_ptr->name2 = EGO_FROST; | |
775 | - } | |
776 | - else if (o_ptr->name2 == EGO_SLAY_ANIMAL) | |
777 | - { | |
778 | - o_ptr->name2 = EGO_HURT_ANIMAL; | |
779 | - } | |
780 | - else if (o_ptr->name2 == EGO_SLAY_EVIL) | |
781 | - { | |
782 | - o_ptr->name2 = EGO_HURT_EVIL; | |
783 | - } | |
784 | - else if (o_ptr->name2 == EGO_SLAY_DRAGON) | |
785 | - { | |
786 | - o_ptr->name2 = EGO_HURT_DRAGON; | |
787 | - } | |
788 | - } | |
789 | - | |
790 | - /* Hack -- fix some "Bows" */ | |
791 | - if (o_ptr->tval == TV_BOW) | |
792 | - { | |
793 | - /* Special ego-item indexes */ | |
794 | - if (o_ptr->name2 == EGO_MIGHT) | |
795 | - { | |
796 | - o_ptr->name2 = EGO_VELOCITY; | |
797 | - } | |
798 | - } | |
799 | - | |
800 | - /* Hack -- fix some "Robes" */ | |
801 | - if (o_ptr->tval == TV_SOFT_ARMOR) | |
802 | - { | |
803 | - /* Special ego-item indexes */ | |
804 | - if (o_ptr->name2 == EGO_MAGI) | |
805 | - { | |
806 | - o_ptr->name2 = EGO_PERMANENCE; | |
807 | - } | |
808 | - } | |
809 | - | |
810 | - /* Hack -- fix some "Boots" */ | |
811 | - if (o_ptr->tval == TV_BOOTS) | |
812 | - { | |
813 | - /* Special ego-item indexes */ | |
814 | - if (o_ptr->name2 == EGO_STEALTH) | |
815 | - { | |
816 | - o_ptr->name2 = EGO_QUIET; | |
817 | - } | |
818 | - else if (o_ptr->name2 == EGO_FREE_ACTION) | |
819 | - { | |
820 | - o_ptr->name2 = EGO_MOTION; | |
821 | - } | |
822 | - } | |
823 | - | |
824 | - /* Hack -- fix some "Shields" */ | |
825 | - if (o_ptr->tval == TV_SHIELD) | |
826 | - { | |
827 | - /* Special ego-item indexes */ | |
828 | - if (o_ptr->name2 == EGO_RESIST_ACID) | |
829 | - { | |
830 | - o_ptr->name2 = EGO_ENDURE_ACID; | |
831 | - } | |
832 | - else if (o_ptr->name2 == EGO_RESIST_ELEC) | |
833 | - { | |
834 | - o_ptr->name2 = EGO_ENDURE_ELEC; | |
835 | - } | |
836 | - else if (o_ptr->name2 == EGO_RESIST_FIRE) | |
837 | - { | |
838 | - o_ptr->name2 = EGO_ENDURE_FIRE; | |
839 | - } | |
840 | - else if (o_ptr->name2 == EGO_RESIST_COLD) | |
841 | - { | |
842 | - o_ptr->name2 = EGO_ENDURE_COLD; | |
843 | - } | |
844 | - else if (o_ptr->name2 == EGO_RESISTANCE) | |
845 | - { | |
846 | - o_ptr->name2 = EGO_ENDURANCE; | |
847 | - } | |
848 | - else if (o_ptr->name2 == EGO_ELVENKIND) | |
849 | - { | |
850 | - o_ptr->name2 = EGO_ENDURANCE; | |
851 | - } | |
852 | - } | |
853 | - } | |
854 | - | |
855 | - /* | |
856 | - * Hack - reduce number of attacks from old objects | |
857 | - * This changed with the addition of oangband combat. | |
858 | - */ | |
859 | - if (z_older_than(2, 3, 4)) | |
860 | - { | |
861 | - if ((f1 & (TR1_BLOWS)) && (o_ptr->pval > 2)) | |
862 | - { | |
863 | - o_ptr->pval = 2; | |
864 | - } | |
865 | - } | |
866 | - | |
867 | - /* Hack -- the "searching" bonuses changed in 2.7.6 */ | |
868 | - if (older_than(2, 7, 6)) | |
869 | - { | |
870 | - /* Reduce the "pval" bonus on "search" */ | |
871 | - if (f1 & (TR1_SEARCH)) | |
872 | - { | |
873 | - /* Paranoia -- do not lose any search bonuses */ | |
874 | - o_ptr->pval = (o_ptr->pval + 4) / 5; | |
875 | - } | |
876 | - } | |
877 | - | |
878 | - | |
879 | 624 | /* Paranoia */ |
880 | 625 | if (o_ptr->name1) |
881 | 626 | { |
@@ -912,7 +657,6 @@ | ||
912 | 657 | /* Hack -- extract the "broken" flag */ |
913 | 658 | if (!o_ptr->pval < 0) o_ptr->ident |= (IDENT_BROKEN); |
914 | 659 | |
915 | - | |
916 | 660 | /* Artifacts */ |
917 | 661 | if (o_ptr->name1) |
918 | 662 | { |
@@ -934,13 +678,6 @@ | ||
934 | 678 | |
935 | 679 | /* Hack -- extract the "broken" flag */ |
936 | 680 | if (!a_ptr->cost) o_ptr->ident |= (IDENT_BROKEN); |
937 | - | |
938 | - /* Hack -- assume "curse" */ | |
939 | - if (older_than(2, 7, 9)) | |
940 | - { | |
941 | - /* Hack -- assume cursed */ | |
942 | - if (a_ptr->flags3 & (TR3_CURSED)) o_ptr->ident |= (IDENT_CURSED); | |
943 | - } | |
944 | 681 | } |
945 | 682 | |
946 | 683 | /* Ego items */ |
@@ -957,13 +694,6 @@ | ||
957 | 694 | |
958 | 695 | /* Hack -- extract the "broken" flag */ |
959 | 696 | if (!e_ptr->cost) o_ptr->ident |= (IDENT_BROKEN); |
960 | - | |
961 | - /* Hack -- assume "curse" */ | |
962 | - if (older_than(2, 7, 9)) | |
963 | - { | |
964 | - /* Hack -- assume cursed */ | |
965 | - if (e_ptr->flags3 & (TR3_CURSED)) o_ptr->ident |= (IDENT_CURSED); | |
966 | - } | |
967 | 697 | } |
968 | 698 | |
969 | 699 | if (o_ptr->art_name) /* A random artifact */ |
@@ -972,21 +702,6 @@ | ||
972 | 702 | o_ptr->ds = old_ds; |
973 | 703 | } |
974 | 704 | |
975 | - /* Hack -- assume "cursed" items */ | |
976 | - if (older_than(2, 7, 9)) | |
977 | - { | |
978 | - /* Hack -- assume cursed */ | |
979 | - if (k_ptr->flags3 & (TR3_CURSED)) o_ptr->ident |= (IDENT_CURSED); | |
980 | - | |
981 | - /* Hack -- apply "uncursed" incription */ | |
982 | -#ifdef JP | |
983 | -if (streq(buf, "呪いなし")) o_ptr->ident &= ~(IDENT_CURSED); | |
984 | -#else | |
985 | - if (streq(buf, "uncursed")) o_ptr->ident &= ~(IDENT_CURSED); | |
986 | -#endif | |
987 | - | |
988 | - } | |
989 | - | |
990 | 705 | /* Change shattered weapons from 0d0 to 1d1 */ |
991 | 706 | if (is_weapon(o_ptr)) |
992 | 707 | { |
@@ -1059,70 +774,50 @@ | ||
1059 | 774 | |
1060 | 775 | monster_race *r_ptr = &r_info[r_idx]; |
1061 | 776 | |
777 | + /* Count sights/deaths/kills */ | |
778 | + rd_s16b(&r_ptr->r_sights); | |
779 | + rd_s16b(&r_ptr->r_deaths); | |
780 | + rd_s16b(&r_ptr->r_pkills); | |
781 | + rd_s16b(&r_ptr->r_tkills); | |
1062 | 782 | |
1063 | - /* Pre-2.7.7 */ | |
1064 | - if (older_than(2, 7, 7)) | |
1065 | - { | |
1066 | - /* Strip old flags */ | |
1067 | - strip_bytes(38); | |
1068 | - } | |
783 | + /* Count wakes and ignores */ | |
784 | + rd_byte(&r_ptr->r_wake); | |
785 | + rd_byte(&r_ptr->r_ignore); | |
1069 | 786 | |
1070 | - /* Pre-2.2.0 (old r_info.txt) */ | |
1071 | - else if (z_older_than(2, 2, 0)) | |
1072 | - { | |
1073 | - /* Throw away old info */ | |
1074 | - strip_bytes(48); | |
1075 | - } | |
787 | + /* Extra stuff */ | |
788 | + rd_byte(&r_ptr->r_xtra1); | |
789 | + rd_byte(&r_ptr->r_xtra2); | |
1076 | 790 | |
1077 | - /* Current */ | |
1078 | - else | |
1079 | - { | |
1080 | - /* Count sights/deaths/kills */ | |
1081 | - rd_s16b(&r_ptr->r_sights); | |
1082 | - rd_s16b(&r_ptr->r_deaths); | |
1083 | - rd_s16b(&r_ptr->r_pkills); | |
1084 | - rd_s16b(&r_ptr->r_tkills); | |
791 | + /* Count drops */ | |
792 | + rd_byte(&r_ptr->r_drop_gold); | |
793 | + rd_byte(&r_ptr->r_drop_item); | |
1085 | 794 | |
1086 | - /* Count wakes and ignores */ | |
1087 | - rd_byte(&r_ptr->r_wake); | |
1088 | - rd_byte(&r_ptr->r_ignore); | |
795 | + /* Count spells */ | |
796 | + rd_byte(&r_ptr->r_cast_inate); | |
797 | + rd_byte(&r_ptr->r_cast_spell); | |
1089 | 798 | |
1090 | - /* Extra stuff */ | |
1091 | - rd_byte(&r_ptr->r_xtra1); | |
1092 | - rd_byte(&r_ptr->r_xtra2); | |
799 | + /* Count blows of each type */ | |
800 | + rd_byte(&r_ptr->r_blows[0]); | |
801 | + rd_byte(&r_ptr->r_blows[1]); | |
802 | + rd_byte(&r_ptr->r_blows[2]); | |
803 | + rd_byte(&r_ptr->r_blows[3]); | |
1093 | 804 | |
1094 | - /* Count drops */ | |
1095 | - rd_byte(&r_ptr->r_drop_gold); | |
1096 | - rd_byte(&r_ptr->r_drop_item); | |
805 | + /* Memorize flags */ | |
806 | + rd_u32b(&r_ptr->r_flags1); | |
807 | + rd_u32b(&r_ptr->r_flags2); | |
808 | + rd_u32b(&r_ptr->r_flags3); | |
809 | + rd_u32b(&r_ptr->r_flags4); | |
810 | + rd_u32b(&r_ptr->r_flags5); | |
811 | + rd_u32b(&r_ptr->r_flags6); | |
1097 | 812 | |
1098 | - /* Count spells */ | |
1099 | - rd_byte(&r_ptr->r_cast_inate); | |
1100 | - rd_byte(&r_ptr->r_cast_spell); | |
813 | + /* Read the "Racial" monster limit per level */ | |
814 | + rd_byte(&r_ptr->max_num); | |
1101 | 815 | |
1102 | - /* Count blows of each type */ | |
1103 | - rd_byte(&r_ptr->r_blows[0]); | |
1104 | - rd_byte(&r_ptr->r_blows[1]); | |
1105 | - rd_byte(&r_ptr->r_blows[2]); | |
1106 | - rd_byte(&r_ptr->r_blows[3]); | |
816 | + /* Later (?) */ | |
817 | + rd_byte(&tmp8u); | |
818 | + rd_byte(&tmp8u); | |
819 | + rd_byte(&tmp8u); | |
1107 | 820 | |
1108 | - /* Memorize flags */ | |
1109 | - rd_u32b(&r_ptr->r_flags1); | |
1110 | - rd_u32b(&r_ptr->r_flags2); | |
1111 | - rd_u32b(&r_ptr->r_flags3); | |
1112 | - rd_u32b(&r_ptr->r_flags4); | |
1113 | - rd_u32b(&r_ptr->r_flags5); | |
1114 | - rd_u32b(&r_ptr->r_flags6); | |
1115 | - | |
1116 | - | |
1117 | - /* Read the "Racial" monster limit per level */ | |
1118 | - rd_byte(&r_ptr->max_num); | |
1119 | - | |
1120 | - /* Later (?) */ | |
1121 | - rd_byte(&tmp8u); | |
1122 | - rd_byte(&tmp8u); | |
1123 | - rd_byte(&tmp8u); | |
1124 | - } | |
1125 | - | |
1126 | 821 | /* Repair the lore flags */ |
1127 | 822 | r_ptr->r_flags1 &= r_ptr->flags1; |
1128 | 823 | r_ptr->r_flags2 &= r_ptr->flags2; |
@@ -1144,30 +839,19 @@ | ||
1144 | 839 | |
1145 | 840 | int j; |
1146 | 841 | |
1147 | - byte own, num; | |
842 | + byte num; | |
1148 | 843 | |
1149 | 844 | /* Read the basic info */ |
1150 | 845 | rd_s32b(&st_ptr->store_open); |
1151 | 846 | rd_s16b(&st_ptr->insult_cur); |
1152 | - rd_byte(&own); | |
847 | + rd_byte(&st_ptr->owner); | |
1153 | 848 | rd_byte(&num); |
1154 | 849 | rd_s16b(&st_ptr->good_buy); |
1155 | 850 | rd_s16b(&st_ptr->bad_buy); |
1156 | 851 | |
1157 | - if (!z_older_than(2, 1, 3)) | |
1158 | - { | |
1159 | - /* Read last visit */ | |
1160 | - rd_s32b(&st_ptr->last_visit); | |
1161 | - } | |
1162 | - else | |
1163 | - { | |
1164 | - /* Reset last visit to the current turn */ | |
1165 | - st_ptr->last_visit = turn; | |
1166 | - } | |
852 | + /* Read last visit */ | |
853 | + rd_s32b(&st_ptr->last_visit); | |
1167 | 854 | |
1168 | - /* Extract the owner (see above) */ | |
1169 | - st_ptr->owner = (older_than(2, 7, 8) ? convert_owner[own] : own); | |
1170 | - | |
1171 | 855 | /* Read the items */ |
1172 | 856 | for (j = 0; j < num; j++) |
1173 | 857 | { |
@@ -1216,9 +900,6 @@ | ||
1216 | 900 | |
1217 | 901 | u16b tmp16u; |
1218 | 902 | |
1219 | - /* Old version */ | |
1220 | - if (older_than(2, 8, 0)) return; | |
1221 | - | |
1222 | 903 | /* Tmp */ |
1223 | 904 | rd_u16b(&tmp16u); |
1224 | 905 |
@@ -1291,22 +972,11 @@ | ||
1291 | 972 | cheat_know = (c & 0x1000) ? TRUE : FALSE; |
1292 | 973 | cheat_live = (c & 0x2000) ? TRUE : FALSE; |
1293 | 974 | |
1294 | - /* Pre-2.8.0 savefiles are done */ | |
1295 | - if (older_than(2, 8, 0)) return; | |
975 | + rd_byte(&autosave_l); | |
976 | + rd_byte(&autosave_t); | |
977 | + rd_s16b(&autosave_freq); | |
1296 | 978 | |
1297 | - if (z_older_than(2, 1, 0)) | |
1298 | - { | |
1299 | - autosave_t = autosave_l = 0; | |
1300 | - autosave_freq = 0; | |
1301 | - } | |
1302 | - else | |
1303 | - { | |
1304 | - rd_byte(&autosave_l); | |
1305 | - rd_byte(&autosave_t); | |
1306 | - rd_s16b(&autosave_freq); | |
1307 | - } | |
1308 | 979 | |
1309 | - | |
1310 | 980 | /*** Normal Options ***/ |
1311 | 981 | |
1312 | 982 | /* Read the option flags */ |
@@ -1401,19 +1071,8 @@ | ||
1401 | 1071 | /* Strip name */ |
1402 | 1072 | rd_string(buf, 64); |
1403 | 1073 | |
1404 | - /* Older ghosts */ | |
1405 | - if (older_than(2, 7, 7)) | |
1406 | - { | |
1407 | - /* Strip old data */ | |
1408 | - strip_bytes(52); | |
1409 | - } | |
1410 | - | |
1411 | - /* Newer ghosts */ | |
1412 | - else | |
1413 | - { | |
1414 | - /* Strip old data */ | |
1415 | - strip_bytes(60); | |
1416 | - } | |
1074 | + /* Strip old data */ | |
1075 | + strip_bytes(60); | |
1417 | 1076 | } |
1418 | 1077 | |
1419 | 1078 |
@@ -1469,75 +1128,31 @@ | ||
1469 | 1128 | |
1470 | 1129 | rd_s16b(&p_ptr->lev); |
1471 | 1130 | |
1472 | - /* Current version */ | |
1473 | - if (!z_older_than(2, 1, 3)) | |
1474 | - { | |
1475 | - rd_s16b(&p_ptr->town_num); | |
1131 | + rd_s16b(&p_ptr->town_num); | |
1476 | 1132 | |
1477 | - /* Read arena and rewards information */ | |
1478 | - rd_s16b(&p_ptr->arena_number); | |
1479 | - rd_s16b(&p_ptr->inside_arena); | |
1480 | - rd_s16b(&p_ptr->inside_quest); | |
1481 | - rd_byte(&p_ptr->exit_bldg); | |
1482 | - rd_byte(&p_ptr->leftbldg); | |
1133 | + /* Read arena and rewards information */ | |
1134 | + rd_s16b(&p_ptr->arena_number); | |
1135 | + rd_s16b(&p_ptr->inside_arena); | |
1136 | + rd_s16b(&p_ptr->inside_quest); | |
1137 | + rd_byte(&p_ptr->exit_bldg); | |
1138 | + rd_byte(&p_ptr->leftbldg); | |
1483 | 1139 | |
1484 | - rd_s16b(&p_ptr->oldpx); | |
1485 | - rd_s16b(&p_ptr->oldpy); | |
1140 | + rd_s16b(&p_ptr->oldpx); | |
1141 | + rd_s16b(&p_ptr->oldpy); | |
1486 | 1142 | |
1487 | - rd_s16b(&tmp16s); | |
1143 | + rd_s16b(&tmp16s); | |
1488 | 1144 | |
1489 | - if (tmp16s > MAX_BACT) | |
1490 | - { | |
1145 | + if (tmp16s > MAX_BACT) | |
1146 | + { | |
1491 | 1147 | #ifdef JP |
1492 | -note(format("の中", tmp16s)); | |
1148 | + note(format("の中", tmp16s)); | |
1493 | 1149 | #else |
1494 | - note(format("Too many (%d) building rewards!", tmp16s)); | |
1150 | + note(format("Too many (%d) building rewards!", tmp16s)); | |
1495 | 1151 | #endif |
1496 | - | |
1497 | - } | |
1498 | - | |
1499 | - for (i = 0; i < tmp16s; i++) rd_s16b(&p_ptr->rewards[i]); | |
1500 | 1152 | } |
1501 | - /* 2.1.2 beta version */ | |
1502 | - else if (z_major == 2 && z_minor == 1 && z_patch == 2) | |
1503 | - { | |
1504 | - /* Town index */ | |
1505 | - rd_s16b(&tmp16s); | |
1506 | - p_ptr->town_num = 1; | |
1507 | - p_ptr->oldpx = 0; | |
1508 | - p_ptr->oldpy = 0; | |
1509 | 1153 | |
1510 | - /* read arena information and rewards -KMW- */ | |
1511 | - rd_s16b(&p_ptr->arena_number); | |
1154 | + for (i = 0; i < tmp16s; i++) rd_s16b(&p_ptr->rewards[i]) ; | |
1512 | 1155 | |
1513 | - rd_s16b(&p_ptr->inside_arena); | |
1514 | - rd_s16b(&p_ptr->inside_quest); | |
1515 | - rd_byte(&p_ptr->exit_bldg); | |
1516 | - rd_byte(&p_ptr->leftbldg); | |
1517 | - | |
1518 | - /* Throw away old quest informations */ | |
1519 | - for (i = 0; i < 100; i++) rd_s16b(&tmp16s); | |
1520 | - for (i = 0; i < 10; i++) rd_s16b(&tmp16s); | |
1521 | - for (i = 0; i < 10; i++) rd_s16b(&tmp16s); | |
1522 | - for (i = 0; i < 5; i++) rd_s16b(&tmp16s); | |
1523 | - for (i = 0; i < 5; i++) rd_s16b(&tmp16s); | |
1524 | - } | |
1525 | - else /* 2.1.0 or older */ | |
1526 | - { | |
1527 | - p_ptr->town_num = 1; | |
1528 | - p_ptr->oldpx = 0; | |
1529 | - p_ptr->oldpy = 0; | |
1530 | - | |
1531 | - /* Initialize arena information -KMW- */ | |
1532 | - p_ptr->arena_number = 0; | |
1533 | - p_ptr->inside_arena = 0; | |
1534 | - p_ptr->inside_quest = 0; | |
1535 | - p_ptr->leftbldg = TRUE; | |
1536 | - p_ptr->exit_bldg = TRUE; | |
1537 | - | |
1538 | - for (i = 0; i < MAX_BACT; ++i) p_ptr->rewards[i] = 0; | |
1539 | - } | |
1540 | - | |
1541 | 1156 | rd_s16b(&p_ptr->mhp); |
1542 | 1157 | rd_s16b(&p_ptr->chp); |
1543 | 1158 | rd_u16b(&p_ptr->chp_frac); |
@@ -1560,9 +1175,6 @@ | ||
1560 | 1175 | rd_s16b(&p_ptr->sc); |
1561 | 1176 | strip_bytes(2); |
1562 | 1177 | |
1563 | - /* Ignore old redundant info */ | |
1564 | - if (older_than(2, 7, 7)) strip_bytes(24); | |
1565 | - | |
1566 | 1178 | /* Read the flags */ |
1567 | 1179 | strip_bytes(2); /* Old "rest" */ |
1568 | 1180 | rd_s16b(&p_ptr->blind); |
@@ -1660,9 +1272,6 @@ | ||
1660 | 1272 | /* Calc the regeneration modifier for mutations */ |
1661 | 1273 | mutant_regenerate_mod = calc_mutant_regenerate_mod(); |
1662 | 1274 | |
1663 | - /* Old redundant flags */ | |
1664 | - if (older_than(2, 7, 7)) strip_bytes(34); | |
1665 | - | |
1666 | 1275 | rd_byte(&p_ptr->confusing); |
1667 | 1276 | rd_byte(&tmp8u); /* oops */ |
1668 | 1277 | rd_byte(&tmp8u); /* oops */ |
@@ -1759,9 +1368,6 @@ | ||
1759 | 1368 | /* Hack -- verify item */ |
1760 | 1369 | if (!q_ptr->k_idx) return (53); |
1761 | 1370 | |
1762 | - /* Hack -- convert old slot numbers */ | |
1763 | - if (older_than(2, 7, 4)) n = convert_slot(n); | |
1764 | - | |
1765 | 1371 | /* Wield equipment */ |
1766 | 1372 | if (n >= INVEN_WIELD) |
1767 | 1373 | { |
@@ -1930,133 +1536,43 @@ | ||
1930 | 1536 | /* Special */ |
1931 | 1537 | c_ptr->feat = 0; |
1932 | 1538 | |
1933 | - /* Old method */ | |
1934 | - if (older_than(2, 7, 5)) | |
1935 | - { | |
1936 | - /* Extract the old "info" flags */ | |
1937 | - if ((tmp8u >> 4) & 0x1) c_ptr->info |= (CAVE_ROOM); | |
1938 | - if ((tmp8u >> 5) & 0x1) c_ptr->info |= (CAVE_MARK); | |
1939 | - if ((tmp8u >> 6) & 0x1) c_ptr->info |= (CAVE_GLOW); | |
1539 | + /* The old "vault" flag */ | |
1540 | + if (tmp8u & (OLD_GRID_ICKY)) c_ptr->info |= (CAVE_ICKY); | |
1940 | 1541 | |
1941 | - /* Hack -- process old style "light" */ | |
1942 | - if (c_ptr->info & (CAVE_GLOW)) | |
1943 | - { | |
1944 | - c_ptr->info |= (CAVE_MARK); | |
1945 | - } | |
1542 | + /* The old "room" flag */ | |
1543 | + if (tmp8u & (OLD_GRID_ROOM)) c_ptr->info |= (CAVE_ROOM); | |
1946 | 1544 | |
1947 | - /* Mega-Hack -- light all walls */ | |
1948 | - else if ((tmp8u & 0x0F) >= 12) | |
1949 | - { | |
1950 | - c_ptr->info |= (CAVE_GLOW); | |
1951 | - } | |
1545 | + /* The old "glow" flag */ | |
1546 | + if (tmp8u & (OLD_GRID_GLOW)) c_ptr->info |= (CAVE_GLOW); | |
1952 | 1547 | |
1953 | - /* Process the "floor type" */ | |
1954 | - switch (tmp8u & 0x0F) | |
1955 | - { | |
1956 | - /* Lite Room Floor */ | |
1957 | - case 2: | |
1958 | - { | |
1959 | - c_ptr->info |= (CAVE_GLOW); | |
1960 | - } | |
1548 | + /* The old "mark" flag */ | |
1549 | + if (tmp8u & (OLD_GRID_MARK)) c_ptr->info |= (CAVE_MARK); | |
1961 | 1550 | |
1962 | - /* Dark Room Floor */ | |
1963 | - case 1: | |
1964 | - { | |
1965 | - c_ptr->info |= (CAVE_ROOM); | |
1966 | - break; | |
1967 | - } | |
1551 | + /* The old "wall" flags -- granite wall */ | |
1552 | + if ((tmp8u & (OLD_GRID_WALL_MASK)) == | |
1553 | + OLD_GRID_WALL_GRANITE) | |
1554 | + { | |
1555 | + /* Permanent wall (assume "solid") XXX XXX XXX */ | |
1556 | + if (tmp8u & (OLD_GRID_PERM)) c_ptr->feat = FEAT_PERM_SOLID; | |
1968 | 1557 | |
1969 | - /* Lite Vault Floor */ | |
1970 | - case 4: | |
1971 | - { | |
1972 | - c_ptr->info |= (CAVE_GLOW); | |
1973 | - } | |
1558 | + /* Normal wall (assume "basic") XXX XXX XXX */ | |
1559 | + else c_ptr->feat = FEAT_WALL_EXTRA; | |
1560 | + } | |
1974 | 1561 | |
1975 | - /* Dark Vault Floor */ | |
1976 | - case 3: | |
1977 | - { | |
1978 | - c_ptr->info |= (CAVE_ROOM); | |
1979 | - c_ptr->info |= (CAVE_ICKY); | |
1980 | - break; | |
1981 | - } | |
1982 | - | |
1983 | - /* Corridor Floor */ | |
1984 | - case 5: | |
1985 | - { | |
1986 | - break; | |
1987 | - } | |
1988 | - | |
1989 | - /* Perma-wall (assume "solid") XXX XXX XXX */ | |
1990 | - case 15: | |
1991 | - { | |
1992 | - c_ptr->feat = FEAT_PERM_SOLID; | |
1993 | - break; | |
1994 | - } | |
1995 | - | |
1996 | - /* Granite wall (assume "basic") XXX XXX XXX */ | |
1997 | - case 12: | |
1998 | - { | |
1999 | - c_ptr->feat = FEAT_WALL_EXTRA; | |
2000 | - break; | |
2001 | - } | |
2002 | - | |
2003 | - /* Quartz vein */ | |
2004 | - case 13: | |
2005 | - { | |
2006 | - c_ptr->feat = FEAT_QUARTZ; | |
2007 | - break; | |
2008 | - } | |
2009 | - | |
2010 | - /* Magma vein */ | |
2011 | - case 14: | |
2012 | - { | |
2013 | - c_ptr->feat = FEAT_MAGMA; | |
2014 | - break; | |
2015 | - } | |
2016 | - } | |
1562 | + /* The old "wall" flags -- quartz vein */ | |
1563 | + else if ((tmp8u & (OLD_GRID_WALL_MASK)) == | |
1564 | + OLD_GRID_WALL_QUARTZ) | |
1565 | + { | |
1566 | + /* Assume no treasure */ | |
1567 | + c_ptr->feat = FEAT_QUARTZ; | |
2017 | 1568 | } |
2018 | 1569 | |
2019 | - /* Newer method */ | |
2020 | - else | |
1570 | + /* The old "wall" flags -- magma vein */ | |
1571 | + else if ((tmp8u & (OLD_GRID_WALL_MASK)) == | |
1572 | + OLD_GRID_WALL_MAGMA) | |
2021 | 1573 | { |
2022 | - /* The old "vault" flag */ | |
2023 | - if (tmp8u & (OLD_GRID_ICKY)) c_ptr->info |= (CAVE_ICKY); | |
2024 | - | |
2025 | - /* The old "room" flag */ | |
2026 | - if (tmp8u & (OLD_GRID_ROOM)) c_ptr->info |= (CAVE_ROOM); | |
2027 | - | |
2028 | - /* The old "glow" flag */ | |
2029 | - if (tmp8u & (OLD_GRID_GLOW)) c_ptr->info |= (CAVE_GLOW); | |
2030 | - | |
2031 | - /* The old "mark" flag */ | |
2032 | - if (tmp8u & (OLD_GRID_MARK)) c_ptr->info |= (CAVE_MARK); | |
2033 | - | |
2034 | - /* The old "wall" flags -- granite wall */ | |
2035 | - if ((tmp8u & (OLD_GRID_WALL_MASK)) == | |
2036 | - OLD_GRID_WALL_GRANITE) | |
2037 | - { | |
2038 | - /* Permanent wall (assume "solid") XXX XXX XXX */ | |
2039 | - if (tmp8u & (OLD_GRID_PERM)) c_ptr->feat = FEAT_PERM_SOLID; | |
2040 | - | |
2041 | - /* Normal wall (assume "basic") XXX XXX XXX */ | |
2042 | - else c_ptr->feat = FEAT_WALL_EXTRA; | |
2043 | - } | |
2044 | - | |
2045 | - /* The old "wall" flags -- quartz vein */ | |
2046 | - else if ((tmp8u & (OLD_GRID_WALL_MASK)) == | |
2047 | - OLD_GRID_WALL_QUARTZ) | |
2048 | - { | |
2049 | - /* Assume no treasure */ | |
2050 | - c_ptr->feat = FEAT_QUARTZ; | |
2051 | - } | |
2052 | - | |
2053 | - /* The old "wall" flags -- magma vein */ | |
2054 | - else if ((tmp8u & (OLD_GRID_WALL_MASK)) == | |
2055 | - OLD_GRID_WALL_MAGMA) | |
2056 | - { | |
2057 | - /* Assume no treasure */ | |
2058 | - c_ptr->feat = FEAT_MAGMA; | |
2059 | - } | |
1574 | + /* Assume no treasure */ | |
1575 | + c_ptr->feat = FEAT_MAGMA; | |
2060 | 1576 | } |
2061 | 1577 | |
2062 | 1578 | /* Advance the cave pointers */ |
@@ -2452,10 +1968,6 @@ | ||
2452 | 1968 | c_ptr->o_idx = o_idx; |
2453 | 1969 | } |
2454 | 1970 | |
2455 | - | |
2456 | - /* Extract index of first monster */ | |
2457 | - start = (older_than(2, 7, 7) ? 2 : 1); | |
2458 | - | |
2459 | 1971 | /* Read the monster count */ |
2460 | 1972 | rd_u16b(&limit); |
2461 | 1973 |
@@ -2472,7 +1984,7 @@ | ||
2472 | 1984 | } |
2473 | 1985 | |
2474 | 1986 | /* Read the monsters */ |
2475 | - for (i = start; i < limit; i++) | |
1987 | + for (i = 1; i < limit; i++) | |
2476 | 1988 | { |
2477 | 1989 | int m_idx; |
2478 | 1990 |
@@ -2584,10 +2096,7 @@ | ||
2584 | 2096 | base_level = dun_level; |
2585 | 2097 | |
2586 | 2098 | /* Read the base level */ |
2587 | - if (!z_older_than(2, 2, 2)) | |
2588 | - { | |
2589 | - rd_s16b(&base_level); | |
2590 | - } | |
2099 | + rd_s16b(&base_level); | |
2591 | 2100 | |
2592 | 2101 | rd_s16b(&num_repro); |
2593 | 2102 | rd_s16b(&py); |
@@ -2597,18 +2106,10 @@ | ||
2597 | 2106 | rd_s16b(&tmp16s); /* max_panel_rows */ |
2598 | 2107 | rd_s16b(&tmp16s); /* max_panel_cols */ |
2599 | 2108 | |
2600 | - /* Old method */ | |
2601 | - if (older_than(2, 8, 0)) | |
2602 | - { | |
2603 | - return (rd_dungeon_aux()); | |
2604 | - } | |
2605 | - | |
2606 | - | |
2607 | 2109 | /* Maximal size */ |
2608 | 2110 | ymax = cur_hgt; |
2609 | 2111 | xmax = cur_wid; |
2610 | 2112 | |
2611 | - | |
2612 | 2113 | /*** Run length decoding ***/ |
2613 | 2114 | |
2614 | 2115 | /* Load the dungeon data */ |
@@ -2670,66 +2171,62 @@ | ||
2670 | 2171 | } |
2671 | 2172 | } |
2672 | 2173 | |
2174 | + /*** Run length decoding ***/ | |
2673 | 2175 | |
2674 | - if (!z_older_than(2, 1, 3)) | |
2176 | + /* Load the dungeon data */ | |
2177 | + for (x = y = 0; y < ymax; ) | |
2675 | 2178 | { |
2676 | - /*** Run length decoding ***/ | |
2179 | + /* Grab RLE info */ | |
2180 | + rd_byte(&count); | |
2181 | + rd_byte(&tmp8u); | |
2677 | 2182 | |
2678 | - /* Load the dungeon data */ | |
2679 | - for (x = y = 0; y < ymax; ) | |
2183 | + /* Apply the RLE info */ | |
2184 | + for (i = count; i > 0; i--) | |
2680 | 2185 | { |
2681 | - /* Grab RLE info */ | |
2682 | - rd_byte(&count); | |
2683 | - rd_byte(&tmp8u); | |
2186 | + /* Access the cave */ | |
2187 | + c_ptr = &cave[y][x]; | |
2684 | 2188 | |
2685 | - /* Apply the RLE info */ | |
2686 | - for (i = count; i > 0; i--) | |
2189 | + /* Extract "feat" */ | |
2190 | + c_ptr->mimic = tmp8u; | |
2191 | + | |
2192 | + /* Advance/Wrap */ | |
2193 | + if (++x >= xmax) | |
2687 | 2194 | { |
2688 | - /* Access the cave */ | |
2689 | - c_ptr = &cave[y][x]; | |
2195 | + /* Wrap */ | |
2196 | + x = 0; | |
2690 | 2197 | |
2691 | - /* Extract "feat" */ | |
2692 | - c_ptr->mimic = tmp8u; | |
2693 | - | |
2694 | 2198 | /* Advance/Wrap */ |
2695 | - if (++x >= xmax) | |
2696 | - { | |
2697 | - /* Wrap */ | |
2698 | - x = 0; | |
2699 | - | |
2700 | - /* Advance/Wrap */ | |
2701 | - if (++y >= ymax) break; | |
2702 | - } | |
2199 | + if (++y >= ymax) break; | |
2703 | 2200 | } |
2704 | 2201 | } |
2202 | + } | |
2705 | 2203 | |
2706 | - /*** Run length decoding ***/ | |
2204 | + /*** Run length decoding ***/ | |
2707 | 2205 | |
2708 | - /* Load the dungeon data */ | |
2709 | - for (x = y = 0; y < ymax; ) | |
2206 | + /* Load the dungeon data */ | |
2207 | + for (x = y = 0; y < ymax; ) | |
2208 | + { | |
2209 | + /* Grab RLE info */ | |
2210 | + rd_byte(&count); | |
2211 | + rd_s16b(&tmp16s); | |
2212 | + | |
2213 | + /* Apply the RLE info */ | |
2214 | + for (i = count; i > 0; i--) | |
2710 | 2215 | { |
2711 | - /* Grab RLE info */ | |
2712 | - rd_byte(&count); | |
2713 | - rd_s16b(&tmp16s); | |
2216 | + /* Access the cave */ | |
2217 | + c_ptr = &cave[y][x]; | |
2714 | 2218 | |
2715 | - /* Apply the RLE info */ | |
2716 | - for (i = count; i > 0; i--) | |
2219 | + /* Extract "feat" */ | |
2220 | + c_ptr->special = tmp16s; | |
2221 | + | |
2222 | + /* Advance/Wrap */ | |
2223 | + if (++x >= xmax) | |
2717 | 2224 | { |
2718 | - /* Access the cave */ | |
2719 | - c_ptr = &cave[y][x]; | |
2225 | + /* Wrap */ | |
2226 | + x = 0; | |
2720 | 2227 | |
2721 | - /* Extract "feat" */ | |
2722 | - c_ptr->special = tmp16s; | |
2723 | - | |
2724 | 2228 | /* Advance/Wrap */ |
2725 | - if (++x >= xmax) | |
2726 | - { | |
2727 | - /* Wrap */ | |
2728 | - x = 0; | |
2729 | - | |
2730 | - /* Advance/Wrap */ | |
2731 | - if (++y >= ymax) break; | |
2732 | - } | |
2229 | + if (++y >= ymax) break; | |
2733 | 2230 | } |
2734 | 2231 | } |
2735 | 2232 | } |
@@ -2880,8 +2377,8 @@ | ||
2880 | 2377 | |
2881 | 2378 | /*** Success ***/ |
2882 | 2379 | |
2883 | - /* Regenerate the dungeon for old savefiles and corrupted panic-saves */ | |
2884 | - if (z_older_than(2, 1, 3) || (py == 0) || (px == 0)) | |
2380 | + /* Regenerate the dungeon for corrupted panic-saves */ | |
2381 | + if ((py == 0) || (px == 0)) | |
2885 | 2382 | { |
2886 | 2383 | character_dungeon = FALSE; |
2887 | 2384 | } |
@@ -2927,19 +2424,6 @@ | ||
2927 | 2424 | |
2928 | 2425 | k_major, k_minor, k_patch)); |
2929 | 2426 | |
2930 | - | |
2931 | - /* Hack -- Warn about "obsolete" versions */ | |
2932 | - if (older_than(2, 7, 4)) | |
2933 | - { | |
2934 | -#ifdef JP | |
2935 | -note("警告 -- 旧式のセーブ・ファイルを変換しています。"); | |
2936 | -#else | |
2937 | - note("Warning -- converting obsolete save file."); | |
2938 | -#endif | |
2939 | - | |
2940 | - } | |
2941 | - | |
2942 | - | |
2943 | 2427 | /* Strip the version bytes */ |
2944 | 2428 | strip_bytes(4); |
2945 | 2429 |
@@ -2953,9 +2437,7 @@ | ||
2953 | 2437 | |
2954 | 2438 | #if SAVEFILE_VERSION |
2955 | 2439 | /* Read the version number of the savefile */ |
2956 | - if (!z_older_than(2, 2, 8) && | |
2957 | - !(z_major == 2 && z_minor == 3 && z_patch == 0)) | |
2958 | - rd_u32b(&sf_version); | |
2440 | + rd_u32b(&sf_version); | |
2959 | 2441 | #endif /* SAVEFILE_VERSION */ |
2960 | 2442 | |
2961 | 2443 | /* Operating system info */ |
@@ -2996,11 +2478,6 @@ | ||
2996 | 2478 | if (arg_fiddle) note("Loaded Option Flags"); |
2997 | 2479 | #endif |
2998 | 2480 | |
2999 | - | |
3000 | - /* Switch streams on for old savefiles */ | |
3001 | - if (z_older_than(2, 2, 7)) | |
3002 | - terrain_streams = TRUE; | |
3003 | - | |
3004 | 2481 | /* |
3005 | 2482 | * Munchkin players are marked |
3006 | 2483 | * |
@@ -3047,49 +2524,8 @@ | ||
3047 | 2524 | |
3048 | 2525 | /* Access that monster */ |
3049 | 2526 | r_ptr = &r_info[i]; |
3050 | - | |
3051 | - /* XXX XXX Hack -- repair old savefiles */ | |
3052 | - if (older_than(2, 7, 6)) | |
3053 | - { | |
3054 | - /* Assume no kills */ | |
3055 | - r_ptr->r_pkills = 0; | |
3056 | - | |
3057 | - /* Hack -- no previous lives */ | |
3058 | - if (sf_lives == 0) | |
3059 | - { | |
3060 | - /* All kills by this life */ | |
3061 | - r_ptr->r_pkills = r_ptr->r_tkills; | |
3062 | - } | |
3063 | - | |
3064 | - /* Hack -- handle uniques */ | |
3065 | - if (r_ptr->flags1 & (RF1_UNIQUE)) | |
3066 | - { | |
3067 | - /* Assume no kills */ | |
3068 | - r_ptr->r_pkills = 0; | |
3069 | - | |
3070 | - /* Handle dead uniques */ | |
3071 | - if (r_ptr->max_num == 0) r_ptr->r_pkills = 1; | |
3072 | - } | |
3073 | - } | |
3074 | 2527 | } |
3075 | 2528 | |
3076 | - /* Pre 2.2.0 version (old r_info.txt) */ | |
3077 | - if (z_older_than(2, 2, 0)) | |
3078 | - { | |
3079 | - monster_race *r_ptr; | |
3080 | - | |
3081 | - for (i = 0; i < max_r_idx; i++) | |
3082 | - { | |
3083 | - /* Access that monster */ | |
3084 | - r_ptr = &r_info[i]; | |
3085 | - | |
3086 | - /* Hack -- Reset the death counter */ | |
3087 | - r_ptr->max_num = 100; | |
3088 | - if (r_ptr->flags1 & RF1_UNIQUE) r_ptr->max_num = 1; | |
3089 | - if (r_ptr->flags3 & RF3_UNIQUE_7) r_ptr->max_num = 7; | |
3090 | - } | |
3091 | - } | |
3092 | - | |
3093 | 2529 | #ifdef JP |
3094 | 2530 | if (arg_fiddle) note("モンスターの思い出をロードしました"); |
3095 | 2531 | #else |
@@ -3156,22 +2592,14 @@ | ||
3156 | 2592 | } |
3157 | 2593 | |
3158 | 2594 | /* 2.1.3 or newer version */ |
3159 | - if (!z_older_than(2, 1, 3)) | |
3160 | 2595 | { |
3161 | 2596 | u16b max_towns_load; |
3162 | 2597 | u16b max_quests_load; |
2598 | + byte max_rquests_load; | |
3163 | 2599 | |
3164 | 2600 | /* Number of towns */ |
3165 | 2601 | rd_u16b(&max_towns_load); |
3166 | 2602 | |
3167 | - /* 2.2.2 or older version */ | |
3168 | - if (z_older_than(2, 2, 3)) | |
3169 | - { | |
3170 | - /* Ignore higher numbers of towns */ | |
3171 | - if (max_towns_load > max_towns) | |
3172 | - max_towns_load = max_towns; | |
3173 | - } | |
3174 | - | |
3175 | 2603 | /* Incompatible save files */ |
3176 | 2604 | if (max_towns_load > max_towns) |
3177 | 2605 | { |
@@ -3187,20 +2615,25 @@ | ||
3187 | 2615 | /* Number of quests */ |
3188 | 2616 | rd_u16b(&max_quests_load); |
3189 | 2617 | |
3190 | - /* 2.2.3 or newer version */ | |
3191 | - if (!z_older_than(2, 2, 3)) | |
2618 | + if (k_older_than(0, 1, 5)) | |
3192 | 2619 | { |
3193 | - /* Incompatible save files */ | |
3194 | - if (max_quests_load > max_quests) | |
3195 | - { | |
2620 | + max_rquests_load = 10; | |
2621 | + } | |
2622 | + else | |
2623 | + { | |
2624 | + rd_byte(&max_rquests_load); | |
2625 | + } | |
2626 | + | |
2627 | + /* Incompatible save files */ | |
2628 | + if (max_quests_load > max_quests) | |
2629 | + { | |
3196 | 2630 | #ifdef JP |
3197 | -note(format("クエストが多すぎる(%u)!", max_quests_load)); | |
2631 | + note(format("クエストが多すぎる(%u)!", max_quests_load)); | |
3198 | 2632 | #else |
3199 | - note(format("Too many (%u) quests!", max_quests_load)); | |
2633 | + note(format("Too many (%u) quests!", max_quests_load)); | |
3200 | 2634 | #endif |
3201 | 2635 | |
3202 | - return (23); | |
3203 | - } | |
2636 | + return (23); | |
3204 | 2637 | } |
3205 | 2638 | |
3206 | 2639 | for (i = 0; i < max_quests_load; i++) |
@@ -3208,49 +2641,69 @@ | ||
3208 | 2641 | if (i < max_quests) |
3209 | 2642 | { |
3210 | 2643 | rd_s16b(&quest[i].status); |
2644 | + rd_s16b(&quest[i].level); | |
3211 | 2645 | |
3212 | - if (!z_older_than(2, 2, 0)) | |
2646 | + if (k_older_than(0, 1, 5)) | |
3213 | 2647 | { |
3214 | - rd_s16b(&quest[i].level); | |
2648 | + quest[i].complev = 0; | |
3215 | 2649 | } |
2650 | + else | |
2651 | + { | |
2652 | + rd_byte(&quest[i].complev); | |
2653 | + } | |
3216 | 2654 | |
3217 | 2655 | /* Load quest status if quest is running */ |
3218 | - if (quest[i].status == QUEST_STATUS_TAKEN) | |
2656 | + if (quest[i].status == QUEST_STATUS_TAKEN | |
2657 | + || (quest[i].status == QUEST_STATUS_COMPLETED) | |
2658 | + || (!k_older_than(0, 1, 5) && (i >= MIN_RANDOM_QUEST) && (i <= (MIN_RANDOM_QUEST + max_rquests_load)))) | |
3219 | 2659 | { |
3220 | 2660 | rd_s16b(&quest[i].cur_num); |
3221 | 2661 | rd_s16b(&quest[i].max_num); |
3222 | 2662 | rd_s16b(&quest[i].type); |
3223 | 2663 | |
3224 | - if (z_older_than(2, 2, 0)) | |
3225 | - { | |
3226 | - strip_bytes(2); | |
3227 | - } | |
3228 | - | |
3229 | 2664 | /* Load quest monster index */ |
3230 | 2665 | rd_s16b(&quest[i].r_idx); |
3231 | 2666 | |
3232 | - /* Load quest item index */ | |
3233 | - if (!z_older_than(2, 2, 1)) | |
2667 | + if ((quest[i].type == QUEST_TYPE_RANDOM) && (!quest[i].r_idx)) | |
3234 | 2668 | { |
3235 | - rd_s16b(&quest[i].k_idx); | |
2669 | + int r_idx; | |
2670 | + while (1) | |
2671 | + { | |
2672 | + monster_race *r_ptr; | |
3236 | 2673 | |
3237 | - if (quest[i].k_idx) | |
3238 | - a_info[quest[i].k_idx].flags3 |= TR3_QUESTITEM; | |
2674 | + /* | |
2675 | + * Random monster 5 - 10 levels out of depth | |
2676 | + * (depending on level) | |
2677 | + */ | |
2678 | + r_idx = get_mon_num(quest[i].level + 5 + randint1(quest[i].level / 10)); | |
2679 | + r_ptr = &r_info[r_idx]; | |
2680 | + | |
2681 | + if(!(r_ptr->flags1 & RF1_UNIQUE)) continue; | |
2682 | + | |
2683 | + if (r_ptr->flags1 & RF1_QUESTOR) continue; | |
2684 | + | |
2685 | + /* | |
2686 | + * Accept monsters that are 2 - 6 levels | |
2687 | + * out of depth depending on the quest level | |
2688 | + */ | |
2689 | + if (r_ptr->level > (quest[i].level + (quest[i].level / 20))) break; | |
2690 | + } | |
2691 | + | |
2692 | + quest[i].r_idx = r_idx; | |
3239 | 2693 | } |
3240 | 2694 | |
2695 | + /* Load quest item index */ | |
2696 | + rd_s16b(&quest[i].k_idx); | |
2697 | + | |
2698 | + if (quest[i].k_idx) | |
2699 | + a_info[quest[i].k_idx].flags3 |= TR3_QUESTITEM; | |
2700 | + | |
3241 | 2701 | /* Load quest flags */ |
3242 | - if (!z_older_than(2, 2, 3)) | |
3243 | - { | |
3244 | - rd_byte(&quest[i].flags); | |
3245 | - } | |
2702 | + rd_byte(&quest[i].flags); | |
3246 | 2703 | |
3247 | - if (z_older_than(2, 2, 0)) | |
3248 | - { | |
3249 | - strip_bytes(40); | |
3250 | - } | |
3251 | - | |
3252 | 2704 | /* Mark uniques */ |
3253 | - if (r_info[quest[i].r_idx].flags1 & RF1_UNIQUE) | |
2705 | + if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_UNTAKEN) | |
2706 | + if (r_info[quest[i].r_idx].flags1 & RF1_UNIQUE) | |
3254 | 2707 | r_info[quest[i].r_idx].flags1 |= RF1_QUESTOR; |
3255 | 2708 | } |
3256 | 2709 | } |
@@ -3261,10 +2714,7 @@ | ||
3261 | 2714 | strip_bytes(2); |
3262 | 2715 | |
3263 | 2716 | /* Ignore quest level */ |
3264 | - if (!z_older_than(2, 2, 0)) | |
3265 | - { | |
3266 | - strip_bytes(2); | |
3267 | - } | |
2717 | + strip_bytes(2); | |
3268 | 2718 | |
3269 | 2719 | /* |
3270 | 2720 | * We don't have to care about the other info, |
@@ -3273,33 +2723,6 @@ | ||
3273 | 2723 | } |
3274 | 2724 | } |
3275 | 2725 | |
3276 | -#if 0 | |
3277 | - /* Only in 2.2.1 and 2.2.2 */ | |
3278 | - if (!z_older_than(2, 2, 1) && z_older_than(2, 2, 3)) | |
3279 | - { | |
3280 | - /* "Hard quests" flag */ | |
3281 | - rd_byte(&ironman_hard_quests); | |
3282 | - | |
3283 | - /****** HACK ******/ | |
3284 | - if (ironman_hard_quests) | |
3285 | - { | |
3286 | - /* Set the option by hand */ | |
3287 | - option_flag[6] |= (1L << 6); | |
3288 | - } | |
3289 | - | |
3290 | - /* Inverted "Wilderness" flag */ | |
3291 | - rd_byte(&lite_town); | |
3292 | - lite_town = !lite_town; | |
3293 | - | |
3294 | - /****** HACK ******/ | |
3295 | - if (lite_town) | |
3296 | - { | |
3297 | - /* Set the option by hand */ | |
3298 | - option_flag[6] |= (1L << 1); | |
3299 | - } | |
3300 | - } | |
3301 | -#endif | |
3302 | - | |
3303 | 2726 | /* Position in the wilderness */ |
3304 | 2727 | rd_s32b(&p_ptr->wilderness_x); |
3305 | 2728 | rd_s32b(&p_ptr->wilderness_y); |
@@ -3329,373 +2752,13 @@ | ||
3329 | 2752 | } |
3330 | 2753 | } |
3331 | 2754 | } |
3332 | - /* rr9: Load old savegame without the quest infos */ | |
3333 | - else if (z_older_than(2, 1, 1)) | |
3334 | - { | |
3335 | - /* Load the number of quests */ | |
3336 | - rd_u16b(&tmp16u); | |
3337 | 2755 | |
3338 | - /* Ignore all infos */ | |
3339 | - for (i = 0; i < tmp16u; i++) | |
3340 | - { | |
3341 | - strip_bytes(4); | |
3342 | - } | |
3343 | - } | |
3344 | - /* rr9: Load 2.1.1 savegame quest infos */ | |
3345 | - else if (z_older_than(2, 1, 2)) | |
3346 | - { | |
3347 | - /* Load the number of quests */ | |
3348 | - rd_u16b(&tmp16u); | |
3349 | - | |
3350 | - j = tmp16u; | |
3351 | - | |
3352 | - /* Ignore the quests */ | |
3353 | - for (i = 0; i < j; i++) | |
3354 | - { | |
3355 | - strip_bytes(5); | |
3356 | - } | |
3357 | - } | |
3358 | - /* 2.1.2 beta version */ | |
3359 | - else if (z_older_than(2, 1, 3)) | |
3360 | - { | |
3361 | - /* Load the number of quests */ | |
3362 | - rd_u16b(&tmp16u); | |
3363 | - | |
3364 | - /* Incompatible save files */ | |
3365 | - if (tmp16u > 20) | |
3366 | - { | |
3367 | 2756 | #ifdef JP |
3368 | -note(format("クエストが多すぎる(%u)!", tmp16u)); | |
3369 | -#else | |
3370 | - note(format("Too many (%u) quests!", tmp16u)); | |
3371 | -#endif | |
3372 | - | |
3373 | - return (23); | |
3374 | - } | |
3375 | - | |
3376 | - /* Load the quest information */ | |
3377 | - for (i = 0; i < tmp16u; i++) | |
3378 | - { | |
3379 | - /* Throw it away */ | |
3380 | - strip_bytes(14); | |
3381 | - } | |
3382 | - } | |
3383 | - | |
3384 | - /* | |
3385 | - * Select the number of random quests | |
3386 | - * when importing old savefiles. | |
3387 | - */ | |
3388 | - if (z_older_than(2, 2, 0)) | |
3389 | - { | |
3390 | - char inp[80]; | |
3391 | - int i, v; | |
3392 | - | |
3393 | - /* Wipe the quests */ | |
3394 | - for (i = 0; i < max_quests; i++) | |
3395 | - { | |
3396 | - quest[i].status = QUEST_STATUS_UNTAKEN; | |
3397 | - | |
3398 | - quest[i].cur_num = 0; | |
3399 | - quest[i].max_num = 0; | |
3400 | - quest[i].type = 0; | |
3401 | - quest[i].level = 0; | |
3402 | - quest[i].r_idx = 0; | |
3403 | - } | |
3404 | - | |
3405 | - /* Clean up */ | |
3406 | - clear_from(10); | |
3407 | - | |
3408 | - /*** User enters number of quests ***/ | |
3409 | - /* Heino Vander Sanden and Jimmy De Laet */ | |
3410 | - | |
3411 | - /* Extra info */ | |
3412 | - Term_putstr(5, 15, -1, TERM_WHITE, | |
3413 | -#ifdef JP | |
3414 | -"必須のクエスト(オベロン及び混沌の邪龍)に加えて、追加のクエストの"); | |
3415 | -#else | |
3416 | - "You can input yourself the number of quest you'd like to"); | |
3417 | -#endif | |
3418 | - | |
3419 | - Term_putstr(5, 16, -1, TERM_WHITE, | |
3420 | -#ifdef JP | |
3421 | -"数を設定することが出来ます。"); | |
3422 | -#else | |
3423 | - "perform next to two obligatory ones ( Oberon and the Serpent of Chaos )"); | |
3424 | -#endif | |
3425 | - | |
3426 | - Term_putstr(5, 17, -1, TERM_WHITE, | |
3427 | -#ifdef JP | |
3428 | -"追加クエストを行ないたくない場合は '0'を入力して下さい。"); | |
3429 | -#else | |
3430 | - "In case you do not want any additional quest, just enter 0"); | |
3431 | -#endif | |
3432 | - | |
3433 | - | |
3434 | - /* Ask the number of additional quests */ | |
3435 | - while (TRUE) | |
3436 | - { | |
3437 | -#ifdef JP | |
3438 | -put_str(format("追加クエストの数 (%u以下) ", MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 2), 20, 2); | |
3439 | -#else | |
3440 | - put_str(format("Number of additional quest? (<%u) ", MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 2), 20, 2); | |
3441 | -#endif | |
3442 | - | |
3443 | - | |
3444 | - /* Get a the number of additional quest */ | |
3445 | - while (TRUE) | |
3446 | - { | |
3447 | - /* Move the cursor */ | |
3448 | - put_str("", 20, 37); | |
3449 | - | |
3450 | - /* Default */ | |
3451 | - strcpy(inp, "20"); | |
3452 | - | |
3453 | - /* Get a response (or escape) */ | |
3454 | - if (!askfor_aux(inp, 2)) inp[0] = '\0'; | |
3455 | - v = atoi(inp); | |
3456 | - | |
3457 | - /* Break on valid input */ | |
3458 | - if ((v <= MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 1) && (v >= 0)) break; | |
3459 | - } | |
3460 | - break; | |
3461 | - } | |
3462 | - | |
3463 | - /* Clear */ | |
3464 | - clear_from(15); | |
3465 | - | |
3466 | - /* Init the random quests */ | |
3467 | - init_flags = INIT_ASSIGN; | |
3468 | - p_ptr->inside_quest = MIN_RANDOM_QUEST; | |
3469 | -#ifdef JP | |
3470 | - process_dungeon_file("q_info_j.txt", 0, 0, 0, 0); | |
3471 | -#else | |
3472 | - process_dungeon_file("q_info.txt", 0, 0, 0, 0); | |
3473 | -#endif | |
3474 | - | |
3475 | - p_ptr->inside_quest = 0; | |
3476 | - | |
3477 | - /* Prepare allocation table */ | |
3478 | - get_mon_num_prep(monster_quest, NULL); | |
3479 | - | |
3480 | - /* Generate quests */ | |
3481 | - for (i = MIN_RANDOM_QUEST + v - 1; i >= MIN_RANDOM_QUEST; i--) | |
3482 | - { | |
3483 | - quest_type *q_ptr = &quest[i]; | |
3484 | - monster_race *r_ptr = NULL; | |
3485 | - | |
3486 | - q_ptr->status = QUEST_STATUS_TAKEN; | |
3487 | - | |
3488 | - for (j = 0; j < MAX_TRIES; j++) | |
3489 | - { | |
3490 | - /* Random monster 5 - 10 levels out of depth */ | |
3491 | - q_ptr->r_idx = get_mon_num(q_ptr->level + 4 + randint(6)); | |
3492 | - | |
3493 | - r_ptr = &r_info[q_ptr->r_idx]; | |
3494 | - | |
3495 | - /* Accept only monsters that are out of depth */ | |
3496 | - if (r_ptr->level > q_ptr->level) break; | |
3497 | - } | |
3498 | - | |
3499 | - /* Get the number of monsters */ | |
3500 | - if (r_ptr->flags1 & RF1_UNIQUE) | |
3501 | - { | |
3502 | - /* Mark uniques */ | |
3503 | - r_ptr->flags1 |= RF1_QUESTOR; | |
3504 | - | |
3505 | - q_ptr->max_num = 1; | |
3506 | - } | |
3507 | - else | |
3508 | - { | |
3509 | - q_ptr->max_num = 5 + (s16b)rand_int(q_ptr->level/3 + 5); | |
3510 | - } | |
3511 | - } | |
3512 | - | |
3513 | - /* Init the two main quests (Oberon + Serpent) */ | |
3514 | - init_flags = INIT_ASSIGN; | |
3515 | - p_ptr->inside_quest = QUEST_OBERON; | |
3516 | -#ifdef JP | |
3517 | - process_dungeon_file("q_info_j.txt", 0, 0, 0, 0); | |
3518 | -#else | |
3519 | - process_dungeon_file("q_info.txt", 0, 0, 0, 0); | |
3520 | -#endif | |
3521 | - | |
3522 | - quest[QUEST_OBERON].status = QUEST_STATUS_TAKEN; | |
3523 | - | |
3524 | - p_ptr->inside_quest = QUEST_SERPENT; | |
3525 | -#ifdef JP | |
3526 | - process_dungeon_file("q_info_j.txt", 0, 0, 0, 0); | |
3527 | -#else | |
3528 | - process_dungeon_file("q_info.txt", 0, 0, 0, 0); | |
3529 | -#endif | |
3530 | - | |
3531 | - quest[QUEST_SERPENT].status = QUEST_STATUS_TAKEN; | |
3532 | - p_ptr->inside_quest = 0; | |
3533 | - } | |
3534 | - | |
3535 | -#if 0 | |
3536 | - /* | |
3537 | - * Select 'hard random quests mode' | |
3538 | - * when importing old savefiles. | |
3539 | - */ | |
3540 | - if (z_older_than(2, 2, 1)) | |
3541 | - { | |
3542 | - char c; | |
3543 | - | |
3544 | - /* Clear */ | |
3545 | - clear_from(15); | |
3546 | - | |
3547 | - /*** Hard quests mode ***/ | |
3548 | - | |
3549 | - /* Extra info */ | |
3550 | - Term_putstr(5, 14, -1, TERM_WHITE, | |
3551 | -#ifdef JP | |
3552 | -"「ハード・クエスト」をオンにすると、追加クエストは難易度が"); | |
3553 | -#else | |
3554 | - "Using 'hard quests' mode makes the random quests harder, because"); | |
3555 | -#endif | |
3556 | - | |
3557 | - Term_putstr(5, 15, -1, TERM_WHITE, | |
3558 | -#ifdef JP | |
3559 | -"上がります。全てのモンスターを他の階に行くことなく一度に倒さねば"); | |
3560 | -#else | |
3561 | - "you have to kill all monsters at the same visit to the quest level."); | |
3562 | -#endif | |
3563 | - | |
3564 | - Term_putstr(5, 16, -1, TERM_WHITE, | |
3565 | -#ifdef JP | |
3566 | -"ならないからです。全てのモンスターを倒さずにその階を一度離れて"); | |
3567 | -#else | |
3568 | - "If you leave the level while some quest monsters are still alive,"); | |
3569 | -#endif | |
3570 | - | |
3571 | - Term_putstr(5, 17, -1, TERM_WHITE, | |
3572 | -#ifdef JP | |
3573 | -"から戻ってくると、倒したモンスターはすべて復活します。"); | |
3574 | -#else | |
3575 | - "then all killed quest monsters are revived on your next visit"); | |
3576 | -#endif | |
3577 | - | |
3578 | - Term_putstr(5, 18, -1, TERM_WHITE, | |
3579 | -#ifdef JP | |
3580 | -""); | |
3581 | -#else | |
3582 | - "to this level."); | |
3583 | -#endif | |
3584 | - | |
3585 | - | |
3586 | - /* Ask about "hard quests" mode */ | |
3587 | - while (1) | |
3588 | - { | |
3589 | -#ifdef JP | |
3590 | -put_str("「ハード・クエスト」をオンにしますか?(y/n/*)", 20, 2); | |
3591 | -#else | |
3592 | - put_str("Use 'Hard quests'? (y/n/*) ", 20, 2); | |
3593 | -#endif | |
3594 | - | |
3595 | - c = inkey(); | |
3596 | - if (c == 'Q') quit(NULL); | |
3597 | - if (c == 'S') return (FALSE); | |
3598 | - if (c == '*') | |
3599 | - { | |
3600 | - c = 'y'; | |
3601 | - if (randint(2) == 1) | |
3602 | - c = 'n'; | |
3603 | - break; | |
3604 | - } | |
3605 | - if (c == ESCAPE) break; | |
3606 | - if ((c == 'y') || (c == 'n')) break; | |
3607 | - if (c == '?') do_cmd_help(); | |
3608 | - else bell(); | |
3609 | - } | |
3610 | - | |
3611 | - /* Set "hard quests" mode */ | |
3612 | - ironman_hard_quests = (c == 'y'); | |
3613 | - | |
3614 | - /* Clear */ | |
3615 | - clear_from(15); | |
3616 | - } | |
3617 | -#endif | |
3618 | - | |
3619 | -#ifdef JP | |
3620 | 2757 | if (arg_fiddle) note("クエスト情報をロードしました"); |
3621 | 2758 | #else |
3622 | 2759 | if (arg_fiddle) note("Loaded Quests"); |
3623 | 2760 | #endif |
3624 | 2761 | |
3625 | - | |
3626 | - /* A version without the wilderness */ | |
3627 | - if (z_older_than(2, 1, 2)) | |
3628 | - { | |
3629 | - char c; | |
3630 | - | |
3631 | - /* Clear */ | |
3632 | - clear_from(14); | |
3633 | - | |
3634 | - /*** Wilderness mode ***/ | |
3635 | - | |
3636 | - /* Extra info */ | |
3637 | - Term_putstr(5, 14, -1, TERM_WHITE, | |
3638 | -#ifdef JP | |
3639 | -"「荒野」モードでは、Zangband で追加された街の外の荒野といくつかの"); | |
3640 | -#else | |
3641 | - "'Wilderness' mode enables the extended wilderness of ZAngband"); | |
3642 | -#endif | |
3643 | - | |
3644 | - Term_putstr(5, 15, -1, TERM_WHITE, | |
3645 | -#ifdef JP | |
3646 | -"新しい街を探索することができます。「荒野」モードは若干重いので、"); | |
3647 | -#else | |
3648 | - "giving you a wilderness and several new towns to explore."); | |
3649 | -#endif | |
3650 | - | |
3651 | - Term_putstr(5, 16, -1, TERM_WHITE, | |
3652 | -#ifdef JP | |
3653 | -"コンピューターのパワーがない場合は使用しないことを"); | |
3654 | -#else | |
3655 | - "Switching off 'wilderness' mode is recommended for slower computers,"); | |
3656 | -#endif | |
3657 | - | |
3658 | - Term_putstr(5, 17, -1, TERM_WHITE, | |
3659 | -#ifdef JP | |
3660 | -"お勧めします。"); | |
3661 | -#else | |
3662 | - "because the wilderness slows down the system a bit."); | |
3663 | -#endif | |
3664 | - | |
3665 | - | |
3666 | - /* Ask about "wilderness" mode */ | |
3667 | - while (1) | |
3668 | - { | |
3669 | -#ifdef JP | |
3670 | -put_str("「荒野」を使用しますか?(y/n/*)", 20, 2); | |
3671 | -#else | |
3672 | - put_str("Use 'wilderness'? (y/n/*) ", 20, 2); | |
3673 | -#endif | |
3674 | - | |
3675 | - c = inkey(); | |
3676 | - if (c == 'Q') quit(NULL); | |
3677 | - if (c == 'S') return (FALSE); | |
3678 | - if (c == '*') | |
3679 | - { | |
3680 | - c = 'y'; | |
3681 | - if (randint(2) == 1) | |
3682 | - c = 'n'; | |
3683 | - break; | |
3684 | - } | |
3685 | - if (c == ESCAPE) break; | |
3686 | - if ((c == 'y') || (c == 'n')) break; | |
3687 | - if (c == '?') do_cmd_help(); | |
3688 | - else bell(); | |
3689 | - } | |
3690 | - | |
3691 | - /* Set "wilderness" mode */ | |
3692 | - lite_town = (c == 'y'); | |
3693 | - | |
3694 | - /* Clear */ | |
3695 | - clear_from(14); | |
3696 | - } | |
3697 | - | |
3698 | - | |
3699 | 2762 | /* Load the Artifacts */ |
3700 | 2763 | rd_u16b(&tmp16u); |
3701 | 2764 |
@@ -3798,52 +2861,19 @@ | ||
3798 | 2861 | } |
3799 | 2862 | |
3800 | 2863 | /* Read number of towns */ |
3801 | - if (!z_older_than(2, 1, 3)) | |
3802 | - { | |
3803 | - rd_u16b(&tmp16u); | |
3804 | - town_count = tmp16u; | |
3805 | - } | |
3806 | - else | |
3807 | - { | |
3808 | - /* Only one town */ | |
3809 | - town_count = 2; | |
3810 | - } | |
2864 | + rd_u16b(&tmp16u); | |
2865 | + town_count = tmp16u; | |
3811 | 2866 | |
3812 | 2867 | /* Read the stores */ |
3813 | 2868 | rd_u16b(&tmp16u); |
3814 | 2869 | for (i = 1; i < town_count; i++) |
3815 | 2870 | { |
3816 | - /* HACK - ignore the empty towns */ | |
3817 | - if (z_older_than(2, 2, 3) && (i >= 6)) | |
2871 | + for (j = 0; j < tmp16u; j++) | |
3818 | 2872 | { |
3819 | - for (j = 0; j < tmp16u; j++) | |
3820 | - { | |
3821 | - /* Read the info into the empty town 5 (R'Lyeh) */ | |
3822 | - if (rd_store(5, j)) return (22); | |
3823 | - } | |
2873 | + if (rd_store(i, j)) return (22); | |
3824 | 2874 | } |
3825 | - else | |
3826 | - { | |
3827 | - for (j = 0; j < tmp16u; j++) | |
3828 | - { | |
3829 | - if (rd_store(i, j)) return (22); | |
3830 | - } | |
3831 | - } | |
3832 | 2875 | } |
3833 | 2876 | |
3834 | -#if 0 | |
3835 | - if (z_older_than(2, 1, 0)) | |
3836 | - { | |
3837 | -#ifdef JP | |
3838 | -msg_print("フレーバー再配置中..."); | |
3839 | -#else | |
3840 | - msg_print("Reallocating flavours..."); | |
3841 | -#endif | |
3842 | - | |
3843 | - flavor_init(); | |
3844 | - } | |
3845 | -#endif | |
3846 | - | |
3847 | 2877 | /* Read the pet command settings */ |
3848 | 2878 | if (sf_version > 2) |
3849 | 2879 | { |
@@ -3851,7 +2881,7 @@ | ||
3851 | 2881 | rd_byte(&p_ptr->pet_open_doors); |
3852 | 2882 | rd_byte(&p_ptr->pet_pickup_items); |
3853 | 2883 | } |
3854 | - else if (!z_older_than(2, 2, 3)) | |
2884 | + else | |
3855 | 2885 | { |
3856 | 2886 | rd_byte(&tmp8u); |
3857 | 2887 |
@@ -3860,13 +2890,6 @@ | ||
3860 | 2890 | rd_byte(&p_ptr->pet_open_doors); |
3861 | 2891 | rd_byte(&p_ptr->pet_pickup_items); |
3862 | 2892 | } |
3863 | - else | |
3864 | - { | |
3865 | - /* Default pet command settings */ | |
3866 | - p_ptr->pet_follow_distance = PET_FOLLOW_DIST; | |
3867 | - p_ptr->pet_open_doors = FALSE; | |
3868 | - p_ptr->pet_pickup_items = FALSE; | |
3869 | - } | |
3870 | 2893 | |
3871 | 2894 | /* I'm not dead yet... */ |
3872 | 2895 | if (!death) |
@@ -3892,22 +2915,11 @@ | ||
3892 | 2915 | /* Read the ghost info */ |
3893 | 2916 | rd_ghost(); |
3894 | 2917 | |
3895 | - if (!z_older_than(2, 2, 4)) | |
3896 | 2918 | { |
3897 | 2919 | s32b tmp32s; |
3898 | 2920 | |
3899 | 2921 | rd_s32b(&tmp32s); |
3900 | -#ifdef USE_SCRIPT | |
3901 | - if (tmp32s) | |
3902 | - { | |
3903 | - char *callbacks = (char*) malloc(tmp32s + 1); | |
3904 | - rd_string(callbacks, tmp32s + 1); | |
3905 | - callbacks_load_callback(callbacks); | |
3906 | - free(callbacks); | |
3907 | - } | |
3908 | -#else /* USE_SCRIPT */ | |
3909 | 2922 | strip_bytes(tmp32s); |
3910 | -#endif /* USE_SCRIPT */ | |
3911 | 2923 | } |
3912 | 2924 | } |
3913 | 2925 |
@@ -57,7 +57,7 @@ | ||
57 | 57 | #define FAKE_VERSION 0 |
58 | 58 | #define FAKE_VER_MAJOR 0 |
59 | 59 | #define FAKE_VER_MINOR 1 |
60 | -#define FAKE_VER_PATCH 4 | |
60 | +#define FAKE_VER_PATCH 5 | |
61 | 61 | #endif /* USE_SCRIPT */ |
62 | 62 | |
63 | 63 | #define ANGBAND_2_8_1 |
@@ -808,8 +808,9 @@ | ||
808 | 808 | (quest[i].k_idx == o_ptr->name1)) |
809 | 809 | { |
810 | 810 | quest[i].status = QUEST_STATUS_COMPLETED; |
811 | + quest[i].complev = (byte)p_ptr->lev; | |
811 | 812 | #ifdef JP |
812 | - msg_print("クエストを達成した!"); | |
813 | + msg_print("クエストを達成した!"); | |
813 | 814 | #else |
814 | 815 | msg_print("You completed your quest!"); |
815 | 816 | #endif |
@@ -4299,6 +4300,7 @@ | ||
4299 | 4300 | if (quest[p_ptr->inside_quest].type == QUEST_TYPE_FIND_EXIT) |
4300 | 4301 | { |
4301 | 4302 | quest[p_ptr->inside_quest].status = QUEST_STATUS_COMPLETED; |
4303 | + quest[p_ptr->inside_quest].complev = (byte)p_ptr->lev; | |
4302 | 4304 | #ifdef JP |
4303 | 4305 | msg_print("クエストを達成した!"); |
4304 | 4306 | #else |
@@ -4308,16 +4310,8 @@ | ||
4308 | 4310 | msg_print(NULL); |
4309 | 4311 | } |
4310 | 4312 | |
4311 | - leaving_quest = p_ptr->inside_quest; | |
4313 | + leave_quest_check(); | |
4312 | 4314 | |
4313 | - /* Leaving an 'only once' quest marks it as failed */ | |
4314 | - if (leaving_quest && | |
4315 | - (quest[leaving_quest].flags & QUEST_FLAG_ONCE) && | |
4316 | - (quest[leaving_quest].status == QUEST_STATUS_TAKEN)) | |
4317 | - { | |
4318 | - quest[leaving_quest].status = QUEST_STATUS_FAILED; | |
4319 | - } | |
4320 | - | |
4321 | 4315 | p_ptr->inside_quest = cave[y][x].special; |
4322 | 4316 | dun_level = 0; |
4323 | 4317 | p_ptr->oldpx = 0; |
@@ -302,6 +302,7 @@ | ||
302 | 302 | (quest[i].k_idx == o_ptr->name1)) |
303 | 303 | { |
304 | 304 | quest[i].status = QUEST_STATUS_COMPLETED; |
305 | + quest[i].complev = (byte)p_ptr->lev; | |
305 | 306 | #ifdef JP |
306 | 307 | msg_print("クエストを達成した!"); |
307 | 308 | #else |
@@ -1447,6 +1447,10 @@ | ||
1447 | 1447 | tmp16u = max_quests; |
1448 | 1448 | wr_u16b(tmp16u); |
1449 | 1449 | |
1450 | + /* Dump the quests */ | |
1451 | + tmp8u = MAX_RANDOM_QUEST - MIN_RANDOM_QUEST; | |
1452 | + wr_byte(tmp8u); | |
1453 | + | |
1450 | 1454 | for (i = 0; i < max_quests; i++) |
1451 | 1455 | { |
1452 | 1456 | /* Save status for every quest */ |
@@ -1456,8 +1460,10 @@ | ||
1456 | 1460 | /* (prevents problems with multi-level quests) */ |
1457 | 1461 | wr_s16b(quest[i].level); |
1458 | 1462 | |
1463 | + wr_byte(quest[i].complev); | |
1464 | + | |
1459 | 1465 | /* Save quest status if quest is running */ |
1460 | - if (quest[i].status == QUEST_STATUS_TAKEN) | |
1466 | + if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED || ((i >= MIN_RANDOM_QUEST) && (i <= MAX_RANDOM_QUEST))) | |
1461 | 1467 | { |
1462 | 1468 | wr_s16b(quest[i].cur_num); |
1463 | 1469 | wr_s16b(quest[i].max_num); |
@@ -2998,18 +2998,10 @@ | ||
2998 | 2998 | p_ptr->oldpy = 0; |
2999 | 2999 | p_ptr->oldpx = 0; |
3000 | 3000 | |
3001 | - leaving_quest = p_ptr->inside_quest; | |
3001 | + leave_quest_check(); | |
3002 | 3002 | |
3003 | - /* Leaving an 'only once' quest marks it as failed */ | |
3004 | - if (leaving_quest && | |
3005 | - (quest[leaving_quest].flags & QUEST_FLAG_ONCE) && | |
3006 | - (quest[leaving_quest].status == QUEST_STATUS_TAKEN)) | |
3007 | - { | |
3008 | - quest[leaving_quest].status = QUEST_STATUS_FAILED; | |
3009 | - } | |
3010 | - | |
3011 | 3003 | p_ptr->inside_quest = cave[py][px].special; |
3012 | - dun_level = 1; | |
3004 | + if(quest[leaving_quest].type != QUEST_TYPE_RANDOM) dun_level = 1; | |
3013 | 3005 | p_ptr->leftbldg = TRUE; |
3014 | 3006 | p_ptr->leaving = TRUE; |
3015 | 3007 | } |
@@ -696,6 +696,7 @@ | ||
696 | 696 | extern void do_cmd_use(void); |
697 | 697 | |
698 | 698 | /* dungeon.c */ |
699 | +extern void leave_quest_check(void); | |
699 | 700 | extern void play_game(bool new_game); |
700 | 701 | extern bool psychometry(void); |
701 | 702 | extern void leave_level(int level); |