diff options
author | Bardur Arantsson <bardur@scientician.net> | 2011-02-22 06:45:48 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-03-29 21:22:23 +0200 |
commit | aef0a9a6670ec219c3fc00e9cd9bc30458a5cab5 (patch) | |
tree | 46834896de02d7c430360c45a59a1c861f421936 /src/cmd4.c | |
parent | 3b4cbce560800a5cf8326904d70623b6bb910241 (diff) |
Refactor: Generalize dynamic quest description for C-based quests
Diffstat (limited to 'src/cmd4.c')
-rw-r--r-- | src/cmd4.c | 29 |
1 files changed, 4 insertions, 25 deletions
@@ -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 |