From 2e5f9238311a5b655d099e70cf91a358e53507fc Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Sat, 17 Jan 2026 00:12:51 -0500 Subject: [PATCH] decoration for debuffs --- go.mod | 2 +- go.sum | 2 ++ skill.go | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 88e1a6f..16c7a73 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.sunturtle.xyz/zephyr/horsebot go 1.24.1 require ( - git.sunturtle.xyz/zephyr/horse v0.0.0-20260117043014-a86aa0daebfe + git.sunturtle.xyz/zephyr/horse v0.0.0-20260117050435-e6032f995f00 github.com/disgoorg/disgo v0.19.0-rc.15 ) diff --git a/go.sum b/go.sum index 8e1122c..d8aea5b 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ git.sunturtle.xyz/zephyr/horse v0.0.0-20260117030110-cb1c51db05bb h1:iFPbu8i9sRa git.sunturtle.xyz/zephyr/horse v0.0.0-20260117030110-cb1c51db05bb/go.mod h1:qGXO/93EfCOI1oGSLqrRkPDF/EAdsgLNZJjRKx+i4Lk= git.sunturtle.xyz/zephyr/horse v0.0.0-20260117043014-a86aa0daebfe h1:fgTarB04AHOKsi/G50fszjCG1pV4u799pxf43zmJk/8= git.sunturtle.xyz/zephyr/horse v0.0.0-20260117043014-a86aa0daebfe/go.mod h1:qGXO/93EfCOI1oGSLqrRkPDF/EAdsgLNZJjRKx+i4Lk= +git.sunturtle.xyz/zephyr/horse v0.0.0-20260117050435-e6032f995f00 h1:L7h4Guiibjm7A0RK1/carM3CCsdOsOJwOqWBLgFF0H0= +git.sunturtle.xyz/zephyr/horse v0.0.0-20260117050435-e6032f995f00/go.mod h1:qGXO/93EfCOI1oGSLqrRkPDF/EAdsgLNZJjRKx+i4Lk= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/disgoorg/disgo v0.19.0-rc.15 h1:x0NsV2gcbdjwuztsg2wYXw76p1Cpc8f6ByDrkPcfQtU= diff --git a/skill.go b/skill.go index b4cdd5c..00c0ddd 100644 --- a/skill.go +++ b/skill.go @@ -34,7 +34,10 @@ func RenderSkill(id horse.SkillID, all map[horse.SkillID]horse.Skill, groups map // should be passive (green) r.AccentColor = 0x66ae1c skilltype = "Passive Skill" - // TODO(zeph): debuff (red) + case isDebuff(s): + // debuff (red) + r.AccentColor = 0xe34747 + skilltype = "Debuff Skill" case s.Rarity == 1: // common (white) r.AccentColor = 0xcccccc @@ -99,6 +102,17 @@ func formatCondition(s string) string { return "`" + s + "`" } +func isDebuff(s horse.Skill) bool { + for _, act := range s.Activations { + for _, a := range act.Abilities { + if a.Value < 0 { + return true + } + } + } + return false +} + // TODO(zeph): autocomplete // if we want to backgroundify construction of an autocomplete map, // use sync.OnceValue and launch a goroutine in main to get the value and discard it