-
Notifications
You must be signed in to change notification settings - Fork 34
Implement Dan Heng Imbibitor Lunae #227
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
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
b18606e
implement DanHeng ImbibitorLunae
b281400
fix E4,E6
3d6afc4
skill stack start as 4th hit
1f06d30
fix A2
babaa5d
fix nested if and add comment
c213254
change skill use condition
4fdd391
change skill use condition
dc04635
fix skill point not used
2f8e1ef
fix atk rate
100416f
modify sp use logic
a27ee33
change skill/talent effet,fix A6 check
417e2b0
remove addskill from normal&enhance1 attack
0abe8e1
addskill after attack -> before attack
643ae22
format
f94534a
change effect status
e522be4
pass lint check
b6059b9
comment buff name in game
90d8f50
use different key for primary/adjacent attack damage
f8c8035
add EndAttack
1d83d03
add end attck for ult
899e1f3
track attack level,E6 and ult point by variable instead of modifier
b6b56d3
-
9f7b3d6
correct e6 pen rate
23b3fb9
pass lint
4a78956
trace A4,A6 -> modifier
4c88177
do not attack if ratio == 0
35611ce
refactor E6
1320b37
-
431093f
-
e1342c4
-
35df0ff
fix E6 remove condition
9bad98b
pass lint
1039578
rollback
482af66
refactor E6
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,161 @@ | ||
| package danhengimbibitorlunae | ||
|
|
||
| import ( | ||
| "github.com/simimpact/srsim/pkg/engine/info" | ||
| "github.com/simimpact/srsim/pkg/key" | ||
| "github.com/simimpact/srsim/pkg/model" | ||
| ) | ||
|
|
||
| const ( | ||
| Attack1 key.Attack = "danhengimbibitorlunae-enhancedattack-1" | ||
| Attack2Primary key.Attack = "danhengimbibitorlunae-enhancedattack-2-primary" | ||
| Attack2Adjacent key.Attack = "danhengimbibitorlunae-enhancedattack-2-adjacent" | ||
| Attack3Primary key.Attack = "danhengimbibitorlunae-enhancedattack-3-primary" | ||
| Attack3Adjacent key.Attack = "danhengimbibitorlunae-enhancedattack-3-adjacent" | ||
| Attack key.Attack = "danhengimbibitorlunae-normalattack" | ||
| AttackReason key.Reason = "danhengimbibitorlunae-attack" | ||
| ) | ||
|
|
||
| var attackHitsNormal = []float64{0.3, 0.7} | ||
| var attackHitsEnhanced1 = []float64{0.33, 0.33, 0.34} | ||
| var attackHitsEnhanced2 = []float64{0.2, 0.2, 0.2, 0.2, 0.2} | ||
| var adjacentHitsEnhanced2 = []float64{0, 0, 0, 0.5, 0.5} | ||
| var attackHitsEnhanced3 = []float64{0.142, 0.142, 0.142, 0.142, 0.142, 0.142, 0.148} | ||
| var adjacentHitsEnhanced3 = []float64{0, 0, 0, 0.25, 0.25, 0.25, 0.25} | ||
|
|
||
| func (c *char) Attack(target key.TargetID, state info.ActionState) { | ||
| if c.attackLevel == 0 { | ||
| c.NormalAttack(target, state) | ||
| c.engine.ModifySP(info.ModifySP{ | ||
| Key: AttackReason, | ||
| Source: c.id, | ||
| Amount: 1, | ||
| }) | ||
| } | ||
|
|
||
| pointUse := c.attackLevel | ||
| pointHas := c.point | ||
| c.point = pointHas - pointUse | ||
| if c.point < 0 { | ||
| c.point = 0 | ||
| } | ||
| pointUse -= pointHas | ||
| if pointUse > 0 { | ||
| c.engine.ModifySP(info.ModifySP{ | ||
| Key: AttackReason, | ||
| Source: c.id, | ||
| Amount: -pointUse, | ||
| }) | ||
| } | ||
| switch c.attackLevel { | ||
| case 1: | ||
| c.EnhancedAttack1(target, state) | ||
| case 2: | ||
| c.EnhancedAttack2(target, state) | ||
| case 3: | ||
| c.EnhancedAttack3(target, state) | ||
| c.engine.RemoveModifier(c.id, E6Effect) | ||
| } | ||
| c.attackLevel = 0 | ||
| state.EndAttack() | ||
| } | ||
| func (c *char) NormalAttack(target key.TargetID, state info.ActionState) { | ||
| for i, hitRatio := range attackHitsNormal { | ||
| c.engine.Attack(info.Attack{ | ||
| Key: Attack, | ||
| HitIndex: i, | ||
| Source: c.id, | ||
| Targets: []key.TargetID{target}, | ||
| DamageType: model.DamageType_IMAGINARY, | ||
| AttackType: model.AttackType_NORMAL, | ||
| BaseDamage: info.DamageMap{model.DamageFormula_BY_ATK: atk[c.info.AttackLevelIndex()]}, | ||
| StanceDamage: 30, | ||
| EnergyGain: 20, | ||
| HitRatio: hitRatio, | ||
| }) | ||
| c.AddTalent() | ||
| } | ||
| } | ||
| func (c *char) EnhancedAttack1(target key.TargetID, state info.ActionState) { | ||
| for i, hitRatio := range attackHitsEnhanced1 { | ||
| c.engine.Attack(info.Attack{ | ||
| Key: Attack1, | ||
| HitIndex: i, | ||
| Source: c.id, | ||
| Targets: []key.TargetID{target}, | ||
| DamageType: model.DamageType_IMAGINARY, | ||
| AttackType: model.AttackType_NORMAL, | ||
| BaseDamage: info.DamageMap{model.DamageFormula_BY_ATK: enhancedAtk1[c.info.AttackLevelIndex()]}, | ||
| StanceDamage: 60, | ||
| EnergyGain: 30, | ||
| HitRatio: hitRatio, | ||
| }) | ||
| c.AddTalent() | ||
| } | ||
| } | ||
| func (c *char) EnhancedAttack2(target key.TargetID, state info.ActionState) { | ||
| for i, hitRatio := range attackHitsEnhanced2 { | ||
| if i >= 3 { | ||
| c.AddSkill() | ||
| } | ||
| c.engine.Attack(info.Attack{ | ||
| Key: Attack2Primary, | ||
| HitIndex: i, | ||
| Source: c.id, | ||
| Targets: []key.TargetID{target}, | ||
| DamageType: model.DamageType_IMAGINARY, | ||
| AttackType: model.AttackType_NORMAL, | ||
| BaseDamage: info.DamageMap{model.DamageFormula_BY_ATK: enhancedAtk2[c.info.AttackLevelIndex()]}, | ||
| StanceDamage: 90, | ||
| EnergyGain: 35, | ||
| HitRatio: hitRatio, | ||
| }) | ||
| if adjacentHitsEnhanced2[i] > 0 { | ||
| c.engine.Attack(info.Attack{ | ||
| Key: Attack2Adjacent, | ||
| HitIndex: i, | ||
| Source: c.id, | ||
| Targets: c.engine.AdjacentTo(target), | ||
| DamageType: model.DamageType_IMAGINARY, | ||
| AttackType: model.AttackType_NORMAL, | ||
| BaseDamage: info.DamageMap{model.DamageFormula_BY_ATK: enhancedAtk2[c.info.AttackLevelIndex()] * 3 / 19}, | ||
| StanceDamage: 30, | ||
| HitRatio: adjacentHitsEnhanced2[i], | ||
| }) | ||
| } | ||
| c.AddTalent() | ||
| } | ||
| } | ||
| func (c *char) EnhancedAttack3(target key.TargetID, state info.ActionState) { | ||
| for i, hitRatio := range attackHitsEnhanced3 { | ||
| if i >= 3 { | ||
| c.AddSkill() | ||
| } | ||
| c.engine.Attack(info.Attack{ | ||
| Key: Attack3Primary, | ||
| HitIndex: i, | ||
| Source: c.id, | ||
| Targets: []key.TargetID{target}, | ||
| DamageType: model.DamageType_IMAGINARY, | ||
| AttackType: model.AttackType_NORMAL, | ||
| BaseDamage: info.DamageMap{model.DamageFormula_BY_ATK: enhancedAtk3[c.info.AttackLevelIndex()]}, | ||
| StanceDamage: 120, | ||
| EnergyGain: 40, | ||
| HitRatio: hitRatio, | ||
| }) | ||
| if adjacentHitsEnhanced3[i] > 0 { | ||
| c.engine.Attack(info.Attack{ | ||
| Key: Attack3Adjacent, | ||
| HitIndex: i, | ||
| Source: c.id, | ||
| Targets: c.engine.AdjacentTo(target), | ||
| DamageType: model.DamageType_IMAGINARY, | ||
| AttackType: model.AttackType_NORMAL, | ||
| BaseDamage: info.DamageMap{model.DamageFormula_BY_ATK: enhancedAtk3[c.info.AttackLevelIndex()] * 9 / 25}, | ||
| StanceDamage: 60, | ||
| HitRatio: adjacentHitsEnhanced3[i], | ||
| }) | ||
| } | ||
| c.AddTalent() | ||
| } | ||
| } | ||
62 changes: 62 additions & 0 deletions
62
internal/character/danhengimbibitorlunae/danhengimbibitorlunae.go
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,62 @@ | ||
| package danhengimbibitorlunae | ||
|
|
||
| import ( | ||
| "github.com/simimpact/srsim/pkg/engine" | ||
| "github.com/simimpact/srsim/pkg/engine/info" | ||
| "github.com/simimpact/srsim/pkg/engine/target/character" | ||
| "github.com/simimpact/srsim/pkg/key" | ||
| "github.com/simimpact/srsim/pkg/model" | ||
| ) | ||
|
|
||
| func init() { | ||
| character.Register(key.DanHengImbibitorLunae, character.Config{ | ||
| Create: NewInstance, | ||
| Rarity: 5, | ||
| Element: model.DamageType_IMAGINARY, | ||
| Path: model.Path_DESTRUCTION, | ||
| MaxEnergy: 140, | ||
| Promotions: promotions, | ||
| Traces: traces, | ||
| SkillInfo: character.SkillInfo{ | ||
| Attack: character.Attack{ | ||
| SPAdd: 0, | ||
| TargetType: model.TargetType_ENEMIES, | ||
| }, | ||
| Skill: character.Skill{ | ||
| SPNeed: 0, | ||
| TargetType: model.TargetType_SELF, | ||
| CanUse: canUseSkill, | ||
| }, | ||
| Ult: character.Ult{ | ||
| TargetType: model.TargetType_ENEMIES, | ||
| }, | ||
| Technique: character.Technique{ | ||
| TargetType: model.TargetType_SELF, | ||
| IsAttack: false, | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| type char struct { | ||
| engine engine.Engine | ||
| id key.TargetID | ||
| info info.Character | ||
| attackLevel int | ||
| point int | ||
| } | ||
|
|
||
| func NewInstance(engine engine.Engine, id key.TargetID, charInfo info.Character) info.CharInstance { | ||
| c := &char{ | ||
| engine: engine, | ||
| id: id, | ||
| info: charInfo, | ||
| attackLevel: 0, | ||
| point: 0, | ||
| } | ||
| engine.Events().ActionEnd.Subscribe(c.E6ActionEndListener) | ||
| c.initSkill() | ||
| c.initTalent() | ||
| c.initTraces() | ||
| return c | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Uh oh!
There was an error while loading. Please reload this page.