feat(pet): 实现宠物展示功能和稀有宠物塔配置 - 添加PetDisplay字段到Player结构体,用于管理宠物展示状态 - 实现PlayerShowPet方法,支持宠物展示逻辑,包括设置展示标识、 检查宠物存在性并返回相应错误码 - 在Space中添加RefreshUserInfo方法,用于刷新用户信息并应用 宠物展示信息到SimpleInfo - 扩展SimpleInfo结构体,添加PetRide字段用于宠物骑乘标识
105 lines
2.0 KiB
Go
105 lines
2.0 KiB
Go
package model
|
|
|
|
import (
|
|
"blazing/cool"
|
|
)
|
|
|
|
const (
|
|
TableNameRarePetTowerConfig = "config_tower_1"
|
|
TableNamedARKTowerConfig = "config_tower_110"
|
|
TableNameTrialTowerConfig = "config_tower_500"
|
|
TableNameBraveTowerConfig = "config_tower_600"
|
|
)
|
|
|
|
type BaseTowerConfig struct {
|
|
*BaseConfig
|
|
Name string `gorm:"type:varchar(100);default:'';comment:'name'" json:"name" description:"name"`
|
|
TowerLevel uint32 `gorm:"not null;default:0;uniqueIndex;comment:'tower level'" json:"tower_level"`
|
|
BossIds []uint32 `gorm:"type:jsonb;comment:'boss ids'" json:"boss_ids"`
|
|
}
|
|
|
|
func NewBaseTowerConfig() *BaseTowerConfig {
|
|
return &BaseTowerConfig{
|
|
BaseConfig: NewBaseConfig(),
|
|
}
|
|
}
|
|
|
|
type Tower1Config struct {
|
|
*BaseTowerConfig
|
|
}
|
|
|
|
type Tower110Config struct {
|
|
*BaseTowerConfig
|
|
}
|
|
|
|
type Tower500Config struct {
|
|
*BaseTowerConfig
|
|
}
|
|
|
|
type Tower600Config struct {
|
|
*BaseTowerConfig
|
|
}
|
|
|
|
func (*Tower1Config) TableName() string {
|
|
return TableNameRarePetTowerConfig
|
|
}
|
|
|
|
func (*Tower1Config) GroupName() string {
|
|
return "default"
|
|
}
|
|
|
|
func New1TowerConfig() *Tower1Config {
|
|
return &Tower1Config{
|
|
BaseTowerConfig: NewBaseTowerConfig(),
|
|
}
|
|
}
|
|
|
|
func (*Tower110Config) TableName() string {
|
|
return TableNamedARKTowerConfig
|
|
}
|
|
|
|
func (*Tower110Config) GroupName() string {
|
|
return "default"
|
|
}
|
|
|
|
func New110TowerConfig() *Tower110Config {
|
|
return &Tower110Config{
|
|
BaseTowerConfig: NewBaseTowerConfig(),
|
|
}
|
|
}
|
|
|
|
func (*Tower500Config) TableName() string {
|
|
return TableNameTrialTowerConfig
|
|
}
|
|
|
|
func (*Tower500Config) GroupName() string {
|
|
return "default"
|
|
}
|
|
|
|
func New500TowerConfig() *Tower500Config {
|
|
return &Tower500Config{
|
|
BaseTowerConfig: NewBaseTowerConfig(),
|
|
}
|
|
}
|
|
|
|
func (*Tower600Config) TableName() string {
|
|
return TableNameBraveTowerConfig
|
|
}
|
|
|
|
func (*Tower600Config) GroupName() string {
|
|
return "default"
|
|
}
|
|
|
|
func New600TowerConfig() *Tower600Config {
|
|
return &Tower600Config{
|
|
BaseTowerConfig: NewBaseTowerConfig(),
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
cool.CreateTable(&Tower1Config{})
|
|
cool.CreateTable(&Tower110Config{})
|
|
cool.CreateTable(&Tower500Config{})
|
|
cool.CreateTable(&Tower600Config{})
|
|
}
|