Exemple #1
0
    public static HalfWineskin Factory(string hero)
    {
        HalfWineskin halfWineskin = HalfWineskin.Factory();

        GameManager.instance.findHero(hero).heroInventory.AddItem(halfWineskin);
        return(halfWineskin);
    }
    public void Execute()
    {
        foreach (Token token in freeMoves)
        {
            if (token is HalfWineskin && token.reserved == 1)
            {
                GameManager.instance.MainHero.heroInventory.RemoveSmallToken((SmallToken)token);
            }
            else if (token is Wineskin && token.reserved == 2)
            {
                GameManager.instance.MainHero.heroInventory.RemoveSmallToken((SmallToken)token);
            }
            else if (token is Wineskin && token.reserved == 1)
            {
                SmallToken halfWineskin = HalfWineskin.Factory();
                GameManager.instance.MainHero.heroInventory.ReplaceSmallToken((SmallToken)token, halfWineskin, true);
            }
            else if (token is Herb && token.reserved != 0)
            {
                GameManager.instance.MainHero.heroInventory.RemoveSmallToken((SmallToken)token);
            }
        }

        freeMoves = new List <Token>();

        if (!PhotonNetwork.OfflineMode)
        {
            photonView.RPC("ExecuteRPC", RpcTarget.AllViaServer, new object[] { totalFreeMoves });
        }
        else
        {
            ExecuteRPC(totalFreeMoves);
        }
    }
Exemple #3
0
    public static HalfWineskin Factory(int cellID)
    {
        HalfWineskin halfWineskin = HalfWineskin.Factory();

        halfWineskin.Cell = Cell.FromId(cellID);
        return(halfWineskin);
    }