From 62d65257f11db27ceaf07860812f8fcd0bbe7852 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 18 Nov 2022 22:04:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=85=85=E5=80=BC=E5=90=8E=E3=80=81N?= =?UTF-8?q?=E5=A4=A9=E6=B2=A1=E7=99=BB=E5=BD=95=E6=83=85=E5=86=B5=E4=B8=8B?= =?UTF-8?q?=E6=8A=BD=E5=8D=A1=E6=A6=82=E7=8E=87=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/api_drawCard.go | 2 +- modules/hero/module.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index 0d7aae279..d91f3cca6 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -63,7 +63,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq pool = this.module.modelHero.CheckPool(drawCount, cfgDraw) drawCount += 1 strPool = append(strPool, pool) - ret := this.module.CheckCondition(session.GetUserId(), req.DrawCount) + ret := this.module.CheckCondition(session.GetUserId()) if ret == true { // 命中插入5星英雄 szStar = append(szStar, 5) continue diff --git a/modules/hero/module.go b/modules/hero/module.go index 82c568271..28dbd336e 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -458,7 +458,7 @@ func (this *Hero) NoLoginDay(uid string, day int32) { } // 检查充值和未登录天数之内抽卡是否抽中 -func (this *Hero) CheckCondition(uid string, drawCount int32) bool { +func (this *Hero) CheckCondition(uid string) bool { var ( curCount int32 update map[string]interface{} @@ -472,16 +472,15 @@ func (this *Hero) CheckCondition(uid string, drawCount int32) bool { curCount = conf.DrawCardRechargeReward[1] } if v >= curCount { // 触发保底 直接给5星 - delete(record.Condition, "recharge") update["condition"] = record.Condition return true } else { // 1/curCount概率 n, _ := rand.Int(rand.Reader, big.NewInt(int64(curCount))) - if n.Int64() < 1 { delete(record.Condition, "recharge") + update["condition"] = record.Condition return true } record.Condition["recharge"] += 1 @@ -494,12 +493,14 @@ func (this *Hero) CheckCondition(uid string, drawCount int32) bool { } if v >= curCount { // 触发保底 直接给5星 delete(record.Condition, "login") + update["login"] = record.Condition return true } else { // 1/curCount概率 n, _ := rand.Int(rand.Reader, big.NewInt(int64(curCount))) if n.Int64() < 1 { delete(record.Condition, "login") + update["login"] = record.Condition return true } record.Condition["login"] += 1 From bc276967be94d0588921df3a095c82ec682e3888 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 21 Nov 2022 10:07:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E7=BB=8F=E9=AA=8C?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_herolevelup.json | 474 +++--------------- sys/configure/structs/game.heroLevelupData.go | 17 +- 2 files changed, 62 insertions(+), 429 deletions(-) diff --git a/bin/json/game_herolevelup.json b/bin/json/game_herolevelup.json index 7765623b6..10482b8da 100644 --- a/bin/json/game_herolevelup.json +++ b/bin/json/game_herolevelup.json @@ -1,774 +1,420 @@ [ { "level": 1, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 40 - } - ], + "heroexp": 40, "hp": 1857, "atk": 154, "def": 168 }, { "level": 2, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 80 - } - ], + "heroexp": 80, "hp": 1953, "atk": 162, "def": 177 }, { "level": 3, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 120 - } - ], + "heroexp": 120, "hp": 2049, "atk": 170, "def": 186 }, { "level": 4, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 160 - } - ], + "heroexp": 160, "hp": 2145, "atk": 178, "def": 195 }, { "level": 5, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 200 - } - ], + "heroexp": 200, "hp": 2241, "atk": 186, "def": 203 }, { "level": 6, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 240 - } - ], + "heroexp": 240, "hp": 2337, "atk": 194, "def": 212 }, { "level": 7, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 280 - } - ], + "heroexp": 280, "hp": 2433, "atk": 202, "def": 221 }, { "level": 8, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 320 - } - ], + "heroexp": 320, "hp": 2529, "atk": 210, "def": 229 }, { "level": 9, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 360 - } - ], + "heroexp": 360, "hp": 2625, "atk": 218, "def": 238 }, { "level": 10, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 400 - } - ], + "heroexp": 400, "hp": 2759.4, "atk": 229, "def": 250 }, { "level": 11, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 440 - } - ], + "heroexp": 440, "hp": 2893.8, "atk": 241, "def": 263 }, { "level": 12, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 900 - } - ], + "heroexp": 900, "hp": 3028.2, "atk": 252, "def": 275 }, { "level": 13, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 975 - } - ], + "heroexp": 975, "hp": 3162.6, "atk": 263, "def": 287 }, { "level": 14, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 1050 - } - ], + "heroexp": 1050, "hp": 3297, "atk": 274, "def": 299 }, { "level": 15, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 1125 - } - ], + "heroexp": 1125, "hp": 3431.4, "atk": 285, "def": 311 }, { "level": 16, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 1200 - } - ], + "heroexp": 1200, "hp": 3565.8, "atk": 297, "def": 324 }, { "level": 17, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 1275 - } - ], + "heroexp": 1275, "hp": 3700.2, "atk": 308, "def": 336 }, { "level": 18, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 1350 - } - ], + "heroexp": 1350, "hp": 3834.6, "atk": 319, "def": 348 }, { "level": 19, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 1425 - } - ], + "heroexp": 1425, "hp": 3969, "atk": 330, "def": 360 }, { "level": 20, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 1500 - } - ], + "heroexp": 1500, "hp": 4141.8, "atk": 345, "def": 376 }, { "level": 21, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 2120 - } - ], + "heroexp": 2120, "hp": 4314.6, "atk": 359, "def": 392 }, { "level": 22, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 2240 - } - ], + "heroexp": 2240, "hp": 4487.4, "atk": 373, "def": 407 }, { "level": 23, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 2380 - } - ], + "heroexp": 2380, "hp": 4660.2, "atk": 388, "def": 423 }, { "level": 24, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 2520 - } - ], + "heroexp": 2520, "hp": 4833, "atk": 402, "def": 439 }, { "level": 25, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 2680 - } - ], + "heroexp": 2680, "hp": 5005.8, "atk": 417, "def": 455 }, { "level": 26, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 2840 - } - ], + "heroexp": 2840, "hp": 5178.6, "atk": 431, "def": 470 }, { "level": 27, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 3020 - } - ], + "heroexp": 3020, "hp": 5351.4, "atk": 445, "def": 486 }, { "level": 28, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 3200 - } - ], + "heroexp": 3200, "hp": 5524.2, "atk": 460, "def": 502 }, { "level": 29, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 3400 - } - ], + "heroexp": 3400, "hp": 5697, "atk": 474, "def": 517 }, { "level": 30, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 3600 - } - ], + "heroexp": 3600, "hp": 5908.2, "atk": 492, "def": 537 }, { "level": 31, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 5700 - } - ], + "heroexp": 5700, "hp": 6119.4, "atk": 509, "def": 556 }, { "level": 32, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 6000 - } - ], + "heroexp": 6000, "hp": 6330.6, "atk": 527, "def": 575 }, { "level": 33, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 6330 - } - ], + "heroexp": 6330, "hp": 6541.8, "atk": 545, "def": 594 }, { "level": 34, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 6660 - } - ], + "heroexp": 6660, "hp": 6753, "atk": 562, "def": 613 }, { "level": 35, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 7020 - } - ], + "heroexp": 7020, "hp": 6964.2, "atk": 580, "def": 633 }, { "level": 36, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 7380 - } - ], + "heroexp": 7380, "hp": 7175.4, "atk": 597, "def": 652 }, { "level": 37, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 7770 - } - ], + "heroexp": 7770, "hp": 7386.6, "atk": 615, "def": 671 }, { "level": 38, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 8160 - } - ], + "heroexp": 8160, "hp": 7597.8, "atk": 633, "def": 690 }, { "level": 39, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 8580 - } - ], + "heroexp": 8580, "hp": 7809, "atk": 650, "def": 709 }, { "level": 40, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 9000 - } - ], + "heroexp": 9000, "hp": 8058.6, "atk": 671, "def": 732 }, { "level": 41, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 9600 - } - ], + "heroexp": 9600, "hp": 8308.2, "atk": 692, "def": 755 }, { "level": 42, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 10200 - } - ], + "heroexp": 10200, "hp": 8557.8, "atk": 713, "def": 777 }, { "level": 43, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 10800 - } - ], + "heroexp": 10800, "hp": 8807.4, "atk": 733, "def": 800 }, { "level": 44, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 11400 - } - ], + "heroexp": 11400, "hp": 9057, "atk": 754, "def": 823 }, { "level": 45, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 12000 - } - ], + "heroexp": 12000, "hp": 9306.6, "atk": 775, "def": 846 }, { "level": 46, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 12900 - } - ], + "heroexp": 12900, "hp": 9556.2, "atk": 796, "def": 868 }, { "level": 47, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 13800 - } - ], + "heroexp": 13800, "hp": 9805.8, "atk": 817, "def": 891 }, { "level": 48, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 14700 - } - ], + "heroexp": 14700, "hp": 10055.4, "atk": 837, "def": 914 }, { "level": 49, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 15600 - } - ], + "heroexp": 15600, "hp": 10305, "atk": 858, "def": 936 }, { "level": 50, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 16500 - } - ], + "heroexp": 16500, "hp": 10593, "atk": 882, "def": 963 }, { "level": 51, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 23600 - } - ], + "heroexp": 23600, "hp": 10881, "atk": 906, "def": 989 }, { "level": 52, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 25200 - } - ], + "heroexp": 25200, "hp": 11169, "atk": 930, "def": 1015 }, { "level": 53, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 26800 - } - ], + "heroexp": 26800, "hp": 11457, "atk": 954, "def": 1041 }, { "level": 54, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 28400 - } - ], + "heroexp": 28400, "hp": 11745, "atk": 978, "def": 1067 }, { "level": 55, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 30000 - } - ], + "heroexp": 30000, "hp": 12033, "atk": 1002, "def": 1093 }, { "level": 56, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 32000 - } - ], + "heroexp": 32000, "hp": 12321, "atk": 1026, "def": 1120 }, { "level": 57, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 34000 - } - ], + "heroexp": 34000, "hp": 12609, "atk": 1050, "def": 1146 }, { "level": 58, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 36000 - } - ], + "heroexp": 36000, "hp": 12897, "atk": 1074, "def": 1172 }, { "level": 59, - "heroexp": [ - { - "a": "attr", - "t": "heroexp", - "n": 38000 - } - ], + "heroexp": 38000, "hp": 13185, "atk": 1098, "def": 1198 }, { "level": 60, - "heroexp": [], + "heroexp": 0, "hp": 13511.4, "atk": 1125, "def": 1228 diff --git a/sys/configure/structs/game.heroLevelupData.go b/sys/configure/structs/game.heroLevelupData.go index 529b8e1b9..f9bfe4971 100644 --- a/sys/configure/structs/game.heroLevelupData.go +++ b/sys/configure/structs/game.heroLevelupData.go @@ -12,7 +12,7 @@ import "errors" type GameHeroLevelupData struct { Level int32 - Heroexp []*Gameatn + Heroexp int32 Hp float32 Atk float32 Def float32 @@ -26,20 +26,7 @@ func (*GameHeroLevelupData) GetTypeId() int32 { func (_v *GameHeroLevelupData)Deserialize(_buf map[string]interface{}) (err error) { { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["level"].(float64); !_ok_ { err = errors.New("level error"); return }; _v.Level = int32(_tempNum_) } - { - var _arr_ []interface{} - var _ok_ bool - if _arr_, _ok_ = _buf["heroexp"].([]interface{}); !_ok_ { err = errors.New("heroexp error"); return } - - _v.Heroexp = make([]*Gameatn, 0, len(_arr_)) - - for _, _e_ := range _arr_ { - var _list_v_ *Gameatn - { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } } - _v.Heroexp = append(_v.Heroexp, _list_v_) - } - } - + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["heroexp"].(float64); !_ok_ { err = errors.New("heroexp error"); return }; _v.Heroexp = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hp"].(float64); !_ok_ { err = errors.New("hp error"); return }; _v.Hp = float32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["atk"].(float64); !_ok_ { err = errors.New("atk error"); return }; _v.Atk = float32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["def"].(float64); !_ok_ { err = errors.New("def error"); return }; _v.Def = float32(_tempNum_) }