Skip to content

RepeatableSkills API

hp-1e edited this page Jun 7, 2026 · 2 revisions

RepeatableSkills API

设置可重复技能 / Configure Repeatable Skills

将指定技能注册为可重复加点技能,并可选择设置最大点击次数。

Registers a skill as repeatable, with an optional maximum click count.

RepeatableSkills.setSkillType("puffish_skills:combat", "rage_stack", "repeatable")
RepeatableSkills.setRepeatable("puffish_skills:combat", "rage_stack", true)
RepeatableSkills.setRepeatable("puffish_skills:combat", "rage_stack", true, 5)
RepeatableSkills.setRepeatLimit("puffish_skills:combat", "rage_stack", 5)

setRepeatable(categoryId, skillId, true) 表示不限制重复次数。

setRepeatable(categoryId, skillId, true) means the skill can be repeated without a limit.

setRepeatable(categoryId, skillId, true, limit) 表示最多可点击 limit 次。计数包含首次解锁,所以如果上限为 5,玩家总计最多获得 5 次奖励。

setRepeatable(categoryId, skillId, true, limit) means the skill can grant rewards up to limit times. The first unlock is included in the count, so a limit of 5 means the player can receive the reward 5 times total.

查询 / Query

查询技能类型、是否可重复、重复上限、当前重复次数和剩余可加次数。

Queries the skill type, repeatable flag, repeat limit, current repeat count, and remaining repeat count.

const type = RepeatableSkills.getSkillType("puffish_skills:combat", "rage_stack")
const repeatable = RepeatableSkills.isRepeatable("puffish_skills:combat", "rage_stack")
const limit = RepeatableSkills.getRepeatLimit("puffish_skills:combat", "rage_stack")

const count = RepeatableSkills.getRepeatCount(player, "puffish_skills:combat", "rage_stack")
const remaining = RepeatableSkills.getRemainingRepeats(player, "puffish_skills:combat", "rage_stack")

getRemainingRepeats 返回 -1 时表示不限制。

getRemainingRepeats returns -1 when the skill has no repeat limit.

主动触发重复加点 / Trigger Repeat

通过脚本主动触发一次重复加点。

Triggers one repeatable skill click from script.

RepeatableSkills.repeatUnlock(player, "puffish_skills:combat", "rage_stack")

重复加点会消耗技能定义中的 cost,并再次触发该技能的奖励。

Repeating a skill consumes the skill definition's cost and triggers that skill's rewards again.

Clone this wiki locally