上传代码

This commit is contained in:
liwei1dao 2024-02-20 12:25:00 +08:00
parent d3d402fc1e
commit 80e414f988
4 changed files with 25 additions and 18 deletions

View File

@ -55,11 +55,13 @@ func (this *configureComp) getMaxHoroscopes() (result map[int32]*cfg.GameHorosco
} else {
result = make(map[int32]*cfg.GameHoroscopeData)
for _, v := range v.(*cfg.GameHoroscope).GetDataMap() {
if _, ok = result[v.NodeId]; !ok {
result[v.NodeId] = v
}
if v.Lv > result[v.NodeId].Lv {
result[v.NodeId] = v
if v.Type == 1 {
if _, ok = result[v.NodeId]; !ok {
result[v.NodeId] = v
}
if v.Lv > result[v.NodeId].Lv {
result[v.NodeId] = v
}
}
}
}
@ -75,7 +77,7 @@ func (this *configureComp) getHoroscopebylv(nodeid, lv int32) (result *cfg.GameH
this.module.Errorln(err)
} else {
for _, v := range v.(*cfg.GameHoroscope).GetDataMap() {
if v.NodeId == nodeid && v.Lv == lv {
if v.Type == 1 && v.NodeId == nodeid && v.Lv == lv {
result = v
return
}

View File

@ -169,9 +169,11 @@ func (this *modelHoroscope) reddot(session comm.IUserSession) bool {
}
for _, v := range horoscope.GetDataList() {
if lv, ok := info.Nodes[v.NodeId]; !ok && v.Lv > lv {
if errdata = this.module.CheckRes(session, v.CostItem); errdata == nil {
return true
if v.Type == 1 {
if lv, ok := info.Nodes[v.NodeId]; !ok && v.Lv > lv {
if errdata = this.module.CheckRes(session, v.CostItem); errdata == nil {
return true
}
}
}
}

View File

@ -10,13 +10,14 @@ import (
)
const (
game_puggsyevent = "game_puggsyevent.json"
game_puggsyskill = "game_puggsyskill.json"
game_puggsyevent = "game_puggsyevent.json"
// game_puggsyskill = "game_puggsyskill.json"
game_puggsyfight = "game_puggsyfight.json"
game_puggsyscore = "game_puggsyscore.json"
game_passcheck = "game_passcheck.json"
game_puggsystar = "game_puggsystar.json"
game_puggsyrecruit = "game_puggsyrecruit.json"
game_horoscope = "game_horoscope.json" //购买挑战记录
)
// /背包配置管理组件
@ -30,12 +31,14 @@ func (this *ConfigureComp) Init(service core.IService, module core.IModule, comp
this.MCompConfigure.Init(service, module, comp, options)
this.module = module.(*IsLand)
err = this.LoadConfigure(game_puggsyevent, cfg.NewGamePuggsyEvent)
err = this.LoadConfigure(game_puggsyskill, cfg.NewGamePuggsySkill)
// err = this.LoadConfigure(game_puggsyskill, cfg.NewGamePuggsySkill)
err = this.LoadConfigure(game_puggsyfight, cfg.NewGamePuggsyFight)
err = this.LoadConfigure(game_puggsyscore, cfg.NewGamePuggsyScore)
err = this.LoadConfigure(game_passcheck, cfg.NewGamePassCheck)
err = this.LoadConfigure(game_puggsystar, cfg.NewGamePuggsyStar)
err = this.LoadConfigure(game_puggsyrecruit, cfg.NewGamePuggsyRecruit)
err = this.LoadConfigure(game_horoscope, cfg.NewGameHoroscope)
return
}
@ -83,7 +86,7 @@ func (this *ConfigureComp) getGamePuggsySkillData(id int32) (configure *cfg.Game
v interface{}
ok bool
)
if v, err = this.GetConfigure(game_puggsyskill); err != nil {
if v, err = this.GetConfigure(game_horoscope); err != nil {
this.module.Errorf("err:%v", err)
return
} else {
@ -97,16 +100,16 @@ func (this *ConfigureComp) getGamePuggsySkillData(id int32) (configure *cfg.Game
}
//技能节点
func (this *ConfigureComp) getGamePuggsySkilllvData(nid, lv int32) (conf *cfg.GamePuggsySkillData, err error) {
func (this *ConfigureComp) getGamePuggsySkilllvData(nid, lv int32) (conf *cfg.GameHoroscopeData, err error) {
var (
v interface{}
)
if v, err = this.GetConfigure(game_puggsyskill); err != nil {
if v, err = this.GetConfigure(game_horoscope); err != nil {
this.module.Errorf("err:%v", err)
return
} else {
for _, v := range v.(*cfg.GamePuggsySkill).GetDataList() {
if v.NodeId == nid && v.Lv == lv {
for _, v := range v.(*cfg.GameHoroscope).GetDataList() {
if v.Type == 2 && v.NodeId == nid && v.Lv == lv {
conf = v
return
}

View File

@ -59,7 +59,7 @@ func (this *modelComp) getmodel(uid string) (result *pb.DBIsland, err error) {
//计算属性
func (this *modelComp) compute(info *pb.DBIsland, heros []*pb.DBHero) (err error) {
var (
node *cfg.GamePuggsySkillData
node *cfg.GameHoroscopeData
property map[int32]int32 = make(map[int32]int32)
)