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

Yanfei frames update #693

Merged
merged 2 commits into from
Aug 10, 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
11 changes: 7 additions & 4 deletions internal/characters/yanfei/asc.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
// repeatedly triggered it will overwrite the oldest bonus first. The Pyro DMG
// bonus from Proviso is applied before charged attack damage is calculated.
func (c *char) a1(stacks int) {
c.a1buff[attributes.PyroP] = float64(stacks) * 0.05
c.a1Buff[attributes.PyroP] = float64(stacks) * 0.05
c.AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("yanfei-a1", 360),
AffectedStat: attributes.PyroP,
Amount: func() ([]float64, bool) {
return c.a1buff, true
return c.a1Buff, true
},
})
}
Expand All @@ -39,6 +39,9 @@ func (c *char) a4() {
if atk.Info.AttackTag != combat.AttackTagExtra && !crit {
return false
}
// make it so a4 only applies hitlag once per A4 proc and not everytime an enemy gets hit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just leaving a note here that i have no idea if this is what happens or not

defhalt := !c.a4HitlagApplied
c.a4HitlagApplied = true

ai := combat.AttackInfo{
ActorIndex: c.Index,
Expand All @@ -50,9 +53,9 @@ func (c *char) a4() {
Durability: 25,
Mult: 0.8,
HitlagFactor: 0.05,
CanBeDefenseHalted: true,
CanBeDefenseHalted: defhalt,
}
c.Core.QueueAttack(ai, combat.NewCircleHit(c.Core.Combat.Player(), 0.1, false, combat.TargettableEnemy), 1, 1)
c.Core.QueueAttack(ai, combat.NewCircleHit(c.Core.Combat.Player(), 0.1, false, combat.TargettableEnemy), 10, 10)

return false
}, "yanfei-a4")
Expand Down
14 changes: 10 additions & 4 deletions internal/characters/yanfei/attack.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

var attackFrames [][]int
var attackHitmarks = []int{13, 28, 49}
var attackHitmarks = []int{12, 16, 37}

const (
normalHitNum = 3
Expand All @@ -21,9 +21,15 @@ const (
func init() {
attackFrames = make([][]int, normalHitNum)

attackFrames[0] = frames.InitNormalCancelSlice(attackHitmarks[0], 13)
attackFrames[1] = frames.InitNormalCancelSlice(attackHitmarks[1], 28)
attackFrames[2] = frames.InitNormalCancelSlice(attackHitmarks[2], 49)
attackFrames[0] = frames.InitNormalCancelSlice(attackHitmarks[0], 26) // N1 -> N2
attackFrames[0][action.ActionCharge] = 21 // N1 -> CA

attackFrames[1] = frames.InitNormalCancelSlice(attackHitmarks[1], 28) // N2 -> N3
attackFrames[1][action.ActionCharge] = 16 // N2 -> CA

attackFrames[2] = frames.InitNormalCancelSlice(attackHitmarks[2], 73) // N3 -> N1
attackFrames[2][action.ActionCharge] = 42 // N3 -> CA

}

// Standard attack function with seal handling
Expand Down
17 changes: 11 additions & 6 deletions internal/characters/yanfei/burst.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ import (
var burstFrames []int

const (
burstHitmark = 65
burstBuffKey = "yanfei-burst"
burstHitmark = 24
burstBuffKey = "yanfei-q"
)

func init() {
burstFrames = frames.InitAbilSlice(65)
burstFrames = frames.InitAbilSlice(58) // Q -> N1
burstFrames[action.ActionCharge] = 47 // Q -> CA
burstFrames[action.ActionSkill] = 55 // Q -> E
burstFrames[action.ActionDash] = 33 // Q -> D
burstFrames[action.ActionJump] = 32 // Q -> J
burstFrames[action.ActionSwap] = 46 // Q -> Swap
}

// Burst - Deals burst damage and adds status for charge attack bonus
Expand Down Expand Up @@ -72,13 +77,13 @@ func (c *char) Burst(p map[string]int) action.ActionInfo {

c.c4()

c.SetCDWithDelay(action.ActionBurst, 20*60, 8)
c.ConsumeEnergy(8)
c.SetCD(action.ActionBurst, 20*60)
c.ConsumeEnergy(5)

return action.ActionInfo{
Frames: frames.NewAbilFunc(burstFrames),
AnimationLength: burstFrames[action.InvalidAction],
CanQueueAfter: burstHitmark,
CanQueueAfter: burstFrames[action.ActionJump], // earliest cancel
State: action.BurstState,
}
}
Expand Down
30 changes: 22 additions & 8 deletions internal/characters/yanfei/charge.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ import (

var chargeFrames []int

const chargeHitmark = 66
const chargeHitmark = 63

func init() {
chargeFrames = frames.InitAbilSlice(66)
chargeFrames[action.ActionDash] = chargeHitmark
chargeFrames[action.ActionJump] = chargeHitmark
chargeFrames = frames.InitAbilSlice(79) // CA -> N1
chargeFrames[action.ActionCharge] = 78 // CA -> CA
chargeFrames[action.ActionSkill] = chargeHitmark // CA -> E
chargeFrames[action.ActionBurst] = chargeHitmark // CA -> Q
chargeFrames[action.ActionDash] = 51 // CA -> D
chargeFrames[action.ActionJump] = 49 // CA -> J
chargeFrames[action.ActionSwap] = 59 // CA -> Swap
}

// Charge attack function - handles seal use
Expand All @@ -40,8 +44,15 @@ func (c *char) ChargeAttack(p map[string]int) action.ActionInfo {
Durability: 25,
Mult: charge[c.sealCount][c.TalentLvlAttack()],
}

// add windup if we're in idle or swap only
windup := 16
if c.Core.Player.CurrentState() == action.Idle || c.Core.Player.CurrentState() == action.SwapState {
windup = 0
}

// TODO: Not sure of snapshot timing
c.Core.QueueAttack(ai, combat.NewCircleHit(c.Core.Combat.Player(), 2, false, combat.TargettableEnemy), chargeHitmark, chargeHitmark)
c.Core.QueueAttack(ai, combat.NewCircleHit(c.Core.Combat.Player(), 2, false, combat.TargettableEnemy), chargeHitmark-windup, chargeHitmark-windup)

c.Core.Log.NewEvent("yanfei charge attack consumed seals", glog.LogCharacterEvent, c.Index).
Write("current_seals", c.sealCount)
Expand All @@ -52,10 +63,13 @@ func (c *char) ChargeAttack(p map[string]int) action.ActionInfo {
c.DeleteStatus(sealBuffKey)
}, 1)

// needed for a4 hitlag handling
c.a4HitlagApplied = false

return action.ActionInfo{
Frames: frames.NewAbilFunc(chargeFrames),
AnimationLength: chargeFrames[action.InvalidAction],
CanQueueAfter: chargeHitmark,
Frames: func(next action.Action) int { return chargeFrames[next] - windup },
AnimationLength: chargeFrames[action.InvalidAction] - windup,
CanQueueAfter: chargeFrames[action.ActionJump] - windup, // earliest cancel is before hitmark
State: action.ChargeAttackState,
}
}
13 changes: 9 additions & 4 deletions internal/characters/yanfei/skill.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ import (

var skillFrames []int

const skillHitmark = 46
const skillHitmark = 32

func init() {
skillFrames = frames.InitAbilSlice(46)
skillFrames = frames.InitAbilSlice(46) // E -> N1
skillFrames[action.ActionCharge] = 35 // E -> CA
skillFrames[action.ActionBurst] = 43 // E -> Q
skillFrames[action.ActionDash] = 29 // E -> D
skillFrames[action.ActionJump] = 34 // E -> J
skillFrames[action.ActionSwap] = 44 // E -> Swap
}

// Yanfei skill - Straightforward as it has little interactions with the rest of her kit
Expand Down Expand Up @@ -50,12 +55,12 @@ func (c *char) Skill(p map[string]int) action.ActionInfo {

c.Core.QueueParticle("yanfei", 3, attributes.Pyro, skillHitmark+c.Core.Flags.ParticleDelay)

c.SetCD(action.ActionSkill, 540)
c.SetCDWithDelay(action.ActionSkill, 540, 28)

return action.ActionInfo{
Frames: frames.NewAbilFunc(skillFrames),
AnimationLength: skillFrames[action.InvalidAction],
CanQueueAfter: skillHitmark,
CanQueueAfter: skillFrames[action.ActionDash], // earliest cancel is before skillHitmark
State: action.SkillState,
}
}
5 changes: 3 additions & 2 deletions internal/characters/yanfei/yanfei.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ type char struct {
sealStamReduction float64
sealCount int
burstBuff []float64
a1buff []float64
a1Buff []float64
a4HitlagApplied bool
}

func NewChar(s *core.Core, w *character.CharWrapper, _ character.CharacterProfile) error {
Expand Down Expand Up @@ -52,7 +53,7 @@ func NewChar(s *core.Core, w *character.CharWrapper, _ character.CharacterProfil
}

func (c *char) Init() error {
c.a1buff = make([]float64, attributes.EndStatType)
c.a1Buff = make([]float64, attributes.EndStatType)
c.burstBuff = make([]float64, attributes.EndStatType)
c.burstBuff[attributes.DmgP] = burstBonus[c.TalentLvlBurst()]
c.a4()
Expand Down