-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathattack.go
More file actions
34 lines (28 loc) · 799 Bytes
/
attack.go
File metadata and controls
34 lines (28 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package tingyun
import (
"github.com/simimpact/srsim/pkg/engine/info"
"github.com/simimpact/srsim/pkg/key"
"github.com/simimpact/srsim/pkg/model"
)
const Normal key.Attack = "tingyun-normal"
func (c *char) Attack(target key.TargetID, state info.ActionState) {
// A4 implemented the same way as game with add and remove
c.engine.AddModifier(c.id, info.Modifier{
Name: A4,
Source: c.id,
})
c.engine.Attack(info.Attack{
Key: Normal,
AttackType: model.AttackType_NORMAL,
DamageType: model.DamageType_FIRE,
BaseDamage: info.DamageMap{
model.DamageFormula_BY_ATK: basic[c.info.AttackLevelIndex()],
},
Targets: []key.TargetID{target},
Source: c.id,
EnergyGain: 20,
StanceDamage: 30,
})
c.engine.EndAttack()
c.engine.RemoveModifier(c.id, A4)
}