Skip to content

Commit 7cf36bf

Browse files
Added Nightweaver's Looking Glass (#2578)
* added nightweavers looking glass updated docs pipeline rerun * adjusted shortcuts * Fix nightweavers implementation. Fix durations. Ignore reactions on gadgets. Fixed reaction bonus not scaling on refines. --------- Co-authored-by: Charlie Zheng <charlie.x.3000@gmail.com>
1 parent 6047ede commit 7cf36bf

12 files changed

Lines changed: 266 additions & 0 deletions

File tree

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: nightweavers
2+
genshin_id: 14520
3+
key: nightweaverslookingglass
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
id: 14520
2+
key: "nightweaverslookingglass"
3+
rarity: 5
4+
weapon_class: WEAPON_CATALYST
5+
image_name: "UI_EquipIcon_Catalyst_MenulisRing"
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: 1198975171
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
package nightweavers
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/genshinsim/gcsim/pkg/core"
7+
"github.com/genshinsim/gcsim/pkg/core/attacks"
8+
"github.com/genshinsim/gcsim/pkg/core/attributes"
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/enemy"
14+
"github.com/genshinsim/gcsim/pkg/modifier"
15+
)
16+
17+
func init() {
18+
core.RegisterWeaponFunc(keys.NightweaversLookingGlass, NewWeapon)
19+
}
20+
21+
type Weapon struct {
22+
Index int
23+
}
24+
25+
func (w *Weapon) SetIndex(idx int) { w.Index = idx }
26+
func (w *Weapon) Init() error { return nil }
27+
28+
const (
29+
prayerKey = "prayer-of-the-far-north"
30+
newMoonKey = "new-moon-verse"
31+
)
32+
33+
// When the equipping character's Elemental Skill deals Hydro or Dendro DMG,
34+
// they will gain Prayer of the Far North: Elemental Mastery is increased by
35+
// 60/75/90/105/120 for 4.5s. When nearby party members trigger Lunar-Bloom reactions, the
36+
// equipping character gains New Moon Verse: Elemental Mastery is increased
37+
// by 60/75/90/105/120 for 10s. When both Prayer of the Far North and New Moon Verse are
38+
// in effect, all nearby party members' Bloom DMG is increased by 120%/150%/180%/210%/240%, their
39+
// Hyperbloom and Burgeon DMG is increased by 80%/100%/120%/140%/160%, and their Lunar-Bloom DMG
40+
// is increased by 40%/50%/60%/70%/80%. This effect cannot stack. The aforementioned effects
41+
// can be triggered even if the equipping character is off-field.
42+
func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) (info.Weapon, error) {
43+
w := &Weapon{}
44+
r := p.Refine
45+
46+
m := make([]float64, attributes.EndStatType)
47+
m[attributes.EM] = 45 + float64(r)*15
48+
49+
prayer := func(args ...any) {
50+
if _, ok := args[0].(*enemy.Enemy); !ok {
51+
return
52+
}
53+
54+
atk := args[1].(*info.AttackEvent)
55+
if atk.Info.ActorIndex != char.Index() {
56+
return
57+
}
58+
switch atk.Info.AttackTag {
59+
case attacks.AttackTagElementalArt:
60+
case attacks.AttackTagElementalArtHold:
61+
default:
62+
return
63+
}
64+
65+
switch atk.Info.Element {
66+
case attributes.Hydro:
67+
case attributes.Dendro:
68+
default:
69+
return
70+
}
71+
72+
char.AddStatMod(character.StatMod{
73+
Base: modifier.NewBaseWithHitlag(prayerKey, 4.5*60),
74+
AffectedStat: attributes.EM,
75+
Amount: func() []float64 {
76+
return m
77+
},
78+
})
79+
}
80+
c.Events.Subscribe(event.OnEnemyDamage, prayer, fmt.Sprintf("prayer-of-the-far-north-%v", char.Base.Key.String()))
81+
82+
newmoon := func(args ...any) {
83+
if _, ok := args[0].(*enemy.Enemy); !ok {
84+
return
85+
}
86+
char.AddStatMod(character.StatMod{
87+
Base: modifier.NewBaseWithHitlag(newMoonKey, 10*60),
88+
AffectedStat: attributes.EM,
89+
Amount: func() []float64 {
90+
return m
91+
},
92+
})
93+
}
94+
c.Events.Subscribe(event.OnLunarBloom, newmoon, fmt.Sprintf("new-moon-verse-%v", char.Base.Key.String()))
95+
96+
reactBuff := 0.3 + float64(r)*0.1
97+
// add reaction bonus when both of previous bonuses are active
98+
for _, otherChar := range c.Player.Chars() {
99+
otherChar.AddReactBonusMod(character.ReactBonusMod{
100+
Base: modifier.NewBase("nightweavers", -1),
101+
Amount: func(ai info.AttackInfo) float64 {
102+
if !char.StatusIsActive(prayerKey) || !char.StatusIsActive(newMoonKey) {
103+
return 0
104+
}
105+
106+
switch ai.AttackTag {
107+
case attacks.AttackTagBloom, attacks.AttackTagBountifulCore:
108+
return reactBuff * 3
109+
case attacks.AttackTagHyperbloom, attacks.AttackTagBurgeon:
110+
return reactBuff * 2
111+
case attacks.AttackTagDirectLunarBloom:
112+
return reactBuff
113+
default:
114+
return 0
115+
}
116+
},
117+
})
118+
}
119+
120+
return w, nil
121+
}

internal/weapons/catalyst/nightweavers/nightweavers_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
@@ -147,6 +147,7 @@ var weaponNames = []string{
147147
"moonweaversdawn",
148148
"mountainbracingbolt",
149149
"mouunsmoon",
150+
"nightweaverslookingglass",
150151
"nocturnescurtaincall",
151152
"oathsworneye",
152153
"oldmercspal",
@@ -375,6 +376,7 @@ const (
375376
MoonweaversDawn
376377
MountainBracingBolt
377378
MouunsMoon
379+
NightweaversLookingGlass
378380
NocturnesCurtainCall
379381
OathswornEye
380382
OldMercsPal

pkg/shortcut/weapons.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ var WeaponNameToKey = map[string]keys.Weapon{
202202
"mouunsmoon": keys.MouunsMoon,
203203
"mouun": keys.MouunsMoon,
204204
"mouuns": keys.MouunsMoon,
205+
"nightweaverslookingglass": keys.NightweaversLookingGlass,
206+
"nightweavers": keys.NightweaversLookingGlass,
205207
"nocturnescurtaincall": keys.NocturnesCurtainCall,
206208
"nocturnes": keys.NocturnesCurtainCall,
207209
"oathsworneye": keys.OathswornEye,

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/mappa"
136136
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/memory"
137137
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/moonglow"
138+
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/nightweavers"
138139
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/nocturnes"
139140
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/oathsworneye"
140141
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/otherworldly"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: >
3+
Nightweaver's Looking Glass
4+
---
5+
6+
import AoETable from "@site/src/components/AoE/AoETable";
7+
import IssuesTable from "@site/src/components/Issues/IssuesTable";
8+
import NamesList from "@site/src/components/Names/NamesList";
9+
import ParamsTable from "@site/src/components/Params/ParamsTable";
10+
import FieldsTable from "@site/src/components/Fields/FieldsTable";
11+
12+
## AoE Data
13+
14+
<AoETable item_key="nightweaverslookingglass" data_src="weapon" />
15+
16+
## Known issues
17+
18+
<IssuesTable item_key="nightweaverslookingglass" data_src="weapon" />
19+
20+
## Names
21+
22+
<NamesList item_key="nightweaverslookingglass" data_src="weapon" />
23+
24+
## Params
25+
26+
<ParamsTable item_key="nightweaverslookingglass" data_src="weapon" />
27+
28+
## Fields
29+
30+
<FieldsTable item_key="nightweaverslookingglass" 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
@@ -256,6 +256,9 @@
256256
"mouun",
257257
"mouuns"
258258
],
259+
"nightweaverslookingglass": [
260+
"nightweavers"
261+
],
259262
"nocturnescurtaincall": [
260263
"nocturnes"
261264
],

0 commit comments

Comments
 (0)