public static DropAnnounceInfo CreateItemInfo(uint id, int num, out bool is_rare) { is_rare = false; ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(id); if (itemData == null) { return(null); } DropAnnounceInfo dropAnnounceInfo = new DropAnnounceInfo(); int haveingItemNum = MonoBehaviourSingleton <InventoryManager> .I.GetHaveingItemNum(id); haveingItemNum = Mathf.Min(haveingItemNum, MonoBehaviourSingleton <UserInfoManager> .I.userInfo.constDefine.ITEM_NUM_MAX); dropAnnounceInfo.text = StringTable.Format(STRING_CATEGORY.IN_GAME, 2000u, itemData.name, num, haveingItemNum); if (!GameDefine.IsRare(itemData.rarity)) { dropAnnounceInfo.color = COLOR.NORMAL; } else { dropAnnounceInfo.color = COLOR.RARE; is_rare = true; } return(dropAnnounceInfo); }
public static bool IsRare(SortCompareData icon_base) { if (icon_base != null) { return(GameDefine.IsRare(icon_base.GetRarity())); } return(false); }
public override void Initialize() { object[] array = GameSection.GetEventData() as object[]; baseSkill = (array[0] as SkillItemInfo); SkillItemInfo[] array2 = array[1] as SkillItemInfo[]; material = new SkillItemInfo[array2.Length]; int i = 0; for (int num = array2.Length; i < num; i++) { material[i] = array2[i]; } total = (int)(baseSkill.growCost * (float)material.Length); isEquipConfirm = false; isRareConfirm = false; int j = 0; for (int num2 = material.Length; j < num2; j++) { if (isRareConfirm && isEquipConfirm && isExceedConfirm) { break; } if (!isRareConfirm && GameDefine.IsRare(material[j].tableData.rarity)) { isRareConfirm = true; } if (!isEquipConfirm && material[j].isAttached) { isEquipConfirm = true; } if (!isExceedConfirm && material[j].IsExceeded()) { isExceedConfirm = true; } } Array.Sort(material, delegate(SkillItemInfo l, SkillItemInfo r) { ulong num3 = (ulong)(((long)r.tableData.rarity << 61) + (long)((ulong)(uint)(-1 - (int)r.tableData.id) << 16) + r.level); ulong num4 = (ulong)(((long)l.tableData.rarity << 61) + (long)((ulong)(uint)(-1 - (int)l.tableData.id) << 16) + l.level); int num5 = (num3 != num4) ? ((num3 > num4) ? 1 : (-1)) : 0; if (num5 == 0) { num5 = ((r.exp != l.exp) ? ((r.exp > l.exp) ? 1 : (-1)) : 0); if (num5 == 0) { num5 = ((r.uniqueID != l.uniqueID) ? ((r.uniqueID > l.uniqueID) ? 1 : (-1)) : 0); } } return(num5); }); isExceed = baseSkill.IsLevelMax(); base.Initialize(); }
public override void Initialize() { List <AbilityItemSortData> source = GameSection.GetEventData() as List <AbilityItemSortData>; sellData = (from x in (IEnumerable <AbilityItemSortData>) source select(x)).ToList(); base.isRareConfirm = false; sellData.ForEach(delegate(SortCompareData sort_data) { if (!base.isRareConfirm && GameDefine.IsRare(sort_data.GetRarity())) { base.isRareConfirm = true; } }); base.Initialize(); }
public override void Initialize() { object[] array = GameSection.GetEventData() as object[]; tab = (ItemStorageTop.TAB_MODE)(int) array[0]; sellData = (array[1] as List <SortCompareData>); if (array.Length > 2) { goBackTo = (GO_BACK)(int)array[2]; } base.isRareConfirm = false; base.isEquipConfirm = false; base.isExceedConfirm = false; base.isExceedEquipmentConfirm = false; sellData.ForEach(delegate(SortCompareData sort_data) { if (!base.isRareConfirm || !base.isEquipConfirm || (!base.isExceedConfirm && !base.isExceedEquipmentConfirm)) { if (!base.isRareConfirm && GameDefine.IsRare(sort_data.GetRarity())) { base.isRareConfirm = true; } if (!base.isEquipConfirm && sort_data.IsEquipping()) { base.isEquipConfirm = true; } if (!base.isExceedConfirm && !base.isExceedEquipmentConfirm && sort_data.IsExceeded()) { if (sort_data.GetMaterialType() == REWARD_TYPE.EQUIP_ITEM) { base.isExceedEquipmentConfirm = true; } else { base.isExceedConfirm = true; } } } }); base.Initialize(); }
public static DropAnnounceInfo CreateEquipItemInfo(uint id, int num, out bool is_rare) { is_rare = false; EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData(id); if (equipItemData == null) { return(null); } DropAnnounceInfo dropAnnounceInfo = new DropAnnounceInfo(); dropAnnounceInfo.text = StringTable.Format(STRING_CATEGORY.IN_GAME, 2003u, equipItemData.name, num); if (!GameDefine.IsRare(equipItemData.rarity)) { dropAnnounceInfo.color = COLOR.NORMAL; } else { dropAnnounceInfo.color = COLOR.RARE; is_rare = true; } return(dropAnnounceInfo); }
private static UIDropAnnounce.COLOR GetColor(Coop_Model_EnemyDefeat model, List <InGameManager.DropDeliveryInfo> deliveryList) { UIDropAnnounce.COLOR cOLOR = UIDropAnnounce.COLOR.NORMAL; if (!model.dropLoungeShare) { switch (model.boxType) { case 1: return(UIDropAnnounce.COLOR.SP_N); case 2: return(UIDropAnnounce.COLOR.SP_HN); case 3: return(UIDropAnnounce.COLOR.SP_R); case 4: return(UIDropAnnounce.COLOR.HALLOWEEN); default: { int i = 0; for (int count = model.dropIds.Count; i < count; i++) { if (cOLOR == UIDropAnnounce.COLOR.NORMAL) { switch (model.dropTypes[i]) { case 5: cOLOR = UIDropAnnounce.COLOR.RARE; break; case 4: { EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData((uint)model.dropItemIds[i]); if (equipItemData != null && GameDefine.IsRare(equipItemData.rarity)) { cOLOR = UIDropAnnounce.COLOR.RARE; } break; } default: { ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData((uint)model.dropItemIds[i]); if (itemData != null && GameDefine.IsRare(itemData.rarity)) { cOLOR = UIDropAnnounce.COLOR.RARE; } break; } } } } if (deliveryList.Count > 0 && cOLOR == UIDropAnnounce.COLOR.NORMAL) { cOLOR = UIDropAnnounce.COLOR.DELIVERY; } return(cOLOR); } } } return(UIDropAnnounce.COLOR.LOUNGE); }