Files
wsmud/world/obj/cash/jing.js
2026-05-26 16:41:20 +08:00

58 lines
1.9 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(OBJ);
this.set({
unit: "枚",
name: "养精丹",
desc: "一枚丹药吃了后会增加10点精力但是吃多了会伤肝。",
ad_jl: 10,
grade: 1,
value: 10000,
max_count: 10
});
this.on_use = function (me) {
//if (this.grade==1&& me.query_temp("jing" + this.grade) >= 10) {
// me.notify("<yel>你已经吃太多养精丹了,要注意身体。</yel>");
// return false;
//}
if (this.grade < 3) return me.notify_fail('养精丹已无法使用。');
//me.add_temp("jing" + this.grade, 1, UTIL.diff_time());
me.add_temp("ad_jl", this.ad_jl);
me.notify("<hiy>你增加了" + this.ad_jl + "点精力。</hiy>");
return true;
}
this.on_create = function (path, par) {
if (!par) return;
par = par.substr(1);
var lv = parseInt(par);
if (!(lv > 0 && lv < 5)) return;
switch (lv) {
case 1:
this.name = "养精丹";
this.ad_jl = 20;
this.desc = "一枚丹药吃了后会增加20点精力但是吃多了会伤肝。";
break;
case 2:
this.name = "养精丹";
this.ad_jl = 30;
this.desc = "一枚丹药吃了后会增加30点精力但是吃多了会伤肝。";
break;
case 3:
this.name = "养精丹";
this.ad_jl = 50;
this.desc = "一枚丹药吃了后会增加50点精力但是吃多了会伤肝。";
break;
case 4:
this.name = "养精丹";
this.ad_jl = 100;
this.desc = "一枚丹药吃了后会增加100点精力但是吃多了会伤肝。";
break;
default:
this.name = "养精丹";
this.ad_jl = 10;
this.desc = "一枚丹药吃了后会增加10点精力但是吃多了会伤肝。";
break;
}
this.grade = lv + 1;
}