Skip to content

Reactions#245

Merged
aaron-hwang merged 21 commits intosimimpact:mainfrom
aaron-hwang:reactions
Jan 13, 2024
Merged

Reactions#245
aaron-hwang merged 21 commits intosimimpact:mainfrom
aaron-hwang:reactions

Conversation

@aaron-hwang
Copy link
Collaborator

WIP, need to add:

  • Interface for modifiers, should contain function that will run custom event logic. This function will correspond to TriggerModifierCustomEvent in the DM. (Main purpose is for kafka implementation atp)
  • Relevant states need to implement the function for aforementioned interface
  • Notes: Name ideas for interface: Triggerable? CustomEventTriggerable?

Copy link
Member

@kylebartz kylebartz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To test this implementation, can implement Sampo E4 as part of this PR: #48

Comment on lines 103 to 104
// Custom event trigger for bleed dots
func (B BleedState) TriggerEvent(mod *modifier.Instance) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: might not be clear to users what TriggerEvent means when reading character implementations (though not against the name)

Thinking about implementations, such as Sampo E4 or Kafka, these would also need to take in a Ratio which gets multiplied against the original damage percentage of the mod (IE: Sampo E4 is 4%). In the game implementation, this would be that DOT_TriggerRatio: https://damnae.github.io/stargazer/#/modifier-MCommon_Element_Electric/from/avatar-1005/@59d64be43a1da285cf22ba9be5ed90ef2b23f857

Comment on lines 3 to 5
type CustomEventTriggerable interface {
TriggerEvent()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be specific to trigger dots/element modifiers and not some generic "any custom event" trigger

Copy link
Member

@kylebartz kylebartz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implementation lgtm. Would like to see Sampo E4 implemented and tested just to verify if it works (not 100% on if these function headers would be best as current state or against pointers): #48.

"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this changed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file name should be all lowercase with underscore separation (triggerable_dot.go)

AttackType: model.AttackType_DOT,
DamageType: model.DamageType_FIRE,
BaseDamage: info.DamageMap{
model.DamageFormula_BY_BREAK_DAMAGE: b.BreakBaseMulti,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing ratio?

AttackType: model.AttackType_DOT,
DamageType: model.DamageType_PHYSICAL,
BaseDamage: info.DamageMap{
model.DamageFormula_BY_ATK: b.DamagePercentage,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing ratio?

AttackType: model.AttackType_DOT,
DamageType: model.DamageType_WIND,
BaseDamage: info.DamageMap{
model.DamageFormula_BY_ATK: w.DamagePercentage * mod.Count(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing ratio

AttackType: model.AttackType_DOT,
DamageType: model.DamageType_WIND,
BaseDamage: info.DamageMap{
model.DamageFormula_BY_BREAK_DAMAGE: w.BreakBaseMulti * mod.Count(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing ratio

Comment on lines 28 to +39
func (c *char) OnProjectileHit(target key.TargetID, stanceDamage float64, i int) {
// if c.info.Eidolon >= 4 && c.engine.HasBehaviorFlag(target, model.BehaviorFlag_STAT_DOT_POISON) {
// //TODO: implement sampo E4
// }
if c.info.Eidolon >= 4 && c.engine.HasBehaviorFlag(target, model.BehaviorFlag_STAT_DOT_POISON) {
// Wind dot (kit dots)
for _, dot := range c.engine.GetModifiers(target, common.WindShear) {
dot.State.(common.WindShearState).TriggerDot(dot, 0.06, c.engine, target)
}

// Break wind dots
for _, dot := range c.engine.GetModifiers(target, common.BreakWindShear) {
dot.State.(common.BreakWindShearState).TriggerDot(dot, 0.06, c.engine, target)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: My FUD with this is you are checking by behavior flag but getting modifiers by name. Runs us into an odd situation for what if there is something that is STAT_DOT_POISON but not WindShear or BreakWindShear. Best if we had some way to GetModifiersByBehaviorFlag instead?

@aaron-hwang aaron-hwang merged commit ca10c8d into simimpact:main Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants