private void MeteorAction() { MyScriptWrapper.EnableGlobalEvent(World.Global.MyGlobalEventEnum.MeteorWind, true); MissionTimer.RegisterTimerAction(MyMwcUtils.GetRandomInt(2000, 4000), MeteorAction, false); //MyScriptWrapper.GenerateMeteor(100, MySession.PlayerShip.GetPosition() + MySession.PlayerShip.WorldMatrix.Forward * 500, MyMwcVoxelMaterialsEnum.Lava_01, MySession.PlayerShip.WorldMatrix.Forward * -1000, MyParticleEffectsIDEnum.MeteorTrail_FireAndSmoke); }
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); }
void Accelerate() { if (m_moveMS_AccelerateCounter < 150) { m_moveMS_Speed += 28f; MissionTimer.RegisterTimerAction(250, Accelerate, false); } }
void AsteroidInsideExplosion4() { MyScriptWrapper.AddExplosion(MyScriptWrapper.GetEntity((uint)EntityID.ExplosionIn4_1), MyExplosionTypeEnum.BOMB_EXPLOSION, 100f, 500f); MyScriptWrapper.AddExplosion(MyScriptWrapper.GetEntity((uint)EntityID.ExplosionIn4_2), MyExplosionTypeEnum.BOMB_EXPLOSION, 100f, 500f); MyScriptWrapper.SetParticleEffect(MyScriptWrapper.GetEntity((uint)EntityID.ExplosionLarge2), true); MyScriptWrapper.PlaySound3D(MySession.PlayerShip, MySoundCuesEnum.SfxShipLargeExplosion); MissionTimer.RegisterTimerAction(1000, AsteroidInsideExplosion4_2, false); }
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 MyScriptWrapperOnOnDialogueFinished(MyDialogueEnum dialogue, bool interrupted) { switch (dialogue) { case MyDialogueEnum.EAC_AMBUSH_0300_GUYS_HURRY_UP: MyScriptWrapper.PlayDialogue(MyDialogueEnum.EAC_AMBUSH_0400_MARCUS_TO_EAC); break; case MyDialogueEnum.EAC_AMBUSH_0400_MARCUS_TO_EAC: if (m_backToMadelyn.IsAvailable()) { m_backToMadelyn.Success(); } if (m_speakWithPolice.IsAvailable()) { m_speakWithPolice.Success(); } MyScriptWrapper.ActivateSpawnPoints(m_barricadeSpawns); m_speakWithPoliceDialogueFinished = true; break; case MyDialogueEnum.EAC_AMBUSH_1200_1300: MyScriptWrapper.HideEntity(m_ravenGirl); MyScriptWrapper.RemoveEntityMark(m_ravenGirl); MyScriptWrapper.SetEntitiesEnabled(m_particlesMarcus, false); m_marcus.AITemplate = MyBotAITemplates.GetTemplate(MyAITemplateEnum.PASSIVE); m_marcus.SetWaypointPath("MarcusRetreat"); m_marcus.PatrolMode = MyPatrolMode.ONE_WAY; m_marcus.Patrol(); m_ravenGuy.AITemplate = MyBotAITemplates.GetTemplate(MyAITemplateEnum.PASSIVE); m_ravenGuy.SetWaypointPath("VitolinoRetreat"); m_ravenGuy.PatrolMode = MyPatrolMode.ONE_WAY; m_ravenGuy.Patrol(); MyScriptWrapper.PlayDialogue(MyDialogueEnum.EAC_AMBUSH_1500); MissionTimer.RegisterTimerAction(30000, MarcusForCrashDialogue, false); break; case MyDialogueEnum.EAC_AMBUSH_1500: //MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.Special, 3, "LostInTheDistance"); break; case MyDialogueEnum.EAC_AMBUSH_1600: //MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.SadnessOrDesperation, 3, "KA02"); //TODO: change to MyScriptWrapper.PlayDialogue(MyDialogueEnum.EAC_AMBUSH_1650); MarcusForCrash(); break; case MyDialogueEnum.EAC_AMBUSH_1650: Boom(); break; } }
void O05GetCloserToEnemyLoaded(MyMissionBase sender) { MyScriptWrapper.StopTransition(3); MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.DesperateWithStress, 1, "KA01"); //smuggler.SetWaypointPath("SmugglerRun2"); m_manjeet.PatrolMode = MyPatrolMode.ONE_WAY; m_manjeet.Patrol(); m_manjeet.LookTarget = null; MissionTimer.RegisterTimerAction(10000, StartPathDialogue, false); }
private void M08DestroyOnMissionSuccess(MyMissionBase sender) { MyScriptWrapper.PlayDialogue(MyDialogueEnum.WHITEWOLVES_RESEARCH_0600_DESTROY); Boom1(); MissionTimer.RegisterTimerAction(250, Boom1Hide, false); MissionTimer.RegisterTimerAction(1000, Boom2, false); MissionTimer.RegisterTimerAction(1250, Boom2Hide, false); MissionTimer.RegisterTimerAction(2020, Boom3, false); MissionTimer.RegisterTimerAction(2450, Boom3Hide, false); }
private void RiftReached(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (entity == MySession.PlayerShip) { //MyAudio.ApplyTransition(MyMusicTransitionEnum.Mystery); // start shakes m_riftShake = true; MissionTimer.RegisterTimerAction(MyMwcUtils.GetRandomInt(4000, 12000), m_farExplosionAction, false); } }
void O01FlyTowardsMadelynSuccess(MyMissionBase sender) { MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.HeavyFight, 3, "KA03"); MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnLastAsteroid); MyScriptWrapper.PlayDialogue(MyDialogueEnum.CHINESE_ESCAPE_0900_KILL_THOSE_BASTARDS); MissionTimer.RegisterTimerAction(15000, ExplosionLastAsteroid1, false); MyScriptWrapper.SetParticleEffect(MyScriptWrapper.GetEntity((uint)EntityID.ExplosionParticleLeft1), true); MyScriptWrapper.PlaySound3D(MySession.PlayerShip, MySoundCuesEnum.SfxShipLargeExplosion); MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnLastL); MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnLastR); }
//private void AssignTargetsToBots() //{ // foreach (var spawn in m_spawnCompanions) // { // MyScriptWrapper.GetEntity(spawn).Faction = MyMwcObjectBuilder_FactionEnum.China; // foreach (var bot in MyScriptWrapper.GetSpawnPointBots(spawn)) // { // if (bot.Ship != null) // { // bot.Ship.Attack(MyScriptWrapper.GetEntity((uint)m_transporterAttackPoints[MyMwcUtils.GetRandomInt(m_transporterAttackPoints.Count)])); // } // } // } // if (m_reassignBotTargets) // { // MissionTimer.RegisterTimerAction(3000, AssignTargetsToBots, false); // } //} private void DetectorActionSecond(MyEntityDetector sender, MyEntity entity, int meetCriterias) { if (entity == m_transporter) { MissionTimer.RegisterTimerAction(8000, AsteroidInsideExplosionR2, false); MissionTimer.RegisterTimerAction(12000, AsteroidInsideExplosionL1, false); MissionTimer.RegisterTimerAction(20000, WatchFront, false); MissionTimer.RegisterTimerAction(15000, AsteroidInsideExplosion3, false); MissionTimer.RegisterTimerAction(18000, AsteroidInsideExplosion4, false); MyScriptWrapper.AddExplosion(MyScriptWrapper.GetEntity((uint)EntityID.ExplosionRight1_1), MyExplosionTypeEnum.BOMB_EXPLOSION, 100f, 500f); m_detectorSecond.Off(); m_detectorSecond.OnEntityEnter -= DetectorActionSecond; m_detectorThird.OnEntityEnter += DetectorActionThird; m_detectorThird.On(); } }
private void FarExplosion() { // MainShake MyScriptWrapper.IncreaseHeadShake(MyMwcUtils.GetRandomInt(7, 10)); MyScriptWrapper.AddAudioImpShipQuake(); // Register sub shakes MissionTimer.RegisterTimerAction(MyMwcUtils.GetRandomInt(200, 400), m_subShakeAction, false); MissionTimer.RegisterTimerAction(MyMwcUtils.GetRandomInt(600, 800), m_subShakeAction, false); MissionTimer.RegisterTimerAction(MyMwcUtils.GetRandomInt(800, 1200), m_subShakeAction, false); MissionTimer.RegisterTimerAction(MyMwcUtils.GetRandomInt(1200, 1400), m_subShakeAction, false); // Register next far explosion MissionTimer.RegisterTimerAction(MyMwcUtils.GetRandomInt(3000, 5000), m_shakeAction, false); //TODO add particle effect }
private void OnDetectorEnter(MyEntityDetector sender, MyEntity entity, int meetcriterias) { if (m_restartRace) { MyScriptWrapper.RemoveEntityMark(m_detector); ResetStart(); m_restartRace = false; Name = m_prepareName; } else //only first time { MyScriptWrapper.PlaySound3D(sender, MySoundCuesEnum.VocRace01Welcome); m_startSoundFinished = false; MissionTimer.RegisterTimerAction(14000, () => { m_startSoundFinished = true; }); } }
private void Boom() { StartMovingMadelyn2(); MyScriptWrapper.HideEntity(m_marcus); MyScriptWrapper.RemoveEntityMark(m_marcus); MyScriptWrapper.PlayDialogue(MyDialogueEnum.EAC_AMBUSH_1700); MyScriptWrapper.DeactivateSpawnPoints(m_wavesMarcusSpawns); MyScriptWrapper.AddExplosions(m_particlesExplosion1, Explosions.MyExplosionTypeEnum.LARGE_SHIP_EXPLOSION, 100, particleIDOverride: MyParticleEffectsIDEnum.Explosion_Medium); MissionTimer.RegisterTimerAction(3000, Boom1, false); MissionTimer.RegisterTimerAction(4000, Boom2, false); MissionTimer.RegisterTimerAction(4500, Boom2_2, false); MissionTimer.RegisterTimerAction(5000, Boom3, false); MissionTimer.RegisterTimerAction(5500, Boom4, false); MissionTimer.RegisterTimerAction(7000, Boom4_2, false); MissionTimer.RegisterTimerAction(30000, EndGame, false); }
void autodestructEscape_OnMissionLoaded(MyMissionBase sender) { MyScriptWrapper.SetEntityEnabled(MyScriptWrapper.GetEntity((uint)EntityID.DoorHubA), false); MyScriptWrapper.SetAlarmMode((uint)EntityID.AlarmAutodestruct1, true); MyScriptWrapper.SetAlarmMode((uint)EntityID.AlarmAutodestruct2, true); MyScriptWrapper.TryUnhide((uint)EntityID.TurretAutodescrut1); MyScriptWrapper.TryUnhide((uint)EntityID.TurretAutodescrut2); MyScriptWrapper.TryUnhide((uint)EntityID.TurretAutodescrut3); MyScriptWrapper.TryUnhide((uint)EntityID.TurretAutodescrut4); MyScriptWrapper.SetWaypointListSecrecy(new List <uint> { (uint)EntityID.WaypointAutodestruct1, (uint)EntityID.WaypointAutodestruct2 }, true); MissionTimer.RegisterTimerAction(TimeSpan.FromMinutes(1), Autodestruct, false, MyTexts.AutodestructIn, false); }
private void DetectorActionThird(MyEntityDetector sender, MyEntity entity, int meetCriterias) { MyScriptWrapper.SetParticleEffect(MyScriptWrapper.GetEntity((uint)EntityID.ExplosionLarge3), true); MyScriptWrapper.PlaySound3D(MySession.PlayerShip, MySoundCuesEnum.SfxShipLargeExplosion); if (entity == m_transporter) { m_moveMadelynFlag = true; MyScriptWrapper.SetParticleEffect(MyScriptWrapper.GetEntity((uint)EntityID.ExplosionParticleFirstRight), true); MyScriptWrapper.PlaySound3D(MySession.PlayerShip, MySoundCuesEnum.SfxShipLargeExplosion); MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnCenterL); MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnCenterR); MyScriptWrapper.PlayDialogue(MyDialogueEnum.CHINESE_ESCAPE_0700_ON_THE_RIGHT); MissionTimer.RegisterTimerAction(20000, Last1, false); m_detectorThird.Off(); m_detectorThird.OnEntityEnter -= DetectorActionThird; } }
private void MyScriptWrapperOnBotReachedWaypoint(MyEntity bot, MyEntity waypoint) { if (m_07followContact.IsAvailable() && waypoint.EntityId.Value.NumericValue == (uint)EntityID.WaypointFollow1 && bot == MyScriptWrapper.GetEntity("Mitchel")) { MissionTimer.RegisterTimerAction(5000, Follow1Reached, false); } MySmallShipBot vesselGuardL = (MySmallShipBot)MyScriptWrapper.TryGetEntity("GuardL"); MySmallShipBot vesselGuardR = (MySmallShipBot)MyScriptWrapper.TryGetEntity("GuardR"); if (m_waitForTheMoment.IsAvailable() && bot == vesselGuardL && waypoint.EntityId.Value.NumericValue == (uint)EntityID.WaypointGuardL) { m_guardLReached = true; } if (m_waitForTheMoment.IsAvailable() && bot == vesselGuardR && waypoint.EntityId.Value.NumericValue == (uint)EntityID.WaypointGuardR) { m_guardRReached = true; } }
public override void Load() { base.Load(); MissionTimer.RegisterTimerAction(MyMwcUtils.GetRandomInt(40000, 50000), SolarwindAction, false); MissionTimer.RegisterTimerAction(MyMwcUtils.GetRandomInt(4000, 5000), MeteorAction, false); m_riftShake = false; MyEntityDetector shakeDetector = MyScriptWrapper.GetDetector((uint)EntityID.Deterctor_shakes); shakeDetector.OnEntityEnter += RiftReached; shakeDetector.OnEntityLeave += RiftLeft; shakeDetector.On(); foreach (var detector in m_eruptionDetectors) { MyEntityDetector eruptionDetector = MyScriptWrapper.GetDetector(detector); eruptionDetector.OnEntityEnter += Erupt; eruptionDetector.On(); } /* * foreach (var detector in m_meteorDetectors) * { * MyEntityDetector MeteorDetector = MyScriptWrapper.GetDetector(detector); * MeteorDetector.OnEntityEnter += Meteorite; * MeteorDetector.On(); * } */ MySmallShipBot ravenGirl = (MySmallShipBot)MyScriptWrapper.GetEntity("RavenGirl"); MySmallShipBot ravenGuy = (MySmallShipBot)MyScriptWrapper.GetEntity("RavenGuy"); MyScriptWrapper.StopFollow(ravenGirl); MyScriptWrapper.StopFollow(ravenGuy); ravenGirl.LookTarget = MySession.PlayerShip; ravenGuy.LookTarget = MySession.PlayerShip; MyAudio.MusicAllowed = false; //to forbid action music caused by bot fight MissionTimer.RegisterTimerAction(1000, PlayActionMusic, false); }
void Last3() { MissionTimer.RegisterTimerAction(15000, Last4, false); MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnLast3); MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnLast3_2); }
void BackToTransmitter_Loaded(MyMissionBase sender) { MissionTimer.RegisterTimerAction(TimeSpan.FromMinutes(5), () => Fail(MyTextsWrapperEnum.Fail_TimeIsUp), false); }
void AsteroidInsideExplosionL1() { MyScriptWrapper.AddExplosion(MyScriptWrapper.GetEntity((uint)EntityID.ExplosionLeft1_1), MyExplosionTypeEnum.BOMB_EXPLOSION, 100f, 500f); MissionTimer.RegisterTimerAction(1000, AsteroidInsideExplosionL2, false); }
void RussianCommandoLoaded(MyMissionBase sender) { MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_1100_MADELYNSCARED); MissionTimer.RegisterTimerAction(TimeSpan.FromSeconds(5), () => MyScriptWrapper.PlayDialogue(MyDialogueEnum.RUSSIAN_TRANSMITTER_1300_APOLLOSCARED), false); MissionTimer.RegisterTimerAction(TimeSpan.FromSeconds(65), () => m_fightRussianCommando.Success(), false); }
public override void Update()//vola se v kazdem snimku { base.Update(); if (m_moveMS_Up) { foreach (var item in m_standbyparticle) { MyEntity particle = MyScriptWrapper.GetEntity(item); MyScriptWrapper.SetEntityEnabled(particle, true); MoveMotherShipForward(particle, new Vector3(0, m_moveMS_Speed, 0)); } foreach (var item in m_finalparticle) { MyEntity particle = MyScriptWrapper.GetEntity(item); MoveMotherShipForward(particle, new Vector3(0, m_moveMS_Speed, 0)); } m_moveMS_Back = MoveMotherShipForwardDest(m_fourthReichMS, new Vector3(0, m_moveMS_Speed, 0), m_fourthReichMS_UpDestination); if (m_moveMS_Back) { m_moveMS_Up = false; } } if (m_moveMS_Back) { foreach (var item in m_standbyparticle) { MyEntity particle = MyScriptWrapper.GetEntity(item); MoveMotherShipForward(particle, new Vector3(0, 0, m_moveMS_Speed)); } foreach (var item in m_finalparticle) { MyEntity particle = MyScriptWrapper.GetEntity(item); MoveMotherShipForward(particle, new Vector3(0, 0, m_moveMS_Speed)); } m_moveMS_Up2 = MoveMotherShipForwardDest(m_fourthReichMS, new Vector3(0, 0, m_moveMS_Speed), m_fourthReichMS_BackDestination); if (m_moveMS_Up2) { m_moveMS_Back = false; } } if (m_moveMS_Up2) { foreach (var item in m_standbyparticle) { MyEntity particle = MyScriptWrapper.GetEntity(item); MyScriptWrapper.SetEntityEnabled(particle, false); MoveMotherShipForward(particle, new Vector3(0, m_moveMS_Speed, 0)); } foreach (var item in m_finalparticle) { MyEntity particle = MyScriptWrapper.GetEntity(item); MyScriptWrapper.SetEntityEnabled(particle, true); MoveMotherShipForward(particle, new Vector3(0, m_moveMS_Speed, 0)); } m_moveMS_Out = MoveMotherShipForwardDest(m_fourthReichMS, new Vector3(0, m_moveMS_Speed, 0), m_fourthReichMS_Up2Destination); if (m_moveMS_Out) { MissionTimer.RegisterTimerAction(300, Accelerate, false); m_moveMS_Up2 = false; } } if (m_moveMS_Out) { foreach (var item in m_standbyparticle) { MyEntity particle = MyScriptWrapper.GetEntity(item); MoveMotherShipForward(particle, new Vector3(0, 0, -m_moveMS_Speed)); } foreach (var item in m_finalparticle) { MyEntity particle = MyScriptWrapper.GetEntity(item); MoveMotherShipForward(particle, new Vector3(0, 0, -m_moveMS_Speed)); } MoveMotherShipForward(m_fourthReichMS, new Vector3(0, 0, -m_moveMS_Speed)); } }
void ExplosionLastAsteroid1() { MissionTimer.RegisterTimerAction(5000, ExplosionLastAsteroid2, false); MyScriptWrapper.SetParticleEffect(MyScriptWrapper.GetEntity((uint)EntityID.ExplosionParticleRight1), true); MyScriptWrapper.PlaySound3D(MySession.PlayerShip, MySoundCuesEnum.SfxShipLargeExplosion); }
private void ReachTheRiftSubmissionLoaded(MyMissionBase sender) { MyScriptWrapper.PlayDialogue(Audio.Dialogues.MyDialogueEnum.RIFT_0400_SHOPPINGDONE); MissionTimer.RegisterTimerAction(20000, PlayRiftMusic, false); }
void m_objective02_defendMadelyn_OnMissionLoaded(MyMissionBase sender) { MissionTimer.RegisterTimerAction(TimeSpan.FromMinutes(2), MadelynDefended, false, MyTexts.DefendMadelyn, false); }
private void SolarwindAction() { MyScriptWrapper.EnableGlobalEvent(World.Global.MyGlobalEventEnum.SunWind, true); MissionTimer.RegisterTimerAction(MyMwcUtils.GetRandomInt(5000, 40000), SolarwindAction, false); }
void Last4() { MissionTimer.RegisterTimerAction(5000, MadelynInSight, false); MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnLast4); }