Beispiel #1
0
    private bool isDangerousWeather(Weather.weatherTypes weather)
    {
        bool dangerous = false;

        switch (weather)
        {
        case Weather.weatherTypes.ACID_RAIN:
            dangerous = true;
            break;

        case Weather.weatherTypes.BLIZZARD:
            dangerous = true;
            break;

        case Weather.weatherTypes.HELLFIRE:
            dangerous = true;
            break;

        case Weather.weatherTypes.SCARY_LIGHTNING:
            dangerous = true;
            break;
        }

        return(dangerous);
    }
Beispiel #2
0
    private void setWeatherBasedParticles()
    {
        Weather.weatherTypes weather = calendar.getForecastWeather(0);
        WeatherVisuals       visuals = gameObject.GetComponent <WeatherVisuals>();

        visuals.updateWeatherParticles(weather);
    }
Beispiel #3
0
    private GameObject getParticleFromWeather(Weather.weatherTypes weather)
    {
        GameObject particle = null;

        switch (weather)
        {
        case Weather.weatherTypes.ACID_RAIN:
            particle = acidRain;
            break;

        case Weather.weatherTypes.BLIZZARD:
            particle = blizzard;
            break;

        case Weather.weatherTypes.CLOUDY:
            particle = cloudy;
            break;

        case Weather.weatherTypes.RAIN:
            particle = rain;
            break;

        case Weather.weatherTypes.SNOW:
            particle = snow;
            break;

        default:
            particle = null;
            break;
        }

        return(particle);
    }
Beispiel #4
0
    public void updateWeatherParticles(Weather.weatherTypes weather)
    {
        player = GameObject.FindGameObjectWithTag("Player");
        ParticleSystem currentParticleScript = player.GetComponentInChildren <ParticleSystem>();
        GameObject     currentParticle       = null;

        if (currentParticleScript != null)
        {
            currentParticle = currentParticleScript.gameObject;
        }
        GameObject newParticle = getParticleFromWeather(weather);

        if (!givenParticlesHaveSameName(currentParticle, newParticle))
        {
            if (currentParticle != null)
            {
                Destroy(currentParticle);
            }
            if (newParticle != null)
            {
                GameObject     part = Instantiate(newParticle, player.transform);
                ParticleSystem sys  = part.GetComponent <ParticleSystem>();
                sys.collision.SetPlane(0, player.transform);

                if (player.GetComponent <InBuilding>().getPlayerInBuilding())
                {
                    sys.Stop();
                }
            }
        }
    }
Beispiel #5
0
    private void removeStorms(GameObject target, float temp, Weather.weatherTypes weather)
    {
        GenericStorm[] storms = target.GetComponentsInChildren <GenericStorm>();

        for (int i = 0; i < storms.Length; i++)
        {
            storms[i].removeStorm();
        }
    }
Beispiel #6
0
    public void increaseRandomWeatherChance()
    {
        Weather.weatherTypes[] weathers = (Weather.weatherTypes[])Enum.GetValues(typeof(Weather.weatherTypes));

        int choice = UnityEngine.Random.Range(0, weathers.Length);

        Weather.weatherTypes weatherChoice = weathers[choice];
        foreach (Weather.weatherTypes i in weathers)
        {
            chances[i] += 1;
        }
    }
Beispiel #7
0
    private void addStorms(float temp, Weather.weatherTypes weather)
    {
        player = GameObject.FindGameObjectWithTag("Player");
        if (temp > 30)
        {
            Instantiate(heatwaveStorm, player.transform.position, Quaternion.identity, player.transform);
        }
        if (temp < -10)
        {
            Instantiate(gatheringStorm, player.transform.position, Quaternion.identity, player.transform);
        }
        if (temp < -30)
        {
            Instantiate(frostbiteStorm, player.transform.position, Quaternion.identity, player.transform);
        }

        switch (weather)
        {
        case Weather.weatherTypes.ACID_RAIN:
            Instantiate(acidStorm, player.transform.position, Quaternion.identity, player.transform);
            break;

        case Weather.weatherTypes.BLIZZARD:
            Instantiate(blizzardStorm, player.transform.position, Quaternion.identity, player.transform);
            break;

        case Weather.weatherTypes.HELLFIRE:
            Instantiate(hellfireStorm, player.transform.position, Quaternion.identity, player.transform);
            break;

        case Weather.weatherTypes.PERFECT_WEATHER:
            Instantiate(perfectStorm, player.transform.position, Quaternion.identity, player.transform);
            break;

        case Weather.weatherTypes.SNOW:
            Instantiate(snowStorm, player.transform.position, Quaternion.identity, player.transform);
            break;

        default:
            break;
        }
    }
Beispiel #8
0
    private void forecastWeather()
    {
        Weather.weatherTypes weatherToForecast = calendar.getForecastWeather(1);

        int endDay = Mathf.Min(4, calendar.getDaysToForecast());

        for (int i = endDay; i > 1; i--)
        {
            if (isDangerousWeather(calendar.getForecastWeather(i)))
            {
                weatherToForecast = calendar.getForecastWeather(i);
            }
        }

        string weatherName = weatherToForecast.ToString();

        weatherName = weatherName.ToLower();
        weatherName = weatherName.Replace("_", "-");

        rpgtalk.NewTalk(weatherName + "-forecast-start", weatherName + "-forecast-end");
    }
Beispiel #9
0
 public void SpawnMonsters(Weather.weatherTypes currentWeather)
 {
     if (currentWeather == Weather.weatherTypes.SUPER_HOT)
     {
         putMonsterOnMap(evilPenguin);
     }
     else if (currentWeather == Weather.weatherTypes.BLIZZARD)
     {
         putMonsterOnMap(evilPenguin);
     }
     else if (currentWeather == Weather.weatherTypes.ACID_RAIN)
     {
         putMonsterOnMap(evilPenguin);
     }
     else if (currentWeather == Weather.weatherTypes.HELLFIRE)
     {
         putMonsterOnMap(evilPenguin);
     }
     else if (currentWeather == Weather.weatherTypes.SCARY_LIGHTNING)
     {
         putMonsterOnMap(evilPenguin);
     }
 }
Beispiel #10
0
 public void resetStorms(float temp, Weather.weatherTypes weather)
 {
     removeStorms(player, temp, weather);
     addStorms(temp, weather);
 }
Beispiel #11
0
 public void updateWeatherName(Weather.weatherTypes type)
 {
     weatherNameText.text = type.ToString();
 }