diff --git a/bin/json/game_vikingboss.json b/bin/json/game_vikingboss.json index 71003f184..2397e23a3 100644 --- a/bin/json/game_vikingboss.json +++ b/bin/json/game_vikingboss.json @@ -55,6 +55,7 @@ } ], "drop": 1001, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -119,6 +120,7 @@ } ], "drop": 1002, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -183,6 +185,7 @@ } ], "drop": 1003, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -247,6 +250,7 @@ } ], "drop": 1004, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -311,6 +315,7 @@ } ], "drop": 1005, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -375,6 +380,7 @@ } ], "drop": 1006, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -439,6 +445,7 @@ } ], "drop": 1007, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -503,6 +510,7 @@ } ], "drop": 1008, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -567,6 +575,7 @@ } ], "drop": 1009, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -631,6 +640,7 @@ } ], "drop": 1010, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -695,6 +705,7 @@ } ], "drop": 1011, + "scene": "", "bossmodel": 11003, "boss_skill": 51004, "boss": [ @@ -759,6 +770,7 @@ } ], "drop": 1012, + "scene": "", "bossmodel": 11003, "boss_skill": 51004, "boss": [ @@ -823,6 +835,7 @@ } ], "drop": 1013, + "scene": "", "bossmodel": 11003, "boss_skill": 51004, "boss": [ @@ -887,6 +900,7 @@ } ], "drop": 1014, + "scene": "", "bossmodel": 11003, "boss_skill": 51004, "boss": [ @@ -951,6 +965,7 @@ } ], "drop": 1015, + "scene": "", "bossmodel": 11003, "boss_skill": 51004, "boss": [ @@ -1015,6 +1030,7 @@ } ], "drop": 1016, + "scene": "", "bossmodel": 11003, "boss_skill": 51004, "boss": [ @@ -1079,6 +1095,7 @@ } ], "drop": 1017, + "scene": "", "bossmodel": 11003, "boss_skill": 51004, "boss": [ @@ -1143,6 +1160,7 @@ } ], "drop": 1018, + "scene": "", "bossmodel": 11003, "boss_skill": 51004, "boss": [ @@ -1207,6 +1225,7 @@ } ], "drop": 1019, + "scene": "", "bossmodel": 11003, "boss_skill": 51004, "boss": [ @@ -1271,6 +1290,7 @@ } ], "drop": 1020, + "scene": "", "bossmodel": 11003, "boss_skill": 51004, "boss": [ @@ -1335,6 +1355,7 @@ } ], "drop": 1021, + "scene": "", "bossmodel": 11018, "boss_skill": 51004, "boss": [ @@ -1399,6 +1420,7 @@ } ], "drop": 1022, + "scene": "", "bossmodel": 11018, "boss_skill": 51004, "boss": [ @@ -1463,6 +1485,7 @@ } ], "drop": 1023, + "scene": "", "bossmodel": 11018, "boss_skill": 51004, "boss": [ @@ -1527,6 +1550,7 @@ } ], "drop": 1024, + "scene": "", "bossmodel": 11018, "boss_skill": 51004, "boss": [ @@ -1591,6 +1615,7 @@ } ], "drop": 1025, + "scene": "", "bossmodel": 11018, "boss_skill": 51004, "boss": [ @@ -1655,6 +1680,7 @@ } ], "drop": 1026, + "scene": "", "bossmodel": 11018, "boss_skill": 51004, "boss": [ @@ -1719,6 +1745,7 @@ } ], "drop": 1027, + "scene": "", "bossmodel": 11018, "boss_skill": 51004, "boss": [ @@ -1783,6 +1810,7 @@ } ], "drop": 1028, + "scene": "", "bossmodel": 11018, "boss_skill": 51004, "boss": [ @@ -1847,6 +1875,7 @@ } ], "drop": 1029, + "scene": "", "bossmodel": 11018, "boss_skill": 51004, "boss": [ @@ -1911,6 +1940,7 @@ } ], "drop": 1030, + "scene": "", "bossmodel": 11018, "boss_skill": 51004, "boss": [ @@ -1965,6 +1995,7 @@ } ], "drop": 1001, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2019,6 +2050,7 @@ } ], "drop": 1002, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2073,6 +2105,7 @@ } ], "drop": 1003, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2127,6 +2160,7 @@ } ], "drop": 1004, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2181,6 +2215,7 @@ } ], "drop": 1005, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2235,6 +2270,7 @@ } ], "drop": 1006, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2289,6 +2325,7 @@ } ], "drop": 1007, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2343,6 +2380,7 @@ } ], "drop": 1008, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2397,6 +2435,7 @@ } ], "drop": 1009, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2451,6 +2490,7 @@ } ], "drop": 1010, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2505,6 +2545,7 @@ } ], "drop": 1001, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2559,6 +2600,7 @@ } ], "drop": 1002, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2613,6 +2655,7 @@ } ], "drop": 1003, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2667,6 +2710,7 @@ } ], "drop": 1004, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2721,6 +2765,7 @@ } ], "drop": 1005, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2775,6 +2820,7 @@ } ], "drop": 1006, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2829,6 +2875,7 @@ } ], "drop": 1007, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2883,6 +2930,7 @@ } ], "drop": 1008, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2937,6 +2985,7 @@ } ], "drop": 1009, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ @@ -2991,6 +3040,7 @@ } ], "drop": 1010, + "scene": "", "bossmodel": 11009, "boss_skill": 51004, "boss": [ diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index 77f1e51a7..d635d1a08 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -73,37 +73,40 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq szStar = append(szStar, 5) continue } - sz := make([]int32, 0) + // 3,4,5 星权重 + starWeight := make([]int32, 0) if cfgDraw.BasePoolStar3 != 0 { - sz = append(sz, cfgDraw.BasePoolStar3) + starWeight = append(starWeight, cfgDraw.BasePoolStar3) } if cfgDraw.BasePoolStar4 != 0 { - sz = append(sz, cfgDraw.BasePoolStar4) + starWeight = append(starWeight, cfgDraw.BasePoolStar4) } if cfgDraw.BasePoolStar5 != 0 { - sz = append(sz, cfgDraw.BasePoolStar5) + starWeight = append(starWeight, cfgDraw.BasePoolStar5) } - starIndex := this.module.modelHero.GetRandW(sz) + starIndex := this.module.modelHero.GetRandW(starWeight) // 3 4 5 星索引 // 特殊规则 DrawCard_5StarsInRange 第2-30次抽奖必出一个5星英雄(普通卡池) inRangeConf := this.module.configure.GetGlobalConf().DrawCard5StarsInRange if len(inRangeConf) == 3 { iStart := inRangeConf[0] // 抽卡开始 iEnd := inRangeConf[1] // 抽卡结束 star := inRangeConf[2] - if heroRecord.Inevitable == 0 && heroRecord.Drawcount > iStart && heroRecord.Drawcount < iEnd && iEnd >= iStart { - n, _ := rand.Int(rand.Reader, big.NewInt(int64(iEnd-iStart))) - if n.Int64() < 1 { // 抽中 + if star >= 3 { // 保底必须三星+ + if heroRecord.Inevitable == 0 && heroRecord.Drawcount > iStart && heroRecord.Drawcount < iEnd && iEnd >= iStart { + n, _ := rand.Int(rand.Reader, big.NewInt(int64(iEnd-iStart))) + if n.Int64() < 1 { // 抽中 + starIndex = star - 3 + heroRecord.Inevitable = heroRecord.Drawcount + update["inevitable"] = heroRecord.Drawcount + } + } + // 保底情况 + if heroRecord.Drawcount == iEnd && heroRecord.Inevitable == 0 { starIndex = star - 3 heroRecord.Inevitable = heroRecord.Drawcount update["inevitable"] = heroRecord.Drawcount } } - // 保底情况 - if heroRecord.Drawcount == iEnd && heroRecord.Inevitable == 0 { - starIndex = star - 3 - heroRecord.Inevitable = heroRecord.Drawcount - update["inevitable"] = heroRecord.Drawcount - } } heroRecord.Star4++ // 4星保底数量+1 diff --git a/modules/user/api_create.go b/modules/user/api_create.go index dae16099b..d75a98849 100644 --- a/modules/user/api_create.go +++ b/modules/user/api_create.go @@ -49,11 +49,19 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (c return } + //初始体力 + var ps int32 + gpd := this.module.configure.GetPlayerlvConf(self.Lv) + if gpd != nil { + ps = gpd.PsCeiling + } + update := map[string]interface{}{ "name": req.NickName, //设置昵称 "created": true, //创角标识 "figure": req.Figure, //设置形象 "gender": req.Gender, //设置性别 + "ps": ps, //设置初始体力 } globalConf := this.module.globalConf diff --git a/modules/viking/api_challenge.go b/modules/viking/api_challenge.go index 25024ff6f..469bc2800 100644 --- a/modules/viking/api_challenge.go +++ b/modules/viking/api_challenge.go @@ -77,7 +77,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng return } session.SendMsg(string(this.module.GetType()), VikingChallengeResp, &pb.VikingChallengeResp{ - Info: &pb.BattleInfo{Id: record.Id, Title: record.Title, Btype: record.Btype, Ptype: record.Ptype, RedCompId: record.RedCompId, Redflist: record.Redflist, BlueCompId: record.BlueCompId, Buleflist: record.Buleflist}, + Info: &pb.BattleInfo{Id: record.Id, Title: record.Title, Scene: cfgData.Scene, Btype: record.Btype, Ptype: record.Ptype, RedCompId: record.RedCompId, Redflist: record.Redflist, BlueCompId: record.BlueCompId, Buleflist: record.Buleflist}, BossId: req.BossId, Difficulty: req.Difficulty, }) diff --git a/sys/configure/structs/Game.VikingBossData.go b/sys/configure/structs/Game.VikingBossData.go index b889fb040..ff94ac35e 100644 --- a/sys/configure/structs/Game.VikingBossData.go +++ b/sys/configure/structs/Game.VikingBossData.go @@ -20,6 +20,7 @@ type GameVikingBossData struct { Firstprize []*Gameatn Dropshow []*Gameatn Drop int32 + Scene string Bossmodel int32 BossSkill int32 Boss []int32 @@ -80,6 +81,7 @@ func (_v *GameVikingBossData)Deserialize(_buf map[string]interface{}) (err error } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["drop"].(float64); !_ok_ { err = errors.New("drop error"); return }; _v.Drop = int32(_tempNum_) } + { var _ok_ bool; if _v.Scene, _ok_ = _buf["scene"].(string); !_ok_ { err = errors.New("scene error"); return } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["bossmodel"].(float64); !_ok_ { err = errors.New("bossmodel error"); return }; _v.Bossmodel = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["boss_skill"].(float64); !_ok_ { err = errors.New("boss_skill error"); return }; _v.BossSkill = int32(_tempNum_) } {