-
Notifications
You must be signed in to change notification settings - Fork 0
RepeatableSkills API
将指定技能注册为可重复加点技能,并可选择设置最大点击次数。
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.
查询技能类型、是否可重复、重复上限、当前重复次数和剩余可加次数。
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.
通过脚本主动触发一次重复加点。
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.