horsegen: include unique owner in skill info

This commit is contained in:
2026-01-23 23:37:36 -05:00
parent a5f84754ea
commit 5bf2588d41
5 changed files with 364 additions and 203 deletions

View File

@@ -191,6 +191,7 @@ type Skill struct {
Activations [2]SkillActivation
SPCost int
InheritID int
UniqueOwner string
IconID int
Index int
}
@@ -302,10 +303,11 @@ func Skills(ctx context.Context, db *sqlitex.Pool) ([]Skill, error) {
},
},
},
SPCost: stmt.ColumnInt(47),
InheritID: stmt.ColumnInt(48),
IconID: stmt.ColumnInt(49),
Index: stmt.ColumnInt(50),
SPCost: stmt.ColumnInt(47),
InheritID: stmt.ColumnInt(48),
UniqueOwner: stmt.ColumnText(49),
IconID: stmt.ColumnInt(50),
Index: stmt.ColumnInt(51),
}
r = append(r, s)
}

View File

@@ -53,6 +53,9 @@ var AllSkills = map[SkillID]Skill{
{{- end }}
{{- end }}
},
{{- if $s.UniqueOwner }}
UniqueOwner: {{ printf "%q" $s.UniqueOwner }},
{{- end }}
{{- if $s.SPCost }}
SPCost: {{ $s.SPCost }},
{{- end }}

View File

@@ -12,6 +12,20 @@ WITH skill_names AS (
FROM skill_data d
JOIN skill_names n ON d.id = n.id
WHERE group_rate = 1
), card_name AS (
SELECT
"index" AS "id",
"text" AS "name"
FROM text_data n
WHERE category = 4
), card_unique AS (
SELECT DISTINCT
ss.skill_id1 AS unique_id,
card_name.name
FROM card_data card
JOIN card_name ON card.id = card_name.id
JOIN card_rarity_data rd ON card.id = rd.card_id
JOIN skill_set ss ON rd.skill_set = ss.id
)
SELECT
d.id,
@@ -67,6 +81,7 @@ SELECT
d.target_value_2_3,
IFNULL(p.need_skill_point, 0) AS sp_cost,
d.unique_skill_id_1,
COALESCE(u.name, iu.name, '') AS unique_owner,
d.icon_id,
ROW_NUMBER() OVER (ORDER BY d.id) - 1 AS "index"
FROM skill_data d
@@ -74,4 +89,6 @@ FROM skill_data d
LEFT JOIN skill_data ud ON d.unique_skill_id_1 = ud.id
LEFT JOIN skill_groups g ON d.group_id = g.group_id
LEFT JOIN single_mode_skill_need_point p ON d.id = p.id
LEFT JOIN card_unique u ON d.id = u.unique_id
LEFT JOIN card_unique iu ON d.unique_skill_id_1 = iu.unique_id
ORDER BY d.id