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
11 changed files
with
250 additions
and
1 deletion.
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: lumidouceelegy | ||
genshin_id: 13513 | ||
key: lumidouceelegy |
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: 13513 | ||
key: "lumidouceelegy" | ||
rarity: 5 | ||
weapon_class: WEAPON_POLE | ||
image_name: "UI_EquipIcon_Pole_Muguet" | ||
base_stats: { | ||
base_props: { | ||
prop_type: FIGHT_PROP_BASE_ATTACK | ||
initial_value: 45.9364 | ||
curve: GROW_CURVE_ATTACK_301 | ||
} | ||
base_props: { | ||
prop_type: FIGHT_PROP_CRITICAL | ||
initial_value: 0.072 | ||
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: 1948935171 |
112 changes: 112 additions & 0 deletions
112
internal/weapons/spear/lumidouceelegy/lumidouceelegy.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,112 @@ | ||
package lumidouceelegy | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/genshinsim/gcsim/pkg/core" | ||
"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/enemy" | ||
"github.com/genshinsim/gcsim/pkg/modifier" | ||
) | ||
|
||
func init() { | ||
core.RegisterWeaponFunc(keys.LumidouceElegy, NewWeapon) | ||
} | ||
|
||
const ( | ||
atkBuffKey = "lumidouceelegy-atk-buff" | ||
bonusBuffKey = "lumidouceelegy-bonus-buff" | ||
energyKey = "lumidouceelegy-energy" | ||
energyICDKey = "lumidouceelegy-energy-icd" | ||
) | ||
|
||
type Weapon struct { | ||
Index int | ||
refine int | ||
char *character.CharWrapper | ||
stacks int | ||
buff []float64 | ||
} | ||
|
||
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{ | ||
refine: p.Refine, | ||
char: char, | ||
} | ||
|
||
perm := make([]float64, attributes.EndStatType) | ||
perm[attributes.ATKP] = 0.11 + 0.04*float64(w.refine) | ||
char.AddStatMod(character.StatMod{ | ||
Base: modifier.NewBase(atkBuffKey, -1), | ||
AffectedStat: attributes.ATKP, | ||
Amount: func() ([]float64, bool) { | ||
return perm, true | ||
}, | ||
}) | ||
|
||
w.buff = make([]float64, attributes.EndStatType) | ||
|
||
c.Events.Subscribe(event.OnBurning, func(args ...interface{}) bool { | ||
_, ok := args[0].(*enemy.Enemy) | ||
atk := args[1].(*combat.AttackEvent) | ||
if !ok { | ||
return false | ||
} | ||
if atk.Info.ActorIndex != w.char.Index { | ||
return false | ||
} | ||
w.bonusCB() | ||
return false | ||
}, fmt.Sprintf("lumidouceelegy-on-burning-%v", char.Base.Key.String())) | ||
|
||
c.Events.Subscribe(event.OnEnemyDamage, func(args ...interface{}) bool { | ||
t, ok := args[0].(*enemy.Enemy) | ||
atk := args[1].(*combat.AttackEvent) | ||
if !ok { | ||
return false | ||
} | ||
if !t.IsBurning() { | ||
return false | ||
} | ||
if atk.Info.Element != attributes.Dendro { | ||
return false | ||
} | ||
if atk.Info.ActorIndex != w.char.Index { | ||
return false | ||
} | ||
w.bonusCB() | ||
return false | ||
}, fmt.Sprintf("lumidouceelegy-on-damage-%v", char.Base.Key.String())) | ||
|
||
return &w, nil | ||
} | ||
|
||
func (w *Weapon) bonusCB() { | ||
if !w.char.StatModIsActive(bonusBuffKey) { | ||
w.stacks = 0 | ||
} | ||
if w.stacks < 2 { | ||
w.stacks++ | ||
} | ||
|
||
if w.stacks == 2 && !w.char.StatusIsActive(energyICDKey) { | ||
w.char.AddStatus(energyICDKey, 12*60, true) | ||
w.char.AddEnergy(energyKey, float64(w.refine)+11.0) | ||
} | ||
|
||
w.char.AddStatMod(character.StatMod{ | ||
Base: modifier.NewBaseWithHitlag(bonusBuffKey, 8*60), | ||
Amount: func() ([]float64, bool) { | ||
w.buff[attributes.DmgP] = (0.05*float64(w.refine) + 0.13) * float64(w.stacks) | ||
return w.buff, true | ||
}, | ||
}) | ||
} |
25 changes: 25 additions & 0 deletions
25
internal/weapons/spear/lumidouceelegy/lumidouceelegy_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
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,26 @@ | ||
--- | ||
--- | ||
|
||
## title: Lumidouce Elegy | ||
|
||
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="lumidouceelegy" data_src="weapon" /> | ||
|
||
## Known issues | ||
|
||
<IssuesTable item_key="lumidouceelegy" data_src="weapon" /> | ||
|
||
## Names | ||
|
||
<NamesList item_key="lumidouceelegy" data_src="weapon" /> | ||
|
||
## Params | ||
|
||
<ParamsTable item_key="lumidouceelegy" data_src="weapon" /> | ||
|
||
## Fields | ||
|
||
<FieldsTable item_key="lumidouceelegy" 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
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