diff --git a/bin/json/game_potions.json b/bin/json/game_potions.json index fb1f1baa2..380d348d6 100644 --- a/bin/json/game_potions.json +++ b/bin/json/game_potions.json @@ -7,24 +7,48 @@ }, "type": 1, "quality": 1, - "SlitCount": 10, - "countdown": 30, - "generateInterval": 300, + "normalScore": 10, + "highScore": 30, + "countdown": [ + 30, + 35, + 40 + ], + "generateInterval": [ + 300 + ], "flyMinTime": 5, "flyMaxTime": 15, - "needSplit": [ - "120001" - ], "pool": [ - "120001", - "120002", - "120003", - "120004" + { + "Id": "120001", + "weight": 500, + "score": 1, + "effectType": 1 + }, + { + "Id": "120002", + "weight": 200, + "score": 10, + "effectType": 1 + }, + { + "Id": "120003", + "weight": 200, + "score": -5, + "effectType": 2 + }, + { + "Id": "120004", + "weight": 100, + "score": 100, + "effectType": 3 + } ], "material": [ { "a": "item", - "t": "10001", + "t": "120001", "n": 1 } ], @@ -58,24 +82,46 @@ }, "type": 2, "quality": 1, - "SlitCount": 10, - "countdown": 30, - "generateInterval": 300, + "normalScore": 10, + "highScore": 30, + "countdown": [ + 30 + ], + "generateInterval": [ + 300 + ], "flyMinTime": 5, "flyMaxTime": 15, - "needSplit": [ - "120002" - ], "pool": [ - "120001", - "120002", - "120003", - "120004" + { + "Id": "120001", + "weight": 500, + "score": 1, + "effectType": 1 + }, + { + "Id": "120002", + "weight": 200, + "score": 10, + "effectType": 1 + }, + { + "Id": "120003", + "weight": 200, + "score": -5, + "effectType": 2 + }, + { + "Id": "120004", + "weight": 100, + "score": 100, + "effectType": 3 + } ], "material": [ { "a": "item", - "t": "10002", + "t": "120002", "n": 1 } ], @@ -109,24 +155,46 @@ }, "type": 3, "quality": 1, - "SlitCount": 10, - "countdown": 30, - "generateInterval": 300, + "normalScore": 10, + "highScore": 30, + "countdown": [ + 30 + ], + "generateInterval": [ + 300 + ], "flyMinTime": 5, "flyMaxTime": 15, - "needSplit": [ - "120003" - ], "pool": [ - "120001", - "120002", - "120003", - "120004" + { + "Id": "120001", + "weight": 500, + "score": 1, + "effectType": 1 + }, + { + "Id": "120002", + "weight": 200, + "score": 10, + "effectType": 1 + }, + { + "Id": "120003", + "weight": 200, + "score": -5, + "effectType": 2 + }, + { + "Id": "120004", + "weight": 100, + "score": 100, + "effectType": 3 + } ], "material": [ { "a": "item", - "t": "10003", + "t": "120003", "n": 1 } ], @@ -160,24 +228,46 @@ }, "type": 4, "quality": 1, - "SlitCount": 10, - "countdown": 30, - "generateInterval": 300, + "normalScore": 10, + "highScore": 30, + "countdown": [ + 30 + ], + "generateInterval": [ + 300 + ], "flyMinTime": 5, "flyMaxTime": 15, - "needSplit": [ - "120004" - ], "pool": [ - "120001", - "120002", - "120003", - "120004" + { + "Id": "120001", + "weight": 500, + "score": 1, + "effectType": 1 + }, + { + "Id": "120002", + "weight": 200, + "score": 10, + "effectType": 1 + }, + { + "Id": "120003", + "weight": 200, + "score": -5, + "effectType": 2 + }, + { + "Id": "120004", + "weight": 100, + "score": 100, + "effectType": 3 + } ], "material": [ { "a": "item", - "t": "10004", + "t": "120004", "n": 1 } ], @@ -211,24 +301,46 @@ }, "type": 1, "quality": 2, - "SlitCount": 20, - "countdown": 30, - "generateInterval": 300, + "normalScore": 20, + "highScore": 40, + "countdown": [ + 40 + ], + "generateInterval": [ + 300 + ], "flyMinTime": 5, "flyMaxTime": 15, - "needSplit": [ - "120005" - ], "pool": [ - "120005", - "120006", - "120007", - "120008" + { + "Id": "120005", + "weight": 500, + "score": 1, + "effectType": 1 + }, + { + "Id": "120006", + "weight": 200, + "score": 10, + "effectType": 1 + }, + { + "Id": "120007", + "weight": 200, + "score": -5, + "effectType": 2 + }, + { + "Id": "120008", + "weight": 100, + "score": 100, + "effectType": 3 + } ], "material": [ { "a": "item", - "t": "10005", + "t": "120005", "n": 1 } ], @@ -262,24 +374,46 @@ }, "type": 2, "quality": 2, - "SlitCount": 20, - "countdown": 30, - "generateInterval": 300, + "normalScore": 20, + "highScore": 40, + "countdown": [ + 40 + ], + "generateInterval": [ + 300 + ], "flyMinTime": 5, "flyMaxTime": 15, - "needSplit": [ - "120006" - ], "pool": [ - "120005", - "120006", - "120007", - "120008" + { + "Id": "120005", + "weight": 500, + "score": 1, + "effectType": 1 + }, + { + "Id": "120006", + "weight": 200, + "score": 10, + "effectType": 1 + }, + { + "Id": "120007", + "weight": 200, + "score": -5, + "effectType": 2 + }, + { + "Id": "120008", + "weight": 100, + "score": 100, + "effectType": 3 + } ], "material": [ { "a": "item", - "t": "10006", + "t": "120006", "n": 1 } ], @@ -313,24 +447,46 @@ }, "type": 3, "quality": 2, - "SlitCount": 20, - "countdown": 30, - "generateInterval": 300, + "normalScore": 20, + "highScore": 40, + "countdown": [ + 40 + ], + "generateInterval": [ + 300 + ], "flyMinTime": 5, "flyMaxTime": 15, - "needSplit": [ - "120007" - ], "pool": [ - "120005", - "120006", - "120007", - "120008" + { + "Id": "120005", + "weight": 500, + "score": 1, + "effectType": 1 + }, + { + "Id": "120006", + "weight": 200, + "score": 10, + "effectType": 1 + }, + { + "Id": "120007", + "weight": 200, + "score": -5, + "effectType": 2 + }, + { + "Id": "120008", + "weight": 100, + "score": 100, + "effectType": 3 + } ], "material": [ { "a": "item", - "t": "10007", + "t": "120007", "n": 1 } ], @@ -364,24 +520,46 @@ }, "type": 4, "quality": 2, - "SlitCount": 20, - "countdown": 30, - "generateInterval": 300, + "normalScore": 20, + "highScore": 40, + "countdown": [ + 40 + ], + "generateInterval": [ + 300 + ], "flyMinTime": 5, "flyMaxTime": 15, - "needSplit": [ - "120008" - ], "pool": [ - "120005", - "120006", - "120007", - "120008" + { + "Id": "120005", + "weight": 500, + "score": 1, + "effectType": 1 + }, + { + "Id": "120006", + "weight": 200, + "score": 10, + "effectType": 1 + }, + { + "Id": "120007", + "weight": 200, + "score": -5, + "effectType": 2 + }, + { + "Id": "120008", + "weight": 100, + "score": 100, + "effectType": 3 + } ], "material": [ { "a": "item", - "t": "10008", + "t": "120008", "n": 1 } ], @@ -415,24 +593,46 @@ }, "type": 1, "quality": 3, - "SlitCount": 30, - "countdown": 30, - "generateInterval": 300, + "normalScore": 30, + "highScore": 50, + "countdown": [ + 50 + ], + "generateInterval": [ + 300 + ], "flyMinTime": 5, "flyMaxTime": 15, - "needSplit": [ - "120009" - ], "pool": [ - "120009", - "120101", - "120102", - "120103" + { + "Id": "120009", + "weight": 500, + "score": 1, + "effectType": 1 + }, + { + "Id": "120101", + "weight": 200, + "score": 10, + "effectType": 1 + }, + { + "Id": "120102", + "weight": 200, + "score": -5, + "effectType": 2 + }, + { + "Id": "120103", + "weight": 100, + "score": 100, + "effectType": 3 + } ], "material": [ { "a": "item", - "t": "10009", + "t": "120009", "n": 1 } ], @@ -466,24 +666,46 @@ }, "type": 2, "quality": 3, - "SlitCount": 30, - "countdown": 30, - "generateInterval": 300, + "normalScore": 30, + "highScore": 50, + "countdown": [ + 50 + ], + "generateInterval": [ + 300 + ], "flyMinTime": 5, "flyMaxTime": 15, - "needSplit": [ - "120101" - ], "pool": [ - "120009", - "120101", - "120102", - "120103" + { + "Id": "120009", + "weight": 500, + "score": 1, + "effectType": 1 + }, + { + "Id": "120101", + "weight": 200, + "score": 10, + "effectType": 1 + }, + { + "Id": "120102", + "weight": 200, + "score": -5, + "effectType": 2 + }, + { + "Id": "120103", + "weight": 100, + "score": 100, + "effectType": 3 + } ], "material": [ { "a": "item", - "t": "10010", + "t": "120101", "n": 1 } ], @@ -517,24 +739,46 @@ }, "type": 3, "quality": 3, - "SlitCount": 30, - "countdown": 30, - "generateInterval": 300, + "normalScore": 30, + "highScore": 50, + "countdown": [ + 50 + ], + "generateInterval": [ + 300 + ], "flyMinTime": 5, "flyMaxTime": 15, - "needSplit": [ - "120102" - ], "pool": [ - "120009", - "120101", - "120102", - "120103" + { + "Id": "120009", + "weight": 500, + "score": 1, + "effectType": 1 + }, + { + "Id": "120101", + "weight": 200, + "score": 10, + "effectType": 1 + }, + { + "Id": "120102", + "weight": 200, + "score": -5, + "effectType": 2 + }, + { + "Id": "120103", + "weight": 100, + "score": 100, + "effectType": 3 + } ], "material": [ { "a": "item", - "t": "10011", + "t": "120102", "n": 1 } ], @@ -568,24 +812,46 @@ }, "type": 4, "quality": 3, - "SlitCount": 30, - "countdown": 30, - "generateInterval": 300, + "normalScore": 30, + "highScore": 50, + "countdown": [ + 50 + ], + "generateInterval": [ + 300 + ], "flyMinTime": 5, "flyMaxTime": 15, - "needSplit": [ - "120103" - ], "pool": [ - "120009", - "120101", - "120102", - "120103" + { + "Id": "120009", + "weight": 500, + "score": 1, + "effectType": 1 + }, + { + "Id": "120101", + "weight": 200, + "score": 10, + "effectType": 1 + }, + { + "Id": "120102", + "weight": 200, + "score": -5, + "effectType": 2 + }, + { + "Id": "120103", + "weight": 100, + "score": 100, + "effectType": 3 + } ], "material": [ { "a": "item", - "t": "10012", + "t": "120103", "n": 1 } ], diff --git a/modules/items/api_potionsynthesis.go b/modules/items/api_potionsynthesis.go index 09382b810..027d482ba 100644 --- a/modules/items/api_potionsynthesis.go +++ b/modules/items/api_potionsynthesis.go @@ -38,7 +38,7 @@ func (this *apiComp) PotionSynthesis(session comm.IUserSession, req *pb.ItemsPot return } give = make([]*cfg.Gameatn, 0) - if req.Succnum <= 30 { + if req.Succnum <= configure.NormalScore { for _, v := range configure.LowYield { give = append(give, &cfg.Gameatn{ A: v.A, @@ -46,7 +46,7 @@ func (this *apiComp) PotionSynthesis(session comm.IUserSession, req *pb.ItemsPot N: v.N * req.Num, }) } - } else if req.Succnum <= 60 { + } else if req.Succnum < configure.HighScore { for _, v := range configure.StandardYield { give = append(give, &cfg.Gameatn{ A: v.A, diff --git a/sys/configure/structs/Game.PotionsData.go b/sys/configure/structs/Game.PotionsData.go index f9377d1d6..fd7d6606b 100644 --- a/sys/configure/structs/Game.PotionsData.go +++ b/sys/configure/structs/Game.PotionsData.go @@ -15,13 +15,13 @@ type GamePotionsData struct { Describe string Type int32 Quality int32 - SlitCount int32 - Countdown int32 - GenerateInterval int32 + NormalScore int32 + HighScore int32 + Countdown []int32 + GenerateInterval []int32 FlyMinTime float32 FlyMaxTime float32 - NeedSplit []string - Pool []string + Pool []*GamePotionFly Material []*Gameatn StandardYield []*Gameatn LowYield []*Gameatn @@ -39,35 +39,48 @@ func (_v *GamePotionsData)Deserialize(_buf map[string]interface{}) (err error) { {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["describe"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Describe error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Describe, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["quality"].(float64); !_ok_ { err = errors.New("quality error"); return }; _v.Quality = int32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["SlitCount"].(float64); !_ok_ { err = errors.New("SlitCount error"); return }; _v.SlitCount = int32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["countdown"].(float64); !_ok_ { err = errors.New("countdown error"); return }; _v.Countdown = int32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["generateInterval"].(float64); !_ok_ { err = errors.New("generateInterval error"); return }; _v.GenerateInterval = int32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["flyMinTime"].(float64); !_ok_ { err = errors.New("flyMinTime error"); return }; _v.FlyMinTime = float32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["flyMaxTime"].(float64); !_ok_ { err = errors.New("flyMaxTime error"); return }; _v.FlyMaxTime = float32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["normalScore"].(float64); !_ok_ { err = errors.New("normalScore error"); return }; _v.NormalScore = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["highScore"].(float64); !_ok_ { err = errors.New("highScore error"); return }; _v.HighScore = int32(_tempNum_) } { var _arr_ []interface{} var _ok_ bool - if _arr_, _ok_ = _buf["needSplit"].([]interface{}); !_ok_ { err = errors.New("needSplit error"); return } + if _arr_, _ok_ = _buf["countdown"].([]interface{}); !_ok_ { err = errors.New("countdown error"); return } - _v.NeedSplit = make([]string, 0, len(_arr_)) + _v.Countdown = make([]int32, 0, len(_arr_)) for _, _e_ := range _arr_ { - var _list_v_ string - { if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } } - _v.NeedSplit = append(_v.NeedSplit, _list_v_) + var _list_v_ int32 + { var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) } + _v.Countdown = append(_v.Countdown, _list_v_) } } { var _arr_ []interface{} var _ok_ bool - if _arr_, _ok_ = _buf["pool"].([]interface{}); !_ok_ { err = errors.New("pool error"); return } + if _arr_, _ok_ = _buf["generateInterval"].([]interface{}); !_ok_ { err = errors.New("generateInterval error"); return } - _v.Pool = make([]string, 0, len(_arr_)) + _v.GenerateInterval = make([]int32, 0, len(_arr_)) for _, _e_ := range _arr_ { - var _list_v_ string - { if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } } + var _list_v_ int32 + { var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) } + _v.GenerateInterval = append(_v.GenerateInterval, _list_v_) + } + } + + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["flyMinTime"].(float64); !_ok_ { err = errors.New("flyMinTime error"); return }; _v.FlyMinTime = float32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["flyMaxTime"].(float64); !_ok_ { err = errors.New("flyMaxTime error"); return }; _v.FlyMaxTime = float32(_tempNum_) } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["pool"].([]interface{}); !_ok_ { err = errors.New("pool error"); return } + + _v.Pool = make([]*GamePotionFly, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ *GamePotionFly + { 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 = DeserializeGamePotionFly(_x_); err != nil { return } } _v.Pool = append(_v.Pool, _list_v_) } }