Beispiel #1
0
        public static void Initialize(Config config)
        {
            QuestTable.Load("res/QuestClient.json");
            ItemTable.Load("res/ItemClient.json", "res/UseItemClient.json");
            VehicleTable.Load("res/VehicleUpgrade.json", "res/VehicleList.json");
            AssistTable.Load("res/AssistClient.json");

            Log.WriteLine("Loaded resources.");
        }
Beispiel #2
0
        public IQuestTable Execute(QuestID id)
        {
            using (var r = ExecuteReader(id))
            {
                if (!r.Read())
                    return null;

                var ret = new QuestTable();
                ret.ReadValues(r);
                return ret;
            }
        }
Beispiel #3
0
        /// <summary>
        /// Creates an instance of a quest given the accordingly table containing the information.
        /// </summary>
        /// <param name="questTable"></param>
        public Quest(QuestTable questTable)
        {
            Name = questTable.Name;
            Description = questTable.Description;
            QuestId = questTable.QuestTableId;
            CanRepeat = questTable.CanRepeat;

            // Load up requirements
            LoadStartRequirements(questTable);
            LoadFinishRequirements(questTable);
            LoadRewards(questTable);
        }
Beispiel #4
0
        public IQuestTable Execute(QuestID id)
        {
            using (var r = ExecuteReader(id))
            {
                if (!r.Read())
                {
                    return(null);
                }

                var ret = new QuestTable();
                ret.ReadValues(r);
                return(ret);
            }
        }
Beispiel #5
0
    private void Start()
    {
        //IL_0001: Unknown result type (might be due to invalid IL or missing references)
        this.get_gameObject().SetActive(IsEnable());
        if (IsEnable())
        {
            int num     = QuestTable.GetSameRushQuestData((uint)MonoBehaviourSingleton <InGameManager> .I.rushId).Count - 1;
            int waveNum = MonoBehaviourSingleton <InGameManager> .I.GetWaveNum(0);

            waveMax.text = "/" + string.Format(StringTable.Get(STRING_CATEGORY.RUSH_WAVE, 10004400u), waveNum + num - 1);
            wave         = MonoBehaviourSingleton <InGameManager> .I.GetCurrentWaveNum();

            SetWaveNow(wave);
        }
    }
        public void ReplaceAll(System.Collections.Generic.IList <Quest> data)
        {
            var newData = CloneAndSortBy(data, x => x.Id, System.Collections.Generic.Comparer <int> .Default);
            var table   = new QuestTable(newData);

            memory = new MemoryDatabase(
                table,
                memory.ItemTable,
                memory.MonsterTable,
                memory.PersonTable,
                memory.Test1Table,
                memory.Test2Table

                );
        }
        public void Diff(Quest[] addOrReplaceData)
        {
            var data    = DiffCore(memory.QuestTable.GetRawDataUnsafe(), addOrReplaceData, x => x.Id, System.Collections.Generic.Comparer <int> .Default);
            var newData = CloneAndSortBy(data, x => x.Id, System.Collections.Generic.Comparer <int> .Default);
            var table   = new QuestTable(newData);

            memory = new MemoryDatabase(
                table,
                memory.ItemTable,
                memory.MonsterTable,
                memory.PersonTable,
                memory.Test1Table,
                memory.Test2Table

                );
        }
        public void RemoveQuest(int[] keys)
        {
            var data    = RemoveCore(memory.QuestTable.GetRawDataUnsafe(), keys, x => x.Id, System.Collections.Generic.Comparer <int> .Default);
            var newData = CloneAndSortBy(data, x => x.Id, System.Collections.Generic.Comparer <int> .Default);
            var table   = new QuestTable(newData);

            memory = new MemoryDatabase(
                table,
                memory.ItemTable,
                memory.MonsterTable,
                memory.PersonTable,
                memory.Test1Table,
                memory.Test2Table

                );
        }
 public MemoryDatabase(
     QuestTable QuestTable,
     ItemTable ItemTable,
     MonsterTable MonsterTable,
     PersonTable PersonTable,
     Test1Table Test1Table,
     Test2Table Test2Table
     )
 {
     this.QuestTable   = QuestTable;
     this.ItemTable    = ItemTable;
     this.MonsterTable = MonsterTable;
     this.PersonTable  = PersonTable;
     this.Test1Table   = Test1Table;
     this.Test2Table   = Test2Table;
 }
Beispiel #10
0
        public void GeneralTest()
        {
            var questTable = new QuestTable();
            var player     = new Player();
            var quest      = new Quest(player);

            quest.AddObserver(questTable);
            var commandCreator = new QuestCommandCreator(quest);

            player.AddObserver(commandCreator);

            quest.RunQuest();
            quest.Run();

            Assert.AreEqual(quest.State, QuestState.Completed);
        }
    private void CreateFloorPopText()
    {
        int count = questIdList.Count;
        int num   = 0;

        maxFloorList = new string[count];
        minFloorList = new string[count];
        for (int i = 0; i < count; i++)
        {
            minFloorList[i] = (num + 1).ToString();
            QuestTable.QuestTableData questData = Singleton <QuestTable> .I.GetQuestData((uint)questIdList[i]);

            List <QuestTable.QuestTableData> sameRushQuestData = QuestTable.GetSameRushQuestData(questData.rushId);
            int num2 = sameRushQuestData.Count - 1;
            num            += num2;
            maxFloorList[i] = num.ToString();
        }
    }
    private void UpdateRecommendQuestPriority(QuestTable.QuestTableData[] quest_table, QuestTable.QuestTableData _table, bool is_order, out bool find_unknown_quest)
    {
        find_unknown_quest = false;
        if (!is_order && !IsOpenedQuest(_table))
        {
            find_unknown_quest = true;
        }
        else
        {
            if (is_order)
            {
                QuestItemInfo questItem = MonoBehaviourSingleton <InventoryManager> .I.GetQuestItem(_table.questID);

                if (questItem == null)
                {
                    return;
                }
                int questNum = QuestTable.GetQuestNum(questItem);
                if (questNum <= 0)
                {
                    return;
                }
            }
            for (int i = 0; i < 2; i++)
            {
                if (quest_table[i] == null)
                {
                    quest_table[i] = _table;
                    if (i != 0)
                    {
                        SortRecommendQuest(quest_table, _table, is_order);
                    }
                    return;
                }
            }
            int num = 1;
            if (IsSelectPriorityQuestInfo(quest_table[num], _table))
            {
                SortRecommendQuest(quest_table, _table, is_order);
            }
        }
    }
Beispiel #13
0
    protected IEnumerator StartPredownload()
    {
        SetActive((Enum)UI.BTN_JOIN, false);
        SetActive((Enum)UI.BTN_CREATE, false);
        SetActive((Enum)UI.BTN_AUTO_MATCHING, false);
        SetActive((Enum)UI.BTN_JOIN_OFF, false);
        SetActive((Enum)UI.BTN_CREATE_OFF, false);
        SetActive((Enum)UI.BTN_AUTO_MATCHING_OFF, false);
        List <ResourceInfo> list = new List <ResourceInfo>();
        List <QuestTable.QuestTableData> targetQuest = QuestTable.GetSameRushQuestData(info.GetQuestData().rushId);

        targetQuest.Remove(info.GetQuestData());
        foreach (QuestTable.QuestTableData item2 in targetQuest)
        {
            uint mapId = item2.mapId;
            FieldMapTable.FieldMapTableData fieldMapData = Singleton <FieldMapTable> .I.GetFieldMapData(mapId);

            if (fieldMapData == null)
            {
                yield break;
            }
            string stageName = fieldMapData.stageName;
            if (string.IsNullOrEmpty(stageName))
            {
                stageName = "ST011D_01";
            }
            StageTable.StageData stageData = Singleton <StageTable> .I.GetData(stageName);

            if (stageData == null)
            {
                yield break;
            }
            list.Add(new ResourceInfo(RESOURCE_CATEGORY.STAGE_SCENE, stageData.scene));
            list.Add(new ResourceInfo(RESOURCE_CATEGORY.STAGE_SKY, stageData.sky));
            if (!string.IsNullOrEmpty(stageData.cameraLinkEffect))
            {
                list.Add(new ResourceInfo(RESOURCE_CATEGORY.EFFECT_ACTION, stageData.cameraLinkEffect));
            }
            if (!string.IsNullOrEmpty(stageData.cameraLinkEffectY0))
            {
                list.Add(new ResourceInfo(RESOURCE_CATEGORY.EFFECT_ACTION, stageData.cameraLinkEffectY0));
            }
            if (!string.IsNullOrEmpty(stageData.rootEffect))
            {
                list.Add(new ResourceInfo(RESOURCE_CATEGORY.EFFECT_ACTION, stageData.rootEffect));
            }
            for (int i = 0; i < 8; i++)
            {
                if (!string.IsNullOrEmpty(stageData.useEffects[i]))
                {
                    list.Add(new ResourceInfo(RESOURCE_CATEGORY.EFFECT_ACTION, stageData.useEffects[i]));
                }
            }
            EnemyTable.EnemyData enemyData = Singleton <EnemyTable> .I.GetEnemyData((uint)item2.enemyID[0]);

            int    bodyId   = enemyData.modelId;
            string bodyName = ResourceName.GetEnemyBody(bodyId);
            string mateName = ResourceName.GetEnemyMaterial(bodyId);
            string animName = ResourceName.GetEnemyAnim(enemyData.animId);
            list.Add(new ResourceInfo(RESOURCE_CATEGORY.ENEMY_MODEL, bodyName));
            if (!string.IsNullOrEmpty(mateName))
            {
                list.Add(new ResourceInfo(RESOURCE_CATEGORY.ENEMY_MATERIAL, bodyName));
            }
            list.Add(new ResourceInfo(RESOURCE_CATEGORY.ENEMY_ANIM, animName));
            if (!string.IsNullOrEmpty(enemyData.baseEffectName))
            {
                list.Add(new ResourceInfo(RESOURCE_CATEGORY.EFFECT_ACTION, enemyData.baseEffectName));
            }
        }
        if (list.Find((ResourceInfo x) => !MonoBehaviourSingleton <ResourceManager> .I.IsCached(x.category, x.packageName)) != null)
        {
            RequestEvent("ASSET_DOWNLOAD", StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 3000u));
            SetActive((Enum)UI.BTN_JOIN_OFF, true);
            SetActive((Enum)UI.BTN_CREATE_OFF, true);
            SetActive((Enum)UI.BTN_AUTO_MATCHING_OFF, true);
            LoadingQueue load_queue = new LoadingQueue(this);
            foreach (ResourceInfo item3 in list)
            {
                if (!string.IsNullOrEmpty(item3.packageName) && !MonoBehaviourSingleton <ResourceManager> .I.IsCached(item3.category, item3.packageName))
                {
                    ResourceManager.downloadOnly = true;
                    load_queue.Load(item3.category, item3.packageName, null, false);
                    ResourceManager.downloadOnly = false;
                    yield return((object)load_queue.Wait());
                }
            }
        }
        bool pushEnable = true;

        SetActive((Enum)UI.BTN_JOIN, pushEnable);
        SetActive((Enum)UI.BTN_CREATE, pushEnable);
        SetActive((Enum)UI.BTN_AUTO_MATCHING, pushEnable);
        SetActive((Enum)UI.BTN_JOIN_OFF, !pushEnable);
        SetActive((Enum)UI.BTN_CREATE_OFF, !pushEnable);
        SetActive((Enum)UI.BTN_AUTO_MATCHING_OFF, !pushEnable);
    }
Beispiel #14
0
 private void LoadStartRequirements(QuestTable questTable)
 {
     StartRequirements = new List<IQuestRequirement>();
 }
Beispiel #15
0
 private void LoadRewards(QuestTable questTable)
 {
     QuestRewards = new List<IQuestReward>();
     QuestRewards.Add(new ExperienceQuestReward(questTable.RewardExp));
 }
Beispiel #16
0
        private void LoadFinishRequirements(QuestTable questTable)
        {
            FinishRequirements = new List<IQuestRequirement>();

            // If we have some monster requirements
            if (questTable.EndMonsterRequirements != null)
            {
                var monsterRequirements = new QuestMonstersKilledRequirement(questTable.EndMonsterRequirements);
                FinishRequirements.Add(monsterRequirements);
            }

            // Check for item requirements
            if (questTable.EndItemRequirements != null)
            {
                var itemRequirements = new QuestHasItemRequirement(questTable.EndItemRequirements);
                FinishRequirements.Add(itemRequirements);
            }
        }