Ejemplo n.º 1
0
    public void calculateNewToken()
    {
        PigLvling currentLvl   = Game2_LvlingStat.GetLvling();
        int       currentToken = currentLvl.TokenCount;

        if (currentToken > lastestTokenCount)
        {
            for (int i = 0; i < currentToken - lastestTokenCount; i++)
            {
                for (int j = 1; j <= 4; j++)
                {
                    tokenFlag.Insert(Random.Range(0, tokenFlag.Count), j);
                }
            }
        }
        else
        {
            for (int i = 0; i < lastestTokenCount - currentToken; i++)
            {
                for (int j = 1; j <= 4; j++)
                {
                    tokenFlag.Remove(j);
                }
            }
        }
        lastestTokenCount = currentToken;
    }
Ejemplo n.º 2
0
 public static void PigEating(int flag)
 {
     if (pGlobal.GDABar.EatFlag(flag))
     {
         if (!pGlobal.GDABar.FullFlagUpdate())
         {
             PigLvling currentLvl = Game2_LvlingStat.GetLvling();
             pGlobal.guage.SetTimer(currentLvl.AngryGuageTime);
             //[SCORETAG]
             AddScore(Game2_LvlingStat.GetEatingScore());
             AddCombo();
             pGlobal.pig.Eating();
         }
         else
         {
             Game2_LvlingStat.AddEXP();
             pGlobal.calculateNewToken();
             pGlobal.calculateExtraToken();
             PigLvling currentLvl = Game2_LvlingStat.GetLvling();
             pGlobal.guage.SetTimer(currentLvl.AngryGuageTime);
             //[SCORETAG]
             AddScore(Game2_LvlingStat.GetExcerciseScore());
             AddCombo();
             pGlobal.pig.Exercise();
         }
     }
     else
     {
         PigLvling currentLvl = Game2_LvlingStat.GetLvling();
         pGlobal.guage.SetTimer(currentLvl.AngryGuageTime);
         BrokeCombo();
         DecreaseLife();
         pGlobal.pig.Sick();
     }
 }
Ejemplo n.º 3
0
    public void calculateExtraToken()
    {
        PigLvling currentLvl        = Game2_LvlingStat.GetLvling();
        int       currentExtraToken = currentLvl.ExtraToken;

        ExtraTokenCount  += currentExtraToken - lastestExtraToken;
        lastestExtraToken = currentExtraToken;
    }
Ejemplo n.º 4
0
    public void CreatePackage()
    {
        IsFree = false;
        PigLvling currentLvl = Game2_LvlingStat.GetLvling();

        extraToken = Game2Global.GetExtraToken();
        gda.SetTagFlag(Game2Global.GetRandomPackageFlag(extraToken + 1));
        package.SetPackageIndex(Random.Range(0, 5));
    }
Ejemplo n.º 5
0
    public static int GetExtraToken()
    {
        //process extra Token
        PigLvling currentLvl  = Game2_LvlingStat.GetLvling();
        int       randomRange = (currentLvl.MaxToken - 1 > pGlobal.ExtraTokenCount)?
                                pGlobal.ExtraTokenCount + 1:
                                currentLvl.MaxToken;
        int token = Random.Range(0, randomRange);

        pGlobal.ExtraTokenCount -= token;
        return(token);
    }
Ejemplo n.º 6
0
    void GameStart()
    {
        Game2_LvlingStat.ResetGame(gController.mainMenu.Item4.IsSelect);
        PigLvling currentLvl = Game2_LvlingStat.GetLvling();

        guage.SetTimer(currentLvl.AngryGuageTime);
        lastestTokenCount = currentLvl.TokenCount;
        lastestExtraToken = currentLvl.ExtraToken;
        ExtraTokenCount   = lastestExtraToken;
        for (int i = 0; i < currentLvl.TokenCount; i++)
        {
            for (int j = 1; j <= 4; j++)
            {
                tokenFlag.Insert(Random.Range(0, tokenFlag.Count), j);
            }
        }
        spawnPoint.FirstSpawn();
        guage.StartPlayGame();
        guage.gameObject.SetActive(true);
    }
Ejemplo n.º 7
0
 // Use this for initialization
 void Awake()
 {
     GameLvlingObject = this;
     ResetGame();
 }