Skip to content

Commit

Permalink
fix:更新版本号
Browse files Browse the repository at this point in the history
  • Loading branch information
CikeyQi committed Dec 14, 2024
1 parent 8fc1051 commit db5ab34
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 29 deletions.
17 changes: 16 additions & 1 deletion apps/Training.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,22 @@ export class Training extends plugin {
return calculatedRole;
});

roleList.sort((a, b) => b.starLevel - a.starLevel || b.phantomData.statistic.totalScore - a.phantomData.statistic.totalScore);
roleList.forEach(role => {
const { phantomData } = role;
phantomData.statistic = {
color: "#a0a0a0",
rank: "N",
totalScore: "N/A",
...phantomData.statistic
};
});

roleList.sort((a, b) => {
const aScore = parseFloat(a.phantomData.statistic.totalScore) || 0;
const bScore = parseFloat(b.phantomData.statistic.totalScore) || 0;

return b.starLevel - a.starLevel || bScore - aScore;
});

const imageCard = await Render.render('Template/training/training', {
baseData: baseData.data,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "waves-plugin",
"version": "1.5.15",
"version": "1.5.16",
"description": "基于 Yunzai 的鸣潮游戏数据查询插件",
"main": "index.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion resources/Alias/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,7 @@
- yh
椿:
-
- c
- c
灯灯:
- 登登
- dd
Binary file added resources/Strategy/moealkyne/灯灯.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions resources/Template/charProfile/charProfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
{{if data.roleDetail.data.phantomData.statistic}}
<div class="total-score-table-left">
<div class="total-score-key">声骸总分</div>
<div class="total-score-value" style="{{data.roleDetail.data.phantomData.statistic.color || "#a0a0a0"}}">
<div class="total-score-value" style="color: {{data.roleDetail.data.phantomData.statistic.color}};">
{{data.roleDetail.data.phantomData.statistic.totalScore.toFixed(2)}}</div>
<div class="total-score-key">声骸评级</div>
<div class="total-score-value" style="{{data.roleDetail.data.phantomData.statistic.color || "#a0a0a0"}}">
<div class="total-score-value" style="color: {{data.roleDetail.data.phantomData.statistic.color}};">
{{data.roleDetail.data.phantomData.statistic.rank}}</div>
</div>
<div id="column" style="position: relative;left: -20px;top: -30px;width:100%;height:249px;"></div>
Expand All @@ -93,7 +93,7 @@
</div>

<span id="reson-level"
style="{{data.roleDetail.data.weaponData.color}}">谐振 {{data.roleDetail.data.weaponData.resonLevel}} 阶</span>
style="background: {{data.roleDetail.data.weaponData.color}};">谐振 {{data.roleDetail.data.weaponData.resonLevel}} 阶</span>
</div>
</div>
<div id="weapon-effect-name">{{data.roleDetail.data.weaponData.weapon.weaponEffectName}}</div>
Expand All @@ -109,7 +109,7 @@
<div class="phantom-header-right">
<div class="phantom-name">{{phantom.phantomProp.name.replace("(","(").replace(")",")")}}</div>
{{if phantom.realScore}}
<div class="phantom-rank-score" style="{{phantom.color}}">
<div class="phantom-rank-score" style="color: {{phantom.color}};">
{{phantom.realScore.toFixed(2)}}-{{phantom.rank}}</div>
{{else}}
<div class="phantom-rank-score" style="color: #a0a0a0;">暂无评分</div>
Expand All @@ -124,7 +124,7 @@
</div>
{{/each}}
{{each phantom.subProps prop}}
<div class="phantom-attribute-item" style="{{prop.color}}">
<div class="phantom-attribute-item" style="color: {{prop.color}};">
<span class="phantom-attribute-key">{{prop.attributeName}}</span> <span
class="phantom-attribute-value">{{prop.attributeValue}}</span>
</div>
Expand Down
5 changes: 3 additions & 2 deletions resources/Template/training/training.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@
<img src="{{pluginResources}}/Template/training/imgs/no_phantom.png">
{{/if}}
</div>
<div class="phantom-rank" style="background-{{role.phantomData.statistic.color}}">
<div class="phantom-rank" style="background-color: {{role.phantomData.statistic.color}};">
{{role.phantomData.statistic.rank}}
</div>
<div class="phantom-score">
{{role.phantomData.statistic.totalScore.toFixed(2)}}
{{typeof role.phantomData.statistic.totalScore === 'number' ?
role.phantomData.statistic.totalScore.toFixed(2) : role.phantomData.statistic.totalScore}}
</div>
</div>
</li>
Expand Down
56 changes: 56 additions & 0 deletions resources/Weight/1504.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
baseAttack: 918
baseDefense: 879
baseHP: 8500
subProps:
- name: 暴击伤害
weight: 1
- name: 暴击
weight: 1
- name: 攻击百分比
weight: 0.5
- name: 生命百分比
weight: 0
- name: 防御百分比
weight: 0
- name: 共鸣效率
weight: 0.2
- name: 普攻伤害加成
weight: 0.4
- name: 重击伤害加成
weight: 0
- name: 共鸣技能伤害加成
weight: 0
- name: 共鸣解放伤害加成
weight: 0.1
mainProps:
C4:
- name: 暴击伤害
weight: 0.5
- name: 暴击
weight: 0.5
- name: 治疗效果加成
weight: 0
- name: 生命百分比
weight: 0
- name: 攻击百分比
weight: 0.25
- name: 防御百分比
weight: 0
C3:
- name: 伤害加成
weight: 0.75
- name: 攻击百分比
weight: 0.75
- name: 生命百分比
weight: 0
- name: 防御百分比
weight: 0
- name: 共鸣效率
weight: 0.6
C1:
- name: 攻击百分比
weight: 1
- name: 防御百分比
weight: 0
- name: 生命百分比
weight: 0
2 changes: 1 addition & 1 deletion resources/Weight/1603.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mainProps:
- name: 防御百分比
weight: 0
- name: 共鸣效率
weight: 0.75
weight: 0
C1:
- name: 攻击百分比
weight: 1
Expand Down
2 changes: 1 addition & 1 deletion resources/Weight/weight.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.0.2
version: 1.0.3
subProps:
- name: 暴击伤害
max: 21
Expand Down
34 changes: 17 additions & 17 deletions utils/Calculate.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class WeightCalculator {
});

const weaponColors = {
5: "background:#9d2933;",
4: "background:#9f00ed;",
3: "background:#6640ff;",
2: "background:#00D200;"
5: "#9d2933",
4: "#9f00ed",
3: "#6640ff",
2: "#00D200"
};
this.roleDetail.weaponData.color = weaponColors[this.roleDetail.weaponData.resonLevel] || "background:#a0a0a0;";
this.roleDetail.weaponData.color = weaponColors[this.roleDetail.weaponData.resonLevel] || "#a0a0a0";

if (!fs.existsSync(this.roleWeightPath)) {
return this.roleDetail;
Expand Down Expand Up @@ -213,22 +213,22 @@ class WeightCalculator {
}

calStyle(weight) {
return weight > 0.5 ? "color:#9d2933;"
: weight > 0 ? "color:#057748;"
: "color:#a0a0a0;";
return weight > 0.5 ? "#9d2933"
: weight > 0 ? "#057748"
: "#a0a0a0";
}

calRank(score) {
const ranks = [
{ minScore: 22, name: "MAX", color: "color:#9d2933;" },
{ minScore: 19, name: "ACE", color: "color:#f08a5d;" },
{ minScore: 17, name: "SSS", color: "color:#eec900;" },
{ minScore: 15, name: "SS", color: "color:#eec900;" },
{ minScore: 12, name: "S", color: "color:#eec900;" },
{ minScore: 9, name: "A", color: "color:#9f00ed;" },
{ minScore: 6, name: "B", color: "color:#6640ff;" },
{ minScore: 3, name: "C", color: "color:#00D200;" },
{ minScore: 0, name: "D", color: "color:#a0a0a0;" },
{ minScore: 22, name: "MAX", color: "#9d2933" },
{ minScore: 19, name: "ACE", color: "#f08a5d" },
{ minScore: 17, name: "SSS", color: "#eec900" },
{ minScore: 15, name: "SS", color: "#eec900" },
{ minScore: 12, name: "S", color: "#eec900" },
{ minScore: 9, name: "A", color: "#9f00ed" },
{ minScore: 6, name: "B", color: "#6640ff" },
{ minScore: 3, name: "C", color: "#00D200" },
{ minScore: 0, name: "D", color: "#a0a0a0" },
];

for (const rank of ranks) {
Expand Down

0 comments on commit db5ab34

Please sign in to comment.