Skip to content

Commit d237d37

Browse files
authored
Add Starcaller's Watch (#2299)
1 parent 40e9ea9 commit d237d37

File tree

11 files changed

+234
-0
lines changed

11 files changed

+234
-0
lines changed

internal/services/assets/weapons_gen.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package_name: starcallerswatch
2+
genshin_id: 14517
3+
key: starcallerswatch
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
id: 14517
2+
key: "starcallerswatch"
3+
rarity: 5
4+
weapon_class: WEAPON_CATALYST
5+
image_name: "UI_EquipIcon_Catalyst_Figurines"
6+
base_stats: {
7+
base_props: {
8+
prop_type: FIGHT_PROP_BASE_ATTACK
9+
initial_value: 44.3358
10+
curve: GROW_CURVE_ATTACK_304
11+
}
12+
base_props: {
13+
prop_type: FIGHT_PROP_ELEMENT_MASTERY
14+
initial_value: 57.6
15+
curve: GROW_CURVE_CRITICAL_301
16+
}
17+
promo_data: {
18+
max_level: 20
19+
}
20+
promo_data: {
21+
max_level: 40
22+
add_props: {
23+
prop_type: FIGHT_PROP_BASE_ATTACK
24+
value: 31.1
25+
}
26+
}
27+
promo_data: {
28+
max_level: 50
29+
add_props: {
30+
prop_type: FIGHT_PROP_BASE_ATTACK
31+
value: 62.2
32+
}
33+
}
34+
promo_data: {
35+
max_level: 60
36+
add_props: {
37+
prop_type: FIGHT_PROP_BASE_ATTACK
38+
value: 93.4
39+
}
40+
}
41+
promo_data: {
42+
max_level: 70
43+
add_props: {
44+
prop_type: FIGHT_PROP_BASE_ATTACK
45+
value: 124.5
46+
}
47+
}
48+
promo_data: {
49+
max_level: 80
50+
add_props: {
51+
prop_type: FIGHT_PROP_BASE_ATTACK
52+
value: 155.6
53+
}
54+
}
55+
promo_data: {
56+
max_level: 90
57+
add_props: {
58+
prop_type: FIGHT_PROP_BASE_ATTACK
59+
value: 186.7
60+
}
61+
}
62+
}
63+
name_text_hash_map: 2466897131
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
package starcallerswatch
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/combat"
9+
"github.com/genshinsim/gcsim/pkg/core/event"
10+
"github.com/genshinsim/gcsim/pkg/core/info"
11+
"github.com/genshinsim/gcsim/pkg/core/keys"
12+
"github.com/genshinsim/gcsim/pkg/core/player/character"
13+
"github.com/genshinsim/gcsim/pkg/core/player/shield"
14+
"github.com/genshinsim/gcsim/pkg/modifier"
15+
)
16+
17+
const (
18+
buffKey = "starcallerswatch-buff"
19+
ICDKey = "starcallerswatch-icd"
20+
buffDur = 15 * 60
21+
ICDDur = 14 * 60
22+
)
23+
24+
func init() {
25+
core.RegisterWeaponFunc(keys.StarcallersWatch, NewWeapon)
26+
}
27+
28+
type Weapon struct {
29+
Index int
30+
tickSrc int
31+
}
32+
33+
func (w *Weapon) SetIndex(idx int) { w.Index = idx }
34+
func (w *Weapon) Init() error { return nil }
35+
36+
func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) (info.Weapon, error) {
37+
w := &Weapon{}
38+
r := float64(p.Refine)
39+
40+
m := make([]float64, attributes.EndStatType)
41+
m[attributes.EM] = 75.0 + 25.0*r
42+
43+
char.AddStatMod(character.StatMod{
44+
Base: modifier.NewBase("starcallerswatch-em", -1),
45+
Amount: func() ([]float64, bool) {
46+
return m, true
47+
},
48+
})
49+
50+
bonus := make([]float64, attributes.EndStatType)
51+
bonus[attributes.DmgP] = 0.21 + 0.07*r
52+
53+
c.Events.Subscribe(event.OnShielded, func(args ...interface{}) bool {
54+
shd := args[0].(shield.Shield)
55+
if shd.ShieldOwner() != char.Index {
56+
return false
57+
}
58+
// TODO: Not sure if the character needs to be on the field
59+
if c.Player.Active() != char.Index {
60+
return false
61+
}
62+
if char.StatusIsActive(ICDKey) {
63+
return false
64+
}
65+
66+
char.AddStatus(ICDKey, ICDDur, true)
67+
char.AddStatus("starcallerswatch", buffDur, true)
68+
69+
src := c.F
70+
w.tickSrc = src
71+
char.QueueCharTask(func() {
72+
if src != w.tickSrc {
73+
return
74+
}
75+
for _, other := range c.Player.Chars() {
76+
other.DeleteAttackMod(buffKey)
77+
}
78+
}, buffDur)
79+
80+
for _, x := range c.Player.Chars() {
81+
this := x
82+
this.AddAttackMod(character.AttackMod{
83+
Base: modifier.NewBase(buffKey, -1),
84+
Amount: func(atk *combat.AttackEvent, t combat.Target) ([]float64, bool) {
85+
if c.Player.Active() != this.Index {
86+
return nil, false
87+
}
88+
return bonus, true
89+
},
90+
})
91+
}
92+
93+
return false
94+
}, fmt.Sprintf("starcallerswatch-onshielded-%v", char.Base.Key.String()))
95+
96+
return w, nil
97+
}

internal/weapons/catalyst/starcallerswatch/starcallerswatch_gen.go

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/core/keys/weapon.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ var weaponNames = []string{
193193
"splendoroftranquilwaters",
194194
"staffofhoma",
195195
"staffofthescarletsands",
196+
"starcallerswatch",
196197
"sturdybone",
197198
"summitshaper",
198199
"surfsup",
@@ -398,6 +399,7 @@ const (
398399
SplendorOfTranquilWaters
399400
StaffOfHoma
400401
StaffOfTheScarletSands
402+
StarcallersWatch
401403
SturdyBone
402404
SummitShaper
403405
SurfsUp

pkg/shortcut/weapons.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ var WeaponNameToKey = map[string]keys.Weapon{
291291
"scarletsands": keys.StaffOfTheScarletSands,
292292
"scarlet": keys.StaffOfTheScarletSands,
293293
"sss": keys.StaffOfTheScarletSands,
294+
"starcallerswatch": keys.StarcallersWatch,
295+
"scw": keys.StarcallersWatch,
294296
"sturdybone": keys.SturdyBone,
295297
"summitshaper": keys.SummitShaper,
296298
"summit": keys.SummitShaper,

pkg/simulation/imports.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ import (
135135
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/sacrificialjade"
136136
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/skyward"
137137
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/solar"
138+
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/starcallerswatch"
138139
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/surfsup"
139140
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/thrilling"
140141
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/tulaytullahsremembrance"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Starcaller's Watch
3+
---
4+
5+
import AoETable from "@site/src/components/AoE/AoETable";
6+
import IssuesTable from "@site/src/components/Issues/IssuesTable";
7+
import NamesList from "@site/src/components/Names/NamesList";
8+
import ParamsTable from "@site/src/components/Params/ParamsTable";
9+
import FieldsTable from "@site/src/components/Fields/FieldsTable";
10+
11+
## AoE Data
12+
13+
<AoETable item_key="starcallerswatch" data_src="weapon" />
14+
15+
## Known issues
16+
17+
<IssuesTable item_key="starcallerswatch" data_src="weapon" />
18+
19+
## Names
20+
21+
<NamesList item_key="starcallerswatch" data_src="weapon" />
22+
23+
## Params
24+
25+
<ParamsTable item_key="starcallerswatch" data_src="weapon" />
26+
27+
## Fields
28+
29+
<FieldsTable item_key="starcallerswatch" data_src="weapon" />

ui/packages/docs/src/components/Names/weapon_data.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@
381381
"scarlet",
382382
"sss"
383383
],
384+
"starcallerswatch": [
385+
"scw"
386+
],
384387
"sturdybone": [],
385388
"summitshaper": [
386389
"summit"

0 commit comments

Comments
 (0)