数数打点修复
This commit is contained in:
parent
3580537335
commit
7b0ce97ca8
@ -417,7 +417,7 @@ func ReqDecorateAll(player *Player, buf []byte) error {
|
||||
return errors.New("等级不足")
|
||||
}
|
||||
PlayerBaseMod := player.GetPlayerBaseMod()
|
||||
CostItem, AddItem, DecorateNum, DecorateList := DecorateMod.DecorateAll(PlayerBaseMod.GetStar())
|
||||
CostItem, AddItem, DecorateNum, DecorateList, Log := DecorateMod.DecorateAll(PlayerBaseMod.GetStar())
|
||||
err := player.HandleItem(CostItem, msg.ITEM_POP_LABEL_DecorateCost.String()) // 扣除道具
|
||||
if err != nil {
|
||||
player.SendErrClienRes(&msg.ResDecorateAll{
|
||||
@ -449,6 +449,13 @@ func ReqDecorateAll(player *Player, buf []byte) error {
|
||||
"deco_step_id": DecorateList,
|
||||
})
|
||||
|
||||
if len(Log) > 0 {
|
||||
for _, v := range Log {
|
||||
player.TeLog("scene_reward", v.(map[string]interface{}))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
player.PlayMod.save()
|
||||
player.PushClientRes(DecorateMod.BackData())
|
||||
player.PushClientRes(&msg.ResDecorate{
|
||||
|
||||
@ -53,13 +53,14 @@ func (d *Decorate) GetDecorateCostItem(AreaId, DecorateId int) []*item.Item {
|
||||
return []*item.Item{item.NewItem(item.ITEM_STAR_ID, -Item)}
|
||||
}
|
||||
|
||||
func (d *Decorate) DecorateAll(Star int) ([]*item.Item, []*item.Item, int, []int) {
|
||||
func (d *Decorate) DecorateAll(Star int) ([]*item.Item, []*item.Item, int, []int, []interface{}) {
|
||||
DecorateAll := decorateCfg.GetAllSortIdByAreaId(d.AreaId)
|
||||
SubAlice := GoUtil.SubSlices(DecorateAll, GoUtil.MapIntToIntSlice(d.FinishList))
|
||||
sort.Ints(SubAlice)
|
||||
SubItem := 0
|
||||
AddItem := make([]*item.Item, 0)
|
||||
DecorateList := make([]int, 0)
|
||||
Log := make([]interface{}, 0)
|
||||
Num := 0
|
||||
for _, v := range SubAlice {
|
||||
|
||||
@ -74,6 +75,20 @@ func (d *Decorate) DecorateAll(Star int) ([]*item.Item, []*item.Item, int, []int
|
||||
d.DecorateNum++
|
||||
Num++
|
||||
Item := decorateCfg.GetProgressReward(d.AreaId, d.Progress)
|
||||
if len(Item) > 0 {
|
||||
if d.Progress >= len(DecorateAll) {
|
||||
Log = append(Log, map[string]interface{}{
|
||||
"deco_step_id": fmt.Sprintf("%d_%d", d.AreaId+1, 0),
|
||||
"item_list": AddItem,
|
||||
})
|
||||
} else {
|
||||
Log = append(Log, map[string]interface{}{
|
||||
"deco_step_id": fmt.Sprintf("%d_%d", d.AreaId, d.Progress),
|
||||
"item_list": AddItem,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
AddItem = append(AddItem, Item...)
|
||||
DecorateList = append(DecorateList, v)
|
||||
}
|
||||
@ -84,7 +99,7 @@ func (d *Decorate) DecorateAll(Star int) ([]*item.Item, []*item.Item, int, []int
|
||||
d.FinishList = make(map[int]struct{})
|
||||
}
|
||||
|
||||
return []*item.Item{item.NewItem(item.ITEM_STAR_ID, -SubItem)}, AddItem, Num, DecorateList
|
||||
return []*item.Item{item.NewItem(item.ITEM_STAR_ID, -SubItem)}, AddItem, Num, DecorateList, Log
|
||||
}
|
||||
|
||||
// 获取装饰信息
|
||||
|
||||
Loading…
Reference in New Issue
Block a user