Esempio n. 1
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);
        }
    }