Expand description
Native ports for the additional_quests category — quest
additional_quests_behaviors (run via run_event in
logic::quests::{handle_claim_quest, handle_hidden_quest_completed},
returning Vec<OverlordEvent>).
These scripts fire when a quest is claimed (or a hidden quest completes) and issue follow-up quests. The shipped bodies fall into a small set of patterns:
- loop-task cycle —
loop_tasks::on_finish_regular_loop_task+loop_tasks::advance_loop(the regular loop-task quest chain). - loop-task cycle + first-loop flag — pattern 1 plus a
SetCustomValue("loop_tasks.first_loop_skill_crystals_received", 1). - loop-task prepare —
prepare_loop(RNG) +advance_loop, optionally preceded byon_finish_regular_loop_task. - milestone marker —
SetCustomValue("loop_tasks.last_milestone.<k>", n)thenadvance_loop. - set custom value — a single
SetCustomValue(key, n)(mimic-item codes, events, so they are not ported. - redirect loop task — a single
UpdateActiveLoopTaskId(<fixed quest uuid>).
§RNG
Only the prepare_loop pattern (#3) consumes RNG (slot-draw randints). The
native draw order matches exactly. All other patterns ignore the snapshot
(harmless).
§Scope (per the run_event call site in quests.rs)
Random, CharacterState, State — plus config/lookups the loop_tasks
logic needs.
Structs§
- Additional
Quests Ctx - Inputs available to an
additional_questsnative fn — the questadditional_quests_behaviorscope plus config/lookups the loop_tasks logic needs. - Default
Loop Task Ctx - Inputs for the default-loop-task selector
(
game_settings.default_loop_task_behavior).
Constants§
Functions§
- default_
loop_ task_ const - The shipped default loop task: a constant quest id.
- loop_
finish_ advance - Pattern 1: on_finish_regular_loop_task + advance_loop. Shared by the regular loop-task quests (019a4b43 / 019b561c / 019b561e / 019b561f / 019b5621 / 019bc1e6 / 019bc29c-572e / 019bc29c-b647 / 019d768d).
- loop_
finish_ advance_ first_ crystals - Pattern 2 (019a6ef3): finish + advance, then mark the first-loop crystals flag.
- loop_
finish_ prepare_ advance - Pattern 3a (019bdb53): on_finish_regular_loop_task + prepare_loop (RNG) + advance_loop.
- loop_
prepare_ advance - Pattern 3b (019cd269): prepare_loop (RNG) + advance_loop (no finish call).
- milestone_
level - Pattern 4:
SetCustomValue("loop_tasks.last_milestone.level", N)+ advance. - milestone_
stage - Pattern 4:
SetCustomValue("loop_tasks.last_milestone.stage", N)+ advance. - mimic_
next_ item - Pattern 5:
SetCustomValue("next_mimic_item_code", CODE). - redirect_
to - Pattern 6:
UpdateActiveLoopTaskId(QUEST). - register
- Register this category’s native fns.
- test_
default_ loop_ task - Test default loop task: the fixture’s first loop-task quest.
- test_
loop_ task_ 0 - Test loop-task 9d3d2428 on claim:
loop_task = 0, advance back to 305300e2. - test_
loop_ task_ 1 - Test loop-task 305300e2 on claim:
loop_task = 1, advance to 29540ca2. - test_
loop_ task_ 2 - Test loop-task 29540ca2 on claim:
loop_task = 2, advance to 9d3d2428. - test_
loop_ task_ seed - Test loop-task seeder (hidden starting quest c3ae0d0c, completes after the
SetCustomValue("loop_task", 0)+give_quests([305300e2, 29540ca2, 9d3d2428])+UpdateActiveLoopTaskId(305300e2). This is what first unlocks the 3-quest loop-task cycle; the migration stubbed it toNone, so loop tasks were never given.
Type Aliases§
- Additional
Quests Fn - Signature of an
additional_questsnative fn. - Default
Loop Task Fn - Signature of a default-loop-task fn (returns the loop-task quest id).