This commit is contained in:
liwei1dao 2023-05-10 10:29:58 +08:00
commit f7b7eb85d5
8 changed files with 89 additions and 49 deletions

View File

@ -12,9 +12,11 @@
"text": "师徒二人"
},
"png": "jiban_img_zu02",
"img": "hgd_img_bg",
"friends_lv": 1,
"favorability_lv": 1,
"hid": "25001",
"hidimg": "hgd_role_25001",
"attribute": [
{
"a": "atkpro",
@ -38,10 +40,12 @@
"key": "favorability_friends_friend_name_40001",
"text": "师徒二人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu03",
"img": "hgd_img_bg",
"friends_lv": 1,
"favorability_lv": 1,
"hid": "14002",
"hidimg": "hgd_role_14002",
"attribute": [
{
"a": "atk",
@ -65,10 +69,12 @@
"key": "favorability_friends_friend_name_40001",
"text": "师徒二人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu04",
"img": "hgd_img_bg",
"friends_lv": 2,
"favorability_lv": 9,
"favorability_lv": 3,
"hid": "25001",
"hidimg": "hgd_role_25001",
"attribute": [
{
"a": "atkpro",
@ -92,10 +98,12 @@
"key": "favorability_friends_friend_name_40001",
"text": "师徒二人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu05",
"img": "hgd_img_bg",
"friends_lv": 2,
"favorability_lv": 9,
"favorability_lv": 3,
"hid": "14002",
"hidimg": "hgd_role_14002",
"attribute": [
{
"a": "atk",
@ -119,10 +127,12 @@
"key": "favorability_friends_friend_name_40001",
"text": "师徒二人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu06",
"img": "hgd_img_bg",
"friends_lv": 3,
"favorability_lv": 15,
"favorability_lv": 6,
"hid": "25001",
"hidimg": "hgd_role_25001",
"attribute": [
{
"a": "atkpro",
@ -146,10 +156,12 @@
"key": "favorability_friends_friend_name_40001",
"text": "师徒二人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu07",
"img": "hgd_img_bg",
"friends_lv": 3,
"favorability_lv": 15,
"favorability_lv": 6,
"hid": "14002",
"hidimg": "hgd_role_14002",
"attribute": [
{
"a": "atk",
@ -173,10 +185,12 @@
"key": "favorability_friends_friend_name_102",
"text": "师徒三人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu08",
"img": "hgd_img_bg",
"friends_lv": 1,
"favorability_lv": 1,
"hid": "25001",
"hidimg": "hgd_role_25001",
"attribute": [
{
"a": "atkpro",
@ -200,10 +214,12 @@
"key": "favorability_friends_friend_name_102",
"text": "师徒三人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu09",
"img": "hgd_img_bg",
"friends_lv": 1,
"favorability_lv": 1,
"hid": "35001",
"hidimg": "hgd_role_35001",
"attribute": [
{
"a": "atk",
@ -227,10 +243,12 @@
"key": "favorability_friends_friend_name_102",
"text": "师徒三人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu10",
"img": "hgd_img_bg",
"friends_lv": 1,
"favorability_lv": 1,
"hid": "15004",
"hidimg": "hgd_role_15004",
"attribute": [
{
"a": "HP",
@ -254,10 +272,12 @@
"key": "favorability_friends_friend_name_102",
"text": "师徒三人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu11",
"img": "hgd_img_bg",
"friends_lv": 2,
"favorability_lv": 9,
"hid": "25001",
"hidimg": "hgd_role_25001",
"attribute": [
{
"a": "atkpro",
@ -281,10 +301,12 @@
"key": "favorability_friends_friend_name_102",
"text": "师徒三人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu12",
"img": "hgd_img_bg",
"friends_lv": 2,
"favorability_lv": 9,
"hid": "35001",
"hidimg": "hgd_role_35001",
"attribute": [
{
"a": "atk",
@ -308,10 +330,12 @@
"key": "favorability_friends_friend_name_102",
"text": "师徒三人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu13",
"img": "hgd_img_bg",
"friends_lv": 2,
"favorability_lv": 9,
"hid": "15004",
"hidimg": "hgd_role_15004",
"attribute": [
{
"a": "HP",
@ -335,10 +359,12 @@
"key": "favorability_friends_friend_name_102",
"text": "师徒三人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu14",
"img": "hgd_img_bg",
"friends_lv": 3,
"favorability_lv": 15,
"hid": "25001",
"hidimg": "hgd_role_25001",
"attribute": [
{
"a": "atkpro",
@ -362,10 +388,12 @@
"key": "favorability_friends_friend_name_102",
"text": "师徒三人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu15",
"img": "hgd_img_bg",
"friends_lv": 3,
"favorability_lv": 15,
"hid": "35001",
"hidimg": "hgd_role_35001",
"attribute": [
{
"a": "atk",
@ -389,10 +417,12 @@
"key": "favorability_friends_friend_name_102",
"text": "师徒三人"
},
"png": "jiban_img_zu02",
"png": "jiban_img_zu16",
"img": "hgd_img_bg",
"friends_lv": 3,
"favorability_lv": 15,
"hid": "15004",
"hidimg": "hgd_role_15004",
"attribute": [
{
"a": "HP",

View File

@ -63,6 +63,7 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
code = pb.ErrorCode_ConfigNoFound
return
}
_hero.JuexingLv += 1
_value, ok := strconv.Atoi(awakenData.Phasebonus[0])
if ok == nil { // 升级技能
for pos, v := range _hero.NormalSkill {
@ -77,7 +78,7 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
} else { // 加属性
this.module.modelHero.resetJuexingProperty(_hero)
}
_hero.JuexingLv += 1
_heroMap["juexingLv"] = _hero.JuexingLv
_heroMap["juexProperty"] = _hero.JuexProperty
// 保存数据

View File

@ -88,7 +88,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
}
hunting.BossTime[key] = req.Report.Costtime
// 耗时校验 当前战斗胜利时间消耗小于之前刷新数据
if hunting.BossTime[key] > req.Report.Costtime || hunting.BossTime[key] == 0 && req.Difficulty >= hunting.Boss[req.BossType] {
if (hunting.BossTime[key] > req.Report.Costtime || hunting.BossTime[key] == 0) && req.Difficulty >= hunting.Boss[req.BossType] {
mapData["bossTime"] = hunting.BossTime // 更新时间
userinfo := this.module.ModuleUser.GetUser(session.GetUserId())

View File

@ -37,26 +37,25 @@ func (this *apiComp) FetterLvUp(session comm.IUserSession, req *pb.LibraryFetter
totalFetterLv += _d.Favorlv
}
}
totalFetterLv = 0
conf := this.module.configure.GetFriendData(fetter.Fid, fetter.Fidlv+1)
fetter.Fidlv += 1
conf := this.module.configure.GetFriendData(fetter.Fid, fetter.Fidlv)
if len(conf) == 0 {
code = pb.ErrorCode_ConfigNoFound
return
} else {
fetter.Fidlv += 1
if conf[0].FavorabilityLv > totalFetterLv {
code = pb.ErrorCode_LibraryLvReward
return
}
}
if _, ok := fetter.Prize[fetter.Fidlv]; ok {
if conf[0].FavorabilityLv > totalFetterLv {
code = pb.ErrorCode_LibraryLvReward
return
}
if _, ok := fetter.Prize[fetter.Fidlv]; !ok {
code = pb.ErrorCode_LibraryReward
return
}
fetter.Prize[fetter.Fidlv] = 1
// 发奖
hProperty := make(map[string][]*cfg.Gameatr, 0)
for _, v := range conf {
var sz []*cfg.Gameatr

View File

@ -3,6 +3,7 @@ package library
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
)
@ -64,10 +65,10 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
}
}
for i := sCount + 1; i <= sCount+req.Counts; i++ {
_heroObj.Givecount += 1
addExp += attenuation[i]
}
_heroObj.Givecount += req.Counts
// 校验是否是自己喜欢的食物
_c := this.module.configure.GetFavorability(_heroObj.Heroid, _heroObj.Favorlv)
if _c == nil {
@ -133,6 +134,10 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
mapData["favorexp"] = _heroObj.Favorexp
mapData["favorlv"] = _heroObj.Favorlv
mapData["givecount"] = _heroObj.Givecount
if _heroObj.Ctime == 0 { // 记录刷新的时间
_heroObj.Ctime = configure.Now().Unix()
mapData["ctime"] = _heroObj.Ctime
}
this.module.modelFetter.modifyHeroFetterDataByObjId(session.GetUserId(), _heroObj.Id, mapData)
rsp.Data = _heroObj
session.SendMsg(string(this.module.GetType()), LibraryUseGiftResp, rsp)

View File

@ -19,16 +19,16 @@ func (this *apiComp) ForgeEquipCheck(session comm.IUserSession, req *pb.SmithyFo
// 打造装备
func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEquipReq) (code pb.ErrorCode, data *pb.ErrorData) {
var (
stove *pb.DBStove
err error
update map[string]interface{}
addProbability int32
costRes []*cfg.Gameatn
customLv int32 // 定制装备的等级
rsp *pb.SmithyForgeEquipResp
needTemperatureCos int32 // 需要消耗的温度
maxT int32
atno []*pb.UserAtno
stove *pb.DBStove
err error
update map[string]interface{}
addProbability int32
costRes []*cfg.Gameatn
customLv int32 // 定制装备的等级
rsp *pb.SmithyForgeEquipResp
needT int32 // 需要消耗的温度
maxT int32
atno []*pb.UserAtno
)
// 参数校验
if req.Count == 0 { // 传0 默认打造意见
@ -84,19 +84,20 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
customLv = reelcfg.CustomizedLv[index]
}
}
needTemperatureCos = reelcfg.TemperatureCos * req.Count
needT = reelcfg.TemperatureCos * req.Count
// 熟练度减少的温度
t := this.module.modelStove.CheckTemperature(req.ReelId, stove.Data[req.ReelId].Lv)
needTemperatureCos = needTemperatureCos * (1000 - t) / 1000 // 千分比
needT = needT * (1000 - t) / 1000 // 千分比
// 工具台技能减少
_s := this.module.modelStove.StoveToolsTemperature(stove)
if _s != 0 {
needTemperatureCos *= (1 - _s/1000)
needT *= (1 - _s/1000)
}
if req.Lava > 0 { // 熔岩打造
exemption := this.module.ModuleTools.GetGlobalConf().ExemptionTemperatureCos // 预计消耗温度
gloabNum := this.module.ModuleTools.GetGlobalConf().ExemptionTemperatureCosNum
if needTemperatureCos > req.Count*gloabNum {
if needT > req.Lava*gloabNum {
this.module.Errorf("ErrorCode_SmithyLackLava needT:%d,curT:%d,count :%d", needT, req.Count*gloabNum, req.Count)
code = pb.ErrorCode_SmithyLackLava // 缺少熔岩
return
}
@ -112,11 +113,11 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
costRes = append(costRes, lavaCost)
} else {
// 检查炉温 是否够
if stove.Temperature < needTemperatureCos {
if stove.Temperature < needT {
code = pb.ErrorCode_SmithyNoTemperature // 炉温不够 直接返回
return
}
stove.Temperature -= needTemperatureCos // 消耗温度
stove.Temperature -= needT // 消耗温度
update["temperature"] = stove.Temperature
}

View File

@ -95,7 +95,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
}
}
if viking.BossTime[key] > req.Report.Costtime || (viking.BossTime[key] == 0 && req.Difficulty >= viking.Boss[req.BossId]) {
if (viking.BossTime[key] > req.Report.Costtime || viking.BossTime[key] == 0) && req.Difficulty >= viking.Boss[req.BossId] {
viking.BossTime[key] = req.Report.Costtime
userinfo := this.module.ModuleUser.GetUser(session.GetUserId())
this.module.CheckRank(session.GetUserId(), req.BossId, req.Difficulty, req.Report, userinfo)

View File

@ -17,9 +17,11 @@ type GameFriendsData struct {
TypeName string
FriendName string
Png string
Img string
FriendsLv int32
FavorabilityLv int32
Hid string
Hidimg string
Attribute []*Gameatr
AttributeTxt string
}
@ -37,9 +39,11 @@ func (_v *GameFriendsData)Deserialize(_buf map[string]interface{}) (err error) {
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["type_name"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.TypeName error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.TypeName, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["friend_name"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.FriendName error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.FriendName, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; if _v.Png, _ok_ = _buf["png"].(string); !_ok_ { err = errors.New("png error"); return } }
{ var _ok_ bool; if _v.Img, _ok_ = _buf["img"].(string); !_ok_ { err = errors.New("img error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["friends_lv"].(float64); !_ok_ { err = errors.New("friends_lv error"); return }; _v.FriendsLv = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["favorability_lv"].(float64); !_ok_ { err = errors.New("favorability_lv error"); return }; _v.FavorabilityLv = int32(_tempNum_) }
{ var _ok_ bool; if _v.Hid, _ok_ = _buf["hid"].(string); !_ok_ { err = errors.New("hid error"); return } }
{ var _ok_ bool; if _v.Hidimg, _ok_ = _buf["hidimg"].(string); !_ok_ { err = errors.New("hidimg error"); return } }
{
var _arr_ []interface{}
var _ok_ bool