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 kagotsurube isshin sword #655

Merged
merged 2 commits into from
Aug 5, 2022
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
83 changes: 83 additions & 0 deletions internal/weapons/sword/kagotsurubeisshin/kagotsurubeisshin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package kagotsurubeisshin

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

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

// When a Normal, Charged, or Plunging Attack hits an opponent, it will whip up a
// Hewing Gale, dealing AoE DMG equal to 180% of ATK and increasing ATK by 15% for
// 8s. This effect can be triggered once every 8s.
type Weapon struct {
Index int
}

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

const icdKey = "kagotsurube-isshin-icd"

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

duration := 480
cd := 480

c.Events.Subscribe(event.OnDamage, func(args ...interface{}) bool {
atk := args[1].(*combat.AttackEvent)
if atk.Info.ActorIndex != char.Index {
return false
}
if c.Player.Active() != char.Index {
return false
}
if char.StatusIsActive(icdKey) {
return false
}
if atk.Info.AttackTag != combat.AttackTagNormal && atk.Info.AttackTag != combat.AttackTagExtra && atk.Info.AttackTag != combat.AttackTagPlunge {
return false
}
val := make([]float64, attributes.EndStatType)
val[attributes.ATKP] = 0.15
char.AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("kagotsurube-isshin", duration),
AffectedStat: attributes.NoStat,
Amount: func() ([]float64, bool) {
return val, true
},
})
// add a new action that deals % dmg immediately
// superconduct attack
ai := combat.AttackInfo{
ActorIndex: char.Index,
Abil: "Kagotsurube Isshin Proc",
AttackTag: combat.AttackTagWeaponSkill,
ICDTag: combat.ICDTagNone,
ICDGroup: combat.ICDGroupDefault,
StrikeType: combat.StrikeTypeDefault,
Element: attributes.Physical,
Durability: 100,
Mult: 1.8,
}
trg := args[0].(combat.Target)
c.QueueAttack(ai, combat.NewCircleHit(trg, 1, false, combat.TargettableEnemy), 0, 1)

// trigger cd
char.AddStatus(icdKey, cd, true)

return false
}, fmt.Sprintf("kagotsurube-isshin-%v", char.Base.Key.String()))
return w, nil
}
37 changes: 37 additions & 0 deletions pkg/core/curves/weaponcurves.go
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,43 @@ var WeaponBaseMap = map[keys.Weapon]WeaponBase{
},
},
},
keys.KagotsurubeIsshin: {
AtkCurve: GROW_CURVE_ATTACK_201,
SpecializedCurve: GROW_CURVE_CRITICAL_201,
BaseAtk: 42.4010009765625,
BaseSpecialized: 0.09000000357627869,
Specialized: attributes.ATKP,
PromotionBonus: []PromoData{
{
MaxLevel: 20,
Atk: 0,
},
{
MaxLevel: 40,
Atk: 25.899999618530273,
},
{
MaxLevel: 50,
Atk: 51.900001525878906,
},
{
MaxLevel: 60,
Atk: 77.80000305175781,
},
{
MaxLevel: 70,
Atk: 103.69999694824219,
},
{
MaxLevel: 80,
Atk: 129.6999969482422,
},
{
MaxLevel: 90,
Atk: 155.60000610351562,
},
},
},
keys.KagurasVerity: {
AtkCurve: GROW_CURVE_ATTACK_301,
SpecializedCurve: GROW_CURVE_CRITICAL_301,
Expand Down
2 changes: 2 additions & 0 deletions pkg/core/keys/weapon.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ var weaponNames = []string{
"huntersbow",
"ironpoint",
"ironsting",
"kagotsurubeisshin",
"kagurasverity",
"katsuragikirinagamasa",
"kitaincrossspear",
Expand Down Expand Up @@ -221,6 +222,7 @@ const (
HuntersBow
IronPoint
IronSting
KagotsurubeIsshin
KagurasVerity
KatsuragikiriNagamasa
KitainCrossSpear
Expand Down
1 change: 1 addition & 0 deletions pkg/shortcut/weapons.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ var WeaponNameToKey = map[string]keys.Weapon{
"huntersbow": keys.HuntersBow,
"ironpoint": keys.IronPoint,
"ironsting": keys.IronSting,
"kagotsurubeisshin": keys.KagotsurubeIsshin,
"kagurasverity": keys.KagurasVerity,
"katsuragikirinagamasa": keys.KatsuragikiriNagamasa,
"kitaincrossspear": keys.KitainCrossSpear,
Expand Down
1 change: 1 addition & 0 deletions pkg/simulation/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ import (
_ "github.com/genshinsim/gcsim/internal/weapons/sword/haran"
_ "github.com/genshinsim/gcsim/internal/weapons/sword/harbinger"
_ "github.com/genshinsim/gcsim/internal/weapons/sword/ironsting"
_ "github.com/genshinsim/gcsim/internal/weapons/sword/kagotsurubeisshin"
_ "github.com/genshinsim/gcsim/internal/weapons/sword/lion"
_ "github.com/genshinsim/gcsim/internal/weapons/sword/lithic"
_ "github.com/genshinsim/gcsim/internal/weapons/sword/mistsplitter"
Expand Down
164 changes: 164 additions & 0 deletions scripts/weapstat/weapons.json
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,170 @@
}
]
},
"kagotsurubeisshin": {
"base": {
"attack": 42.4010009765625,
"specialized": 0.09000000357627869
},
"curve": {
"attack": "GROW_CURVE_ATTACK_201",
"specialized": "GROW_CURVE_CRITICAL_201"
},
"specialized": "FIGHT_PROP_ATTACK_PERCENT",
"promotion": [
{
"maxlevel": 20,
"attack": 0
},
{
"maxlevel": 40,
"attack": 25.899999618530273
},
{
"maxlevel": 50,
"attack": 51.900001525878906
},
{
"maxlevel": 60,
"attack": 77.80000305175781
},
{
"maxlevel": 70,
"attack": 103.69999694824219
},
{
"maxlevel": 80,
"attack": 129.6999969482422
},
{
"maxlevel": 90,
"attack": 155.60000610351562
}
]
},
"prizedisshinblade": {
"base": {
"attack": 42.4010009765625,
"specialized": 0.09000000357627869
},
"curve": {
"attack": "GROW_CURVE_ATTACK_201",
"specialized": "GROW_CURVE_CRITICAL_201"
},
"specialized": "FIGHT_PROP_ATTACK_PERCENT",
"promotion": [
{
"maxlevel": 20,
"attack": 0
},
{
"maxlevel": 40,
"attack": 25.899999618530273
},
{
"maxlevel": 50,
"attack": 51.900001525878906
},
{
"maxlevel": 60,
"attack": 77.80000305175781
},
{
"maxlevel": 70,
"attack": 103.69999694824219
},
{
"maxlevel": 80,
"attack": 129.6999969482422
},
{
"maxlevel": 90,
"attack": 155.60000610351562
}
]
},
"prizedisshinbladea": {
"base": {
"attack": 42.4010009765625,
"specialized": 0
},
"curve": {
"attack": "GROW_CURVE_ATTACK_201",
"specialized": "GROW_CURVE_CRITICAL_201"
},
"specialized": "FIGHT_PROP_ATTACK_PERCENT",
"promotion": [
{
"maxlevel": 20,
"attack": 0
},
{
"maxlevel": 40,
"attack": 25.899999618530273
},
{
"maxlevel": 50,
"attack": 51.900001525878906
},
{
"maxlevel": 60,
"attack": 77.80000305175781
},
{
"maxlevel": 70,
"attack": 103.69999694824219
},
{
"maxlevel": 80,
"attack": 129.6999969482422
},
{
"maxlevel": 90,
"attack": 155.60000610351562
}
]
},
"prizedisshinbladeb": {
"base": {
"attack": 42.4010009765625,
"specialized": 0.04500000178813934
},
"curve": {
"attack": "GROW_CURVE_ATTACK_201",
"specialized": "GROW_CURVE_CRITICAL_201"
},
"specialized": "FIGHT_PROP_ATTACK_PERCENT",
"promotion": [
{
"maxlevel": 20,
"attack": 0
},
{
"maxlevel": 40,
"attack": 25.899999618530273
},
{
"maxlevel": 50,
"attack": 51.900001525878906
},
{
"maxlevel": 60,
"attack": 77.80000305175781
},
{
"maxlevel": 70,
"attack": 103.69999694824219
},
{
"maxlevel": 80,
"attack": 129.6999969482422
},
{
"maxlevel": 90,
"attack": 155.60000610351562
}
]
},
"aquilafavonia": {
"base": {
"attack": 47.5369987487793,
Expand Down
Loading