随机机器人宠物技能等级

This commit is contained in:
by 2024-07-23 15:11:00 +08:00
parent b6477c60ef
commit 1322a09297
2 changed files with 28 additions and 25 deletions

View File

@ -317,32 +317,9 @@ func (this *Player) OnLogined() {
this.dirty = true
}
} else {
this.VIP = rand.Int31n(6) + 1
this.VIP = rand.Int31n(16) + 1
//机器人随机vip和头像
this.RobRandVip()
//随机机器人宠物技能等级
if this.Pets.SkillInfo == nil {
this.Pets.SkillInfo = make(map[int32]map[int32]int32)
for petId, _ := range this.Pets.ModUnlock {
skillLevel := int32(0)
if this.VIP < 1 {
skillLevel = rand.Int31n(2)
} else if this.VIP >= 1 && this.VIP <= 3 {
skillLevel = rand.Int31n(3) + 1
} else if this.VIP >= 4 && this.VIP <= 6 {
skillLevel = rand.Int31n(4) + 2
} else if this.VIP >= 7 && this.VIP <= 9 {
skillLevel = rand.Int31n(4) + 3
} else if this.VIP >= 10 && this.VIP <= 12 {
skillLevel = rand.Int31n(5) + 4
} else if this.VIP >= 13 && this.VIP <= 16 {
skillLevel = rand.Int31n(6) + 5
}
this.Pets.SkillInfo[petId] = make(map[int32]int32)
this.Pets.SkillInfo[petId][10001] = skillLevel
}
}
}
this.VipExtra = VipMgrSington.GetVipPointsExtra(this.Platform, this.VIP)
@ -4362,6 +4339,31 @@ func (this *Player) RandRobotVip(scene *Scene) {
this.VIP = int32(vip)
}
func (this *Player) RandRobotPetSkillLevel() {
//随机机器人宠物技能等级
if this.Pets.SkillInfo == nil {
this.Pets.SkillInfo = make(map[int32]map[int32]int32)
for petId, _ := range this.Pets.ModUnlock {
skillLevel := int32(0)
if this.VIP < 1 {
skillLevel = rand.Int31n(2)
} else if this.VIP >= 1 && this.VIP <= 3 {
skillLevel = rand.Int31n(3) + 1
} else if this.VIP >= 4 && this.VIP <= 6 {
skillLevel = rand.Int31n(4) + 2
} else if this.VIP >= 7 && this.VIP <= 9 {
skillLevel = rand.Int31n(4) + 3
} else if this.VIP >= 10 && this.VIP <= 12 {
skillLevel = rand.Int31n(5) + 4
} else if this.VIP >= 13 && this.VIP <= 16 {
skillLevel = rand.Int31n(6) + 5
}
this.Pets.SkillInfo[petId] = make(map[int32]int32)
this.Pets.SkillInfo[petId][10001] = skillLevel
}
}
}
// BindTelReward 发送绑定手机号奖励
func (this *Player) BindTelReward() {
// todo 奖励限额ip日期最多赠送多少奖励

View File

@ -451,7 +451,8 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
this.robotNum++
p.RobotRandName()
p.RandRobotVip(this)
//随机机器人宠物技能等级
p.RandRobotPetSkillLevel()
name := this.GetSceneName()
logger.Logger.Tracef("(this *Scene) PlayerEnter(%v) robot(%v) robotlimit(%v)", name, this.robotNum, this.robotLimit)
}