private List <DeliveryTable.DeliveryData> CreateClearedDliveryList(ARENA_RANK borderRank) { List <DeliveryTable.DeliveryData> list = new List <DeliveryTable.DeliveryData>(); List <ClearStatusDelivery> clearStatusDelivery = MonoBehaviourSingleton <DeliveryManager> .I.clearStatusDelivery; int i = 0; for (int count = clearStatusDelivery.Count; i < count; i++) { ClearStatusDelivery d = clearStatusDelivery[i]; if (d.deliveryStatus == 3) { DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)d.deliveryId); if (deliveryTableData.eventID == eventData.eventId && !Array.Exists(deliveryInfo, (Delivery x) => x.dId == d.deliveryId)) { ArenaTable.ArenaData arenaData = deliveryTableData.GetArenaData(); if (arenaData != null && arenaData.rank >= borderRank && deliveryTableData.GetConditionType(0u) != DELIVERY_CONDITION_TYPE.COMPLETE_DELIVERY_ID) { list.Add(deliveryTableData); if (deliveryTableData.clearEventID != 0) { string text = deliveryTableData.clearEventTitle; if (string.IsNullOrEmpty(text)) { text = deliveryTableData.name; } stories.Add(new Story((int)deliveryTableData.clearEventID, text)); } } } } } return(list); }
public bool IsClearTutorialDelivery(DeliveryTable.DeliveryData table, ClearStatusDelivery target_delivery_clear_status) { if (!TutorialStep.IsPlayingFirstBackHome() && !TutorialStep.IsPlayingFirstDelivery()) { return(false); } if (TutorialStep.IsPlayingFirstDelivery()) { if (table == null || table.needs == null) { return(false); } if (target_delivery_clear_status.needCount.Count < table.needs.Length) { return(false); } int i = 0; for (int num = table.needs.Length; i < num; i++) { if (target_delivery_clear_status.needCount[i] < (int)table.needs[i].needNum) { return(false); } } } return(true); }
public void UpdateClearStatuses(List <ClearStatusDelivery> clearStatusUpdateList) { if (clearStatusUpdateList != null && clearStatusUpdateList.Count > 0) { int i = 0; for (int count = clearStatusUpdateList.Count; i < count; i++) { ClearStatusDelivery clearStatusDelivery = clearStatusUpdateList[i]; if (clearStatusDelivery != null && clearStatusDelivery.deliveryId > 0) { ClearStatusDelivery clearStatusDelivery2 = this.clearStatusDelivery.Find((ClearStatusDelivery status) => status.deliveryId == clearStatusUpdateList[i].deliveryId); if (clearStatusDelivery2 == null || clearStatusDelivery2.deliveryId <= 0) { this.clearStatusDelivery.Add(clearStatusDelivery); CheckCompletableClearStatus(clearStatusDelivery); } else { bool flag = MonoBehaviourSingleton <DeliveryManager> .I.IsCompletableDelivery(clearStatusDelivery.deliveryId); clearStatusDelivery2.deliveryId = clearStatusDelivery.deliveryId; clearStatusDelivery2.deliveryStatus = clearStatusDelivery.deliveryStatus; clearStatusDelivery2.needCount = clearStatusDelivery.needCount; if (flag) { break; } CheckCompletableClearStatus(clearStatusDelivery2); } } } } }
public void OnDiff(BaseModelDiff.DiffClearStatusDelivery diff) { bool flag = false; if (Utility.IsExist(diff.add)) { diff.add.ForEach(delegate(ClearStatusDelivery data) { DeliveryManager deliveryManager2 = this; clearStatusDelivery.RemoveAll((ClearStatusDelivery find_data) => find_data.deliveryId == data.deliveryId); clearStatusDelivery.Add(data); CheckCompletableClearStatus(data); }); flag = true; } if (Utility.IsExist(diff.update)) { diff.update.ForEach(delegate(ClearStatusDelivery data) { DeliveryManager deliveryManager = this; ClearStatusDelivery clearStatusDelivery = this.clearStatusDelivery.Find((ClearStatusDelivery list_data) => list_data.deliveryId == data.deliveryId); clearStatusDelivery.deliveryId = data.deliveryId; clearStatusDelivery.deliveryStatus = data.deliveryStatus; clearStatusDelivery.needCount = data.needCount; CheckCompletableClearStatus(clearStatusDelivery); }); flag = true; } if (flag) { DirtyClearDelivery(); } }
private new List <DeliveryTable.DeliveryData> CreateClearedDliveryList() { List <DeliveryTable.DeliveryData> list = new List <DeliveryTable.DeliveryData>(); List <ClearStatusDelivery> clearStatusDelivery = MonoBehaviourSingleton <DeliveryManager> .I.clearStatusDelivery; int groupId = regionData.groupId; uint regionId = regionData.regionId; int i = 0; for (int count = clearStatusDelivery.Count; i < count; i++) { ClearStatusDelivery d = clearStatusDelivery[i]; if (d.deliveryStatus == 3) { DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)d.deliveryId); if ((deliveryTableData.type == DELIVERY_TYPE.STORY || deliveryTableData.type == DELIVERY_TYPE.ONCE) && (deliveryTableData.regionId == regionId || (groupId > 0 && deliveryTableData.regionId == groupId)) && !Array.Exists(deliveryInfo, (Delivery x) => x.dId == d.deliveryId)) { list.Add(deliveryTableData); if (deliveryTableData.clearEventID != 0) { string text = deliveryTableData.clearEventTitle; if (string.IsNullOrEmpty(text)) { text = deliveryTableData.name; } stories.Add(new Story((int)deliveryTableData.clearEventID, text)); } } } } return(list); }
protected virtual List <DeliveryTable.DeliveryData> CreateClearedDliveryList() { List <DeliveryTable.DeliveryData> list = new List <DeliveryTable.DeliveryData>(); List <ClearStatusDelivery> clearStatusDelivery = MonoBehaviourSingleton <DeliveryManager> .I.clearStatusDelivery; int i = 0; for (int count = clearStatusDelivery.Count; i < count; i++) { ClearStatusDelivery d = clearStatusDelivery[i]; if (d.deliveryStatus == 3) { DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)d.deliveryId); if (deliveryTableData.eventID == eventData.eventId && !Array.Exists(deliveryInfo, (Delivery x) => x.dId == d.deliveryId)) { list.Add(deliveryTableData); if (deliveryTableData.clearEventID != 0) { string value = deliveryTableData.clearEventTitle; if (string.IsNullOrEmpty(value)) { value = deliveryTableData.name; } stories.Add(new Story((int)deliveryTableData.clearEventID, value)); } } } } return(list); }
public CLEAR_STATUS GetClearStatusDelivery(uint deliveryId) { CLEAR_STATUS result = CLEAR_STATUS.NEW; ClearStatusDelivery clearStatusDelivery = this.clearStatusDelivery.Find((ClearStatusDelivery data) => data.deliveryId == deliveryId); if (clearStatusDelivery != null) { result = (CLEAR_STATUS)clearStatusDelivery.deliveryStatus; } return(result); }
public void GetAllProgressDelivery(int delivery_id, out int have, out int need) { have = 0; need = 0; ClearStatusDelivery clearStatusDelivery = this.clearStatusDelivery.Find((ClearStatusDelivery data) => data.deliveryId == delivery_id); if (clearStatusDelivery != null) { have = clearStatusDelivery.GetAllNeedCount(); } DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)delivery_id); if (deliveryTableData != null) { need = (int)deliveryTableData.GetAllNeedItemNum(); } }
private void CheckCompletableClearStatus(ClearStatusDelivery data) { if (MonoBehaviourSingleton <DeliveryManager> .I.IsCompletableDelivery(data.deliveryId)) { DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)data.deliveryId); if (!deliveryTableData.IsStoryDelivery() && deliveryTableData.GetConditionType(0u) != 0 && !IsDefeatFieldConditionType(deliveryTableData.GetConditionType(0u)) && !IsDeliveryArena(deliveryTableData) && MonoBehaviourSingleton <UIAnnounceBand> .IsValid()) { string empty = string.Empty; empty = ((!IsDeliveryBingo(deliveryTableData)) ? StringTable.Get(STRING_CATEGORY.DELIVERY_COMPLETE, 1u) : StringTable.Get(STRING_CATEGORY.DELIVERY_COMPLETE, 2u)); MonoBehaviourSingleton <UIAnnounceBand> .I.SetAnnounce(deliveryTableData.name, empty); SoundManager.PlayOneshotJingle(40000030, null, null); } CheckAnnounceHomeReturn(data.deliveryId); } }
private void AddDataCompleted(CardData cardData) { List <ClearStatusDelivery> clearStatusDelivery = MonoBehaviourSingleton <DeliveryManager> .I.clearStatusDelivery; int i = 0; for (int count = clearStatusDelivery.Count; i < count; i++) { ClearStatusDelivery clearStatusDelivery2 = clearStatusDelivery[i]; DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)clearStatusDelivery2.deliveryId); if (deliveryTableData == null) { Log.Warning("DeliveryTable Not Found : dId " + clearStatusDelivery2.deliveryId); } else if (deliveryTableData.IsEvent() && deliveryTableData.eventID == cardData.eventData.eventId && clearStatusDelivery2.deliveryStatus == 3) { AddMissionData(deliveryTableData, null, cardData, true); } } }
public bool IsCompletableDelivery(int delivery_id) { ClearStatusDelivery clearStatusDelivery = this.clearStatusDelivery.Find((ClearStatusDelivery data) => data.deliveryId == delivery_id); if (clearStatusDelivery == null) { return(false); } DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)delivery_id); int i = 0; for (int num = deliveryTableData.needs.Length; i < num; i++) { if (deliveryTableData.needs[i].IsValid() && clearStatusDelivery.GetNeedCount((uint)i) < (uint)deliveryTableData.needs[i].needNum) { return(false); } } return(true); }
public int ProgressDelivery(int delivery_id, int need_index, int add_num) { DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)delivery_id); ClearStatusDelivery clearStatusDelivery = this.clearStatusDelivery.Find((ClearStatusDelivery data) => data.deliveryId == delivery_id); if (clearStatusDelivery == null) { clearStatusDelivery = new ClearStatusDelivery(); clearStatusDelivery.deliveryId = delivery_id; if (deliveryTableData != null) { int i = 0; for (int num = deliveryTableData.needs.Length; i < num; i++) { clearStatusDelivery.needCount.Add(0); } } this.clearStatusDelivery.Add(clearStatusDelivery); } int num2 = clearStatusDelivery.needCount[need_index]; List <int> needCount; List <int> list = needCount = clearStatusDelivery.needCount; int index; int index2 = index = need_index; index = needCount[index]; list[index2] = index + add_num; if (clearStatusDelivery.needCount[need_index] > (int)deliveryTableData.needs[need_index].needNum) { clearStatusDelivery.needCount[need_index] = (int)deliveryTableData.needs[need_index].needNum; add_num = clearStatusDelivery.needCount[need_index] - num2; } if (IsClearTutorialDelivery(deliveryTableData, clearStatusDelivery) && UITutorialFieldHelper.IsValid()) { UITutorialFieldHelper.I.OnCollectItem(); } return(add_num); }