Module progress

Source
Expand description

Native functions for the conditional_progress category — quest progress behaviors (QuestTemplate::progress_behavior). Output is the new i64 progress value assigned to QuestInstance::current.

Quest progress collapses to ~12 patterns; per-quest constants (level thresholds, dungeon/currency/rarity ids) are const parameters of generic fns, registered once per shipped constant. Content uuids baked into patterns are exported as consts and validated against the config at deploy time (see [super::validate]).

Structs§

ConditionalProgressCtx
Inputs available to a conditional_progress native fn.

Constants§

COLLECT_CURRENCY
DUNGEON_1
DUNGEON_2
DUNGEON_3
LOG_IN_QUEST
RARITY_A
RARITY_B
RARITY_C

Functions§

always_one
Always 1.
complete_daily_quest
complete_loop_task_quest
complete_weekly_quest
count_equipped_at_rarity
On PlayerEquipItem: the number of equipped inventory items whose rarity q is at least the target rarity R’s q; other events leave progress unchanged.
current_chapter_level
character.current_chapter_level (raw, monotonic). Paired with a quest whose progress_target is the TARGET chapter, so the quest completes exactly when the player reaches that chapter — one behavior gates ANY chapter without a per-threshold const registration (active_quest.current = progress, so is_completed is current_chapter >= progress_target). Used by the progress-pass (trophy road) tiers, which span the whole game (chapter-level 20→115; the pass button itself unlocks at chapter-level 20 per gatings.progress_pass_button_unlock_chapter).
increment_by_batch_size
quest.current + event.batch_size.
increment_one
quest.current + 1.
log_in_today
+1 when the event references the log-in daily quest.
loop_task_collect_currency
CompleteAllLoopTasks → 100; other custom events → unchanged; otherwise quest.current + amount of the target currency in the event’s currency list, or 0 when the currency isn’t present (preserved from the shipped behavior — note: 0, not quest.current).
loop_task_increment_batch
Loop-task-aware +batch_size with completion value N.
loop_task_increment_one
Loop-task-aware +1: CompleteAllLoopTasksN (the completion target), other custom events → unchanged, else +1.
loop_task_pvp_win
Loop-task-guarded PvP win. A CompleteAllLoopTasks custom event force- completes; otherwise the same player-won-PvP gate as pvp_win.
loop_task_raid_dungeon
Loop-task-guarded dungeon raid.
loop_task_reach_chapter_level
Loop-task-guarded reach-chapter-level.
loop_task_reach_level
Loop-task-guarded reach-level: CompleteAllLoopTasks → 1, other custom events → unchanged, else event.level >= T ? 1 : 0.
pvp_win
EndFight that the player won in a PvP fight → +1, else unchanged. The is_win gate is what distinguishes a “Win in the Arena” objective from mere participation — without it a loss would (wrongly) count as a win.
quest_current_0_then_1_else_2
current 0 → 1, otherwise 2.
quest_event_level_1_then_2
level 1 → 1, level 2 → 2, otherwise 0.
raid_dungeon
+1 on a RaidDungeon event for dungeon D, or while the active fight is in dungeon D; otherwise unchanged.
reach_chapter_level
character.current_chapter_level >= T ? 1 : 0 (no guard).
reach_level
event.level >= T ? 1 : 0 (no loop-task guard).
register
Register this category’s native fns into the registry.
upgraded_abilities_delta
quest.current + Σ (final - current) over event.upgraded_abilities.

Type Aliases§

ConditionalProgressFn
Signature of a conditional_progress native fn. Captureless fn so it is Copy and storable in the registry; context arrives via ConditionalProgressCtx.