Skip to content

Commit

Permalink
Merge pull request #888 from k0l11/itto-c6
Browse files Browse the repository at this point in the history
fix itto c6
  • Loading branch information
skippi authored Aug 31, 2022
2 parents 2b6b695 + 842691d commit 6343d96
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions internal/characters/itto/charge.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,27 @@ func (s SlashType) String() string {
return slashName[s]
}

func (s SlashType) Next(stacks int) SlashType {
func (s SlashType) Next(stacks int, c6Proc bool) SlashType {
switch s {
// idle -> charge (based on stacks)
case InvalidSlash:
if stacks == 1 {
if stacks == 1 && !c6Proc {
return FinalSlash
} else if stacks == 1 && c6Proc {
return LeftSlash
} else if stacks > 1 {
return LeftSlash
}
return SaichiSlash

// loops CA1/CA2 until stacks=1
case LeftSlash:
if stacks == 1 {
if stacks == 1 && !c6Proc {
return FinalSlash
}
return RightSlash
case RightSlash:
if stacks == 1 {
if stacks == 1 && !c6Proc {
return FinalSlash
}
return LeftSlash
Expand Down Expand Up @@ -173,7 +175,8 @@ func (c *char) ChargeAttack(p map[string]int) action.ActionInfo {

prevSlash := c.slashState
stacks := c.Tags[strStackKey]
c.slashState = prevSlash.Next(stacks)
c6Proc := c.Base.Cons >= 6 && c.Core.Rand.Float64() < 0.5
c.slashState = prevSlash.Next(stacks, c6Proc)

// figure out how many frames we need to skip
windup := c.windupFrames(prevSlash, c.slashState)
Expand Down Expand Up @@ -212,7 +215,7 @@ func (c *char) ChargeAttack(p map[string]int) action.ActionInfo {
c.Core.QueueAttack(ai, combat.NewDefCircHit(r, false, combat.TargettableEnemy), 0, chargeHitmarks[c.slashState]-windup)

// C6: has a 50% chance to not consume stacks of Superlative Superstrength.
if c.Base.Cons < 6 || c.Core.Rand.Float64() < 0.5 {
if !c6Proc {
c.addStrStack("charge", -1)
}

Expand All @@ -226,7 +229,7 @@ func (c *char) ChargeAttack(p map[string]int) action.ActionInfo {
Frames: func(next action.Action) int {
f := chargeFrames[curSlash][next]
// handle CA1/CA2 -> CAF frames
if next == action.ActionCharge && curSlash.Next(c.Tags[strStackKey]) == FinalSlash {
if next == action.ActionCharge && curSlash.Next(c.Tags[strStackKey], c6Proc) == FinalSlash {
switch curSlash {
case LeftSlash: // CA1 -> CAF
f = 60
Expand Down

0 comments on commit 6343d96

Please sign in to comment.