上传战斗优化

This commit is contained in:
liwei1dao 2023-05-12 20:50:41 +08:00
parent 1cd38733aa
commit 7a331ccefb
5 changed files with 911 additions and 679 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,93 @@
[
{
"id": 122,
"title": {
"key": "jump_explain122",
"text": "金币商店"
},
"desc": {
"key": "jump_explain122",
"text": "金币商店"
},
"jumpid": 122,
"icon": "icon_sd"
},
{
"id": 123,
"title": {
"key": "jump_explain123",
"text": "钻石商店"
},
"desc": {
"key": "jump_explain123",
"text": "钻石商店"
},
"jumpid": 123,
"icon": "zc_icon_04_ct"
},
{
"id": 124,
"title": {
"key": "jump_explain124",
"text": "友情商店"
},
"desc": {
"key": "jump_explain124",
"text": "友情商店"
},
"jumpid": 124,
"icon": "zc_icon_04_ct"
},
{
"id": 125,
"title": {
"key": "jump_explain125",
"text": "竞技商店"
},
"desc": {
"key": "jump_explain125",
"text": "竞技商店"
},
"jumpid": 125,
"icon": "zc_icon_04_ct"
},
{
"id": 126,
"title": {
"key": "jump_explain126",
"text": "公会商店"
},
"desc": {
"key": "jump_explain126",
"text": "公会商店"
},
"jumpid": 126,
"icon": "zc_icon_04_ct"
},
{
"id": 1127,
"title": {
"key": "jump_explain1127",
"text": "特殊商店"
},
"desc": {
"key": "jump_explain1127",
"text": "特殊商店"
},
"jumpid": 1127,
"icon": "zc_icon_04_ct"
},
{
"id": 1128,
"title": {
"key": "jump_explain1128",
"text": "铁匠商店"
},
"desc": {
"key": "jump_explain1128",
"text": "铁匠商店"
},
"jumpid": 1128,
"icon": "zc_icon_04_ct"
}
]

View File

@ -9,3 +9,123 @@ type (
BattleFinish(out *pb.BattleFinishPush)
}
)
func AttributesTransBase(attr string) int32 {
basearrt := int32(0)
switch attr {
case "hp":
basearrt = 53
break
case "atk":
basearrt = 56
break
case "def":
basearrt = 59
break
case "hppro":
break
case "atkpro":
break
case "defpro":
break
case "speed":
basearrt = 62
break
case "cri":
basearrt = 65
break
case "cridam":
basearrt = 68
break
case "effhit":
basearrt = 71
break
case "effre":
basearrt = 74
break
case "losthold":
basearrt = 11
break
case "understand":
basearrt = 12
break
case "damre":
basearrt = 13
break
case "causedam":
basearrt = 14
break
case "treadd":
basearrt = 15
break
case "betreadd":
basearrt = 16
break
case "suckblood":
basearrt = 102
break
case "speedpro":
break
}
return basearrt
}
func AttributesTransExt(attr string) int32 {
basearrt := int32(0)
switch attr {
case "hp":
basearrt = 77
break
case "atk":
basearrt = 80
break
case "def":
basearrt = 83
break
case "hppro":
break
case "atkpro":
break
case "defpro":
break
case "speed":
basearrt = 86
break
case "cri":
basearrt = 89
break
case "cridam":
basearrt = 92
break
case "effhit":
basearrt = 95
break
case "effre":
basearrt = 98
break
case "losthold":
basearrt = 11
break
case "understand":
basearrt = 12
break
case "damre":
basearrt = 13
break
case "causedam":
basearrt = 14
break
case "treadd":
basearrt = 15
break
case "betreadd":
basearrt = 16
break
case "suckblood":
basearrt = 102
break
case "speedpro":
break
}
return basearrt
}

View File

@ -672,20 +672,36 @@ func (this *modelBattleComp) createBattleRole(hero *pb.DBHero, tid, pos int) (ro
CaptainSkill: hero.CaptainSkill,
NormalSkill: hero.NormalSkill,
EquipSkill: hero.EquipSkill,
Property: make(map[string]int32),
Property: make(map[int32]int32),
}
for k, v := range hero.Property {
role.Property[k] += v
arrt := AttributesTransBase(k)
role.Property[arrt] += v
if k == comm.Hp {
role.Currhp += v
}
}
for k, v := range hero.AddProperty {
role.Property[k] += v
arrt := AttributesTransExt(k)
role.Property[arrt] += v
if k == comm.Hp {
role.Currhp += v
}
}
for k, v := range hero.JuexProperty {
role.Property[k] += v
arrt := AttributesTransExt(k)
role.Property[arrt] += v
if k == comm.Hp {
role.Currhp += v
}
}
for k, v := range hero.HoroscopeProperty {
role.Property[k] += v
arrt := AttributesTransExt(k)
role.Property[arrt] += v
if k == comm.Hp {
role.Currhp += v
}
}
if hero.SuiteId != 0 { //主套装
if suit, err := this.module.configure.Getequipsuit(hero.SuiteId); err != nil {
@ -703,7 +719,6 @@ func (this *modelBattleComp) createBattleRole(hero *pb.DBHero, tid, pos int) (ro
role.SubSuitSkill = suit.Skill
}
}
role.Currhp = role.Property[comm.Hp]
return
}
@ -744,7 +759,7 @@ func (this *modelBattleComp) createMasterRoles(comp, wheel int, fid int32) (capt
Lv: hero.Lv,
CaptainSkill: hero.CaptainSkill,
NormalSkill: hero.NormalSkill,
Property: hero.Property,
Property: make(map[int32]int32),
Isboos: v.IsBoss,
Monsterid: v.Monster,
}
@ -775,11 +790,15 @@ func (this *modelBattleComp) createMasterRoles(comp, wheel int, fid int32) (capt
roles[i].SubSuitSkill = suit.Skill
}
}
roles[i].Property[comm.Hp] = int32(float32(roles[i].Property[comm.Hp]) * v.Hppro)
roles[i].Property[comm.Atk] = int32(float32(roles[i].Property[comm.Atk]) * v.Atkpro)
roles[i].Property[comm.Def] = int32(float32(roles[i].Property[comm.Def]) * v.Defpro)
roles[i].Property[comm.Speed] = monst.Speed
roles[i].Currhp = roles[i].Property[comm.Hp]
hero.Property[comm.Hp] = int32(float32(hero.Property[comm.Hp]) * v.Hppro)
hero.Property[comm.Atk] = int32(float32(hero.Property[comm.Atk]) * v.Atkpro)
hero.Property[comm.Def] = int32(float32(hero.Property[comm.Def]) * v.Defpro)
hero.Property[comm.Speed] = monst.Speed
for k, v := range hero.Property {
arrt := AttributesTransBase(k)
roles[i].Property[arrt] = v
}
roles[i].Currhp = hero.Property[comm.Hp]
}
}
}

View File

@ -281,7 +281,7 @@ type BattleRole struct {
NormalSkill []*SkillData `protobuf:"bytes,10,rep,name=normalSkill,proto3" json:"normalSkill" bson:"normalSkill"` //普通技能
EquipSkill []*SkillData `protobuf:"bytes,11,rep,name=equipSkill,proto3" json:"equipSkill" bson:"equipSkill"` //普通技能
PandaBuff int32 `protobuf:"varint,12,opt,name=PandaBuff,proto3" json:"PandaBuff"` //熊猫buff技能id
Property map[string]int32 `protobuf:"bytes,13,rep,name=property,proto3" json:"property" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 属性相关
Property map[int32]int32 `protobuf:"bytes,13,rep,name=property,proto3" json:"property" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //基础属性
Ishelp bool `protobuf:"varint,14,opt,name=ishelp,proto3" json:"ishelp"` //是否是助战英雄
Isboos int32 `protobuf:"varint,15,opt,name=isboos,proto3" json:"isboos"` //是否是boos
Monsterid int32 `protobuf:"varint,16,opt,name=monsterid,proto3" json:"monsterid"` //怪物id
@ -404,7 +404,7 @@ func (x *BattleRole) GetPandaBuff() int32 {
return 0
}
func (x *BattleRole) GetProperty() map[string]int32 {
func (x *BattleRole) GetProperty() map[int32]int32 {
if x != nil {
return x.Property
}
@ -694,7 +694,7 @@ var file_battle_battle_db_proto_rawDesc = []byte{
0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x72, 0x68, 0x70, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05,
0x52, 0x06, 0x63, 0x75, 0x72, 0x72, 0x68, 0x70, 0x1a, 0x3b, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x70,
0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x9e, 0x01, 0x0a, 0x0d, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74,
0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70,