英雄觉醒 配置支持增加多条属性

This commit is contained in:
meixiongfeng 2023-07-07 15:04:10 +08:00
parent 94cdd0a0de
commit 246bb80bf3
7 changed files with 3519 additions and 917 deletions

File diff suppressed because it is too large Load Diff

View File

@ -13857,7 +13857,7 @@
"access": [],
"use_skip": 0,
"upper_limit": 0,
"img": "attr_gold",
"img": "item_10000035",
"intr": {
"key": "item_item_intr_355",
"text": "用于商城购买消耗的礼卷"
@ -13931,7 +13931,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "wp_icon_jjcq",
"img": "item_14020028",
"intr": {
"key": "item_item_intr_357",
"text": "原始鸵鸟产的蛋,具有极高的营养价值。"
@ -13968,7 +13968,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020029",
"intr": {
"key": "item_item_intr_358",
"text": "海螺响起时,可能是传递一种信号,也可能是传递一种思念。"
@ -14005,7 +14005,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020030",
"intr": {
"key": "item_item_intr_359",
"text": "长途旅行过程中,可以把颈枕放在脖子后,缓解疲劳感。"
@ -14042,7 +14042,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020031",
"intr": {
"key": "item_item_intr_360",
"text": "用原始世界各种造型的贝壳串联起来的项链。"
@ -14079,7 +14079,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020032",
"intr": {
"key": "item_item_intr_361",
"text": "平先生做的阳春面,深受和平谷居民的欢迎。"
@ -14116,7 +14116,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020033",
"intr": {
"key": "item_item_intr_362",
"text": "一个绑满鞭炮的椅子,能够达到一飞冲天的效果。"
@ -14153,7 +14153,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020034",
"intr": {
"key": "item_item_intr_363",
"text": "神龙大侠诞生之后,繁衍出的应援物。"
@ -14190,7 +14190,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020035",
"intr": {
"key": "item_item_intr_364",
"text": "传统手工艺品,逢年过节挂上灯笼,增添节日氛围。"
@ -14227,7 +14227,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020036",
"intr": {
"key": "item_item_intr_365",
"text": "闻名于坏蛋联盟的世界名画。"
@ -14264,7 +14264,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020037",
"intr": {
"key": "item_item_intr_366",
"text": "用来提升室内装潢高级感的摆件。"
@ -14301,7 +14301,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020038",
"intr": {
"key": "item_item_intr_367",
"text": "用于庆祝一年中最重要的一天。"
@ -14338,7 +14338,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020039",
"intr": {
"key": "item_item_intr_368",
"text": "一种冰棒,吃完会让人心情愉悦。"
@ -14375,7 +14375,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020040",
"intr": {
"key": "item_item_intr_369",
"text": "被赋予魔法的毛毯,把人带到想去的地方。"
@ -14412,7 +14412,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020041",
"intr": {
"key": "item_item_intr_370",
"text": "传说,只要喝下幸福药水,就能和所爱之人幸福的生活在一起。"
@ -14449,7 +14449,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020042",
"intr": {
"key": "item_item_intr_371",
"text": "一种击打乐器,经常在具有地方特色的庆典活动中出现。"
@ -14486,7 +14486,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020043",
"intr": {
"key": "item_item_intr_372",
"text": "这是一面能窥探到人内心深处欲望的镜子。"
@ -14523,7 +14523,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020044",
"intr": {
"key": "item_item_intr_373",
"text": "这本书里记载了各种龙的信息,爱龙人士的首选。"
@ -14560,7 +14560,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020045",
"intr": {
"key": "item_item_intr_374",
"text": "维京人纯手工打造的龙牙,坚硬无比。"
@ -14597,7 +14597,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020046",
"intr": {
"key": "item_item_intr_375",
"text": "猎龙人研发的弩箭,是龙的天敌。"
@ -14634,7 +14634,7 @@
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "icon_st03",
"img": "item_14020047",
"intr": {
"key": "item_item_intr_376",
"text": "龙骑士驯龙时安置在龙身上的护具。"

View File

@ -24,12 +24,13 @@ func (this *apiComp) AwakenCheck(session comm.IUserSession, req *pb.HeroAwakenRe
/// 英雄觉醒
func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (errdata *pb.ErrorData) {
var (
awakenData *cfg.GameHeroAwakenData
_hero *pb.DBHero
chanegCard []*pb.DBHero // change
_heroMap map[string]interface{}
err error
bManAwaken bool // 是否达到满级共鸣
awakenData *cfg.GameHeroAwakenData
_hero *pb.DBHero
chanegCard []*pb.DBHero // change
_heroMap map[string]interface{}
err error
bManAwaken bool // 是否达到满级共鸣
bPropertyChange bool // 属性变化
)
_heroMap = make(map[string]interface{}, 0)
chanegCard = make([]*pb.DBHero, 0)
@ -82,21 +83,23 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (e
return
}
_hero.JuexingLv += 1
_value, ok := strconv.Atoi(awakenData.Phasebonus[0])
if ok == nil { // 升级技能
for pos, v := range _hero.NormalSkill {
value, err := strconv.Atoi(awakenData.Phasebonus[1])
if err == nil {
if pos == value {
v.SkillID = int32(_value)
for _, v := range awakenData.Phasebonus {
_value, ok := strconv.Atoi(v.S)
if ok == nil { // 升级技能
for pos, v1 := range _hero.NormalSkill {
if int32(pos) == v.D {
v1.SkillID = int32(_value)
_heroMap["normalSkill"] = _hero.NormalSkill
break
}
}
} else { // 加属性
bPropertyChange = true
}
_heroMap["normalSkill"] = _hero.NormalSkill
} else { // 加属性
}
if bPropertyChange {
this.module.modelHero.resetJuexingProperty(_hero)
}
_heroMap["juexingLv"] = _hero.JuexingLv
_heroMap["juexProperty"] = _hero.JuexProperty
// 保存数据

View File

@ -22,6 +22,7 @@ import (
"os"
"reflect"
"runtime/trace"
"strconv"
"strings"
"testing"
"time"
@ -113,6 +114,8 @@ type sumy struct {
func Test_Main(t *testing.T) {
value, err := strconv.Atoi("944005411")
fmt.Printf("%v,%v", value, err)
ids := utils.RandomNumbers(0, 10, 5)
for _, v := range ids {
fmt.Printf("%d", v)

View File

@ -203,31 +203,34 @@ func (this *ModelHero) resetJuexingProperty(hero *pb.DBHero) {
if len(awakenData.Phasebonus) != 2 {
continue
}
key := awakenData.Phasebonus[0]
value, err := strconv.Atoi(awakenData.Phasebonus[1])
if err != nil {
continue
}
switch key {
case comm.Hp:
hero.JuexProperty[comm.Hp] += int32(value)
case comm.Def:
hero.JuexProperty[comm.Def] += int32(value)
case comm.Atk:
hero.JuexProperty[comm.Atk] += int32(value)
case comm.Speed:
hero.JuexProperty[comm.Speed] += int32(value)
case comm.Cri:
hero.JuexProperty[comm.Cri] += int32(value)
case comm.ResonanceHpPro:
hero.JuexProperty[comm.Hp] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Hp])))
case comm.ResonanceAtkPro:
hero.JuexProperty[comm.Atk] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Atk])))
case comm.ResonanceDefPro:
hero.JuexProperty[comm.Def] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Def])))
default:
this.module.Errorf("unkonw Resonance property:%s", key)
for _, v := range awakenData.Phasebonus {
value, err := strconv.Atoi(v.S)
if err == nil {
continue
}
switch v.S {
case comm.Hp:
hero.JuexProperty[comm.Hp] += int32(value)
case comm.Def:
hero.JuexProperty[comm.Def] += int32(value)
case comm.Atk:
hero.JuexProperty[comm.Atk] += int32(value)
case comm.Speed:
hero.JuexProperty[comm.Speed] += int32(value)
case comm.Cri:
hero.JuexProperty[comm.Cri] += int32(value)
case comm.ResonanceHpPro:
hero.JuexProperty[comm.Hp] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Hp])))
case comm.ResonanceAtkPro:
hero.JuexProperty[comm.Atk] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Atk])))
case comm.ResonanceDefPro:
hero.JuexProperty[comm.Def] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Def])))
default:
this.module.Errorf("unkonw Resonance property:%s", v.S)
}
}
}
}

View File

@ -0,0 +1,37 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type Gamecompare struct {
S string
D int32
}
const TypeId_Gamecompare = -229713143
func (*Gamecompare) GetTypeId() int32 {
return -229713143
}
func (_v *Gamecompare)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; if _v.S, _ok_ = _buf["s"].(string); !_ok_ { err = errors.New("s error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["d"].(float64); !_ok_ { err = errors.New("d error"); return }; _v.D = int32(_tempNum_) }
return
}
func DeserializeGamecompare(_buf map[string]interface{}) (*Gamecompare, error) {
v := &Gamecompare{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}

View File

@ -15,7 +15,7 @@ type GameHeroAwakenData struct {
Hid string
Phase int32
Name string
Phasebonus []string
Phasebonus []*Gamecompare
Describe string
Icon string
Condition int32
@ -39,11 +39,11 @@ func (_v *GameHeroAwakenData)Deserialize(_buf map[string]interface{}) (err error
var _ok_ bool
if _arr_, _ok_ = _buf["phasebonus"].([]interface{}); !_ok_ { err = errors.New("phasebonus error"); return }
_v.Phasebonus = make([]string, 0, len(_arr_))
_v.Phasebonus = make([]*Gamecompare, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ string
{ if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } }
var _list_v_ *Gamecompare
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGamecompare(_x_); err != nil { return } }
_v.Phasebonus = append(_v.Phasebonus, _list_v_)
}
}