抽出5星英雄后A次抽奖内不会再抽到5星英雄(普通卡池+阵营卡池)
This commit is contained in:
parent
024609c29b
commit
fc006b4441
@ -11,7 +11,6 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
game_gourmet = "game_gourmet.json"
|
game_gourmet = "game_gourmet.json"
|
||||||
game_gourmetskill = "game_gourmetskill.json"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
///配置管理基础组件
|
///配置管理基础组件
|
||||||
|
@ -457,6 +457,58 @@ func (this *Hero) NoLoginDay(uid string, day int32) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 连续抽卡最多连续出A个相同阵营的英雄(普通卡池)
|
||||||
|
/*
|
||||||
|
heroCid 抽到的5星英雄ID
|
||||||
|
drawCount 当前抽卡次数
|
||||||
|
poll 当前卡池
|
||||||
|
返回值 newCid不满足抽卡要求替换其他5星英雄
|
||||||
|
*/
|
||||||
|
func (this *Hero) ContinuousRestriction(uid string, heroCid string, drawCount int32, pool string) (newCid string) {
|
||||||
|
var (
|
||||||
|
update map[string]interface{}
|
||||||
|
)
|
||||||
|
record, err := this.modelRecord.GetHeroRecord(uid)
|
||||||
|
if err != nil {
|
||||||
|
return heroCid
|
||||||
|
}
|
||||||
|
for heroid, index := range record.Star5Hero {
|
||||||
|
if heroid == heroCid {
|
||||||
|
conf := this.configure.GetGlobalConf() //.
|
||||||
|
iMaxCOunt := conf.DrawCardContinuousRestrictionStar5
|
||||||
|
if drawCount-index <= iMaxCOunt { // 连续n次还获得该英雄 直接替换其他英雄
|
||||||
|
|
||||||
|
_data := this.configure.GetPollByType(pool)
|
||||||
|
if _data == nil {
|
||||||
|
|
||||||
|
return heroCid
|
||||||
|
}
|
||||||
|
sz := make([]int32, 0)
|
||||||
|
for _, v := range _data[5] {
|
||||||
|
sz = append(sz, v.Weight)
|
||||||
|
}
|
||||||
|
//randomIndex := this.modelHero.GetRandW(sz)
|
||||||
|
for i := 0; i < len(_data[5]); i++ {
|
||||||
|
if v, ok := _data[5]; ok {
|
||||||
|
if int32(len(v)) > int32(i) {
|
||||||
|
newCid = v[i].Id
|
||||||
|
if newCid == heroid {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
record.Star5Hero[heroid] = drawCount
|
||||||
|
update["star5Hero"] = record.Star5Hero
|
||||||
|
this.modelRecord.ChangeHeroRecord(uid, update) // 更新信息
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return heroCid
|
||||||
|
}
|
||||||
|
|
||||||
// 检查充值和未登录天数之内抽卡是否抽中
|
// 检查充值和未登录天数之内抽卡是否抽中
|
||||||
func (this *Hero) CheckCondition(uid string) bool {
|
func (this *Hero) CheckCondition(uid string) bool {
|
||||||
var (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user