diff --git a/bin/json/game_opencond.json b/bin/json/game_opencond.json index e0db597d9..f8415a0a6 100644 --- a/bin/json/game_opencond.json +++ b/bin/json/game_opencond.json @@ -184,7 +184,7 @@ "main": [ { "key": 1, - "param": 3 + "param": 1 } ], "optional": "", @@ -844,7 +844,7 @@ "main": [ { "key": 1, - "param": 30 + "param": 1 } ], "optional": "", @@ -976,7 +976,7 @@ "main": [ { "key": 1, - "param": 30 + "param": 1 } ], "optional": "", diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index 4823f38fb..2702daebf 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -77,7 +77,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp defer this.hlock.Unlock() if _configure, ok := v.(*cfg.GameHeroAwaken); ok { for _, v := range _configure.GetDataList() { - this.awakenMap[utils.ToInt64(v.Hid)+int64(v.Phase<<31)] = v + this.awakenMap[utils.ToInt64(v.Hid)+int64(v.Phase)<<31] = v } return } @@ -94,7 +94,9 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp this.hlock.Lock() defer this.hlock.Unlock() for _, v := range _configure.GetDataList() { - this.starMap[utils.ToInt64(v.Id)+int64(v.Star<<31)] = v + key := utils.ToInt64(v.Id) + key += int64(v.Star) << 31 + this.starMap[key] = v } return @@ -109,14 +111,15 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp // 获取英雄升星相关配置数据 func (this *configureComp) GetHeroStarupConfig(hid string, star int32) *cfg.GameHeroStarupData { - return this.starMap[utils.ToInt64(hid)+int64(star<<31)] + return this.starMap[utils.ToInt64(hid)+int64(star)<<31] } // 获取当前英雄最高星级 func (this *configureComp) GetHeroMaxStar(hid string, curStar int32) int32 { var star int32 for star = curStar; star < 100; star++ { - if _, ok := this.starMap[utils.ToInt64(hid)+int64((star+1)<<31)]; !ok { + if v, ok := this.starMap[utils.ToInt64(hid)+int64(star+1)<<31]; !ok { + this.module.Debugf("%v", v) return star } } @@ -125,7 +128,7 @@ func (this *configureComp) GetHeroMaxStar(hid string, curStar int32) int32 { // 获取觉醒配置 func (this *configureComp) GetHeroAwakenConfig(hid string, phase int32) *cfg.GameHeroAwakenData { - return this.awakenMap[utils.ToInt64(hid)+int64(phase<<31)] + return this.awakenMap[utils.ToInt64(hid)+int64(phase)<<31] } // 抽卡配置表 diff --git a/modules/smithy/api_forgeequip.go b/modules/smithy/api_forgeequip.go index 17d023418..344447a00 100644 --- a/modules/smithy/api_forgeequip.go +++ b/modules/smithy/api_forgeequip.go @@ -58,7 +58,6 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq Value: 0, } } - // 是否是精益打造 if req.Quality > 0 { costRes = append(costRes, reelcfg.RefineCos) @@ -129,30 +128,36 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq v.N = 0 } } - if code = this.module.CheckRes(session, costRes); code != pb.ErrorCode_Success { - return - } if code = this.module.ConsumeRes(session, costRes, true); code != pb.ErrorCode_Success { return } // 装备资源分发 - if customLv > 0 { // - + if customLv > 0 { sz := make([]int32, 4) // 最高 4个品质 // 获得极品权重 sz[3] = this.module.modelStove.StoveToolsQualityProbability(stove) - if equip, code1 := this.module.ModuleEquipment.GetForgeEquip(session, req.SuiteId, req.Position, customLv, sz); code1 == pb.ErrorCode_Success { - rsp.Equip = append(rsp.Equip, equip) - } else { + if equip, code1 := this.module.ModuleEquipment.GetForgeEquip(session, req.SuiteId, req.Position, customLv, sz); code1 != pb.ErrorCode_Success { code = code1 return + } else { + rsp.Equip = append(rsp.Equip, equip) } - } else { + } else { // 普通打造 // 获取掉落id newdrop := this.module.modelStove.CheckUnlockSuid(req.ReelId, stove.Data[req.ReelId].Lv, reelcfg.BasicDrop) res := this.module.configure.GetDropReward(newdrop) + // 检查是否命中双倍打造 + if ok := this.module.modelStove.CheckForgetwoEquip(req.ReelId, stove.Data[req.ReelId].Lv); ok { + if err, atno := this.module.DispenseAtno(session, res, true); err == pb.ErrorCode_Success { + for _, v := range atno { + if eq, err1 := this.module.ModuleEquipment.QueryEquipment(session.GetUserId(), v.O); err1 == pb.ErrorCode_Success { + rsp.Equip = append(rsp.Equip, eq) + } + } + } + } if err, atno := this.module.DispenseAtno(session, res, true); err == pb.ErrorCode_Success { for _, v := range atno { if eq, err1 := this.module.ModuleEquipment.QueryEquipment(session.GetUserId(), v.O); err1 == pb.ErrorCode_Success { @@ -191,9 +196,10 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq if nextProficiency.Type == comm.SmithyReelType4 { if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { rst.SuiteId = append(rst.SuiteId, nextProficiency.Value1) - update := make(map[string]interface{}, 0) - update["suiteId"] = rst.SuiteId - this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), update) + + this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{ + "suiteId": rst.SuiteId, + }) } } } diff --git a/modules/smithy/api_getlist.go b/modules/smithy/api_getlist.go index 4e67c92e3..f95832ef1 100644 --- a/modules/smithy/api_getlist.go +++ b/modules/smithy/api_getlist.go @@ -15,9 +15,7 @@ func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.SmithyGetLi ///获取美食城基本信息 func (this *apiComp) GetList(session comm.IUserSession, req *pb.SmithyGetListReq) (code pb.ErrorCode, data proto.Message) { - // this.module.modelAtlas.CheckActivateAtlas(session.GetUserId(), "10110", 1, 1, 1) - // this.AtlasList(session, &pb.SmithyAtlasListReq{}) code = this.GetListCheck(session, req) if code != pb.ErrorCode_Success { return // 参数校验失败直接返回 diff --git a/modules/smithy/api_rise.go b/modules/smithy/api_rise.go index 75b0c151e..80fb4773f 100644 --- a/modules/smithy/api_rise.go +++ b/modules/smithy/api_rise.go @@ -10,7 +10,7 @@ import ( //参数校验 func (this *apiComp) RiseCheck(session comm.IUserSession, req *pb.SmithyRiseReq) (code pb.ErrorCode) { - if req.ItemId != "" && req.Count < 0 { + if req.ItemId == "" || req.Count <= 0 { code = pb.ErrorCode_ReqParameterError } return diff --git a/modules/smithy/model_stove.go b/modules/smithy/model_stove.go index 24d11fa7c..c6e00af4e 100644 --- a/modules/smithy/model_stove.go +++ b/modules/smithy/model_stove.go @@ -9,7 +9,6 @@ import ( "go_dreamfactory/pb" "go_dreamfactory/sys/configure" cfg "go_dreamfactory/sys/configure/structs" - "math" "math/big" "strconv" @@ -81,7 +80,7 @@ func (this *modelStove) CheckTemperature(reelId int32, lv int32) (t int32) { return } -// 检查额外概率制造两件装备 +// 限定 普通打造的时候检查额外概率制造两件装备 func (this *modelStove) CheckForgetwoEquip(reelId int32, lv int32) (b bool) { var ( index int32 @@ -95,7 +94,7 @@ func (this *modelStove) CheckForgetwoEquip(reelId int32, lv int32) (b bool) { } } if value > 0 { - n, _ := rand.Int(rand.Reader, big.NewInt(100)) + n, _ := rand.Int(rand.Reader, big.NewInt(1000)) // 千分比 if value < int32(n.Int64()) { return true @@ -212,22 +211,19 @@ func (this *modelStove) GetRandEquipLv(sz []int32) int32 { return 0 } +// 解析掉落id func (this *modelStove) CheckUnlockSuid(reelId, lv, dropid int32) int32 { var index int32 - var szDrop []int32 - var szLen int32 for index = 1; index <= lv; index++ { if conf := this.module.configure.GetSmithyProficileData(reelId, index); conf != nil { if conf.Type == comm.SmithyReelType4 && conf.Value1 != 0 { - szDrop = append(szDrop, conf.Value1) + dropid *= 100 + dropid += conf.Value1 + break } } } - szLen = int32(len(szDrop)) - dropid *= int32(math.Pow(10, float64(szLen))) - for pos, v := range szDrop { - dropid += v * int32(math.Pow(10, float64(pos))) - } + return dropid } diff --git a/utils/strings.go b/utils/strings.go index 7cbfbd620..5466352fe 100644 --- a/utils/strings.go +++ b/utils/strings.go @@ -90,9 +90,8 @@ func ToInt32(s string) int32 { } func ToInt64(s string) int64 { - if j, err := strconv.ParseInt(s, 10, 32); err != nil { - return 0 - } else { - return int64(j) + if bint, err := strconv.ParseInt(s, 10, 32); err == nil { + return bint } + return 0 }