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

add calamity of eshu #2268

Merged
merged 2 commits into from
Nov 22, 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
2 changes: 2 additions & 0 deletions internal/services/assets/weapons_gen.go

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

46 changes: 46 additions & 0 deletions internal/weapons/sword/calamityofeshu/calamityofeshu.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package calamityofeshu

import (
"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/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.CalamityOfEshu, NewWeapon)
}

type Weapon struct {
Index int
}

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

func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) (info.Weapon, error) {
w := &Weapon{}
r := float64(p.Refine)

m := make([]float64, attributes.EndStatType)
m[attributes.DmgP] = 0.15 + 0.05*r
m[attributes.CR] = 0.06 + 0.02*r
char.AddAttackMod(character.AttackMod{
Base: modifier.NewBase("calamityofeshu", -1),
Amount: func(atk *combat.AttackEvent, t combat.Target) ([]float64, bool) {
if !c.Player.Shields.CharacterIsShielded(char.Index, c.Player.Active()) {
return nil, false
}
if atk.Info.AttackTag != attacks.AttackTagNormal && atk.Info.AttackTag != attacks.AttackTagExtra {
return nil, false
}
return m, true
},
})

return w, nil
}
25 changes: 25 additions & 0 deletions internal/weapons/sword/calamityofeshu/calamityofeshu_gen.go

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

3 changes: 3 additions & 0 deletions internal/weapons/sword/calamityofeshu/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package_name: calamityofeshu
genshin_id: 11432
key: calamityofeshu
63 changes: 63 additions & 0 deletions internal/weapons/sword/calamityofeshu/data_gen.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
id: 11432
key: "calamityofeshu"
rarity: 4
weapon_class: WEAPON_SWORD_ONE_HAND
image_name: "UI_EquipIcon_Sword_SacrificialNgombe"
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_ATTACK_PERCENT
initial_value: 0.06
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: 590019915
2 changes: 2 additions & 0 deletions pkg/core/keys/weapon.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ var weaponNames = []string{
"blackcliffwarbow",
"blacktassel",
"bloodtaintedgreatsword",
"calamityofeshu",
"calamityqueller",
"cashflowsupervision",
"chainbreaker",
Expand Down Expand Up @@ -256,6 +257,7 @@ const (
BlackcliffWarbow
BlackTassel
BloodtaintedGreatsword
CalamityOfEshu
CalamityQueller
CashflowSupervision
ChainBreaker
Expand Down
1 change: 1 addition & 0 deletions pkg/shortcut/weapons.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var WeaponNameToKey = map[string]keys.Weapon{
"blacktassel": keys.BlackTassel,
"bloodtaintedgreatsword": keys.BloodtaintedGreatsword,
"bloodtainted": keys.BloodtaintedGreatsword,
"calamityofeshu": keys.CalamityOfEshu,
"calamityqueller": keys.CalamityQueller,
"calamity": keys.CalamityQueller,
"cashflowsupervision": keys.CashflowSupervision,
Expand Down
1 change: 1 addition & 0 deletions pkg/simulation/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ import (
_ "github.com/genshinsim/gcsim/internal/weapons/sword/aquila"
_ "github.com/genshinsim/gcsim/internal/weapons/sword/blackcliff"
_ "github.com/genshinsim/gcsim/internal/weapons/sword/blacksword"
_ "github.com/genshinsim/gcsim/internal/weapons/sword/calamityofeshu"
_ "github.com/genshinsim/gcsim/internal/weapons/sword/cinnabar"
_ "github.com/genshinsim/gcsim/internal/weapons/sword/coolsteel"
_ "github.com/genshinsim/gcsim/internal/weapons/sword/darkironsword"
Expand Down
29 changes: 29 additions & 0 deletions ui/packages/docs/docs/reference/weapons/calamityofeshu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Calamity of Eshu
---

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="calamityofeshu" data_src="weapon" />

## Known issues

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

## Names

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

## Params

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

## Fields

<FieldsTable item_key="calamityofeshu" 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 @@ -49,6 +49,7 @@
"bloodtaintedgreatsword": [
"bloodtainted"
],
"calamityofeshu": [],
"calamityqueller": [
"calamity"
],
Expand Down
8 changes: 8 additions & 0 deletions ui/packages/ui/src/Data/weapon_data.generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@
"image_name": "UI_EquipIcon_Claymore_Siegfry",
"name_text_hash_map ": "4090429643"
},
"calamityofeshu": {
"id": 11432,
"key": "calamityofeshu",
"rarity": 4,
"weapon_class": "WEAPON_SWORD_ONE_HAND",
"image_name": "UI_EquipIcon_Sword_SacrificialNgombe",
"name_text_hash_map ": "590019915"
},
"calamityqueller": {
"id": 13507,
"key": "calamityqueller",
Expand Down
Loading