public void Reset() { // Remove also dead bots foreach (var bot in MyBotCoordinator.GetBots()) { if (EntityId.HasValue && bot.OwnerId == EntityId.Value.NumericValue && bot.IsDead()) { bot.MarkForClose(); } } foreach (var bot in m_botShips) { if (bot.Ship != null && !bot.Ship.Closed) { bot.Ship.MarkForClose(); } bot.Ship = null; bot.SpawnTime = MyMinerGame.TotalGamePlayTimeInMilliseconds; bot.FirstSpawned = false; } LeftToSpawn = MaxSpawnCount; m_allKilledEventRaised = false; FirstSpawnDone = false; }
public static void MakeEnemy(MyMwcObjectBuilder_FactionEnum shipFaction) { // Order bots to kill player foreach (var bot in MyBotCoordinator.GetBots()) { var relation = MyFactions.GetFactionsRelation(shipFaction, bot.Faction); if (relation == MyFactionRelationEnum.Friend || relation == MyFactionRelationEnum.Neutral) { bot.Attack(MySession.PlayerShip); } } MyScriptWrapper.SetPlayerFaction(MyMwcObjectBuilder_FactionEnum.Freelancers); MyMissions.DisableSaveObjectives(); }
public void Start(Vector3 position, Vector3 initialVelocity, Vector3 direction, float impulseMultiplier, MyEntity owner) { base.Start(position, initialVelocity, direction, impulseMultiplier, owner); m_hologramState = HologramState.Deactivated; if (!TimeToActivate.HasValue) { TimeToActivate = MyHologramConstants.TIME_TO_ACTIVATE; } foreach (var bot in MyBotCoordinator.GetBots()) { if (bot.CanSeeTarget(owner)) { m_awareBots.Add(bot); } } }