forked from genshinsim/gcsim
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
218 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
63
internal/weapons/catalyst/starcallerswatch/data_gen.textproto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
82
internal/weapons/catalyst/starcallerswatch/starcallerswatch.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
25
internal/weapons/catalyst/starcallerswatch/starcallerswatch_gen.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
ui/packages/docs/docs/reference/weapons/starcallerswatch.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters