koishi-plugin-toram 0.4.5 → 0.5.0
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 +23 -29
- package/package.json +1 -1
- package/readme.md +17 -59
package/lib/index.js
CHANGED
|
@@ -38,13 +38,6 @@ async function apply(ctx, config) {
|
|
|
38
38
|
}, {
|
|
39
39
|
primary: 'id'
|
|
40
40
|
});
|
|
41
|
-
ctx.model.extend('toram_dishes_effect', {
|
|
42
|
-
id: 'number',
|
|
43
|
-
type: 'string',
|
|
44
|
-
effect: 'string'
|
|
45
|
-
}, {
|
|
46
|
-
primary: 'id'
|
|
47
|
-
});
|
|
48
41
|
ctx.model.extend('toram_data_version', {
|
|
49
42
|
id: 'number',
|
|
50
43
|
database: 'string',
|
|
@@ -55,16 +48,13 @@ async function apply(ctx, config) {
|
|
|
55
48
|
const databasesToUpsert = [
|
|
56
49
|
{ tableName: 'toram_boss',
|
|
57
50
|
fileName: './data/boss',
|
|
58
|
-
version: '0.
|
|
51
|
+
version: '0.5.0' },
|
|
59
52
|
{ tableName: 'toram_dishes',
|
|
60
53
|
fileName: './data/dishes',
|
|
61
|
-
version: '0.
|
|
54
|
+
version: '0.5.0' },
|
|
62
55
|
{ tableName: 'toram_dishes_name',
|
|
63
56
|
fileName: './data/dishes_name',
|
|
64
|
-
version: '0.
|
|
65
|
-
{ tableName: 'toram_dishes_effect',
|
|
66
|
-
fileName: './data/dishes_effect',
|
|
67
|
-
version: '0.4.0-alpha.1' }
|
|
57
|
+
version: '0.5.0' }
|
|
68
58
|
];
|
|
69
59
|
const PlayerExpRate = [11, 11, 11, 11, 11, 10, 9, 7, 3];
|
|
70
60
|
const NumberReplace = { '一': '1', '二': '2', '三': '3', '四': '4', '五': '5', '六': '6', '七': '7', '八': '8', '九': '9', '十': '10' };
|
|
@@ -74,11 +64,11 @@ async function apply(ctx, config) {
|
|
|
74
64
|
const DishesPlayerNotFind = [
|
|
75
65
|
'魔导书里还没有这个人的料理记录哦?去找青灯让她加一下吧~',
|
|
76
66
|
'如果你确定输入了正确的玩家昵称,那大概是还没有收录这个人的料理吧【缩缩】',
|
|
77
|
-
'【翻翻】嗯……已查阅
|
|
67
|
+
'【翻翻】嗯……已查阅504条料理记录,找到符合的记录0条【合上书本】'
|
|
78
68
|
];
|
|
79
69
|
const DishesNotFind = [
|
|
80
70
|
'居然!青灯现在还没发现有人做这个料理!怎么回事呢~',
|
|
81
|
-
'【翻翻】嗯……已查阅
|
|
71
|
+
'【翻翻】嗯……已查阅504条料理记录,找到符合的记录0条【合上书本】',
|
|
82
72
|
'好像还没有人做这种料理呢……你要不要考虑一下?w'
|
|
83
73
|
];
|
|
84
74
|
const DishesLevelError = [
|
|
@@ -87,7 +77,7 @@ async function apply(ctx, config) {
|
|
|
87
77
|
'魔导书很担心你的精神状态——'
|
|
88
78
|
];
|
|
89
79
|
const DishesLevelNotFind = [
|
|
90
|
-
'【翻翻】嗯……已查阅
|
|
80
|
+
'【翻翻】嗯……已查阅504条料理记录,找到符合的记录0条【合上书本】',
|
|
91
81
|
'冷门料理或者等级较低的热门料理是不太会主动收录的哦?想加的话要去找青灯呢~',
|
|
92
82
|
'魔导书还没有记录有这个等级的这种料理呢——'
|
|
93
83
|
];
|
|
@@ -96,6 +86,20 @@ async function apply(ctx, config) {
|
|
|
96
86
|
'魔导书很担心你的精神状态——',
|
|
97
87
|
'不可以调戏魔导书!'
|
|
98
88
|
];
|
|
89
|
+
const DishesEffect = {
|
|
90
|
+
'炖牛肉': '仇恨值增加', '奶油炖菜': '仇恨值减少',
|
|
91
|
+
'黄金炒饭': '体力值上限', '烩炒饭': '魔法值上限',
|
|
92
|
+
'鲣鱼饭团': '力量', '梅干饭团': '智力', '金枪鱼蛋黄酱饭团': '耐力', '明太子饭团': '敏捷', '鲑鱼饭团': '灵巧',
|
|
93
|
+
'章鱼烧': '暴击率', '日式炒面': '攻击魔法回复',
|
|
94
|
+
'玛格丽特披萨': '武器物理攻击', '辣香肠披萨': '物理攻击', '海鲜披萨': '魔法攻击',
|
|
95
|
+
'酱油拉面': '命中', '盐味拉面': '回避', '豚骨拉面': '物理防御', '味增拉面': '魔法防御',
|
|
96
|
+
'水果百汇': '掉宝率加成', '巧克力百汇': '经验值加成',
|
|
97
|
+
'巧克力蛋糕': '物理屏障', '起司蛋糕': '魔法屏障',
|
|
98
|
+
'美式松饼': '百分比屏障',
|
|
99
|
+
'牛肉汉堡': '物理抗性', '鱼排汉堡': '魔法抗性',
|
|
100
|
+
'蜂蜜吐司': '光属性抗性', '布丁吐司': '土属性抗性', '香草吐司': '无属性抗性', '香蒜吐司': '暗属性抗性', '鲔鱼吐司': '水属性抗性', '煎蛋吐司': '火属性抗性', '起司吐司': '风属性抗性',
|
|
101
|
+
'奶油培根意大利面': '对光属性伤害', '青酱意大利面': '对地属性伤害', '香蒜辣椒意大利面': '对无属性伤害', '墨鱼意大利面': '对暗属性伤害', '蛤蜊意大利面': '对水属性伤害', '肉酱意大利面': '对火属性伤害', '那不勒斯意大利面': '对风属性伤害'
|
|
102
|
+
};
|
|
99
103
|
ctx.middleware(async (session, next) => {
|
|
100
104
|
let { elements } = session;
|
|
101
105
|
for (const element of elements) {
|
|
@@ -138,8 +142,6 @@ async function apply(ctx, config) {
|
|
|
138
142
|
}
|
|
139
143
|
return DishesPlayerNotFind[Math.floor(Math.random() * DishesPlayerNotFind.length)];
|
|
140
144
|
}
|
|
141
|
-
const DishesEffectArr = await ctx.database.get('toram_dishes_effect', { type: DishesType });
|
|
142
|
-
const DishesEffect = DishesEffectArr[0]?.effect;
|
|
143
145
|
if (DishesLevelChoice == undefined) {
|
|
144
146
|
let Level10Dishes, Level9Dishes, Level8Dishes;
|
|
145
147
|
const GetLevel10Dishes = await ctx.database.get('toram_dishes', { $and: [{ type: DishesType }, { level: 10 }] });
|
|
@@ -171,13 +173,13 @@ async function apply(ctx, config) {
|
|
|
171
173
|
const LevelUnder8Dishes = GetAllLevelDishes.map((player) => {
|
|
172
174
|
return `${player?.name}(${player?.level}级)`;
|
|
173
175
|
});
|
|
174
|
-
text = DishesType + '(' + DishesEffect + ')名单如下:\n' + LevelUnder8Dishes;
|
|
176
|
+
text = DishesType + '(' + DishesEffect[DishesType] + ')名单如下:\n' + LevelUnder8Dishes;
|
|
175
177
|
text = text.replace(/,/g, ',');
|
|
176
178
|
return text;
|
|
177
179
|
}
|
|
178
180
|
return DishesNotFind[Math.floor(Math.random() * DishesNotFind.length)];
|
|
179
181
|
}
|
|
180
|
-
text = DishesType + '(' + DishesEffect + ')名单如下:';
|
|
182
|
+
text = DishesType + '(' + DishesEffect[DishesType] + ')名单如下:';
|
|
181
183
|
if (GetLevel10Dishes.length != 0) {
|
|
182
184
|
text += '\n10级:\n' + Level10Dishes;
|
|
183
185
|
}
|
|
@@ -215,7 +217,7 @@ async function apply(ctx, config) {
|
|
|
215
217
|
.sort(function compareFunction(item1, item2) {
|
|
216
218
|
return item1.localeCompare(item2);
|
|
217
219
|
});
|
|
218
|
-
text = DishesType + '(' + DishesEffect + ')' + DishesLevelChoice + '级名单如下:\n' + LevelChoiceDishes;
|
|
220
|
+
text = DishesType + '(' + DishesEffect[DishesType] + ')' + DishesLevelChoice + '级名单如下:\n' + LevelChoiceDishes;
|
|
219
221
|
text = text.replace(/,/g, ',');
|
|
220
222
|
return text;
|
|
221
223
|
}
|
|
@@ -303,11 +305,6 @@ async function apply(ctx, config) {
|
|
|
303
305
|
{ id: row[0], name: row[1], type: row[2] }
|
|
304
306
|
]);
|
|
305
307
|
}
|
|
306
|
-
if (tableName == 'toram_dishes_effect') {
|
|
307
|
-
await ctx.database.upsert('toram_dishes_effect', [
|
|
308
|
-
{ id: row[0], type: row[1], effect: row[2] }
|
|
309
|
-
]);
|
|
310
|
-
}
|
|
311
308
|
}
|
|
312
309
|
await ctx.database.upsert('toram_data_version', [{ database: tableName, version: version }], 'database');
|
|
313
310
|
}
|
|
@@ -326,9 +323,6 @@ async function apply(ctx, config) {
|
|
|
326
323
|
if (err.message.includes('/dishes_name')) {
|
|
327
324
|
return '写入中断……未在data文件夹里找到文件dishes_name.json';
|
|
328
325
|
}
|
|
329
|
-
if (err.message.includes('/dishes_effect')) {
|
|
330
|
-
return '写入中断……未在data文件夹里找到文件dishes_effect.json';
|
|
331
|
-
}
|
|
332
326
|
if (err.message.includes('/dishes')) {
|
|
333
327
|
return '写入中断……未在data文件夹里找到文件dishes.json';
|
|
334
328
|
}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -18,72 +18,30 @@ QQ:1874053520
|
|
|
18
18
|
|
|
19
19
|
————————————
|
|
20
20
|
|
|
21
|
-
0.
|
|
21
|
+
0.5.0
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
数据库结构更新,请在数据表toram_data_version中移除toram_dishes_effect的记录
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
0.4.4
|
|
28
|
-
|
|
29
|
-
支持'xx级'及部分汉字数字的写法作为参数
|
|
30
|
-
|
|
31
|
-
————————————
|
|
32
|
-
|
|
33
|
-
0.4.3
|
|
34
|
-
|
|
35
|
-
指令参数无结果时会随机返回少量语句
|
|
36
|
-
|
|
37
|
-
————————————
|
|
38
|
-
|
|
39
|
-
0.4.2
|
|
40
|
-
|
|
41
|
-
修复了升级指令错误的bug
|
|
42
|
-
|
|
43
|
-
————————————
|
|
44
|
-
|
|
45
|
-
0.4.1
|
|
46
|
-
|
|
47
|
-
修复了数据文件写入无效的bug
|
|
48
|
-
|
|
49
|
-
————————————
|
|
50
|
-
|
|
51
|
-
0.4.0
|
|
52
|
-
|
|
53
|
-
新增数据文件写入功能!!!数据写入完毕后就可以正常使用啦~
|
|
54
|
-
|
|
55
|
-
暂时移除组队大厅相关功能
|
|
25
|
+
料理数据更新【496→504】
|
|
56
26
|
|
|
57
27
|
————————————
|
|
58
28
|
|
|
59
|
-
0.
|
|
29
|
+
0.4.x
|
|
60
30
|
|
|
61
|
-
|
|
31
|
+
5.料理数据更新
|
|
32
|
+
4.支持'xx级'及部分汉字数字的写法作为参数
|
|
33
|
+
3.指令参数无结果时会随机返回少量语句
|
|
34
|
+
2.修复了升级指令错误的bug
|
|
35
|
+
1.修复了数据文件写入无效的bug
|
|
36
|
+
0.新增数据文件写入功能!!!数据写入完毕后就可以正常使用啦~
|
|
37
|
+
暂时移除组队大厅相关功能
|
|
62
38
|
|
|
63
39
|
————————————
|
|
64
40
|
|
|
65
|
-
0.3.
|
|
66
|
-
|
|
67
|
-
料理查询支持输入玩家昵称【需要数据表toram_dishes_effect】
|
|
68
|
-
|
|
69
|
-
————————————
|
|
70
|
-
|
|
71
|
-
0.3.4
|
|
72
|
-
|
|
73
|
-
料理查询功能优化
|
|
74
|
-
|
|
75
|
-
————————————
|
|
76
|
-
|
|
77
|
-
0.3.3
|
|
78
|
-
|
|
79
|
-
新增料理查询功能【需要数据表toram_dishes及toram_dishes_name】
|
|
80
|
-
|
|
81
|
-
————————————
|
|
82
|
-
|
|
83
|
-
0.3.2
|
|
84
|
-
|
|
85
|
-
本插件当前具有以下功能:
|
|
86
|
-
|
|
87
|
-
1.升级查询【需要数据表toram_boss】
|
|
41
|
+
0.3.x
|
|
88
42
|
|
|
89
|
-
|
|
43
|
+
6.料理查询功能优化【需要更新数据表】
|
|
44
|
+
5.料理查询支持输入玩家昵称【需要数据表toram_dishes_effect】
|
|
45
|
+
4.料理查询功能优化
|
|
46
|
+
3.新增料理查询功能【需要数据表toram_dishes及toram_dishes_name】
|
|
47
|
+
2.本插件当前具有以下功能:1.升级查询【需要数据表toram_boss】2.组队大厅相关
|