Skip to content

Commit

Permalink
implement xianyun lisa plunge & lisa n0 (genshinsim#2264)
Browse files Browse the repository at this point in the history
* 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
3 people authored Nov 3, 2024
1 parent 259b0f1 commit 2abeffd
Show file tree
Hide file tree
Showing 8 changed files with 283 additions and 1 deletion.
6 changes: 6 additions & 0 deletions internal/characters/lisa/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ skill_data_mapping:
- 3 # 4-Hit DMG|{param3:F1P}
charge:
- 4 # Charged Attack DMG|{param4:P}
collision:
- 6 # Plunge DMG|{param6:F1P}
lowPlunge:
- 7 # Low/High Plunge DMG|{param7:P}/{param8:P}
highPlunge:
- 8 # Low/High Plunge DMG|{param7:P}/{param8:P}
skill:
skillHold:
- 0 # Non-Conductive Hold DMG|{param0:P}
Expand Down
12 changes: 12 additions & 0 deletions internal/characters/lisa/lisa.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"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/model"
)

func init() {
Expand Down Expand Up @@ -39,3 +40,14 @@ func (c *char) Init() error {
}
return nil
}

func (c *char) AnimationStartDelay(k model.AnimationDelayKey) int {
switch k {
case model.AnimationXingqiuN0StartDelay:
return 5
case model.AnimationYelanN0StartDelay:
return 4
default:
return c.Character.AnimationStartDelay(k)
}
}
54 changes: 54 additions & 0 deletions internal/characters/lisa/lisa_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

160 changes: 160 additions & 0 deletions internal/characters/lisa/plunge.go
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)
}
10 changes: 9 additions & 1 deletion ui/packages/docs/src/components/Actions/character_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,14 @@
"ability": "burst",
"legal": true
},
{
"ability": "low_plunge",
"notes": "Previous action must be a jump buffed via Xianyun's burst for example."
},
{
"ability": "high_plunge",
"notes": "Previous action must be a jump buffed via Xianyun's burst for example."
},
{
"ability": "dash",
"legal": true
Expand All @@ -1675,7 +1683,7 @@
},
{
"ability": "walk",
"notes": "No action followed by walk has proper frames."
"notes": "No action followed by walk (except low_plunge and high_plunge) has proper frames."
},
{
"ability": "swap",
Expand Down
20 changes: 20 additions & 0 deletions ui/packages/docs/src/components/AoE/character_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -5449,6 +5449,26 @@
"fanAngle": 40
}
],
"plunge": [
{
"ability": "Plunge",
"shape": "Circle",
"center": "Player",
"radius": 1.5
},
{
"ability": "Low_Plunge",
"shape": "Circle",
"center": "Player",
"radius": 3
},
{
"ability": "High_Plunge",
"shape": "Circle",
"center": "Player",
"radius": 3.5
}
],
"skill": [
{
"ability": "E-Tap",
Expand Down
12 changes: 12 additions & 0 deletions ui/packages/docs/src/components/Frames/character_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,18 @@
"count_credit": "Kolibri#7675",
"vid": "https://youtu.be/f58tVgt3OYw",
"count": "https://docs.google.com/spreadsheets/d/1KRt6I_c5qeUQVXcHv7ZOZKdqjn4Z_VN1OyVFvhDumOc/edit?usp=sharing"
},
{
"vid_credit": "archednosi",
"count_credit": "archednosi",
"vid": "https://youtu.be/m_gLie94m-E",
"count": "https://docs.google.com/spreadsheets/d/1FDKj16LAEyy0gBef_1SZovg8y9h2PksvStrj7w5U6qM/edit?usp=sharing"
},
{
"vid_credit": "archednosi",
"count_credit": "archednosi",
"vid": "https://youtu.be/gbRypU0JDZQ",
"count": "https://docs.google.com/spreadsheets/d/1FDKj16LAEyy0gBef_1SZovg8y9h2PksvStrj7w5U6qM/edit?usp=sharing"
}
],
"lynette": [
Expand Down
10 changes: 10 additions & 0 deletions ui/packages/docs/src/components/Params/character_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,16 @@
"ability": "skill",
"param": "hold",
"desc": "0 for Tap (default), 1 for Hold."
},
{
"ability": "low_plunge",
"param": "collision",
"desc": "0 for no collision dmg (default), 1 for collision dmg."
},
{
"ability": "high_plunge",
"param": "collision",
"desc": "0 for no collision dmg (default), 1 for collision dmg."
}
],
"lynette": [
Expand Down

0 comments on commit 2abeffd

Please sign in to comment.