|
| 1 | +package tamayuratei |
| 2 | + |
| 3 | +import ( |
| 4 | + "fmt" |
| 5 | + |
| 6 | + "github.com/genshinsim/gcsim/pkg/core" |
| 7 | + "github.com/genshinsim/gcsim/pkg/core/attributes" |
| 8 | + "github.com/genshinsim/gcsim/pkg/core/event" |
| 9 | + "github.com/genshinsim/gcsim/pkg/core/info" |
| 10 | + "github.com/genshinsim/gcsim/pkg/core/keys" |
| 11 | + "github.com/genshinsim/gcsim/pkg/core/player/character" |
| 12 | + "github.com/genshinsim/gcsim/pkg/modifier" |
| 13 | +) |
| 14 | + |
| 15 | +func init() { |
| 16 | + core.RegisterWeaponFunc(keys.TamayurateiNoOhanashi, NewWeapon) |
| 17 | +} |
| 18 | + |
| 19 | +type Weapon struct { |
| 20 | + Index int |
| 21 | +} |
| 22 | + |
| 23 | +func (w *Weapon) SetIndex(idx int) { w.Index = idx } |
| 24 | +func (w *Weapon) Init() error { return nil } |
| 25 | + |
| 26 | +// Increase ATK by 20% and Movement SPD by 10% for 10s when using an Elemental Skill. |
| 27 | +func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) (info.Weapon, error) { |
| 28 | + w := &Weapon{} |
| 29 | + r := p.Refine |
| 30 | + |
| 31 | + m := make([]float64, attributes.EndStatType) |
| 32 | + m[attributes.ATKP] = 0.15 + float64(r)*0.05 |
| 33 | + |
| 34 | + c.Events.Subscribe(event.OnSkill, func(args ...interface{}) bool { |
| 35 | + if c.Player.Active() != char.Index { |
| 36 | + return false |
| 37 | + } |
| 38 | + char.AddStatMod(character.StatMod{ |
| 39 | + Base: modifier.NewBaseWithHitlag("tamayuratei", 10*60), |
| 40 | + Amount: func() ([]float64, bool) { |
| 41 | + return m, true |
| 42 | + }, |
| 43 | + }) |
| 44 | + |
| 45 | + return false |
| 46 | + }, fmt.Sprintf("tamayuratei-%v", char.Base.Key.String())) |
| 47 | + |
| 48 | + return w, nil |
| 49 | +} |
0 commit comments