Exemplo n.º 1
0
        public void Effect(Forms.BasePanel panel, 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 == "mon")
            {
                PeopleBook.Fight(infos[0], "oneline", mlevel + infos[1], new PeopleFightParm(), success, fail, null);
                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();
        }
Exemplo n.º 2
0
        public void CheckEvent(Forms.BasePanel panel, int x, int y, HsActionCallback success, HsActionCallback fail)
        {
            int idex;

            if ((idex = GetItemIndex(x, y)) >= 0)
            {
                items[idex].Effect(panel, success, fail);
            }
        }