init: add workspace files
This commit is contained in:
27
world/obj/book/bc.js
Normal file
27
world/obj/book/bc.js
Normal file
@@ -0,0 +1,27 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "份",
|
||||
name: "秘籍碎片",
|
||||
desc: "一本武功秘籍",
|
||||
max_level: 100
|
||||
});
|
||||
this.transable = true;
|
||||
this.otype = 1;
|
||||
this.on_create = function (path, par) {
|
||||
if (!par) return;
|
||||
par = par.substr(1);
|
||||
var skill = SKILL.get(par);
|
||||
if (!skill || !skill.grade) {
|
||||
this.value = 1000;
|
||||
return;
|
||||
}
|
||||
this.skill = skill.id;
|
||||
this.grade = skill.grade;
|
||||
this.name = skill.name + "残页";
|
||||
this.desc = "一本武功秘籍碎片,需要" + ["十", "三十", "五十", "一百", "二百", "五百"][this.grade - 1] + "份这样的残页就可以合成一本完整的" + skill.color_name + "秘籍。";
|
||||
this.combine_count = COMBINED[this.grade];
|
||||
this.combine_to = "book/book#" + skill.id;
|
||||
this.value = WORLD.DATA.book_values[this.grade];
|
||||
|
||||
}
|
||||
const COMBINED = [10, 10, 30, 50, 100, 200, 500];
|
||||
56
world/obj/book/bk.js
Normal file
56
world/obj/book/bk.js
Normal file
@@ -0,0 +1,56 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "本",
|
||||
name: "武功秘籍",
|
||||
desc: "一本武功秘籍",
|
||||
max_level: 100,
|
||||
combined: true,
|
||||
value: 0
|
||||
});
|
||||
this.on_create = function (path, par) {
|
||||
if (!par) return;
|
||||
par = par.substr(1);
|
||||
var skill = SKILL.get(par);
|
||||
if (!skill) return;
|
||||
this.skill = skill.id;
|
||||
this.grade = skill.grade;
|
||||
var cc = this.query_grade_color();
|
||||
this.name = skill.name + "秘籍";
|
||||
this.color_name = "<" + cc + ">" + this.name + "</" + cc + ">";
|
||||
this.desc = "一本武功秘籍,里面记载了" + skill.color_name + "的练习方法。";
|
||||
var cond = skill.condition_tostring();
|
||||
if (cond) {
|
||||
this.desc = this.desc + "\n学习条件:\n" + cond;
|
||||
} else {
|
||||
this.desc = this.desc + "\n学习条件:无" + cond;
|
||||
}
|
||||
if (!this.grade) this.value = 1000;
|
||||
}
|
||||
this.on_use = function (me) {
|
||||
|
||||
var skill_base = SKILL.get(this.skill );
|
||||
if (!skill_base) return me.notify('你不能从里面学到东西。');
|
||||
var skill = me.skills[this.skill];
|
||||
if (!skill) {
|
||||
skill = {
|
||||
level: 0,
|
||||
exp: 0
|
||||
};
|
||||
var str = ['{type:"dialog",dialog:"skills",item:'];
|
||||
skill_base.item_to_json(str, skill, me);
|
||||
str.push("}");
|
||||
me.notify(str.join(""));
|
||||
me.skills[this.skill] = skill;
|
||||
if (skill_base.type == SKILL_TYPES.BASE) {
|
||||
me.init_skill();
|
||||
}
|
||||
}
|
||||
|
||||
skill_base.release_prop(me, me.query_skill(skill_base.id));
|
||||
skill.level = me.query_skill(this.skill, 0) + 100;
|
||||
skill_base.attach_prop(me, skill.level );
|
||||
me.notify('{type:"dialog",dialog:"skills",id:"' + this.skill + '",level:' + skill.level
|
||||
+ ',exp:0}');
|
||||
me.notify('你学会了' + skill_base.color_name + '。');
|
||||
me.recount();
|
||||
}
|
||||
47
world/obj/book/book.js
Normal file
47
world/obj/book/book.js
Normal file
@@ -0,0 +1,47 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "本",
|
||||
name: "武功秘籍",
|
||||
desc: "一本武功秘籍",
|
||||
max_level: 100,
|
||||
combined: true,
|
||||
value: 0
|
||||
});
|
||||
this.otype = 1;
|
||||
this.on_create = function (path, par) {
|
||||
if (!par) return;
|
||||
par = par.substr(1);
|
||||
var skill = SKILL.get(par);
|
||||
if (!skill) return;
|
||||
this.skill = skill.id;
|
||||
this.grade = skill.grade;
|
||||
var cc = this.query_grade_color();
|
||||
this.name = skill.name + "秘籍";
|
||||
this.color_name = "<" + cc + ">" + this.name + "</" + cc + ">";
|
||||
this.desc = "一本武功秘籍,里面记载了" + skill.color_name + "的练习方法。";
|
||||
var cond = skill.condition_tostring();
|
||||
if (cond) {
|
||||
this.desc = this.desc + "\n学习条件:\n" + cond;
|
||||
} else {
|
||||
this.desc = this.desc + "\n学习条件:无" + cond;
|
||||
}
|
||||
this.value = WORLD.DATA.book_values[this.grade] * COMBINED[this.grade];
|
||||
}
|
||||
this.on_study = function (me, skill, lv) {
|
||||
if (skill.do_learn && skill.do_learn(me, lv) == false) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//const VALUES = [1, 1000, 5000, 10000, 100000, 500000, 2000000];
|
||||
const COMBINED = [1, 10, 30, 50, 100, 200, 500];
|
||||
|
||||
|
||||
|
||||
this.add_action('sbook', '存到技能仓库', function (me) {
|
||||
WORLD.COMMANDS.sbook.enter(me, this.id);
|
||||
});
|
||||
|
||||
this.add_action('split', '拆分', function (me) {
|
||||
WORLD.COMMANDS.sbook.split_book(me, this);
|
||||
});
|
||||
|
||||
20
world/obj/book/ts.js
Normal file
20
world/obj/book/ts.js
Normal file
@@ -0,0 +1,20 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "份",
|
||||
name: "无效武功",
|
||||
desc: "查看技能提示"
|
||||
});
|
||||
this.transable = true;
|
||||
this.on_create = function (path, par) {
|
||||
if (!par) return;
|
||||
par = par.substr(1);
|
||||
var skill = SKILL.get(par);
|
||||
if (!skill) {
|
||||
return;
|
||||
}
|
||||
this.skill = skill.id;
|
||||
this.grade = skill.grade;
|
||||
this.name = "技能:" + skill.name;
|
||||
this.desc = skill.color_name + "秘籍。";
|
||||
|
||||
}
|
||||
11
world/obj/book/up.js
Normal file
11
world/obj/book/up.js
Normal file
@@ -0,0 +1,11 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "份",
|
||||
name: "门派进阶残页",
|
||||
desc: "一份秘籍残页,可用来进阶门派武功,(点击技能-武功名称-查看详细-进阶)",
|
||||
value: 10000,
|
||||
grade: 4
|
||||
});
|
||||
|
||||
this.transable = true;
|
||||
this.otype = 1;
|
||||
11
world/obj/book/wd.js
Normal file
11
world/obj/book/wd.js
Normal file
@@ -0,0 +1,11 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "份",
|
||||
name: "武道残页",
|
||||
desc: "一本武功秘籍碎片,需要十份残页就可以合成一本完整的武道秘籍。",
|
||||
combine_to: "book/wudao",
|
||||
combine_count: 10,
|
||||
grade: 5
|
||||
});
|
||||
|
||||
this.otype = 1;
|
||||
19
world/obj/book/wudao.js
Normal file
19
world/obj/book/wudao.js
Normal file
@@ -0,0 +1,19 @@
|
||||
this.inherits(OBJ);
|
||||
this.set({
|
||||
unit: "本",
|
||||
name: "武道",
|
||||
desc: "一本神秘的武功秘籍,据说里面记载了很多已经失传的武功秘辛。",
|
||||
grade: 5,
|
||||
combined: true
|
||||
});
|
||||
this.otype = 1;
|
||||
this.lingwu = function (me, p) {
|
||||
me.do_command("lingwu");
|
||||
}
|
||||
|
||||
|
||||
// this.add_action("wu", "领悟", this.lingwu);
|
||||
|
||||
// this.add_action("wu2", "融合", function (me) {
|
||||
// me.do_command('lingwu2');
|
||||
// });
|
||||
Reference in New Issue
Block a user