Exemple #1
0
 public void OnStateEnter(GameManagerScriptPT gameManager)
 {
     gM = gameManager;
     if (gM.IfPlayerWon())
     {
         gM.GetComponent <GUIControllerScriptPT>().ViewMessage("You win", 2, true);
     }
     else
     {
         gM.GetComponent <GUIControllerScriptPT>().ViewMessage("You lose", 2, true);
     }
 }
Exemple #2
0
 public void Execute(GameObject tower, int player)
 {
     gM.GetComponent <SoundScriptPT>().PlaySound(Sounds.SWAP);
     gM.SwapTowers(tower, player);
     if (player == 1)
     {
         gM.ChangeState(new IEnemyMoveStatePT());
         gM.UndoPowerPoints(1, 1);
         gM.GetComponent <GUIControllerScriptPT>().LockUnlockPowers(false, gM.GetPowerPoints(1));
     }
     else
     {
         gM.UndoPowerPoints(1, 2);
     }
 }
    public void Execute(GameObject tower, int player)
    {
        int hp = gM.GetMaxHP();

        gM.GetComponent <SoundScriptPT>().PlaySound(Sounds.HEAL);
        tower.GetComponent <PokeTowerScript>().HealTower(hp);
        if (player == 1)
        {
            gM.ChangeState(new IEnemyMoveStatePT());
            gM.UndoPowerPoints(3, 1);
            gM.GetComponent <GUIControllerScriptPT>().LockUnlockPowers(false, gM.GetPowerPoints(1));
        }
        else
        {
            gM.UndoPowerPoints(3, 2);
        }
    }
    public void Execute(GameObject tower, int player)
    {
        gM.GetComponent <SoundScriptPT>().PlaySound(Sounds.TRANSFORM);
        int      pT          = (int)tower.GetComponent <PokeTowerScript>().GetPokeType();
        PokeType newType     = generateType(pT);
        Sprite   towerSprite = gM.GetComponent <ConstDataScript>().GetTowerSprite(newType);

        tower.GetComponent <PokeTowerScript>().ChangeType(newType, towerSprite);
        if (player == 1)
        {
            gM.ChangeState(new IEnemyMoveStatePT());
            gM.UndoPowerPoints(2, 1);
            gM.GetComponent <GUIControllerScriptPT>().LockUnlockPowers(false, gM.GetPowerPoints(1));
        }
        else
        {
            gM.UndoPowerPoints(2, 2);
        }
    }
    public void Execute(GameObject tower, int player)
    {
        int     xOffset = -2;
        Vector2 force   = new Vector2(-500, 0);

        if (player == 1)
        {
            xOffset = 2;
            force   = new Vector2(500, 0);
            gM.GetComponent <GUIControllerScriptPT>().LockUnlockPowers(false, gM.GetPowerPoints(1));
        }

        PokeType pT       = tower.GetComponent <PokeTowerScript>().GetPokeType();
        Vector3  position = new Vector3(tower.transform.position.x + xOffset,
                                        tower.transform.position.y, tower.transform.position.z);

        tower.GetComponent <PokeTowerScript>().Attack(gM.GetComponent <ConstDataScript>().GetAttackSprite(pT),
                                                      position, force);

        if (player == 1)
        {
            gM.ChangeState(new IWaitStatePT());
        }
    }