Exemple #1
0
 public void Effect(Forms.BasePanel panel, string tile, HsActionCallback success, HsActionCallback fail)
 {
     if (type == "item")
     {
         UserProfile.InfoBag.AddItem(infos[0], 1);
         HItemConfig itemConfig = ConfigData.GetHItemConfig(infos[0]);
         panel.AddFlowCenter(string.Format("获得{0}x1", itemConfig.Name), HSTypes.I2RareColor(itemConfig.Rare));
     }
     else if (type == "task")
     {
         UserProfile.InfoTask.SetTaskStateById(infos[0], 2);
         panel.AddFlowCenter(string.Format("任务{0}达成", ConfigData.GetTaskConfig(infos[0]).Name), "White");
     }
     else if (type == "mon")
     {
         PeopleBook.Fight(infos[0], tile, -1, mlevel + infos[1], success, fail);
         return;
     }
     else if (type == "gold")
     {
         UserProfile.InfoBag.AddResource(GameResourceType.Gold, (uint)infos[0]);
         panel.AddFlowCenter(string.Format("获得黄金x{0}", infos[0]), HSTypes.I2ResourceColor(0));
     }
     else if (type == "resource")
     {
         UserProfile.InfoBag.AddResource((GameResourceType)(infos[0] - 1), 1);
         panel.AddFlowCenter(string.Format("获得{1}x{0}", 1, HSTypes.I2Resource(infos[0] - 1)), HSTypes.I2ResourceColor(infos[0] - 1));
     }
     string word = MazeItemConfig.Word;
     if (word != "")
     {
         panel.AddFlowCenter(word, "White");
     }
     success();
 }