@sjtdev/koishi-plugin-dota2tracker 1.2.6-pre → 1.2.6-pre3

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
@@ -2,7 +2,14 @@
2
2
  ##### (因koishi尚未更新发布pre版)
3
3
  **改进&修复**:修复了`查询英雄`图片中 技能数值未被正确替换、全才英雄基础攻击力显示错误的问题,并优化了命石描述显示方式
4
4
  **改进**:调整比赛战报图片样式:解析失败时显示的“第-手”改为“第?手”
5
- **修复**:修复玩家信息图片中场次表现评分为0时显示为?的问题
5
+ **修复**:修复`查询玩家`图片中场次表现评分为0时显示为?的问题
6
+
7
+ #### pre2
8
+ **改进&修复**:彻底完善了`查询英雄`图片中所有由命石、神杖、魔晶提供或改变的数值说明,修复命石说明中技能数值为百分数时未带百分号的问题。
9
+
10
+ #### pre3
11
+ **改进&修复**:继续优化`查询英雄`代码结构使由命石、神杖、魔晶改变的技能属性更直观;修复某些技能数据中有旧天赋加成数据留存、导致的天赋数值未被正确填充。
12
+ **改进**:为`艾欧`添加别名:["艾欧", "小精灵"] → ["艾欧", "小精灵", "精灵", "IO"]
6
13
 
7
14
  ### 1.2.5-fix
8
15
  **修复**:使用临时替代方案修复由koishi-4.17.9的bug引起的无法主动发送消息(播报战报等),待koishi更新修复后回滚此改动。
package/lib/index.js CHANGED
@@ -1133,7 +1133,7 @@ var HEROES_CHINESE = {
1133
1133
  "88": ["司夜刺客", "小强"],
1134
1134
  "89": ["娜迦海妖", "小娜迦"],
1135
1135
  "90": ["光之守卫", "光法"],
1136
- "91": ["艾欧", "小精灵"],
1136
+ "91": ["艾欧", "小精灵", "精灵", "IO"],
1137
1137
  "92": ["维萨吉", "死灵龙", "死灵飞龙"],
1138
1138
  "93": ["斯拉克", "小鱼", "小鱼人"],
1139
1139
  "94": ["美杜莎", "一姐", "美杜莎"],
@@ -1516,7 +1516,7 @@ async function apply(ctx, config) {
1516
1516
  const svs = ab.special_values.filter((sv) => sv.facet_bonus.name === facet.name);
1517
1517
  svs.forEach((sv) => {
1518
1518
  if (sv.heading_loc) {
1519
- facet.abilities.find((ability) => ab.id == ability.id)?.attributes.push({ heading_loc: sv.heading_loc, values: [...sv.facet_bonus.values] });
1519
+ facet.abilities.find((ability) => ab.id == ability.id)?.attributes.push({ heading_loc: sv.heading_loc, values: [...sv.facet_bonus.values], is_percentage: sv.is_percentage });
1520
1520
  }
1521
1521
  });
1522
1522
  facet.description_loc = formatHeroDesc(facet.description_loc, svs, "facet" /* Facet */);
@@ -1537,8 +1537,8 @@ async function apply(ctx, config) {
1537
1537
  if (target) {
1538
1538
  talent.name_loc = talent.name_loc.replace(match[0], target.values_float.join("/"));
1539
1539
  } else {
1540
- const ability = hero.abilities.find((ability2) => ability2.special_values.some((specialValue) => specialValue.bonuses.some((bonus) => bonus.name === talent.name)));
1541
- if (ability) {
1540
+ const abilities = hero.abilities.filter((ability) => ability.special_values.some((specialValue) => specialValue.bonuses.some((bonus) => bonus.name === talent.name)));
1541
+ for (const ability of abilities) {
1542
1542
  const specialValues = ability.special_values.filter((specialValue) => specialValue.bonuses.some((bonus) => bonus.name === talent.name));
1543
1543
  const regex2 = /{s:bonus_(.*?)}/g;
1544
1544
  let match2;
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.6-pre",
4
+ "version": "1.2.6-pre3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -412,16 +412,17 @@
412
412
  color: #9828ae;
413
413
  }
414
414
 
415
- .skill .description {
415
+ .skill > .description {
416
416
  color: #9bb1ce;
417
417
  margin-bottom: 32px;
418
418
  }
419
419
 
420
- .skill .facet {
420
+ .skill > .facet {
421
421
  padding-left: 0;
422
+ margin-bottom: 16px;
422
423
  }
423
424
 
424
- .skill .value{
425
+ .skill .value {
425
426
  color: #fff;
426
427
  }
427
428
 
@@ -449,6 +450,7 @@
449
450
  .skill .aghanim_description img {
450
451
  position: unset;
451
452
  transform: none;
453
+ margin-right: 8px;
452
454
  }
453
455
 
454
456
  .skill .notes {
@@ -458,7 +460,12 @@
458
460
  background-color: #263945;
459
461
  }
460
462
 
461
- .skill .attributes .item {
463
+ .skill .attributes {
464
+ line-height: 1.2em;
465
+ margin-bottom: 12px;
466
+ }
467
+
468
+ .skill .attributes .heading {
462
469
  color: #546780;
463
470
  }
464
471
 
@@ -466,16 +473,48 @@
466
473
  color: #4b525d;
467
474
  }
468
475
 
469
- .skill .attributes .values > img {
476
+ .skill .attributes .values img {
470
477
  width: 16px;
471
478
  }
472
479
 
473
- .skill .attributes {
474
- margin-bottom: 12px;
480
+ .skill .attributes .facet {
481
+ display: inline-flex;
482
+ font-size: 1em;
483
+ align-items: center;
484
+ line-height: 1.2em;
485
+ position: unset;
486
+ color: #fff;
487
+ }
488
+
489
+ .skill .attributes .facet span {
490
+ height: auto;
491
+ width: auto;
492
+ position: unset;
493
+ padding: 0 2px;
494
+ }
495
+
496
+ .skill .attributes .facet img {
497
+ width: auto;
498
+ height: 1em;
499
+ padding-right: 0.2em;
500
+ }
501
+
502
+ .skill .attributes .alternative .plus {
503
+ display: none;
504
+ }
505
+
506
+ .skill .attributes .primary ~ .alternative .plus {
507
+ display: inline;
508
+ }
509
+ .skill .attributes .primary ~ .alternative::before {
510
+ content: "(";
511
+ }
512
+ .skill .attributes .primary ~ .alternative::after {
513
+ content: ")";
475
514
  }
476
515
 
477
- .skill .mana_cost {
478
- padding-left: 12px;
516
+ .skill .cooldown {
517
+ padding-right: 12px;
479
518
  }
480
519
 
481
520
  .skill .cooldown::before,
@@ -635,7 +674,7 @@
635
674
  ${ability.description_ability_loc?`<div class="description">${ability.description_ability_loc}</div>`:""}
636
675
  ${ability.attributes&&ability.attributes?.length ? ability.attributes.map(attr=>
637
676
  `<div class="attributes">
638
- <p><span class="item">${attr.heading_loc}</span><span class="values">${attr.values.join(" / ")}</span></p>
677
+ <p><span class="item">${attr.heading_loc}</span><span class="values">${attr.values.map(value => value + (attr.is_percentage ? "%" : "")).join(" / ")}</span></p>
639
678
  </div>`).join(""):""}
640
679
  </div>`).join("")
641
680
  :""}
@@ -710,7 +749,33 @@
710
749
  <div class="attributes">
711
750
  ${item.special_values
712
751
  .filter(sv => sv.heading_loc)
713
- .map((sv) => `<p><span class="item">${sv.heading_loc}</span><span class="values">${sv.values_float.map(value=>value+(sv.is_percentage?"%":"")).join(" / ")}${sv.bonuses.map(bonus=>` (<img src="${utils.getImageUrl("talents","icons","svg")}"/>${(bonus.value>0?"+":"")+bonus.value+(sv.is_percentage?"%":"")})`).join(" ")}</span></p>`)
752
+ .map((sv) =>
753
+ `<p>
754
+ <span class="heading">${sv.heading_loc}</span>
755
+ <span class="values">
756
+ ${!(sv.values_float.every(value => value === 0) || sv.values_float.length == 0) ?
757
+ `<span class="primary${(sv.values_float.every(value => value === 0) || sv.values_float.length == 0)?" empty":""}">
758
+ ${(!((sv.values_float.every(value => value === 0) || sv.values_float.length == 0) && (sv.values_scepter.length || sv.values_shard.length || sv.facet_bonus.name))
759
+ ? (sv.values_float.map(value => value + (sv.is_percentage ? "%" : "")).join(" / ")) : "")}
760
+ </span>` : "" }
761
+ ${sv.values_scepter && sv.values_scepter.length ?
762
+ `<span class="alternative scepter">
763
+ <img src="${utils.getImageUrl("scepter")}"/>${sv.values_scepter.map(value => (value > 0 ? '<span class="plus">+</span>' : "") + value + (sv.is_percentage ? "%" : "")).join(" / ")}
764
+ </span>` : "" }
765
+ ${sv.values_shard && sv.values_shard.length ?
766
+ `<span class="alternative shard">
767
+ <img src="${utils.getImageUrl("shard")}"/>${sv.values_shard.map(value => (value > 0 ? '<span class="plus">+</span>' : "") + value + (sv.is_percentage ? "%" : "")).join(" / ")}
768
+ </span>` : "" }
769
+ ${sv.facet_bonus.name ?
770
+ `<span class="alternative facet">
771
+ <span class="facet"><span class="name_back type_${hero.facets.find(facet=>facet.name==sv.facet_bonus.name).color}"><img src="${utils.getImageUrl(hero.facets.find(facet=>facet.name==sv.facet_bonus.name).icon, ImageType.IconsFacets)}" />${sv.facet_bonus.values.map(value => (value > 0 ? '<span class="plus">+</span>' : "") + value + (sv.is_percentage ? "%" : "")).join(" / ")}</span></span>
772
+ </span>` : "" }
773
+ ${sv.bonuses.length ?
774
+ `<span class="alternative talent">
775
+ ${sv.bonuses.map(bonus=>` <img src="${utils.getImageUrl("talents","icons","svg")}"/>${(bonus.value>0?'<span class="plus">+</span>':"")+bonus.value+(sv.is_percentage?"%":"")}`).join(" ")}
776
+ </span>` : "" }
777
+ </span>
778
+ </p>`)
714
779
  .join("")}
715
780
  </div>
716
781
  <p>