-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathattack.go
More file actions
32 lines (27 loc) · 762 Bytes
/
attack.go
File metadata and controls
32 lines (27 loc) · 762 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
package luocha
import (
"github.com/simimpact/srsim/pkg/engine/info"
"github.com/simimpact/srsim/pkg/key"
"github.com/simimpact/srsim/pkg/model"
)
const Normal key.Attack = "luocha-normal"
var hitSplit = []float64{0.3, 0.3, 0.4}
func (c *char) Attack(target key.TargetID, state info.ActionState) {
for i, hitRatio := range hitSplit {
c.engine.Attack(info.Attack{
Key: Normal,
HitIndex: i,
Targets: []key.TargetID{target},
Source: c.id,
AttackType: model.AttackType_NORMAL,
DamageType: model.DamageType_IMAGINARY,
BaseDamage: info.DamageMap{
model.DamageFormula_BY_ATK: basic[c.info.AttackLevelIndex()],
},
EnergyGain: 20,
StanceDamage: 30,
HitRatio: hitRatio,
})
}
c.engine.EndAttack()
}