83 lines
2.2 KiB
Go
83 lines
2.2 KiB
Go
package info
|
|
|
|
import (
|
|
"github.com/tnnmigga/enum"
|
|
)
|
|
|
|
// type Battle struct {
|
|
// Rand *random.RandomXS128 //本次战斗随机数
|
|
// same []BattleInputSourceEntity //同阵营
|
|
// Round int //回合数
|
|
// BattleMode EnumBattleMode //战斗模式
|
|
// opposite []BattleInputSourceEntity //不同阵营
|
|
// Effects *NodeManager //挂载effect,实际上是给每个输入源,然后触发时候循环调用Effects ,
|
|
|
|
// //A的effect->触发死亡->这时候就应该调用对手的切换,实现effect62
|
|
// }
|
|
|
|
// 执行下一回合
|
|
// func (b *Battle) NextRound() {
|
|
|
|
// b.Round++ //回合数加1
|
|
|
|
// }
|
|
|
|
// 战斗模式
|
|
type EnumBattleMode int
|
|
|
|
var BattleMode = enum.New[struct {
|
|
PVE EnumBattleMode `enum:"3"`
|
|
PVP_6V6 EnumBattleMode `enum:"2"`
|
|
PVP_1V1 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"` //掉线
|
|
PlayerOVerTime EnumBattleOverReason `enum:"2"` //超时
|
|
PlayerCaptureSuccess EnumBattleOverReason `enum:"3"` //捕捉成功
|
|
DefaultEnd EnumBattleOverReason `enum:"4"` //默认结束
|
|
PlayerEscape EnumBattleOverReason `enum:"5"` //逃跑
|
|
}]()
|
|
|
|
// 战斗模式
|
|
|
|
var BattleMode_PVP = enum.New[struct {
|
|
PVP_1V1 EnumBattleMode `enum:"1"`
|
|
PVP_6V6 EnumBattleMode `enum:"2"`
|
|
}]()
|
|
var Playerinvitemap map[uint32][]Playerinvite = make(map[uint32][]Playerinvite) //玩家邀请信息 ,比如一个玩家被多人邀请对战
|
|
|
|
type Playerinvite struct { //挂载到[]Playerinvite上? 被邀请者->邀请者
|
|
InviteID uint32 // 邀请者
|
|
InviteTime EnumBattleMode //游戏模式
|
|
}
|