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.
implement xianyun lisa plunge & lisa n0 (genshinsim#2264)
* Implement xianyun plunge for lisa * docs & n0 * Implement xianyun plunge for lisa * docs & n0 * fix walk frames in plunge --------- Co-authored-by: archednosibkup <edisonkhoa.nguyen@sjsu.edu> Co-authored-by: imring <35897995+imring@users.noreply.github.com>
- Loading branch information
1 parent
259b0f1
commit 2abeffd
Showing
8 changed files
with
283 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
package lisa | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/genshinsim/gcsim/internal/frames" | ||
"github.com/genshinsim/gcsim/pkg/core/action" | ||
"github.com/genshinsim/gcsim/pkg/core/attacks" | ||
"github.com/genshinsim/gcsim/pkg/core/attributes" | ||
"github.com/genshinsim/gcsim/pkg/core/combat" | ||
"github.com/genshinsim/gcsim/pkg/core/player" | ||
) | ||
|
||
var highPlungeFrames []int | ||
var lowPlungeFrames []int | ||
|
||
const lowPlungeHitmark = 45 | ||
const highPlungeHitmark = 47 | ||
const collisionHitmark = lowPlungeHitmark - 6 | ||
|
||
const lowPlungeRadius = 3.0 | ||
|
||
const highPlungeRadius = 3.5 | ||
|
||
func init() { | ||
// low_plunge -> x | ||
lowPlungeFrames = frames.InitAbilSlice(67) // Jump | ||
lowPlungeFrames[action.ActionAttack] = 58 | ||
lowPlungeFrames[action.ActionCharge] = 56 - 8 | ||
lowPlungeFrames[action.ActionSkill] = 58 | ||
lowPlungeFrames[action.ActionBurst] = 57 | ||
lowPlungeFrames[action.ActionDash] = lowPlungeHitmark | ||
lowPlungeFrames[action.ActionWalk] = 66 | ||
lowPlungeFrames[action.ActionSwap] = 50 | ||
|
||
// high_plunge -> x | ||
highPlungeFrames = frames.InitAbilSlice(68) // Jump | ||
highPlungeFrames[action.ActionAttack] = 60 | ||
highPlungeFrames[action.ActionCharge] = 59 - 8 | ||
highPlungeFrames[action.ActionSkill] = 58 | ||
highPlungeFrames[action.ActionBurst] = 59 | ||
highPlungeFrames[action.ActionDash] = highPlungeHitmark | ||
highPlungeFrames[action.ActionWalk] = 67 | ||
highPlungeFrames[action.ActionSwap] = 52 | ||
} | ||
|
||
// Low Plunge attack damage queue generator | ||
// Use the "collision" optional argument if you want to do a falling hit on the way down | ||
// Default = 0 | ||
func (c *char) LowPlungeAttack(p map[string]int) (action.Info, error) { | ||
defer c.Core.Player.SetAirborne(player.Grounded) | ||
switch c.Core.Player.Airborne() { | ||
case player.AirborneXianyun: | ||
return c.lowPlungeXY(p), nil | ||
default: | ||
return action.Info{}, errors.New("low_plunge can only be used while airborne") | ||
} | ||
} | ||
|
||
func (c *char) lowPlungeXY(p map[string]int) action.Info { | ||
collision, ok := p["collision"] | ||
if !ok { | ||
collision = 0 // Whether or not collision hit | ||
} | ||
|
||
if collision > 0 { | ||
c.plungeCollision(collisionHitmark) | ||
} | ||
|
||
ai := combat.AttackInfo{ | ||
ActorIndex: c.Index, | ||
Abil: "Low Plunge", | ||
AttackTag: attacks.AttackTagPlunge, | ||
ICDTag: attacks.ICDTagNone, | ||
ICDGroup: attacks.ICDGroupDefault, | ||
StrikeType: attacks.StrikeTypeDefault, | ||
Element: attributes.Electro, | ||
Durability: 25, | ||
Mult: lowPlunge[c.TalentLvlAttack()], | ||
} | ||
c.Core.QueueAttack( | ||
ai, | ||
combat.NewCircleHitOnTarget(c.Core.Combat.Player(), nil, lowPlungeRadius), | ||
lowPlungeHitmark, | ||
lowPlungeHitmark, | ||
) | ||
|
||
return action.Info{ | ||
Frames: frames.NewAbilFunc(lowPlungeFrames), | ||
AnimationLength: lowPlungeFrames[action.InvalidAction], | ||
CanQueueAfter: lowPlungeFrames[action.ActionDash], | ||
State: action.PlungeAttackState, | ||
} | ||
} | ||
|
||
// High Plunge attack damage queue generator | ||
// Use the "collision" optional argument if you want to do a falling hit on the way down | ||
// Default = 0 | ||
func (c *char) HighPlungeAttack(p map[string]int) (action.Info, error) { | ||
defer c.Core.Player.SetAirborne(player.Grounded) | ||
switch c.Core.Player.Airborne() { | ||
case player.AirborneXianyun: | ||
return c.highPlungeXY(p), nil | ||
default: | ||
return action.Info{}, errors.New("high_plunge can only be used while airborne") | ||
} | ||
} | ||
|
||
func (c *char) highPlungeXY(p map[string]int) action.Info { | ||
collision, ok := p["collision"] | ||
if !ok { | ||
collision = 0 // Whether or not collision hit | ||
} | ||
|
||
if collision > 0 { | ||
c.plungeCollision(collisionHitmark) | ||
} | ||
|
||
ai := combat.AttackInfo{ | ||
ActorIndex: c.Index, | ||
Abil: "High Plunge", | ||
AttackTag: attacks.AttackTagPlunge, | ||
ICDTag: attacks.ICDTagNone, | ||
ICDGroup: attacks.ICDGroupDefault, | ||
StrikeType: attacks.StrikeTypeDefault, | ||
Element: attributes.Electro, | ||
Durability: 25, | ||
Mult: highPlunge[c.TalentLvlAttack()], | ||
} | ||
c.Core.QueueAttack( | ||
ai, | ||
combat.NewCircleHitOnTarget(c.Core.Combat.Player(), nil, highPlungeRadius), | ||
highPlungeHitmark, | ||
highPlungeHitmark, | ||
) | ||
|
||
return action.Info{ | ||
Frames: frames.NewAbilFunc(highPlungeFrames), | ||
AnimationLength: highPlungeFrames[action.InvalidAction], | ||
CanQueueAfter: highPlungeFrames[action.ActionDash], | ||
State: action.PlungeAttackState, | ||
} | ||
} | ||
|
||
// Plunge normal falling attack damage queue generator | ||
// Standard - Always part of high/low plunge attacks | ||
func (c *char) plungeCollision(delay int) { | ||
ai := combat.AttackInfo{ | ||
ActorIndex: c.Index, | ||
Abil: "Plunge Collision", | ||
AttackTag: attacks.AttackTagPlunge, | ||
ICDTag: attacks.ICDTagNone, | ||
ICDGroup: attacks.ICDGroupDefault, | ||
StrikeType: attacks.StrikeTypeDefault, | ||
Element: attributes.Electro, | ||
Durability: 0, | ||
Mult: collision[c.TalentLvlAttack()], | ||
} | ||
c.Core.QueueAttack(ai, combat.NewCircleHitOnTarget(c.Core.Combat.Player(), nil, 1.5), delay, delay) | ||
} |
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