Пример #1
0
    // Use this for initialization
    public static ItemDataContainer GetData()
    {
        var itemContainer = ItemDataContainer.Load(Path.Combine(Application.dataPath, "Resources/items.xml"));


        return(itemContainer);
    }
Пример #2
0
    public Campaign(string cname, string fileName)
    {
        CampaignName         = cname;
        this.fileName        = fileName;
        CampaignDescrtiption = "no campaign description";
        thumbnailName        = "default";

        cutscenes_watched = new List <string>();

        /// New Data stuff
        ///
        ItemDataContainer      = new ItemDataContainer();
        CutsceneDataContainer  = new CutsceneDataContianer();
        EffectMapDataContainer = new EffectMapsDataContainer();
        TileDataContainer      = new TileDatabaseContainer();
        MapData      = new MapDataContainer();
        PropertyMaps = new PropertyMapsContainer();
        JobsData     = new JobsDataContainer();

        GlobalFlags = new Dictionary <string, Flags>();

        movementTypes = new List <string>()
        {
            "walking", "flying"
        };
        properties.Add("flammable");
        properties.Add("on fire");

        initalCutscene = "";
        initalCombat   = "";

        campaignModifier = new DifficultyModifier();
    }
Пример #3
0
    public static void DiscoverRecipes(ItemDataContainer flower)
    {
        if (!alchemyOrganizer._discoveredFlowers.Contains(flower))
        {
            alchemyOrganizer._discoveredFlowers.Add(flower);
            for (int i = 0; i < alchemyOrganizer._recipieList.Count; i++)
            {
                Recipe recipe = alchemyOrganizer._recipieList[i];
                if (recipe.state != RecipeState.Available)
                {
                    if (recipe.ingredientsData[0].ingredient.itemName == flower.itemName)
                    {
                        alchemyOrganizer.UpdateRecipeToState(recipe, RecipeState.Available);
                    }

                    //bool fullyDiscovered = true;
                    //bool discovered = false;

                    //for (int ii = 0; ii < recipe.ingredientsData.Length; ii++)
                    //{
                    //	if(alchemyOrganizer._discoveredFlowers.Contains(recipe.ingredientsData[ii].ingredient))
                    //	{
                    //		discovered = true;
                    //	}
                    //	else
                    //	{
                    //		fullyDiscovered = false;
                    //	}
                    //}

                    //if (fullyDiscovered == true)
                    //{
                    //	alchemyOrganizer.UpdateRecipeToState(recipe, RecipeState.Available);
                    //}
                    //// Unavailable Removed
                    ////else if (discovered == true && recipe.state != RecipeState.Unavailable)
                    ////{
                    ////	alchemyOrganizer.UpdateRecipeToState(recipe, RecipeState.Unavailable);
                    ////}
                }

                /*for(int ii = 0; ii < alchemyOrganizer._recipieList[i].ingredientsData.Length; ii++)
                 *              {
                 *                      if(alchemyOrganizer._recipieList[i].ingredientsData[ii].ingredient.itemName == flower.name)
                 *                      {
                 *                              bool fullDiscover = true;
                 *                              for(int i = 0; i < alchemyOrganizer._recipieList[i])
                 *                      }
                 *              }*/
            }
        }
    }
Пример #4
0
 bool GetImageFromCollection(ItemDataContainer identifier, out Sprite image)
 {
     for (int i = 0; i < _items.Count; i++)
     {
         if (_items[i] == identifier)
         {
             image = _items[i].itemIcon;
             return(true);
         }
     }
     Debug.LogWarning("OBS! Every potion and flower name should be connected to an entry in the Image Collection, this is not true for "
                      + identifier);
     image = null;
     return(false);
 }
Пример #5
0
    bool OpenBookmark(int index, string input, GetAxisRawDown axisDown = null)
    {
        if ((Input.GetButtonDown(input) || (axisDown != null && axisDown.GetAxisDown())) && !_potionWheel.activeSelf)
        {
            if (_book.activeSelf && _currentBookmark == index)
            {
                CloseBook();
            }
            else if (_book.activeSelf)
            {
                ToBookmark(index, true);
            }
            else if (CharacterState.Control_State == CHARACTER_CONTROL_STATE.PLAYERCONTROLLED)
            {
                if ((input == InputKeyWords.INVENTORY || input == InputKeyWords.FLOWERS) && recentlyPickedFlower != null)
                {
                    OpenBook(1);

                    int i = _flowerPages.FindIndex(x => x.GetFlower() == recentlyPickedFlower) + 2;
                    if (i == -1)
                    {
                        Debug.LogErrorFormat("Book Manager failed to find a page covering the flower {0}", recentlyPickedFlower.itemName);
                    }
                    Debug.LogFormat("Change To Picked Flower! Picked flower is at page {0}", i);
                    SetCurrentFlowerPage(i);
                    recentlyPickedFlower = null;
                }
                else
                {
                    OpenBook(index);
                }
            }
            else
            {
                return(false);
            }
            PageChangerActive(_currentBookmark);

            return(true);
        }
        return(false);
    }
Пример #6
0
    bool FindSameSymbol(ItemDataContainer data, int amount, out ItemDataContainer hasSame)
    {
        Debug.Log("Test");
        for (int i = 0; i < _allIngredients.Count; i++)
        {
            if (data.symbol == null || _allIngredients[i] == null)
            {
                Debug.Log("Null Fail");
                hasSame = null;
            }
            else if (object.ReferenceEquals(_allIngredients[i].symbol, data.symbol) && FlowerLibrary.GetFlowerAmount(_allIngredients[i].itemName) >= amount)
            {
                Debug.Log("Not Null Fail");
                hasSame = _allIngredients[i];
                return(true);
            }
        }

        Debug.Log("test");
        hasSame = null;
        return(false);
    }
Пример #7
0
 public static void SetPickedFlower(ItemDataContainer flower)
 {
     Debug.Log("Picked Flower Set!");
     Instance.recentlyPickedFlower = flower;
 }