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.

47 lines
955 B

package lottery
import (
"GenshinImpact/global"
"math/rand"
)
// 5星
func RandomEpicWeapon() string {
global.LastEpicWeapon = 0
global.LastRareWeapon = 0
if global.LastEpicCommonWeapon == true {
//当期upWeapon
return RandomEpicUpWeapon()
}
diceUp := rand.Intn(100)
//up5占5星出货75%
if diceUp <= 74 {
//当期upWeapon
return RandomEpicUpWeapon()
}
return RandomEpicCommonWeapon()
}
// UP5星Weapon
func RandomEpicUpWeapon() string {
global.LastEpicCommonWeapon = false
if global.WeaponTargetSwitch {
if global.WeaponTargetCount == 2 {
global.WeaponTargetCount = 0
return global.WeaponTarget
}
global.WeaponTargetCount += 1
}
return RandomStr(global.UpEpicWeapon)
}
// 常驻5星Weapon
func RandomEpicCommonWeapon() string {
global.LastEpicCommonWeapon = true
if global.WeaponTargetSwitch && global.WeaponTargetCount < 2 {
global.WeaponTargetCount += 1
}
return RandomStr(global.EpicCommonWeaponPool)
}