import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class TowerOne here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class TowerTwo extends Towers
{
    
    /**
     * Kreiert eine neues Objekt der Klasse TowerOne
     * 
     */
    
    
    public TowerTwo()
    {
        
        towerShotIntervall = 1500;        //Intervall bis ein Schuss abgefeuert wird
        towerDistance      = 250;        // maximale Distanz die ein Tower ein Monster erkennt
        towerLevel         = 1;          // Upgrade Level des Towers
        
        towerMoney         = 250;
        towerShotPower     = 4;
        towerShotSpeed     = 20;
        munitionRadius     = 100;
        upgradekosten      = 600;
        
        GreenfootImage[] gM = new GreenfootImage[4];
        gM[0] = TeD_World.B_MUN_2;
        gM[1] = TeD_World.B_MUN_2_A1;
        gM[2] = TeD_World.B_MUN_2_A2;
        gM[3] = TeD_World.B_MUN_2_A3;
        
        
        aniMun = new Animation( 4 , gM , 100 );
        
        turmhöhe           = 20;
        f                  = 4.5;
        turmImage_Gerade   = TeD_World.NOIMAGE;
        
        GreenfootImage[] gN = new GreenfootImage[6];
        gN[0] = TeD_World.B_T2_AN_0;
        gN[1] = TeD_World.B_T2_AN_1;
        gN[2] = TeD_World.B_T2_AN_2;
        gN[3] = TeD_World.B_T2_AN_3;
        gN[4] = TeD_World.B_T2_AN_4;
        gN[5] = TeD_World.B_T2_AN_5;
        
        aniNord = new Animation( 6 , gN , towerShotIntervall/6 ); 
        
        GreenfootImage[] gS = new GreenfootImage[6];
        gS[0] = TeD_World.B_T2_AS_0;
        gS[1] = TeD_World.B_T2_AS_1;
        gS[2] = TeD_World.B_T2_AS_2;
        gS[3] = TeD_World.B_T2_AS_3;
        gN[4] = TeD_World.B_T2_AS_4;
        gN[5] = TeD_World.B_T2_AS_5;
        
        aniSued = new Animation( 6 , gS , towerShotIntervall/6  );
        
        GreenfootImage[] gW = new GreenfootImage[6];
        gW[0] = TeD_World.B_T2_AW_0;
        gW[1] = TeD_World.B_T2_AW_1;
        gW[2] = TeD_World.B_T2_AW_2;
        gW[3] = TeD_World.B_T2_AW_3;
        gW[4] = TeD_World.B_T2_AW_4;
        gW[5] = TeD_World.B_T2_AW_5;
        
        aniWest = new Animation( 6 , gW , towerShotIntervall/6  );
        
        GreenfootImage[] gO = new GreenfootImage[6];
        gO[0] = TeD_World.B_T2_AO_0;
        gO[1] = TeD_World.B_T2_AO_1;
        gO[2] = TeD_World.B_T2_AO_2;
        gO[3] = TeD_World.B_T2_AO_3;
        gO[4] = TeD_World.B_T2_AO_4;
        gO[5] = TeD_World.B_T2_AO_5;
        
        aniOst = new Animation( 6 , gO , towerShotIntervall/6  );
        
        
        
        
    }
    @Override
    public void upgrade()
    {
        if(this.towerLevel == 1)
        {
              towerShotIntervall = 1200;        
              towerDistance      = 300;        
              towerLevel         = 2;          
              upgradekosten      = 700;
              towerMoney         = 400;
              towerShotPower     = 8;
              towerShotSpeed     = 20;
              munitionRadius     = 200;
        
              turmhöhe           = 3;
              f                  = 40;
             
              Animation hilf5;
              Animation hilf6;
              
              
              GreenfootImage[] gN = new GreenfootImage[2];
              gN[0] = TeD_World.B_T5_AS_0;
              gN[1] = TeD_World.B_T5_AS_1;
              
              hilf6 = new Animation( 2 , gN , 600  );
              aniNord = hilf6;
              aniSued = hilf6;
              aniWest = hilf6;
              aniOst = hilf6;
              
              TeD_World.SPIELEVERWALTUNG.map0.map[(TeD_World.pixToCell(this.getY()+53))-1][(TeD_World.pixToCell(this.getX()))-1] = 41;
              TeD_World.SPIELEVERWALTUNG.druckeKarte(TeD_World.SPIELEVERWALTUNG.map0);
              
              GreenfootImage[] gM = new GreenfootImage[1];
              gM[0] = TeD_World.LEER;
        
              hilf5 = new Animation( 1 , gM , 800 );
              aniMun = hilf5;
              
        }
        else if(this.towerLevel == 2)
        {
                towerShotIntervall = 1000;        
                towerDistance      = 350;        
                towerLevel         = 3;          
                
                towerMoney         = 600;
                towerShotPower     = 14;
                towerShotSpeed     = 20;
                munitionRadius     = 250;
        
                turmhöhe           = 3;
                f                  = 50;
                
                Animation hilf6;
               Animation hilf7;
               Animation hilf8;
               Animation hilf9;
               Animation hilf0;
               
               GreenfootImage[] gN = new GreenfootImage[4];
               
               gN[0] = TeD_World.B_T8_AN_0;
               gN[1] = TeD_World.B_T8_AN_1;
               gN[2] = TeD_World.B_T8_AN_2;
               gN[3] = TeD_World.B_T8_AN_3;
               
               hilf6 = new Animation( 4 , gN , (towerShotIntervall*19)/80  );
               aniNord = hilf6;
               
               GreenfootImage[] gS = new GreenfootImage[4];
               
               gS[0] = TeD_World.B_T8_AS_0;
               gS[1] = TeD_World.B_T8_AS_1;
               gS[2] = TeD_World.B_T8_AS_2;
               gS[3] = TeD_World.B_T8_AS_3;
               
               hilf7 = new Animation( 4 , gS , (towerShotIntervall*19)/80   );
               aniSued = hilf7;
               
               GreenfootImage[] gW = new GreenfootImage[4];
               
               gW[0] = TeD_World.B_T8_AW_0;
               gW[1] = TeD_World.B_T8_AW_1;
               gW[2] = TeD_World.B_T8_AW_2;
               gW[3] = TeD_World.B_T8_AW_3;
               
               hilf8 = new Animation( 4 , gW , (towerShotIntervall*19)/80   );
               aniWest = hilf8;
               
               GreenfootImage[] gO = new GreenfootImage[4];
               
               gO[0] = TeD_World.B_T8_AO_0;
               gO[1] = TeD_World.B_T8_AO_1;
               gO[2] = TeD_World.B_T8_AO_2;
               gO[3] = TeD_World.B_T8_AO_3;
               
               hilf9 = new Animation( 4 , gO , (towerShotIntervall*19)/80   );
               aniOst = hilf9;
               
               GreenfootImage[] gM = new GreenfootImage[4];
               gM[0] = TeD_World.B_MUN_6;
               gM[1] = TeD_World.B_MUN_6_A1;
               gM[2] = TeD_World.B_MUN_6_A2;
               gM[3] = TeD_World.B_MUN_6_A3;
        
               hilf0 = new Animation( 4 , gM , 100 );
               aniMun = hilf0;
               
               TeD_World.SPIELEVERWALTUNG.map0.map[(TeD_World.pixToCell(this.getY()+53))-1][(TeD_World.pixToCell(this.getX()))-1] = 51;
               TeD_World.SPIELEVERWALTUNG.druckeKarte(TeD_World.SPIELEVERWALTUNG.map0);
        
                  
        }
    }
}