public override void Load() // vykona se jednou na zacatku { MyScriptWrapper.EnsureInventoryItem(MyScriptWrapper.GetCentralInventory(), MyMwcObjectBuilderTypeEnum.SmallShip_HackingTool, (int)MyMwcObjectBuilder_SmallShip_HackingTool_TypesEnum.Level_2); MyScriptWrapper.HideEntity(MyScriptWrapper.GetEntity((uint)EntityID.PC64)); // Hiding old useless HUB just for case we will need it again m_detector = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector)); m_detector.On(); m_detector.OnEntityEnter += DetectorAction; m_cargodetector = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.CargoDetector)); m_cargodetector.On(); m_cargodetector.OnEntityEnter += DetectorAction; m_hidedetector = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector_Hide)); m_hidedetector.On(); m_hidedetector.OnEntityEnter += DetectorAction; m_unhidedetector = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector_Unhide)); m_unhidedetector.OnEntityEnter += DetectorAction; m_ravengirl = MyScriptWrapper.GetEntity("RavenGirl"); m_ravenguy = MyScriptWrapper.GetEntity("RavenGuy"); foreach (var pc in m_pc) { MyScriptWrapper.RemoveEntityMark(MyScriptWrapper.GetEntity(pc)); } MyScriptWrapper.Highlight((uint)EntityID.Radar, true, this); MyScriptWrapper.EnablePhysics((uint)EntityID.Radar, false); base.Load(); }
private void OnDetectorLeave(MyEntityDetector sender, MyEntity entity) { if (m_isStartingGame) { MyScriptWrapper.RemoveEntityMark(m_detector); m_restartRace = true; MyScriptWrapper.AddNotification(MyScriptWrapper.CreateNotification(MyTextsWrapperEnum.GoBackToStartingPosition, MyHudConstants.ENEMY_FONT, 5000)); Name = m_goBackName; for (int i = 0; i < notifyCount; i++) { if (notifications[i] != null) { notifications[i].Disappear(); } } if (OnStartNumberChanged != null) { OnStartNumberChanged(-1); } if (m_startSoundFinished) { MyAudio.Stop(); } } }
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(); } } }
private void StartPositionLeaved(MyEntityDetector sender, MyEntity entity) { if (sender == m_detector_ReachStart && entity == MySession.PlayerShip) { m_playerIsOnStart = false; } }
static void OnEntityLeave(MyEntityDetector sender, MyEntity entity) { if (entity == m_detectedEntity) { m_currentInventoryScreen.CancelTransfering(); } }
public override void Load() // Code in that block will be called on the load of the sector { base.Load(); MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.HeavyFight, 3); // Sets music group to be played in the sector - no matter if the mission is running or not TimeSpan respawnTime = TimeSpan.FromSeconds(60); MyScriptWrapper.SetCargoRespawn((uint)EntityID.Cargo1, respawnTime); MyScriptWrapper.SetCargoRespawn((uint)EntityID.Cargo2, respawnTime); MyScriptWrapper.SetCargoRespawn((uint)EntityID.Cargo3, respawnTime); MyScriptWrapper.SetCargoRespawn((uint)EntityID.Cargo4, respawnTime); MyScriptWrapper.SetCargoRespawn((uint)EntityID.Cargo5, respawnTime); MyScriptWrapper.SetCargoRespawn((uint)EntityID.Cargo6, respawnTime); MyScriptWrapper.SetCargoRespawn((uint)EntityID.Cargo7, respawnTime); MyScriptWrapper.SetCargoRespawn((uint)EntityID.Cargo8, respawnTime); MyScriptWrapper.SetCargoRespawn((uint)EntityID.Cargo9, respawnTime); MyScriptWrapper.SetCargoRespawn((uint)EntityID.Cargo10, respawnTime); MyScriptWrapper.SetCargoRespawn((uint)EntityID.Cargo11, respawnTime); MyScriptWrapper.SetCargoRespawn((uint)EntityID.Cargo12, respawnTime); m_Detector1 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector1)); m_Detector1.OnEntityEnter += Detector1Action; m_Detector1.On(); m_Detector2 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector2)); m_Detector2.OnEntityEnter += Detector2Action; m_Detector2.On(); m_Detector3 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector3)); m_Detector3.OnEntityEnter += Detector3Action; m_Detector3.On(); }
private void RaceExplosionsDetectorEntered(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (sender == m_detector_Explosion1 && entity == MySession.PlayerShip) { MyScriptWrapper.AddExplosions(m_explosionParticles1, MyExplosionTypeEnum.BOMB_EXPLOSION, 5); MyScriptWrapper.PlaySound3D(MyScriptWrapper.GetEntity(m_explosionParticles1[0]), MySoundCuesEnum.VocRace09dirtyTricks); //MyScriptWrapper.IncreaseHeadShake(12f); } if (sender == m_detector_Explosion2 && entity == MySession.PlayerShip) { MyScriptWrapper.AddExplosions(m_explosionParticles2, MyExplosionTypeEnum.BOMB_EXPLOSION, 5); //MyScriptWrapper.IncreaseHeadShake(10f); } if (sender == m_detector_Explosion3 && entity == MySession.PlayerShip) { MyScriptWrapper.AddExplosions(m_explosionParticles3, MyExplosionTypeEnum.BOMB_EXPLOSION, 5); //MyScriptWrapper.IncreaseHeadShake(11f); } if (sender == m_detector_TunnelExplosion && entity == MySession.PlayerShip) { MyScriptWrapper.AddExplosion(MyScriptWrapper.GetEntity((uint)EntityID.ParticleExplosionInTunnel), MyExplosionTypeEnum.BOMB_EXPLOSION, 5); //MyScriptWrapper.PlaySound3D(MySession.PlayerShip, MySoundCuesEnum.SfxAcquireDroneOn); //MyScriptWrapper.PlaySound3D(MySession.PlayerShip, MySoundCuesEnum.SfxShipLargeExplosion); MyScriptWrapper.PlayDialogue(MyDialogueEnum.JUNKYARD_RETURN_0500); } }
public override void Load() // Code in that block will be called on the load of the sector { base.Load(); m_Detector1 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector1)); m_Detector1.OnEntityEnter += Detector1Action; m_Detector1.On(); m_Detector2 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector2)); m_Detector2.OnEntityEnter += Detector2Action; m_Detector2.On(); m_Detector3 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector3)); m_Detector3.OnEntityEnter += Detector3Action; m_Detector3.On(); m_Detector4 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector4)); m_Detector4.OnEntityEnter += Detector4Action; m_Detector4.On(); MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.HeavyFight, 3); // Sets music group to be played in the sector - no matter if the mission is running or not MyScriptWrapper.SetPlayerFaction(MyMwcObjectBuilder_FactionEnum.Rainiers); }
//private void OnTargetDetected(MyEntityDetector sender, MyEntity entity, int criterias) //{ // m_foundSmallShips.Add(entity as MySmallShip); // m_foundSmallShipsPositionChange = true; //} //private void OnTargetLost(MyEntityDetector sender, MyEntity entity) //{ // m_foundSmallShips.Remove(entity as MySmallShip); //} //private void OnTargetPositionChanged(MyEntityDetector sender, MyEntity entity, Vector3 position) //{ // m_foundSmallShipsPositionChange = true; //} private void OnNearestTargetChange(MyEntityDetector sender, MyEntity oldNearestEntity, MyEntity newNearestEntity) { m_target = newNearestEntity as MySmallShip; if (m_target != null) { } }
public override void Load() { base.Load(); MissionTimer.RegisterTimerAction(MyMwcUtils.GetRandomInt(3000, 5000), m_shakeAction, true); doorDetector1 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity(367)); doorDetector1.OnEntityEnter += DoorDetector1Open; doorDetector1.On(); doorDetector2 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity(366)); doorDetector2.OnEntityEnter += DoorDetector2Closed; doorDetector2.On(); for (int i = 0; i < mines.GetLength(0); i++) { MyEntityDetector mineDetector = MyScriptWrapper.GetDetector(mines[i, 1]); mineDetector.OnEntityEnter += new OnEntityEnter(mineDetector_OnEntityEnter); mineDetector.OnEntityPositionChange += new OnEntityPositionChange(mineDetector_OnEntityPositionChange); mineDetector.On(); } MyScriptWrapper.OnBotReachedWaypoint += OnBotReachedWaypoint; MyScriptWrapper.OnSpawnpointBotSpawned += OnSpawnpointBotSpawned; //aliendetector MyScriptWrapper.Highlight(RadarEntity, true, this); MyScriptWrapper.EnablePhysics(RadarEntity, false); //aliendetector MyScriptWrapper.Highlight(1962, true, this); MyScriptWrapper.EnablePhysics(1962, false); }
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); }
private void StartSecurity02Detector(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (entity == MySession.PlayerShip) { MyScriptWrapper.ActivateSpawnPoints(m_spawnsSecurityDetector); sender.Off(); } }
public void Detector2_Enter(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (MyScriptWrapper.IsPlayerShip(entity)) { MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.spawn2); sender.Off(); } }
public void BridgeDetectorAction(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (MyScriptWrapper.IsPlayerShip(entity)) { MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.BridgeSpawnpoint); sender.Off(); } }
void MyRussianTransmitterMission_OnEntityEnter(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (MyScriptWrapper.IsPlayerShip(entity)) { MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_0200_BACKDOOR); sender.Off(); } }
void DummyNearVolodia_Enter(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (MyScriptWrapper.IsPlayerShip(entity)) { MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_0700_STRANGERPROPOSAL); sender.Off(); } }
void DummyNearCargo_Enter(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (MyScriptWrapper.IsPlayerShip(entity)) { MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_0800_NEARCARGO); sender.Off(); } }
public void Detector4Action(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (entity == MySession.PlayerShip) { MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Spawn4); m_Detector4.Off(); } }
void ManjeetFound(MyEntityDetector sender, MyEntity bot, int meetcriterias) { if (sender == m_manjeetFindDetector && bot == MySession.PlayerShip && m_objective01BFindInformator.IsAvailable()) { m_objective01BFindInformator.Success(); m_objective02FindSmuggler.Success(); } }
void DetectorNearHub3_Enter(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (MyScriptWrapper.IsPlayerShip(entity)) { MyScriptWrapper.PlayDialogue(MyDialogueEnum.RESEARCH_VESSEL_1200_THIRDHUB); sender.Off(); } }
void detector_OnEntityEnter(MyEntityDetector sender, MyEntity entity, int meetCriterias) { MyDummyPoint dummy = (MyDummyPoint)sender.Parent; uint scannerId = (uint)dummy.Tag; MyPrefabScanner scanner = (MyPrefabScanner)MyScriptWrapper.GetEntity(scannerId); scanner.Enabled = false; }
private MyEntityDetector InitDetector(uint detectorID, OnEntityEnter handler) { MyEntityDetector detector = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity(detectorID)); detector.OnEntityEnter += handler; detector.On(); return(detector); }
private void StartDummyDetector(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (entity == MySession.PlayerShip) { MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.StartSpawn); sender.Off(); } }
public MyPrefabScanningPartPlane(MyPrefabScanner scanner) : base(scanner) { m_scannerCriterias.Add(new MyEntityDetectorCriterium <MyEntity>(1, MyPrefabScanner.CanBeScannedCriterium, true, this)); m_entityDetector = new MyEntityDetector(); m_entityDetector.OnEntityEnter += OnEntityEnter; m_scanner.OnPositionChanged += OnScannerPositionChanged; }
public void Detector3Action(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (MySession.IsPlayerShip(entity)) { MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Spawn3); m_Detector3.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)); }
public override void Close() { base.Close(); if (m_entityDetector != null) { m_entityDetector.Close(); m_entityDetector = null; } }
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 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 DialogueMining(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (entity == MySession.PlayerShip) { MyScriptWrapper.PlayDialogue(Audio.Dialogues.MyDialogueEnum.RIFT_0600_MINING); MyScriptWrapper.EntityInventoryItemAmountChanged += OreAmountChanged; sender.Off(); } }
public override void Load() // Code in that block will be called on the load of the sector { base.Load(); MyAudio.ApplyTransition(MyMusicTransitionEnum.HeavyFight, 3); // Sets music group to be played in the sector - no matter if the mission is running or not MyScriptWrapper.SetPlayerFaction(MyMwcObjectBuilder_FactionEnum.Rainiers); MyScriptWrapper.SetFactionRelation(MyMwcObjectBuilder_FactionEnum.Russian, MyMwcObjectBuilder_FactionEnum.China, -100); base.Load(); m_Detector1 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector1)); m_Detector1.OnEntityEnter += Detector1Action; m_Detector1.On(); m_Detector2 = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.Detector2)); m_Detector2.OnEntityEnter += Detector2Action; m_Detector2.On(); }
public void Detector2Action(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (entity == MySession.PlayerShip) { MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Spawn2); m_Detector2.Off(); } }