koishi-plugin-toram 0.4.0 → 0.4.2

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.
package/lib/index.js CHANGED
@@ -80,7 +80,7 @@ async function apply(ctx, config) {
80
80
  try {
81
81
  x = 0;
82
82
  const ver_boss = await ctx.database.get('toram_data_version', 1);
83
- if (ver_boss[0].version != '0.4.0-alpha.1') {
83
+ if (ver_boss[0]?.version != '0.4.0-alpha.1') {
84
84
  session.send('正在写入数据表【toram_boss】,当前进度1/4……');
85
85
  const json_boss = require('./data/boss');
86
86
  const data_boss = json_boss.rows;
@@ -93,7 +93,7 @@ async function apply(ctx, config) {
93
93
  x++;
94
94
  }
95
95
  const ver_dishes = await ctx.database.get('toram_data_version', 2);
96
- if (ver_dishes[0].version != '0.4.0-alpha.1') {
96
+ if (ver_dishes[0]?.version != '0.4.0-alpha.1') {
97
97
  session.send('正在写入数据表【toram_dishes】,当前进度2/4……');
98
98
  const json_dishes = require('./data/dishes');
99
99
  const data_dishes = json_dishes.rows;
@@ -106,7 +106,7 @@ async function apply(ctx, config) {
106
106
  x++;
107
107
  }
108
108
  const ver_dishes_name = await ctx.database.get('toram_data_version', 3);
109
- if (ver_dishes_name[0].version != '0.4.0-alpha.1') {
109
+ if (ver_dishes_name[0]?.version != '0.4.0-alpha.1') {
110
110
  session.send('正在写入数据表【toram_dishes_name】,当前进度3/4……');
111
111
  const json_dishes_name = require('./data/dishes_name');
112
112
  const data_dishes_name = json_dishes_name.rows;
@@ -118,8 +118,8 @@ async function apply(ctx, config) {
118
118
  await ctx.database.upsert('toram_data_version', [{ id: 3, database: 'toram_dishes_name', version: '0.4.0-alpha.1' }]);
119
119
  x++;
120
120
  }
121
- const ver_dishes_effect = await ctx.database.get('toram_data_version', 3);
122
- if (ver_dishes_effect[0].version != '0.4.0-alpha.1') {
121
+ const ver_dishes_effect = await ctx.database.get('toram_data_version', 4);
122
+ if (ver_dishes_effect[0]?.version != '0.4.0-alpha.1') {
123
123
  session.send('正在写入数据表【toram_dishes_effect】,当前进度4/4……');
124
124
  const json_dishes_effect = require('./data/dishes_effect');
125
125
  const data_dishes_effect = json_dishes_effect.rows;
@@ -303,7 +303,7 @@ async function apply(ctx, config) {
303
303
  .map(([, i]) => i);
304
304
  const WildBoss = MaxExpFixedWildBossIndex.map(index => {
305
305
  const boss = FitLevelWildBoss[index];
306
- x = PlayerExpRate[Math.abs(PlayerLevel - WildBoss.level)] || 0;
306
+ x = PlayerExpRate[Math.abs(PlayerLevel - boss?.level)] || 0;
307
307
  return `${boss?.name} 等级${boss?.level} ${boss?.map} 经验值${boss?.baseEXP * x} ${boss?.element}属性`;
308
308
  }).join('\n');
309
309
  text += WildBoss;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-toram",
3
3
  "description": "托拉姆物语小工具",
4
- "version": "0.4.0",
4
+ "version": "0.4.2",
5
5
  "contributors": [
6
6
  "青灯 <1874053520@qq.com>"
7
7
  ],
package/readme.md CHANGED
@@ -18,6 +18,18 @@ QQ:1874053520
18
18
 
19
19
  ————————————
20
20
 
21
+ 0.4.2
22
+
23
+ 修复了升级指令错误的bug
24
+
25
+ ————————————
26
+
27
+ 0.4.1
28
+
29
+ 修复了数据文件写入无效的bug
30
+
31
+ ————————————
32
+
21
33
  0.4.0
22
34
 
23
35
  新增数据文件写入功能!!!数据写入完毕后就可以正常使用啦~