This commit is contained in:
liwei1dao 2023-02-07 18:53:02 +08:00
commit 2ea491b859
21 changed files with 300 additions and 2685 deletions

View File

@ -1,62 +0,0 @@
[
{
"index": "hero_reset",
"var": [
{
"a": "attr",
"t": "gold",
"n": 20000
}
]
},
{
"index": "hero_name",
"var": [
{
"a": "attr",
"t": "gold",
"n": 20
}
]
},
{
"index": "friend_peize",
"var": [
{
"a": "attr",
"t": "friend",
"n": 100
}
]
},
{
"index": "equip_wash",
"var": [
{
"a": "attr",
"t": "gold",
"n": 20000
}
]
},
{
"index": "talent_reset",
"var": [
{
"a": "attr",
"t": "gold",
"n": 20000
}
]
},
{
"index": "unified_reward",
"var": [
{
"a": "attr",
"t": "gold",
"n": 20000
}
]
}
]

View File

@ -538,6 +538,7 @@
10,
20,
30
]
],
"generaltp": "500000"
}
]

View File

@ -1425,7 +1425,7 @@
"hid": "23003",
"name": {
"key": "hero_23003",
"text": "泰德·邓普顿"
"text": "黛塔黛恩"
},
"star": 3,
"color": 2,

File diff suppressed because it is too large Load Diff

View File

@ -6247,6 +6247,50 @@
"text": "波比的天赋点不足"
}
},
{
"id": "500000",
"name": {
"key": "itemname_90001",
"text": "通用共鸣道具"
},
"usetype": 3,
"color": 5,
"bagtype": 1,
"index": 99,
"special_type": 0,
"time": 0,
"effects": "effect_ui_wuping_2",
"box_id": 0,
"synthetize_num": 0,
"access": [
155
],
"use_skip": 155,
"upper_limit": 999,
"uselv": 0,
"isani": 0,
"star": 0,
"race": 0,
"img": "ytx_js_15005",
"ico": "ytx_js_15005",
"intr": {
"key": "itemdesc_500000",
"text": "亚力克斯天赋点"
},
"sale": [
{
"a": "attr",
"t": "gold",
"n": 1000
}
],
"synthetize_deplete": [],
"decompose_deplete": [],
"tipstxt": {
"key": "itemtipstxt_500000",
"text": "波比的天赋点不足"
}
},
{
"id": "1000001",
"name": {

View File

@ -51,7 +51,7 @@ type (
QueryHeroAmount(uId string, heroCfgId string) (amount uint32)
// 批量创建英雄
CreateRepeatHeros(session IUserSession, heros map[string]int32, bPush bool) (hero *pb.DBHero, code pb.ErrorCode)
CreateRepeatHeros(session IUserSession, heros map[string]int32, bPush bool) (hero *pb.DBHero, atno []*pb.UserAtno, code pb.ErrorCode)
// 获取英雄
// heroId 英雄ID
GetHeroByObjID(uid, heroId string) (*pb.DBHero, pb.ErrorCode)
@ -89,8 +89,6 @@ type (
GetTujianHeroNum(uid string) int32
//拥有觉醒至A级的B星英雄N个 Rtype123
CheckJuexingHeroNum(uid string, juexingLv int32, star int32) int32
//拥有共鸣至N级的英雄 Rtype124
CheckResonaceHeroNum(uid string, resonaceLv int32) int32
// 获取所有满星满级满觉醒的英雄
GetAllMaxHero(session IUserSession) (code pb.ErrorCode)

View File

@ -470,12 +470,7 @@ func (this *modelBattleComp) createBattleRole(hero *pb.DBHero, tid, pos int) (ro
for k, v := range hero.AddProperty {
role.Property[k] += v
}
for k, v := range hero.Energy {
role.Property[k] += v
}
for k, v := range hero.EnergyProperty {
role.Property[k] += v
}
for k, v := range hero.JuexProperty {
role.Property[k] += v
}

View File

@ -67,12 +67,11 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
newHero := this.module.modelHero.CloneNewHero(session.GetUserId(), _hero)
_hero.JuexProperty = map[string]int32{}
chanegCard = append(chanegCard, newHero)
_heroMap["isOverlying"] = false
_heroMap["sameCount"] = 1
_heroMap["horoscopeProperty"] = _hero.HoroscopeProperty
}
_hero.SameCount = 1
_hero.IsOverlying = false
// 加属性 awakenData
if len(awakenData.Phasebonus) != 2 {
code = pb.ErrorCode_ConfigNoFound

View File

@ -30,13 +30,12 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
costAtn *cfg.Gameatn
heroRecord *pb.DBHeroRecord
pool string // 当前抽对应的卡池
_mapAddHero map[string]int32
strPool []string // 10连跨多个卡池情况
update map[string]interface{}
normalDraw bool // 是否是普通抽
)
update = make(map[string]interface{})
_mapAddHero = make(map[string]int32, 0)
cfgDraw = this.module.configure.GetGlobalConf() // 读取抽卡配置文件
if cfgDraw == nil {
return
@ -326,35 +325,30 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
update["totalcount"] = heroRecord.Totalcount
update["daycount"] = heroRecord.Daycount
this.module.modelRecord.ChangeHeroRecord(session.GetUserId(), update)
szNewCards := make([]*cfg.Gameatn, 0)
rsp := &pb.HeroDrawCardResp{
Data: []*pb.AtnoData{},
}
for _, heroId := range szCards {
bFind := false
_mapAddHero[heroId]++
for _, v := range szNewCards {
if v.T == heroId {
v.N++
bFind = true
break
}
}
if !bFind {
res := &cfg.Gameatn{
A: "hero",
T: heroId,
N: 1,
}
szNewCards = append(szNewCards, res)
if code, atno := this.module.DispenseAtno(session, []*cfg.Gameatn{res}, true); code == pb.ErrorCode_Success {
var list *pb.AtnoData
list.Atno = atno
rsp.Data = append(rsp.Data, list)
for _, v := range atno {
if v.A == "hero" {
if user := this.module.ModuleUser.GetUser(session.GetUserId()); user != nil { // 广播 首次获得英雄
this.chat.SendSysChatToWorld(comm.ChatSystem13, nil, 0, 0, user.Name, v.T)
}
}
// 获得新卡
if code = this.module.DispenseRes(session, szNewCards, true); code != pb.ErrorCode_Success {
this.module.Errorf("err:%v,create heros:%v,uid,%s", code, szNewCards, session.GetUserId())
code = pb.ErrorCode_HeroCreate // 创建新英雄失败
}
///英雄招募 【玩家名称】在招募中获得了【英雄名称】!
this.module.SendChatMsg(session, _mapAddHero, szCards)
}
}
session.SendMsg(string(this.module.GetType()), DrawCard, rsp)
// 任务统计
this.module.SendTaskMsg(session, szStar, req.DrawCount, normalDraw)

View File

@ -34,7 +34,6 @@ func (this *apiComp) GetSpecified(session comm.IUserSession, req *pb.HeroGetSpec
_heroMap := map[string]interface{}{
"lv": hero.Lv,
"star": hero.Star,
"isOverlying": false,
}
// 保存数据
err1 := this.module.modelHero.ChangeList(session.GetUserId(), hero.Id, _heroMap)

View File

@ -22,6 +22,7 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe
talent *pb.DBHeroTalent
err error
chanegCard []*pb.DBHero // 推送属性变化
res []*cfg.Gameatn // 学习天赋需要消耗的道具
)
chanegCard = make([]*pb.DBHero, 0)
if code = this.TalentLearnCheck(session, req); code != pb.ErrorCode_Success {
@ -81,27 +82,38 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe
}
}
}
// 校验消耗
if code = this.module.CheckRes(session, talentConf.Thing); code != pb.ErrorCode_Success {
return
}
res = append(res, talentConf.Thing...)
// 消耗指定的天赋点数
t := this.module.configure.GetHeroTalentBoxItem(talent.HeroId)
if t != "" && talentConf.Point > 0 {
res := &cfg.Gameatn{
curItemCount := int32(this.module.ModuleItems.QueryItemAmount(session.GetUserId(), t))
if curItemCount < talentConf.Point { // 如果数量不够 则取找其他物品替代
leftCount := talentConf.Point - curItemCount // 需要其他物品的数量
generaltp := this.module.configure.GetGlobalConf().Generaltp
otherCount := int32(this.module.ModuleItems.QueryItemAmount(session.GetUserId(), generaltp))
if leftCount <= otherCount { // 其他物品够扣
point := &cfg.Gameatn{
A: "item",
T: generaltp,
N: leftCount,
}
res = append(res, point)
} else { // 其他替代的道具也不足 直接返回
code = pb.ErrorCode_ItemsNoEnough
return
}
} else {
point := &cfg.Gameatn{
A: "item",
T: t,
N: talentConf.Point,
}
if code = this.module.CheckRes(session, []*cfg.Gameatn{res}); code != pb.ErrorCode_Success {
return
} else {
if code = this.module.ConsumeRes(session, []*cfg.Gameatn{res}, true); code != pb.ErrorCode_Success {
return
res = append(res, point)
}
}
}
if code = this.module.ConsumeRes(session, talentConf.Thing, true); code != pb.ErrorCode_Success {
if code = this.module.ConsumeRes(session, res, true); code != pb.ErrorCode_Success {
return
}

View File

@ -22,8 +22,6 @@ const (
hero_exp = "game_heroexp.json" // 升级
hero_skillup = "game_heroskilllevel.json" // 英雄技能升级
game_skillatk = "game_skillatk.json" // 英雄技能
//hero_resonance = "game_heroresonance.json" // 英雄共鸣
//hero_comatn = "game_comatn.json" // 英雄共鸣重置
hero_awaken = "game_heroawaken.json" // 英雄觉醒
hero_drawcard = "game_drawcard.json" // 抽卡
hero_drawupdraw = "game_drawupdraw.json" // 抽卡概率调整
@ -62,7 +60,6 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
hero_exp: cfg.NewGameHeroExp,
hero_skillup: cfg.NewGameHeroSkillLevel,
game_skillatk: cfg.NewGameSkillAtk,
//hero_comatn: cfg.NewGameComAtn,
hero_drawcard: cfg.NewGameDrawCard,
hero_fusion: cfg.NewGameHerofusion,
hero_starupsp: cfg.NewGameHeroStarupSp,

View File

@ -50,16 +50,13 @@ func (this *ModelHero) InitHero(uid string, heroCfgId string) *pb.DBHero {
HeroID: heroCfg.Hid,
Star: heroCfg.Star, //初始星级
Lv: 1, //初始等级
IsOverlying: true, //是否允许叠加,
Block: false, //未锁定
CardType: heroCfg.Type, //卡片类型
Skins: []int32{},
EquipID: make([]string, 8), //初始装备
SameCount: 1, //默认叠加数量
AddProperty: make(map[string]int32),
Energy: make(map[string]int32),
Property: make(map[string]int32),
EnergyProperty: make(map[string]int32),
JuexProperty: make(map[string]int32),
TalentProperty: make(map[string]int32),
HoroscopeProperty: make(map[string]int32),
@ -161,58 +158,6 @@ func (this *ModelHero) initHeroOverlying(uid string, heroCfgId string, count int
return
}
// 该方法适用创建初始英雄 叠加英雄 count叠加数量
func (this *ModelHero) createHeroOverlying(uid string, heroCfgId string, count int32) (hero *pb.DBHero, err error) {
heros := make([]*pb.DBHero, 0)
if this.moduleHero.IsCross() {
if dbModel, err := this.moduleHero.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
this.moduleHero.Errorln(err)
} else {
if err = dbModel.GetList(uid, &heros); err != nil {
this.moduleHero.Errorf("err:%v", err)
}
}
} else {
if err = this.GetList(uid, &heros); err != nil {
this.moduleHero.Errorf("err:%v", err)
}
}
for _, obj := range heros {
if obj.HeroID == heroCfgId { // z
return
}
}
for _, h := range heros {
if h.HeroID == heroCfgId &&
h.IsOverlying {
h.SameCount += count
data := map[string]interface{}{
"sameCount": h.SameCount, //叠加数
}
hero = h
if this.moduleHero.IsCross() {
if model, err := this.moduleHero.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
this.moduleHero.Errorln(err)
} else {
if err := model.ChangeList(uid, h.Id, data); err != nil {
return nil, err
}
}
} else {
if err := this.ChangeList(uid, h.Id, data); err != nil {
return nil, err
}
}
return
}
}
return this.initHeroOverlying(uid, heroCfgId, count)
}
//获取一个英雄(参数唯一objID)
func (this *ModelHero) getOneHero(uid, heroId string) *pb.DBHero {
hero := &pb.DBHero{}
@ -394,7 +339,7 @@ func (this *ModelHero) setEquipment(uid string, hero *pb.DBHero) (newHero *pb.DB
suite2Star := hero.Suite2Star
suite1Lv := hero.Suite1Lv
suite2Lv := hero.Suite2Lv
if hero.IsOverlying && hero.SameCount > 1 {
if hero.SameCount > 1 {
// 克隆一个新的
hero.SameCount -= 1
hero.Suite1Star = 0
@ -407,8 +352,6 @@ func (this *ModelHero) setEquipment(uid string, hero *pb.DBHero) (newHero *pb.DB
newHero = this.CloneNewHero(uid, hero)
hero.EquipID = make([]string, 8)
hero.SameCount = 1
hero.IsOverlying = false
update["isoverlying"] = false
update["sameCount"] = 1
update["horoscopeProperty"] = hero.HoroscopeProperty
}
@ -603,12 +546,10 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, hero *pb.DBHero, ex
this.moduleHero.Debugf("add hero exp :old lv:%d,old exp:%d,new lv:%d,new exp:%d,addexp:%d", hero.Lv, hero.Exp, curLv, curExp, exp)
update["lv"] = curLv
update["exp"] = curExp
update["isOverlying"] = false
update["sameCount"] = 1
update["horoscopeProperty"] = hero.HoroscopeProperty
hero.Lv = curLv
hero.Exp = curExp
hero.IsOverlying = false
hero.SameCount = 1
if err := this.ChangeList(session.GetUserId(), hero.Id, update); err != nil {
@ -721,16 +662,13 @@ func (this *ModelHero) InitMonsterHero(heroCfgId string, star, lv int32) *pb.DBH
HeroID: heroCfg.Hid,
Star: star, //初始星级
Lv: lv, //初始等级
IsOverlying: true, //是否允许叠加,
Block: false, //未锁定
CardType: heroCfg.Type, //卡片类型
Skins: []int32{},
EquipID: make([]string, 8), //初始装备
SameCount: 1, //默认叠加数量
AddProperty: make(map[string]int32),
Energy: make(map[string]int32),
Property: make(map[string]int32),
EnergyProperty: make(map[string]int32),
JuexProperty: make(map[string]int32),
TalentProperty: make(map[string]int32),
HoroscopeProperty: make(map[string]int32),
@ -863,13 +801,18 @@ func (this *ModelHero) resetTalentProperty(hero *pb.DBHero) {
}
// 创建一条英雄信息,如果有这个英雄 则转换成对应的碎片
func (this *ModelHero) createHero(session comm.IUserSession, heroCfgId string, count int32) (hero *pb.DBHero, bFirst bool, err error) {
func (this *ModelHero) createHero(session comm.IUserSession, heroCfgId string, count int32) (hero *pb.DBHero, bFirst bool, atno []*pb.UserAtno, err error) {
heros := make([]*pb.DBHero, 0)
uid := session.GetUserId()
heroCfg := this.moduleHero.configure.GetHeroConfig(heroCfgId)
if heroCfg == nil {
err = errors.New("not found hero configID")
this.moduleHero.Errorf("not found hero configID:%s", heroCfgId)
return
}
if this.moduleHero.IsCross() {
if dbModel, err := this.moduleHero.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
this.moduleHero.Errorln(err)
} else {
if err = dbModel.GetList(uid, &heros); err != nil {
this.moduleHero.Errorf("err:%v", err)
@ -894,19 +837,96 @@ func (this *ModelHero) createHero(session comm.IUserSession, heroCfgId string, c
if err != nil {
return
}
atno = append(atno, &pb.UserAtno{
A: "hero",
T: hero.HeroID,
N: 1,
O: hero.Id,
})
}
// 转碎片处理
if count > 0 {
heroCfg := this.moduleHero.configure.GetHeroConfig(heroCfgId)
if heroCfg != nil {
res := make([]*cfg.Gameatn, 0)
// 如果技能是满级 则转成其他道具
if this.checkHeroAllSkillMax(hero) {
list := this.moduleHero.configure.GetGlobalConf().Moonshopmoney
if list != nil {
for pos, v := range list {
if int32(pos)+3 == heroCfg.Star && v > 0 {
res = append(res, &cfg.Gameatn{
A: "attr",
T: "moongold",
N: v * count,
})
atno = append(atno, &pb.UserAtno{
A: "attr",
T: "moongold",
N: v * count,
})
break
}
}
}
} else {
for i := 0; i < int(count); i++ {
res = append(res, heroCfg.Herofrag...)
for _, v := range heroCfg.Herofrag {
atno = append(atno, &pb.UserAtno{
A: v.A,
T: v.T,
N: v.N,
})
}
this.moduleHero.DispenseRes(session, res, true)
}
}
// expitem 获得
if rst, err := this.moduleHero.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { // 统计主线进度
_mp := rst.Expitem
bAdd := false
if heroCfg.Expitemnum > 0 {
if v, ok := _mp[hero.HeroID]; ok {
if heroCfg.Expitemnum > v {
_mp[hero.HeroID] += 1
bAdd = true
}
} else {
_mp[hero.HeroID] = 1
bAdd = true
}
}
if bAdd {
this.moduleHero.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{
"expitem": _mp,
})
for i := 0; i < int(count); i++ {
res = append(res, heroCfg.Expitem...)
for _, v := range heroCfg.Herofrag {
atno = append(atno, &pb.UserAtno{
A: v.A,
T: v.T,
N: v.N,
})
}
}
}
}
if len(res) > 0 { // 资源统一发放
this.moduleHero.DispenseRes(session, res, true)
}
}
return
}
// 校验当前技能是否是满级
func (this *ModelHero) checkHeroAllSkillMax(hero *pb.DBHero) bool {
for _, v := range hero.NormalSkill {
if this.moduleHero.configure.GetHeroSkillMaxLvConfig(uint32(v.SkillID)) > v.SkillLv {
return false
}
}
return true
}

View File

@ -76,11 +76,11 @@ func (this *Hero) Start() (err error) {
}
//创建单个叠加英雄
func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string, num int32) (hero *pb.DBHero, bFirst bool, code pb.ErrorCode) {
func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string, num int32) (hero *pb.DBHero, bFirst bool, atno []*pb.UserAtno, code pb.ErrorCode) {
var (
err error
)
hero, bFirst, err = this.modelHero.createHero(session, heroCfgId, num)
hero, bFirst, atno, err = this.modelHero.createHero(session, heroCfgId, num)
if err == nil && bFirst {
//go func(uid string, heroCfgId string) { // 携程处理 图鉴数据
if db.IsCross() {
@ -235,7 +235,6 @@ func (this *Hero) GetSpecifiedHero(session comm.IUserSession, heroConfId string,
_heroMap := map[string]interface{}{
"lv": hero.Lv,
"star": hero.Star,
"isOverlying": false,
"sameCount": amount,
}
// 保存数据
@ -256,7 +255,7 @@ func (this *Hero) EventUserOffline(session comm.IUserSession) {
}
// 批量创建多个英雄
func (this *Hero) CreateRepeatHeros(session comm.IUserSession, heros map[string]int32, bPush bool) (hero *pb.DBHero, code pb.ErrorCode) {
func (this *Hero) CreateRepeatHeros(session comm.IUserSession, heros map[string]int32, bPush bool) (hero *pb.DBHero, atno []*pb.UserAtno, code pb.ErrorCode) {
var (
changeList []*pb.DBHero
firstGet []string
@ -266,7 +265,7 @@ func (this *Hero) CreateRepeatHeros(session comm.IUserSession, heros map[string]
if num == 0 { // 数量为0 不做处理
continue
}
if hero, bFirst, code = this.createRepeatHero(session, heroCfgId, num); code != pb.ErrorCode_Success {
if hero, bFirst, atno, code = this.createRepeatHero(session, heroCfgId, num); code != pb.ErrorCode_Success {
this.Errorf("create hero %s failed", heroCfgId)
continue
}
@ -352,7 +351,6 @@ func (this *Hero) KungFuHero(session comm.IUserSession, heroObjID string, bKongf
}
_heroMap := map[string]interface{}{
"status": pb.HeroType_HeroTypeKongFu,
"isOverlying": false,
"sameCount": 1,
"horoscopeProperty": _hero.HoroscopeProperty,
}
@ -417,10 +415,8 @@ func (this *Hero) QueryCrossHeroinfo(oid string) (hero *pb.DBHero, err error) {
func (this *Hero) GetHeroListByUse(uid string) []*pb.DBHero {
tmp := make([]*pb.DBHero, 0)
for _, v := range this.modelHero.getHeroList(uid) {
if !v.IsOverlying {
tmp = append(tmp, v)
}
}
return tmp
}
@ -618,17 +614,6 @@ 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))
}
// 获取所有满星满级满觉醒的英雄
func (this *Hero) GetAllMaxHero(session comm.IUserSession) (code pb.ErrorCode) {
data := this.modelHero.moduleHero.configure.GetHeroConfigData()
@ -678,7 +663,6 @@ func (this *Hero) GetAllMaxHero(session comm.IUserSession) (code pb.ErrorCode) {
"lv": hero.Lv,
"star": hero.Star,
"juexingLv": hero.JuexingLv,
"isOverlying": false,
"sameCount": 1,
"normalSkill": hero.NormalSkill,
"talentProperty": hero.TalentProperty,
@ -701,21 +685,6 @@ func (this *Hero) GetAllMaxHero(session comm.IUserSession) (code pb.ErrorCode) {
return
}
func (this *Hero) SendChatMsg(session comm.IUserSession, _mapAddHero map[string]int32, cards []string) {
rsp := &pb.HeroDrawCardResp{}
///英雄招募 【玩家名称】在招募中获得了【英雄名称】!
for hid := range _mapAddHero {
if user := this.ModuleUser.GetUser(session.GetUserId()); user != nil {
this.chat.SendSysChatToWorld(comm.ChatSystem13, nil, 0, 0, user.Name, hid)
} else {
this.Errorf("no found userdata uid:%s", session.GetUserId())
}
}
rsp.Heroes = cards
session.SendMsg(string(this.GetType()), DrawCard, rsp)
}
func (this *Hero) SendTaskMsg(session comm.IUserSession, szStar []int32, drawCount int32, itype bool) {
// 任务统计
if itype { //普通招募

View File

@ -88,9 +88,7 @@ func (this *modelHoroscope) computeHeroNumeric(uid string, hero ...*pb.DBHero) (
//计算属性
func (this *modelHoroscope) compute(info *pb.DBHoroscope, hero *pb.DBHero) (err error) {
if hero.IsOverlying {
return
}
var (
heroconf *cfg.GameHeroData
node *cfg.GameHoroscopeData

View File

@ -50,9 +50,16 @@ func (this *apiComp) Useitem(session comm.IUserSession, req *pb.ItemsUseItemReq)
return
}
sale := RandomProps(prop)
if code = this.module.ModuleHero.GetSpecifiedHero(session, sale.Prize[0].T, sale.Star, 1, int32(req.Amount)); code != pb.ErrorCode_Success {
var res []*cfg.Gameatn
res = append(res, &cfg.Gameatn{
A: "hero",
T: sale.Prize[0].T,
N: int32(req.Amount),
})
if code = this.module.DispenseRes(session, res, true); code != pb.ErrorCode_Success {
return
}
//随机任务
this.module.ModuleRtask.SendToRtask(session, comm.Rtype22, 1)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype22, utils.ToInt32(sale.Prize[0].T))

View File

@ -134,10 +134,6 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall
if first { // 发奖
if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { // 统计主线进度
_mp := rst.Mline
if _mp == nil {
_mp = make(map[int32]int32, 1)
_mp[curChapter.CType] = req.StageId
} else {
if v, ok := _mp[curChapter.CType]; ok {
if v <= req.StageId {
_mp[curChapter.CType] = req.StageId
@ -145,8 +141,6 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall
} else {
_mp[curChapter.CType] = req.StageId
}
}
this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{
"mline": _mp,
})
@ -162,7 +156,6 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall
N: v.N,
})
}
} else {
if code = this.module.DispenseRes(session, stageConf.Commonaward, true); code != pb.ErrorCode_Success {
this.module.Debugf("Mline Commonaward DispenseRes err:+%v", stageConf.Commonaward)

View File

@ -373,7 +373,7 @@ func (this *ModuleBase) DispenseRes(session comm.IUserSession, res []*cfg.Gameat
this.Debugf("发放道具资源: %v [%v]", items, code)
}
if len(heros) > 0 { //卡片资源
_, code = this.ModuleHero.CreateRepeatHeros(session, heros, bPush)
_, _, code = this.ModuleHero.CreateRepeatHeros(session, heros, bPush)
this.Debugf("发放英雄资源: %v [%v]", heros, code)
}
if len(equips) > 0 {
@ -576,14 +576,9 @@ func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gamea
}
}
if len(heros) > 0 { //卡片资源
hero, code := this.ModuleHero.CreateRepeatHeros(session, heros, bPush)
this.Debugf("发放英雄资源: %v [%v]", heros, code)
atno = append(atno, &pb.UserAtno{
A: "hero",
T: hero.HeroID,
N: int32(len(heros)),
O: hero.Id,
})
hero, atn, code := this.ModuleHero.CreateRepeatHeros(session, heros, bPush)
this.Debugf("发放英雄资源: %v [%v]", hero, code)
atno = append(atno, atn...)
}
if len(equips) > 0 {
change, code := this.ModuleEquipment.AddNewEquipments(session, equips, bPush)

View File

@ -85,6 +85,8 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (c
initUpdate := map[string]interface{}{
"modifynameCount": 1, //修改名称1次
"sociatyTicket": globalConf.GuildBossInitialNum, //公会BOSS挑战券
"expitem": make(map[string]int32, 0), // 初始化
"mline": make(map[string]int32, 0),
}
if err := this.module.modelExpand.ChangeUserExpand(session.GetUserId(), initUpdate); err != nil {
code = pb.ErrorCode_DBError

View File

@ -555,51 +555,49 @@ var File_rtask_rtask_msg_proto protoreflect.FileDescriptor
var file_rtask_rtask_msg_proto_rawDesc = []byte{
0x0a, 0x15, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x73,
0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x2f,
0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x14, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x6c,
0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64,
0x22, 0x45, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73,
0x70, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x12, 0x18, 0x0a,
0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b,
0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x50, 0x75, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74,
0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61,
0x73, 0x6b, 0x49, 0x64, 0x22, 0x48, 0x0a, 0x12, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e,
0x69, 0x73, 0x68, 0x49, 0x64, 0x73, 0x50, 0x75, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74,
0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61,
0x73, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x13,
0x0a, 0x11, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x52, 0x65, 0x71, 0x22, 0x3c, 0x0a, 0x12, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x72,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x63,
0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x52, 0x74,
0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72,
0x64, 0x22, 0x42, 0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65,
0x71, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a,
0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x70,
0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x27, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x65,
0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63,
0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x22, 0x94,
0x01, 0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12,
0x1c, 0x0a, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a,
0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x70,
0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64,
0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x12,
0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05,
0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61,
0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x74, 0x61,
0x73, 0x6b, 0x49, 0x64, 0x73, 0x22, 0x3f, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x65,
0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x01,
0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74,
0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x74,
0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x72,
0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a,
0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a,
0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b,
0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61, 0x73,
0x6b, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73,
0x6b, 0x49, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x2b,
0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x50, 0x75, 0x73,
0x68, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x48, 0x0a, 0x12, 0x52,
0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x49, 0x64, 0x73, 0x50, 0x75, 0x73,
0x68, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x03,
0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67,
0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72,
0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65,
0x74, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x22, 0x3c, 0x0a, 0x12, 0x52, 0x74,
0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70,
0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0e, 0x2e, 0x44, 0x42, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x42, 0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73,
0x6b, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b,
0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b,
0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02,
0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x27, 0x0a, 0x0d,
0x52, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a,
0x06, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69,
0x73, 0x53, 0x75, 0x63, 0x63, 0x22, 0x94, 0x01, 0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x54,
0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x54,
0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b,
0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02,
0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07,
0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63,
0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49,
0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64,
0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x05, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x22, 0x3f, 0x0a, 0x0d,
0x52, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a,
0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, 0x61,
0x67, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20,
0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -642,7 +640,6 @@ func file_rtask_rtask_msg_proto_init() {
if File_rtask_rtask_msg_proto != nil {
return
}
file_battle_battle_msg_proto_init()
file_rtask_rtask_db_proto_init()
if !protoimpl.UnsafeEnabled {
file_rtask_rtask_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {

View File

@ -174,6 +174,7 @@ type GameGlobalData struct {
RotateAngle float32
RotateDizzyTime float32
Moonshopmoney []int32
Generaltp string
}
const TypeId_GameGlobalData = 477542761
@ -736,6 +737,7 @@ func (_v *GameGlobalData)Deserialize(_buf map[string]interface{}) (err error) {
}
}
{ var _ok_ bool; if _v.Generaltp, _ok_ = _buf["generaltp"].(string); !_ok_ { err = errors.New("generaltp error"); return } }
return
}