Skip to content

Commit

Permalink
add starcallerswatch
Browse files Browse the repository at this point in the history
  • Loading branch information
kengzzzz committed Nov 30, 2024
1 parent 458e269 commit d3deb02
Show file tree
Hide file tree
Showing 10 changed files with 218 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/weapons/catalyst/starcallerswatch/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package_name: starcallerswatch
genshin_id: 14517
key: starcallerswatch
63 changes: 63 additions & 0 deletions internal/weapons/catalyst/starcallerswatch/data_gen.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
id: 14517
key: "starcallerswatch"
rarity: 5
weapon_class: WEAPON_CATALYST
image_name: "UI_EquipIcon_Catalyst_Figurines"
base_stats: {
base_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
initial_value: 44.3358
curve: GROW_CURVE_ATTACK_304
}
base_props: {
prop_type: FIGHT_PROP_ELEMENT_MASTERY
initial_value: 57.6
curve: GROW_CURVE_CRITICAL_301
}
promo_data: {
max_level: 20
}
promo_data: {
max_level: 40
add_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
value: 31.1
}
}
promo_data: {
max_level: 50
add_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
value: 62.2
}
}
promo_data: {
max_level: 60
add_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
value: 93.4
}
}
promo_data: {
max_level: 70
add_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
value: 124.5
}
}
promo_data: {
max_level: 80
add_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
value: 155.6
}
}
promo_data: {
max_level: 90
add_props: {
prop_type: FIGHT_PROP_BASE_ATTACK
value: 186.7
}
}
}
name_text_hash_map: 1201790667
82 changes: 82 additions & 0 deletions internal/weapons/catalyst/starcallerswatch/starcallerswatch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package starcallerswatch

import (
"fmt"

"github.com/genshinsim/gcsim/pkg/core"
"github.com/genshinsim/gcsim/pkg/core/attributes"
"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/core/player/shield"
"github.com/genshinsim/gcsim/pkg/modifier"
)

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

type Weapon struct {
Index int
}

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

const (
ICDKey = "starcallerswatch-icd"
buffDur = 15 * 60
ICDDur = 14 * 60
)

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.EM] = 75.0 + 25.0*r

char.AddStatMod(character.StatMod{
Base: modifier.NewBase("starcallerswatch-em", -1),
Amount: func() ([]float64, bool) {
return m, true
},
})

bonus := make([]float64, attributes.EndStatType)
bonus[attributes.DmgP] = 0.21 + 0.07*r

c.Events.Subscribe(event.OnShielded, func(args ...interface{}) bool {
shd := args[0].(shield.Shield)
if shd.ShieldOwner() != char.Index {
return false
}
if c.Player.Active() != char.Index {
return false
}
if char.StatusIsActive(ICDKey) {
return false
}

char.AddStatus(ICDKey, ICDDur, true)

for _, x := range c.Player.Chars() {
this := x
this.AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("starcallerswatch-bonus", buffDur),
AffectedStat: attributes.DmgP,
Amount: func() ([]float64, bool) {
if c.Player.Active() != this.Index {
return nil, false
}
return bonus, true
},
})
}

return false
}, fmt.Sprintf("starcallerswatch-onshielded-%v", char.Base.Key.String()))

return w, nil
}
25 changes: 25 additions & 0 deletions internal/weapons/catalyst/starcallerswatch/starcallerswatch_gen.go

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 @@ -193,6 +193,7 @@ var weaponNames = []string{
"splendoroftranquilwaters",
"staffofhoma",
"staffofthescarletsands",
"starcallerswatch",
"sturdybone",
"summitshaper",
"surfsup",
Expand Down Expand Up @@ -398,6 +399,7 @@ const (
SplendorOfTranquilWaters
StaffOfHoma
StaffOfTheScarletSands
StarcallersWatch
SturdyBone
SummitShaper
SurfsUp
Expand Down
2 changes: 2 additions & 0 deletions pkg/shortcut/weapons.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ var WeaponNameToKey = map[string]keys.Weapon{
"scarletsands": keys.StaffOfTheScarletSands,
"scarlet": keys.StaffOfTheScarletSands,
"sss": keys.StaffOfTheScarletSands,
"starcallerswatch": keys.StarcallersWatch,
"starcallers": keys.StarcallersWatch,
"sturdybone": keys.SturdyBone,
"summitshaper": keys.SummitShaper,
"summit": keys.SummitShaper,
Expand Down
1 change: 1 addition & 0 deletions pkg/simulation/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ import (
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/sacrificialjade"
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/skyward"
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/solar"
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/starcallerswatch"
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/surfsup"
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/thrilling"
_ "github.com/genshinsim/gcsim/internal/weapons/catalyst/tulaytullahsremembrance"
Expand Down
29 changes: 29 additions & 0 deletions ui/packages/docs/docs/reference/weapons/starcallerswatch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Starcaller's Watch
---

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

## Known issues

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

## Names

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

## Params

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

## Fields

<FieldsTable item_key="starcallerswatch" data_src="weapon" />
3 changes: 3 additions & 0 deletions ui/packages/docs/src/components/Names/weapon_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@
"scarlet",
"sss"
],
"starcallerswatch": [
"starcallers"
],
"sturdybone": [],
"summitshaper": [
"summit"
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 @@ -1280,6 +1280,14 @@
"image_name": "UI_EquipIcon_Pole_Deshret",
"name_text_hash_map ": "4238339131"
},
"starcallerswatch": {
"id": 14517,
"key": "starcallerswatch",
"rarity": 5,
"weapon_class": "WEAPON_CATALYST",
"image_name": "UI_EquipIcon_Catalyst_Figurines",
"name_text_hash_map ": "4238339131"
},
"sturdybone": {
"id": 11430,
"key": "sturdybone",
Expand Down

0 comments on commit d3deb02

Please sign in to comment.