Beispiel #1
0
        public static void SuspendWeather(string iname, List <Unit> units, Unit modify_unit, int rank, int rankcap, int change_clock)
        {
            if (string.IsNullOrEmpty(iname))
            {
                return;
            }
            WeatherData weatherData = new WeatherData();

            weatherData.setup(iname, modify_unit, rank, rankcap);
            if (weatherData.mWeatherParam == null)
            {
                return;
            }
            weatherData.mChangeClock = (OInt)change_clock;
            if (units != null)
            {
                using (List <Unit> .Enumerator enumerator = units.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Unit current = enumerator.Current;
                        if (!current.IsGimmick)
                        {
                            weatherData.updatePassive(current);
                        }
                    }
                }
            }
            WeatherData.mCurrentWeatherData = weatherData;
        }
Beispiel #2
0
        public static WeatherData ChangeWeather(string iname, List <Unit> units, int now_clock, RandXorshift rand, Unit modify_unit = null, int rank = 1, int rankcap = 1)
        {
            if (string.IsNullOrEmpty(iname))
            {
                return((WeatherData)null);
            }
            if (WeatherData.mCurrentWeatherData != null && WeatherData.mCurrentWeatherData.WeatherParam.Iname == iname)
            {
                return((WeatherData)null);
            }
            WeatherData weatherData = new WeatherData();

            weatherData.setup(iname, modify_unit, rank, rankcap);
            if (weatherData.mWeatherParam == null)
            {
                return((WeatherData)null);
            }
            if (WeatherData.mCurrentWeatherSet != null)
            {
                weatherData.mChangeClock = (OInt)WeatherData.mCurrentWeatherSet.GetNextChangeClock(now_clock, rand);
            }
            WeatherData.mCurrentWeatherData = weatherData;
            SceneBattle instance = SceneBattle.Instance;

            if (UnityEngine.Object.op_Implicit((UnityEngine.Object)instance))
            {
                BattleCore battle = instance.Battle;
                if (battle != null)
                {
                    LogWeather logWeather = battle.Log <LogWeather>();
                    if (logWeather != null)
                    {
                        logWeather.WeatherData = weatherData;
                    }
                }
            }
            if (units != null)
            {
                using (List <Unit> .Enumerator enumerator = units.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Unit current = enumerator.Current;
                        if (!current.IsGimmick)
                        {
                            weatherData.updatePassive(current);
                        }
                    }
                }
            }
            return(weatherData);
        }