60 lines
1.3 KiB
Go
60 lines
1.3 KiB
Go
package info
|
|
|
|
import (
|
|
"blazing/common/utils/random"
|
|
|
|
"github.com/tnnmigga/enum"
|
|
)
|
|
|
|
type BattleContext struct {
|
|
Rand *random.RandomXS128 //本次战斗随机数
|
|
same []BattleInputSourceEntity //同阵营
|
|
Round int //回合数
|
|
BattleMode EnumBattleMode //战斗模式
|
|
opposite []BattleInputSourceEntity //不同阵营
|
|
}
|
|
|
|
// 战斗模式
|
|
type EnumBattleMode int
|
|
|
|
var BattleMode = enum.New[struct {
|
|
PVE EnumBattleMode `enum:"3"`
|
|
PVP EnumBattleMode `enum:"1"`
|
|
}]()
|
|
|
|
// 玩家离线数据
|
|
type PlayerOfflineData struct {
|
|
// 可以根据需要添加字段
|
|
PlayerID int64
|
|
}
|
|
|
|
// 玩家逃脱数据
|
|
type PlayerEscapeData struct {
|
|
// 可以根据需要添加字段
|
|
PlayerID int64
|
|
}
|
|
|
|
// 玩家捕获成功数据
|
|
type PlayerCaptureSuccessData struct {
|
|
// 可以根据需要添加字段
|
|
CaptorID int64
|
|
TargetID int64
|
|
CaptureTime int64
|
|
}
|
|
|
|
// 默认结束数据
|
|
type DefaultEndData struct {
|
|
// 可以根据需要添加字段
|
|
Reason string
|
|
}
|
|
|
|
// 战斗结束原因枚举
|
|
type EnumBattleOverReason int
|
|
|
|
var BattleOverReason = enum.New[struct {
|
|
PlayerOffline EnumBattleOverReason `enum:"1"` //掉线
|
|
PlayerEscape EnumBattleOverReason `enum:"2"` //逃跑
|
|
PlayerCaptureSuccess EnumBattleOverReason `enum:"3"` //捕捉成功
|
|
DefaultEnd EnumBattleOverReason `enum:"4"` //默认结束
|
|
}]()
|