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

Mountain-Bracing Bolt #2249

Merged
merged 2 commits into from
Oct 20, 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
3 changes: 3 additions & 0 deletions internal/weapons/spear/mountainbracingbolt/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package_name: mountainbracingbolt
genshin_id: 13430
key: mountainbracingbolt
63 changes: 63 additions & 0 deletions internal/weapons/spear/mountainbracingbolt/data_gen.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
id: 13430
key: "mountainbracingbolt"
rarity: 4
weapon_class: WEAPON_POLE
image_name: "UI_EquipIcon_Pole_Umpakati"
base_stats: {
base_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
initial_value: 43.7349
curve: GROW_CURVE_ATTACK_202
}
base_props: {
prop_type: FIGHT_PROP_CHARGE_EFFICIENCY
initial_value: 0.066667
curve: GROW_CURVE_CRITICAL_201
}
promo_data: {
max_level: 20
}
promo_data: {
max_level: 40
add_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
value: 25.9
}
}
promo_data: {
max_level: 50
add_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
value: 51.9
}
}
promo_data: {
max_level: 60
add_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
value: 77.8
}
}
promo_data: {
max_level: 70
add_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
value: 103.7
}
}
promo_data: {
max_level: 80
add_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
value: 129.7
}
}
promo_data: {
max_level: 90
add_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
value: 155.6
}
}
}
name_text_hash_map: 1965515667
70 changes: 70 additions & 0 deletions internal/weapons/spear/mountainbracingbolt/mountainbracingbolt.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package mountainbracingbolt

import (
"fmt"

"github.com/genshinsim/gcsim/pkg/core"
"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/event"
"github.com/genshinsim/gcsim/pkg/core/info"
"github.com/genshinsim/gcsim/pkg/core/keys"
"github.com/genshinsim/gcsim/pkg/core/player/character"
"github.com/genshinsim/gcsim/pkg/modifier"
)

func init() {
core.RegisterWeaponFunc(keys.MountainBracingBolt, NewWeapon)
}

type Weapon struct {
Index int
}

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

const (
baseBuffKey = "mountain-bracing-bolt-base"
otherBuffKey = "mountain-bracing-bolt-other"
)

// Decreases Climbing Stamina Consumption by 15% and increases Elemental Skill DMG by 12%.
// Also, after other nearby party members use Elemental Skills,
// the equipping character's Elemental Skill DMG will also increase by 12% for 8s.
func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) (info.Weapon, error) {
w := &Weapon{}
r := p.Refine

m := make([]float64, attributes.EndStatType)
m[attributes.DmgP] = 0.09 + float64(r)*0.03

char.AddAttackMod(character.AttackMod{
Base: modifier.NewBase(baseBuffKey, -1),
Amount: func(atk *combat.AttackEvent, t combat.Target) ([]float64, bool) {
if atk.Info.AttackTag != attacks.AttackTagElementalArt && atk.Info.AttackTag != attacks.AttackTagElementalArtHold {
return nil, false
}
return m, true
},
})

c.Events.Subscribe(event.OnSkill, func(args ...interface{}) bool {
if c.Player.Active() == char.Index {
return false
}
char.AddAttackMod(character.AttackMod{
Base: modifier.NewBaseWithHitlag(otherBuffKey, 8*60),
Amount: func(atk *combat.AttackEvent, t combat.Target) ([]float64, bool) {
if atk.Info.AttackTag != attacks.AttackTagElementalArt && atk.Info.AttackTag != attacks.AttackTagElementalArtHold {
return nil, false
}
return m, true
},
})
return false
}, fmt.Sprintf("mountain-bracing-bolt-%v", char.Base.Key.String()))

return w, nil
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/core/keys/weapon.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ var weaponNames = []string{
"mistsplitterreforged",
"mitternachtswaltz",
"moonpiercer",
"mountainbracingbolt",
"mouunsmoon",
"oathsworneye",
"oldmercspal",
Expand Down Expand Up @@ -331,6 +332,7 @@ const (
MistsplitterReforged
MitternachtsWaltz
Moonpiercer
MountainBracingBolt
MouunsMoon
OathswornEye
OldMercsPal
Expand Down
1 change: 1 addition & 0 deletions pkg/shortcut/weapons.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ var WeaponNameToKey = map[string]keys.Weapon{
"mitternachts": keys.MitternachtsWaltz,
"waltz": keys.MitternachtsWaltz,
"moonpiercer": keys.Moonpiercer,
"mountainbracingbolt": keys.MountainBracingBolt,
"mouunsmoon": keys.MouunsMoon,
"mouun": keys.MouunsMoon,
"mouuns": keys.MouunsMoon,
Expand Down
1 change: 1 addition & 0 deletions pkg/simulation/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ import (
_ "github.com/genshinsim/gcsim/internal/weapons/spear/lumidouceelegy"
_ "github.com/genshinsim/gcsim/internal/weapons/spear/missive"
_ "github.com/genshinsim/gcsim/internal/weapons/spear/moonpiercer"
_ "github.com/genshinsim/gcsim/internal/weapons/spear/mountainbracingbolt"
_ "github.com/genshinsim/gcsim/internal/weapons/spear/primordial"
_ "github.com/genshinsim/gcsim/internal/weapons/spear/prospectorsdrill"
_ "github.com/genshinsim/gcsim/internal/weapons/spear/prototype"
Expand Down
29 changes: 29 additions & 0 deletions ui/packages/docs/docs/reference/weapons/mountainbracingbolt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Mountain-Bracing Bolt
---

import AoETable from "@site/src/components/AoE/AoETable";
import IssuesTable from "@site/src/components/Issues/IssuesTable";
import NamesList from "@site/src/components/Names/NamesList";
import ParamsTable from "@site/src/components/Params/ParamsTable";
import FieldsTable from "@site/src/components/Fields/FieldsTable";

## AoE Data

<AoETable item_key="mountainbracingbolt" data_src="weapon" />

## Known issues

<IssuesTable item_key="mountainbracingbolt" data_src="weapon" />

## Names

<NamesList item_key="mountainbracingbolt" data_src="weapon" />

## Params

<ParamsTable item_key="mountainbracingbolt" data_src="weapon" />

## Fields

<FieldsTable item_key="mountainbracingbolt" data_src="weapon" />
1 change: 1 addition & 0 deletions ui/packages/docs/src/components/Names/weapon_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
"waltz"
],
"moonpiercer": [],
"mountainbracingbolt": [],
"mouunsmoon": [
"mouun",
"mouuns"
Expand Down
Loading
Loading