This commit is contained in:
meixiongfeng 2023-08-10 18:29:17 +08:00
parent 7e63436373
commit 4c02b5b321
2 changed files with 17 additions and 0 deletions

View File

@ -3,8 +3,10 @@ package stonehenge
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/modules/battle"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"math"
"strconv"
)
@ -169,6 +171,20 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
}
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)) // 回血
}
}

View File

@ -5,6 +5,7 @@ const (
EventType10 = 10 // 宝箱事件
EventType14 = 14 // 战斗事件
EventType16 = 16 // 捡垃圾事件
EventType17 = 17 // 回血事件
EventType25 = 25 // buff三选一
EventType28 = 28 // BOSS 战斗
)