Files
wsmud/world/cmd/dialog/reward.js
2026-05-26 16:41:20 +08:00

66 lines
1.7 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
this.inherits(COMMAND);
this.command = "reward";
this.allow_busy = true;
this.allow_state = true;
this.allow_die = true;
this.allow_faint = true;
this.regex = /^(\w+)(?:\s+(\d+))?$/;
this.enter = function (me, par, index) {
if (!par) {
return;
}
let rule = this.rules[par];
if (!rule) return me.notify("你要看什么?");
let ary = this[par] ?? [];
let reward = ary[index - 1] ?? "";
me.notify("<hic>" + rule + reward + "</hic>");
}
this.score_reward = function (i) {
return {
obj: "money/exp",
count: (20 - i) * 1000
};
}
this.top_reward = function (i) {
return {
obj: "money/gold",
count: (50 + (10 - i) * 5)
};
}
this.weapon_reward = function (i) {
return {
obj: "st/xuanjing",
count: (50 + (10 - i) * 5)
};
}
this.rules = {
score: "根据你所有学会的武学计算的分数,按照门派榜单发放奖励,",
top: "每日消耗精力获得挑战次数,只可挑战积分比自己高的玩家,挑战成功自己增加积分,失败双方积分不变,按照门派榜单发放奖励,",
weapon: "当武器获得精炼或者自制装备时会计算分数玩家同一部件多件装备取最高分上榜所有榜单奖励总计上限200",
mp: "定时更新,无奖励",
exp: "定时更新,无奖励",
money: "定时更新,无奖励",
};
this.top = [
];
for (let i = 0; i < 10; i++) {
this.top[i] = "每天获得黄金*" + (50 + (10 - i) * 5);
}
this.weapon = [
];
for (let i = 0; i < 10; i++) {
this.weapon[i] = "每天获得玄晶*" + (50 + (10 - i) * 5);
}
this.score = [
];
for (let i = 0; i < 20; i++) {
this.score[i] = "每天获得潜能:" + (20 - i) * 1000;
}