-
Notifications
You must be signed in to change notification settings - Fork 0
/
stat.go
41 lines (34 loc) · 854 Bytes
/
stat.go
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
35
36
37
38
39
40
41
package main
import "math"
func (o *TBasic) GetLvl() int {
return o.lvl
}
func (o *TBasic) GetExp() int {
return o.exp
}
func (o *TBasic) GetExpLvl() int {
i := o.__.(IObject).GetLvl() * 10 * int(math.Pow(1.1, 2))
return i
}
func (o *TBasic) IncreaseExp(i int) {
o.exp += i
if o.__.(IObject).GetExp() >= o.__.(IObject).GetExpLvl() {
o.lvl++
log.Info(o.__.(IObject).GetType(), " reach level up")
}
}
func (o *TBasic) GetMaxHp() int {
return o.__.(IObject).GetLvl() * o.__.(IObject).GetStamina()
}
func (o *TBasic) GetHp() int {
return o.__.(IObject).GetMaxHp() - o.gainedDmg
}
func (o *TBasic) GetDmg() int {
return o.__.(IObject).GetStr() * 3 / 5
}
func (o *TBasic) GetStamina() int {
return o.__.(IObject).GetLvl() * int(math.Pow(1.1, 2))
}
func (o *TBasic) GetStr() int {
return o.__.(IObject).GetLvl() * int(math.Pow(1.1, 2))
}