Esempio n. 1
0
        private void mineDetector_OnEntityPositionChange(MyEntityDetector sender, MyEntity entity, Vector3 newposition)
        {
            if (sender.Closed)
                return;

            if (entity == MySession.PlayerShip)
            {
                if (m_beepCue == null || !m_beepCue.Value.IsPlaying)
                {
                    m_beepCue = MyAudio.AddCue2D(MySoundCuesEnum.SfxHudAlarmDamageA);
                }

                float distance = (entity.GetPosition() - sender.GetPosition()).Length();

                if (distance < m_mineStartRadius)
                {
                    uint mineId = 0;
                    for (int i = 0; i < m_mines.GetLength(0); i++)
                    {
                        if (m_mines[i, 1] == sender.Parent.EntityId.Value.NumericValue)
                        {
                            mineId = m_mines[i, 0];
                        }
                    }
                    ExplodeMine(mineId);
                    sender.Off();
                    sender.Parent.MarkForClose();
                }

            }
        }
 void m_botDetector_OnEntityEnter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     MyScriptWrapper.Follow(MySession.PlayerShip, m_botToTalk);
     sender.Off();
 }            
Esempio n. 3
0
 private void DialogueMining(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (entity == MySession.PlayerShip)
     {
         MyScriptWrapper.PlayDialogue(Audio.Dialogues.MyDialogueEnum.RIFT_0600_MINING);
         MyScriptWrapper.EntityInventoryItemAmountChanged += OreAmountChanged;
         sender.Off();
     }
 }
 private void M03DetectorOnOnEntityEnter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (entity == MySession.PlayerShip)
     {
         var madelynLocation = MyScriptWrapper.GetEntity((uint)EntityID.RunForYourLifeMovingMadelyn);
         MyScriptWrapper.Move(m_madelyn, madelynLocation.GetPosition(), madelynLocation.GetForward(), madelynLocation.GetUp());
         sender.Off();
     }
 }
 void DummyNearFrequencyHub_Enter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (MyScriptWrapper.IsPlayerShip(entity))
     {
         if (m_tradeWithVolodia.IsCompleted())
         {
             MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_1500_IFITDOESNOTWORK);
             sender.Off();
         }
         else
         {
             MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_0400_HUBFOUND);
             sender.Off();
         }
     }
 }
 void DummyNearCargo_Enter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (MyScriptWrapper.IsPlayerShip(entity))
     {
         MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_0800_NEARCARGO);
         sender.Off();
     }
 }
        void FindMainRoomEntrance_OnEntityEnter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
        {
            MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_1900_PLACEDEVICE);
            var detectorOutside = MyScriptWrapper.GetDetector((uint)EntityID.DummyOutsideTransmitter);
            detectorOutside.Off();

            sender.Off();
        }
 private void StartDetector12(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (entity == MySession.PlayerShip)
     {
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnpointOnRoadToOldEntr2);
         sender.Off();
     }
 }
Esempio n. 9
0
 private void PlayerInPipes(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (MySession.IsPlayerShip(entity))
     {
         MyScriptWrapper.DestroyEntities(new List<uint> { (uint)EntityID.GrilleToDestroy });
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Spawnpoint_ToLeftHub);
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Spawnpoint_ToRightHub);
         SetHoundDetectorsBase();
         var rightEnteredDetector = MyScriptWrapper.GetDetector((uint)EntityID.Detector_RightEntered);
         rightEnteredDetector.Off();
         var leftEnteredDetector = MyScriptWrapper.GetDetector((uint)EntityID.Detector_LeftEntered);
         leftEnteredDetector.Off();
         MyScriptWrapper.SetWaypointListSecrecy(new List<uint> { (uint)EntityID.Waypoint_ToAmbush }, true);
         sender.Off();
     }
 }
 public void BridgeDetectorAction(MyEntityDetector sender, MyEntity entity, int meetCriterias) 
 {
     if (MyScriptWrapper.IsPlayerShip(entity))
     {
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.BridgeSpawnpoint);
         sender.Off();
     }
 }
 public void Detector2_Enter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (MyScriptWrapper.IsPlayerShip(entity))
     {
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.spawn2);
         sender.Off();
     }
 }
 void DetectorNearHub3_Enter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (MyScriptWrapper.IsPlayerShip(entity))
     {
         MyScriptWrapper.PlayDialogue(MyDialogueEnum.RESEARCH_VESSEL_1200_THIRDHUB);
         sender.Off();
     }
 }
Esempio n. 13
0
 void SecurityDetectorReached(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (entity == m_hacker)
     {
         m_hackerSubmission.Suspend(true);
         sender.Off();
     }
 }
 private void Box1Entered(MyEntityDetector sender, MyEntity entity, int meetcriterias)
 {
     sender.Off();
     if (m_findArtifact.IsAvailable()) m_findArtifact.MissionEntityIDs.Remove((uint)EntityID.Box1Marker);
     MyScriptWrapper.RemoveEntityMark(MyScriptWrapper.GetEntity((uint)EntityID.Box1Marker));
 }
 private void StartDetector08(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (entity == MySession.PlayerShip)
     {
         //MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SomeSpawnpoint07);
         //MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SomeSpawnpoint10);
         //MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SomeSpawnpoint09);
         //MyScriptWrapper.ActivateSpawnPoint(164174);
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnpointSeekAndDestroyA);
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnpointSeekAndDestroyB);
         sender.Off();
     }
 }
Esempio n. 16
0
 private void LeftEntered(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (MySession.IsPlayerShip(entity))
     {
         MyScriptWrapper.DestroyEntities(new List<uint> { (uint)EntityID.GrilleToDestroy });
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Spawnpoint_ToLeftHub);
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Spawnpoint_ToRightHub);
         sender.Off();
     }
 }
 private void StartDetector10(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (entity == MySession.PlayerShip)
     {
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.CrushRussiansSpawnpoint);
         sender.Off();
     }
 }
Esempio n. 18
0
 private void WarheadDiscovered(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (MySession.IsPlayerShip(entity))
     {
         MyScriptWrapper.PlayDialogue(MyDialogueEnum.LAIKA_0900_WARHEAD);
         MyScriptWrapper.SetWaypointListSecrecy(new List<uint> { (uint)EntityID.Waypoint_Right_Door }, false);
         sender.OnEntityEnter -= WarheadDiscovered;
         sender.Off();
     }
 }
 private void StartDetectorForExitArea2(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (entity == MySession.PlayerShip)
     {
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SomeSpawnpoint10);
         sender.Off();
     }
 }
Esempio n. 20
0
 private void WarheadDetectorEnter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (MySession.IsPlayerShip(entity))
     {
         MyScriptWrapper.PlayDialogue(MyDialogueEnum.LAIKA_0950_WARHEAD_HACK);
         sender.OnEntityEnter -= WarheadDetectorEnter;
         sender.Off();
     }
 }
 void detectorOutsideTransmitter_OnEntityEnter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_1800_BADROUTE);
     sender.Off();
 }
        private void AttackBarthDetector_Enter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
        {
            if (entity == m_barth)
                return;

            var relation = MyFactions.GetFactionsRelation(entity.Faction, m_barth.Faction);
            var bot = entity as MySmallShipBot;
            if (bot != null && relation == MyFactionRelationEnum.Enemy)
            {
                bot.Attack(m_barth);
            }

            sender.Off();
        }
 void DummyNearVolodia_Enter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (MyScriptWrapper.IsPlayerShip(entity))
     {
         MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_0700_STRANGERPROPOSAL);
         sender.Off();
     }
 }
 private void CleanUpDetector(MyEntityDetector detector, OnEntityEnter handler)
 {
     if (detector != null)
     {
         detector.OnEntityEnter -= handler;
         detector.Off();
     }
 }
 void MyRussianTransmitterMission_OnEntityEnter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (MyScriptWrapper.IsPlayerShip(entity))
     {
         MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_0200_BACKDOOR);
         sender.Off();
     }
 }
 private void StartDetector01(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (entity == MySession.PlayerShip)
     {
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Spawnpoint1);
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Spawnpoint2);
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Spawnpoint3);
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Spawnpoint4);
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnpointSlaversRight);
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnpointSlaversLeft);
         sender.Off();
     }
 }
Esempio n. 27
0
 private void DialogueBase(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (entity == MySession.PlayerShip)
     {
         MyScriptWrapper.PlayDialogue(Audio.Dialogues.MyDialogueEnum.RIFT_0200_STATION);
         MissionTimer.RegisterTimerAction(24000, DialogueBaseCont, false);
         sender.Off();
     }
 }
 private void StartDetector04(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (entity == MySession.PlayerShip)
     {
         //MyScriptWrapper.ActivateSpawnPoint(156386);
         MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SomeSpawnpoint01);
         sender.Off();
     }
 }
Esempio n. 29
0
 private void Erupt(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     if (entity == MySession.PlayerShip)
     {
         MyScriptWrapper.AddExplosion(sender, MyExplosionTypeEnum.BOMB_EXPLOSION, MyMwcUtils.GetRandomFloat(40f, 60f), MyMwcUtils.GetRandomFloat(25f, 40f), true);
         MyScriptWrapper.IncreaseHeadShake(MyMwcUtils.GetRandomFloat(5f, 15f));
         sender.Off();
     }
 }
 private void DetectorComentatorOnOnEntityEnter(MyEntityDetector sender, MyEntity entity, int meetCriterias)
 {
     MyScriptWrapper.PlaySound3D(sender, MySoundCuesEnum.VocRace04running);
     sender.Off();
 }