Exemplo n.º 1
0
 private void ExecuteEffects()
 {
     if (effects.temperatureAdd != 0)
     {
         ZylinderPlanet planet = GameObject.Find("Planet").GetComponent <ZylinderPlanet>();
         planet.raiseTempOfXRandomHex(effects.temperatureAdd);
     }
     if (effects.humidityAdd != 0)
     {
         ZylinderPlanet planet = GameObject.Find("Planet").GetComponent <ZylinderPlanet>();
         planet.raiseHumidOfXRandomHex(effects.humidityAdd);
     }
     if (effects.temperatureSub != 0)
     {
         ZylinderPlanet planet = GameObject.Find("Planet").GetComponent <ZylinderPlanet>();
         planet.lowerTempOfXRandomHex(effects.temperatureSub);
     }
     if (effects.humiditySub != 0)
     {
         ZylinderPlanet planet = GameObject.Find("Planet").GetComponent <ZylinderPlanet>();
         planet.lowerHumidOfXRandomHex(effects.humiditySub);
     }
     if (effects.CatNumber == 1)
     {
         ZylinderPlanet planet = GameObject.Find("Planet").GetComponent <ZylinderPlanet>();
         planet.increaseCatastrophe(effects.CatNumber, MeteorChance);
     }
     if (effects.CatNumber == 2)
     {
         ZylinderPlanet planet = GameObject.Find("Planet").GetComponent <ZylinderPlanet>();
         planet.increaseCatastrophe(effects.CatNumber, IceAgeChance);
     }
     if (effects.CatNumber == 3)
     {
         ZylinderPlanet planet = GameObject.Find("Planet").GetComponent <ZylinderPlanet>();
         planet.increaseCatastrophe(effects.CatNumber, VolcanoChance);
     }
 }
Exemplo n.º 2
0
 private void ExecuteEffects()
 {
     if (effects.temperatureAdd != 0)
     {
         ZylinderPlanet planet = GameObject.Find("Planet").GetComponent <ZylinderPlanet>();
         planet.raiseTempOfXRandomHex(effects.temperatureAdd);
     }
     if (effects.humidityAdd != 0)
     {
         ZylinderPlanet planet = GameObject.Find("Planet").GetComponent <ZylinderPlanet>();
         planet.raiseHumidOfXRandomHex(effects.humidityAdd);
     }
     if (effects.temperatureSub != 0)
     {
         ZylinderPlanet planet = GameObject.Find("Planet").GetComponent <ZylinderPlanet>();
         planet.lowerTempOfXRandomHex(effects.temperatureSub);
     }
     if (effects.humiditySub != 0)
     {
         ZylinderPlanet planet = GameObject.Find("Planet").GetComponent <ZylinderPlanet>();
         planet.lowerHumidOfXRandomHex(effects.humiditySub);
     }
 }
Exemplo n.º 3
0
    private void selectSeven(int new_index)
    {
        ZylinderPlanet planet = GameObject.Find("Planet").GetComponent <ZylinderPlanet>();

        int[] indexMods =
        {
            0,
            -1,
            -10,
            1,
            9,
            10,
            11
        };
        if (new_index % 2 == 0) //
        {
            indexMods[4] = -9;
            indexMods[6] = -11;
        }

        int hex_end = planet.surfaceHexagons.Count;

        foreach (int ele in hovereredList)
        {
            planet.highlightBiome(ele, false);
        }

        hovereredList = new List <int>();

        for (int i = 0; i < indexMods.Length; i++)
        {
            if (new_index % planet.gridWidth == 0)
            {
                if ((new_index + indexMods[i]) % planet.gridWidth == planet.gridWidth - 1)
                {
                    continue;
                }
            }
            if (new_index % planet.gridWidth == planet.gridWidth - 1)
            {
                if ((new_index + indexMods[i]) % planet.gridWidth == 0)
                {
                    continue;
                }
            }

            int temp = new_index % planet.gridWidth;
            //if (temp + indexMods[i] >= 10) continue;

            if (new_index + indexMods[i] < 0)
            {
                hovereredList.Add(new_index + indexMods[i] + hex_end);
            }
            else if (new_index + indexMods[i] >= hex_end)
            {
                hovereredList.Add(new_index + indexMods[i] - hex_end);
            }
            else
            {
                hovereredList.Add(new_index + indexMods[i]);
            }
        }

        foreach (int ele in hovereredList)
        {
            planet.highlightBiome(ele, true);
        }
    }