上传 代码

This commit is contained in:
liwei1dao 2023-04-01 17:24:33 +08:00
parent 4cda2451d6
commit f38c9f106c
3 changed files with 432 additions and 153 deletions

View File

@ -7,24 +7,48 @@
}, },
"type": 1, "type": 1,
"quality": 1, "quality": 1,
"SlitCount": 10, "normalScore": 10,
"countdown": 30, "highScore": 30,
"generateInterval": 300, "countdown": [
30,
35,
40
],
"generateInterval": [
300
],
"flyMinTime": 5, "flyMinTime": 5,
"flyMaxTime": 15, "flyMaxTime": 15,
"needSplit": [
"120001"
],
"pool": [ "pool": [
"120001", {
"120002", "Id": "120001",
"120003", "weight": 500,
"120004" "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": [ "material": [
{ {
"a": "item", "a": "item",
"t": "10001", "t": "120001",
"n": 1 "n": 1
} }
], ],
@ -58,24 +82,46 @@
}, },
"type": 2, "type": 2,
"quality": 1, "quality": 1,
"SlitCount": 10, "normalScore": 10,
"countdown": 30, "highScore": 30,
"generateInterval": 300, "countdown": [
30
],
"generateInterval": [
300
],
"flyMinTime": 5, "flyMinTime": 5,
"flyMaxTime": 15, "flyMaxTime": 15,
"needSplit": [
"120002"
],
"pool": [ "pool": [
"120001", {
"120002", "Id": "120001",
"120003", "weight": 500,
"120004" "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": [ "material": [
{ {
"a": "item", "a": "item",
"t": "10002", "t": "120002",
"n": 1 "n": 1
} }
], ],
@ -109,24 +155,46 @@
}, },
"type": 3, "type": 3,
"quality": 1, "quality": 1,
"SlitCount": 10, "normalScore": 10,
"countdown": 30, "highScore": 30,
"generateInterval": 300, "countdown": [
30
],
"generateInterval": [
300
],
"flyMinTime": 5, "flyMinTime": 5,
"flyMaxTime": 15, "flyMaxTime": 15,
"needSplit": [
"120003"
],
"pool": [ "pool": [
"120001", {
"120002", "Id": "120001",
"120003", "weight": 500,
"120004" "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": [ "material": [
{ {
"a": "item", "a": "item",
"t": "10003", "t": "120003",
"n": 1 "n": 1
} }
], ],
@ -160,24 +228,46 @@
}, },
"type": 4, "type": 4,
"quality": 1, "quality": 1,
"SlitCount": 10, "normalScore": 10,
"countdown": 30, "highScore": 30,
"generateInterval": 300, "countdown": [
30
],
"generateInterval": [
300
],
"flyMinTime": 5, "flyMinTime": 5,
"flyMaxTime": 15, "flyMaxTime": 15,
"needSplit": [
"120004"
],
"pool": [ "pool": [
"120001", {
"120002", "Id": "120001",
"120003", "weight": 500,
"120004" "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": [ "material": [
{ {
"a": "item", "a": "item",
"t": "10004", "t": "120004",
"n": 1 "n": 1
} }
], ],
@ -211,24 +301,46 @@
}, },
"type": 1, "type": 1,
"quality": 2, "quality": 2,
"SlitCount": 20, "normalScore": 20,
"countdown": 30, "highScore": 40,
"generateInterval": 300, "countdown": [
40
],
"generateInterval": [
300
],
"flyMinTime": 5, "flyMinTime": 5,
"flyMaxTime": 15, "flyMaxTime": 15,
"needSplit": [
"120005"
],
"pool": [ "pool": [
"120005", {
"120006", "Id": "120005",
"120007", "weight": 500,
"120008" "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": [ "material": [
{ {
"a": "item", "a": "item",
"t": "10005", "t": "120005",
"n": 1 "n": 1
} }
], ],
@ -262,24 +374,46 @@
}, },
"type": 2, "type": 2,
"quality": 2, "quality": 2,
"SlitCount": 20, "normalScore": 20,
"countdown": 30, "highScore": 40,
"generateInterval": 300, "countdown": [
40
],
"generateInterval": [
300
],
"flyMinTime": 5, "flyMinTime": 5,
"flyMaxTime": 15, "flyMaxTime": 15,
"needSplit": [
"120006"
],
"pool": [ "pool": [
"120005", {
"120006", "Id": "120005",
"120007", "weight": 500,
"120008" "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": [ "material": [
{ {
"a": "item", "a": "item",
"t": "10006", "t": "120006",
"n": 1 "n": 1
} }
], ],
@ -313,24 +447,46 @@
}, },
"type": 3, "type": 3,
"quality": 2, "quality": 2,
"SlitCount": 20, "normalScore": 20,
"countdown": 30, "highScore": 40,
"generateInterval": 300, "countdown": [
40
],
"generateInterval": [
300
],
"flyMinTime": 5, "flyMinTime": 5,
"flyMaxTime": 15, "flyMaxTime": 15,
"needSplit": [
"120007"
],
"pool": [ "pool": [
"120005", {
"120006", "Id": "120005",
"120007", "weight": 500,
"120008" "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": [ "material": [
{ {
"a": "item", "a": "item",
"t": "10007", "t": "120007",
"n": 1 "n": 1
} }
], ],
@ -364,24 +520,46 @@
}, },
"type": 4, "type": 4,
"quality": 2, "quality": 2,
"SlitCount": 20, "normalScore": 20,
"countdown": 30, "highScore": 40,
"generateInterval": 300, "countdown": [
40
],
"generateInterval": [
300
],
"flyMinTime": 5, "flyMinTime": 5,
"flyMaxTime": 15, "flyMaxTime": 15,
"needSplit": [
"120008"
],
"pool": [ "pool": [
"120005", {
"120006", "Id": "120005",
"120007", "weight": 500,
"120008" "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": [ "material": [
{ {
"a": "item", "a": "item",
"t": "10008", "t": "120008",
"n": 1 "n": 1
} }
], ],
@ -415,24 +593,46 @@
}, },
"type": 1, "type": 1,
"quality": 3, "quality": 3,
"SlitCount": 30, "normalScore": 30,
"countdown": 30, "highScore": 50,
"generateInterval": 300, "countdown": [
50
],
"generateInterval": [
300
],
"flyMinTime": 5, "flyMinTime": 5,
"flyMaxTime": 15, "flyMaxTime": 15,
"needSplit": [
"120009"
],
"pool": [ "pool": [
"120009", {
"120101", "Id": "120009",
"120102", "weight": 500,
"120103" "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": [ "material": [
{ {
"a": "item", "a": "item",
"t": "10009", "t": "120009",
"n": 1 "n": 1
} }
], ],
@ -466,24 +666,46 @@
}, },
"type": 2, "type": 2,
"quality": 3, "quality": 3,
"SlitCount": 30, "normalScore": 30,
"countdown": 30, "highScore": 50,
"generateInterval": 300, "countdown": [
50
],
"generateInterval": [
300
],
"flyMinTime": 5, "flyMinTime": 5,
"flyMaxTime": 15, "flyMaxTime": 15,
"needSplit": [
"120101"
],
"pool": [ "pool": [
"120009", {
"120101", "Id": "120009",
"120102", "weight": 500,
"120103" "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": [ "material": [
{ {
"a": "item", "a": "item",
"t": "10010", "t": "120101",
"n": 1 "n": 1
} }
], ],
@ -517,24 +739,46 @@
}, },
"type": 3, "type": 3,
"quality": 3, "quality": 3,
"SlitCount": 30, "normalScore": 30,
"countdown": 30, "highScore": 50,
"generateInterval": 300, "countdown": [
50
],
"generateInterval": [
300
],
"flyMinTime": 5, "flyMinTime": 5,
"flyMaxTime": 15, "flyMaxTime": 15,
"needSplit": [
"120102"
],
"pool": [ "pool": [
"120009", {
"120101", "Id": "120009",
"120102", "weight": 500,
"120103" "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": [ "material": [
{ {
"a": "item", "a": "item",
"t": "10011", "t": "120102",
"n": 1 "n": 1
} }
], ],
@ -568,24 +812,46 @@
}, },
"type": 4, "type": 4,
"quality": 3, "quality": 3,
"SlitCount": 30, "normalScore": 30,
"countdown": 30, "highScore": 50,
"generateInterval": 300, "countdown": [
50
],
"generateInterval": [
300
],
"flyMinTime": 5, "flyMinTime": 5,
"flyMaxTime": 15, "flyMaxTime": 15,
"needSplit": [
"120103"
],
"pool": [ "pool": [
"120009", {
"120101", "Id": "120009",
"120102", "weight": 500,
"120103" "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": [ "material": [
{ {
"a": "item", "a": "item",
"t": "10012", "t": "120103",
"n": 1 "n": 1
} }
], ],

View File

@ -38,7 +38,7 @@ func (this *apiComp) PotionSynthesis(session comm.IUserSession, req *pb.ItemsPot
return return
} }
give = make([]*cfg.Gameatn, 0) give = make([]*cfg.Gameatn, 0)
if req.Succnum <= 30 { if req.Succnum <= configure.NormalScore {
for _, v := range configure.LowYield { for _, v := range configure.LowYield {
give = append(give, &cfg.Gameatn{ give = append(give, &cfg.Gameatn{
A: v.A, A: v.A,
@ -46,7 +46,7 @@ func (this *apiComp) PotionSynthesis(session comm.IUserSession, req *pb.ItemsPot
N: v.N * req.Num, N: v.N * req.Num,
}) })
} }
} else if req.Succnum <= 60 { } else if req.Succnum < configure.HighScore {
for _, v := range configure.StandardYield { for _, v := range configure.StandardYield {
give = append(give, &cfg.Gameatn{ give = append(give, &cfg.Gameatn{
A: v.A, A: v.A,

View File

@ -15,13 +15,13 @@ type GamePotionsData struct {
Describe string Describe string
Type int32 Type int32
Quality int32 Quality int32
SlitCount int32 NormalScore int32
Countdown int32 HighScore int32
GenerateInterval int32 Countdown []int32
GenerateInterval []int32
FlyMinTime float32 FlyMinTime float32
FlyMaxTime float32 FlyMaxTime float32
NeedSplit []string Pool []*GamePotionFly
Pool []string
Material []*Gameatn Material []*Gameatn
StandardYield []*Gameatn StandardYield []*Gameatn
LowYield []*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 __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["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["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["normalScore"].(float64); !_ok_ { err = errors.New("normalScore error"); return }; _v.NormalScore = 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["highScore"].(float64); !_ok_ { err = errors.New("highScore error"); return }; _v.HighScore = 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 _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["countdown"].([]interface{}); !_ok_ { err = errors.New("countdown error"); return }
_v.Countdown = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
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["generateInterval"].([]interface{}); !_ok_ { err = errors.New("generateInterval error"); return }
_v.GenerateInterval = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
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["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["flyMaxTime"].(float64); !_ok_ { err = errors.New("flyMaxTime error"); return }; _v.FlyMaxTime = float32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["needSplit"].([]interface{}); !_ok_ { err = errors.New("needSplit error"); return }
_v.NeedSplit = make([]string, 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 _arr_ []interface{} var _arr_ []interface{}
var _ok_ bool var _ok_ bool
if _arr_, _ok_ = _buf["pool"].([]interface{}); !_ok_ { err = errors.New("pool error"); return } if _arr_, _ok_ = _buf["pool"].([]interface{}); !_ok_ { err = errors.New("pool error"); return }
_v.Pool = make([]string, 0, len(_arr_)) _v.Pool = make([]*GamePotionFly, 0, len(_arr_))
for _, _e_ := range _arr_ { for _, _e_ := range _arr_ {
var _list_v_ string var _list_v_ *GamePotionFly
{ if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } } { 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_) _v.Pool = append(_v.Pool, _list_v_)
} }
} }