Esempio n. 1
0
    private PlayingPiece MakeAPiece()
    {
        Debug.Log("Piece Made");
        PlayingPiece toReturn = GameObject.Instantiate(piecePrefab);

        if (forcedPieces.Count > 0)
        {
            int[,] forcedPiece = forcedPieces[0];
            forcedPieces.RemoveAt(0);
            toReturn.Initialize(this.player, dice, forcedPiece);
        }
        else
        {
            int num       = dice.NextInt(0, pieceSizeBag.Length);
            int pieceSize = pieceSizeBag[num];
            toReturn.Initialize(this.player, dice, pieceArray[pieceSize][dice.NextInt(0, pieceArray[pieceSize].Length)]);
        }

        return(toReturn);
    }
Esempio n. 2
0
    //In our current formula, there are no reasons to have cubes other than the "standard" cube,
    //But this is here just in case we do something weird later.
    internal PowerupType GetRandomCubeType(SeededRandom dice)
    {
        List <PowerupType> randomBag = new List <PowerupType>();

        for (int x = 0; x < 100; x++)
        {
            randomBag.Add(PowerupType.ENERGY);
        }
        for (int x = 0; x < AttackCubes(); x++)
        {
            randomBag.Add(PowerupType.ATTACK);
        }
        for (int x = 0; x < ShieldCubes(); x++)
        {
            randomBag.Add(PowerupType.SHIELDS);
        }
        for (int x = 0; x < PsiCubes(); x++)
        {
            randomBag.Add(PowerupType.PSI);
        }
        return(randomBag[dice.NextInt(0, randomBag.Count)]);
    }