init: add workspace files

This commit is contained in:
2026-05-26 16:41:20 +08:00
commit f4f2393f72
1041 changed files with 67405 additions and 0 deletions

33
world/obj/food/desk.js Normal file
View File

@@ -0,0 +1,33 @@
this.inherits(CONTAINER);
this.set({
name: "婚宴礼桌",
desc: "这是醉仙楼的宴席桌子,上面放满了各种好吃的。",
unit: "个",
value: 0,
grade: 1,
combined: false,
no_get: true,
no_alloc: true
});
this.on_create = function (path, par) {
var lv = 0;
if (par) {
lv = parseInt(par.substr(1));
if (!(lv > 0 && lv < 6)) lv = 0;
}
this.grade = lv;
}
this.query_items = function (me) {
if (me.query_temp("get_marry") || !WORLD.DATA.query_temp("marry")) return;
var items = [];
var count = 1;
if (me.id == WORLD.DATA.query_temp("mar1") || me.id == WORLD.DATA.query_temp("mar2")) count = 3;
for (var i = 0; i < this.grade; i++) {
var obj = OBJ.CREATE("food/marry#" + (this.random(3) + 3 * i), count);
items.push(obj);
}
return items;
}
this.clear_items = function (me) {
me.set_temp("get_marry", 1, 60000 * 30);
}

19
world/obj/food/desk2.js Normal file
View File

@@ -0,0 +1,19 @@
this.inherits(CONTAINER);
this.set({
name: "餐桌",
desc: "这是醉仙楼的宴席桌子,上面放满了各种好吃的。",
unit: "个",
value: 0,
grade: 5,
combined: false,
no_get: true,
no_alloc:true
});
this.query_items = function (me) {
if (me.query_temp("get_dest") ) return;
var items = [OBJ.CREATE(me.gender == 1 ? "cash/jing#4" : "food/hua", 3)];
return items;
}
this.clear_items = function (me) {
me.set_temp("get_dest", 1, 3600000 * 48);
}

72
world/obj/food/drink.js Normal file
View File

@@ -0,0 +1,72 @@
this.inherits(OBJ);
this.unit = "壶";
this.name = "米酒";
this.value = 200;
this.combined = true;
this.desc = "一壶醉仙楼的米酒喝掉后每5秒恢复100点内力。";
this.action_msg = "喝";
this.distime = 60000;
this.recover_mp = 100;
this.transable = true;
this.on_use = function (me) {
me.send_room("$N仰头灌下一" + this.unit + this.name + "。");
me.add_status({
id: "drink",
name: this.name,
desc: this.desc,
recover_mp: this.recover_mp,
on_interval: function (me) {
if (me.mp < me.max_mp) {
me.add_mp(this.recover_mp);
me.send('<blu>你恢复了' + this.recover_mp + '内力。</blu>');
}
},
duration_count: 10,
duration: 5000
});
}
this.on_create = function (path, par) {
if (!par) {
this.path = path + "#0";
return;
}
par = par.substr(1);
var lv = parseInt(par);
if (!(lv > 0 && lv < 5)) return;
this.set(OBJS[lv]);
}
const OBJS = [{
name: "米酒",
value: 200,
recover_mp: 100,
desc: "一壶醉仙楼的米酒喝掉后每5秒恢复100点内力。",
unit: "壶"
}, {
name: "花雕酒",
value: 400,
recover_mp: 200,
desc: "一壶醉仙楼产的花雕酒喝掉后每5秒恢复200点内力。",
unit: "壶"
}, {
name: "女儿红",
value: 1000,
recover_mp: 400,
desc: "醉仙楼特酿女儿红每5秒回复400点内力",
unit: "壶"
}, {
name: "醉仙酿",
value: 10000,
recover_mp: 1000,
desc: "醉仙楼的招牌据说连神仙喝了都会醉倒每5秒回复1000点内力",
unit: "壶",
grade: 1
}, {
name: "醉八仙",
value: 20000,
recover_mp: 5000,
desc: "蓬莱酒楼的招牌据说连神仙喝了都会醉倒每5秒回复5000点内力",
unit: "壶",
grade: 2
}];

67
world/obj/food/food.js Normal file
View File

@@ -0,0 +1,67 @@
this.inherits(OBJ);
this.unit = "碗";
this.name = "米饭";
this.value = 200;
this.combined = true;
this.desc = "一碗热气腾腾的白米饭吃掉后每5秒恢复100点气血。";
this.action_msg = "吃";
this.distime = 60000;
this.transable = true;
this.recover_hp = 100;
this.on_use = function (me) {
me.send_room("$N吃下一" + this.unit + this.name + "。");
me.add_status({
id: "food",
name: this.name,
recover_hp: this.recover_hp,
on_interval: function (me) {
let hp = me.do_recover(this.recover_hp);
if (hp > 0) me.notify('<hig>你恢复了' + hp + '气血。</hig>');
},
duration_count: 4,
duration: 5000
});
}
this.on_create = function (path, par) {
if (!par) {
this.path = path + "#0";
return;
}
par = par.substr(1);
var lv = parseInt(par);
if (!(lv > 0 && lv < 5)) return;
this.set([{
name: "米饭",
value: 100,
recover_hp: 100,
desc: "一碗热气腾腾的白米饭吃掉后每5秒恢复100点气血。",
unit: "碗"
}, {
name: "包子",
value: 100,
recover_hp: 100,
desc: "一个热气腾腾的肉包子吃掉后每5秒恢复100点气血。",
unit: "个"
}, {
name: "鸡腿",
value: 200,
recover_hp: 200,
desc: "一个香喷喷的鸡腿吃掉后每5秒恢复200点气血。",
unit: "个"
}, {
name: "面条",
value: 200,
recover_hp: 200,
desc: "一碗热气腾腾的面条吃掉后每5秒恢复200点气血。",
unit: "碗"
}, {
name: "扬州炒饭",
value: 500,
recover_hp: 400,
desc: "一碗香气腾腾的炒饭吃掉后每5秒恢复400点气血。",
unit: "碗"
}
][lv]);
}

12
world/obj/food/hua.js Normal file
View File

@@ -0,0 +1,12 @@
this.inherits(OBJ);
this.unit = "朵";
this.name = "<hiw>百合花</hiw>";
this.grade = 5;
this.value = 1000000;
this.combined = true;
this.desc = "清新脱俗的百合有如婀娜多姿的美丽佳人";
this.on_use = function (me) {
me.notify("<hiw>你拿起一朵百合花轻轻一嗅,顿时神清气爽,精气十足。</hiw>");
me.add_temp("ad_jl", 100);
me.notify("<hiy>你增加了100点精力。</hiy>");
}

75
world/obj/food/marry.js Normal file
View File

@@ -0,0 +1,75 @@
this.inherits(OBJ);
this.unit = "盘";
this.name = "米饭";
this.value = 200;
this.combined = true;
this.desc = "一碗热气腾腾的白米饭吃掉后每5秒恢复100点气血。";
this.action_msg = "吃";
this.distime = 60000;
this.allow_fight = true;
this.distype = "buff";
this.transable = true;
this.on_use = function (me) {
if (this.grade < 3) {
var pname = ["fy_per", "zj_per", "gj_per",
"ds_per", "mz_per", "add_sh_per",
"diff_downside_per", "lianxi_per", "study_per", "dazuo_per", "add_bjsh_per",
"diff_bj", "lianyao1", "releasetime_per", "gjsd_per", "hp_per"].random();
var prop = {};
prop[pname] = 5 + this.grade * 5;
me.add_status({
id: "food",
name: "宴席",
desc: "你吃下了一份大餐",
prop: prop,
duration: 60000 * 20
});
me.send_room("$N吃下一" + this.unit + this.color_name + "。");
} else if (this.grade == 3) {
if (me.max_hp <= me.hp) return me.notify_fail('你目前气血充沛,用不着恢复。');
var hp = me.add_hp(parseInt(me.max_hp * 50 / 100));
hp = hp || 0;
me.send_room("$N吃下一" + this.unit + this.color_name + "。");
me.notify("<hig>你恢复了" + hp + "气血。</hig>")
} else if (this.grade == 4) {
if (me.max_hp <= me.hp) return me.notify_fail('你目前气血充沛,用不着恢复。');
var hp = me.add_hp(parseInt(me.max_hp * 80 / 100));
hp = hp || 0;
me.send_room("$N吃下一" + this.unit + this.color_name + "。");
me.notify("<hig>你恢复了" + hp + "气血。</hig>")
} else {
me.add_temp("ad_jl", 100);
me.send_room("$N吃下一" + this.unit + this.color_name + "。");
me.notify("<hiy>你增加了100点精力。</hiy>");
}
}
this.on_create = function (path, par) {
var lv = 0;
if (par) {
lv = parseInt(par.substr(1));
if (!(lv > 0 && lv < 15)) lv = 0;
}
this.grade = parseInt(lv / 3) + 1;
this.level = lv;
this.name = ["蜜饯青梅", "红梅珠香", "碧螺春卷",
"乌龙吐珠", "蝴蝶暇卷", "沙舟踏翠",
"山珍刺龙芽", "佛手金卷", "金丝酥雀",
"瑶柱玉女", "凤凰展翅", "凤尾鱼翅",
"龙凤呈祥", "花开富贵", "祥龙双飞"][lv];
this.desc = "这是一道醉仙楼的名菜:" + this.name + "";
this.name = "喜宴:" + this.name;
if (this.grade < 3) {
this.desc += "据说吃了后有不少好处。";
// this.distype = "buff";
}
else if (this.grade < 5) {
this.desc += "吃了后会恢复你大量气血。";
this.distype = "hp";
}
else if (this.grade == 5) {
this.desc += "吃了后会恢复你大量精力。";
this.distype = null;
}
this.value = this.grade * 1000;
}