コード例 #1
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));
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
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);
                    }
                }
            }
        }
コード例 #4
0
        private void GuardsCatchedPlayer()
        {
            MySmallShipBot vesselGuardL = (MySmallShipBot)MyScriptWrapper.GetEntity("GuardL");
            MySmallShipBot vesselGuardR = (MySmallShipBot)MyScriptWrapper.GetEntity("GuardR");

            MyScriptWrapper.ChangeFaction(vesselGuardL, MyMwcObjectBuilder_FactionEnum.Slavers);
            MyScriptWrapper.ChangeFaction(vesselGuardR, MyMwcObjectBuilder_FactionEnum.Slavers);
            Fail(MyTextsWrapperEnum.Fail_CaughtByGuards);
        }
コード例 #5
0
        private void MissedWindow()
        {
            MySmallShipBot vesselGuardL = (MySmallShipBot)MyScriptWrapper.GetEntity("GuardL");
            MySmallShipBot vesselGuardR = (MySmallShipBot)MyScriptWrapper.GetEntity("GuardR");

            MyScriptWrapper.ChangeFaction(vesselGuardL, MyMwcObjectBuilder_FactionEnum.Slavers);
            MyScriptWrapper.ChangeFaction(vesselGuardR, MyMwcObjectBuilder_FactionEnum.Slavers);
            Fail(MyTextsWrapperEnum.Fail_MissedTimeWindow);
        }
コード例 #6
0
        private void MyScriptWrapper_OnDialogueFinished(MyDialogueEnum dialogue, bool interrupted)
        {
            if (dialogue == MyDialogueEnum.CHINESE_ESCAPE_0100_INTRODUCTION)
            {
                MyScriptWrapper.PlayDialogue(MyDialogueEnum.CHINESE_ESCAPE_0200_IT_IS_TRAP);
            }
            else
            if (dialogue == MyDialogueEnum.CHINESE_ESCAPE_0200_IT_IS_TRAP)
            {
                MyScriptWrapper.SetFactionRelation(MyMwcObjectBuilder_FactionEnum.Rainiers, MyMwcObjectBuilder_FactionEnum.China, MyFactions.RELATION_WORST);
                MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.HeavyFight, 3, "MM01");

                m_motherShipSpeed = MOTHERSHIP_FULLSPEED;

                foreach (var spawn in m_spawnCompanions)
                {
                    MyScriptWrapper.ChangeFaction(spawn, MyMwcObjectBuilder_FactionEnum.China);
                    foreach (var bot in MyScriptWrapper.GetSpawnPointBots(spawn))
                    {
                        if (bot.Ship != null)
                        {
                            MyScriptWrapper.ChangeFaction(bot.Ship.EntityId.Value.NumericValue, MyMwcObjectBuilder_FactionEnum.China);
                            bot.Ship.SpeedModifier = 1f;
                            MyScriptWrapper.SetEntityDestructible(bot.Ship, true);

                            m_attackerBots.Add(bot.Ship);
                        }
                    }
                }


                m_detectorFirst.Off();
                m_detectorFirst.OnEntityEnter  -= DetectorActionFirst;
                m_detectorSecond.OnEntityEnter += DetectorActionSecond;
                m_detectorSecond.On();

                m_reassignBotTargets = true;
                //AssignTargetsToBots();

                MyScriptWrapper.AddNotification(MyScriptWrapper.CreateNotification(
                                                    MyTextsWrapperEnum.WatchMothershipHealth,
                                                    MyHudConstants.ENEMY_FONT,
                                                    8000,
                                                    null));
            }
            else if (dialogue == MyDialogueEnum.CHINESE_ESCAPE_0300_ON_THIRD)
            {
                MyScriptWrapper.PlayDialogue(MyDialogueEnum.CHINESE_ESCAPE_0400_ON_NINE);
            }
        }
コード例 #7
0
 void O05MetZappasFirstGangmanSuccess(MyMissionBase sender)
 {
     foreach (var spawn in new List <uint> {
         (uint)EntityID.MomoGangMember1, (uint)EntityID.MomoGangMember2
     })
     {
         var entity = MyScriptWrapper.GetEntity(spawn) as MySmallShipBot;
         if (entity != null)
         {
             entity.LookTarget = null;
         }
         MyScriptWrapper.ChangeFaction(entity, MyMwcObjectBuilder_FactionEnum.Slavers);
     }
 }
コード例 #8
0
 void O07DSpeakWithMomoLoaded(MyMissionBase sender)
 {
     m_momoBoss.LookTarget = MySession.PlayerShip;
     foreach (var spawn in new List <uint> {
         (uint)EntityID.SP4_1, (uint)EntityID.SP4_2, (uint)EntityID.MomoZappaSP
     })
     {
         MyScriptWrapper.ChangeFaction(spawn, MyMwcObjectBuilder_FactionEnum.Slavers);
         foreach (var bot in MyScriptWrapper.GetSpawnPointBots(spawn))
         {
             MyScriptWrapper.SetEntityDestructible(bot.Ship, true);
             MyScriptWrapper.ChangeFaction(bot.Ship, MyMwcObjectBuilder_FactionEnum.Slavers);
         }
     }
 }
コード例 #9
0
 void O2FindSmugglerSuccess(MyMissionBase sender)
 {
     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.SetEntityDestructible(bot.Ship, true);
                 MyScriptWrapper.ChangeFaction(bot.Ship, MyMwcObjectBuilder_FactionEnum.Slavers);
             }
         }
     }
 }
コード例 #10
0
        public override void Load()
        {
            // HACK: ...adding dead entities (dead by solar wind or anything)
            // These entities probably died after Reichstag A mission was successful, so they were not indestructible, solar wind came and eat them
            var colonel  = MyScriptWrapper.TryGetEntity((uint)EntityID.Bot_WaltherStauffenberg);
            var valkyrie = MyScriptWrapper.TryGetEntity((uint)EntityID.Bot_Disabled_03);

            if (colonel == null || valkyrie == null)
            {
                var sector = MyLocalCache.LoadSector(new MyMwcSectorIdentifier(MyMwcSectorTypeEnum.STORY, null, this.GetCurrentSector(), String.Empty));
                var bots   = sector.SectorObjects.OfType <MyMwcObjectBuilder_SmallShip_Bot>();
                foreach (var bot in bots)
                {
                    if (colonel == null && bot.EntityId == (uint)EntityID.Bot_WaltherStauffenberg ||
                        valkyrie == null && bot.EntityId == (uint)EntityID.Bot_Disabled_03)
                    {
                        MyEntities.CreateFromObjectBuilderAndAdd(bot.DisplayName, bot, bot.PositionAndOrientation.GetMatrix());
                    }
                }
            }

            base.Load();

            MyScriptWrapper.SetFactionRelation(MyMwcObjectBuilder_FactionEnum.FourthReich, MyMwcObjectBuilder_FactionEnum.Rainiers, MyFactions.RELATION_BEST);

            MySmallShipBot FoRrepresentative = (MySmallShipBot)MyScriptWrapper.TryGetEntity((uint)EntityID.Bot_WaltherStauffenberg);

            MyScriptWrapper.ChangeFaction(FoRrepresentative, MyMwcObjectBuilder_FactionEnum.FourthReich);
            FoRrepresentative.IsDestructible = false;
            MySmallShipBot Hans = (MySmallShipBot)MyScriptWrapper.TryGetEntity((uint)EntityID.Bot_Hans);
            MySmallShipBot Karl = (MySmallShipBot)MyScriptWrapper.TryGetEntity((uint)EntityID.Bot_Karl);

            Hans.IsDestructible = false;
            Karl.IsDestructible = false;
            Hans.Follow(FoRrepresentative);
            Karl.Follow(FoRrepresentative);

            MyScriptWrapper.DisableShip(MyScriptWrapper.GetEntity((uint)EntityID.Bot_Disabled_01), true, false);
            MyScriptWrapper.DisableShip(MyScriptWrapper.GetEntity((uint)EntityID.Bot_Disabled_02), true, false);
            MyScriptWrapper.DisableShip(MyScriptWrapper.GetEntity((uint)EntityID.Bot_Disabled_03), true, false);
            MyScriptWrapper.DisableShip(MyScriptWrapper.GetEntity((uint)EntityID.Bot_Disabled_04), true, false);
            MyScriptWrapper.DisableShip(MyScriptWrapper.GetEntity((uint)EntityID.Bot_Disabled_05), true, false);
        }
コード例 #11
0
        public override void Load() // Code in that block will be called on the load of the sector
        {
            base.Load();

            MySmallShipBot FoRrepresentative = (MySmallShipBot)MyScriptWrapper.TryGetEntity((uint)EntityID.Bot_WaltherStauffenberg);

            MyScriptWrapper.ChangeFaction(FoRrepresentative, MyMwcObjectBuilder_FactionEnum.FourthReich);
            FoRrepresentative.IsDestructible = false;
            MySmallShipBot Hans = (MySmallShipBot)MyScriptWrapper.TryGetEntity((uint)EntityID.Bot_Hans);
            MySmallShipBot Karl = (MySmallShipBot)MyScriptWrapper.TryGetEntity((uint)EntityID.Bot_Karl);

            Hans.IsDestructible = false;
            Karl.IsDestructible = false;
            Hans.Follow(FoRrepresentative);
            Karl.Follow(FoRrepresentative);

            MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.CalmAtmosphere); // Sets music group to be played in the sector - no matter if the mission is running or not

            MyScriptWrapper.SetFactionRelation(MyMwcObjectBuilder_FactionEnum.FourthReich, MyMwcObjectBuilder_FactionEnum.Rainiers, MyFactions.RELATION_NEUTRAL);
        }
コード例 #12
0
        void OnSpawnpointBotSpawned(MyEntity spawnpoint, MyEntity spawnedBot)
        {
            foreach (var sp in m_firstWave)
            {
                if (spawnpoint == MyScriptWrapper.GetEntity(sp))
                {
                    MyScriptWrapper.SetSleepDistance(spawnedBot, 3000);
                }
            }

            foreach (var item in new List <uint> {
                (uint)EntityID.SP4_1, (uint)EntityID.SP4_2
            })
            {
                if (spawnpoint.EntityId.Value.NumericValue == item)
                {
                    MyScriptWrapper.StopFollow(spawnedBot);
                    if (m_momoBoss != null)
                    {
                        MyScriptWrapper.SetEntityDestructible(spawnedBot, false);
                        MyScriptWrapper.Follow(m_momoBoss, spawnedBot);
                        MyScriptWrapper.SetSleepDistance(spawnedBot, 3000);
                    }
                    else
                    {
                        Debug.Assert(true, "Boss entity is null. Cannot identify leader");
                    }
                }
            }

            if (spawnpoint == MyScriptWrapper.GetEntity((uint)EntityID.MomoZappaSP))
            {
                spawnedBot.SetName("Momo");
                spawnedBot.DisplayName = MyTexts.MomoZappa;
                m_momoBoss             = (MySmallShipBot)spawnedBot;
                m_objective07SpeakWithMomo.BotToTalkId = MyScriptWrapper.GetEntityId(m_momoBoss);
                MyScriptWrapper.SetEntityDestructible(m_momoBoss, false);
                m_momoBoss.LookTarget = MySession.PlayerShip;
                m_momoBoss.Health     = m_momoBoss.MaxHealth = 1000;
                MyScriptWrapper.SetSleepDistance(spawnedBot, 3000);
                MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SP4_1);
                MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SP4_2);
            }

            if (spawnpoint == MyScriptWrapper.GetEntity((uint)EntityID.BR_SP_Boss))
            {
                spawnedBot.DisplayName = MyTexts.GangsterBoss;
                m_blackRavenBoss       = (MySmallShipBot)spawnedBot;
                MyScriptWrapper.SetEntityDestructible(m_blackRavenBoss, false);
                MyScriptWrapper.ChangeFaction(m_blackRavenBoss, MyMwcObjectBuilder_FactionEnum.Traders);
                m_blackRavenBoss.LookTarget = MySession.PlayerShip;
                m_blackRavenBoss.Health     = m_blackRavenBoss.MaxHealth = 500;
                MyScriptWrapper.SetSleepDistance(spawnedBot, 5000);

                m_blackRavenBoss.OnDie += OnGangsterBossDied;

                foreach (var item in new List <uint>
                {
                    (uint)EntityID.BR_SP_1,
                    (uint)EntityID.BR_SP_2,
                    (uint)EntityID.BR_SP_3,
                    (uint)EntityID.BR_SP_4,
                    (uint)EntityID.BR_SP_Boss
                })
                {
                    MyScriptWrapper.ActivateSpawnPoint(item);
                }
            }

            foreach (var item in m_spawns)
            {
                if (spawnpoint == MyScriptWrapper.GetEntity(item) && spawnedBot != m_blackRavenBoss)
                {
                    MyScriptWrapper.SetSleepDistance(spawnedBot, 5000);
                    if (m_blackRavenBoss != null && !m_blackRavenBoss.Closed)
                    {
                        if (ActiveObjectives.Contains(m_objective12BrFight))
                        {
                            MyScriptWrapper.SetEntityDestructible(spawnedBot, true);
                            MyScriptWrapper.ChangeFaction(spawnedBot, MyMwcObjectBuilder_FactionEnum.Slavers);
                        }
                        else
                        {
                            MyScriptWrapper.SetEntityDestructible(spawnedBot, false);
                            MyScriptWrapper.ChangeFaction(spawnedBot, MyMwcObjectBuilder_FactionEnum.Traders);
                        }
                        MyScriptWrapper.Follow(m_blackRavenBoss, spawnedBot);
                    }
                    else
                    {
                        MyScriptWrapper.SetEntityDestructible(spawnedBot, true);
                        MyScriptWrapper.ChangeFaction(spawnedBot, MyMwcObjectBuilder_FactionEnum.Slavers);
                        ((MySmallShipBot)spawnedBot).Attack(MySession.PlayerShip);
                    }
                }
            }
        }