예제 #1
0
    // Start is called before the first frame update
    private IEnumerator Init()
    {
        JobData.Load();
        SkillData.Load();
        EnemyData.Load();
        BattleTileData.Load();
        BattlefieldData.Load();
        BattleGroupData.Load();
        BattleStatusData.Load();
        ItemData.Load();
        EquipData.Load();
        ItemEffectData.Load();
        LanguageData.Load();
        DungeonData.Load();
        RoomData.Load();
        TreasureData.Load();
        ConversationData.Load();
        ShopData.Load();
        DungeonGroupData.Load();
        ExpData.Load();
        NewCookData.Load();

        yield return(new WaitForEndOfFrame());

        InitManager();

        MySceneManager.Instance.Load();

#if UNITY_EDITOR
        DebugCommand.Start();
#endif
    }
예제 #2
0
    public static Food GetFood(List <Item> materialList)
    {
        bool              IsContain  = true;
        Food              food       = null;
        List <int>        tagList    = new List <int>();
        List <RootObject> resultList = new List <RootObject>();

        for (int i = 0; i < materialList.Count; i++)
        {
            tagList.Add(materialList[i].CookTag);
        }

        foreach (KeyValuePair <int, RootObject> item in _dataDic)
        {
            IsContain = true;
            for (int i = 0; i < item.Value.MaterialList.Count; i++)
            {
                if (!tagList.Contains(item.Value.MaterialList[i]))
                {
                    IsContain = false;
                    continue;
                }
            }
            if (IsContain)
            {
                resultList.Add(item.Value);
            }
        }

        if (resultList.Count > 0)
        {
            resultList.Sort((x, y) =>
            {
                return((y.Priority).CompareTo(x.Priority));
            });

            RootObject result = resultList[0];
            int        addHP  = result.AddHP;
            int        addMP  = result.AddMP;
            ItemEffectData.RootObject itemEffectData;
            for (int i = 0; i < materialList.Count; i++)
            {
                itemEffectData = ItemEffectData.GetData(materialList[i].ID);
                if (itemEffectData != null)
                {
                    addHP += itemEffectData.AddHP;
                    addMP += itemEffectData.AddMP;
                }
            }
            food = new Food(result.ResultID, 1, addHP, addMP);
        }
        return(food);
    }
예제 #3
0
    private EquipUpgradeViewManager.EquipUpgradeViewData GetViewdata(ItemEquipment m_equip)
    {
        EquipUpgradeViewManager.EquipUpgradeViewData viewData = new EquipUpgradeViewManager.EquipUpgradeViewData();
        viewData.oldEquipId = m_equip.templateId;

        ItemEffectData    itemEffect = ItemEffectData.dataMap.Get(m_equip.effectId);
        ItemEquipmentData newEquip   = null;

        foreach (int id in itemEffect.reward1.Keys)
        {
            newEquip            = ItemEquipmentData.dataMap.Get(id);
            viewData.newEquipId = newEquip.id;
            break;
        }
        viewData.materialIdList    = new List <int>();
        viewData.materilNumStrList = new List <string>();
        foreach (KeyValuePair <int, int> pair in itemEffect.costId)
        {
            Mogo.Util.LoggerHelper.Debug(pair.Key);
            ItemParentData item = ItemParentData.GetItem(pair.Key);
            if (item.itemType > 0)
            {
                viewData.materialIdList.Add(item.id);
                string numStr  = string.Empty;
                int    num     = InventoryManager.Instance.GetItemNumByIdAndType(item.id, item.itemType);
                int    needNum = pair.Value;
                numStr = string.Concat(num, "/", needNum);
                if (needNum > num)
                {
                    numStr = MogoUtils.GetRedString(numStr);
                }
                viewData.materilNumStrList.Add(numStr);
            }
            else
            {
                viewData.needGold = "X" + pair.Value;
            }
        }

        int level = MogoWorld.thePlayer.level;

        viewData.power = LanguageData.GetContent(190000, newEquip.GetScore(level) - m_equip.GetScore(level));

        return(viewData);
    }
예제 #4
0
    public Food(int id, int amount, int addHP = -1, int addMP = -1)
    {
        ItemData.RootObject itemData = ItemData.GetData(id);

        if (itemData != null)
        {
            ID           = id;
            Name         = itemData.GetName();
            Icon         = itemData.Icon;
            Volume       = itemData.Volume;
            Price        = itemData.Price;
            Amount       = amount;
            CanCook      = itemData.CanCook;
            CanBeStacked = itemData.CanBeStacked;
            Type         = itemData.Type;
            CookTag      = itemData.CookTag;

            ItemEffectData.RootObject itemEffectData = ItemEffectData.GetData(id);
            if (addHP == -1)
            {
                AddHP = itemEffectData.AddHP;
            }
            else
            {
                AddHP = addHP;
            }

            if (addMP == -1)
            {
                AddMP = itemEffectData.AddMP;
            }
            else
            {
                AddMP = addMP;
            }

            Comment = String.Format(itemData.GetComment(), AddHP, AddMP);
        }
        else
        {
            Debug.Log("資料不存在!");
        }
    }