예제 #1
0
        void O12BRFightLoaded(MyMissionBase sender)
        {
            m_valentin = (MySmallShipBot)MyScriptWrapper.GetEntity("RavenGuy");
            MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.HeavyFight, 3, "KA03");
            MyScriptWrapper.Follow(MySession.PlayerShip, m_marcus);
            MyScriptWrapper.Follow(MySession.PlayerShip, m_tarja);
            MyScriptWrapper.Follow(MySession.PlayerShip, m_valentin);
            m_marcus.SpeedModifier = 1.0f;

            MyScriptWrapper.ChangeFaction((uint)EntityID.BR_SP_Boss, MyMwcObjectBuilder_FactionEnum.Slavers);
            foreach (var bot in MyScriptWrapper.GetSpawnPointBots((uint)EntityID.BR_SP_Boss))
            {
                if (bot.Ship != null)
                {
                    MyScriptWrapper.SetEntityDestructible(bot.Ship, true);
                    MyScriptWrapper.ChangeFaction(bot.Ship, MyMwcObjectBuilder_FactionEnum.Slavers);
                }
            }

            foreach (var spawn in m_spawns)
            {
                MyScriptWrapper.ChangeFaction(spawn, MyMwcObjectBuilder_FactionEnum.Slavers);
                foreach (var bot in MyScriptWrapper.GetSpawnPointBots(spawn))
                {
                    if (bot.Ship != null)
                    {
                        MyScriptWrapper.SetEntityDestructible(bot.Ship, true);
                        MyScriptWrapper.ChangeFaction(bot.Ship, MyMwcObjectBuilder_FactionEnum.Slavers);
                    }
                }
            }
        }
예제 #2
0
        void autodestructDestroy_OnMissionSuccess(MyMissionBase sender)
        {
            MyScriptWrapper.SetAlarmMode((uint)EntityID.AlarmAutodestruct1, false);
            MyScriptWrapper.SetAlarmMode((uint)EntityID.AlarmAutodestruct2, false);

            MissionTimer.ClearActions();
        }
예제 #3
0
        void O10FindBombDealerLoaded(MyMissionBase sender)
        {
            m_manjeet.LookTarget = null;
            MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.Special, 1, "MM01");
            MyScriptWrapper.SetSleepDistance(m_marcus, 5000);
            MyScriptWrapper.StopFollow(m_marcus);
            m_marcus.SetWaypointPath("MarcusOut");
            m_marcus.SpeedModifier = 2.0f;
            MyScriptWrapper.AddNotification(MyScriptWrapper.CreateNotification(MyTextsWrapperEnum.MarcusIsLeavingForTarja, MyGuiManager.GetFontMinerWarsGreen(), 5000));
            m_marcus.PatrolMode = MyPatrolMode.ONE_WAY;
            m_marcus.Patrol();

            m_valentin = (MySmallShipBot)MyScriptWrapper.GetEntity("RavenGuy");
            m_valentin.LeaderLostEnabled = true;
            MyScriptWrapper.MarkEntity(m_valentin, MyTextsWrapper.Get(MyActorConstants.GetActorDisplayName(MyActorEnum.VALENTIN)).ToString(), HUD.MyHudIndicatorFlagsEnum.SHOW_DISTANCE | HUD.MyHudIndicatorFlagsEnum.SHOW_ONLY_IF_DETECTED_BY_RADAR | HUD.MyHudIndicatorFlagsEnum.SHOW_TEXT | HUD.MyHudIndicatorFlagsEnum.SHOW_BORDER_INDICATORS, HUD.MyGuitargetMode.Friend);
            MyScriptWrapper.StopFollow(m_valentin);
            MyEntity valentinPosition = MyScriptWrapper.GetEntity((uint)EntityID.ValentinBRPosition);

            m_valentin.SetWorldMatrix(valentinPosition.WorldMatrix);

            m_tarja.LeaderLostEnabled = true;
            MyScriptWrapper.StopFollow(m_tarja);
            MyScriptWrapper.MarkEntity(m_tarja, MyTextsWrapper.Get(MyActorConstants.GetActorDisplayName(MyActorEnum.TARJA)).ToString(), HUD.MyHudIndicatorFlagsEnum.SHOW_DISTANCE | HUD.MyHudIndicatorFlagsEnum.SHOW_ONLY_IF_DETECTED_BY_RADAR | HUD.MyHudIndicatorFlagsEnum.SHOW_TEXT | HUD.MyHudIndicatorFlagsEnum.SHOW_BORDER_INDICATORS, HUD.MyGuitargetMode.Friend);
            MyEntity tarjaPosition = MyScriptWrapper.GetEntity((uint)EntityID.TarjaBRPosition);

            m_tarja.SetWorldMatrix(tarjaPosition.WorldMatrix);
            MyScriptWrapper.SetEntityDisplayName(m_tarja, MyTextsWrapper.Get(MyTextsWrapperEnum.Actor_Tarja).ToString());

            MyScriptWrapper.UnhideEntity(MyScriptWrapper.GetEntity((uint)EntityID.BombDealer));
        }
예제 #4
0
 void FindSecurityControl_OnMissionSuccess(MyMissionBase sender)
 {
     MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Security_Spawn);
     MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Security_Spawn1);
     MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.FindSecurity_Spawn);
     MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Spawn_cargo);
 }
예제 #5
0
 void enterControlRoom_OnMissionLoaded(MyMissionBase sender)
 {
     this.MissionTimer.RegisterTimerAction(6000, openCargoDoor_boom, false, MyTexts.ExplosionIn, false);
     MyScriptWrapper.SetWaypointListSecrecy(new List <uint> {
         (uint)EntityID.WaypointControlRoom1, (uint)EntityID.WaypointControlRoom2
     }, true);
 }
예제 #6
0
        void O03FlyToStartLoaded(MyMissionBase sender)
        {
            MyScriptWrapper.OnBotReachedWaypoint += Script_BotReachedWaypoint;

            m_detector_ReachStart.OnEntityEnter += StartPositionEntered;
            m_detector_ReachStart.OnEntityLeave += StartPositionLeaved;
            m_detector_ReachStart.On();

            MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Racer2);
            MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Racer3);
            MyScriptWrapper.MarkEntity(MyScriptWrapper.GetEntity((uint)EntityID.DetectorStartRacePosition), MyTexts.FlyToStartingPoint, HUD.MyHudIndicatorFlagsEnum.SHOW_TEXT | HUD.MyHudIndicatorFlagsEnum.SHOW_DISTANCE | HUD.MyHudIndicatorFlagsEnum.SHOW_BORDER_INDICATORS);

            m_manjeet.LookTarget = null;
            m_manjeet.SetWaypointPath("SmugglerOut");
            m_manjeet.PatrolMode = CommonLIB.AppCode.ObjectBuilders.Object3D.MyPatrolMode.ONE_WAY;
            m_manjeet.Patrol();
            MyScriptWrapper.SetSleepDistance(m_manjeet, 3000);

            MySmallShipBot challenger = (MySmallShipBot)MyScriptWrapper.GetEntity("Challenger");

            challenger.SetWaypointPath("Gotostart");
            challenger.PatrolMode = CommonLIB.AppCode.ObjectBuilders.Object3D.MyPatrolMode.ONE_WAY;
            challenger.Patrol();

            MyScriptWrapper.SetSleepDistance(challenger, 20000);

            MyScriptWrapper.SetEntitiesEnabled(m_influenceSpheresFansBeforeStart, true);
        }
예제 #7
0
 void O02SmugglerDialogueLoaded(MyMissionBase sender)
 {
     foreach (var item in m_companionSpawnpoints)
     {
         MyScriptWrapper.ActivateSpawnPoint(item);
     }
 }
예제 #8
0
 private void Objective04_RaceOnOnMissionSuccess(MyMissionBase sender)
 {
     this.MissionTimer.RegisterTimerAction(TimeSpan.FromSeconds(5), () => {
         MyScriptWrapper.SetEntitiesEnabled(m_influenceSpheresFansAfterStart, false);
         MyScriptWrapper.SetEntitiesEnabled(m_influenceSpheresFansBeforeStart, false);
     }, false);
 }
예제 #9
0
        void O04FollowSmugglerSuccess(MyMissionBase sender)
        {
            MyScriptWrapper.StopTransition(3);
            MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.CalmAtmosphere, 1, "KA03");

            foreach (var spawn in new List <uint> {
                (uint)EntityID.SP_Find_1, (uint)EntityID.SP_Find_2, (uint)EntityID.SP_Find_3
            })
            {
                MyScriptWrapper.ChangeFaction(spawn, MyMwcObjectBuilder_FactionEnum.Slavers);
                foreach (var bot in MyScriptWrapper.GetSpawnPointBots(spawn))
                {
                    if (bot.Ship != null)
                    {
                        MyScriptWrapper.ChangeFaction(bot.Ship, MyMwcObjectBuilder_FactionEnum.Traders);
                    }
                }
            }

            m_manjeet.Idle();

            foreach (var spawn in new List <uint> {
                (uint)EntityID.MomoGangMember1, (uint)EntityID.MomoGangMember2
            })
            {
                MyScriptWrapper.UnhideEntity(MyScriptWrapper.GetEntity(spawn));
            }
        }
        private void DestroyFactoryBotsLoaded(MyMissionBase sender)
        {
            MyScriptWrapper.ActivateSpawnPoints(m_factorySpawns);

            MySmallShipBot mitchel = (MySmallShipBot)MyScriptWrapper.GetEntity("Mitchel");

            MyScriptWrapper.ChangeFaction(mitchel, MyMwcObjectBuilder_FactionEnum.Slavers);
            MyScriptWrapper.SetEntityDestructible(mitchel, true);

            //Support for objective skip
            MySmallShipBot smuggler2 = (MySmallShipBot)MyScriptWrapper.TryGetEntity("Smuggler");

            if (smuggler2 == null)
            {
                Follow1Reached();
                MyEntity spawnPoint = MyScriptWrapper.GetEntity(((uint)EntityID.SpawnpointFactory));
                (spawnPoint as MySpawnPoint).SpawnShip(0);
            }

            MySmallShipBot smuggler = (MySmallShipBot)MyScriptWrapper.GetEntity("Smuggler");

            MyScriptWrapper.ChangeFaction(smuggler, MyMwcObjectBuilder_FactionEnum.Slavers);
            MyScriptWrapper.SetEntityDestructible(smuggler, true);

            MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnpointGuardL);
            MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnpointGuardR);
        }
 private void SpeakWithPolice_Loaded(MyMissionBase sender)
 {
     if (m_speakWithPoliceDialogueFinished)
     {
         sender.Success();
     }
 }
 private void WaitForTheMomentUpdate(MyMissionBase sender)
 {
     if (m_guardLReached && m_guardRReached)
     {
         m_waitForTheMoment.Success();
     }
 }
        private void DefendMadelyn_Loaded(MyMissionBase sender)
        {
            MyScriptWrapper.StopTransition(100);
            MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.DesperateWithStress, 3, "KA03");

            MyScriptWrapper.SetFactionRelation(MyMwcObjectBuilder_FactionEnum.Rainiers, MyMwcObjectBuilder_FactionEnum.Euroamerican, MyFactions.RELATION_WORST);

            var bots = GetBotsFromSpawnpoints(m_barricadeSpawns);

            foreach (var mySmallShipBot in bots)
            {
                if (mySmallShipBot != null)
                {
                    mySmallShipBot.LookTarget = null;
                    MyScriptWrapper.SetEntityDestructible(mySmallShipBot, true);
                }
            }
            var looms = GetBotsFromSpawnpoints(m_barricadeLoomers);

            foreach (var mySmallShipBot in looms)
            {
                if (mySmallShipBot != null)
                {
                    mySmallShipBot.LookTarget = null;
                    MyScriptWrapper.SetEntityDestructible(mySmallShipBot, true);
                }
            }
            MyScriptWrapper.ActivateSpawnPoints(m_barricadeElites);

            ((MyInfluenceSphere)MyScriptWrapper.GetEntity((uint)EntityID.WarSound)).Enabled = true;
        }
예제 #14
0
 public override void Unload(MyMissionBase sender)
 {
     base.Unload(sender);
     m_detector.OnEntityEnter           -= DetectorOnOnEntityEnter;
     MyScriptWrapper.OnDialogueFinished -= MyScriptWrapperOnOnDialogueFinished;
     m_detector.Off();
 }
예제 #15
0
 void marcusLocationIntel_OnMissionLoaded(MyMissionBase sender)
 {
     //throw new NotImplementedException();
     MyScriptWrapper.DeactivateSpawnPoint(74982);
     MyScriptWrapper.DeactivateSpawnPoint(74981);
     //MyAudio.ApplyTransition(MyMusicTransitionEnum.HeavyFight);
 }
 private void MVisitVendorOnOnMissionLoaded(MyMissionBase sender)
 {
     m_captain.SetWaypointPath("Captain");
     m_captain.PatrolMode    = MyPatrolMode.CYCLE;
     m_captain.SpeedModifier = 0.25f;
     m_captain.Patrol();
 }
 private void SpeakCaptainOnOnMissionLoaded(MyMissionBase sender)
 {
     m_gateKeeper.SetWaypointPath("GateKeep");
     m_gateKeeper.PatrolMode    = MyPatrolMode.CYCLE;
     m_gateKeeper.SpeedModifier = 0.25f;
     m_gateKeeper.Patrol();
 }
        void findFrequency_OnMissionLoaded(MyMissionBase sender)
        {
            var detector = MyScriptWrapper.GetDetector((uint)EntityID.DummyNearFrequencyHub);

            detector.OnEntityEnter += new OnEntityEnter(DummyNearFrequencyHub_Enter);
            detector.On();
        }
        void MeetStranger_Loaded(MyMissionBase sender)
        {
            var detector = MyScriptWrapper.GetDetector((uint)EntityID.DummyNearVolodia);

            detector.OnEntityEnter += new OnEntityEnter(DummyNearVolodia_Enter);
            detector.On();
        }
        public override void Update(MyMissionBase sender)
        {
            if (m_isFirstUpdate)
            {
                for (int i = 0; i < m_scannersStartTimes.Count; i++)
                {
                    m_scannersStartTimes[i] = sender.MissionTimer.ElapsedTime + MyMwcUtils.GetRandomInt(0, 3)*1000;
                }
                m_isFirstUpdate = false;
            }
            else
            {
                var index =0;
                foreach (MyEntity scanner in m_scanners)
                {
                    if (m_scannersStartTimes[index] < sender.MissionTimer.ElapsedTime)
                    {
                        scanner.Enabled = !scanner.Enabled;
                        m_scannersStartTimes[index] = sender.MissionTimer.ElapsedTime + m_scannersUpdateTimes[index];
                    }
                    index++;
                }
            }

        }
예제 #21
0
 private void OnEquipMarcussSucces(MyMissionBase sender)
 {
     if (m_marcus != null)
     {
         m_marcus.Inventory.AddInventoryItems(m_marcusInventory);
         m_marcusInventory.Clear();
     }
 }
예제 #22
0
 public override void Load(MyMissionBase sender)
 {
     m_detector = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity(m_detectorId));
     m_detector.On();
     m_detector.OnEntityEnter           += DetectorOnOnEntityEnter;
     MyScriptWrapper.OnDialogueFinished += MyScriptWrapperOnOnDialogueFinished;
     base.Load(sender);
 }
예제 #23
0
 private void OnFindCircuitLoaded(MyMissionBase sender)
 {
     MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.LightFight, 100, "KA27");
     MyScriptWrapper.Highlight((uint)EntityID.CargoIDCard, true, this);
     MyScriptWrapper.ActivateSpawnPoint(72524);
     MyScriptWrapper.DisableShip(MyScriptWrapper.GetEntity(75066));
     MyScriptWrapper.SetEntityEnabled((uint)EntityID.CargoIDCard, false);
 }
예제 #24
0
        public override void Unload(MyMissionBase sender)
        {
            base.Unload(sender);
            m_detector.OnEntityEnter -= DetectorOnOnEntityEnter;
            MyScriptWrapper.OnDialogueFinished -= MyScriptWrapperOnOnDialogueFinished;
            m_detector.Off();

        }
 private void M09PlantcargoOnOnMissionLoaded(MyMissionBase sender)
 {
     foreach (var box in m_plantBoxes)
     {
         MyScriptWrapper.Highlight(box, true, this);
     }
     sender.MissionTimer.RegisterTimerAction(25000, MissedWindow, false, "", false);
 }
예제 #26
0
 void DestroyBatteriesMSSuccess(MyMissionBase sender)
 {
     MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Batteries_Spawn);
     foreach (var Light in TurnOff)
     {
         MyScriptWrapper.SetEntityEnabled(MyScriptWrapper.GetEntity(Light), false);
     }
 }
 void PlaceDeviceOnTransmitter_Success(MyMissionBase sender)
 {
     MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_2000_DEVICEWORKING);
     MyScriptWrapper.Highlight((uint)EntityID.Transmitter1, false, this);
     MyScriptWrapper.Highlight((uint)EntityID.Transmitter2, false, this);
     MyScriptWrapper.Highlight((uint)EntityID.PlaceDeviceOnTransmitter, false, this);
     MyScriptWrapper.EnablePhysics((uint)EntityID.PlaceDeviceOnTransmitter, true);
 }
        void m_04GetOrganicSamples_OnMissionLoaded(MyMissionBase sender)
        {
            MyScriptWrapper.Highlight((uint)EntityID.BlinkLight3, true, this);
            MyScriptWrapper.Highlight((uint)EntityID.BlinkLight4, true, this);

            SickensDialog();
            //MissionTimer.RegisterTimerAction(3000, SickensDialog, false);
        }
예제 #29
0
 public override void Load(MyMissionBase sender)
 {
     m_detector = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity(m_detectorId));
     m_detector.On();
     m_detector.OnEntityEnter += DetectorOnOnEntityEnter;
     MyScriptWrapper.OnDialogueFinished += MyScriptWrapperOnOnDialogueFinished;
     base.Load(sender);
 }
예제 #30
0
        private void GetOreSubmissionSuccess(MyMissionBase sender)
        {
            MyScriptWrapper.EntityInventoryItemAmountChanged -= OreAmountChanged;

            // remove the mined plutonium to prevend stupid players from breaking the game
            MyScriptWrapper.AddNotification(MyScriptWrapper.CreateNotification(MyTextsWrapperEnum.PlutoniumStored, MyGuiManager.GetFontMinerWarsBlue(), 5000, new object[] { URANITE_TO_OBTAIN }));
            MyScriptWrapper.RemoveInventoryItemAmount(MyScriptWrapper.GetPlayerInventory(), MyMwcObjectBuilderTypeEnum.Ore, (int)MyMwcObjectBuilder_Ore_TypesEnum.URANITE, URANITE_TO_OBTAIN);
        }
        private void ReturnToMadelyn_Loaded(MyMissionBase sender)
        {
            MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.HeavyFight, 3, "KA19");
            MyScriptWrapper.SetEntitiesEnabled(m_particlesApollo, false);
            MyScriptWrapper.ActivateSpawnPoints(m_barricadeHeavies);

            EveryoneAttackMadelyn();
        }
 private void SpeakToManjeet_Loaded(MyMissionBase sender)
 {
     MyScriptWrapper.SetFactionRelation(MyMwcObjectBuilder_FactionEnum.Rainiers, MyMwcObjectBuilder_FactionEnum.Euroamerican, MyFactions.RELATION_NEUTRAL);  // The police won't attack you at first.
     MyScriptWrapper.TryUnhide((uint)EntityID.EACMothershipContainer2, destroyGeneratedWaypointEdges: true);
     MyScriptWrapper.TryUnhide((uint)EntityID.EACMothershipContainer1, destroyGeneratedWaypointEdges: true);
     MyScriptWrapper.SetEntityPriority(MyScriptWrapper.GetEntity((uint)EntityID.EACMothershipContainer1), -1, true);
     MyScriptWrapper.SetEntityPriority(MyScriptWrapper.GetEntity((uint)EntityID.EACMothershipContainer2), -1, true);
 }
 private void M11TalkToReefOnOnMissionLoaded(MyMissionBase sender)
 {
     m_marcus.Follow(MySession.PlayerShip);
     m_ravenguyBot.Follow(MySession.PlayerShip);
     m_ravengirlBot.Follow(MySession.PlayerShip);
     MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.Victory, 3, "KA02");
     m_reef.LookTarget = MySession.PlayerShip;
 }
예제 #34
0
        public override void Load(MyMissionBase sender)
        {
            base.Load(sender);

            for (int i = 0; i < m_mines.GetLength(0); i++)
            {
                MyEntityDetector mineDetector = MyScriptWrapper.GetDetector(m_mines[i, 1]);
                mineDetector.OnEntityPositionChange +=mineDetector_OnEntityPositionChange;
                mineDetector.On();
            }
        }
예제 #35
0
        public override void Unload(MyMissionBase sender)
        {
            base.Unload(sender);

            foreach (uint id in m_spawnpointIDs)
            {
                MySpawnPoint spawnpoint;
                if (MyEntities.TryGetEntityById(new MyEntityIdentifier(id), out spawnpoint))
                    spawnpoint.RemoveLimiter(this);
            }
        }
예제 #36
0
 public override void Load(MyMissionBase sender)
 {
     base.Load(sender);
     m_ship = m_shipId.HasValue ? MyScriptWrapper.GetEntity(m_shipId.Value) : MyScriptWrapper.GetEntity(m_shipName);
     m_trajectory = new MyLine(m_ship.GetPosition(), MyScriptWrapper.GetEntity(m_targetId).GetPosition());
     
     if (m_isShip)
     {
         MyScriptWrapper.PrepareMotherShipForMove(m_ship);
     }
     m_shipMoving = true;
 }
예제 #37
0
        public override void Unload(MyMissionBase sender)
        {
            base.Unload(sender);

            if (m_detector != null)
            {
                m_detector.OnEntityEnter -= OnDetector;
                m_detector.Off();
            }

            MyScriptWrapper.OnSpawnpointBotSpawned -= OnSpawnpointBotSpawned;
            MyScriptWrapper.EntityDeath -= EntityDeath;
        }
예제 #38
0
        public override void Load(MyMissionBase sender)
        {
            base.Load(sender);

            m_detector = MyScriptWrapper.GetDetector(m_detectorID);
            if (m_detector != null)
            {
                m_detector.OnEntityEnter += OnDetector;
                m_detector.On();
            }

            m_currentWave = 0;
            m_spawnedBots = new List<MyEntity>();
        }
예제 #39
0
 public override void Update(MyMissionBase sender)
 {
     base.Update(sender);
     var progress = sender.MissionTimer.ElapsedTime / (float)m_time;
     if (progress < 1.0f && m_shipMoving)
     {
         var position = Vector3.SmoothStep(m_trajectory.From, m_trajectory.To, progress);
         MyScriptWrapper.Move(m_ship, position);
     }
     else
     {
         StopShip();
     }
 }
예제 #40
0
 public override void Update(MyMissionBase sender)
 
 {
     base.Update(sender);
     if (m_enabled)
     {
         if (sender.MissionTimer.ElapsedTime > m_nextChange)
         {
             m_nextChange = sender.MissionTimer.ElapsedTime + m_blinkingPeriod;
             
             m_highlited = !m_highlited;
             if (m_highlited) m_nextChange = sender.MissionTimer.ElapsedTime + 2*m_blinkingPeriod;
             UpdateHighlighting();
         }
     }
 }
        public override void Load(MyMissionBase sender)
        {
           
            m_scanners = new List<MyPrefabScanner>();
            m_isFirstUpdate = true;
            m_scannersStartTimes = new List<int>();
            foreach (var mScannersId in m_scannersIds)
            {
                var scanner = MyScriptWrapper.GetEntity(mScannersId) as MyPrefabScanner;
                scanner.OnEntityScanned += ScannerOnOnEntityScanned;
                m_scanners.Add(scanner);
                m_scannersStartTimes.Add(0);
            }

            
        }
예제 #42
0
        public void SetObjectives(MyMissionBase mission)
        {
            if (mission != null)
            {
                this.Name = mission.Name;
                this.Description = mission.Description;

                this.NameTemp = mission.NameTemp;
                this.DescriptionTemp = mission.DescriptionTemp;
            }
            else
            {
                Name = MyTextsWrapperEnum.EmptyDescription;
                NameTemp = new StringBuilder();
                Description = MyTextsWrapperEnum.EmptyDescription;
                DescriptionTemp = new StringBuilder();
            }
        }
        public override void Load(MyMissionBase sender)
        {
            base.Load(sender);
            m_spawnPoints.Clear();

            if (m_spawnPointIDs == null)
            {   //Add all spawnpoints in mission
                List<uint> list = new List<uint>();
                foreach (MyEntity entity in MyEntities.GetEntities())
                {
                    MySpawnPoint spawnPoint = entity as MySpawnPoint;
                    if (spawnPoint != null && MyFactions.GetFactionsRelation(MySession.PlayerShip.Faction, spawnPoint.Faction) == MyFactionRelationEnum.Enemy && !m_excludedSpawnPointIDs.Contains(spawnPoint.EntityId.Value.NumericValue))
                    {
                        list.Add(spawnPoint.EntityId.Value.NumericValue);
                        spawnPoint.OnActivatedChanged += new Action<MySpawnPoint>(spawnPoint_OnActivatedChanged);
                    }
                }
                m_spawnPointIDs = list.ToArray();
            }

            foreach (uint spawnPointID in m_spawnPointIDs)
            {
                m_spawnPoints.Add(MyEntities.GetEntityById(new MyEntityIdentifier(spawnPointID)) as MySpawnPoint);
            }

            MyScriptWrapper.OnSpawnpointBotSpawned += OnSpawnpointBotSpawned;
            
            m_currentBotsCount = 0;

            foreach (MySpawnPoint spawnPoint in m_spawnPoints)
            {
                spawnPoint.LeftToSpawn = 0;
                spawnPoint.FirstSpawnTimer = 0;
                spawnPoint.RespawnTimer = 0;

                m_currentBotsCount += spawnPoint.GetShipCount();
                spawnPoint.Deactivate();
            }

            UpdateCurrentBotCount();
        }
예제 #44
0
        public override void Update(MyMissionBase sender)
        {
            base.Update(sender);

            if (Time.HasValue)
            {
                if (m_shakeIndex < m_shakeWaves.Count &&
                    sender.MissionTimer.GetElapsedTime().TotalMilliseconds > Time.Value + m_shakeWaves[m_shakeIndex])
                {
                    if (m_shakeIndex == 0)
                    {
                        MyScriptWrapper.IncreaseHeadShake(FirstShake);
                    }
                    else
                    {
                        MyScriptWrapper.IncreaseHeadShake(MyMwcUtils.GetRandomFloat(NextShakesMin, NextShakesMax) * MathHelper.Max(0, 1.0f - Damping * m_shakeIndex));
                    }
                    ++m_shakeIndex;
                }
            }
        }
예제 #45
0
 void ParalyzeDefenseOnMissionUnloaded(MyMissionBase sender)
 {
     MyScriptWrapper.EntityDeath -= OnMyParalyzeDefenseEntityDeath;
 }
예제 #46
0
 private void M21DestroyReefOnOnMissionSuccess(MyMissionBase sender)
 {
     MyScriptWrapper.SetEntitiesEnabled(m_21EnableparticlesDestroy, true);
     MyScriptWrapper.SetEntitiesEnabled(m_21DisableParticlesDestroy, false);
     MyScriptWrapper.TryHide((uint)EntityID._21Ship2, true);
     MyScriptWrapper.TryUnhide((uint)EntityID._21ShipUnhide, true);
 }
예제 #47
0
        private void M21DestroyReefOnOnMissionLoaded(MyMissionBase sender)
        {
            MyScriptWrapper.SetEntitiesEnabled(m_21Enableparticles, true);
            MyScriptWrapper.TryHide((uint)EntityID._19Ship, true);
            MyScriptWrapper.PlaySound3D(MyScriptWrapper.GetEntity(m_21Enableparticles[0]), MySoundCuesEnum.SfxShipLargeExplosion);

            MyScriptWrapper.TryUnhide((uint)EntityID.Voxel2, true);
            MyScriptWrapper.TryHide((uint)EntityID._21VoxelAsteroidHide, true);
        }
예제 #48
0
 void Return_OnMissionLoaded(MyMissionBase sender)
 {
     MySmallShipBot transport1 = (MySmallShipBot)MyScriptWrapper.GetEntity((uint)EntityID.ShipTransport1);
     transport1.SetWaypointPath("transport");
     transport1.Patrol();
     MySmallShipBot transport2 = (MySmallShipBot)MyScriptWrapper.GetEntity((uint)EntityID.ShipTransport2);
     transport2.SetWaypointPath("transport");
     transport2.Patrol();
 }
예제 #49
0
 private void ReefEscapeOnOnMissionSuccess(MyMissionBase sender)
 {
     MyScriptWrapper.TryUnhide((uint)EntityID._21Prefab1UnHide, true);
     MyScriptWrapper.TryUnhide((uint)EntityID._21Ship2, true);
 }
예제 #50
0
 void m_Unlockprison1_OnMissionSuccess(MyMissionBase sender)
 {
     MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.unlockspawn);
 }
예제 #51
0
        void BreakTheChains_OnMissionSuccess(MyMissionBase sender)
        {
            MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.generatorspawn);

            foreach (var chainEffect in m_chainEffects)
            {
                MyScriptWrapper.SetEntityEnabled(chainEffect, false);
            }
        }
예제 #52
0
 private void M20ReefEscapeOnOnMissionLoaded(MyMissionBase sender)
 {
     //MyScriptWrapper.TryHide((uint)EntityID.RegroupWithMadelynShip2);
 }
예제 #53
0
 private void M22FlyBackTomadelynOnOnMissionLoaded(MyMissionBase sender)
 {
     var madelynLocation = MyScriptWrapper.GetEntity((uint) EntityID._22Ship1);
     MyScriptWrapper.Move(m_madelyn, madelynLocation.GetPosition(), madelynLocation.GetForward(), madelynLocation.GetUp());
     MyScriptWrapper.TryUnhide((uint)EntityID._22Ship2, true);
 }
예제 #54
0
        private void M12HackGenerator2OnOnMissionLoaded(MyMissionBase sender)
        {
            MyScriptWrapper.MarkEntity(MyScriptWrapper.TryGetEntity((uint)EntityID.HackGenerator2Doors), "Destroy", MyHudIndicatorFlagsEnum.SHOW_DISTANCE | MyHudIndicatorFlagsEnum.SHOW_TEXT | MyHudIndicatorFlagsEnum.SHOW_HEALTH_BARS | MyHudIndicatorFlagsEnum.SHOW_BORDER_INDICATORS, MyGuitargetMode.Enemy);
            MyScriptWrapper.TryUnhideEntities(m_hackGenerator2Cargos, true);
            sender.Components.Add(new MyHeadshake(0, MyHeadshake.DefaultShaking));

            MyScriptWrapper.SetEntitiesEnabled(m_hackGenerator2Particles, true);
        }
예제 #55
0
 private void M13HackEngine2OnOnMissionLoaded(MyMissionBase sender)
 {
     MyScriptWrapper.SetEntitiesEnabled(m_13Particles, true);
 }
예제 #56
0
 private void M17HackGenerator3OnOnMissionLoaded(MyMissionBase sender)
 {
     sender.Components.Add(new MyHeadshake(m_leaveShip1.MissionTimer.ElapsedTime, MyHeadshake.DefaultShaking, 12, 5, 10));
 }
예제 #57
0
        private void M18LeaveShipOnOnMissionLoaded(MyMissionBase sender)
        {
            MyScriptWrapper.SetEntityEnabled((uint)EntityID._18DisableDummy, false);
            MyScriptWrapper.SetEntitiesEnabled(m_18EnableParticles, true);
            MyScriptWrapper.SetEntityEnabled((uint)EntityID._18DisableTurret, false);
            MissionTimer.RegisterTimerAction(m_18ObjectiveTime, ExplosionMission18, false);

            for (int i = 0; i < m_18ObjectiveTime / 5000; i++)
            {
                Components.Add(new MyHeadshake(MissionTimer.ElapsedTime + i * 5000, MyHeadshake.DefaultShaking, 12, 5, 10));
            }

        }
예제 #58
0
 private void M19KilReefOnOnMissionLoaded(MyMissionBase sender)
 {
     MyScriptWrapper.SetEntitiesEnabled(m_19DisableParticles, false);
     MyScriptWrapper.ActivateSpawnPoints(new List<uint>() { (uint)EntityID._19Spawn1, (uint)EntityID._19Spawn2 });
     MyScriptWrapper.TryHide((uint)EntityID.CoughtInTrapShip3, true);
     MyScriptWrapper.TryUnhide((uint)EntityID._19Ship, true);
     sender.MissionTimer.RegisterTimerAction(5000, KillReefParticles);
 }
예제 #59
0
 void m_FreeSlaves_2_OnMissionSuccess(MyMissionBase sender)
 {
     MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.freeslaves2spawn);
 }
예제 #60
0
 private void M23ExploreAliengateOnOnMissionLoaded(MyMissionBase sender)
 {
     //MyScriptWrapper.AddNotification(MyScriptWrapper.CreateNotification(MyTexts.CampaignIsCompleted, MyGuiManager.GetFontMinerWarsGreen(), 100000));
     MyGuiScreenGamePlay.Static.DrawCampaignEnd = true;
     sender.MissionTimer.RegisterTimerAction(15000, HideDrawCampaignEnd, false);
 }