Skip to content
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

Hanya #327

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

Hanya #327

Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions internal/character/hanya/attack.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package hanya

import (
"github.com/simimpact/srsim/pkg/engine/info"
"github.com/simimpact/srsim/pkg/key"
"github.com/simimpact/srsim/pkg/model"
)

const (
Normal key.Attack = "hanya-normal"
)

func (c *char) Attack(target key.TargetID, state info.ActionState) {
c.engine.Attack(info.Attack{
Key: Normal,
Source: c.id,
Targets: []key.TargetID{target},
BaseDamage: info.DamageMap{
model.DamageFormula_BY_ATK: basic[c.info.AttackLevelIndex()],
},
StanceDamage: 30,
EnergyGain: 20,
AttackType: model.AttackType_MAZE_NORMAL,
DamageType: model.DamageType_PHYSICAL,
})

state.EndAttack()
}
164 changes: 164 additions & 0 deletions internal/character/hanya/data.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions internal/character/hanya/eidolon.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package hanya

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 (
E1 = "hanya-e1"
E1Cooldown = "hanya-e1-cooldown"
E2 = "hanya-e2"
)

func init() {
modifier.Register(E1, modifier.Config{
Stacking: modifier.ReplaceBySource,
Listeners: modifier.Listeners{
OnTriggerDeath: E1HanyaAdv,
},
})

modifier.Register(E1Cooldown, modifier.Config{
Listeners: modifier.Listeners{
OnPhase2: E1HanyaCD,
},
})

modifier.Register(E2, modifier.Config{
StatusType: model.StatusType_STATUS_BUFF,
Stacking: modifier.ReplaceBySource,
Duration: 1,
kdovtdc marked this conversation as resolved.
Show resolved Hide resolved
})
}

func (c *char) initEidolons() {
if c.info.Eidolon >= 2 {
c.engine.AddModifier(c.id, info.Modifier{
Name: E2,
Source: c.id,
Stats: info.PropMap{
prop.SPDConvert: 0.2,
},
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

needs a listener first to check for Skill use and then apply Spd buff

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

idea: Change skill logic to check for e2 and add speed modifier with duration of 1 (and other necessary logic etc) instead. Most likely need to add after state.endAttack() is called, but should otherwise have the same semantics. Can check tomorrow to be sure.

}
}

func E1HanyaAdv(mod *modifier.Instance, target key.TargetID) {
if !mod.Engine().HasModifier(mod.Source(), E1Cooldown) {
kdovtdc marked this conversation as resolved.
Show resolved Hide resolved
mod.Engine().ModifyGaugeNormalized(info.ModifyAttribute{
Key: E1,
Source: mod.Owner(),
Target: mod.Source(),
Amount: -1500,
kdovtdc marked this conversation as resolved.
Show resolved Hide resolved
})
}
}

func E1HanyaCD(mod *modifier.Instance) {
mod.RemoveSelf()
}
56 changes: 56 additions & 0 deletions internal/character/hanya/hanya.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package hanya

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.Hanya, character.Config{
Create: NewInstance,
Rarity: 4,
Element: model.DamageType_PHYSICAL,
Path: model.Path_HARMONY,
MaxEnergy: 140,
Promotions: promotions,
Traces: traces,
SkillInfo: character.SkillInfo{
Attack: character.Attack{
SPAdd: 1,
TargetType: model.TargetType_ENEMIES,
},
Skill: character.Skill{
SPNeed: 1,
TargetType: model.TargetType_ENEMIES,
},
Ult: character.Ult{
TargetType: model.TargetType_ALLIES,
},
Technique: character.Technique{
TargetType: model.TargetType_ENEMIES,
IsAttack: true,
},
},
})
}

type char struct {
engine engine.Engine
id key.TargetID
info info.Character
}

func NewInstance(engine engine.Engine, id key.TargetID, charInfo info.Character) info.CharInstance {
c := &char{
engine: engine,
id: id,
info: charInfo,
}

c.initEidolons()

return c
}
Loading
Loading