Example #1
0
    void InitProps(bool isAI)
    {
        // init BoldiCount
        SetBoldiCount(isAI ? c_StartBoldiCountForAIs : Lehmer.Range(0, 50));

        // scale according to start BoldiCount
        SetScale(Vector3.one * (1.0f + m_BoldiCount * c_ScalePerBoldi));

        // manage grow rate
        m_GrowRate = 1.0f + m_BoldiCount * c_GrowPerBoldi;
        m_GrowTimer.StartTimer(1.0f / m_GrowRate);
    }
Example #2
0
        void LaunchRandom()
        {
            // find a home which is mine
            IHome[] myHomes    = m_Gameboard.GetHomes(TeamId, true);
            IHome[] theirHomes = m_Gameboard.GetHomes(TeamId, false);

            // launch boldies
            if (myHomes.Length > 0 && theirHomes.Length > 0)
            {
                IHome   from   = myHomes[Lehmer.Range(0, myHomes.Length)];
                IHome   to     = theirHomes[Lehmer.Range(0, theirHomes.Length)];
                EAmount amount = (EAmount)Lehmer.Range(0, (int)EAmount.Count);
                LaunchBoldies(from, to, amount);
            }
        }
Example #3
0
    void CreateHomes(Vector3 bounds)
    {
        // create random buffer
        IntBufferedRandom rnd = new IntBufferedRandom();

        rnd.AddValueRange(0, c_GridSize * c_GridSize);
        rnd.Range = Lehmer.Range;

        // create homes
        int homeCount = Lehmer.Range(c_MinHomeCount, c_GridSize * c_GridSize);

        for (int i = 0; i < homeCount; ++i)
        {
            CreateHome(GetPosition(rnd.DrawValue(), bounds));
        }
    }
Example #4
0
 void StartTimer()
 {
     m_Timer.StartTimer(Lehmer.Range(2.0f, 5.0f));
 }