You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
673 B
34 lines
673 B
package lottery
|
|
|
|
import (
|
|
"GenshinImpact/global"
|
|
"math/rand"
|
|
)
|
|
|
|
// 5星
|
|
func RandomEpic() string {
|
|
global.LastEpic = 0
|
|
global.LastRare = 0
|
|
if global.LastEpicCommon == true {
|
|
global.LastEpicCommon = false
|
|
return RandomEpicUPCharator()
|
|
}
|
|
diceUp := rand.Intn(10)
|
|
if diceUp <= 4 {
|
|
return RandomEpicUPCharator()
|
|
}
|
|
return RandomEpicCommonCharactor()
|
|
}
|
|
|
|
// 常驻5星角色
|
|
func RandomEpicCommonCharactor() string {
|
|
global.LastEpicCommon = true
|
|
epicCommonCharactorPool := global.EpicCommonCharactorPool
|
|
return epicCommonCharactorPool[rand.Intn(len(epicCommonCharactorPool))]
|
|
}
|
|
|
|
// 当期up角色
|
|
func RandomEpicUPCharator() string {
|
|
return global.UpEpicChar
|
|
}
|