-
Notifications
You must be signed in to change notification settings - Fork 34
Sparkle #346
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
Open
aaron-hwang
wants to merge
25
commits into
simimpact:main
Choose a base branch
from
aaron-hwang:sparkle
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Sparkle #346
Changes from 18 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c09f12c
Skeleton
aaron-hwang bf1341e
Basic atk impl
aaron-hwang 5fdaff8
Skill impl
aaron-hwang 1c6bd1e
Ult impl start
aaron-hwang d2ffa72
E2 implementation
aaron-hwang 3ded8a7
Talent implementation
aaron-hwang 6528be4
trace impl skeleton
aaron-hwang 65626d2
Most of Ult implementation
aaron-hwang f9dd266
a6 implementation
aaron-hwang cc1a35d
technique impl
aaron-hwang 92827bc
added action advance to sparkle skill
aaron-hwang 5acaa82
linting
aaron-hwang 2fc898e
Fixed e2 impl
aaron-hwang aaa699d
added trace/talent init
aaron-hwang f92d1d3
added ult interaction with talent
aaron-hwang 11f9a95
added sp recover and energy recover on ult
aaron-hwang 53b807f
fixed bad length check
aaron-hwang 77345ed
linting
aaron-hwang 47a72a1
Fixed tickmoments being swapped
aaron-hwang c194d8c
added candispel and statustype to talent buff
aaron-hwang 5462f00
a6 register
aaron-hwang 8325a25
unnecessary candispel: false
aaron-hwang e985992
modifiers renamed
aaron-hwang 67caa76
modifier renaming
aaron-hwang 7d8ff4b
linter complaining about nesting
aaron-hwang 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,38 @@ | ||
| package sparkle | ||
|
|
||
| import ( | ||
| "github.com/simimpact/srsim/pkg/engine/info" | ||
| "github.com/simimpact/srsim/pkg/key" | ||
| "github.com/simimpact/srsim/pkg/model" | ||
| ) | ||
|
|
||
| const ( | ||
| SparkleBasic key.Attack = "sparkle-basic" | ||
| ) | ||
|
|
||
| func (c *char) Attack(target key.TargetID, state info.ActionState) { | ||
| // A2 | ||
| if c.info.Traces["101"] { | ||
| c.engine.ModifyEnergy(info.ModifyAttribute{ | ||
| Key: A2, | ||
| Amount: 10, | ||
| Target: c.id, | ||
| Source: c.id, | ||
| }) | ||
| } | ||
|
|
||
| c.engine.Attack(info.Attack{ | ||
| Key: SparkleBasic, | ||
| Source: c.id, | ||
| Targets: []key.TargetID{target}, | ||
| DamageType: model.DamageType_QUANTUM, | ||
| AttackType: model.AttackType_NORMAL, | ||
| BaseDamage: info.DamageMap{ | ||
| model.DamageFormula_BY_ATK: basic[c.info.AttackLevelIndex()], | ||
| }, | ||
| EnergyGain: 20, | ||
| StanceDamage: 30, | ||
| }) | ||
|
|
||
| state.EndAttack() | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,25 @@ | ||
| package sparkle | ||
|
|
||
| import ( | ||
| "github.com/simimpact/srsim/pkg/engine/event" | ||
| "github.com/simimpact/srsim/pkg/engine/modifier" | ||
| "github.com/simimpact/srsim/pkg/engine/prop" | ||
| ) | ||
|
|
||
| const ( | ||
| E2 = "sparkle-e2" | ||
| ) | ||
|
|
||
| func init() { | ||
| modifier.Register(E2, modifier.Config{ | ||
| Stacking: modifier.ReplaceBySource, | ||
| Listeners: modifier.Listeners{ | ||
| OnBeforeHitAll: E2Callback, | ||
| }, | ||
| MaxCount: 3, | ||
| }) | ||
| } | ||
|
|
||
| func E2Callback(mod *modifier.Instance, e event.HitStart) { | ||
| e.Hit.Defender.AddProperty(E2, prop.DEFPercent, -0.08*mod.Count()) | ||
| } |
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,116 @@ | ||
| package sparkle | ||
|
|
||
| import ( | ||
| "github.com/simimpact/srsim/pkg/engine/info" | ||
| "github.com/simimpact/srsim/pkg/engine/modifier" | ||
| "github.com/simimpact/srsim/pkg/engine/prop" | ||
| "github.com/simimpact/srsim/pkg/key" | ||
| "github.com/simimpact/srsim/pkg/model" | ||
| ) | ||
|
|
||
| const ( | ||
| SparkleSkillBuff = "SparkleSkillBuff" | ||
| Dreamdiver = "dreamdiver" | ||
| SparkleSkill = "sparkle-skill" | ||
| ) | ||
|
|
||
| func init() { | ||
| modifier.Register(SparkleSkillBuff, modifier.Config{ | ||
| Stacking: modifier.ReplaceBySource, | ||
| CanDispel: true, | ||
| StatusType: model.StatusType_STATUS_BUFF, | ||
| Listeners: modifier.Listeners{ | ||
| OnAdd: addActualBuff, | ||
| OnRemove: A4Extend, | ||
| }, | ||
| TickMoment: modifier.ModifierPhase1End, | ||
aaron-hwang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Duration: 1, | ||
| }) | ||
|
|
||
| modifier.Register(Dreamdiver, modifier.Config{ | ||
| Stacking: modifier.Replace, | ||
| CanDispel: true, | ||
| StatusType: model.StatusType_STATUS_BUFF, | ||
aaron-hwang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Duration: 1, | ||
| }) | ||
| } | ||
|
|
||
| type SkillBuffState struct { | ||
| cdmgBuff float64 | ||
| } | ||
|
|
||
| func (c *char) Skill(target key.TargetID, state info.ActionState) { | ||
| c.engine.ModifyGaugeNormalized(info.ModifyAttribute{ | ||
| Key: SparkleSkill, | ||
| Target: target, | ||
| Source: c.id, | ||
| Amount: -0.5, | ||
| }) | ||
|
|
||
| sparkle := c.engine.Stats(c.id) | ||
| sparkleCdmg := sparkle.GetProperty(prop.CritDMG) | ||
| proportion := skillCdmgScaling[c.info.SkillLevelIndex()] | ||
| if c.info.Eidolon >= 6 { | ||
| proportion += 0.3 | ||
| } | ||
| c.engine.AddModifier(target, info.Modifier{ | ||
| Name: SparkleSkillBuff, | ||
| Source: c.id, | ||
| Duration: 1, | ||
| State: SkillBuffState{ | ||
| cdmgBuff: proportion*sparkleCdmg + skillFlatCdmg[c.info.SkillLevelIndex()], | ||
| }, | ||
| }) | ||
|
|
||
| // At e6, when using skill sparkle should add skill buff to all teammates with cipher | ||
| if c.info.Eidolon >= 6 { | ||
| targets := make([]key.TargetID, 0, 4) | ||
| for _, char := range c.engine.Characters() { | ||
| if c.engine.HasModifier(char, Cipher) { | ||
| targets = append(targets, char) | ||
| } | ||
| } | ||
|
|
||
| for _, char := range targets { | ||
| c.engine.AddModifier(char, info.Modifier{ | ||
| Name: SparkleSkillBuff, | ||
| Source: c.id, | ||
| Duration: 1, | ||
| State: SkillBuffState{ | ||
| cdmgBuff: proportion*sparkleCdmg + skillFlatCdmg[c.info.SkillLevelIndex()], | ||
| }, | ||
| }) | ||
| } | ||
| } | ||
|
|
||
| c.engine.ModifyEnergy(info.ModifyAttribute{ | ||
| Key: SparkleSkill, | ||
| Source: c.id, | ||
| Target: c.id, | ||
| Amount: 30, | ||
| }) | ||
| } | ||
|
|
||
| func addActualBuff(mod *modifier.Instance) { | ||
| mod.Engine().RemoveModifier(mod.Owner(), Dreamdiver) | ||
| mod.Engine().AddModifier(mod.Owner(), info.Modifier{ | ||
| Name: Dreamdiver, | ||
| Source: mod.Source(), | ||
| Stats: info.PropMap{ | ||
| prop.CritDMG: mod.State().(SkillBuffState).cdmgBuff, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| func A4Extend(mod *modifier.Instance) { | ||
| sparkleinfo, _ := mod.Engine().CharacterInfo(mod.Source()) | ||
| if sparkleinfo.Traces["102"] { | ||
| mod.Engine().AddModifier(mod.Owner(), info.Modifier{ | ||
| Name: Dreamdiver, | ||
| Source: mod.Source(), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| Stats: info.PropMap{ | ||
| prop.CritDMG: mod.State().(SkillBuffState).cdmgBuff, | ||
| }, | ||
| }) | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming-wise, I would probably call the first-applied mod "dreamdiver" and the a4 extension "dreamdiver-a4-extend" or something