koishi-plugin-rocom 1.0.13 → 1.0.17

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 (36) hide show
  1. package/lib/atlas-service.d.ts +33 -0
  2. package/lib/atlas-service.js +439 -0
  3. package/lib/client.d.ts +19 -0
  4. package/lib/client.js +101 -1
  5. package/lib/commands/account.js +1 -0
  6. package/lib/commands/merchant.js +11 -2
  7. package/lib/commands/query.js +141 -9
  8. package/lib/commands/tools.js +104 -0
  9. package/lib/commands/wiki.js +167 -6
  10. package/lib/egg-service.d.ts +2 -0
  11. package/lib/egg-service.js +50 -15
  12. package/lib/index.d.ts +5 -0
  13. package/lib/index.js +3153 -188
  14. package/lib/pet-data-service.d.ts +62 -0
  15. package/lib/pet-data-service.js +468 -0
  16. package/lib/render-templates/pet-data/index.html +172 -0
  17. package/lib/render-templates/pet-data/style.css +553 -0
  18. package/lib/render-templates/wiki/detail/index.html +84 -0
  19. package/lib/render-templates/wiki/list/index.html +84 -0
  20. package/lib/render-templates/wiki/menu/index.html +65 -0
  21. package/lib/render-templates/wiki/pet/index.html +158 -0
  22. package/lib/render-templates/wiki/pet/style.css +393 -0
  23. package/lib/render-templates/wiki/shared/style.css +431 -0
  24. package/lib/render-templates/wiki/skill/index.html +79 -0
  25. package/lib/render-templates/wiki/skill/style.css +233 -0
  26. package/lib/render-templates/wiki/suggestions/index.html +84 -0
  27. package/lib/render.js +37 -8
  28. package/lib/types.d.ts +9 -1
  29. package/lib/user.d.ts +23 -1
  30. package/lib/user.js +32 -1
  31. package/lib/wiki-catalog.d.ts +19 -0
  32. package/lib/wiki-catalog.js +124 -0
  33. package/lib/wiki-service.d.ts +220 -0
  34. package/lib/wiki-service.js +1463 -0
  35. package/package.json +1 -1
  36. package/readme.md +4 -5
@@ -0,0 +1,431 @@
1
+ @font-face {
2
+ font-family: 'mianfeiziti';
3
+ src: url('../../../ttf/HYWenHei-85W-1.ttf') format('truetype');
4
+ font-display: swap;
5
+ }
6
+
7
+ :root {
8
+ --font-main: 'mianfeiziti', "Microsoft YaHei", system-ui, sans-serif;
9
+ --ink: #352a1c;
10
+ --muted: #8c7a61;
11
+ --line: rgba(160, 140, 110, .32);
12
+ --panel: rgba(255, 252, 247, .86);
13
+ --panel-strong: rgba(255, 250, 238, .94);
14
+ --gold: #ffc65f;
15
+ --gold-deep: #d4842b;
16
+ --green: #2f9d73;
17
+ --blue: #3479bd;
18
+ --red: #c85b40;
19
+ }
20
+
21
+ * {
22
+ box-sizing: border-box;
23
+ }
24
+
25
+ html,
26
+ body {
27
+ margin: 0;
28
+ padding: 0;
29
+ }
30
+
31
+ body.wiki-body {
32
+ display: inline-block;
33
+ min-height: 100vh;
34
+ padding: 30px;
35
+ color: var(--ink);
36
+ background-color: #faf6ed;
37
+ font-family: var(--font-main);
38
+ }
39
+
40
+ .wiki-page {
41
+ position: relative;
42
+ width: 1280px;
43
+ min-height: 620px;
44
+ padding: 34px 44px;
45
+ background: url("../../../img/ercode-bg.D1ccSQKH.png") center center / 100% 100% no-repeat;
46
+ overflow: hidden;
47
+ }
48
+
49
+ .wiki-page::before {
50
+ content: "";
51
+ position: absolute;
52
+ inset: 0;
53
+ background: rgba(28, 22, 18, .10);
54
+ pointer-events: none;
55
+ z-index: 1;
56
+ }
57
+
58
+ .wiki-page::after {
59
+ content: "";
60
+ position: absolute;
61
+ right: -26px;
62
+ bottom: -18px;
63
+ width: 330px;
64
+ height: 330px;
65
+ background: url("../../../img/小洛克.png") right bottom / contain no-repeat;
66
+ opacity: .10;
67
+ pointer-events: none;
68
+ z-index: 2;
69
+ }
70
+
71
+ .wiki-content {
72
+ position: relative;
73
+ z-index: 3;
74
+ }
75
+
76
+ .hero {
77
+ display: grid;
78
+ grid-template-columns: minmax(0, 1fr) auto;
79
+ gap: 24px;
80
+ align-items: center;
81
+ margin-bottom: 18px;
82
+ padding-bottom: 16px;
83
+ border-bottom: 2px dashed var(--line);
84
+ }
85
+
86
+ .kicker {
87
+ color: var(--gold-deep);
88
+ font-size: 16px;
89
+ font-weight: 900;
90
+ letter-spacing: 0;
91
+ }
92
+
93
+ .subtitle {
94
+ margin-top: 5px;
95
+ color: var(--muted);
96
+ font-size: 15px;
97
+ line-height: 1.4;
98
+ }
99
+
100
+ h1 {
101
+ margin: 6px 0 0;
102
+ color: var(--gold);
103
+ font-size: 34px;
104
+ line-height: 1.12;
105
+ letter-spacing: 0;
106
+ -webkit-text-stroke: 1px var(--gold-deep);
107
+ text-shadow: 0 1px 3px rgba(0, 0, 0, .24);
108
+ }
109
+
110
+ .hero-summary {
111
+ max-width: 960px;
112
+ margin: 10px 0 0;
113
+ color: #5a3e1b;
114
+ font-size: 16px;
115
+ line-height: 1.48;
116
+ }
117
+
118
+ .hero-image {
119
+ width: 188px;
120
+ height: 188px;
121
+ display: flex;
122
+ align-items: center;
123
+ justify-content: center;
124
+ border: 1px solid var(--line);
125
+ border-radius: 8px;
126
+ background: rgba(255, 255, 255, .48);
127
+ }
128
+
129
+ .hero-image img {
130
+ max-width: 170px;
131
+ max-height: 170px;
132
+ object-fit: contain;
133
+ }
134
+
135
+ .badge-row,
136
+ .card-badges {
137
+ display: flex;
138
+ flex-wrap: wrap;
139
+ gap: 8px;
140
+ margin-top: 13px;
141
+ }
142
+
143
+ .badge-row span,
144
+ .card-badges span {
145
+ display: inline-flex;
146
+ align-items: center;
147
+ min-height: 30px;
148
+ padding: 5px 10px;
149
+ border-radius: 5px;
150
+ background: rgba(255, 198, 95, .22);
151
+ color: #7a4b14;
152
+ font-size: 14px;
153
+ font-weight: 900;
154
+ }
155
+
156
+ .badge-row span:first-child,
157
+ .card-badges span:first-child {
158
+ background: var(--green);
159
+ color: #ffffff;
160
+ }
161
+
162
+ .facts-grid {
163
+ display: grid;
164
+ grid-template-columns: repeat(4, minmax(0, 1fr));
165
+ gap: 12px;
166
+ margin-bottom: 16px;
167
+ }
168
+
169
+ .fact {
170
+ min-height: 64px;
171
+ padding: 10px 12px;
172
+ border: 1px solid var(--line);
173
+ border-radius: 7px;
174
+ background: var(--panel);
175
+ }
176
+
177
+ .fact span {
178
+ display: block;
179
+ color: var(--muted);
180
+ font-size: 13px;
181
+ }
182
+
183
+ .fact strong {
184
+ display: block;
185
+ margin-top: 5px;
186
+ color: var(--ink);
187
+ font-size: 16px;
188
+ line-height: 1.28;
189
+ overflow-wrap: anywhere;
190
+ }
191
+
192
+ .panel {
193
+ margin-top: 16px;
194
+ padding: 16px;
195
+ border: 1px solid var(--line);
196
+ border-radius: 8px;
197
+ background: rgba(255, 252, 247, .72);
198
+ }
199
+
200
+ .query-guide {
201
+ margin: 0 0 16px;
202
+ padding: 14px 16px;
203
+ border: 2px solid rgba(47, 157, 115, .42);
204
+ border-radius: 8px;
205
+ background: rgba(239, 255, 247, .88);
206
+ box-shadow: 0 8px 18px rgba(47, 157, 115, .10);
207
+ }
208
+
209
+ .guide-title {
210
+ color: var(--green);
211
+ font-size: 22px;
212
+ font-weight: 900;
213
+ line-height: 1.2;
214
+ }
215
+
216
+ .guide-text {
217
+ margin-top: 6px;
218
+ color: #4d3b22;
219
+ font-size: 16px;
220
+ line-height: 1.4;
221
+ }
222
+
223
+ .guide-examples {
224
+ display: flex;
225
+ flex-wrap: wrap;
226
+ gap: 8px;
227
+ margin-top: 10px;
228
+ }
229
+
230
+ .guide-examples span {
231
+ display: inline-flex;
232
+ align-items: center;
233
+ min-height: 32px;
234
+ padding: 6px 10px;
235
+ border-radius: 5px;
236
+ background: #ffffff;
237
+ color: #24684f;
238
+ font-size: 15px;
239
+ font-weight: 900;
240
+ box-shadow: inset 0 0 0 1px rgba(47, 157, 115, .20);
241
+ overflow-wrap: anywhere;
242
+ }
243
+
244
+ .panel-title {
245
+ display: flex;
246
+ align-items: baseline;
247
+ gap: 8px;
248
+ margin-bottom: 10px;
249
+ color: #c97926;
250
+ font-size: 20px;
251
+ font-weight: 900;
252
+ }
253
+
254
+ .panel-title small {
255
+ color: var(--muted);
256
+ font-size: 15px;
257
+ }
258
+
259
+ .card-grid {
260
+ display: grid;
261
+ grid-template-columns: repeat(4, minmax(0, 1fr));
262
+ gap: 12px;
263
+ }
264
+
265
+ .wiki-card {
266
+ min-height: 220px;
267
+ padding: 13px;
268
+ border: 1px solid rgba(160, 140, 110, .28);
269
+ border-radius: 8px;
270
+ background: var(--panel-strong);
271
+ overflow: hidden;
272
+ }
273
+
274
+ .wiki-card.is-compact {
275
+ min-height: 142px;
276
+ }
277
+
278
+ .card-image {
279
+ width: 78px;
280
+ height: 78px;
281
+ display: flex;
282
+ align-items: center;
283
+ justify-content: center;
284
+ margin: 0 auto 10px;
285
+ border-radius: 7px;
286
+ background: rgba(255, 255, 255, .44);
287
+ }
288
+
289
+ .card-image img {
290
+ max-width: 72px;
291
+ max-height: 72px;
292
+ object-fit: contain;
293
+ }
294
+
295
+ .wiki-card h2 {
296
+ min-height: 48px;
297
+ margin: 0;
298
+ color: var(--ink);
299
+ font-size: 18px;
300
+ line-height: 1.22;
301
+ text-align: center;
302
+ overflow-wrap: anywhere;
303
+ }
304
+
305
+ .wiki-card p {
306
+ height: 60px;
307
+ margin: 8px 0 0;
308
+ color: #6e5b42;
309
+ font-size: 14px;
310
+ line-height: 1.35;
311
+ overflow: hidden;
312
+ }
313
+
314
+ .meta-grid {
315
+ display: grid;
316
+ grid-template-columns: repeat(2, minmax(0, 1fr));
317
+ gap: 6px;
318
+ margin-top: 9px;
319
+ }
320
+
321
+ .meta-item {
322
+ min-height: 43px;
323
+ padding: 6px 8px;
324
+ border-radius: 5px;
325
+ background: rgba(232, 220, 196, .42);
326
+ }
327
+
328
+ .meta-item span,
329
+ .row-label {
330
+ display: block;
331
+ color: var(--muted);
332
+ font-size: 13px;
333
+ }
334
+
335
+ .meta-item b,
336
+ .row-value {
337
+ display: block;
338
+ margin-top: 2px;
339
+ color: var(--ink);
340
+ font-size: 13px;
341
+ line-height: 1.24;
342
+ overflow-wrap: anywhere;
343
+ }
344
+
345
+ .row-grid {
346
+ display: grid;
347
+ grid-template-columns: repeat(2, minmax(0, 1fr));
348
+ gap: 10px;
349
+ }
350
+
351
+ .row-item {
352
+ min-height: 58px;
353
+ padding: 10px 12px;
354
+ border: 1px solid rgba(160, 140, 110, .25);
355
+ border-radius: 7px;
356
+ background: var(--panel);
357
+ }
358
+
359
+ .topic-group {
360
+ margin-top: 14px;
361
+ }
362
+
363
+ .group-header {
364
+ margin-bottom: 12px;
365
+ }
366
+
367
+ .group-title {
368
+ color: #c97926;
369
+ font-size: 22px;
370
+ font-weight: 900;
371
+ }
372
+
373
+ .group-desc {
374
+ margin-top: 4px;
375
+ color: var(--muted);
376
+ font-size: 14px;
377
+ }
378
+
379
+ .wiki-menu-page .hero {
380
+ grid-template-columns: minmax(0, 1fr);
381
+ }
382
+
383
+ .wiki-menu-page .facts-grid {
384
+ grid-template-columns: repeat(3, minmax(0, 1fr));
385
+ }
386
+
387
+ .category-grid {
388
+ display: grid;
389
+ grid-template-columns: repeat(3, minmax(0, 1fr));
390
+ gap: 12px;
391
+ }
392
+
393
+ .category-card {
394
+ min-height: 156px;
395
+ padding: 14px 16px;
396
+ border: 1px solid rgba(160, 140, 110, .28);
397
+ border-radius: 8px;
398
+ background: var(--panel-strong);
399
+ }
400
+
401
+ .category-card h2 {
402
+ margin: 0;
403
+ color: var(--ink);
404
+ font-size: 19px;
405
+ line-height: 1.22;
406
+ }
407
+
408
+ .category-command {
409
+ margin-top: 9px;
410
+ color: #6e5b42;
411
+ font-size: 15px;
412
+ line-height: 1.35;
413
+ }
414
+
415
+ .category-children {
416
+ margin-top: 10px;
417
+ color: var(--muted);
418
+ font-size: 14px;
419
+ line-height: 1.36;
420
+ max-height: 58px;
421
+ overflow: hidden;
422
+ }
423
+
424
+ .footer {
425
+ display: flex;
426
+ justify-content: space-between;
427
+ gap: 16px;
428
+ margin-top: 20px;
429
+ color: #b39e7e;
430
+ font-size: 14px;
431
+ }
@@ -0,0 +1,79 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>技能 Wiki - {{name}}</title>
7
+ <link rel="stylesheet" href="{{_res_path}}render/wiki/skill/style.css">
8
+ </head>
9
+ <body class="skill-body">
10
+ <div class="skill-shell">
11
+ <header class="skill-hero">
12
+ <div class="hero-title">
13
+ <div class="kicker">ROCOM SKILL WIKI</div>
14
+ <div class="name-row">
15
+ <img src="{{icon}}" alt="{{name}}" onerror="this.style.display='none'">
16
+ <div>
17
+ <div class="skill-id">ID {{skill_id}}</div>
18
+ <h1>{{name}}</h1>
19
+ </div>
20
+ </div>
21
+ <p>{{description}}</p>
22
+ {{if flavor_text}}
23
+ <div class="flavor">{{flavor_text}}</div>
24
+ {{/if}}
25
+ </div>
26
+ <div class="hero-stats">
27
+ <div><span>PP</span><strong>{{cost}}</strong></div>
28
+ <div><span>威力</span><strong>{{power}}</strong></div>
29
+ <div><span>属性</span><strong>{{type}}</strong></div>
30
+ <div><span>类型</span><strong>{{skill_type}}</strong></div>
31
+ </div>
32
+ </header>
33
+
34
+ <main class="skill-content">
35
+ <section class="panel">
36
+ <div class="panel-title">基础信息</div>
37
+ <div class="meta-grid">
38
+ <div><span>伤害类型</span><strong>{{damage_type}}</strong></div>
39
+ <div><span>元素类型</span><strong>{{element_type}}</strong></div>
40
+ <div><span>技能系列</span><strong>{{families}}</strong></div>
41
+ </div>
42
+ {{if tags && tags.length}}
43
+ <div class="tag-row">
44
+ {{each tags tag}}
45
+ <span><img src="{{tag.icon}}" onerror="this.style.display='none'">{{tag.name}}</span>
46
+ {{/each}}
47
+ </div>
48
+ {{/if}}
49
+ </section>
50
+
51
+ <section class="panel pets-panel">
52
+ <div class="panel-title">可用精灵 <small>{{pet_total}}</small></div>
53
+ <div class="pet-grid">
54
+ {{each pets pet}}
55
+ <article class="pet-card">
56
+ <img src="{{pet.icon}}" alt="{{pet.name}}" onerror="this.style.display='none'">
57
+ <div>
58
+ <strong>{{pet.name}}</strong>
59
+ <span>#{{pet.pet_id}}</span>
60
+ {{if pet.sourceLine}}
61
+ <small>{{pet.sourceLine}}</small>
62
+ {{/if}}
63
+ </div>
64
+ </article>
65
+ {{/each}}
66
+ {{if !pets.length}}
67
+ <div class="empty">暂无可用精灵资料</div>
68
+ {{/if}}
69
+ </div>
70
+ </section>
71
+ </main>
72
+
73
+ <footer class="skill-footer">
74
+ <span>{{commandHint}}</span>
75
+ <span>{{copyright}}</span>
76
+ </footer>
77
+ </div>
78
+ </body>
79
+ </html>
@@ -0,0 +1,233 @@
1
+ :root {
2
+ --ink: #2d3543;
3
+ --muted: #6c7785;
4
+ --line: #d9e2ea;
5
+ --panel: #ffffff;
6
+ --blue: #3479bd;
7
+ --green: #2f9d73;
8
+ --gold: #d69b32;
9
+ }
10
+
11
+ @font-face {
12
+ font-family: 'HYWenHei-85W';
13
+ src: url('../../../ttf/HYWenHei-85W-1.ttf') format('truetype');
14
+ font-display: swap;
15
+ }
16
+
17
+ * {
18
+ box-sizing: border-box;
19
+ }
20
+
21
+ body.skill-body {
22
+ margin: 0;
23
+ color: var(--ink);
24
+ background: linear-gradient(180deg, #edf5fa 0%, #f9fbfd 52%, #eef4f1 100%);
25
+ font-family: "HYWenHei-85W", "Microsoft YaHei", sans-serif;
26
+ }
27
+
28
+ .skill-shell {
29
+ width: 960px;
30
+ padding: 28px;
31
+ }
32
+
33
+ .skill-hero {
34
+ display: grid;
35
+ grid-template-columns: minmax(0, 1fr) 310px;
36
+ gap: 18px;
37
+ border: 1px solid var(--line);
38
+ border-radius: 8px;
39
+ background: var(--panel);
40
+ padding: 26px;
41
+ box-shadow: 0 18px 40px rgba(45, 53, 67, .10);
42
+ }
43
+
44
+ .kicker {
45
+ color: var(--blue);
46
+ font-size: 18px;
47
+ font-weight: 900;
48
+ }
49
+
50
+ .name-row {
51
+ display: flex;
52
+ align-items: center;
53
+ gap: 16px;
54
+ margin-top: 16px;
55
+ }
56
+
57
+ .name-row img {
58
+ width: 78px;
59
+ height: 78px;
60
+ object-fit: contain;
61
+ border: 1px solid var(--line);
62
+ border-radius: 8px;
63
+ background: #f5f9fc;
64
+ }
65
+
66
+ .skill-id {
67
+ color: var(--muted);
68
+ font-size: 18px;
69
+ font-weight: 700;
70
+ }
71
+
72
+ h1 {
73
+ margin: 4px 0 0;
74
+ font-size: 52px;
75
+ line-height: 1.05;
76
+ letter-spacing: 0;
77
+ }
78
+
79
+ .hero-title p,
80
+ .flavor {
81
+ margin: 18px 0 0;
82
+ color: #405064;
83
+ font-size: 22px;
84
+ line-height: 1.45;
85
+ }
86
+
87
+ .flavor {
88
+ padding: 12px;
89
+ border-left: 5px solid var(--green);
90
+ background: #f2faf6;
91
+ font-size: 18px;
92
+ }
93
+
94
+ .hero-stats {
95
+ display: grid;
96
+ grid-template-columns: repeat(2, 1fr);
97
+ gap: 10px;
98
+ }
99
+
100
+ .hero-stats div,
101
+ .meta-grid div {
102
+ min-height: 92px;
103
+ padding: 14px;
104
+ border: 1px solid var(--line);
105
+ border-radius: 8px;
106
+ background: #f8fbfd;
107
+ }
108
+
109
+ .hero-stats span,
110
+ .meta-grid span {
111
+ display: block;
112
+ color: var(--muted);
113
+ font-size: 16px;
114
+ }
115
+
116
+ .hero-stats strong,
117
+ .meta-grid strong {
118
+ display: block;
119
+ margin-top: 6px;
120
+ font-size: 28px;
121
+ }
122
+
123
+ .skill-content {
124
+ display: grid;
125
+ gap: 18px;
126
+ margin-top: 18px;
127
+ }
128
+
129
+ .panel {
130
+ border: 1px solid var(--line);
131
+ border-radius: 8px;
132
+ background: var(--panel);
133
+ padding: 20px;
134
+ box-shadow: 0 10px 24px rgba(45, 53, 67, .07);
135
+ }
136
+
137
+ .panel-title {
138
+ margin-bottom: 14px;
139
+ font-size: 26px;
140
+ font-weight: 900;
141
+ }
142
+
143
+ .panel-title small {
144
+ color: var(--muted);
145
+ font-size: 18px;
146
+ }
147
+
148
+ .meta-grid {
149
+ display: grid;
150
+ grid-template-columns: repeat(3, 1fr);
151
+ gap: 10px;
152
+ }
153
+
154
+ .meta-grid div {
155
+ min-height: 82px;
156
+ }
157
+
158
+ .meta-grid strong {
159
+ font-size: 22px;
160
+ }
161
+
162
+ .tag-row {
163
+ display: flex;
164
+ flex-wrap: wrap;
165
+ gap: 8px;
166
+ margin-top: 14px;
167
+ }
168
+
169
+ .tag-row span {
170
+ display: inline-flex;
171
+ align-items: center;
172
+ gap: 6px;
173
+ padding: 8px 10px;
174
+ border-radius: 6px;
175
+ background: #eef5fa;
176
+ color: #405064;
177
+ font-size: 17px;
178
+ font-weight: 800;
179
+ }
180
+
181
+ .tag-row img {
182
+ width: 24px;
183
+ height: 24px;
184
+ object-fit: contain;
185
+ }
186
+
187
+ .pet-grid {
188
+ display: grid;
189
+ grid-template-columns: repeat(3, 1fr);
190
+ gap: 10px;
191
+ }
192
+
193
+ .pet-card {
194
+ display: grid;
195
+ grid-template-columns: 48px minmax(0, 1fr);
196
+ gap: 10px;
197
+ align-items: center;
198
+ padding: 10px;
199
+ border: 1px solid var(--line);
200
+ border-radius: 7px;
201
+ background: #fbfdff;
202
+ }
203
+
204
+ .pet-card img {
205
+ width: 48px;
206
+ height: 48px;
207
+ object-fit: contain;
208
+ }
209
+
210
+ .pet-card strong {
211
+ display: block;
212
+ font-size: 18px;
213
+ }
214
+
215
+ .pet-card span,
216
+ .pet-card small {
217
+ display: block;
218
+ color: var(--muted);
219
+ font-size: 14px;
220
+ }
221
+
222
+ .empty {
223
+ color: var(--muted);
224
+ font-size: 18px;
225
+ }
226
+
227
+ .skill-footer {
228
+ display: flex;
229
+ justify-content: space-between;
230
+ margin-top: 16px;
231
+ color: var(--muted);
232
+ font-size: 15px;
233
+ }