init: add workspace files
This commit is contained in:
22
world/extends/map/area.js
Normal file
22
world/extends/map/area.js
Normal file
@@ -0,0 +1,22 @@
|
||||
AREA.prototype.notify_update = function () {
|
||||
this.json = null;
|
||||
if (this.is_area)
|
||||
WORLD.send(`{type:"dialog",dialog:"jh",t:"fam",refresh:${this.index}}`);
|
||||
else
|
||||
WORLD.send(`{type:"dialog",dialog:"jh",t:"fb",refresh:${this.fb_index}}`);
|
||||
}
|
||||
AREA.prototype.query_owner = function (me) {
|
||||
return me.query_teamid();
|
||||
}
|
||||
AREA.prototype.clear_copy = function (me) {
|
||||
var room = ROOM.Get(this.first)?.query_copy2(me);
|
||||
if (room)
|
||||
room.clear_copy(me);
|
||||
}
|
||||
AREA.prototype.is_unlock = function (me) {
|
||||
if (this.jd_index >= 0)
|
||||
return me.isenable_area(this);
|
||||
return (this.unlock_index ?? this.fb_index) <= me.query_temp("fb", 0);
|
||||
}
|
||||
|
||||
|
||||
37
world/extends/map/fam_area.js
Normal file
37
world/extends/map/fam_area.js
Normal file
@@ -0,0 +1,37 @@
|
||||
const stand_actions = [
|
||||
['goto fam1', '练功', '回到你所在门派师父所在位置学习武功'],
|
||||
|
||||
['goto fam2', '后勤', '前往当前门派后勤管理的位置']
|
||||
];
|
||||
const pt_action = [
|
||||
'goto pt_fam', '进入战场', '你的帮派正在进攻'
|
||||
];
|
||||
|
||||
FAMILY_AREA.prototype.query_actions = function (me) {
|
||||
let actions = [];
|
||||
for (let item of stand_actions) {
|
||||
actions.push([
|
||||
item[0] + " " + this.family, item[1], item[2]
|
||||
]);
|
||||
}
|
||||
let fam = FAMILIES[this.family];
|
||||
if (fam.battle_family) {
|
||||
let target_fam = FAMILIES[fam.battle_family];
|
||||
actions.push([
|
||||
'goto fam3 ' + this.family, '进入战场', target_fam.name + "正在进攻" + fam.name
|
||||
]);
|
||||
}
|
||||
if (fam.first_npc) {
|
||||
actions.push([
|
||||
'sx greet', '请安', fam.name + "首席弟子:" + fam.first_npc.name
|
||||
]);
|
||||
}
|
||||
return actions;
|
||||
}
|
||||
// FAMILY_AREA.prototype.query_owner = function (me) {
|
||||
// return me.query_teamid();
|
||||
// }
|
||||
FAMILY_AREA.prototype.notify_update = function () {
|
||||
this.json = null;
|
||||
WORLD.send(`{type:"dialog",dialog:"jh",t:"fam",refresh:${this.index}}`);
|
||||
}
|
||||
Reference in New Issue
Block a user