init: add workspace files
This commit is contained in:
54
world/map/yz/leitai/biwu.js
Normal file
54
world/map/yz/leitai/biwu.js
Normal file
@@ -0,0 +1,54 @@
|
||||
this.inherits(ROOM);
|
||||
this.name = "擂台"
|
||||
this.desc = "你正站在一个白玉汉石砌成方圆数十丈的大擂台上面,擂台下面的观众声嘶力竭的呐喊助威,加油!加油!加油!加油!加油!加油!";
|
||||
this.exits = { "down": "yz/leitai/ltx" };
|
||||
this.max_item_count = 2;
|
||||
this.no_save=true;
|
||||
this.add_action("fight", null, function (me) { return me.notify("你正在比试。") });
|
||||
this.add_action("kill", null, function (me) { return me.notify("你正在比试。") });
|
||||
this.add_action("dazuo", null, function (me) { return me.notify("你正在比试。") });
|
||||
this.add_action("liaoshang", null, function (me) { return me.notify("你正在比试。") });
|
||||
this.on_enter = function (me) {
|
||||
me.full();
|
||||
if (this.items.length != 2) return;
|
||||
var p1 = this.items[0];
|
||||
var p2 = this.items[1];
|
||||
p1.die = this.on_die;
|
||||
p2.die = this.on_die;
|
||||
this.call_interval(x => {
|
||||
if (p1.environment != p2.environment) return false;
|
||||
if (p1.environment != this) return;
|
||||
p2.send_message("\n<hic>比赛还有" + (5 - x) + "秒钟正式开始!</hic>", true);
|
||||
},
|
||||
1000,
|
||||
5, x => {
|
||||
p1.do_kill(p2);
|
||||
}
|
||||
);
|
||||
}
|
||||
this.on_die = function (killer) {
|
||||
if (!killer) return;
|
||||
var p1 = this;
|
||||
var p2 = killer;
|
||||
COMMAND.DO("sys", "武林大会:" + p2.name + "战胜了" + p1.name + "。");
|
||||
p1.hp = 100;
|
||||
p2.add_temp("fight_sc", 1);
|
||||
p2.notify("\n<hig>你战胜了对手,获得比武积分1,5秒钟后将离开擂台。</hig>\n");
|
||||
p1.notify("\n<hig>你的比赛失败了,本轮积分不变,5秒钟后将离开擂台。</hig>\n");
|
||||
this.call_out(function (me) {
|
||||
p1.moveto(p1.query_temp("enter_room"), null, p1.name + "走了进来。", "out");
|
||||
p2.moveto(p2.query_temp("enter_room"), null, p2.name + "走了进来。", "out");
|
||||
},5000);
|
||||
var task = TASK.GET('fight');
|
||||
if (task) {
|
||||
task.battle_over(p1, p2);
|
||||
}
|
||||
}
|
||||
this.on_leave = function (me, dir) {
|
||||
if (dir == "out") {
|
||||
me.die = USER.prototype.die;
|
||||
return true;
|
||||
}
|
||||
me.notify("你正在比武,打完才能下擂台。");
|
||||
return false;
|
||||
}
|
||||
85
world/map/yz/leitai/biwu2.js
Normal file
85
world/map/yz/leitai/biwu2.js
Normal file
@@ -0,0 +1,85 @@
|
||||
this.inherits(ROOM);
|
||||
this.name = "擂台"
|
||||
this.desc = "你正站在一个白玉汉石砌成方圆数十丈的大擂台上面,擂台下面的观众声嘶力竭的呐喊助威,加油!加油!加油!加油!加油!加油!";
|
||||
this.exits = { "down": "yz/leitai/ltx" };
|
||||
this.max_item_count = 1;
|
||||
this.no_save = true;
|
||||
this.add_action("fight", null, function (me) { return me.notify("你正在比试。") });
|
||||
this.add_action("kill", null, function (me) { return me.notify("你正在比试。") });
|
||||
this.add_action("dazuo", null, function (me) { return me.notify("你正在比试。") });
|
||||
this.add_action("liaoshang", null, function (me) { return me.notify("你正在比试。") });
|
||||
this.add_action("relive", null, function (me) { return me.notify("你正在比试。") });
|
||||
this.start_time = 0;
|
||||
this.on_enter = function (me) {
|
||||
if (!me.is_player) return;
|
||||
me.die = challenge_over;
|
||||
this.start_time = Date.now();
|
||||
me.call_interval(x => {
|
||||
me.send_message("\n<hic>挑战还有" + (10 - x) + "秒钟正式开始!</hic>", true);
|
||||
},
|
||||
1000,
|
||||
10,
|
||||
function () {
|
||||
npc.do_kill(me);
|
||||
}
|
||||
);
|
||||
}
|
||||
this.on_heart_beat = function (dt) {
|
||||
if (this.start_time) {
|
||||
if (dt - this.start_time >= 300000) {
|
||||
|
||||
this.start_time = 0;
|
||||
if (!this.items.length) {
|
||||
return;
|
||||
}
|
||||
if (this.items.length == 1) {
|
||||
var obj = this.items[0];
|
||||
if (obj.is_player) {
|
||||
obj.moveto(obj.query_temp("enter_room"), null, obj.name + "走了进来。", "endfight");
|
||||
obj.notify("<yel>你挑战失败。</yel>");
|
||||
} else {
|
||||
this.items.length = 0;
|
||||
obj.environment = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
var player = null;
|
||||
for (var i = 0; i < this.items.length; i++) {
|
||||
if (this.items[i].is_player) {
|
||||
player = this.items[i];
|
||||
} else {
|
||||
this.items[i].environment = null;
|
||||
}
|
||||
}
|
||||
if (player) {
|
||||
player.moveto(player.query_temp("enter_room"), null, player.name + "走了进来。", "endfight");
|
||||
player.notify("<yel>你挑战超时,自动离开擂台。</yel>");
|
||||
}
|
||||
this.items.length = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
function challenge_over(killer) {
|
||||
if (this.environment.items.length != 2) {
|
||||
return this.send("比武出现问题,请练习管理解决。");;
|
||||
}
|
||||
var p1 = this.environment.items[0];
|
||||
var p2 = this.environment.items[1];
|
||||
if (!p1.is_player||!p2.is_player) {
|
||||
return this.send("比武出现问题,请练习管理解决。");;
|
||||
}
|
||||
|
||||
|
||||
this.die = USER.prototype.die;
|
||||
killer.die = USER.prototype.die;
|
||||
this.send_room("<hic>比武结束," + killer.name + "获得胜利,5秒钟后将离开擂台。</hic>");
|
||||
killer.send("<hig>恭喜你获得胜利,积分+1,目前积分</hig>");
|
||||
|
||||
this.call_out(move_out, 5000);
|
||||
}
|
||||
function move_out() {
|
||||
|
||||
}
|
||||
this.on_leave = function (me, dir) {
|
||||
return me.notify_fail("你比试完才可以下擂台。");
|
||||
}
|
||||
70
world/map/yz/leitai/leitai.js
Normal file
70
world/map/yz/leitai/leitai.js
Normal file
@@ -0,0 +1,70 @@
|
||||
this.inherits(ROOM);
|
||||
this.name = "擂台"
|
||||
this.desc = "你正站在一个白玉汉石砌成方圆数十丈的大擂台上面,擂台下面的观众声嘶力竭的呐喊助威,加油!加油!加油!加油!加油!加油!";
|
||||
this.exits = {};
|
||||
this.max_item_count = 1;
|
||||
this.no_save = true;
|
||||
|
||||
|
||||
this.add_action("fight", null, function (me) {
|
||||
me.notify("你正在擂台比试。");
|
||||
return true;
|
||||
}).allow_fight = true;;
|
||||
this.add_action("kill", null, function (me) {
|
||||
me.notify("你正在擂台比试。");
|
||||
return true;
|
||||
}).allow_fight = true;;
|
||||
this.add_action("dazuo", null, function (me) {
|
||||
me.notify("你正在擂台比试。");
|
||||
return true;
|
||||
}).allow_fight = true;;
|
||||
this.add_action("liaoshang", null, function (me) {
|
||||
me.notify("你正在擂台比试。");
|
||||
return true;
|
||||
}).allow_fight = true;;
|
||||
this.add_action("perform", null, function (me) {
|
||||
me.notify("擂台上自动出招。");
|
||||
return true;
|
||||
}).allow_fight = true;;
|
||||
this.add_action("unequip", null, function (me) {
|
||||
me.notify("擂台上自动出招,不允许卸下装备。");
|
||||
return true;
|
||||
}).allow_fight = true;;
|
||||
// this.add_action("equip", null, function (me) {
|
||||
// me.notify("擂台上自动出招。");
|
||||
// return true;
|
||||
// });
|
||||
this.add_action("enable", null, function (me) {
|
||||
me.notify("擂台上自动出招,不能更改武功。");
|
||||
return true;
|
||||
}).allow_fight = true;
|
||||
// this.add_action("use", null, function (me) {
|
||||
|
||||
// me.notify("擂台上自动出招,不允许使用道具。");
|
||||
// return true;
|
||||
// }).allow_fight = true;;
|
||||
this.add_action("surrender", '投降', function (me) {
|
||||
WORLD.COMMANDS.biwu.surrender(me);
|
||||
return true;
|
||||
}).allow_fight = true;
|
||||
// this.start_time = 0;
|
||||
// this.on_enter = function (me) {
|
||||
// if (!me.is_player) return;
|
||||
|
||||
|
||||
// }
|
||||
// this.start_challenge = function (me, index) {
|
||||
// if (me.environment !== this) return;
|
||||
|
||||
// }
|
||||
|
||||
this.on_leave = function (me, dir) {
|
||||
|
||||
if (dir == "fightend") {
|
||||
return true;
|
||||
}
|
||||
// if (dir == "down") {
|
||||
// return me.notify_fail("你比试完才可以下擂台。");
|
||||
// }
|
||||
return me.notify_fail("你比试完才可以下擂台。");
|
||||
}
|
||||
5
world/map/yz/leitai/ltx.js
Normal file
5
world/map/yz/leitai/ltx.js
Normal file
@@ -0,0 +1,5 @@
|
||||
this.inherits(ROOM);
|
||||
this.name = "擂台"
|
||||
this.desc = "这是一个方圆数十丈的大广场,一个用白玉汉石砌成数丈高的擂台耸立在广场中央,从上面不时传来吆喝声和惨叫声,擂台的四个边角竖着四根十多丈高的旗杆,分别用金线绣着武林霸主四个大字,广场的正北方用同样的石料砌了一个小台。台上竖着一根大旗杆,一张大旗迎风招展。";
|
||||
this.exits = { "north": "yz/xidajie1" };
|
||||
this.no_fight = true;
|
||||
Reference in New Issue
Block a user