mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
大世界AOI广播域隔离
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"hk4e/common/constant"
|
||||
"hk4e/gdconf"
|
||||
"hk4e/pkg/logger"
|
||||
)
|
||||
|
||||
type Team struct {
|
||||
Name string
|
||||
AvatarIdList []uint32
|
||||
@@ -61,40 +55,6 @@ func NewDbTeam() (r *DbTeam) {
|
||||
return r
|
||||
}
|
||||
|
||||
func (t *DbTeam) UpdateTeam() {
|
||||
activeTeam := t.GetActiveTeam()
|
||||
// TODO 队伍元素共鸣
|
||||
t.TeamResonances = make(map[uint16]bool)
|
||||
t.TeamResonancesConfig = make(map[int32]bool)
|
||||
teamElementTypeCountMap := make(map[uint16]uint8)
|
||||
for _, avatarId := range activeTeam.GetAvatarIdList() {
|
||||
avatarSkillDataConfig := gdconf.GetAvatarEnergySkillConfig(avatarId)
|
||||
if avatarSkillDataConfig == nil {
|
||||
logger.Error("get avatar energy skill is nil, avatarId: %v", avatarId)
|
||||
continue
|
||||
}
|
||||
elementType := constant.ElementTypeConst.VALUE_MAP[uint16(avatarSkillDataConfig.CostElemType)]
|
||||
if elementType == nil {
|
||||
logger.Error("get element type const is nil, value: %v", avatarSkillDataConfig.CostElemType)
|
||||
continue
|
||||
}
|
||||
teamElementTypeCountMap[elementType.Value] += 1
|
||||
}
|
||||
for k, v := range teamElementTypeCountMap {
|
||||
if v >= 2 {
|
||||
element := constant.ElementTypeConst.VALUE_MAP[k]
|
||||
if element.TeamResonanceId != 0 {
|
||||
t.TeamResonances[element.TeamResonanceId] = true
|
||||
t.TeamResonancesConfig[element.ConfigHash] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(t.TeamResonances) == 0 {
|
||||
t.TeamResonances[constant.ElementTypeConst.Default.TeamResonanceId] = true
|
||||
t.TeamResonancesConfig[int32(constant.ElementTypeConst.Default.TeamResonanceId)] = true
|
||||
}
|
||||
}
|
||||
|
||||
func (t *DbTeam) GetActiveTeamId() uint8 {
|
||||
return t.CurrTeamIndex + 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user