summaryrefslogtreecommitdiff
path: root/src/cmd4.c
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2011-02-22 06:45:48 +0100
committerBardur Arantsson <bardur@scientician.net>2012-03-29 21:22:23 +0200
commitaef0a9a6670ec219c3fc00e9cd9bc30458a5cab5 (patch)
tree46834896de02d7c430360c45a59a1c861f421936 /src/cmd4.c
parent3b4cbce560800a5cf8326904d70623b6bb910241 (diff)
Refactor: Generalize dynamic quest description for C-based quests
Diffstat (limited to 'src/cmd4.c')
-rw-r--r--src/cmd4.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/src/cmd4.c b/src/cmd4.c
index f6f90247..fdce00cd 100644
--- a/src/cmd4.c
+++ b/src/cmd4.c
@@ -4225,34 +4225,13 @@ static void do_cmd_knowledge_quests(void)
/* Dynamic quests */
if (quest[i].dynamic_desc)
{
- /* Random quests */
- if (i == QUEST_RANDOM)
+ /* C type quests */
+ if (quest[i].type == HOOK_TYPE_C)
{
- /**/
- if (!(dungeon_flags1 & DF1_PRINCIPAL)) continue;
- if ((dun_level < 1) || (dun_level >= MAX_RANDOM_QUEST)) continue;
- if (!random_quests[dun_level].type) continue;
- if (random_quests[dun_level].done) continue;
- if (p_ptr->inside_quest) continue;
- if (!dun_level) continue;
-
- if (!is_randhero(dun_level))
+ if (!quest[i].gen_desc(fff))
{
- fprintf(fff, "#####yCaptured princess!\n");
- fprintf(fff, "A princess is being held prisoner and tortured here!\n");
- fprintf(fff, "Save her from the horrible %s.\n",
- r_info[random_quests[dun_level].r_idx].name + r_name);
+ continue;
}
- else
- {
- fprintf(fff, "#####yLost sword!\n");
- fprintf(fff, "An adventurer lost his sword to a bunch of %s!\n",
- r_info[random_quests[dun_level].r_idx].name + r_name);
- fprintf(fff, "Kill them all to get it back.\n");
- }
- fprintf(fff, "Number: %d, Killed: %ld.\n",
- random_quests[dun_level].type, (long int) quest[QUEST_RANDOM].data[0]);
- fprintf(fff, "\n");
}
/* MUST be a lua quest */
else