Exemplo n.º 1
0
        public void Tick(Actor self)
        {
            if (allies1.WinState != WinState.Undefined)
            {
                return;
            }

            if (world.FrameNumber == 1)
            {
                SpawnAlliedUnit(McvName);
                evacuateWidget = new InfoWidget("");
                Ui.Root.AddChild(evacuateWidget);
                UpdateUnitsEvacuated();
            }
            if (world.FrameNumber == attackAtFrame)
            {
                SpawnSovietUnits();
                attackAtFrame         += attackAtFrameIncrement;
                attackAtFrameIncrement = Math.Max(attackAtFrameIncrement - 5, minAttackAtFrame);
            }

            if (world.FrameNumber == ReinforcementsTicks1 || world.FrameNumber == ReinforcementsTicks2)
            {
                Sound.Play("reinfor1.aud");
            }

            if (world.FrameNumber % 25 == 0)
            {
                if (world.FrameNumber >= ReinforcementsTicks1 && currentReinforcement1 < Reinforcements1.Length)
                {
                    SpawnAlliedUnit(Reinforcements1[currentReinforcement1++]);
                }

                if (world.FrameNumber >= ReinforcementsTicks2 && currentReinforcement2 < Reinforcements2.Length)
                {
                    SpawnAlliedUnit(Reinforcements2[currentReinforcement2++]);
                }
            }


            if (sovietParadrops > 0)
            {
                if (world.FrameNumber == sovietParadropTicks)
                {
                    Sound.Play("sovfapp1.aud");
                }

                if (world.FrameNumber >= sovietParadropTicks && world.FrameNumber % ParadropIncrement == 0)
                {
                    CPos lz;
                    CPos entry;
                    do
                    {
                        var x = world.SharedRandom.Next(paradropBox.X, paradropBox.X + paradropBox.Width);
                        var y = world.SharedRandom.Next(paradropBox.Y, paradropBox.Y + paradropBox.Height);
                        entry = new CPos(0, y);
                        lz    = new CPos(x, y);
                    }while (!ParadropTerrainTypes.Contains(world.GetTerrainType(lz)));
                    MissionUtils.Paradrop(world, soviets, SovietParadroppers, entry, lz);
                    sovietParadrops--;
                }
            }
            if (world.FrameNumber % 25 == 0)
            {
                ManageSovietUnits();
            }

            if (objectives[AirbaseID].Status != ObjectiveStatus.Completed)
            {
                if (world.FrameNumber % 25 == 0)
                {
                    BuildSovietAircraft();
                }

                ManageSovietAircraft();
            }

            EvacuateAlliedUnits(exit1TopLeft.CenterLocation, exit1BottomRight.CenterLocation, exit1ExitPoint.Location);
            EvacuateAlliedUnits(exit2TopLeft.CenterLocation, exit2BottomRight.CenterLocation, exit2ExitPoint.Location);

            CheckSovietAirbase();

            if (!world.Actors.Any(a => (a.Owner == allies1 || a.Owner == allies2) && a.IsInWorld && !a.IsDead() &&
                                  ((a.HasTrait <Building>() && !a.HasTrait <Wall>()) || a.HasTrait <BaseBuilding>())))
            {
                objectives[EvacuateID].Status = ObjectiveStatus.Failed;
                OnObjectivesUpdated(true);
                MissionFailed("The remaining Allied forces in the area have been wiped out.");
            }
        }
Exemplo n.º 2
0
        public void Tick(Actor self)
        {
            if (multi0.WinState != WinState.Undefined)
            {
                return;
            }

            if (world.FrameNumber == patrolAttackFrame)
            {
                patrolAttackFrame           += patrolattackAtFrameIncrement;
                patrolattackAtFrameIncrement = Math.Max(patrolattackAtFrameIncrement - 5, 100);
                SendPatrol(Patrol, soviets, patrol1.Location, paradrop1.Location);
                SendPatrol(Patrol, soviets, patrol2.Location, paradrop2.Location);
                SendPatrol(Patrol, soviets, patrol3.Location, paradrop3.Location);
                SendPatrol(Patrol, soviets, patrol4.Location, paradrop4.Location);
            }
            if (world.FrameNumber == WaveAttackFrame)
            {
                WaveAttackFrame           += WaveAttackAtFrameIncrement;
                WaveAttackAtFrameIncrement = Math.Max(WaveAttackAtFrameIncrement - 5, 100);
                SendWave();
            }
            if (world.FrameNumber == VehicleAttackFrame)
            {
                VehicleAttackFrame           += VehicleAttackAtFrameIncrement;
                VehicleAttackAtFrameIncrement = Math.Max(VehicleAttackAtFrameIncrement - 5, 100);
                SendVehicles();
            }
            if (world.FrameNumber == TimerTicks)
            {
                evacuateWidget = new InfoWidget("");
                Ui.Root.AddChild(evacuateWidget);
                WaveNumber++;
                Wave("One Initializing");
                UpdateWaveSequence();
            }
            if (world.FrameNumber == 1500 * 2)
            {
                WaveNumber++;
                Wave("Two Initializing");
                SpawnPatrol      = false;
                AttackSquad      = 7;
                AttackSquadCount = 2;
                UpdateWaveSequence();
                MissionUtils.Parabomb(world, soviets, entry1.Location, paradrop1.Location);
                MissionUtils.Parabomb(world, soviets, entry1.Location, paradrop1.Location + new CVec(0, -2));
            }
            if (world.FrameNumber == 1500 * 4)
            {
                WaveNumber++;
                Wave("Three Initializing");
                UpdateWaveSequence();
                AttackSquad = 8;
            }
            if (world.FrameNumber == 1500 * 6)
            {
                WaveNumber++;
                Wave("Four Initializing");
                UpdateWaveSequence();
                AttackSquad = 9;
                MissionUtils.Parabomb(world, soviets, entry1.Location, paradrop1.Location);
                MissionUtils.Parabomb(world, soviets, entry2.Location, paradrop3.Location);
                AttackSquadCount = 3;
                VehicleSquad     = 3;
            }
            if (world.FrameNumber == 1500 * 8)
            {
                WaveNumber++;
                Wave("Five Initializing");
                UpdateWaveSequence();
                AttackSquad       = 10;
                VehicleSquad      = 4;
                VehicleSquadCount = 2;
                SendBoss(tank);
            }
            if (world.FrameNumber == 1500 * 11)
            {
                WaveNumber++;
                Wave("Six Initializing");
                UpdateWaveSequence();
                AttackSquad      = 11;
                AttackSquadCount = 4;
                MissionUtils.Parabomb(world, soviets, entry1.Location, paradrop1.Location);
                MissionUtils.Parabomb(world, soviets, entry4.Location, paradrop1.Location);
                MissionUtils.Parabomb(world, soviets, entry6.Location, paradrop3.Location);
                MissionUtils.Parabomb(world, soviets, entry5.Location, paradrop3.Location);
                SendBoss(tank);
                SendBoss(tank);
            }
            if (world.FrameNumber == 1500 * 14)
            {
                WaveNumber++;
                Wave("Seven Initializing");
                UpdateWaveSequence();
                AttackSquad       = 12;
                VehicleSquad      = 5;
                VehicleSquadCount = 3;
                SendBoss(v2);
            }
            if (world.FrameNumber == 1500 * 17)
            {
                SpawnVehicles = true;
                WaveNumber++;
                Wave("Eight Initializing");
                UpdateWaveSequence();
                AttackSquad      = 13;
                AttackSquadCount = 5;
                MissionUtils.Parabomb(world, soviets, entry1.Location, paradrop1.Location);
                MissionUtils.Parabomb(world, soviets, entry4.Location, paradrop1.Location);
                MissionUtils.Parabomb(world, soviets, entry6.Location, paradrop3.Location);
                MissionUtils.Parabomb(world, soviets, entry5.Location, paradrop3.Location);
                MissionUtils.Parabomb(world, soviets, entry2.Location, paradrop2.Location);
                MissionUtils.Parabomb(world, soviets, entry3.Location, paradrop2.Location);
                SendBoss(v2);
                SendBoss(tank);
                SendBoss(v2);
            }
            if (world.FrameNumber == 1500 * 21)
            {
                WaveNumber++;
                Wave("Nine Initializing");
                UpdateWaveSequence();
                AttackSquad       = 14;
                VehicleSquad      = 6;
                VehicleSquadCount = 4;
                SendBoss(v2);
                SendBoss(tank);
                SendBoss(tank);
            }
            if (world.FrameNumber == 1500 * 25)
            {
                WaveNumber++;
                Wave("Ten Initializing");
                UpdateWaveSequence();
                AttackSquad      = 15;
                AttackSquadCount = 6;
                for (int i = 0; i < 2; i++)
                {
                    MissionUtils.Parabomb(world, soviets, entry1.Location, paradrop1.Location + new CVec(0, -2));
                    MissionUtils.Parabomb(world, soviets, entry2.Location, paradrop3.Location + new CVec(0, -2));
                    MissionUtils.Parabomb(world, soviets, entry4.Location, paradrop2.Location + new CVec(0, -2));
                    MissionUtils.Parabomb(world, soviets, entry5.Location, paradrop4.Location + new CVec(0, -2));
                    MissionUtils.Parabomb(world, soviets, entry2.Location, paradrop1.Location + new CVec(0, 2));
                    MissionUtils.Parabomb(world, soviets, entry4.Location, paradrop3.Location + new CVec(0, 2));
                    MissionUtils.Parabomb(world, soviets, entry3.Location, paradrop2.Location + new CVec(0, 2));
                    MissionUtils.Parabomb(world, soviets, entry5.Location, paradrop4.Location + new CVec(0, 2));
                }
                SendBoss(boss);
            }
            if (world.FrameNumber == 1500 * 30)
            {
                SpawnWave     = false;
                SpawnVehicles = false;
            }
            if (world.FrameNumber == 1500 * 31)
            {
                MissionAccomplished("You and your mates have Survived the Onslaught!");
            }
        }