Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove noblesse interdependencies #2026

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions internal/artifacts/noblesse/noblesse.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/genshinsim/gcsim/pkg/core/combat"
"github.com/genshinsim/gcsim/pkg/core/event"
"github.com/genshinsim/gcsim/pkg/core/glog"
"github.com/genshinsim/gcsim/pkg/core/hacks"
"github.com/genshinsim/gcsim/pkg/core/info"
"github.com/genshinsim/gcsim/pkg/core/keys"
"github.com/genshinsim/gcsim/pkg/core/player/character"
Expand All @@ -24,27 +25,20 @@ type Set struct {
Index int
nob2buff []float64
nob4buff []float64
charKey keys.Char
charIsSpecialCase bool
}

func (s *Set) SetIndex(idx int) { s.Index = idx }
func (s *Set) Init() error { return nil }

var specialChars = [keys.EndCharKeys]bool{}

func init() {
specialChars[keys.AetherAnemo] = true
specialChars[keys.LumineAnemo] = true
specialChars[keys.Ningguang] = true
specialChars[keys.Beidou] = true
specialChars[keys.Sayu] = true
specialChars[keys.Aloy] = true
specialChars[keys.Ganyu] = true
func (s *Set) Init() error {
s.charIsSpecialCase = hacks.NOCharIsSpecial(s.charKey)
return nil
}

func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[string]int) (info.Set, error) {
s := Set{
core: c,
core: c,
charKey: char.Base.Key,
}

if count >= 2 {
Expand All @@ -65,7 +59,6 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri
buffDuration := 720 // 12s * 60
s.nob4buff = make([]float64, attributes.EndStatType)
s.nob4buff[attributes.ATKP] = 0.2
s.charIsSpecialCase = specialChars[char.Base.Key]

//TODO: this used to be post. need to check
c.Events.Subscribe(event.OnBurst, func(args ...interface{}) bool {
Expand Down
2 changes: 2 additions & 0 deletions internal/characters/aloy/aloy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package aloy
import (
tmpl "github.com/genshinsim/gcsim/internal/template/character"
"github.com/genshinsim/gcsim/pkg/core"
"github.com/genshinsim/gcsim/pkg/core/hacks"
"github.com/genshinsim/gcsim/pkg/core/info"
"github.com/genshinsim/gcsim/pkg/core/keys"
"github.com/genshinsim/gcsim/pkg/core/player/character"
)

func init() {
core.RegisterCharFunc(keys.Aloy, NewChar)
hacks.RegisterNOSpecialChar(keys.Aloy)
}

type char struct {
Expand Down
2 changes: 2 additions & 0 deletions internal/characters/beidou/beidou.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import (
tmpl "github.com/genshinsim/gcsim/internal/template/character"
"github.com/genshinsim/gcsim/pkg/core"
"github.com/genshinsim/gcsim/pkg/core/combat"
"github.com/genshinsim/gcsim/pkg/core/hacks"
"github.com/genshinsim/gcsim/pkg/core/info"
"github.com/genshinsim/gcsim/pkg/core/keys"
"github.com/genshinsim/gcsim/pkg/core/player/character"
)

func init() {
core.RegisterCharFunc(keys.Beidou, NewChar)
hacks.RegisterNOSpecialChar(keys.Beidou)
}

type char struct {
Expand Down
2 changes: 2 additions & 0 deletions internal/characters/ganyu/ganyu.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import (
tmpl "github.com/genshinsim/gcsim/internal/template/character"
"github.com/genshinsim/gcsim/pkg/core"
"github.com/genshinsim/gcsim/pkg/core/action"
"github.com/genshinsim/gcsim/pkg/core/hacks"
"github.com/genshinsim/gcsim/pkg/core/info"
"github.com/genshinsim/gcsim/pkg/core/keys"
"github.com/genshinsim/gcsim/pkg/core/player/character"
)

func init() {
core.RegisterCharFunc(keys.Ganyu, NewChar)
hacks.RegisterNOSpecialChar(keys.Ganyu)
}

type char struct {
Expand Down
2 changes: 2 additions & 0 deletions internal/characters/ningguang/ningguang.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import (
"github.com/genshinsim/gcsim/pkg/core/action"
"github.com/genshinsim/gcsim/pkg/core/combat"
"github.com/genshinsim/gcsim/pkg/core/event"
"github.com/genshinsim/gcsim/pkg/core/hacks"
"github.com/genshinsim/gcsim/pkg/core/info"
"github.com/genshinsim/gcsim/pkg/core/keys"
"github.com/genshinsim/gcsim/pkg/core/player/character"
)

func init() {
core.RegisterCharFunc(keys.Ningguang, NewChar)
hacks.RegisterNOSpecialChar(keys.Ningguang)
}

type char struct {
Expand Down
2 changes: 2 additions & 0 deletions internal/characters/sayu/sayu.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import (
"github.com/genshinsim/gcsim/pkg/core/attacks"
"github.com/genshinsim/gcsim/pkg/core/attributes"
"github.com/genshinsim/gcsim/pkg/core/combat"
"github.com/genshinsim/gcsim/pkg/core/hacks"
"github.com/genshinsim/gcsim/pkg/core/info"
"github.com/genshinsim/gcsim/pkg/core/keys"
"github.com/genshinsim/gcsim/pkg/core/player/character"
)

func init() {
core.RegisterCharFunc(keys.Sayu, NewChar)
hacks.RegisterNOSpecialChar(keys.Sayu)
}

type char struct {
Expand Down
2 changes: 2 additions & 0 deletions internal/characters/traveler/anemo/aether/aether.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package aether
import (
"github.com/genshinsim/gcsim/internal/characters/traveler/common/anemo"
"github.com/genshinsim/gcsim/pkg/core"
"github.com/genshinsim/gcsim/pkg/core/hacks"
"github.com/genshinsim/gcsim/pkg/core/info"
"github.com/genshinsim/gcsim/pkg/core/keys"
"github.com/genshinsim/gcsim/pkg/core/player/character"
Expand All @@ -27,4 +28,5 @@ func NewChar(s *core.Core, w *character.CharWrapper, p info.CharacterProfile) er

func init() {
core.RegisterCharFunc(keys.AetherAnemo, NewChar)
hacks.RegisterNOSpecialChar(keys.AetherAnemo)
}
2 changes: 2 additions & 0 deletions internal/characters/traveler/anemo/lumine/lumine.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package lumine
import (
"github.com/genshinsim/gcsim/internal/characters/traveler/common/anemo"
"github.com/genshinsim/gcsim/pkg/core"
"github.com/genshinsim/gcsim/pkg/core/hacks"
"github.com/genshinsim/gcsim/pkg/core/info"
"github.com/genshinsim/gcsim/pkg/core/keys"
"github.com/genshinsim/gcsim/pkg/core/player/character"
Expand All @@ -27,4 +28,5 @@ func NewChar(s *core.Core, w *character.CharWrapper, p info.CharacterProfile) er

func init() {
core.RegisterCharFunc(keys.LumineAnemo, NewChar)
hacks.RegisterNOSpecialChar(keys.LumineAnemo)
}
13 changes: 13 additions & 0 deletions pkg/core/hacks/hacks.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package hacks

import "github.com/genshinsim/gcsim/pkg/core/keys"

var noblesseSpecialChars = [keys.EndCharKeys]bool{}

func RegisterNOSpecialChar(k keys.Char) {
noblesseSpecialChars[k] = true
}

func NOCharIsSpecial(k keys.Char) bool {
return noblesseSpecialChars[k]
}
Loading