@sjtdev/koishi-plugin-dota2tracker 1.2.10-pre.2 → 1.2.11-pre

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/changelog.md CHANGED
@@ -1,3 +1,24 @@
1
+ ### 1.2.11-pre
2
+ **新增&改进**:
3
+ - 尝试对`match_2`模板添加命石显示,同时将队伍标识条由左边移至上边为命石让出空间。
4
+ (`match_1`晚些适配)
5
+
6
+ # 1.2.10
7
+ **新增**:
8
+ - 添加对新英雄`百戏大王`的支持。(战报播报、查询英雄等)
9
+
10
+ **修复**:
11
+ - 修复`查询英雄`图片中英雄的“基础攻击间隔”显示有误的问题。
12
+ - 修复战报图中若玩家名有html标签会导致图片排版错乱的问题。
13
+ - 修复周报与日报中评分条样式不正确的问题。
14
+
15
+ **改进**:
16
+ - 调整了总结模板和玩家信息模板中胜负字体颜色样式,使其看起来更清晰。
17
+ - 优化了总结模板中胜负数和胜率的样式。
18
+
19
+ <details>
20
+ <summary><b>1.2.10-pre更新日志</b></summary>
21
+
1
22
  ### 1.2.10-pre.2
2
23
  **改进**:
3
24
  - 调整了总结模板和玩家信息模板中胜负字体颜色样式,使其看起来更清晰。
@@ -7,6 +28,7 @@
7
28
  **修复**:
8
29
  - 修复战报图中若玩家名有html标签会导致图片排版错乱的问题。
9
30
  - 修复周报与日报中评分条样式不正确的问题。
31
+ </details>
10
32
 
11
33
  # 1.2.9
12
34
  **改进**:
@@ -18,7 +40,7 @@
18
40
 
19
41
  **修复**:
20
42
  - `查询英雄`:修复DOTA2 7.37版本更新后API变动导致部分英雄查询报错。
21
-
43
+
22
44
  <details>
23
45
  <summary><b>1.2.9-pre更新日志</b></summary>
24
46
 
package/lib/index.js CHANGED
@@ -110,8 +110,12 @@ function MATCH_INFO(matchId) {
110
110
  id
111
111
  name
112
112
  shortName
113
+ facets {
114
+ facetId
115
+ }
113
116
  }
114
- dotaPlus{
117
+ variant
118
+ dotaPlus {
115
119
  level
116
120
  }
117
121
  leaverStatus
@@ -168,7 +172,6 @@ function MATCH_INFO(matchId) {
168
172
  goldPerMinute
169
173
  experiencePerMinute
170
174
  heroHealing
171
-
172
175
  stats {
173
176
  campStack
174
177
  heroDamageReport {
@@ -182,7 +185,7 @@ function MATCH_INFO(matchId) {
182
185
  }
183
186
  }
184
187
  }
185
- additionalUnit{
188
+ additionalUnit {
186
189
  item0Id
187
190
  item1Id
188
191
  item2Id
@@ -194,7 +197,6 @@ function MATCH_INFO(matchId) {
194
197
  backpack2Id
195
198
  neutral0Id
196
199
  }
197
-
198
200
  isRandom
199
201
  }
200
202
  pickBans {
@@ -204,6 +206,13 @@ function MATCH_INFO(matchId) {
204
206
  order
205
207
  }
206
208
  }
209
+ constants {
210
+ facets {
211
+ id
212
+ color
213
+ icon
214
+ }
215
+ }
207
216
  }
208
217
 
209
218
  `;
@@ -564,7 +573,8 @@ function getImageUrl(image, type = "local" /* Local */, format = "png" /* png */
564
573
  return `https://cdn.cloudflare.steamstatic.com/apps/dota2/images/dota_react/${type}/${image}.${format}`;
565
574
  }
566
575
  __name(getImageUrl, "getImageUrl");
567
- function getFormattedMatchData(match) {
576
+ function getFormattedMatchData(data) {
577
+ const { match, constants } = data;
568
578
  ["radiant", "dire"].forEach((team) => {
569
579
  match[team] = { killsCount: match[team + "Kills"]?.reduce((acc, cva) => acc + cva, 0) ?? 0, damageReceived: 0, heroDamage: 0, networth: 0, experience: 0 };
570
580
  });
@@ -772,6 +782,9 @@ function getFormattedMatchData(match) {
772
782
  }
773
783
  }
774
784
  }
785
+ if (player.variant != null) {
786
+ player.facet = constants.facets.find((facet) => facet.id == player.hero.facets[player.variant - 1].facetId);
787
+ }
775
788
  });
776
789
  let ComparisonMode;
777
790
  ((ComparisonMode2) => {
@@ -1174,6 +1187,7 @@ var HEROES_CHINESE = {
1174
1187
  "126": ["虚无之灵", "紫猫"],
1175
1188
  "128": ["电炎绝手", "老奶奶"],
1176
1189
  "129": ["玛尔斯"],
1190
+ "131": ["百戏大王"],
1177
1191
  "135": ["破晓辰星", "大锤"],
1178
1192
  "136": ["玛西"],
1179
1193
  "137": ["獸", "畜"],
@@ -1382,7 +1396,7 @@ async function apply(ctx, config) {
1382
1396
  match = queryLocal[0].data;
1383
1397
  ctx.database.set("dt_previous_query_results", match.id, { queryTime: /* @__PURE__ */ new Date() });
1384
1398
  } else {
1385
- match = getFormattedMatchData((await query(MATCH_INFO(matchId))).data.match);
1399
+ match = getFormattedMatchData((await query(MATCH_INFO(matchId))).data);
1386
1400
  }
1387
1401
  if (match && (match.parsedDateTime || import_moment.default.unix(match.endDateTime).isBefore((0, import_moment.default)().subtract(config.dataParsingTimeoutMinutes, "minutes")))) {
1388
1402
  session.send((ctx.config.urlInMessageType.some((type) => type == "match") ? "https://stratz.com/matches/" + matchId : "") + await ctx.puppeteer.render(genImageHTML(match, config.template_match, "match" /* Match */)));
@@ -1734,7 +1748,7 @@ async function apply(ctx, config) {
1734
1748
  match = queryLocal[0].data;
1735
1749
  ctx.database.set("dt_previous_query_results", match.id, { queryTime: /* @__PURE__ */ new Date() });
1736
1750
  } else
1737
- match = getFormattedMatchData((await query(MATCH_INFO(pendingMatch.matchId))).data.match);
1751
+ match = getFormattedMatchData((await query(MATCH_INFO(pendingMatch.matchId))).data);
1738
1752
  if (match.parsedDateTime || import_moment.default.unix(match.endDateTime).isBefore(now.subtract(config.dataParsingTimeoutMinutes, "minutes"))) {
1739
1753
  pendingMatches = pendingMatches.filter((item) => item.matchId != match.id);
1740
1754
  const img = await ctx.puppeteer.render(genImageHTML(match, config.template_match, "match" /* Match */));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sjtdev/koishi-plugin-dota2tracker",
3
3
  "description": "koishi插件-追踪群友的DOTA2对局",
4
- "version": "1.2.10-pre.2",
4
+ "version": "1.2.11-pre",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -26,7 +26,7 @@
26
26
  "dota2"
27
27
  ],
28
28
  "dependencies": {
29
- "dotaconstants": "^8.10.0",
29
+ "dotaconstants": "^8.11.0",
30
30
  "ejs": "^3.1.10",
31
31
  "moment": "^2.30.1"
32
32
  },
@@ -637,7 +637,7 @@
637
637
  </tr>
638
638
  <tr>
639
639
  <td>基础攻击间隔</td>
640
- <td>${hero.attack_capability.toFixed(1)}</td>
640
+ <td>${hero.attack_rate.toFixed(1)}</td>
641
641
  </tr>
642
642
  <tr>
643
643
  <td>基础攻击前摇</td>
@@ -167,9 +167,9 @@
167
167
 
168
168
  .player > .hero_avatar > .party_line {
169
169
  position: absolute;
170
- height: 100%;
170
+ height: 2px;
171
171
  top: 0;
172
- width: 3px;
172
+ width: 100%;
173
173
  }
174
174
 
175
175
  .player > .hero_avatar > .party_mark {
@@ -178,8 +178,8 @@
178
178
  text-align: center;
179
179
  width: 16px;
180
180
  font-size: 10px;
181
- top: 2px;
182
- left: 5px;
181
+ top: 3px;
182
+ left: 1px;
183
183
  background-color: rgba(0, 0, 0, 0.8);
184
184
  }
185
185
 
@@ -231,6 +231,41 @@
231
231
  content: "IV";
232
232
  }
233
233
 
234
+ .player > .hero_avatar > .facet {
235
+ position: absolute;
236
+ left: 4px;
237
+ left: 0;
238
+ bottom: 0;
239
+ width: 16px;
240
+ height: 16px;
241
+ display: flex;
242
+ justify-content: center;
243
+ align-items: center;
244
+ z-index: 1;
245
+ }
246
+ .player > .hero_avatar > .facet > img {
247
+ width: 12px;
248
+ height: 12px;
249
+ }
250
+ .player > .hero_avatar > .facet.Red {
251
+ background: linear-gradient(to right, #9f3c3c, #4a2026);
252
+ }
253
+ .player > .hero_avatar > .facet.Yellow {
254
+ background: linear-gradient(to right, #c8a45c, #6f3d21);
255
+ }
256
+ .player > .hero_avatar > .facet.Green {
257
+ background: linear-gradient(to right, #a2b23e, #2d5a18);
258
+ }
259
+ .player > .hero_avatar > .facet.Blue {
260
+ background: linear-gradient(to right, #547ea6, #2a385e);
261
+ }
262
+ .player > .hero_avatar > .facet.Purple {
263
+ background: linear-gradient(to right, #675cae, #261c44);
264
+ }
265
+ .player > .hero_avatar > .facet.Gray {
266
+ background: linear-gradient(to right, #adb6be, #4e5557);
267
+ }
268
+
234
269
  .player > .rank {
235
270
  position: relative;
236
271
  grid-row: 1 / span 3;
@@ -487,6 +522,10 @@
487
522
  <div class="player ${player.team}${player.hero.id==80?" bear":""}" style="order: ${player.team==="radiant"?1:100};">
488
523
  <div class="hero_avatar row-1${player.partyId != null ? " party_" + match.party[player.partyId] : ""}">
489
524
  <img src="${utils.getImageUrl(player.hero.shortName, ImageType.Heroes)}" />
525
+ ${player.facet ? `
526
+ <div class="facet ${player.facet.color}">
527
+ <img src="${utils.getImageUrl(player.facet.icon, ImageType.IconsFacets)}">
528
+ </div>` : ""}
490
529
  <p class="level">${player.level}</p>
491
530
  <p class="party_line"></p>
492
531
  <p class="party_mark"></p>