Ejemplo n.º 1
0
    public void loadItemData()
    {
        return;

        try
        {
            Debug.Log("아이템 정보 로드 성공");

            /*string jsonData = File.ReadAllText(saveOrLoad(false, false, "ItemData"));
             * itemDataFile = JsonUtility.FromJson<ItemDataFile>(jsonData);*/

            itemDataFile = JsonUtility.FromJson <ItemDataFile>(Resources.Load <TextAsset>("ItemData").ToString());

            for (int i = 0; i < itemDataFile.itemDatas.Count; i++)
            {
                itemDataFile.itemDatas[i].sprite = loadSprite(itemDataFile.itemDatas[i].spritePath);
                itemDB.Add(itemDataFile.itemDatas[i]);
            }
        }
        catch (FileNotFoundException)
        {
            Debug.Log("로드 오류");

            string jsonData = JsonUtility.ToJson(itemDataFile, true);

            File.WriteAllText(saveOrLoad(false, false, "ItemData"), jsonData);
            loadItemData();
        }
    }
Ejemplo n.º 2
0
    public override void  Upgrade()
    {
        base.Upgrade();

        FacadeClass <ItemDataFile> facadeClass = new FacadeClass <ItemDataFile>();
        ItemDataFile data = facadeClass.ParseJson("itemGeneration/Armors");

        echantements.Add(data.enchantements[Random.Range(0, data.enchantements.Length)]);
    }
Ejemplo n.º 3
0
    void Start ()
    {
        GameObject obj = GameObject.Find("ItemDataFile");
        gameItemDataFile = obj.GetComponent<ItemDataFile>();

        CreateEmptySlot(defaultItemSlot);
        SettingUserItem();
        ScaleUpEffect();
    }
Ejemplo n.º 4
0
        private void menuMainDataLoadItem_Click(object sender, EventArgs e)
        {
            var filepath = ShowOpenFileDialog("item.ini|item.ini");

            if (string.IsNullOrEmpty(filepath))
            {
                return;
            }

            var file = new ItemDataFile();

            file.Read(filepath);
            AddDataToDataView("item", file.Entries);
        }
Ejemplo n.º 5
0
    private void Start()
    {
        itemDataFile           = new ItemDataFile();
        itemDataFile.itemDatas = new List <Item>();

        //saveItemData();
        loadItemData();

        //spawnItem();

        // 딕셔너리에 아이템 정보 입력
        for (int i = 0; i < itemDB.Count; i++)
        {
            itemDatas.Add(itemDB[i].code, itemDB[i]);
        }
    }
Ejemplo n.º 6
0
    void Start ()
    {
        GameObject obj = GameObject.Find("craftItemListDataFile");
        craftItemDataFile = obj.GetComponent<CraftItemListDataFile>();

        obj = GameObject.Find("ItemDataFile");
        itemDataFile = obj.GetComponent<ItemDataFile>();

        spr_afterItemImg.spriteName = string.Empty;

        Ed_OnClickQuantityList = new EventDelegate(this, "OnClickQuantTityList");
        selectQuantityList.onChange.Add(Ed_OnClickQuantityList);

        CreateEmptySlot(defaultItemSlot);
        SetDropDownList();
        ScaleUpEffect();
    }
    public void loadEntityInventorydata()
    {
        if (!isSavedInventory)
        {
            return;
        }

        try
        {
            bool isMobile = GameManager.instance.isMobile;

            string jsonData = File.ReadAllText(saveOrLoad(isMobile, false, "InventoryData_" + id));
            itemDataFiles = JsonUtility.FromJson <ItemDataFile>(jsonData);
            items         = itemDataFiles.itemDatas;
        }
        catch (FileNotFoundException)
        {
        }
    }
Ejemplo n.º 8
0
    public Potion CreatePotion()
    {
        ItemDataFile data = parser.ParseJson("itemGeneration/Potions");

        Potion potion = new Potion("weaponObject ", "items_" + random.Next(130, 145), 10);

        potion.Name = data.names[random.Next(0, data.names.Length)];

        potion.description = data.descriptions[random.Next(0, data.descriptions.Length)];
        potion.rarity      = CreateItemRarity();

        potion.Price      = ((int)potion.rarity + 1) * random.Next(minPriceValue, maxPriceValue) * potionPriceMultiplier;
        potion.attributes = ((int)potion.rarity + 1) * hpPerRarity + " hp";

        for (int i = 0; i < (int)potion.rarity; i++)
        {
            potion.echantements.Add(data.enchantements[random.Next(data.enchantements.Length)]);
        }

        return(potion);
    }
Ejemplo n.º 9
0
    public Armor CreateArmor()
    {
        ItemDataFile data = parser.ParseJson("itemGeneration/Armors");

        //LoadFile
        Armor armor = new Armor("armorObject ", "items_" + random.Next(102, 124), 10);

        armor.Name = data.names[random.Next(0, data.names.Length)];

        armor.description = data.descriptions[random.Next(0, data.descriptions.Length)];
        armor.rarity      = CreateItemRarity();

        armor.Price      = ((int)armor.rarity + 1) * random.Next(minPriceValue, maxPriceValue) * armorPriceMultiplier;
        armor.attributes = random.Next(minArmor, MaxArmor) + " armor";

        for (int i = 0; i < (int)armor.rarity; i++)
        {
            armor.echantements.Add(data.enchantements[random.Next(data.enchantements.Length)]);
        }
        return(armor);
    }
Ejemplo n.º 10
0
    public Weapon CreateWeapon()
    {
        ItemDataFile data = parser.ParseJson("itemGeneration/Weapons");

        //LoadFile
        Weapon weapon = new Weapon("weaponObject ", "items_" + random.Next(73, 102), 10);

        weapon.Name = data.names[random.Next(0, data.names.Length)];

        weapon.description = data.descriptions[random.Next(0, data.descriptions.Length)];
        weapon.rarity      = CreateItemRarity();


        weapon.Price      = ((int)weapon.rarity + 1) * random.Next(minPriceValue, maxPriceValue) * weaponPriceMultipler;
        weapon.attributes = ((int)weapon.rarity + 1) * random.Next(minDamage, MaxDamage) + " damage";


        for (int i = 0; i < (int)weapon.rarity; i++)
        {
            weapon.echantements.Add(data.enchantements[random.Next(data.enchantements.Length)]);
        }

        return(weapon);
    }
Ejemplo n.º 11
0
        public MainWindow()
        {
            InitializeComponent();

            ItemDataFile.LoadItems("C:\\Program Files (x86)\\Wonderland Online\\data\\item.dat");
        }
Ejemplo n.º 12
0
 private static void LoadItems()
 {
     Console.WriteLine("Loading items...");
     ItemDataFile.LoadItems("C:\\Program Files (x86)\\Wonderland Online\\data\\item.dat");
     Console.WriteLine("Items Loaded!");
 }