OSDN Git Service

Completely change TowerQuest. Try Once, Difficult, and Reward Ring of Poison Resistance.
authordis- <dis-@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 18 Nov 2012 16:54:59 +0000 (16:54 +0000)
committerdis- <dis-@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 18 Nov 2012 16:54:59 +0000 (16:54 +0000)
lib/edit/q0000005.txt
lib/edit/q0000006.txt
lib/edit/q0000007.txt
lib/edit/t0000002.txt
src/cmd2.c
src/cmd4.c
src/defines.h
src/dungeon.c
src/externs.h
src/xtra2.c

index 58fe69f..5aa9aa1 100644 (file)
@@ -5,11 +5,20 @@ Q:$5:N:The Tower
 Q:5:N:Åã
 
 # Definition
-Q:$5:Q:4:0:0:0:30:0:0:0:2
-Q:5:Q:4:0:0:0:30:0:0:0:2
+Q:$5:Q:8:0:0:0:40:0:0:0:10
+Q:5:Q:8:0:0:0:40:0:0:0:10
 
 # Description for quest
-?:[LEQ $QUEST5 2]
+?:[LEQ $QUEST5 2] 
+Q:$5:T:The tower outside the town was once used for defence of the city.
+Q:$5:T:Now many monsters seem to be dwelling there.
+Q:$5:T:Please clear it and return to us!
+Q:5:T:³¹¤Î³°¤Ë¤¢¤ëÅã¤Ï¤«¤Ä¤Æ³¹¤Î¼éÈ÷¤Ë»È¤ï¤ì¤Æ¤¤¤Þ¤·¤¿¡£
+Q:5:T:º£¤Ç¤Ï¤¿¤¯¤µ¤ó¤Î¥â¥ó¥¹¥¿¡¼¤¬½»¤ßÉÕ¤¤¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£
+Q:5:T:¤É¤¦¤«¥â¥ó¥¹¥¿¡¼¤É¤â¤ò°ìÁݤ·¤ÆÅã¤ò¼è¤êÌᤷ¤Æ¤¯¤À¤µ¤¤¡ª
+?:1
+
+?:[EQU $QUEST5 7]
 Q:$5:T:The tower outside the town was once used for defence of the city.
 Q:$5:T:Now many monsters seem to be dwelling there.
 Q:$5:T:Please clear it and return to us!
@@ -23,12 +32,21 @@ Q:5:T:
 Q:$5:T:Thank you for cleaning the tower of all these strange creatures.
 Q:$5:T:I've talked with Astinus, the local librarian, Suiyan, the local
 Q:$5:T:weaponmaster, and Lorien, the local beastmaster. They will offer you
-Q:$5:T:a special discount price when they serve you.
+Q:$5:T:a special discount price when they serve you. And a small reward
+Q:$5:T:awaits you outside.
 Q:5:T:Åã¤Î²øʪ¤ò°ìÁݤ·¤Æ²¼¤µ¤Ã¤ÆÍ­Æñ¤¦¤´¤¶¤¤¤Þ¤¹¡£¤³¤Î³¹¤Î»Ê½ñ¤Î¥¢¥¹¥Æ¥£¥Ì¥¹¡¢
 Q:5:T:Éð´ï¾¢¤Î¿å°Ã¡¢¥â¥ó¥¹¥¿¡¼Àç¿Í¤Î¥í¥ê¥¨¥ó¤ËÏäòÉÕ¤±¤Æ¤ª¤¤¤¿¤Î¤Ç¡¢
 Q:5:T:º£¸å¤³¤ì¤é¤ÎŹ¤Ç¤Ï³Ê°Â¤Ç¥µ¡¼¥Ó¥¹¤ò¼õ¤±¤é¤ì¤ë¤Ç¤·¤ç¤¦¡£
+Q:5:T:²Ã¤¨¤Æ¡¢¤µ¤µ¤ä¤«¤Ê¤ªÎé¤ò³°¤ËÍÑ°Õ¤·¤Æ¤ª¤­¤Þ¤·¤¿¡£
 ?:1
 
+# Description for quest failed
+?:[EQU $QUEST5 5]
+Q:$5:T:It seems like this task was too difficult for you.  Good that I
+Q:$5:T:hired another adventurer to clean up the remaining monsters.
+Q:5:T:¤³¤Î»Å»ö¤Ï¤¢¤Ê¤¿¤Ë¤ÏÆñ¤·¤«¤Ã¤¿¤è¤¦¤Ç¤¹¤Í¡£Â¾¤ÎËÁ¸±¼Ô¤ò¸Û¤Ã¤Æ
+Q:5:T:»Ä¤ê¤Î¥â¥ó¥¹¥¿¡¼¤òÂ༣¤·¤Þ¤¹¤«¤é¡¢¤â¤¦¤¤¤¤¤Ç¤¹¤è¡£
+?:1
 
 # Quest up to quest 6
 F:<:QUEST_UP:8:0:0:0:0:NONE:6
@@ -37,34 +55,21 @@ F:<:QUEST_UP:8:0:0:0:0:NONE:6
 F:>:QUEST_DOWN:8
 
 # Monsters to keep the player busy ;-)
-F:1:FLOOR:8:*
-
-# If quests 6 and 7 are finished then you can complete quest 5
-?:[AND [EQU $QUEST6 4] [EQU $QUEST7 4] ]
-# Quest exit
-F:>:QUEST_EXIT:8
-# No monsters when you leave the tower
-F:1:FLOOR:8
-?:1
-
+F:1:FLOOR:8:*5
 
 # Dungeon
 D:XXXXXXXXXXX
-D:X>.1.....1X
+D:X>........X
 D:XXXXXXXXX.X
-D:X1.....1X.X
+D:X.....1.X.X
 D:X.XXXXX.X.X
-D:X.X<XXX.X.X
+D:X1X<XXX.X1X
 D:X.X.....X.X
 D:X.XXXXXXX.X
-D:X1.......1X
+D:X.....1...X
 D:XXXXXXXXXXX
 
 # Starting position when coming from town
 ?:[EQU $LEAVING_QUEST 0]
 P:1:1
 
-# Starting position when coming from level 2 of the tower (quest 6)
-?:[EQU $LEAVING_QUEST 6]
-P:5:3
-
index 4666a82..75f09a2 100644 (file)
@@ -2,40 +2,32 @@
 
 # Name
 Q:$6:N:The Tower 2
-Q:6:N:Å㣲
+Q:6:N:\93\83
 
 # Definition
-Q:$6:Q:6:0:0:0:30:0:0:0:3
-Q:6:Q:6:0:0:0:30:0:0:0:3
+Q:$6:Q:8:0:0:0:40:0:0:0:11
+Q:6:Q:8:0:0:0:40:0:0:0:11
 
 # Floor with monster 9 levels out of deep as long as the quest is uncompleted
-F:1:FLOOR:8
-?:[EQU $QUEST6 1]
 F:1:FLOOR:8:*9
-?:1
 
-# Quest down to quest 5
-F:>:QUEST_DOWN:8:0:0:0:0:NONE:5
+# Quest down to Town
+F:>:QUEST_DOWN:8
 
 # Quest up to quest 7
 F:<:QUEST_UP:8:0:0:0:0:NONE:7
 
 # Dungeon
 D:XXXXXXXXX
-D:X......1X
+D:X.1.....X
 D:X.XXXXX.X
-D:X.X..1X.X
+D:X.X..1X1X
 D:X.X.X.X.X
 D:X.X>X.X.X
 D:X.XXX.X.X
-D:X1....X<X
+D:X.1...X<X
 D:XXXXXXXXX
 
 # Starting position when coming from level 1 of the tower (quest 5)
 ?:[EQU $LEAVING_QUEST 5]
-P:5:3
-
-# Starting position when coming from level 3 of the tower (quest 7)
-?:[EQU $LEAVING_QUEST 7]
-P:7:7
-
+P:5:3
\ No newline at end of file
index ffc73b1..3ade61f 100644 (file)
@@ -2,20 +2,17 @@
 
 # Name
 Q:$7:N:The Tower 3
-Q:7:N:Å㣳
+Q:7:N:\93\83
 
 # Definition
-Q:$7:Q:6:0:0:0:30:0:0:0:3
-Q:7:Q:6:0:0:0:30:0:0:0:3
+Q:$7:Q:8:0:0:0:40:0:0:0:11
+Q:7:Q:8:0:0:0:40:0:0:0:11
 
 # Floor with monster 11 levels out of deep as long as the quest is uncompleted
-F:@:FLOOR:8
-?:[EQU $QUEST7 1]
 F:@:FLOOR:8:*11
-?:1
 
-# Quest stairs down to quest 6
-F:>:QUEST_DOWN:8:0:0:0:0:NONE:6
+# Quest stairs down to Town
+F:>:QUEST_DOWN:8
 
 # Dungeon
 D:XXXXXXXXX
index d2d4f9d..383222d 100644 (file)
@@ -134,11 +134,12 @@ F:b:BUILDING_1:3:0:0:0:0:NONE:5
 F:b:BUILDING_1:3:0:0:0:0:NONE:5
 
 # Quest 5 rewarding, continue with quest 26,
-# reward is cheaper *Identify* at the Library (see buildings)
+# reward is cheaper *Identify* at the Library (see buildings) and Ring of Poison Resistance
 ?:[EQU $QUEST5 3]
 F:b:BUILDING_1:3:0:0:0:0:NONE:26
+F:!:FLOOR:3:0:143
 
-# Quest 5 finished, ontinue with quest 26
+# Quest 5 finished, continue with quest 26
 ?:[EQU $QUEST5 4]
 F:b:BUILDING_1:3:0:0:0:0:NONE:26
 
index 251820c..8351624 100644 (file)
 
 #include "angband.h"
 
+bool confirm_leave_level(bool down_stair)
+{
+       quest_type *q_ptr = &quest[p_ptr->inside_quest];
+
+       /* Confirm leaving from once only quest */
+       if (confirm_quest && p_ptr->inside_quest &&
+           (q_ptr->type == QUEST_TYPE_RANDOM ||
+            (q_ptr->flags & QUEST_FLAG_ONCE &&
+                                               q_ptr->status != QUEST_STATUS_COMPLETED) ||
+                (q_ptr->flags & QUEST_FLAG_TOWER &&
+                                               ((q_ptr->status != QUEST_STATUS_STAGE_COMPLETED) ||
+                                                (down_stair && (quest[QUEST_TOWER1].status != QUEST_STATUS_COMPLETED))))))
+       {
+#ifdef JP
+               msg_print("¤³¤Î³¬¤ò°ìÅÙµî¤ë¤ÈÆóÅÙ¤ÈÌá¤Ã¤ÆÍè¤é¤ì¤Þ¤»¤ó¡£");
+               if (get_check("ËÜÅö¤Ë¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©")) return TRUE;
+#else
+               msg_print("You can't come back here once you leave this floor.");
+               if (get_check("Really leave this floor? ")) return TRUE;
+#endif
+       }
+       else
+       {
+               return TRUE;
+       }
+       return FALSE;
+}
+
 
 /*
  * Go up one level
@@ -46,6 +74,10 @@ void do_cmd_go_up(void)
        /* Quest up stairs */
        if (have_flag(f_ptr->flags, FF_QUEST))
        {
+               /* Cancel the command */
+               if (!confirm_leave_level(FALSE)) return;
+       
+               
                /* Success */
 #ifdef JP
                if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
@@ -88,26 +120,7 @@ void do_cmd_go_up(void)
        }
        else
        {
-               quest_type *q_ptr = &quest[p_ptr->inside_quest];
-
-               /* Confirm leaving from once only quest */
-               if (confirm_quest && p_ptr->inside_quest &&
-                   (q_ptr->type == QUEST_TYPE_RANDOM ||
-                    (q_ptr->flags & QUEST_FLAG_ONCE &&
-                     q_ptr->status != QUEST_STATUS_COMPLETED)))
-               {
-#ifdef JP
-                       msg_print("¤³¤Î³¬¤ò°ìÅÙµî¤ë¤ÈÆóÅÙ¤ÈÌá¤Ã¤ÆÍè¤é¤ì¤Þ¤»¤ó¡£");
-                       if (get_check("ËÜÅö¤Ë¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©")) go_up = TRUE;
-#else
-                       msg_print("You can't come back here once you leave this floor.");
-                       if (get_check("Really leave this floor? ")) go_up = TRUE;
-#endif
-               }
-               else
-               {
-                       go_up = TRUE;
-               }
+               go_up = confirm_leave_level(FALSE);
        }
 
        /* Cancel the command */
@@ -228,6 +241,9 @@ void do_cmd_go_down(void)
        /* Quest down stairs */
        else if (have_flag(f_ptr->flags, FF_QUEST))
        {
+               /* Confirm Leaving */
+               if(!confirm_leave_level(TRUE)) return;
+               
 #ifdef JP
                if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
                        msg_print("¤Ê¤ó¤À¤³¤Î³¬Ãʤϡª");
@@ -237,8 +253,8 @@ void do_cmd_go_down(void)
                        msg_print("You enter the down staircase.");
 #endif
 
-
                leave_quest_check();
+               leave_tower_check();
 
                p_ptr->inside_quest = c_ptr->special;
 
index 6c0dffa..eb63cce 100644 (file)
@@ -9217,7 +9217,9 @@ static void do_cmd_knowledge_quests_current(FILE *fff)
 
        for (i = 1; i < max_quests; i++)
        {
-               if ((quest[i].status == QUEST_STATUS_TAKEN) || (quest[i].status == QUEST_STATUS_COMPLETED))
+               if ((quest[i].status == QUEST_STATUS_TAKEN) ||
+                       ((quest[i].status == QUEST_STATUS_STAGE_COMPLETED) && (quest[i].type == QUEST_TYPE_TOWER)) ||
+                       (quest[i].status == QUEST_STATUS_COMPLETED))
                {
                        /* Set the quest number temporary */
                        int old_quest = p_ptr->inside_quest;
@@ -9246,7 +9248,7 @@ static void do_cmd_knowledge_quests_current(FILE *fff)
                        {
                                char note[80] = "\0";
 
-                               if (quest[i].status == QUEST_STATUS_TAKEN)
+                               if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_STAGE_COMPLETED)
                                {
                                        switch (quest[i].type)
                                        {
@@ -9301,6 +9303,7 @@ static void do_cmd_knowledge_quests_current(FILE *fff)
                                                break;
 
                                        case QUEST_TYPE_KILL_ALL:
+                                       case QUEST_TYPE_TOWER:
 #ifdef JP
                                                sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
 #else
index 3f1b9c7..464b90b 100644 (file)
 /* Check is the quest index is "fixed" */
 #define is_fixed_quest_idx(Q_IDX) (((Q_IDX) < MIN_RANDOM_QUEST) || ((Q_IDX) > MAX_RANDOM_QUEST))
 
+#define QUEST_TOWER1         5
+#define QUEST_TOWER2         6
+#define QUEST_TOWER3         7
 #define QUEST_OBERON         8
 #define QUEST_SERPENT        9
 
@@ -4601,13 +4604,14 @@ extern int PlayerUID;
 /*
  * Quest status
  */
-#define QUEST_STATUS_UNTAKEN         0
-#define QUEST_STATUS_TAKEN           1
-#define QUEST_STATUS_COMPLETED       2
-#define QUEST_STATUS_REWARDED        3
-#define QUEST_STATUS_FINISHED        4
-#define QUEST_STATUS_FAILED          5
-#define QUEST_STATUS_FAILED_DONE     6
+#define QUEST_STATUS_UNTAKEN              0
+#define QUEST_STATUS_TAKEN                1
+#define QUEST_STATUS_COMPLETED            2
+#define QUEST_STATUS_REWARDED             3
+#define QUEST_STATUS_FINISHED             4
+#define QUEST_STATUS_FAILED               5
+#define QUEST_STATUS_FAILED_DONE          6
+#define QUEST_STATUS_STAGE_COMPLETED      7
 
 /*
  * Quest type
@@ -4619,6 +4623,7 @@ extern int PlayerUID;
 #define QUEST_TYPE_KILL_NUMBER               5
 #define QUEST_TYPE_KILL_ALL                  6
 #define QUEST_TYPE_RANDOM                    7
+#define QUEST_TYPE_TOWER                     8
 
 /*
  * Initialization flags
@@ -4635,6 +4640,7 @@ extern int PlayerUID;
 #define QUEST_FLAG_SILENT  0x01 /* no messages fro completion */
 #define QUEST_FLAG_PRESET  0x02 /* quest is outside the main dungeon */
 #define QUEST_FLAG_ONCE    0x04 /* quest is marked finished after leaving */
+#define QUEST_FLAG_TOWER   0x08 /* Tower quest is special */
 
 /*
  * Available graphic modes
index 2f772a1..04dccdd 100644 (file)
@@ -1173,6 +1173,11 @@ void leave_quest_check(void)
        {
                quest[leaving_quest].status = QUEST_STATUS_FAILED;
                quest[leaving_quest].complev = (byte)p_ptr->lev;
+               if(quest[leaving_quest].type == QUEST_TYPE_TOWER)
+               {
+                       quest[QUEST_TOWER1].status = QUEST_STATUS_FAILED;
+                       quest[QUEST_TOWER1].complev = (byte)p_ptr->lev;
+               }
                if (quest[leaving_quest].type == QUEST_TYPE_RANDOM)
                {
                        r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR);
@@ -1185,6 +1190,23 @@ void leave_quest_check(void)
                else if (record_fix_quest)
                        do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL);
        }
+                                               
+}
+
+void leave_tower_check(void)
+{
+       leaving_quest = p_ptr->inside_quest;
+       /* Check for Tower Quest */
+       if (leaving_quest &&
+               (quest[leaving_quest].type == QUEST_TYPE_TOWER) &&
+               (quest[QUEST_TOWER1].status != QUEST_STATUS_COMPLETED))
+       {
+               if(quest[leaving_quest].type == QUEST_TYPE_TOWER)
+               {
+                       quest[QUEST_TOWER1].status = QUEST_STATUS_FAILED;
+                       quest[QUEST_TOWER1].complev = (byte)p_ptr->lev;
+               }
+       }
 }
 
 
@@ -3290,6 +3312,7 @@ msg_print("
                                dungeon_type = 0;
 
                                leave_quest_check();
+                               leave_tower_check();
 
                                p_ptr->inside_quest = 0;
 
index 0dfc5ec..0384a3f 100644 (file)
@@ -714,6 +714,7 @@ extern void travel_step(void);
 #endif
 
 /* cmd2.c */
+extern bool confirm_leave_level(bool down_stair);
 extern void do_cmd_go_up(void);
 extern void do_cmd_go_down(void);
 extern void do_cmd_search(void);
@@ -819,6 +820,7 @@ extern cptr do_spell(int realm, int spell, int mode);
 
 /* dungeon.c */
 extern void leave_quest_check(void);
+extern void leave_tower_check(void);
 extern void extract_option_vars(void);
 extern void determine_bounty_uniques(void);
 extern void determine_today_mon(bool conv_old);
index 246306b..5875a60 100644 (file)
@@ -424,6 +424,7 @@ void check_quest_completion(monster_type *m_ptr)
 
                        /* Interesting quest */
                        if ((quest[i].type == QUEST_TYPE_KILL_NUMBER) ||
+                           (quest[i].type == QUEST_TYPE_TOWER) ||
                            (quest[i].type == QUEST_TYPE_KILL_ALL))
                                break;
 
@@ -579,6 +580,42 @@ msg_print("
                                }
                                break;
                        }
+                       case QUEST_TYPE_TOWER:
+                       {
+                               int number_mon = 0;
+
+                               if (!is_hostile(m_ptr)) break;
+
+                               /* Count all hostile monsters */
+                               for (i2 = 0; i2 < cur_wid; ++i2)
+                                       for (j2 = 0; j2 < cur_hgt; j2++)
+                                               if (cave[j2][i2].m_idx > 0)
+                                                       if (is_hostile(&m_list[cave[j2][i2].m_idx])) 
+                                                               number_mon++;
+
+                               if ((number_mon - 1) == 0)
+                               {
+                                       if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, i, NULL);
+                                       
+                                       quest[i].status = QUEST_STATUS_STAGE_COMPLETED;
+                                       /* completed */
+                                       if((quest[QUEST_TOWER1].status == QUEST_STATUS_STAGE_COMPLETED) &&
+                                          (quest[QUEST_TOWER2].status == QUEST_STATUS_STAGE_COMPLETED) &&
+                                          (quest[QUEST_TOWER3].status == QUEST_STATUS_STAGE_COMPLETED))
+                                       {
+                                               quest[QUEST_TOWER1].status = QUEST_STATUS_COMPLETED;
+                                               quest[QUEST_TOWER1].complev = (byte)p_ptr->lev;;
+                                                       
+#ifdef JP
+msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª");
+#else
+                                               msg_print("You just completed your quest!");
+#endif
+                                               msg_print(NULL);
+                                       }
+                               }
+                               break;
+                       }
                }
        }