@qianhaoq/dsh-dota2ai 0.2.11 → 0.2.13

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 (3) hide show
  1. package/lib/client.js +100 -11
  2. package/lib/index.js +412 -58
  3. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -27509,6 +27509,15 @@ var T9 = {
27509
27509
  events: { en: "What happened", zh: "\u7ECF\u8FC7", ru: "\u0425\u043E\u0434 \u0441\u043E\u0431\u044B\u0442\u0438\u0439" },
27510
27510
  dealt: { en: "Damage to heroes", zh: "\u5BF9\u82F1\u96C4\u4F24\u5BB3", ru: "\u0423\u0440\u043E\u043D \u043F\u043E \u0433\u0435\u0440\u043E\u044F\u043C" },
27511
27511
  firstHeld: { en: "First held", zh: "\u9996\u6B21\u6301\u6709", ru: "\u0412\u043F\u0435\u0440\u0432\u044B\u0435 \u043F\u043E\u043B\u0443\u0447\u0435\u043D" },
27512
+ purchased: { en: "Purchased", zh: "\u8D2D\u9F50\u4E8E", ru: "\u041A\u0443\u043F\u043B\u0435\u043D" },
27513
+ deliveryDelay: { en: "Delivery delay", zh: "\u5230\u8D27\u5EF6\u8FDF", ru: "\u0417\u0430\u0434\u0435\u0440\u0436\u043A\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438" },
27514
+ courierDiedDuringDelivery: { en: "Team courier killed during delivery", zh: "\u9001\u8FBE\u671F\u95F4\u5DF1\u65B9\u4FE1\u4F7F\u9635\u4EA1", ru: "\u041A\u0443\u0440\u044C\u0435\u0440 \u043A\u043E\u043C\u0430\u043D\u0434\u044B \u0443\u0431\u0438\u0442 \u043F\u0440\u0438 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0435" },
27515
+ enemyCourierDiedDuringDelivery: { en: "Enemy courier killed during delivery", zh: "\u9001\u8FBE\u671F\u95F4\u654C\u65B9\u4FE1\u4F7F\u9635\u4EA1", ru: "\u041A\u0443\u0440\u044C\u0435\u0440 \u0432\u0440\u0430\u0433\u0430 \u0443\u0431\u0438\u0442 \u043F\u0440\u0438 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0435" },
27516
+ teamCourierDeaths: { en: "Your team's courier deaths", zh: "\u6211\u65B9\u4FE1\u4F7F\u9635\u4EA1", ru: "\u0421\u043C\u0435\u0440\u0442\u0438 \u043A\u0443\u0440\u044C\u0435\u0440\u043E\u0432 \u043A\u043E\u043C\u0430\u043D\u0434\u044B" },
27517
+ purchaseSource: {
27518
+ direct: { en: "direct buy", zh: "\u76F4\u63A5\u8D2D\u4E70", ru: "\u043F\u0440\u044F\u043C\u0430\u044F \u043F\u043E\u043A\u0443\u043F\u043A\u0430" },
27519
+ components: { en: "all components bought", zh: "\u6563\u4EF6\u4E70\u9F50", ru: "\u0432\u0441\u0435 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u044B \u043A\u0443\u043F\u043B\u0435\u043D\u044B" }
27520
+ },
27512
27521
  refGold: { en: "gold", zh: "\u91D1", ru: "\u0437\u043E\u043B\u043E\u0442\u0430" },
27513
27522
  refRecipe: { en: "Recipe:", zh: "\u5408\u6210\uFF1A", ru: "\u0420\u0435\u0446\u0435\u043F\u0442:" },
27514
27523
  refVs: { en: "against", zh: "\u5BF9\u9635", ru: "\u043F\u0440\u043E\u0442\u0438\u0432" },
@@ -27524,6 +27533,11 @@ var T9 = {
27524
27533
  pierces: { en: "goes through spell immunity", zh: "\u65E0\u89C6\u6280\u80FD\u514D\u75AB", ru: "\u043F\u0440\u043E\u0431\u0438\u0432\u0430\u0435\u0442 \u043D\u0435\u0432\u043E\u0441\u043F\u0440\u0438\u0438\u043C\u0447\u0438\u0432\u043E\u0441\u0442\u044C \u043A \u043C\u0430\u0433\u0438\u0438" },
27525
27534
  noPierce: { en: "blocked by spell immunity", zh: "\u88AB\u6280\u80FD\u514D\u75AB\u6321\u4F4F", ru: "\u0431\u043B\u043E\u043A\u0438\u0440\u0443\u0435\u0442\u0441\u044F \u043D\u0435\u0432\u043E\u0441\u043F\u0440\u0438\u0438\u043C\u0447\u0438\u0432\u043E\u0441\u0442\u044C\u044E \u043A \u043C\u0430\u0433\u0438\u0438" },
27526
27535
  ultimate: { en: "ultimate", zh: "\u5927\u62DB", ru: "\u0443\u043B\u044C\u0442" },
27536
+ scepterGranted: { en: "Aghanim's Scepter", zh: "\u963F\u54C8\u5229\u59C6\u795E\u6756", ru: "Aghanim's Scepter" },
27537
+ shardGranted: { en: "Aghanim's Shard", zh: "\u963F\u54C8\u5229\u59C6\u9B54\u6676", ru: "Aghanim's Shard" },
27538
+ scepterEffect: { en: "Aghanim's Scepter", zh: "\u795E\u6756\u6548\u679C", ru: "Aghanim's Scepter" },
27539
+ shardEffect: { en: "Aghanim's Shard", zh: "\u9B54\u6676\u6548\u679C", ru: "Aghanim's Shard" },
27540
+ grantedAbility: { en: "new ability", zh: "\u6388\u4E88\u6280\u80FD", ru: "\u043D\u043E\u0432\u0430\u044F \u0441\u043F\u043E\u0441\u043E\u0431\u043D\u043E\u0441\u0442\u044C" },
27527
27541
  sec: { en: "s", zh: "\u79D2", ru: "\u0441" },
27528
27542
  lane: { top: { en: "Top lane", zh: "\u4E0A\u8DEF", ru: "\u0412\u0435\u0440\u0445\u043D\u044F\u044F \u043B\u0438\u043D\u0438\u044F" }, mid: { en: "Mid lane", zh: "\u4E2D\u8DEF", ru: "\u041C\u0438\u0434" }, bot: { en: "Bottom lane", zh: "\u4E0B\u8DEF", ru: "\u041D\u0438\u0436\u043D\u044F\u044F \u043B\u0438\u043D\u0438\u044F" } },
27529
27543
  laneAt10: { en: "at 10:00", zh: "10 \u5206\u949F\u65F6", ru: "\u043A 10:00" },
@@ -28500,13 +28514,43 @@ function Record({ data: data2, lang }) {
28500
28514
  ] }, l.lane))
28501
28515
  ] });
28502
28516
  }
28503
- if (data2.kind === "item") return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "ag-rec", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "ag-rec-head", children: [
28504
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: r.first_held.clock }),
28505
- " \xB7 ",
28506
- N(r.item),
28507
- " \xB7 ",
28508
- t2(T9.firstHeld)
28509
- ] }) });
28517
+ if (data2.kind === "item") {
28518
+ const isEnemyCourier = Array.isArray(r.enemy_team_courier_deaths_during_delivery);
28519
+ const courierDeaths = Array.isArray(r.my_team_courier_deaths_during_delivery) ? r.my_team_courier_deaths_during_delivery : Array.isArray(r.enemy_team_courier_deaths_during_delivery) ? r.enemy_team_courier_deaths_during_delivery : [];
28520
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ag-rec", children: [
28521
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "ag-rec-head", children: [
28522
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: r.first_held.clock }),
28523
+ " \xB7 ",
28524
+ N(r.item),
28525
+ " \xB7 ",
28526
+ t2(T9.firstHeld)
28527
+ ] }),
28528
+ (r.first_purchased || typeof r.delivery_delay_seconds === "number" && r.delivery_delay_seconds > 0) && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "ag-rec-line", children: [
28529
+ r.first_purchased && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ag-chip", children: [
28530
+ t2(T9.purchased),
28531
+ " ",
28532
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("em", { children: r.first_purchased.clock }),
28533
+ r.first_purchased.source && T9.purchaseSource[r.first_purchased.source] && ` \xB7 ${t2(T9.purchaseSource[r.first_purchased.source])}`
28534
+ ] }),
28535
+ typeof r.delivery_delay_seconds === "number" && r.delivery_delay_seconds > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: `ag-chip ${courierDeaths.length > 0 ? "is-warn" : ""}`, children: [
28536
+ t2(T9.deliveryDelay),
28537
+ " ",
28538
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("em", { children: [
28539
+ "+",
28540
+ r.delivery_delay_seconds,
28541
+ t2(T9.sec)
28542
+ ] })
28543
+ ] })
28544
+ ] }),
28545
+ courierDeaths.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "ag-rec-line", children: [
28546
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: t2(isEnemyCourier ? T9.enemyCourierDiedDuringDelivery : T9.courierDiedDuringDelivery) }),
28547
+ courierDeaths.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ag-chip is-warn", children: [
28548
+ d.clock,
28549
+ d.killed_by ? ` \u2190 ${N(d.killed_by)}` : ""
28550
+ ] }, `${d.clock}-${i}`))
28551
+ ] })
28552
+ ] });
28553
+ }
28510
28554
  if (data2.kind === "lane") {
28511
28555
  const pc = (v) => `${Math.round(v * 100)}%`;
28512
28556
  const signed = (v) => `${v > 0 ? "+" : v < 0 ? "\u2212" : ""}${Math.abs(v)}`;
@@ -28792,6 +28836,14 @@ function Record({ data: data2, lang }) {
28792
28836
  if (data2.kind === "hero_info") {
28793
28837
  const b = r.base ?? {};
28794
28838
  const shown = [["health", b.health], ["mana", b.mana], ["armor", b.armor], ["magic_resistance", b.magic_resistance], ["attack_range", b.attack_range], ["base_attack_time", b.base_attack_time], ["move_speed", b.move_speed]];
28839
+ const aghsLines = (list, label, prefix) => (Array.isArray(list) ? list : []).map((u, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "ag-rec-line", children: [
28840
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ag-chip", children: [
28841
+ t2(label),
28842
+ u.kind === "granted_ability" ? ` \xB7 ${t2(T9.grantedAbility)}` : ""
28843
+ ] }),
28844
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: u.name ?? N(u.ability) }),
28845
+ u.description ? ` ${u.description}` : ""
28846
+ ] }, `${prefix}-${u.ability}-${i}`));
28795
28847
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ag-rec", children: [
28796
28848
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "ag-rec-head", children: [
28797
28849
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: r.name ?? N(r.hero) }),
@@ -28812,7 +28864,9 @@ function Record({ data: data2, lang }) {
28812
28864
  pretty(k2),
28813
28865
  " ",
28814
28866
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("em", { children: String(v) })
28815
- ] }, k2)) })
28867
+ ] }, k2)) }),
28868
+ aghsLines(r.aghanims_scepter, T9.scepterEffect, "sc"),
28869
+ aghsLines(r.aghanims_shard, T9.shardEffect, "sh")
28816
28870
  ] });
28817
28871
  }
28818
28872
  if (data2.kind === "matchup") {
@@ -29784,12 +29838,36 @@ function Record({ data: data2, lang }) {
29784
29838
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("caption", { className: "ag-rec-sub", children: t2(T9.buildItems) }),
29785
29839
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("tr", { children: T9.buildCols[lang].map((c) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("th", { scope: "col", children: c }, c)) }) }),
29786
29840
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("tbody", { children: r.my_big_items_in_order.map((i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("tr", { children: [
29787
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("td", { children: i.first_held }),
29841
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("td", { children: [
29842
+ i.first_held,
29843
+ typeof i.first_purchased === "string" && typeof i.delivery_delay_seconds === "number" && i.delivery_delay_seconds > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ag-rec-note", children: [
29844
+ t2(T9.purchased),
29845
+ " ",
29846
+ i.first_purchased,
29847
+ " (+",
29848
+ i.delivery_delay_seconds,
29849
+ t2(T9.sec),
29850
+ ")",
29851
+ Array.isArray(i.my_team_courier_deaths_during_delivery) && i.my_team_courier_deaths_during_delivery.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
29852
+ " \xB7 ",
29853
+ t2(T9.courierDiedDuringDelivery),
29854
+ ": ",
29855
+ i.my_team_courier_deaths_during_delivery.map((d2) => `${d2.clock}${d2.killed_by ? ` \u2190 ${N(d2.killed_by)}` : ""}`).join(", ")
29856
+ ] })
29857
+ ] })
29858
+ ] }),
29788
29859
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("th", { scope: "row", children: i.name }),
29789
29860
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("td", { children: i.cost ?? "\u2013" }),
29790
29861
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("td", { children: why(i.built_for) })
29791
29862
  ] }, i.item)) })
29792
29863
  ] }) }),
29864
+ Array.isArray(r.my_team_courier_deaths) && r.my_team_courier_deaths.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "ag-rec-line", children: [
29865
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: t2(T9.teamCourierDeaths) }),
29866
+ r.my_team_courier_deaths.map((d2, idx) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ag-chip is-warn", children: [
29867
+ d2.clock,
29868
+ d2.killed_by ? ` \u2190 ${N(d2.killed_by)}` : ""
29869
+ ] }, `${d2.clock}-${idx}`))
29870
+ ] }),
29793
29871
  (r.answers_to_top_killers ?? []).filter((k2) => k2.pro_items_against_this_killer?.length).map((k2) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "ag-rec-line", children: [
29794
29872
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
29795
29873
  t2(T9.buildVsKiller),
@@ -29956,6 +30034,14 @@ function Record({ data: data2, lang }) {
29956
30034
  ] });
29957
30035
  }
29958
30036
  if (data2.kind === "abilities") {
30037
+ const aghsLines = (list, label, prefix) => (Array.isArray(list) ? list : []).map((u, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "ag-rec-line", children: [
30038
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ag-chip", children: [
30039
+ t2(label),
30040
+ u.kind === "granted_ability" ? ` \xB7 ${t2(T9.grantedAbility)}` : ""
30041
+ ] }),
30042
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: u.name ?? N(u.ability) }),
30043
+ u.description ? ` ${u.description}` : ""
30044
+ ] }, `${prefix}-${u.ability}-${i}`));
29959
30045
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ag-rec", children: [
29960
30046
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "ag-rec-sub", children: [
29961
30047
  r.source,
@@ -29965,8 +30051,11 @@ function Record({ data: data2, lang }) {
29965
30051
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "ag-rec-line", children: r.abilities.map((a) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ag-chip", children: [
29966
30052
  a.name,
29967
30053
  a.ultimate ? ` \xB7 ${t2(T9.ultimate)}` : "",
30054
+ a.granted_by === "scepter" ? ` \xB7 ${t2(T9.scepterGranted)}` : a.granted_by === "shard" ? ` \xB7 ${t2(T9.shardGranted)}` : "",
29968
30055
  typeof a.goes_through_spell_immunity === "boolean" ? ` \xB7 ${t2(a.goes_through_spell_immunity ? T9.pierces : T9.noPierce)}` : ""
29969
- ] }, a.ability)) })
30056
+ ] }, a.ability)) }),
30057
+ aghsLines(r.aghanims_scepter, T9.scepterEffect, "sc"),
30058
+ aghsLines(r.aghanims_shard, T9.shardEffect, "sh")
29970
30059
  ] });
29971
30060
  }
29972
30061
  if (data2.kind === "skill_build") {
@@ -30034,7 +30123,7 @@ function Record({ data: data2, lang }) {
30034
30123
  N(u.ability),
30035
30124
  " Lv",
30036
30125
  u.ability_level,
30037
- u.initial ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("em", { children: t2(T9.sbInitial) }) : u.hero_level != null ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("em", { children: [
30126
+ u.initial ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("em", { children: t2(T9.sbInitial) }) : u.granted_by === "scepter" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("em", { children: t2(T9.scepterGranted) }) : u.granted_by === "shard" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("em", { children: t2(T9.shardGranted) }) : u.hero_level != null ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("em", { children: [
30038
30127
  "Lv",
30039
30128
  u.hero_level
30040
30129
  ] }) : null