@sjtdev/koishi-plugin-dota2tracker 2.2.3 → 2.3.1

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 (105) hide show
  1. package/changelog.md +28 -0
  2. package/lib/index.js +200 -162
  3. package/{queries → lib/queries}/MatchInfo.graphql +13 -0
  4. package/lib/templates/common/components/building_icons.ejs +20 -0
  5. package/lib/templates/common/styles/normalize.min.css +1 -0
  6. package/lib/templates/hero/hero_1.ejs +69 -0
  7. package/lib/templates/images/7.38_simple_minimap.png +0 -0
  8. package/lib/templates/item/item/recipe.ejs +9 -0
  9. package/lib/templates/item/item/style.css +1 -0
  10. package/lib/templates/item/item.ejs +52 -0
  11. package/lib/templates/item/itemlist.ejs +11 -0
  12. package/lib/templates/match/match_1/base.css +1 -0
  13. package/lib/templates/match/match_1/item.ejs +1 -0
  14. package/lib/templates/match/match_1/main.ejs +8 -0
  15. package/lib/templates/match/match_1/player.ejs +1 -0
  16. package/lib/templates/match/match_1/style.css +1 -0
  17. package/lib/templates/match/match_1.ejs +18 -0
  18. package/lib/templates/match/match_2/original.css +1 -0
  19. package/lib/templates/match/match_2/original.ejs +10 -0
  20. package/lib/templates/match/match_2+/charts.ejs +1 -0
  21. package/lib/templates/match/match_2+/extra.css +1 -0
  22. package/lib/templates/match/match_2+/lane_outcome.ejs +56 -0
  23. package/lib/templates/match/match_2+/map.ejs +160 -0
  24. package/lib/templates/match/match_2+.ejs +1 -0
  25. package/lib/templates/match/match_2.ejs +1 -0
  26. package/lib/templates/player/player_1/base.css +1 -0
  27. package/lib/templates/player/player_1/private.ejs +1 -0
  28. package/lib/templates/player/player_1.ejs +78 -0
  29. package/lib/templates/rank/rank_fun.ejs +1 -0
  30. package/lib/templates/report/daily/base.css +1 -0
  31. package/lib/templates/report/daily.ejs +29 -0
  32. package/package.json +2 -2
  33. package/template/hero/hero_1.ejs +0 -900
  34. package/template/item/item/recipe.ejs +0 -51
  35. package/template/item/item/style.css +0 -244
  36. package/template/item/item.ejs +0 -140
  37. package/template/item/itemlist.ejs +0 -99
  38. package/template/match/match_1/item.ejs +0 -11
  39. package/template/match/match_1/main.ejs +0 -37
  40. package/template/match/match_1/player.ejs +0 -154
  41. package/template/match/match_1/style.css +0 -764
  42. package/template/match/match_1.ejs +0 -56
  43. package/template/match/match_2/original.css +0 -463
  44. package/template/match/match_2/original.ejs +0 -192
  45. package/template/match/match_2+/charts.ejs +0 -261
  46. package/template/match/match_2+/extra.css +0 -143
  47. package/template/match/match_2+/lane_outcome.ejs +0 -157
  48. package/template/match/match_2+.ejs +0 -27
  49. package/template/match/match_2.ejs +0 -18
  50. package/template/player/player_1/private.ejs +0 -5
  51. package/template/player/player_1.ejs +0 -654
  52. package/template/rank/rank_fun.ejs +0 -131
  53. package/template/report/daily.ejs +0 -191
  54. /package/{queries → lib/queries}/Constants.graphql +0 -0
  55. /package/{queries → lib/queries}/GetWeeklyMetaByPosition.graphql +0 -0
  56. /package/{queries → lib/queries}/PlayerExtraInfo.graphql +0 -0
  57. /package/{queries → lib/queries}/PlayerInfoWith25Matches.graphql +0 -0
  58. /package/{queries → lib/queries}/PlayerPerformanceForHeroRecommendation.graphql +0 -0
  59. /package/{queries → lib/queries}/PlayersInfoWith10MatchesForGuild.graphql +0 -0
  60. /package/{queries → lib/queries}/PlayersLastmatchRankinfo.graphql +0 -0
  61. /package/{queries → lib/queries}/PlayersMatchesForDaily.graphql +0 -0
  62. /package/{queries → lib/queries}/RequestMatchDataAnalysis.graphql +0 -0
  63. /package/{queries → lib/queries}/VerifyingPlayer.graphql +0 -0
  64. /package/{template → lib/templates}/images/bei.jpg +0 -0
  65. /package/{template → lib/templates}/images/disconnected.png +0 -0
  66. /package/{template → lib/templates}/images/flag_dire.png +0 -0
  67. /package/{template → lib/templates}/images/flag_radiant.png +0 -0
  68. /package/{template → lib/templates}/images/hero_badge_1.png +0 -0
  69. /package/{template → lib/templates}/images/hero_badge_2.png +0 -0
  70. /package/{template → lib/templates}/images/hero_badge_3.png +0 -0
  71. /package/{template → lib/templates}/images/hero_badge_4.png +0 -0
  72. /package/{template → lib/templates}/images/hero_badge_5.png +0 -0
  73. /package/{template → lib/templates}/images/hero_badge_6.png +0 -0
  74. /package/{template → lib/templates}/images/lane_fail.svg +0 -0
  75. /package/{template → lib/templates}/images/lane_jungle.svg +0 -0
  76. /package/{template → lib/templates}/images/lane_stomp.svg +0 -0
  77. /package/{template → lib/templates}/images/lane_stomped.svg +0 -0
  78. /package/{template → lib/templates}/images/lane_tie.svg +0 -0
  79. /package/{template → lib/templates}/images/lane_victory.svg +0 -0
  80. /package/{template → lib/templates}/images/logo_dire.png +0 -0
  81. /package/{template → lib/templates}/images/logo_radiant.png +0 -0
  82. /package/{template → lib/templates}/images/medal_0.png +0 -0
  83. /package/{template → lib/templates}/images/medal_1.png +0 -0
  84. /package/{template → lib/templates}/images/medal_2.png +0 -0
  85. /package/{template → lib/templates}/images/medal_3.png +0 -0
  86. /package/{template → lib/templates}/images/medal_4.png +0 -0
  87. /package/{template → lib/templates}/images/medal_5.png +0 -0
  88. /package/{template → lib/templates}/images/medal_6.png +0 -0
  89. /package/{template → lib/templates}/images/medal_7.png +0 -0
  90. /package/{template → lib/templates}/images/medal_8.png +0 -0
  91. /package/{template → lib/templates}/images/medal_8b.png +0 -0
  92. /package/{template → lib/templates}/images/medal_8c.png +0 -0
  93. /package/{template → lib/templates}/images/scepter.png +0 -0
  94. /package/{template → lib/templates}/images/scepter_0.png +0 -0
  95. /package/{template → lib/templates}/images/scepter_1.png +0 -0
  96. /package/{template → lib/templates}/images/shard.png +0 -0
  97. /package/{template → lib/templates}/images/shard_0.png +0 -0
  98. /package/{template → lib/templates}/images/shard_1.png +0 -0
  99. /package/{template → lib/templates}/images/star_0.png +0 -0
  100. /package/{template → lib/templates}/images/star_1.png +0 -0
  101. /package/{template → lib/templates}/images/star_2.png +0 -0
  102. /package/{template → lib/templates}/images/star_3.png +0 -0
  103. /package/{template → lib/templates}/images/star_4.png +0 -0
  104. /package/{template → lib/templates}/images/star_5.png +0 -0
  105. /package/{template → lib/templates}/images/xi.jpg +0 -0
@@ -1,154 +0,0 @@
1
- <div class="box h-[320px] flex flex-col gap-[4px] rounded-[5px]" <%- `style="grid-column: ${!player.isRadiant+1};grid-row: ${player.position?.slice(-1)%5}" ` %>>
2
- <section class="grid grid-cols-[112px_1fr_100px] grid-rows-[63px_24px]">
3
- <div class="avatar relative h-full relative row-1 col-1 text-[10px] text-shadow-[-1px_1px_2px_#000,1px_-1px_2px_#000,-1px_1px_2px_#000,1px_1px_2px_#000]">
4
- <% if (player.leaverStatus != "NONE" && player.leaverStatus != "DISCONNECTED") { %>
5
- <img class="leaver absolute w-full h-full object-contain" src="<%= getImageUrl("disconnected") %>" />
6
- <% } %>
7
- <div class="party contents">
8
- <i class="party_line absolute w-full h-[2px]" <%- `style="background-color:${partyColor[player.partyId]};"` %>></i>
9
- <b class="party_mark absolute leading-[1.5] w-[16px] top-[3px] left-[2px] bg-black/80 text-center" <%- `style="color:${partyColor[player.partyId]};"` %>><%= match.party[player.partyId] %></b>
10
- </div>
11
- <div class="hero_info absolute top-[3px] right-0 text-right leading-[1.25]">
12
- <p class="order" <%- `style="color: ${['red', 'yellow', 'green'][Math.floor(player.order / 4)]};"` %>><%- player.isRandom ? $t("dota2tracker.template.random") : $t("dota2tracker.template.pick_order",[`${player.order == null ? "?" : player.order + 1}`]) %></p>
13
- <p class="position"><%= $t("dota2tracker.template.position_" + player.position?.slice(-1))??'' %></p>
14
- </div>
15
- <p class="level absolute bottom-0 right-0 text-xs px-[2px]"><%= player.level %></p>
16
- <img class="h-full" src="<%= getImageUrl(player.hero.shortName, ImageType.Heroes) %>" />
17
- </div>
18
- <div class="player_profile mx-[10px] row-1 col-2 w-auto h-full overflow-hidden text-center flex flex-col justify-around leading-[1]">
19
- <p class="player_name truncate max-w-full"><%= player.steamAccount.name %></p>
20
- <p class="flex gap-[12px] justify-center">
21
- <span class="kda"><%= player.kills %>/<%= player.deaths %>/<%= player.assists %></span>
22
- <span class="kc" <%- `style="color:${kcndcStyle.kc(player.killContribution * 100)}"` %>><%= Math.floor(player.killContribution * 100) %>%</span>
23
- <span class="dc" <%- `style="color:${kcndcStyle.dc(player.deathContribution * 100)}"` %>><%= Math.floor(player.deathContribution * 100) %>%</span>
24
- </p>
25
- <p class="flex gap-[16px] justify-center">
26
- <span class="networth text-[rgb(203,176,42)]"><%= player.networth %></span>
27
- <span class="score"><%= (player.heroDamage / player.networth)?.toFixed(2) %></span>
28
- </p>
29
- </div>
30
- <div class="lane_rank row-1 col-3 flex w-full h-full justify-between">
31
- <div class="lane w-[44px] h-full">
32
- <p class="text-[10px] text-center"><%= $t("dota2tracker.template.lane_" + player.laneResult) %></p>
33
- <div class="h-[44px] w-[44px]"><%- laneSVG[player.laneResult] %></div>
34
- </div>
35
- <div class="rank_plus w-[36px] h-full relative text-[10px] leading-[1.15] text-shadow-[-1px_1px_0_#000,1px_-1px_0_#000,-1px_1px_0_#000,1px_1px_0_#000]">
36
- <div class="rank absolute top-0 size-[36px] z-2">
37
- <img class="medal absolute inset-0" src="<%= getImageUrl('medal_' + (player.rank.inTop100 ?? player.rank.medal)) %>"/>
38
- <img class="stars absolute inset-0" src="<%= getImageUrl('star_' + player.rank.star) %>" />
39
- <p class="leader absolute bottom-0 text-center w-full"><%= player.steamAccount?.seasonLeaderboardRank ?? "" %></p>
40
- </div>
41
- <% if (player.dotaPlus) { %>
42
- <div class="plus absolute bottom-0 size-[36px] z-1">
43
- <img class="" src="<%= getImageUrl("hero_badge_" + (player.dotaPlus ? Math.ceil((player.dotaPlus?.level + 1) / 6) : 1)) %>">
44
- <p class="level absolute bottom-0 text-center w-full"><%= player.dotaPlus?.level %></p>
45
- </div>
46
- <% } %>
47
- </div>
48
- </div>
49
- <div class="facet row-2 col-1 w-full h-full grid grid-cols-[24px_1fr] grid-rows-1 bg-linear-to-r
50
- <%- facetColor[player.facet?.color ?? 'Black'] %>">
51
- <% if (player.facet) { %>
52
- <div class="w-[24px] h-[24px] flex items-center justify-center bg-[#4444]">
53
- <img class="h-[18px]" src="<%= getImageUrl(player.facet?.icon, ImageType.IconsFacets) %>" />
54
- </div>
55
- <% } %>
56
- <div class="facet_name w-full truncate grow px-[4px] text-sm flex justify-center items-center"><span class="w-full truncate text-center"><%= player.facet?.displayName ?? "?" %></span></div>
57
- </div>
58
- <div class="titles row-2 col-start-2 col-end-3 w-full flex items-center pl-[12px] gap-[6px]">
59
- <% for (let item of player.titles) { %>
60
- <% const [title, color] = $t(item).split("-"); %>
61
- <span <%- `style="color:${color};"` %>><%= title %></span>
62
- <% } %>
63
- </div>
64
- </section>
65
- <% if (player.hero.id != 80) { %>
66
- <section class="items w-full grid grid-cols-[repeat(3,3fr)_2fr_3fr] grid-rows-2">
67
- <div class="items_main contents">
68
- <% for( let i = 0; i < 6; i++ ) { %>
69
- <%- include("./item.ejs", {item: player.items[i], style: `col-${i%3+1}`, isNeutral: false}) %>
70
- <% } %>
71
- </div>
72
- <div class="items_backpack grayscale col-4 row-start-1 row-span-2 flex flex-col">
73
- <% for( let i = 0; i < 3; i++ ) { %>
74
- <%- include("./item.ejs", {item: player.backpacks[i], style: "", isNeutral: false}) %>
75
- <% } %>
76
- </div>
77
- <div class="items_neutral contents"><%- include("./item.ejs", {item: player.neutral0Id, style: "row-start-1 row-span-2 col-5 flex items-center h-full", isNeutral: true}) %></div>
78
- </section>
79
- <% } else { %>
80
- <section class="items w-full grid grid-cols-[repeat(6,3fr)_10fr] grid-rows-4">
81
- <div class="items_hero contents">
82
- <div class="items_main contents">
83
- <% for( let i = 0; i < 6; i++ ) { %>
84
- <%- include("./item.ejs", {item: player.items[i], style: `row-1 col-${i+1}`, isNeutral: false}) %>
85
- <% } %>
86
- </div>
87
- <div class="items_backpack grayscale contents">
88
- <% for( let i = 0; i < 3; i++ ) { %>
89
- <%- include("./item.ejs", {item: player.backpacks[i], style: `row-2 col-${i+1}`, isNeutral: false}) %>
90
- <% } %>
91
- </div>
92
- <div class="items_neutral contents">
93
- <%- include("./item.ejs", {item: player.neutral0Id, style: "row-2 col-6", isNeutral: true}) %>
94
- </div>
95
- </div>
96
- <div class="items_unit contents">
97
- <div class="items_main contents">
98
- <% for( let i = 0; i < 6; i++ ) { %>
99
- <%- include("./item.ejs", {item: player.unitItems[i], style: `row-3 col-${i+1}`, isNeutral: false}) %>
100
- <% } %>
101
- </div>
102
- <div class="items_backpack grayscale contents">
103
- <% for( let i = 0; i < 3; i++ ) { %>
104
- <%- include("./item.ejs", {item: player.unitBackpacks[i], style: `row-4 col-${i+1}`, isNeutral: false}) %>
105
- <% } %>
106
- </div>
107
- <div class="items_neutral contents">
108
- <%- include("./item.ejs", {item: player.additionalUnit.neutral0Id, style: "row-4 col-6", isNeutral: true}) %>
109
- </div>
110
- </div>
111
- </section>
112
- <% } %>
113
- <section class="buffs_supports w-full h-[24px] flex justify-between">
114
- <div class="buffs flex h-[24px]">
115
- <% for (const buff of player.buffs) { %>
116
- <div class="relative">
117
- <img class="w-[33px] h-[24px]" src="<%= getImageUrl(dotaconstants[`${buff.type}_ids`][buff.id], ImageType[buff.type === "ability" ? "Abilities" : "Items"]) %>" />
118
- <p class="count absolute w-full bottom-0 leading-[1] text-center bg-stone-700/50 text-[10px]"><%= buff.stackCount || "" %></p>
119
- </div>
120
- <% } %>
121
- </div>
122
- <div class="supports flex h-[24px]">
123
- <% for (const supportItem of player.supportItemsCount){ %>
124
- <div class="relative">
125
- <img class="w-[33px] h-[24px]" src="<%= getImageUrl(supportItem.name, ImageType.Items) %>" />
126
- <p class="count absolute w-full bottom-0 leading-[1] text-center bg-stone-700/50 text-[10px]"><%= supportItem.count || "" %></p>
127
- </div>
128
- <% } %>
129
- </div>
130
- </section>
131
- <section class="player-stat h-full flex flex-col justify-around text-[13px] leading-[24px] whitespace-nowrap">
132
- <p class="w-full flex justify-around">
133
- <span><%= $t("dota2tracker.template.hero_damage_") %><span class="hero_damage"><%= player.heroDamage %></span></span>
134
- <span><%= $t("dota2tracker.template.building_damage_") %><span class="building_damage"><%= player.towerDamage %></span></span>
135
- <span><%= $t("dota2tracker.template.damage_received_") %><span class="tak">
136
- <%= (player.stats?.heroDamageReport?.receivedTotal.physicalDamage || 0) +
137
- (player.stats?.heroDamageReport?.receivedTotal.magicalDamage || 0) +
138
- (player.stats?.heroDamageReport?.receivedTotal.pureDamage || 0) %>
139
- </span>
140
- </span>
141
- </p>
142
- <p class="w-full flex justify-around">
143
- <span><%= $t("dota2tracker.template.lasthit_") %><span class="lh"><%= player.numLastHits %></span>/<span class="dn"><%= player.numDenies %></span></span>
144
- <span><%= $t("dota2tracker.template.GPM/XPM_") %><span class="gpm"><%= player.goldPerMinute %></span>/<span class="xpm"><%= player.experiencePerMinute %></span></span>
145
- <span><%= $t("dota2tracker.template.heal_") %><span class="heal"><%= player.heroHealing %></span></span>
146
- </p>
147
- <p class="w-full flex justify-center">
148
- <span><%= $t("dota2tracker.template.crowd_control_duration_") %></span>
149
- <span><%= ((player.stats?.heroDamageReport?.dealtTotal.stunDuration || 0) / 100).toFixed(2) + "/" %></span>
150
- <span><%= ((player.stats?.heroDamageReport?.dealtTotal.slowDuration || 0) / 100).toFixed(2) + "/" %></span>
151
- <span><%= ((player.stats?.heroDamageReport?.dealtTotal.disableDuration || 0) / 100).toFixed(2) %></span>s
152
- </p>
153
- </section>
154
- </div>