Esempio n. 1
0
    public void BuyBuilding(int nr)
    {
        if (stats.Get_Data_From("Free_Field") >= 1 && stats.Get_Data_From("Metal") >= MetalCost(nr) && stats.Get_Data_From("Crystal") >= CrystalCost(nr) && stats.Get_Data_From("Deuter") >= DeuterCost(nr))
        {
            SetPropertiesUp(nr);
            switch (nr)
            {
            case 0:
                stats.Set_Data("Metal_Mine", buildings[nr].level);
                stats.Set_Data("Income_Metal", buildings[nr].income * buildings[nr].level);
                break;

            case 1:
                stats.Set_Data("Crystal_Mine", buildings[nr].level);
                stats.Set_Data("Income_Crystal", buildings[nr].income * buildings[nr].level);
                break;

            case 2:
                stats.Set_Data("Deuter_Sintetizer", buildings[nr].level);
                stats.Set_Data("Income_Deuter", buildings[nr].income * buildings[nr].level);
                break;

            case 3:
                stats.Set_Data("Laboratory", buildings[nr].level);
                break;

            case 4:
                stats.Set_Data("Hangar", buildings[nr].level);
                break;

            case 5:
                stats.Set_Data("Metal_Store", buildings[nr].level);
                stats.Set_Data("Capacity_Metal", stats.Get_Data_From("Capacity_Metal") + buildings[nr].capacity);
                break;

            case 6:
                stats.Set_Data("Crystal_Store", buildings[nr].level);
                stats.Set_Data("Capacity_Crystal", stats.Get_Data_From("Capacity_Crystal") + buildings[nr].capacity);
                break;

            case 7:
                stats.Set_Data("Deuter_Store", buildings[nr].level);
                stats.Set_Data("Capacity_Deuter", stats.Get_Data_From("Capacity_Deuter") + buildings[nr].capacity);
                break;
            }
            SetFreeField(-1);
            ShowInformation(nr, "Bought!");
            GUIPlanetOperations.PlaySound_Complete();
        }
        else if (stats.Get_Data_From("Free_Field") >= 1 && (stats.Get_Data_From("Metal") < MetalCost(nr) || stats.Get_Data_From("Crystal") < CrystalCost(nr) || stats.Get_Data_From("Deuter") < DeuterCost(nr)))
        {
            GUIPlanetOperations.Turn_On_Ads("resources");
            ShowInformation(nr, "Earn!");
        }
    }
Esempio n. 2
0
 public void BuyShips(int nr)
 {
     if (!ships[nr].haveornothave)
     {
         if (staty.Get_Data_From("Antymatery") >= ships[nr].price)
         {
             ships[nr].haveornothave = true;
             staty.Change_Antymatery(-ships[nr].price);
             staty.Set_Data("Ship_Id", ships[nr].id);
             staty.Set_Data("Life", ships[nr].life);
             staty.Set_Data("Ch_Drop", ships[nr].ch_drop);
             staty.Set_Float_Data("Consumption", ships[nr].consumption);
             staty.Set_Data("Bought_Ships", staty.Get_Data_From("Bought_Ships") + 1);
             staty.Set_Data("Speed_Ship", ships[nr].speed_ship);
             staty.Set_Float_Data("Max_Lasers", ships[nr].max_lasers);
             staty.Set_String_Data("Ship_Name", ships[nr].name);
             PlayerPrefs.Save();
             GUIPlanetOperations.Subject_Information(0, 0, 0, ships[nr].price, ships[nr].name, "Bought!", skin.skin_statku[nr]);
         }
         else if (staty.Get_Data_From("Antymatery") < ships[nr].price)
         {
             GUIPlanetOperations.Turn_On_Ads("antymatery");
             GUIPlanetOperations.Subject_Information(0, 0, 0, ships[nr].price, ships[nr].name, "Too Small Antymatery", skin.skin_statku[nr]);
         }
     }
 }
Esempio n. 3
0
 public void BuyLasers(int nr)
 {
     if (!lasers[nr].haveornothave)
     {
         if (staty.Get_Data_From("Antymatery") >= lasers[nr].price)
         {
             lasers[nr].haveornothave = true;
             staty.Change_Antymatery(-lasers[nr].price);
             staty.Set_Data("Laser", lasers[nr].id);
             PlayerPrefs.Save();
             GUIPlanetOperations.Subject_Information(0, 0, 0, lasers[nr].price, lasers[nr].name, "Bought!", skin.skin_laseru[nr]);
         }
         else if (staty.Get_Data_From("Antymatery") < lasers[nr].price)
         {
             GUIPlanetOperations.Turn_On_Ads("antymatery");
             GUIPlanetOperations.Subject_Information(0, 0, 0, lasers[nr].price, lasers[nr].name, "Too Small Antymatery!", skin.skin_laseru[nr]);
         }
     }
 }
Esempio n. 4
0
 public void BuyResearch(int nr)
 {
     if (research[nr].level <= 2)
     {
         if (stats.Get_Data_From("Metal") >= MetalCost(nr) && stats.Get_Data_From("Crystal") >= CrystalCost(nr) && stats.Get_Data_From("Deuter") >= DeuterCost(nr))
         {
             SetPropertiesUp(nr);
             SetTechnology(nr);
         }
         else if (stats.Get_Data_From("Metal") < MetalCost(nr) || stats.Get_Data_From("Crystal") < CrystalCost(nr) || stats.Get_Data_From("Deuter") < DeuterCost(nr))
         {
             GUIPlanetOperations.Turn_On_Ads("resources");
             ShowInformation(nr, "Earn!");
         }
     }
     else if (research[nr].level >= 3)
     {
         ShowInformation(nr, "MAX LVL!");
     }
 }
Esempio n. 5
0
 public void BtnBuy(int nr)
 {
     if (structures[nr].level < 3)
     {
         if (stats.Get_Data_From("Alliance_Antymatery") >= Cost(nr))
         {
             SetPropertiesUp(nr);
             SetStructures(nr);
         }
         else if (stats.Get_Data_From("Alliance_Antymatery") < Cost(nr))
         {
             GUIPlanetOperations.Turn_On_Ads("antymatery");
             ShowInformation(nr, "Earn!");
         }
     }
     else if (structures[nr].level >= 3)
     {
         ShowInformation(nr, "MAX LVL!");
     }
 }
Esempio n. 6
0
 public void EarnAntymatery()
 {
     GUIPlanetOperations.Turn_On_Ads("antymatery");
 }