回血
This commit is contained in:
parent
7e63436373
commit
4c02b5b321
@ -3,8 +3,10 @@ package stonehenge
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
|
"go_dreamfactory/modules/battle"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
|
"math"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -169,6 +171,20 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
case EventType17: // 英雄回血
|
||||||
|
var sz []int32 // 获取
|
||||||
|
var szHero []string
|
||||||
|
for _, v := range stone.Hero {
|
||||||
|
if v.Currhp > 0 {
|
||||||
|
szHero = append(szHero, v.Oid)
|
||||||
|
sz = append(sz, 100)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, v := range comm.GetRandWs(sz, eventConf.Value2) {
|
||||||
|
objId := szHero[v]
|
||||||
|
maxHp := stone.Hero[objId].Property[battle.AttributesTransBase("hp")]
|
||||||
|
stone.Hero[objId].Currhp += int32(math.Floor(float64(maxHp*eventConf.Value1) / 1000)) // 回血
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ const (
|
|||||||
EventType10 = 10 // 宝箱事件
|
EventType10 = 10 // 宝箱事件
|
||||||
EventType14 = 14 // 战斗事件
|
EventType14 = 14 // 战斗事件
|
||||||
EventType16 = 16 // 捡垃圾事件
|
EventType16 = 16 // 捡垃圾事件
|
||||||
|
EventType17 = 17 // 回血事件
|
||||||
EventType25 = 25 // buff三选一
|
EventType25 = 25 // buff三选一
|
||||||
EventType28 = 28 // BOSS 战斗
|
EventType28 = 28 // BOSS 战斗
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user