示例#1
0
        public virtual void CreateDestroy()
        {
            if (IsSpawning && !IsAlive && Fleet == null)
            {
                IsSpawning = false;

                IsAlive = true;

                Fleet = CreateFleet(Color);

                Fleet.SpawnLocation = SpawnLocation;
                Fleet.Init(World);

                RemoteEventLog.SendEvent(new AuditEventSpawn
                {
                    Player = this.ToAuditModelPlayer()
                }, World);

                if (World.Hook.GearheadName != null && this.Name == World.Hook.GearheadName)
                {
                    Fleet.BaseWeapon = new FleetWeaponRobot();
                    IsGearhead       = true;
                }

                if (SpawnMomentum != null)
                {
                    foreach (var ship in Fleet.NewShips)
                    {
                        ship.Momentum = SpawnMomentum.Value;
                    }
                }

                if (!DisableSpawnInvulnerability)
                {
                    SetInvulnerability(SpawnInvulnerableTime, true);
                }

                SpawnTime = World.Time;
            }

            if (PendingDestruction)
            {
                Destroy();
                PendingDestruction = false;
            }

            IsStillPlaying = !PendingDestruction &&
                             DeadSince > World.Time - World.Hook.PlayerCountGracePeriodMS;
        }
示例#2
0
文件: Player.cs 项目: ckissane/IOGame
        public virtual void CreateDestroy()
        {
            if (IsSpawning && !IsAlive && Fleet == null)
            {
                IsSpawning = false;

                IsAlive = true;

                Fleet = CreateFleet(Color);

                Fleet.Init(World);

                IsInvulnerable = true;
                SpawnTime      = World.Time;
            }

            if (PendingDestruction)
            {
                Destroy();
                PendingDestruction = false;
            }
        }