Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
02781c5f70
@ -394,34 +394,33 @@ func (this *modelEquipmentComp) upgradeEquipment(equipment *pb.DB_Equipment, equ
|
|||||||
equipment.MainEntry.Lv++
|
equipment.MainEntry.Lv++
|
||||||
equipment.MainEntry.Value = equipment.MainEntry.BaseValue + int32(math.Floor(float64(equipment.MainEntry.BaseValue*intensify.Bonus)/1000.0))
|
equipment.MainEntry.Value = equipment.MainEntry.BaseValue + int32(math.Floor(float64(equipment.MainEntry.BaseValue*intensify.Bonus)/1000.0))
|
||||||
if intensify.Activation { //不触发副词条变化
|
if intensify.Activation { //不触发副词条变化
|
||||||
if len(equipment.AdverbEntry) < 4 { //去随机副词条
|
if equip.EquipId == 1 {
|
||||||
var (
|
if len(equipment.AdverbEntry) < 4 { //去随机副词条
|
||||||
temp []*cfg.GameEquipAttrlibrarySData
|
var (
|
||||||
sattr []*cfg.GameEquipAttrlibrarySData
|
temp []*cfg.GameEquipAttrlibrarySData
|
||||||
equipatt *cfg.GameEquipAttributeData
|
sattr []*cfg.GameEquipAttrlibrarySData
|
||||||
)
|
)
|
||||||
if temp, err = this.module.configure.GetEquipmentAttrlibraryConfigureById(equip.Addlibrary); err != nil {
|
if temp, err = this.module.configure.GetEquipmentAttrlibraryConfigureById(equip.Addlibrary); err != nil {
|
||||||
this.module.Errorf("升级服务错误 读取副词条配置错误!")
|
this.module.Errorf("升级服务错误 读取副词条配置错误!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//检索出未使用的词条
|
//检索出未使用的词条
|
||||||
for _, v := range temp {
|
for _, v := range temp {
|
||||||
iskeep := false
|
iskeep := false
|
||||||
for _, v1 := range equipment.AdverbEntry {
|
for _, v1 := range equipment.AdverbEntry {
|
||||||
if v.Attr.A == v1.AttrName {
|
if v.Attr.A == v1.AttrName {
|
||||||
|
iskeep = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if v.Attr.A == equipment.MainEntry.AttrName {
|
||||||
iskeep = true
|
iskeep = true
|
||||||
}
|
}
|
||||||
|
if !iskeep {
|
||||||
|
sattr = append(sattr, v)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if v.Attr.A == equipment.MainEntry.AttrName {
|
if len(sattr) > 0 {
|
||||||
iskeep = true
|
index := comm.RandShuffle(len(sattr))[0]
|
||||||
}
|
|
||||||
if !iskeep {
|
|
||||||
sattr = append(sattr, v)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(sattr) > 0 {
|
|
||||||
index := comm.RandShuffle(len(sattr))[0]
|
|
||||||
if equip.EquipId == 1 {
|
|
||||||
equipment.AdverbEntry = append(equipment.AdverbEntry, &pb.EquipmentAttributeEntry{
|
equipment.AdverbEntry = append(equipment.AdverbEntry, &pb.EquipmentAttributeEntry{
|
||||||
Id: sattr[index].Key,
|
Id: sattr[index].Key,
|
||||||
Libraryid: sattr[index].Libraryid,
|
Libraryid: sattr[index].Libraryid,
|
||||||
@ -431,28 +430,9 @@ func (this *modelEquipmentComp) upgradeEquipment(equipment *pb.DB_Equipment, equ
|
|||||||
BaseValue: sattr[index].Attr.N,
|
BaseValue: sattr[index].Attr.N,
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
} else {
|
|
||||||
if equipatt, err = this.module.configure.getEquipAttribute(sattr[index].Skill); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if equipatt.SkillId == 0 {
|
|
||||||
err = fmt.Errorf("equipatt:%d skill is 0", sattr[index].Attr.A)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
equipment.Adverbskill = append(equipment.Adverbskill, &pb.EquipmentSkillEntry{
|
|
||||||
Id: sattr[index].Key,
|
|
||||||
Libraryid: sattr[index].Libraryid,
|
|
||||||
AttrName: sattr[index].Attr.A,
|
|
||||||
SkillId: equipatt.SkillId,
|
|
||||||
Lv: 1,
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if equip.EquipId == 1 {
|
|
||||||
if len(equipment.AdverbEntry) <= 0 {
|
if len(equipment.AdverbEntry) <= 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -467,8 +447,54 @@ func (this *modelEquipmentComp) upgradeEquipment(equipment *pb.DB_Equipment, equ
|
|||||||
}
|
}
|
||||||
equipment.AdverbEntry[index].Lv++
|
equipment.AdverbEntry[index].Lv++
|
||||||
} else {
|
} else {
|
||||||
|
if len(equipment.Adverbskill) < 4 { //去随机副词条
|
||||||
|
var (
|
||||||
|
temp []*cfg.GameEquipAttrlibrarySData
|
||||||
|
sattr []*cfg.GameEquipAttrlibrarySData
|
||||||
|
equipatt *cfg.GameEquipAttributeData
|
||||||
|
)
|
||||||
|
if temp, err = this.module.configure.GetEquipmentAttrlibraryConfigureById(equip.Addlibrary); err != nil {
|
||||||
|
this.module.Errorf("升级服务错误 读取副词条配置错误!")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//检索出未使用的词条
|
||||||
|
for _, v := range temp {
|
||||||
|
iskeep := false
|
||||||
|
for _, v1 := range equipment.Adverbskill {
|
||||||
|
if v.Skill == v1.AttrName {
|
||||||
|
iskeep = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !iskeep {
|
||||||
|
sattr = append(sattr, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(sattr) > 0 {
|
||||||
|
index := comm.RandShuffle(len(sattr))[0]
|
||||||
|
if equipatt, err = this.module.configure.getEquipAttribute(sattr[index].Skill); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if equipatt.SkillId == 0 {
|
||||||
|
err = fmt.Errorf("equipatt:%d skill is 0", sattr[index].Attr.A)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
equipment.Adverbskill = append(equipment.Adverbskill, &pb.EquipmentSkillEntry{
|
||||||
|
Id: sattr[index].Key,
|
||||||
|
Libraryid: sattr[index].Libraryid,
|
||||||
|
AttrName: sattr[index].Skill,
|
||||||
|
SkillId: equipatt.SkillId,
|
||||||
|
Lv: 1,
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(equipment.Adverbskill) <= 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
index := comm.RandShuffle(len(equipment.Adverbskill))[0]
|
index := comm.RandShuffle(len(equipment.Adverbskill))[0]
|
||||||
equipment.Adverbskill[index].Lv++
|
equipment.Adverbskill[index].Lv++
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user