Skip to content

Commit

Permalink
名片增加满专精标识
Browse files Browse the repository at this point in the history
  • Loading branch information
IJNKAWAKAZE committed Oct 11, 2024
1 parent a4c0a57 commit b542ab0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
Binary file added assets/card/spec_max_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 16 additions & 1 deletion src/core/web/card.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type PlayerCard struct {
SkillID string `json:"skillId"`
MainSkillLvl int `json:"mainSkillLvl"`
SpecializeLevel int `json:"specializeLevel"`
IsSpecMax bool `json:"isSpecMax"`
Equip struct {
ID string `json:"id"`
Level int `json:"level"`
Expand Down Expand Up @@ -159,13 +160,27 @@ func cardData(userId int64, sklandId, uid string) (PlayerCard, error) {
playerCard.FurnitureCnt = playerData.Building.Furniture.Total
playerCard.AssistChars = playerData.AssistChars
for i, char := range playerCard.AssistChars {
name := playerData.CharInfoMap[char.CharID].Name
name := charMap[char.CharID].Name
equipId := playerCard.AssistChars[i].Equip.ID
playerCard.AssistChars[i].Name = name
playerCard.AssistChars[i].Equip.Name = strings.ToUpper(playerData.EquipmentInfoMap[equipId].TypeIcon)
playerCard.AssistChars[i].Equip.TypeIcon = playerData.EquipmentInfoMap[equipId].TypeIcon
playerCard.AssistChars[i].Equip.ShiningColor = playerData.EquipmentInfoMap[equipId].ShiningColor
playerCard.AssistChars[i].MainSkillLvl = playerCard.AssistChars[i].MainSkillLvl + playerCard.AssistChars[i].SpecializeLevel
for _, c := range playerData.Chars {
if c.CharID == char.CharID {
count := len(c.Skills)
maxCount := 0
for _, skill := range c.Skills {
if skill.SpecializeLevel == 3 {
maxCount++
}
}
if count > 0 && count == maxCount {
playerCard.AssistChars[i].IsSpecMax = true
}
}
}
}
return playerCard, nil
}
Expand Down
1 change: 1 addition & 0 deletions src/plugins/skland/player_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type PlayerData struct {
SkillID string `json:"skillId"`
MainSkillLvl int `json:"mainSkillLvl"`
SpecializeLevel int `json:"specializeLevel"`
IsSpecMax bool `json:"isSpecMax"`
Equip struct {
ID string `json:"id"`
Level int `json:"level"`
Expand Down
6 changes: 5 additions & 1 deletion template/Card.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
.level {
position: absolute;
text-align: center;
line-height: 1;
color: white;
width: 25px;
padding: 3px;
Expand Down Expand Up @@ -191,7 +192,10 @@
<td>
<div style="background-image: url('assets/card/back_end.png'); width: 150px;height: 150px;">
<img style="width: 130px;left: 10px;top: 2px;" src="https://web.hycdn.cn/arknights/game/assets/char_skin/avatar/{{urlquery .SkinID}}.png" onerror="this.src='assets/common/amiya.png'"/>
<img style="position: absolute;width: 40px;left: 100px;top: 5px;" src="/assets/box/Evolve_{{.EvolvePhase}}.png"/>
{{if .IsSpecMax}}
<img style="position:absolute;width: 50px; right: 5px;" src="/assets/card/spec_max_icon.png"/>
{{end}}
<img style="position: absolute;width: 40px;left: 100px;bottom: 20px;" src="/assets/box/Evolve_{{.EvolvePhase}}.png"/>
<div class="level"><span style="font-size: 10px;">LV</span><br>{{.Level}}</div>
</div>
</td>
Expand Down

0 comments on commit b542ab0

Please sign in to comment.