decoration for debuffs
This commit is contained in:
2
go.mod
2
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
|
||||
)
|
||||
|
||||
|
||||
2
go.sum
2
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=
|
||||
|
||||
16
skill.go
16
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
|
||||
|
||||
Reference in New Issue
Block a user