koishi-plugin-rusty-lake-lizard 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +33 -35
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -111,50 +111,43 @@ var rooms = [
111
111
  id: "bedroom",
112
112
  name: "卧室",
113
113
  description: "这是一个黑暗的、方形的、铺着白色瓷砖的房间。",
114
- image: images.bedroom,
115
- locked: false
114
+ image: images.bedroom
116
115
  },
117
116
  {
118
117
  id: "corridor",
119
118
  name: "走廊",
120
119
  description: "这是一条长长的、昏暗的走廊,尽头分成两条岔路。",
121
- image: images.corridor,
122
- locked: true
120
+ image: images.corridor
123
121
  },
124
122
  {
125
123
  id: "kitchen",
126
124
  name: "厨房",
127
125
  description: "这里摆着一张桌子和一个厨台。",
128
- image: images.kitchen,
129
- locked: true
126
+ image: images.kitchen
130
127
  },
131
128
  {
132
129
  id: "laboratory",
133
130
  name: "化学实验室",
134
131
  description: "这里出奇的空旷——里面只有一个小型实验台立在房间中央,上面摆着少量化学设备。",
135
- image: images.laboratory,
136
- locked: true
132
+ image: images.laboratory
137
133
  },
138
134
  {
139
135
  id: "electrical",
140
136
  name: "电气室",
141
137
  description: "空气中弥漫着一股霉味,天花板上布满了管道和电线,房间中央有一个大型保险丝盒,旁边是一个近乎空荡的货架,上面积满了灰尘。",
142
- image: images.electrical,
143
- locked: true
138
+ image: images.electrical
144
139
  },
145
140
  {
146
141
  id: "office",
147
142
  name: "办公室",
148
143
  description: "简朴干净的白色墙纸与遍布整座设施的冰冷单调的白色瓷砖形成了鲜明的对比。房间中央有一张桌子,上面放着一台电脑,发出轻微的电流声。",
149
- image: images.office,
150
- locked: true
144
+ image: images.office
151
145
  },
152
146
  {
153
147
  id: "hide",
154
148
  name: "隐藏房间",
155
149
  description: "从布满灰尘的通风口爬出来,到了一个黑暗房间的冰冷地板上。嵌入进墙体里的巨型机器矗立在你眼前,一个小屏幕发出红光,显示着闪烁的消息。",
156
- image: images.hide,
157
- locked: true
150
+ image: images.hide
158
151
  }
159
152
  ];
160
153
  var itemsDetails = {
@@ -344,6 +337,12 @@ function apply(ctx) {
344
337
  logger.info(`用户 ${session.userId} 已加入房间 ${gameName}`);
345
338
  await session.send(`成功创建房间:${gameName}。
346
339
  已自动为您加入`);
340
+ const state = await getPlayerState(session);
341
+ const currentRoom = state.currentRoom;
342
+ const current = rooms.find((r) => r.id === currentRoom);
343
+ await session.send(`当前所在场景:${current.name}
344
+ 使用“锈湖 查看”指令查看当前场景。例如:“锈湖 查看 监控”`);
345
+ await session.send(import_koishi.h.image(current.image));
347
346
  });
348
347
  command.subcommand(".删除", "清除游戏房间").action(async ({ session }) => {
349
348
  const games = await ctx.database.get("rusty_lake_games", {});
@@ -403,6 +402,12 @@ ${gameList}`);
403
402
  userId: session.userId
404
403
  });
405
404
  await session.send(`你成功加入了房间:${games[index].gameName}!`);
405
+ const state = await getPlayerState(session);
406
+ const currentRoom = state.currentRoom;
407
+ const current = rooms.find((r) => r.id === currentRoom);
408
+ await session.send(`当前所在场景:${current.name}
409
+ 使用“锈湖 查看”指令查看当前场景。例如:“锈湖 查看 监控”`);
410
+ await session.send(import_koishi.h.image(current.image));
406
411
  });
407
412
  command.subcommand(".移动 <room>", "移动到另一个场景").action(async ({ session }) => {
408
413
  const state = await getPlayerState(session);
@@ -633,14 +638,13 @@ ${targetRoom.description}${targetRoom.image ? "\n" + import_koishi.h.image(targe
633
638
  return "你观察了一会,并没有什么特别的发现。";
634
639
  }
635
640
  } else if (/门/.test(point)) {
636
- const corridor = rooms.find((room) => room.id === "corridor");
637
- if (corridor.locked === true) {
641
+ if (!state.doneTasks.includes("走廊锁")) {
638
642
  await session.send("这扇装有坚固的金属门把手的白门被锁上了,需要钥匙才能开。");
639
643
  if (state.inventory.includes("钥匙")) {
640
644
  await session.send("你拥有钥匙。要试着开门吗?(是/否)");
641
645
  const choice = await session.prompt(5e3);
642
646
  if (choice === "是") {
643
- corridor.locked = false;
647
+ await addTaskToDoneTasks(session, "走廊锁");
644
648
  await ctx.database.upsert("rusty_lake_games", [
645
649
  {
646
650
  id: state.id,
@@ -677,8 +681,7 @@ ${targetRoom.description}${targetRoom.image ? "\n" + import_koishi.h.image(targe
677
681
  response += "摄像头静止地悬挂在天花板上,以一种令人不安的姿态注视着你。";
678
682
  response += "\n\n你试着拨弄它,但它坚固的金属框架可以使它免受任何损害。";
679
683
  } else if (/通风/.test(point)) {
680
- const hide = rooms.find((room) => room.id === "hide");
681
- if (hide.locked === true) {
684
+ if (!state.doneTasks.includes("隐藏房间锁")) {
682
685
  await session.send("通风口被一块挡板覆盖,挡板被螺丝固定在墙上。");
683
686
  if (state.inventory.includes("螺丝刀")) {
684
687
  await session.send("你拥有螺丝刀。要试着拆开挡板吗?(是/否)");
@@ -699,7 +702,7 @@ ${targetRoom.description}${targetRoom.image ? "\n" + import_koishi.h.image(targe
699
702
  response += "\n\n你设法打开通风口,从布满灰尘的通风口爬出来,到了一个黑暗房间的冰冷地板上,脑袋差点撞到上方的桌子。";
700
703
  response += "\n\n你艰难地从桌子下面爬出来,然后就看到了嵌入进墙体里的巨型机器矗立在你眼前,一个小屏幕发出红光,显示着闪烁的消息。“";
701
704
  response += import_koishi.h.image(images.hide);
702
- hide.locked = false;
705
+ await addTaskToDoneTasks(session, "隐藏房间锁");
703
706
  await ctx.database.upsert("rusty_lake_games", [
704
707
  {
705
708
  id: state.id,
@@ -731,14 +734,13 @@ ${targetRoom.description}${targetRoom.image ? "\n" + import_koishi.h.image(targe
731
734
  }
732
735
  } else if (currentRoom.id === "corridor") {
733
736
  if (/厨房/.test(point)) {
734
- const kitchen = rooms.find((room) => room.id === "hide");
735
- if (kitchen.locked === true) {
737
+ if (!state.doneTasks.includes("厨房锁")) {
736
738
  response += "厨房的门没锁,你开门走了进去。";
737
739
  response += "\n\n你走进厨房,面前是一张小桌子和一把椅子。";
738
740
  response += "\n\n远端的墙上有一个厨台,上面放着一个咖啡机。";
739
741
  response += "\n\n你听到角落的垃圾桶周围萦绕着嗡嗡作响的苍蝇声。";
740
742
  response += import_koishi.h.image(images.kitchen);
741
- kitchen.locked = false;
743
+ await addTaskToDoneTasks(session, "厨房锁");
742
744
  await ctx.database.upsert("rusty_lake_games", [
743
745
  {
744
746
  id: state.id,
@@ -754,15 +756,14 @@ ${targetRoom.description}${targetRoom.image ? "\n" + import_koishi.h.image(targe
754
756
  response += "你观察了一会,并没有什么特别的发现。";
755
757
  }
756
758
  } else if (/实验室/.test(point)) {
757
- const laboratory = rooms.find((room) => room.id === "hide");
758
- if (laboratory.locked === true) {
759
+ if (!state.doneTasks.includes("实验室锁")) {
759
760
  response += "你来到化学实验室门口。";
760
761
  response += "\n\n当你靠近门边时,嗅到了从另外一侧传来的浓烈化学气味,直冲鼻腔。";
761
762
  response += "\n\n门没锁,你开门走了进去。";
762
763
  response += "\n\n化学实验室出奇地空旷——里面只有一个小型实验台立在房间中央,上面摆着少量化学设备。";
763
764
  response += "\n\n然而一股令人不安的寒意掠过你的脊背,你总感觉有什么东西在注视着你。";
764
765
  response += import_koishi.h.image(images.laboratory);
765
- laboratory.locked = false;
766
+ await addTaskToDoneTasks(session, "实验室锁");
766
767
  await ctx.database.upsert("rusty_lake_games", [
767
768
  {
768
769
  id: state.id,
@@ -778,8 +779,7 @@ ${targetRoom.description}${targetRoom.image ? "\n" + import_koishi.h.image(targe
778
779
  response += "你观察了一会,并没有什么特别的发现。";
779
780
  }
780
781
  } else if (/电/.test(point)) {
781
- const electrical = rooms.find((room) => room.id === "hide");
782
- if (electrical.locked === true) {
782
+ if (!state.doneTasks.includes("电锁")) {
783
783
  await session.send("通往电气室的门是锁着的。门把手是简单的旋转式,看起来不是很牢固,中间有一个钥匙孔。");
784
784
  await session.send("你准备想办法把门弄开。(输入准备使用的道具或方式)");
785
785
  const choice = await session.prompt(15e3);
@@ -788,7 +788,7 @@ ${targetRoom.description}${targetRoom.image ? "\n" + import_koishi.h.image(targe
788
788
  response += "\n\n门嘎吱作响地打开了,映入眼帘的是一个狭小的房间,空气中弥漫着一股霉味。";
789
789
  response += "\n\n你看到天花板上布满了管道和电线,房间中央有一个大型保险丝盒,旁边是一个近乎空荡的货架,上面积满了灰尘。";
790
790
  response += import_koishi.h.image(images.electrical);
791
- electrical.locked = false;
791
+ await addTaskToDoneTasks(session, "电锁");
792
792
  await ctx.database.upsert("rusty_lake_games", [
793
793
  {
794
794
  id: state.id,
@@ -805,7 +805,7 @@ ${targetRoom.description}${targetRoom.image ? "\n" + import_koishi.h.image(targe
805
805
  response += "\n\n门嘎吱作响地打开了,映入眼帘的是一个狭小的房间,空气中弥漫着一股霉味。";
806
806
  response += "\n\n你看到天花板上布满了管道和电线,房间中央有一个大型保险丝盒,旁边是一个近乎空荡的货架,上面积满了灰尘。";
807
807
  response += import_koishi.h.image(images.electrical);
808
- electrical.locked = false;
808
+ await addTaskToDoneTasks(session, "电锁");
809
809
  await ctx.database.upsert("rusty_lake_games", [
810
810
  {
811
811
  id: state.id,
@@ -822,7 +822,7 @@ ${targetRoom.description}${targetRoom.image ? "\n" + import_koishi.h.image(targe
822
822
  response += "\n\n门嘎吱作响地打开了,映入眼帘的是一个狭小的房间,空气中弥漫着一股霉味。";
823
823
  response += "\n\n你看到天花板上布满了管道和电线,房间中央有一个大型保险丝盒,旁边是一个近乎空荡的货架,上面积满了灰尘。";
824
824
  response += import_koishi.h.image(images.electrical);
825
- electrical.locked = false;
825
+ await addTaskToDoneTasks(session, "电锁");
826
826
  await ctx.database.upsert("rusty_lake_games", [
827
827
  {
828
828
  id: state.id,
@@ -841,8 +841,7 @@ ${targetRoom.description}${targetRoom.image ? "\n" + import_koishi.h.image(targe
841
841
  response += "你观察了一会,并没有什么特别的发现。";
842
842
  }
843
843
  } else if (/办公室/.test(point)) {
844
- const office = rooms.find((room) => room.id === "hide");
845
- if (office.locked === true) {
844
+ if (!state.doneTasks.includes("办公室锁")) {
846
845
  await session.send("办公室的门被一个牢固的电子锁锁住,旁边有一个指纹读取器。");
847
846
  if (state.doneTasks.includes("房间电")) {
848
847
  await session.send("你试了试自己的指纹,读取器闪烁红灯,门并未打开。");
@@ -855,7 +854,7 @@ ${targetRoom.description}${targetRoom.image ? "\n" + import_koishi.h.image(targe
855
854
  response += "\n\n简朴干净的白色墙纸与遍布整座设施的冰冷单调的白色瓷砖形成了鲜明的对比。";
856
855
  response += "\n\n房间中央有一张桌子,上面放着一台电脑,发出轻微的电流声。";
857
856
  response += import_koishi.h.image(images.office);
858
- office.locked = false;
857
+ await addTaskToDoneTasks(session, "办公室锁");
859
858
  await ctx.database.upsert("rusty_lake_games", [
860
859
  {
861
860
  id: state.id,
@@ -1108,7 +1107,6 @@ ${targetRoom.description}${targetRoom.image ? "\n" + import_koishi.h.image(targe
1108
1107
  await session.send("插槽C和H已经插入了保险丝。你决定调整保险丝的位置,并把之前找到的那个也放进去。");
1109
1108
  await session.send("输入你想插入保险丝的三个插槽。(三个大写英文字母)");
1110
1109
  const choice = await session.prompt(15e3);
1111
- const hide = rooms.find((room) => room.id === "hide");
1112
1110
  if (/A/.test(choice) && /B/.test(choice) && /G/.test(choice) && !state.doneTasks.includes("房间电")) {
1113
1111
  response += "你将保险丝插入插槽A、B、G。";
1114
1112
  response += "\n\n放好了最后一个保险丝,你听到电流噼啪作响,伴着火花从保险丝盒中飞溅而出。";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-rusty-lake-lizard",
3
3
  "description": "交互式解谜游戏,来玩玩吧~",
4
- "version": "0.0.4",
4
+ "version": "0.0.5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/lizard0126/rusty-lake-lizard.git"