Skip to content

Commit 1b59561

Browse files
authored
add flower-wreathed feathers (#2366)
1 parent a2db544 commit 1b59561

File tree

10 files changed

+239
-0
lines changed

10 files changed

+239
-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: flowerwreathedfeathers
2+
genshin_id: 15430
3+
key: flowerwreathedfeathers
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
id: 15430
2+
key: "flowerwreathedfeathers"
3+
rarity: 4
4+
weapon_class: WEAPON_BOW
5+
image_name: "UI_EquipIcon_Bow_Umpakati"
6+
base_stats: {
7+
base_props: {
8+
prop_type: FIGHT_PROP_BASE_ATTACK
9+
initial_value: 42.401
10+
curve: GROW_CURVE_ATTACK_201
11+
}
12+
base_props: {
13+
prop_type: FIGHT_PROP_ATTACK_PERCENT
14+
initial_value: 0.09
15+
curve: GROW_CURVE_CRITICAL_201
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: 25.9
25+
}
26+
}
27+
promo_data: {
28+
max_level: 50
29+
add_props: {
30+
prop_type: FIGHT_PROP_BASE_ATTACK
31+
value: 51.9
32+
}
33+
}
34+
promo_data: {
35+
max_level: 60
36+
add_props: {
37+
prop_type: FIGHT_PROP_BASE_ATTACK
38+
value: 77.8
39+
}
40+
}
41+
promo_data: {
42+
max_level: 70
43+
add_props: {
44+
prop_type: FIGHT_PROP_BASE_ATTACK
45+
value: 103.7
46+
}
47+
}
48+
promo_data: {
49+
max_level: 80
50+
add_props: {
51+
prop_type: FIGHT_PROP_BASE_ATTACK
52+
value: 129.7
53+
}
54+
}
55+
promo_data: {
56+
max_level: 90
57+
add_props: {
58+
prop_type: FIGHT_PROP_BASE_ATTACK
59+
value: 155.6
60+
}
61+
}
62+
}
63+
name_text_hash_map: 4019353779
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
package flowerwreathedfeathers
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/genshinsim/gcsim/pkg/core"
7+
"github.com/genshinsim/gcsim/pkg/core/action"
8+
"github.com/genshinsim/gcsim/pkg/core/attacks"
9+
"github.com/genshinsim/gcsim/pkg/core/attributes"
10+
"github.com/genshinsim/gcsim/pkg/core/combat"
11+
"github.com/genshinsim/gcsim/pkg/core/event"
12+
"github.com/genshinsim/gcsim/pkg/core/glog"
13+
"github.com/genshinsim/gcsim/pkg/core/info"
14+
"github.com/genshinsim/gcsim/pkg/core/keys"
15+
"github.com/genshinsim/gcsim/pkg/core/player/character"
16+
"github.com/genshinsim/gcsim/pkg/modifier"
17+
)
18+
19+
const (
20+
buffStatus = "flowerwreathedfeathers"
21+
icdStatus = "flowerwreathedfeathers-icd"
22+
)
23+
24+
func init() {
25+
core.RegisterWeaponFunc(keys.FlowerWreathedFeathers, NewWeapon)
26+
}
27+
28+
type Weapon struct {
29+
Index int
30+
31+
c *core.Core
32+
char *character.CharWrapper
33+
stacks int
34+
leaveSrc int
35+
}
36+
37+
func (w *Weapon) SetIndex(idx int) { w.Index = idx }
38+
func (w *Weapon) Init() error { return nil }
39+
40+
// Decreases Gliding Stamina consumption by 15%. When using Aimed Shots, the DMG dealt by Charged Attacks
41+
// increases by 6% every 0.5s. This effect can stack up to 6 times and will be removed 10s after leaving
42+
// Aiming Mode.
43+
func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) (info.Weapon, error) {
44+
w := &Weapon{
45+
c: c,
46+
char: char,
47+
}
48+
r := p.Refine
49+
50+
// "Gliding Stamina consumption" not implemented
51+
52+
m := make([]float64, attributes.EndStatType)
53+
buff := 0.045 + 0.015*float64(r)
54+
char.AddAttackMod(character.AttackMod{
55+
Base: modifier.NewBase(buffStatus, -1),
56+
Amount: func(atk *combat.AttackEvent, t combat.Target) ([]float64, bool) {
57+
if atk.Info.AttackTag != attacks.AttackTagExtra {
58+
return nil, false
59+
}
60+
m[attributes.DmgP] = buff * float64(w.stacks)
61+
return m, true
62+
},
63+
})
64+
65+
c.Events.Subscribe(event.OnAimShoot, func(args ...interface{}) bool {
66+
if c.Player.Active() != char.Index {
67+
return false
68+
}
69+
if char.StatusIsActive(icdStatus) {
70+
return false
71+
}
72+
char.AddStatus(icdStatus, 0.5*60, true)
73+
74+
w.leaveSrc = -1
75+
if w.stacks < 6 {
76+
w.stacks++
77+
}
78+
c.Log.NewEvent("flower-wreathed feathers proc'd", glog.LogWeaponEvent, char.Index).
79+
Write("stacks", w.stacks)
80+
81+
return false
82+
}, fmt.Sprintf("flower-wreathed-aim-%v", char.Base.Key.String()))
83+
84+
c.Events.Subscribe(event.OnStateChange, func(args ...interface{}) bool {
85+
prev := args[0].(action.AnimationState)
86+
next := args[1].(action.AnimationState)
87+
88+
if c.Player.Active() != char.Index {
89+
return false
90+
}
91+
if prev != action.AimState || next == action.AimState {
92+
return false
93+
}
94+
if w.leaveSrc != -1 {
95+
return false
96+
}
97+
w.leaveSrc = c.F
98+
char.QueueCharTask(w.clearBuff(w.leaveSrc), 10*60)
99+
100+
return false
101+
}, fmt.Sprintf("flower-wreathed-state-%v", char.Base.Key.String()))
102+
103+
c.Events.Subscribe(event.OnCharacterSwap, func(args ...interface{}) bool {
104+
prev := args[0].(int)
105+
106+
if prev != char.Index {
107+
return false
108+
}
109+
if w.leaveSrc != -1 {
110+
return false
111+
}
112+
w.leaveSrc = c.F
113+
char.QueueCharTask(w.clearBuff(w.leaveSrc), 10*60)
114+
115+
return false
116+
}, fmt.Sprintf("flower-wreathed-swap-%v", char.Base.Key.String()))
117+
118+
return w, nil
119+
}
120+
121+
func (w *Weapon) clearBuff(src int) func() {
122+
return func() {
123+
if w.leaveSrc != src {
124+
return
125+
}
126+
if w.c.Player.Active() == w.char.Index && w.c.Player.CurrentState() == action.AimState {
127+
return
128+
}
129+
130+
w.stacks = 0
131+
w.c.Log.NewEvent("flower-wreathed feathers cleared", glog.LogWeaponEvent, w.char.Index).
132+
Write("stacks", w.stacks)
133+
}
134+
}

internal/weapons/bow/flowerwreathedfeathers/flowerwreathedfeathers_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
@@ -94,6 +94,7 @@ var weaponNames = []string{
9494
"filletblade",
9595
"finaleofthedeep",
9696
"fleuvecendreferryman",
97+
"flowerwreathedfeathers",
9798
"fluteofezpitzal",
9899
"flowingpurity",
99100
"footprintoftherainbow",
@@ -302,6 +303,7 @@ const (
302303
FilletBlade
303304
FinaleOfTheDeep
304305
FleuveCendreFerryman
306+
FlowerWreathedFeathers
305307
FluteOfEzpitzal
306308
FlowingPurity
307309
FootprintOfTheRainbow

pkg/shortcut/weapons.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ var WeaponNameToKey = map[string]keys.Weapon{
109109
"finale": keys.FinaleOfTheDeep,
110110
"fleuvecendreferryman": keys.FleuveCendreFerryman,
111111
"fleuve": keys.FleuveCendreFerryman,
112+
"flowerwreathedfeathers": keys.FlowerWreathedFeathers,
112113
"fluteofezpitzal": keys.FluteOfEzpitzal,
113114
"ezpitzal": keys.FluteOfEzpitzal,
114115
"pipe": keys.FleuveCendreFerryman,

pkg/simulation/imports.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import (
7373
_ "github.com/genshinsim/gcsim/internal/weapons/bow/endoftheline"
7474
_ "github.com/genshinsim/gcsim/internal/weapons/bow/favonius"
7575
_ "github.com/genshinsim/gcsim/internal/weapons/bow/firstgreatmagic"
76+
_ "github.com/genshinsim/gcsim/internal/weapons/bow/flowerwreathedfeathers"
7677
_ "github.com/genshinsim/gcsim/internal/weapons/bow/hamayumi"
7778
_ "github.com/genshinsim/gcsim/internal/weapons/bow/heartstrings"
7879
_ "github.com/genshinsim/gcsim/internal/weapons/bow/huntersbow"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
"fleuve",
143143
"pipe"
144144
],
145+
"flowerwreathedfeathers": [],
145146
"fluteofezpitzal": [
146147
"ezpital"
147148
],

ui/packages/ui/src/Data/weapon_data.generated.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,14 @@
488488
"image_name": "UI_EquipIcon_Sword_Machination",
489489
"name_text_hash_map ": "1921306659"
490490
},
491+
"flowerwreathedfeathers": {
492+
"id": 15430,
493+
"key": "flowerwreathedfeathers",
494+
"rarity": 4,
495+
"weapon_class": "WEAPON_BOW",
496+
"image_name": "UI_EquipIcon_Bow_Umpakati",
497+
"name_text_hash_map ": "4019353779"
498+
},
491499
"flowingpurity": {
492500
"id": 14425,
493501
"key": "flowingpurity",

0 commit comments

Comments
 (0)