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 +6 -6
- package/package.json +1 -1
- package/readme.md +12 -0
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]
|
|
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]
|
|
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]
|
|
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',
|
|
122
|
-
if (ver_dishes_effect[0]
|
|
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 -
|
|
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