This commit is contained in:
liwei1dao 2022-11-22 13:57:17 +08:00
commit 3f40324d22
10 changed files with 200 additions and 158 deletions

View File

@ -306,10 +306,10 @@ const (
type ReddotType int32 type ReddotType int32
const ( const (
Reddot1 ReddotType = 10001 //任务----日常活跃宝箱红点 Reddot1 ReddotType = 10001 //任务----日常任务奖励红点
Reddot2 ReddotType = 10002 //任务----周活跃宝箱红点 Reddot2 ReddotType = 10002 //任务----周常任务奖励红点
Reddot3 ReddotType = 10003 //公会----签到红点 Reddot3 ReddotType = 10003 //公会----签到红点
Reddot4 ReddotType = 10004 //任务----成就奖励红点 Reddot4 ReddotType = 10004 //任务----成就任务奖励红点
Reddot5 ReddotType = 10005 //主线关卡----可挑战红点 Reddot5 ReddotType = 10005 //主线关卡----可挑战红点
Reddot6 ReddotType = 10006 //爬塔----可挑战红点 Reddot6 ReddotType = 10006 //爬塔----可挑战红点
Reddot7 ReddotType = 10007 //爬塔----奖励红点 Reddot7 ReddotType = 10007 //爬塔----奖励红点
@ -332,9 +332,9 @@ const (
Reddot24 ReddotType = 10024 //熊猫武馆----可升级红点 Reddot24 ReddotType = 10024 //熊猫武馆----可升级红点
Reddot25 ReddotType = 10025 //熊猫武馆----可领取奖励红点 Reddot25 ReddotType = 10025 //熊猫武馆----可领取奖励红点
Reddot26 ReddotType = 10026 //邮件-----附件红点 Reddot26 ReddotType = 10026 //邮件-----附件红点
Reddot27 ReddotType = 10027 //公会----任务完成红点 Reddot27 ReddotType = 10027 //任务----日常活跃奖励红点
Reddot28 ReddotType = 10028 //公会----进度奖励红点 Reddot28 ReddotType = 10028 //任务----周常活跃奖励红点
Reddot29 ReddotType = 10029 //任务----周常任务完成红点 Reddot29 ReddotType = 10029 //公会----申请红点
Reddot30 ReddotType = 10030 //邮件-----未读邮件红点 Reddot30 ReddotType = 10030 //邮件-----未读邮件红点
) )
@ -497,7 +497,7 @@ const (
Rtype137 TaskType = 137 //累计铁匠铺锻造X小时历史(从创号开始记录满1小时进度+1) Rtype137 TaskType = 137 //累计铁匠铺锻造X小时历史(从创号开始记录满1小时进度+1)
Rtype138 TaskType = 138 //在线N分钟(从接到任务开始,记录玩家在线时间并记入进度) Rtype138 TaskType = 138 //在线N分钟(从接到任务开始,记录玩家在线时间并记入进度)
Rtype139 TaskType = 139 //通过融合获得指定英雄(从接到任务开始记录,通过融合获得指定英雄则任务完成) Rtype139 TaskType = 139 //通过融合获得指定英雄(从接到任务开始记录,通过融合获得指定英雄则任务完成)
Rtype140 TaskType = 140 //关卡编辑器完成条件
) )
const ( const (

View File

@ -11,6 +11,7 @@ import (
"go_dreamfactory/lego/utils/codec/json" "go_dreamfactory/lego/utils/codec/json"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
"time" "time"
"google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/anypb"
@ -226,7 +227,7 @@ func (this *Chat) SendSysChatToWorld(ctype comm.ChatSystemType, appenddata inter
Channel: pb.ChatChannel_System, Channel: pb.ChatChannel_System,
Ctype: pb.ChatType_Text, Ctype: pb.ChatType_Text,
Stag: this.service.GetTag(), Stag: this.service.GetTag(),
Ctime: time.Now().Unix(), Ctime: configure.Now().Unix(),
Content: fmt.Sprintf(st.Text, agrs...), Content: fmt.Sprintf(st.Text, agrs...),
Display: st.Display, Display: st.Display,
} }

View File

@ -67,6 +67,10 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
_hero.SameCount = 1 _hero.SameCount = 1
_hero.IsOverlying = false _hero.IsOverlying = false
// 加属性 awakenData // 加属性 awakenData
if len(awakenData.Phasebonus) != 2 {
code = pb.ErrorCode_ConfigNoFound
return
}
_value, ok := strconv.Atoi(awakenData.Phasebonus[0]) _value, ok := strconv.Atoi(awakenData.Phasebonus[0])
if ok == nil { // 升级技能 if ok == nil { // 升级技能
for pos, v := range _hero.NormalSkill { for pos, v := range _hero.NormalSkill {
@ -81,10 +85,12 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
} else { // 加属性 } else { // 加属性
value, err := strconv.Atoi(awakenData.Phasebonus[1]) value, err := strconv.Atoi(awakenData.Phasebonus[1])
if err == nil { if err == nil {
if value > 0 {
this.module.modelHero.setJuexingProperty(_hero, awakenData.Phasebonus[0], int32(value)) this.module.modelHero.setJuexingProperty(_hero, awakenData.Phasebonus[0], int32(value))
_heroMap["juexProperty"] = _hero.JuexProperty _heroMap["juexProperty"] = _hero.JuexProperty
} }
} }
}
_hero.JuexingLv += 1 _hero.JuexingLv += 1
_heroMap["juexingLv"] = _hero.JuexingLv _heroMap["juexingLv"] = _hero.JuexingLv
// 保存数据 // 保存数据

View File

@ -264,7 +264,7 @@ func (this *ModelHero) setJuexingProperty(hero *pb.DBHero, key string, value int
case comm.ResonanceAtkPro: case comm.ResonanceAtkPro:
hero.JuexProperty[comm.Atk] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Atk]))) hero.JuexProperty[comm.Atk] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Atk])))
case comm.ResonanceDefPro: case comm.ResonanceDefPro:
hero.JuexProperty[comm.Def] += int32(math.Floor((float64(value) / 1000)) * float64(hero.Property[comm.Def])) hero.JuexProperty[comm.Def] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Def])))
} }
} }

View File

@ -139,7 +139,7 @@ func (this *apiComp) Useitem(session comm.IUserSession, req *pb.ItemsUseItemReq)
N: v.N * int32(req.Amount), N: v.N * int32(req.Amount),
}) })
} }
if code = this.module.ConsumeRes(session, itemcf.SynthetizeDeplete, true); code != pb.ErrorCode_Success { if code = this.module.ConsumeRes(session, sale, true); code != pb.ErrorCode_Success {
return return
} }

View File

@ -47,6 +47,7 @@ func (this *apiComp) Battle(session comm.IUserSession, req *pb.MoonfantasyBattle
Buleflist: record.Buleflist, Buleflist: record.Buleflist,
}, },
}) })
this.module.ModuleRtask.SendToRtask(session, comm.Rtype88, 1)
} else { } else {
session.SendMsg(string(this.module.GetType()), "battle", &pb.MoonfantasyBattleResp{Code: cd}) session.SendMsg(string(this.module.GetType()), "battle", &pb.MoonfantasyBattleResp{Code: cd})
} }

View File

@ -127,12 +127,14 @@ func (this *modelDreamComp) trigger(session comm.IUserSession) {
Avatar: user.Avatar, Avatar: user.Avatar,
Uname: user.Name, Uname: user.Name,
Slv: user.Lv, Slv: user.Lv,
Ctime: configure.Now().Unix(),
Stag: session.GetServiecTag(), Stag: session.GetServiecTag(),
Content: mdata.Monster, Content: mdata.Monster,
AppendStr: mdata.Id, AppendStr: mdata.Id,
} }
this.module.modelDream.noticeuserfriend(session, mdata.Id, chat) this.module.modelDream.noticeuserfriend(session, mdata.Id, chat)
session.SendMsg(string(this.module.GetType()), "trigger", &pb.MoonfantasyTriggerPush{Issucc: true, Mid: mdata.Id, Monster: mdata.Monster}) session.SendMsg(string(this.module.GetType()), "trigger", &pb.MoonfantasyTriggerPush{Issucc: true, Mid: mdata.Id, Monster: mdata.Monster})
this.module.ModuleRtask.SendToRtask(session, comm.Rtype87, 1)
return return
} }

View File

@ -123,7 +123,19 @@ func (this *Sociaty) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (
reddot = make(map[comm.ReddotType]bool) reddot = make(map[comm.ReddotType]bool)
sociaty := this.modelSociaty.getUserSociaty(session.GetUserId()) sociaty := this.modelSociaty.getUserSociaty(session.GetUserId())
if sociaty == nil || sociaty.Id == "" { if sociaty == nil || sociaty.Id == "" {
reddot[comm.Reddot3] = false log.Warn("公会红点未获得公会信息", log.Fields{"uid": session.GetUserId()})
return
}
var applyReddot bool
if this.modelSociaty.isRight(session.GetUserId(), sociaty,
pb.SociatyJob_PRESIDENT,
pb.SociatyJob_VICEPRESIDENT,
pb.SociatyJob_ADMIN) {
if len(sociaty.ApplyRecord) > 0 {
applyReddot = true
}
return return
} }
for _, v := range rid { for _, v := range rid {
@ -132,6 +144,8 @@ func (this *Sociaty) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (
if ok := this.modelSociaty.IsSign(session.GetUserId(), sociaty); !ok { if ok := this.modelSociaty.IsSign(session.GetUserId(), sociaty); !ok {
reddot[comm.Reddot3] = true reddot[comm.Reddot3] = true
} }
case comm.Reddot29:
reddot[comm.Reddot29] = applyReddot
} }
} }
return return

View File

@ -57,6 +57,21 @@ func (this *ModelTaskActive) getActiveListByTag(uid string, taskTag comm.TaskTag
return list return list
} }
// 查询完成的且未领取的任务 发现未领取返回true
func (this *ModelTaskActive) noReceiveTaskActive(uid string, taskTag comm.TaskTag) (bool, error) {
list := []*pb.DBTaskActive{}
if err := this.GetList(uid, &list); err != nil {
this.moduleTask.Errorf("getUserActiveList err:%v", err)
return false,err
}
for _, v := range list {
if v.Tag == int32(taskTag) && v.Received == 0 {
return true, nil
}
}
return false, nil
}
//获取玩家活跃记录 id 唯一ID //获取玩家活跃记录 id 唯一ID
func (this *ModelTaskActive) getUserActive(uid, id string, taskTag comm.TaskTag) *pb.DBTaskActive { func (this *ModelTaskActive) getUserActive(uid, id string, taskTag comm.TaskTag) *pb.DBTaskActive {
record := this.getActiveListByTag(uid, taskTag) record := this.getActiveListByTag(uid, taskTag)

View File

@ -23,14 +23,10 @@ type ModuleTask struct {
modelTaskActive *ModelTaskActive modelTaskActive *ModelTaskActive
api *apiComp api *apiComp
configure *configureComp configure *configureComp
// taskHandleMap map[int32]taskHandle //任务处理器
} }
func NewModule() core.IModule { func NewModule() core.IModule {
return &ModuleTask{ return &ModuleTask{}
// taskHandleMap: make(map[int32]taskHandle),
}
} }
func (this *ModuleTask) GetType() core.M_Modules { func (this *ModuleTask) GetType() core.M_Modules {
@ -43,7 +39,6 @@ func (this *ModuleTask) GetEventApp() *event_v2.App {
func (this *ModuleTask) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { func (this *ModuleTask) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options) err = this.ModuleBase.Init(service, module, options)
// this.initTaskHandle()
return return
} }
@ -163,6 +158,14 @@ func (this *ModuleTask) Reddot(session comm.IUserSession, rid ...comm.ReddotType
reddot[comm.Reddot4] = ok reddot[comm.Reddot4] = ok
break break
} }
case comm.Reddot27:
if ok,_:= this.modelTaskActive.noReceiveTaskActive(session.GetUserId(), comm.TASK_DAILY);ok{
reddot[comm.Reddot27] = ok
}
case comm.Reddot28:
if ok,_:= this.modelTaskActive.noReceiveTaskActive(session.GetUserId(), comm.TASK_WEEKLY);ok{
reddot[comm.Reddot28] = ok
}
} }
} }
return return