koishi-plugin-toram 0.8.1 → 0.8.2-onlyTest
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 +15 -10
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -24,14 +24,16 @@ async function apply(ctx, config) {
|
|
|
24
24
|
Type: 'string',
|
|
25
25
|
SubType: 'string',
|
|
26
26
|
Values: 'string' // 对象的值
|
|
27
|
-
}, {
|
|
27
|
+
}, {
|
|
28
|
+
primary: 'id'
|
|
29
|
+
});
|
|
28
30
|
const ver = '0.8.1'; //当前版本
|
|
29
|
-
const 等级_
|
|
31
|
+
const 等级_经验倍率 = [11, 11, 11, 11, 11, 10, 9, 7, 3];
|
|
30
32
|
const 简中_数字转化 = { '一': '1', '二': '2', '三': '3', '四': '4', '五': '5', '六': '6', '七': '7', '八': '8', '九': '9', '十': '10' };
|
|
31
|
-
const
|
|
33
|
+
const 升级_传回配置 = [{ type: '定点王', setting: config.升级_定点王数量 }, { type: '野王', setting: config.升级_野王数量 }];
|
|
32
34
|
// 随手用到的变量
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
let n, x, y, a, b, c, d, e, f, g, text, aa;
|
|
36
|
+
let arr1 = [], arr2 = [], arr3 = [];
|
|
35
37
|
// 外援资料
|
|
36
38
|
const DishesEffect = require('./data/DishesEffect.json'); //料理对应效果
|
|
37
39
|
const AbilityType = require('./data/AbilityType.json'); //能力简称对应能力
|
|
@@ -265,6 +267,9 @@ async function apply(ctx, config) {
|
|
|
265
267
|
}
|
|
266
268
|
return next();
|
|
267
269
|
});
|
|
270
|
+
ctx.command('test18740').action(async ({ session }, ...args) => {
|
|
271
|
+
a = 1;
|
|
272
|
+
});
|
|
268
273
|
// 挂狗名单指令
|
|
269
274
|
ctx.command('挂狗名单').action(async ({ session }, ...args) => {
|
|
270
275
|
var dogs = await ctx.database.get('toram', { Database: 'dog' });
|
|
@@ -413,7 +418,7 @@ async function apply(ctx, config) {
|
|
|
413
418
|
// 计算经验
|
|
414
419
|
.map(boss => {
|
|
415
420
|
var bossValues = JSON.parse(boss.Values);
|
|
416
|
-
x = 等级_
|
|
421
|
+
x = 等级_经验倍率[Math.abs(PlayerLevel - bossValues.level)] || 0;
|
|
417
422
|
return {
|
|
418
423
|
...boss,
|
|
419
424
|
Values: JSON.stringify({
|
|
@@ -430,18 +435,18 @@ async function apply(ctx, config) {
|
|
|
430
435
|
});
|
|
431
436
|
// 根据配置获取头目信息并返回
|
|
432
437
|
text = `${PlayerLevel}级升级所需经验为${LevelUpExp}`;
|
|
433
|
-
for (var i = 0; i <
|
|
438
|
+
for (var i = 0; i < 升级_传回配置.length; i++) {
|
|
434
439
|
var TypeBoss = FitLevelBoss.filter(boss => {
|
|
435
|
-
return boss.Type ==
|
|
440
|
+
return boss.Type == 升级_传回配置[i].type;
|
|
436
441
|
});
|
|
437
442
|
n = TypeBoss.length - 1;
|
|
438
443
|
var TypeBossInfo = TypeBoss
|
|
439
|
-
.slice(0, Math.min(n + 1,
|
|
444
|
+
.slice(0, Math.min(n + 1, 升级_传回配置[i].setting))
|
|
440
445
|
.map(boss => {
|
|
441
446
|
var bossValues = JSON.parse(boss.Values);
|
|
442
447
|
return `${boss?.Name} 等级${bossValues?.level} ${bossValues?.map} 经验值${bossValues?.baseExp} ${bossValues?.element}属性`;
|
|
443
448
|
}).join('\n');
|
|
444
|
-
text += `\n\n${
|
|
449
|
+
text += `\n\n${升级_传回配置[i].type}:\n${TypeBossInfo}`;
|
|
445
450
|
}
|
|
446
451
|
return text;
|
|
447
452
|
}
|