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.
- Loading branch information
Showing
6 changed files
with
244 additions
and
77 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package emilie | ||
|
||
import ( | ||
"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/event" | ||
"github.com/genshinsim/gcsim/pkg/core/geometry" | ||
"github.com/genshinsim/gcsim/pkg/core/player/character" | ||
"github.com/genshinsim/gcsim/pkg/enemy" | ||
"github.com/genshinsim/gcsim/pkg/modifier" | ||
) | ||
|
||
func (c *char) a1() { | ||
if c.Base.Ascension < 1 { | ||
return | ||
} | ||
c.Core.Events.Subscribe(event.OnEmilieA1, func(args ...interface{}) bool { | ||
ai := combat.AttackInfo{ | ||
ActorIndex: c.Index, | ||
Abil: "Emilie Passive A1", | ||
AttackTag: attacks.AttackTagNone, | ||
ICDTag: attacks.ICDTagNone, | ||
ICDGroup: attacks.ICDGroupDefault, | ||
StrikeType: attacks.StrikeTypeDefault, | ||
Element: attributes.Dendro, | ||
Durability: 25, | ||
Mult: 6.0, | ||
} | ||
ap := combat.NewCircleHitOnTarget(c.Core.Combat.PrimaryTarget(), geometry.Point{Y: 4.5}, 3) | ||
c.Core.QueueAttack(ai, ap, 0, 30) | ||
return false | ||
}, "emilie-a1") | ||
} | ||
|
||
func (c *char) a4() { | ||
if c.Base.Ascension < 4 { | ||
return | ||
} | ||
m := make([]float64, attributes.EndStatType) | ||
m[attributes.DmgP] = min(c.getTotalAtk()/1000*0.15, 0.36) | ||
c.AddAttackMod(character.AttackMod{ | ||
Base: modifier.NewBase("emilie-a4", -1), | ||
Amount: func(atk *combat.AttackEvent, t combat.Target) ([]float64, bool) { | ||
if e, ok := t.(*enemy.Enemy); !(ok && e.IsBurning()) { | ||
return nil, false | ||
} | ||
return m, true | ||
}, | ||
}) | ||
} | ||
|
||
// A4 is not implemented: |
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,99 @@ | ||
package emilie | ||
|
||
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" | ||
"github.com/genshinsim/gcsim/pkg/core/geometry" | ||
) | ||
|
||
var ( | ||
burstFrames []int | ||
) | ||
|
||
const ( | ||
burstHitmark = 104 | ||
burstDuration = 168 | ||
burstInterval = 18 | ||
burstMarkKey = "emilie-burst-mark" | ||
) | ||
|
||
func init() { | ||
burstFrames = frames.InitAbilSlice(127) | ||
burstFrames[action.ActionAttack] = 102 | ||
burstFrames[action.ActionSkill] = 102 | ||
burstFrames[action.ActionDash] = 103 | ||
burstFrames[action.ActionJump] = 103 | ||
burstFrames[action.ActionSwap] = 93 | ||
} | ||
|
||
func (c *char) Burst(_ map[string]int) (action.Info, error) { | ||
ai := combat.AttackInfo{ | ||
ActorIndex: c.Index, | ||
Abil: "Aromatic Explication", | ||
AttackTag: attacks.AttackTagElementalBurst, | ||
ICDTag: attacks.ICDTagElementalBurst, | ||
ICDGroup: attacks.ICDGroupDefault, | ||
StrikeType: attacks.StrikeTypeDefault, | ||
Element: attributes.Dendro, | ||
Durability: 25, | ||
Mult: burstDMG[c.TalentLvlBurst()], | ||
} | ||
|
||
oldLvl := c.lumidouceLvl | ||
|
||
c.QueueCharTask(func() { | ||
burstArea := combat.NewCircleHitOnTarget(c.lumidoucePos, nil, 12.5) | ||
|
||
if c.lumidouceSrc != -1 { | ||
c.removeLumi(c.lumidouceSrc) | ||
} | ||
for i := 21; i <= burstDuration; i += burstInterval { | ||
enemy := c.Core.Combat.RandomEnemyWithinArea( | ||
burstArea, | ||
func(e combat.Enemy) bool { | ||
return !e.StatusIsActive(burstMarkKey) | ||
}, | ||
) | ||
var pos geometry.Point | ||
if enemy != nil { | ||
pos = enemy.Pos() | ||
enemy.AddStatus(burstMarkKey, 0.7*60, false) | ||
} else { | ||
pos = geometry.CalcRandomPointFromCenter(burstArea.Shape.Pos(), 0.5, 12.5, c.Core.Rand) | ||
} | ||
|
||
ap := combat.NewCircleHitOnTarget(pos, geometry.Point{Y: 4.5}, 2.5) | ||
c.Core.QueueAttack( | ||
ai, | ||
ap, | ||
0, | ||
0, | ||
) | ||
} | ||
}, 21) | ||
|
||
c.QueueCharTask(func() { | ||
if oldLvl >= 2 { | ||
c.lumidouceLvl = 2 | ||
} else { | ||
c.lumidouceLvl = 0 | ||
} | ||
|
||
c.lumidouceSrc = c.Core.F | ||
|
||
c.Core.Tasks.Add(c.lumiTick(c.Core.F), skillLumiFirstTick) | ||
c.Core.Tasks.Add(c.removeLumi(c.Core.F), 22*60) | ||
}, burstDuration) | ||
|
||
c.ConsumeEnergy(12) | ||
c.SetCD(action.ActionBurst, 13.5*60) | ||
return action.Info{ | ||
Frames: frames.NewAbilFunc(burstFrames), | ||
AnimationLength: burstFrames[action.InvalidAction], | ||
CanQueueAfter: burstFrames[action.ActionSwap], | ||
State: action.BurstState, | ||
}, nil | ||
} |
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
Oops, something went wrong.