Skip to content

Commit

Permalink
add lumidouceelegy
Browse files Browse the repository at this point in the history
  • Loading branch information
kengzzzz committed Jul 21, 2024
1 parent 62aef0b commit ac5c4d9
Show file tree
Hide file tree
Showing 11 changed files with 250 additions and 1 deletion.
3 changes: 3 additions & 0 deletions internal/weapons/spear/lumidouceelegy/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package_name: lumidouceelegy
genshin_id: 13513
key: lumidouceelegy
63 changes: 63 additions & 0 deletions internal/weapons/spear/lumidouceelegy/data_gen.textproto
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 internal/weapons/spear/lumidouceelegy/lumidouceelegy.go
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 internal/weapons/spear/lumidouceelegy/lumidouceelegy_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 @@ -114,6 +114,7 @@ var weaponNames = []string{
"lithicblade",
"lithicspear",
"lostprayertothesacredwinds",
"lumidouceelegy",
"luxurioussealord",
"magicguide",
"mailedflower",
Expand Down Expand Up @@ -302,6 +303,7 @@ const (
LithicBlade
LithicSpear
LostPrayerToTheSacredWinds
LumidouceElegy
LuxuriousSeaLord
MagicGuide
MailedFlower
Expand Down
1 change: 1 addition & 0 deletions pkg/shortcut/weapons.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ var WeaponNameToKey = map[string]keys.Weapon{
"lithicspear": keys.LithicSpear,
"lostprayertothesacredwinds": keys.LostPrayerToTheSacredWinds,
"lostprayer": keys.LostPrayerToTheSacredWinds,
"lumidouceelegy": keys.LumidouceElegy,
"luxurioussealord": keys.LuxuriousSeaLord,
"sealord": keys.LuxuriousSeaLord,
"magicguide": keys.MagicGuide,
Expand Down
1 change: 1 addition & 0 deletions pkg/simulation/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ import (
_ "github.com/genshinsim/gcsim/internal/weapons/spear/ironpoint"
_ "github.com/genshinsim/gcsim/internal/weapons/spear/kitain"
_ "github.com/genshinsim/gcsim/internal/weapons/spear/lithic"
_ "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/primordial"
Expand Down
26 changes: 26 additions & 0 deletions ui/packages/docs/docs/reference/weapons/lumidouceelegy.md
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" />
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 @@ -189,6 +189,7 @@
"lostprayertothesacredwinds": [
"lostprayer"
],
"lumidouceelegy": [],
"luxurioussealord": [
"sealord"
],
Expand Down
9 changes: 8 additions & 1 deletion ui/packages/localization/src/locales/names.generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"lithicblade": "千岩古剑",
"lithicspear": "千岩长枪",
"lostprayertothesacredwinds": "四风原典",
"lumidouceelegy": "柔灯挽歌",
"luxurioussealord": "衔珠海皇",
"magicguide": "魔导绪论",
"mailedflower": "饰铁之花",
Expand Down Expand Up @@ -780,6 +781,7 @@
"lithicblade": "Lithic Blade",
"lithicspear": "Lithic Spear",
"lostprayertothesacredwinds": "Lost Prayer to the Sacred Winds",
"lumidouceelegy": "Lumidouce Elegy",
"luxurioussealord": "Luxurious Sea-Lord",
"magicguide": "Magic Guide",
"mailedflower": "Mailed Flower",
Expand Down Expand Up @@ -1386,6 +1388,7 @@
"lithicblade": "Antikes Millelithenschwert",
"lithicspear": "Millelithenlanze",
"lostprayertothesacredwinds": "Gebete der Vier Winde",
"lumidouceelegy": "Lumidouce-Elegie",
"luxurioussealord": "Luxuriöser Seekönig",
"magicguide": "Magieführer",
"mailedflower": "Eiserne Blume",
Expand Down Expand Up @@ -1992,6 +1995,7 @@
"lithicblade": "千岩古剣",
"lithicspear": "千岩長槍",
"lostprayertothesacredwinds": "四風原典",
"lumidouceelegy": "ルミドゥースの挽歌",
"luxurioussealord": "銜玉の海皇",
"magicguide": "魔導緒論",
"mailedflower": "鉄彩の花",
Expand Down Expand Up @@ -2597,6 +2601,7 @@
"lithicblade": "천암고검",
"lithicspear": "천암장창",
"lostprayertothesacredwinds": "사풍 원서",
"lumidouceelegy": "등방울꽃의 애가",
"luxurioussealord": "진주를 문 해황",
"magicguide": "마도 서론",
"mailedflower": "꽃 장식 대검",
Expand Down Expand Up @@ -3203,6 +3208,7 @@
"lithicblade": "Каменный меч",
"lithicspear": "Каменное копьё",
"lostprayertothesacredwinds": "Молитва святым ветрам",
"lumidouceelegy": "Элегия Люмидус",
"luxurioussealord": "Благодатный владыка вод",
"magicguide": "Руководство по магии",
"mailedflower": "Цветок в латах",
Expand Down Expand Up @@ -3468,7 +3474,7 @@
"goldenwolflord": "Золотой волчий вожак",
"groundedgeoshroom": "Земляной Гео моровик",
"groundedhydroshroom": "Земляной Гидро моровик",
"guardianofapepsoasis": "Страж оазиса Апепа",
"guardianofapepsoasis": "Страж оазиса Апеп",
"halftulpa": "Полутульпа",
"hatjellyfish": "Шляповидная медуза",
"hilichurl": "Хиличурл",
Expand Down Expand Up @@ -3809,6 +3815,7 @@
"lithicblade": "Espada Lítica",
"lithicspear": "Lanza Lítica",
"lostprayertothesacredwinds": "Oración Perdida a los Vientos Sagrados",
"lumidouceelegy": "Elegía Lumidulce",
"luxurioussealord": "Rey de los Mares",
"magicguide": "Guía Mágica",
"mailedflower": "Fierro Floriorlado",
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 @@ -648,6 +648,14 @@
"image_name": "UI_EquipIcon_Catalyst_Fourwinds",
"name_text_hash_map ": "1455107995"
},
"lumidouceelegy": {
"id": 13513,
"key": "lumidouceelegy",
"rarity": 5,
"weapon_class": "WEAPON_POLE",
"image_name": "UI_EquipIcon_Pole_Muguet",
"name_text_hash_map ": "1948935171"
},
"luxurioussealord": {
"id": 12412,
"key": "luxurioussealord",
Expand Down

0 comments on commit ac5c4d9

Please sign in to comment.