Example #1
0
        public void Apply(TasClient tas, Ladder ladder)
        {
            var b = tas.GetBattle();

            if (b == null)
            {
                return;
            }
            var d = b.Details;

            int mint, maxt;

            if (ladder != null)
            {
                d = ladder.CheckBattleDetails(d, out mint, out maxt);
            }
            tas.UpdateBattleDetails(d);

            if (enableAllUnits)
            {
                tas.EnableAllUnits();
            }
            if (disabledUnits.Length > 0)
            {
                tas.DisableUnits(UnitInfo.ToStringList(disabledUnits));
            }

            foreach (var s in perform)
            {
                tas.Say(TasClient.SayPlace.Battle, "", s, false);
            }
        }
Example #2
0
        public void Apply(TasClient tas)
        {
            Battle b = tas.GetBattle();

            if (b == null)
            {
                return;
            }
            BattleDetails d = b.Details;

            if (startingMetal.HasValue)
            {
                d.StartingMetal = startingMetal.Value;
            }
            if (startingEnergy.HasValue)
            {
                d.StartingEnergy = startingEnergy.Value;
            }
            if (maxUnits.HasValue)
            {
                d.MaxUnits = maxUnits.Value;
            }
            if (startPos.HasValue)
            {
                d.StartPos = startPos.Value;
            }
            if (endCondition.HasValue)
            {
                d.EndCondition = endCondition.Value;
            }
            if (limitDgun.HasValue)
            {
                d.LimitDgun = limitDgun.Value;
            }
            if (diminishingMM.HasValue)
            {
                d.DiminishingMM = diminishingMM.Value;
            }
            if (ghostedBuildings.HasValue)
            {
                d.GhostedBuildings = ghostedBuildings.Value;
            }

            d.Validate();
            tas.UpdateBattleDetails(d);

            if (enableAllUnits)
            {
                tas.EnableAllUnits();
            }
            if (disabledUnits.Length > 0)
            {
                tas.DisableUnits(UnitInfo.ToStringList(disabledUnits));
            }
        }
Example #3
0
        public void Apply(TasClient tas, Ladder ladder)
        {
            Battle b = tas.GetBattle();

            if (b == null)
            {
                return;
            }
            BattleDetails d = b.Details;

            if (startingMetal.HasValue)
            {
                d.StartingMetal = startingMetal.Value;
            }
            if (startingEnergy.HasValue)
            {
                d.StartingEnergy = startingEnergy.Value;
            }
            if (maxUnits.HasValue)
            {
                d.MaxUnits = maxUnits.Value;
            }
            if (startPos.HasValue)
            {
                d.StartPos = startPos.Value;
            }
            if (endCondition.HasValue)
            {
                d.EndCondition = endCondition.Value;
            }
            if (limitDgun.HasValue)
            {
                d.LimitDgun = limitDgun.Value;
            }
            if (diminishingMM.HasValue)
            {
                d.DiminishingMM = diminishingMM.Value;
            }
            if (ghostedBuildings.HasValue)
            {
                d.GhostedBuildings = ghostedBuildings.Value;
            }

            d.Validate();
            int mint, maxt;

            if (ladder != null)
            {
                d = ladder.CheckBattleDetails(d, out mint, out maxt);
            }
            tas.UpdateBattleDetails(d);

            if (enableAllUnits)
            {
                tas.EnableAllUnits();
            }
            if (disabledUnits.Length > 0)
            {
                tas.DisableUnits(UnitInfo.ToStringList(disabledUnits));
            }

            foreach (string s in perform)
            {
                tas.Say(TasClient.SayPlace.Battle, "", s, false);
            }
        }