This commit is contained in:
wh_zcy 2022-11-22 19:12:00 +08:00
commit a01024a991
6 changed files with 64 additions and 1 deletions

View File

@ -83,6 +83,7 @@ type (
//拥有觉醒至A级的B星英雄N个 Rtype123
CheckJuexingHeroNum(uid string, juexingLv int32, star int32) int32
//拥有共鸣至N级的英雄 Rtype124
CheckResonaceHeroNum(uid string, resonaceLv int32) int32
}
//玩家
@ -302,4 +303,10 @@ type (
///红点
IReddot
}
ILibrary interface {
//与N个英雄好感度等级达到A
CheckRtype132(uid string, num int32, lv int32) bool
//与指定英雄好感度等级达到N
CheckRtype133(uid string, heroId string, lv int32) bool
}
)

View File

@ -149,6 +149,7 @@ func (this *modelGourmet) CalculationGourmet(uid string, gourmet *pb.DBGourmet)
mapData["cookingFood"] = gourmet.CookingFood // 正在做的
this.module.ModifyGourmetData(uid, mapData) // 同步数据
}
// 技能等级提高了 重新计算订单时间(只对订单中数据有影响)

View File

@ -4,6 +4,7 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
"google.golang.org/protobuf/proto"
)
@ -150,10 +151,12 @@ func (this *apiComp) Resonance(session comm.IUserSession, req *pb.HeroResonanceR
// 任务相关
this.module.ModuleRtask.SendToRtask(session, comm.Rtype39, 1)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype127, _hero.Star, utils.ToInt32(_hero.HeroID), _hero.ResonateNum) //A星英雄共鸣N级
this.module.ModuleRtask.SendToRtask(session, comm.Rtype40, 1, 1)
cfg := this.module.configure.GetHeroConfig(_hero.HeroID)
if cfg != nil {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, _hero.JuexingLv)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype126, cfg.Race, _hero.ResonateNum)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, _hero.ResonateNum)
//xx英雄满级、共鸣、觉醒至最高状态
nextAwaken := this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1)
if nextAwaken == nil { // 达到满级觉醒

View File

@ -591,3 +591,14 @@ func (this *Hero) CheckJuexingHeroNum(uid string, juexingLv int32, star int32) i
}
return int32(len(tmp))
}
//拥有共鸣至N级的英雄
func (this *Hero) CheckResonaceHeroNum(uid string, resonaceLv int32) int32 {
tmp := make([]*pb.DBHero, 0)
for _, v := range this.modelHero.getHeroList(uid) {
if v.ResonateNum >= resonaceLv {
tmp = append(tmp, v)
}
}
return int32(len(tmp))
}

View File

@ -4,6 +4,7 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
"google.golang.org/protobuf/proto"
)
@ -22,6 +23,7 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
totalExp int32
curStar int32 // 配置表星级
maxLv int32 // 羁绊最大等级
upLv int32
)
code = this.UseGiftCheck(session, req)
if code != pb.ErrorCode_Success {
@ -76,6 +78,7 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
if favorConf[_heroObj.Favorlv] <= _heroObj.Favorexp {
_heroObj.Favorexp -= favorConf[_heroObj.Favorlv]
_heroObj.Favorlv += 1
upLv++
} else {
break
}
@ -91,5 +94,11 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
rsp.Data = _heroObj
session.SendMsg(string(this.module.GetType()), LibraryUseGiftResp, rsp)
// 任务统计
//赠送英雄礼物并增加N点好感度
if upLv > 0 {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv)
}
return
}

View File

@ -240,3 +240,35 @@ func (this *Library) Rpc_ModuleFetter(ctx context.Context, args *pb.RPCGeneralRe
}
return
}
//与N个英雄好感度等级达到A
func (this *Library) CheckRtype132(uid string, num int32, lv int32) bool {
fetter := this.GetHeroFetterList(uid)
if len(fetter) == 0 {
return false
}
for _, v := range fetter {
if v.Favorlv >= lv {
num--
}
}
if num >= 0 {
return true
}
return false
}
//与指定英雄好感度等级达到N
func (this *Library) CheckRtype133(uid string, heroId string, lv int32) bool {
fetter := this.GetHeroFetterList(uid)
if len(fetter) == 0 {
return false
}
for _, v := range fetter {
if v.Heroid == heroId && v.Favorlv >= lv {
return true
}
}
return false
}