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

21
world/cmd/obj/lockobj.js Normal file
View File

@@ -0,0 +1,21 @@
this.inherits(COMMAND);
this.command = "lockobj";
this.allow_busy = true;
this.allow_state = true;
this.allow_die = true;
this.allow_faint = true;
//this.regex = /^(\d)\s(\w+)$/;
this.enter = function (me, objid) {
var obj = me.find_obj(objid);
if (!obj) {
return me.notify("你要锁定什么东西?");
}
if (obj.is_locked) {
obj.is_locked = false;
me.send(`{type:"dialog",dialog:"pack",id:"${obj.id}",locked:0}`);
return me.send('<cyn>取消' + obj.color_name + "的锁定状态,你可以进行丢弃,贩卖,分解操作。</cyn>");
}
obj.is_locked = true;
me.send('<hic>设置' + obj.color_name + "为锁定状态,将禁止丢弃,贩卖,分解操作。</hic>\n");
me.send(`{type:"dialog",dialog:"pack",id:"${obj.id}",locked:1}`);
}