少年修仙传客户端代码仓库
client_linchunjie
2019-05-15 72e523a3bde7c345d4a7dbd24d3571328c18d184
3335 任务反馈修改
1个文件已修改
47 ■■■■■ 已修改文件
System/MainInterfacePanel/TaskFeedbackModel.cs 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/TaskFeedbackModel.cs
@@ -79,6 +79,24 @@
                            }
                        }
                        break;
                    case TaskFeedbackType.ItemCount:
                        {
                            var array = LitJson.JsonMapper.ToObject<int[][]>(config.condition);
                            if (array != null)
                            {
                                List<Item> items = new List<Item>();
                                for (int i = 0; i < array.Length; i++)
                                {
                                    items.Add(new Item()
                                    {
                                        id = array[i][0],
                                        count = array[i][1],
                                    });
                                }
                                feedback.items = items;
                            }
                        }
                        break;
                }
                m_TaskFeedbacks.Add(config.taskId, feedback);
@@ -103,6 +121,7 @@
                    case TaskFeedbackType.ReikiPoint:
                    case TaskFeedbackType.Guide:
                    case TaskFeedbackType.Equip:
                    case TaskFeedbackType.ItemCount:
                        {
                            int condition = 0;
                            if (IsSatisfyCondition(feedback, out condition))
@@ -211,18 +230,34 @@
                case TaskFeedbackType.ReikiPoint:
                    return reikiRootModel.GetReikiRootTotalPoint() >= feedback.condition;
                case TaskFeedbackType.Equip:
                    var items = packModel.GetItems(PackType.Item, new SinglePack.FilterParams()
                    {
                        levels = new List<int>() { feedback.equipCondition[0] },
                        qualitys = new List<int>() { feedback.equipCondition[1] },
                    });
                    return items != null && items.Count > 0;
                        var items = packModel.GetItems(PackType.Item, new SinglePack.FilterParams()
                        {
                            levels = new List<int>() { feedback.equipCondition[0] },
                            qualitys = new List<int>() { feedback.equipCondition[1] },
                        });
                        return items != null && items.Count > 0;
                    }
                case TaskFeedbackType.Copper:
                    return PlayerDatas.Instance.baseData.allCopper >= (ulong)feedback.condition;
                case TaskFeedbackType.Guide:
                    return true;
                case TaskFeedbackType.FightPowerSideTask:
                    return PlayerDatas.Instance.baseData.FightPoint >= feedback.condition;
                case TaskFeedbackType.ItemCount:
                    {
                        if (feedback.items != null)
                        {
                            foreach (var item in feedback.items)
                            {
                                if (packModel.GetItemCountByID(PackType.Item, item.id) < item.count)
                                {
                                    return false;
                                }
                            }
                        }
                        return true;
                    }
            }
            return false;
        }
@@ -253,6 +288,7 @@
        public int condition;
        public List<int[]> sideTasks;
        public int[] equipCondition;
        public List<Item> items;
    }
    public enum TaskFeedbackType
@@ -264,6 +300,7 @@
        Copper = 5,
        Guide = 6,
        FightPowerSideTask = 7,
        ItemCount = 8,
    }
}