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(); }
private void virtualRegion_RegionEntered(int id, int x, int y, int key) { if (id >= 20) { if (key > 0) { Image image = BlessBook.GetPreview(key); tooltip.Show(image, parent, x, y); } } else if (id == 10) { Image image = GetPlayerImage(); tooltip.Show(image, parent, 0, 50); } else if (id == 11) { Image image = GetSceneImage(); tooltip.Show(image, parent, width - image.Width, 35); } else if (id < 10) { var resName = HSTypes.I2Resource(id - 1); string resStr = string.Format("{0}:{1}", resName, UserProfile.Profile.InfoBag.Resource.Get((GameResourceType)(id - 1))); Image image = DrawTool.GetImageByString(resStr, 100); tooltip.Show(image, parent, x, y); } }
internal void AddResource(GameResourceType type, uint value) { Resource.Add(type, (int)value); if (type > 0) { MainTipManager.AddTip(string.Format("|获得|{0}|{1}||x{2}", HSTypes.I2ResourceColor((int)type), HSTypes.I2Resource((int)type), value), "White"); AchieveBook.CheckByCheckType("resource"); } }
public void AddResource(int[] res) { Resource.Gold += res[0]; Resource.Lumber += res[1]; Resource.Stone += res[2]; Resource.Mercury += res[3]; Resource.Carbuncle += res[4]; Resource.Sulfur += res[5]; Resource.Gem += res[6]; for (int i = 0; i < 7; i++) { if (res[i] > 0) { MainTipManager.AddTip(string.Format("|获得|{0}|{1}||x{2}", HSTypes.I2ResourceColor(i), HSTypes.I2Resource(i), res[i]), "White"); } } AchieveBook.CheckByCheckType("resource"); }
internal void AddResource(GameResourceType type, uint value) { Resource.Add(type, value); MainTipManager.AddTip(string.Format("|获得|{0}|{1}||x{2}", HSTypes.I2ResourceColor((int)type), HSTypes.I2Resource((int)type), value), "White"); }