feat(fight): 添加旧组队协议支持并优化战斗系统 - 实现了旧组队协议相关功能,包括GroupReadyFightFinish、GroupUseSkill、 GroupUseItem、GroupChangePet和GroupEscape方法 - 新增组队战斗相关的入站信息结构体定义 - 实现了组队BOSS战斗逻辑,添加groupBossSlotLimit常量 - 重构宠物技能设置逻辑,调整金币消耗时机 - 优化战斗循环逻辑,添加对无行动槽位的处理 - 改进AI行动逻辑,增加多位置目标选择
This commit is contained in:
@@ -35,6 +35,7 @@ type fightBuildOptions struct {
|
||||
fightInfo *info.Fightinfo
|
||||
|
||||
controllerBinding int
|
||||
legacyGroupProtocol bool
|
||||
}
|
||||
|
||||
// defaultFightBuildOptions 返回建战默认参数。
|
||||
@@ -89,6 +90,13 @@ func WithInputControllerBinding(mode int) FightOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithLegacyGroupProtocol 设置是否使用旧组队协议 CMD。
|
||||
func WithLegacyGroupProtocol(enabled bool) FightOption {
|
||||
return func(opts *fightBuildOptions) {
|
||||
opts.legacyGroupProtocol = enabled
|
||||
}
|
||||
}
|
||||
|
||||
func NewFightWithOptions(opts ...FightOption) (*FightC, errorcode.ErrorCode) {
|
||||
buildOpts := defaultFightBuildOptions()
|
||||
for _, opt := range opts {
|
||||
|
||||
Reference in New Issue
Block a user