-
Notifications
You must be signed in to change notification settings - Fork 142
add varesa #2371
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
Merged
Merged
add varesa #2371
Changes from 12 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f0e917f
add varesa
imring 0859683
add shortcut
imring cbcd1eb
fix varesa q short condition
imring ece3aec
fix lint
imring d774c50
fix fiery charged hitmark and lint
imring 61e5fd6
multiple fixes
imring fdb44e3
Merge branch 'main' into varesa
imring ea0818f
update varesa hitmarks/ns duration. complete varesa c4
imring 715d6bb
update mode-gcsim
imring 312ddd7
fix ns exit and hitmark point generation
imring be67f6b
bugfixes
imring 6317f93
Merge branch 'main' into varesa
imring 697b370
varesa fixes
imring 189a941
update attack infos & hitboxes
imring 0f3dfe6
update docs
imring a63a48c
Merge branch 'main' into varesa
imring 9930829
fix raiden resolve stacks for varesa
imring 867c518
Updated substat optimizer to use OnEnergyBurst to calculated needed ER
Charlie-Zheng 8070fe5
Added xianyun plunge
Charlie-Zheng 5c098e5
Added docs for varesa plunge frames
Charlie-Zheng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,60 @@ | ||
| package varesa | ||
|
|
||
| import ( | ||
| "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/player/character" | ||
| "github.com/genshinsim/gcsim/pkg/core/stacks" | ||
| "github.com/genshinsim/gcsim/pkg/modifier" | ||
| ) | ||
|
|
||
| const a1Status = "rainbow-crash" | ||
|
|
||
| func (c *char) a1() { | ||
| if c.Base.Ascension < 1 { | ||
| return | ||
| } | ||
| c.AddStatus(a1Status, 5*60, true) | ||
| } | ||
|
|
||
| func (c *char) a1PlungeBuff() float64 { | ||
| if c.Base.Ascension < 1 { | ||
| return 0.0 | ||
| } | ||
| if !c.StatusIsActive(a1Status) { | ||
| return 0.0 | ||
| } | ||
| if c.Base.Cons >= 1 || c.nightsoulState.HasBlessing() { | ||
| return 1.8 | ||
| } | ||
| return 0.5 | ||
| } | ||
|
|
||
| func (c *char) a1Cancel(_ combat.AttackCB) { | ||
| if c.Base.Ascension < 1 { | ||
| return | ||
| } | ||
| c.DeleteAttackMod(a1Status) | ||
|
imring marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| func (c *char) a4() { | ||
| if c.Base.Ascension < 4 { | ||
| return | ||
| } | ||
|
|
||
| m := make([]float64, attributes.EndStatType) | ||
| c.AddStatMod(character.StatMod{ | ||
| Base: modifier.NewBase("varesa-a4", -1), | ||
| Amount: func() ([]float64, bool) { | ||
| m[attributes.ATKP] = 0.35 * float64(c.a4Stacks.Count()) | ||
| return m, true | ||
| }, | ||
| }) | ||
|
|
||
| c.a4Stacks = stacks.NewMultipleRefreshNoRemove(2, c.QueueCharTask, &c.Core.F) | ||
| c.Core.Events.Subscribe(event.OnNightsoulBurst, func(args ...interface{}) bool { | ||
| c.a4Stacks.Add(12 * 60) | ||
| return false | ||
| }, "varesa-a4") | ||
| } | ||
This file contains hidden or 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,142 @@ | ||
| package varesa | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| "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/geometry" | ||
| ) | ||
|
|
||
| // TODO: hitboxes | ||
| var ( | ||
| attackFrames [][]int | ||
| attackHitmarks = []int{28, 7, 33} | ||
|
imring marked this conversation as resolved.
Outdated
|
||
| attackHitlagHaltFrame = []float64{0, 0, 0.03} | ||
| attackHitlagFactor = []float64{0, 0, 0.01} | ||
| attackHitboxes = [][]float64{{2, 3}, {2, 3}, {2.2}} | ||
| attackOffsets = []float64{-0.2, -0.2, 1.1} | ||
|
|
||
| fieryAttackFrames [][]int | ||
| fieryAttackHitmarks = []int{18, 29, 37} | ||
|
imring marked this conversation as resolved.
Outdated
|
||
| fieryAttackHitboxes = [][]float64{{2, 3}, {2, 3}, {2.5, 3}} | ||
| ) | ||
|
|
||
| const normalHitNum = 3 | ||
|
|
||
| func init() { | ||
| attackFrames = make([][]int, normalHitNum) | ||
|
|
||
| attackFrames[0] = frames.InitNormalCancelSlice(attackHitmarks[0], 49) // N1 -> Walk | ||
| attackFrames[0][action.ActionAttack] = 33 | ||
| attackFrames[0][action.ActionCharge] = 23 | ||
|
|
||
| attackFrames[1] = frames.InitNormalCancelSlice(attackHitmarks[1], 30) // N2 -> N3 | ||
| attackFrames[1][action.ActionCharge] = 17 | ||
| attackFrames[1][action.ActionWalk] = 28 | ||
|
|
||
| attackFrames[2] = frames.InitNormalCancelSlice(attackHitmarks[2], 59) // N3 -> Walk | ||
| attackFrames[2][action.ActionAttack] = 45 | ||
| attackFrames[2][action.ActionCharge] = 32 | ||
|
|
||
| fieryAttackFrames = make([][]int, normalHitNum) | ||
|
|
||
| fieryAttackFrames[0] = frames.InitNormalCancelSlice(fieryAttackHitmarks[0], 39) // N1 -> Walk | ||
| fieryAttackFrames[0][action.ActionAttack] = 29 | ||
| fieryAttackFrames[0][action.ActionCharge] = 31 | ||
|
|
||
| fieryAttackFrames[1] = frames.InitNormalCancelSlice(fieryAttackHitmarks[1], 47) // N2 -> Walk | ||
| fieryAttackFrames[1][action.ActionAttack] = 39 | ||
| fieryAttackFrames[1][action.ActionCharge] = 25 | ||
|
|
||
| fieryAttackFrames[2] = frames.InitNormalCancelSlice(fieryAttackHitmarks[2], 63) // N3 -> N4/Walk | ||
| fieryAttackFrames[2][action.ActionCharge] = 37 | ||
| } | ||
|
|
||
| func (c *char) Attack(p map[string]int) (action.Info, error) { | ||
| // OnRemoved is sometimes called after the next action is executed. so we need to exit nightsoul here too | ||
| c.clearNightsoulCB(action.NormalAttackState) | ||
|
|
||
| if c.StatusIsActive(skillStatus) { | ||
| // TODO: or c.Core.Player.Exec(action.ActionCharge, c.Base.Key, nil) | ||
| return c.ChargeAttack(p) | ||
| } | ||
| if c.nightsoulState.HasBlessing() { | ||
| return c.fieryAttack(), nil | ||
| } | ||
|
|
||
|
imring marked this conversation as resolved.
|
||
| ai := combat.AttackInfo{ | ||
| ActorIndex: c.Index, | ||
| Abil: fmt.Sprintf("Normal %v", c.NormalCounter), | ||
| AttackTag: attacks.AttackTagNormal, | ||
| ICDTag: attacks.ICDTagNormalAttack, | ||
| ICDGroup: attacks.ICDGroupDefault, | ||
| StrikeType: attacks.StrikeTypeDefault, | ||
| Element: attributes.Electro, | ||
| Durability: 25, | ||
| Mult: attack[c.NormalCounter][c.TalentLvlAttack()], | ||
| HitlagFactor: 0.01, | ||
| HitlagHaltFrames: attackHitlagHaltFrame[c.NormalCounter] * 60, | ||
| CanBeDefenseHalted: true, | ||
| } | ||
| ap := combat.NewCircleHitOnTarget( | ||
| c.Core.Combat.Player(), | ||
| geometry.Point{Y: attackOffsets[c.NormalCounter]}, | ||
| attackHitboxes[c.NormalCounter][0], | ||
| ) | ||
| if c.NormalCounter == 0 || c.NormalCounter == 1 { | ||
| ap = combat.NewBoxHitOnTarget( | ||
| c.Core.Combat.Player(), | ||
| geometry.Point{Y: attackOffsets[c.NormalCounter]}, | ||
| attackHitboxes[c.NormalCounter][0], | ||
| attackHitboxes[c.NormalCounter][1], | ||
| ) | ||
| } | ||
| c.Core.QueueAttack(ai, ap, attackHitmarks[c.NormalCounter], attackHitmarks[c.NormalCounter]) | ||
|
|
||
| defer c.AdvanceNormalIndex() | ||
|
|
||
| return action.Info{ | ||
| Frames: frames.NewAttackFunc(c.Character, attackFrames), | ||
| AnimationLength: attackFrames[c.NormalCounter][action.InvalidAction], | ||
| CanQueueAfter: attackHitmarks[c.NormalCounter], | ||
| State: action.NormalAttackState, | ||
| }, nil | ||
| } | ||
|
|
||
| func (c *char) fieryAttack() action.Info { | ||
| ai := combat.AttackInfo{ | ||
| ActorIndex: c.Index, | ||
| Abil: fmt.Sprintf("Fiery Passion %v", c.NormalCounter), | ||
| AttackTag: attacks.AttackTagNormal, | ||
| ICDTag: attacks.ICDTagNormalAttack, | ||
| ICDGroup: attacks.ICDGroupDefault, | ||
| StrikeType: attacks.StrikeTypeDefault, | ||
| Element: attributes.Electro, | ||
| Durability: 25, | ||
| Mult: fieryAttack[c.NormalCounter][c.TalentLvlAttack()], | ||
| HitlagFactor: 0.01, | ||
| HitlagHaltFrames: 0.03 * 60, | ||
| CanBeDefenseHalted: true, | ||
| } | ||
|
|
||
|
imring marked this conversation as resolved.
|
||
| ap := combat.NewBoxHitOnTarget( | ||
| c.Core.Combat.Player(), | ||
| nil, | ||
| fieryAttackHitboxes[c.NormalCounter][0], | ||
| fieryAttackHitboxes[c.NormalCounter][1], | ||
| ) | ||
| c.Core.QueueAttack(ai, ap, fieryAttackHitmarks[c.NormalCounter], fieryAttackHitmarks[c.NormalCounter]) | ||
|
|
||
| defer c.AdvanceNormalIndex() | ||
|
|
||
| return action.Info{ | ||
| Frames: frames.NewAttackFunc(c.Character, fieryAttackFrames), | ||
| AnimationLength: fieryAttackFrames[c.NormalCounter][action.InvalidAction], | ||
| CanQueueAfter: fieryAttackHitmarks[c.NormalCounter], | ||
| State: action.NormalAttackState, | ||
| } | ||
| } | ||
This file contains hidden or 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,129 @@ | ||
| package varesa | ||
|
|
||
| import ( | ||
| "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" | ||
| ) | ||
|
|
||
| // TODO: update hitlags/hitboxes | ||
| var ( | ||
| burstFrames []int | ||
| volcanicFrames []int | ||
| ) | ||
|
|
||
| const ( | ||
| burstHitmark = 88 | ||
| burstEnergyFrame = 9 | ||
|
|
||
| kablamHitmark = 42 | ||
| kablamCost = 30 | ||
| kablamAbil = "Volcano Kablam" | ||
| ) | ||
|
|
||
| func init() { | ||
| burstFrames = frames.InitAbilSlice(122) // Q -> Jump | ||
| burstFrames[action.ActionAttack] = 93 | ||
| burstFrames[action.ActionSkill] = 90 | ||
| burstFrames[action.ActionDash] = 93 | ||
| burstFrames[action.ActionWalk] = 101 | ||
| burstFrames[action.ActionSwap] = 90 | ||
|
|
||
| volcanicFrames = frames.InitAbilSlice(47) // Q -> Walk | ||
| volcanicFrames[action.ActionAttack] = 46 | ||
| volcanicFrames[action.ActionSkill] = 45 | ||
| volcanicFrames[action.ActionDash] = 43 | ||
| volcanicFrames[action.ActionSwap] = 42 | ||
| } | ||
|
|
||
| func (c *char) Burst(p map[string]int) (action.Info, error) { | ||
| c.c4Burst() | ||
|
|
||
| if c.StatusIsActive(apexState) { | ||
| return c.volcanicKablam(), nil | ||
| } | ||
|
|
||
| ai := combat.AttackInfo{ | ||
| ActorIndex: c.Index, | ||
| Abil: "Flying Kick", | ||
| AttackTag: attacks.AttackTagElementalBurst, | ||
| AdditionalTags: []attacks.AdditionalTag{attacks.AdditionalTagNightsoul}, | ||
| ICDTag: attacks.ICDTagNone, | ||
| ICDGroup: attacks.ICDGroupDefault, | ||
| StrikeType: attacks.StrikeTypeDefault, | ||
| Element: attributes.Electro, | ||
| Durability: 25, | ||
| Mult: kick[c.TalentLvlBurst()], | ||
| HitlagFactor: 0.1, | ||
| } | ||
|
|
||
| c.QueueCharTask(func() { | ||
| c.nightsoulState.GeneratePoints(c.nightsoulState.MaxPoints) | ||
| c.generatePlungeNightsoul() | ||
| }, 3) | ||
|
|
||
| if c.nightsoulState.HasBlessing() { | ||
| ai.Abil = "Fiery Passion Flying Kick" | ||
| ai.Mult = fieryKick[c.TalentLvlBurst()] | ||
| } | ||
|
|
||
| c.Core.QueueAttack( | ||
| ai, | ||
| combat.NewCircleHit(c.Core.Combat.Player(), c.Core.Combat.PrimaryTarget(), nil, 6), | ||
| burstHitmark, | ||
| burstHitmark, | ||
| ) | ||
|
|
||
| c.ConsumeEnergy(burstEnergyFrame) | ||
| c.SetCD(action.ActionBurst, 18*60) | ||
|
|
||
| return action.Info{ | ||
| Frames: frames.NewAbilFunc(burstFrames), | ||
| AnimationLength: burstFrames[action.InvalidAction], | ||
| CanQueueAfter: burstFrames[action.ActionSwap], | ||
| State: action.BurstState, | ||
| }, nil | ||
| } | ||
|
|
||
| func (c *char) volcanicKablam() action.Info { | ||
| ai := combat.AttackInfo{ | ||
| ActorIndex: c.Index, | ||
| Abil: kablamAbil, | ||
| AdditionalTags: []attacks.AdditionalTag{attacks.AdditionalTagNightsoul}, | ||
| AttackTag: attacks.AttackTagPlunge, | ||
| ICDTag: attacks.ICDTagVaresaCombatCycle, | ||
| ICDGroup: attacks.ICDGroupDefault, | ||
| StrikeType: attacks.StrikeTypeDefault, | ||
| Element: attributes.Electro, | ||
| Durability: 25, | ||
| Mult: kablam[c.TalentLvlBurst()], | ||
| HitlagFactor: 0.1, | ||
| } | ||
|
|
||
| if c.Base.Cons >= 1 { | ||
| c.a1() | ||
| } | ||
|
|
||
| c.Core.Tasks.Add(func() { | ||
| c.Core.QueueAttack( | ||
| ai, | ||
| combat.NewCircleHit(c.Core.Combat.Player(), c.Core.Combat.PrimaryTarget(), nil, 6), | ||
| 0, | ||
| 0, | ||
| ) | ||
| c.DeleteStatus(apexState) | ||
| }, kablamHitmark) | ||
|
|
||
| c.AddEnergy("varesa-kablam", -kablamCost) | ||
|
imring marked this conversation as resolved.
Outdated
|
||
| c.SetCD(action.ActionBurst, 1*60) | ||
|
|
||
| return action.Info{ | ||
| Frames: frames.NewAbilFunc(volcanicFrames), | ||
| AnimationLength: volcanicFrames[action.InvalidAction], | ||
| CanQueueAfter: volcanicFrames[action.ActionSwap], | ||
| State: action.BurstState, // TODO: or plunge state? | ||
| OnRemoved: c.clearNightsoulCB, | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.