Пример #1
0
 public override void onCollide(SceneObject caller, float damage)
 {
     Health -= damage;
     if (Health <= 0)
     {
         QueuedRemoval = true;
     }
     else { }
 }
        public override void onCollide(SceneObject caller, float damage)
        {
            if (Parent != null && caller != null && Parent != caller)
            {
                ProjectileManager.addEsxolusIMissile(this);

                base.onCollide(caller, damage);
            }
            else { }
        }
Пример #3
0
        public override void respawn(long _uniqueID, Vector3 _position, Quaternion _rotation, SceneObject _parent)
        {
            if (level == 1)
            {
                ttd = CHILD_TTD;
            }
            else if (level == 2)
            {
                ttd = GRANDCHILD_TTD;
            }
            else
            {
                ttd = PARENT_TTD;
            }

            split = false;

            base.respawn(_uniqueID, _position, _rotation, _parent);
        }
Пример #4
0
 public virtual SceneObject addSceneObject(SceneObject add)
 {
     queuedForAdd.Add(add); return add;
 }
Пример #5
0
 public override void onCollide(SceneObject caller, float damage)
 {
     Health -= damage;
     if (Health <= 0)
     {
         SceneObjectFactory.createExplosion(Position, Rotation);
         QueuedRemoval = true;
     }
     else { }
 }
Пример #6
0
 public override SceneObject addSceneObject(SceneObject add)
 {
     if (add.CollisionBase != null)
     {
         collisionManager.addToCollisionList(add.CollisionBase);
     }
     else { }
     return base.addSceneObject(add);
 }
 public void addCollisionItem(SceneObject item)
 {
     collisionItems.Add(item);
 }
Пример #8
0
        public override void onCollide(SceneObject caller, float damage)
        {
            base.onCollide(caller, damage);

            if (Health <= 0)
            {
                // Check is added in for missles and when multiple
                // shots hit the spawnship before it dissapears.
                if (Active)
                {
                    ((GameScene)Space394Game.GameInstance.CurrentScene).spawnPointDecrease(ShipTeam);
                    //((GameScene)(Space394Game.GameInstance.CurrentScene)).removeSpawnShip(this);
                    foreach (SpawnShipPiece piece in shipPieces)
                    {
                        piece.onCollide(this, piece.MaxHealth);
                    }
                }
                else { }
            }
            else { }
        }
Пример #9
0
        public override void onCollide(SceneObject caller, float damage)
        {
            if (caller != null && Parent != null && caller != Parent)
            {
                ProjectileManager.addLaser(this);

                base.onCollide(caller, damage);
            }
            else { }
        }
Пример #10
0
 public override void onCollide(SceneObject caller, float damage)
 {
     // Get picked up
 }
Пример #11
0
 public override void onCollide(SceneObject caller, float damage)
 {
     detectionSphere.Active = false;
     ((GameScene)Space394Game.GameInstance.CurrentScene).CollisionManager.removeFromCollisionList(detectionSphere);
     firstTrailingSphere.Active = false;
     ((GameScene)Space394Game.GameInstance.CurrentScene).CollisionManager.removeFromCollisionList(firstTrailingSphere);
     secondTrailingSphere.Active = false;
     ((GameScene)Space394Game.GameInstance.CurrentScene).CollisionManager.removeFromCollisionList(secondTrailingSphere);
     trailGenerator.Active = false;
     trailGenerator.clearLists();
     base.onCollide(caller, damage);
 }
Пример #12
0
 public override void respawn(long _uniqueID, Vector3 _position, Quaternion _rotation, SceneObject _parent)
 {
     detectionSphere.Active = true;
     ((GameScene)Space394Game.GameInstance.CurrentScene).CollisionManager.addToCollisionList(detectionSphere);
     firstTrailingSphere.Active = true;
     ((GameScene)Space394Game.GameInstance.CurrentScene).CollisionManager.addToCollisionList(firstTrailingSphere);
     secondTrailingSphere.Active = true;
     ((GameScene)Space394Game.GameInstance.CurrentScene).CollisionManager.addToCollisionList(secondTrailingSphere);
     trailGenerator.Active = true;
     base.respawn(_uniqueID, _position, _rotation, _parent);
 }
        public static Laser spawnLaser(long seed, Vector3 position, Quaternion rotation, SceneObject parent)
        {
            Laser rLaser = null;
            if (availableLasers.Count == 0)
            {
                rLaser = new Laser(seed, position, rotation);
                rLaser.respawn(seed, position, rotation, parent);
            }
            else
            {
                rLaser = availableLasers.Dequeue();
                rLaser.respawn(seed, position, rotation, parent);
            }

            return ((Laser)Space394Game.GameInstance.CurrentScene.addSceneObject(rLaser));
        }
        public static HalkIMissile spawnHalkIMissile(long seed, Vector3 position, Quaternion rotation, SceneObject parent)
        {
            HalkIMissile rSecondaryAttack = null;
            if (availableHalkIMissiles.Count == 0)
            {
                rSecondaryAttack = new HalkIMissile(seed, position, rotation);
                rSecondaryAttack.respawn(seed, position, rotation, parent);
            }
            else
            {
                rSecondaryAttack = (HalkIMissile)availableHalkIMissiles.Dequeue();
                rSecondaryAttack.respawn(seed, position, rotation, parent);
            }

            return ((HalkIMissile)Space394Game.GameInstance.CurrentScene.addSceneObject(rSecondaryAttack));
        }
        public static EsxolusBMissile spawnEsxolusBMissile(long seed, Vector3 position, Quaternion rotation, SceneObject parent)
        {
            EsxolusBMissile rBomb = null;
            if (availableExsolusBMissiles.Count == 0)
            {
                rBomb = new EsxolusBMissile(seed, position, rotation);
                rBomb.respawn(seed, position, rotation, parent);
            }
            else
            {
                rBomb = (EsxolusBMissile)availableExsolusBMissiles.Dequeue();
                rBomb.respawn(seed, position, rotation, parent);
            }

            return ((EsxolusBMissile)Space394Game.GameInstance.CurrentScene.addSceneObject(rBomb));
        }
Пример #16
0
        public override void onCollide(SceneObject caller, float damage)
        {
            if (Health > 0 && caller != null && caller != this)
            {
                if (caller is Projectile && ((Projectile)caller).Parent is Fighter && ((Fighter)((Projectile)caller).Parent).PlayerControlled) // Projectile hit
                {
                    ((Fighter)((Projectile)caller).Parent).MyPlayer.PlayerHUD.DrawConfirmed = true;
                }
                else if (caller is Fighter && ((Fighter)caller).PlayerControlled) // Straight collision
                {
                    ((Fighter)caller).MyPlayer.PlayerHUD.DrawConfirmed = true;
                }
                else { }
            }
            else { }
            Shields -= damage;
            if (Shields < 0)
            {
                Health += Shields;
                Shields = 0;
            }
            else { }

            if (Health <= 0)
            {
                QueuedRemoval = true; // Let's clean up some of these ships
                CollisionBase.Active = false; // No more onCollides
                if (PlayerControlled)
                {
                    dustGenerator.Active = false;
                }
                else { }

                Attackable = false;
            }
            else
            {
                if (PlayerControlled)
                {
                    MyPlayer.PlayerHUD.TakingHit = true;
                }
                else { }
            }
        }
Пример #17
0
 public override void onCollide(SceneObject caller, float damage)
 {
     // DO NOTHING
     return;
 }
Пример #18
0
 public override void respawn(long _uniqueID, Vector3 _position, Quaternion _rotation, SceneObject _parent)
 {
     base.respawn(_uniqueID, _position, _rotation, _parent);
 }
Пример #19
0
        public override void onCollide(SceneObject caller, float damage)
        {
            if (Health > 0 && caller != null && caller != this)
            {
                if (caller is Projectile && ((Projectile)caller).Parent is Fighter && ((Fighter)((Projectile)caller).Parent).PlayerControlled) // Projectile hit
                {
                    ((Fighter)((Projectile)caller).Parent).MyPlayer.PlayerHUD.DrawConfirmed = true;
                }
                else if (caller is Fighter && ((Fighter)caller).PlayerControlled) // Straight collision
                {
                    ((Fighter)caller).MyPlayer.PlayerHUD.DrawConfirmed = true;
                }
                else { }
            }
            else { }
            Shields = parent.Shields = parent.Shields - damage;
            float prevHealth = Health;
            if (Shields < 0)
            {
                Health += Shields;
                parent.Shields = 0;
            }
            else { }

            if (Health <= 0 && prevHealth > 0)
            {
                onDie();
                SceneObjectFactory.createMassiveExplosion(caller.Position, Rotation);
                if (parent.Health > 0 && caller != parent)
                {
                    parent.onCollide(this, MaxHealth);
                }
                else { }
            }
            else { }
        }
Пример #20
0
 public override void onCollide(SceneObject caller, float damage)
 {
     if (Health > 0 && caller != null && caller != this)
     {
         if (caller is Projectile && ((Projectile)caller).Parent is Fighter && ((Fighter)((Projectile)caller).Parent).PlayerControlled) // Projectile hit
         {
             ((Fighter)((Projectile)caller).Parent).MyPlayer.PlayerHUD.DrawConfirmed = true;
         }
         else if (caller is Fighter && ((Fighter)caller).PlayerControlled) // Straight collision
         {
             ((Fighter)caller).MyPlayer.PlayerHUD.DrawConfirmed = true;
         }
         else { }
     }
     else { }
     shields -= damage;
     if (shields < 0)
     {
         float lastHealth = Health;
         Health += shields;
         shields = 0;
     }
     else { }
 }
 public bool isColliding(SceneObject item)
 {
     return (box.isColliding(item.CollisionBase));
 }
Пример #22
0
        public override void onCollide(SceneObject caller, float damage)
        {
            if (Parent != null && caller != null && Parent != caller)
            {
                explosionCollider.Active = false;

                SceneObjectFactory.createExplosion(Position, Rotation);

                base.onCollide(caller, damage);
            }
            else { }
        }
Пример #23
0
 public override void removeSceneObject(SceneObject remove)
 {
     if (remove.CollisionBase != null)
     {
         collisionManager.removeFromCollisionList(remove.CollisionBase);
     }
     else { }
     base.removeSceneObject(remove);
 }
Пример #24
0
 public override void onCollide(SceneObject caller, float damage)
 {
     // Do nothing
 }
Пример #25
0
 public virtual void removeSceneObject(SceneObject remove)
 {
     if (sceneObjects.ContainsKey(remove.GetHashCode()))
     {
         queuedForRemoval.Add(remove);
     }
     else { }
 }
Пример #26
0
        public override void onCollide(SceneObject caller, float damage)
        {
            base.onCollide(caller, damage);

            if (Health <= 0)
            {
                SceneObjectFactory.createMassiveExplosion(Position, Rotation);
            }
            else { }
        }
Пример #27
0
 public abstract void onCollide(SceneObject caller, float damage);
Пример #28
0
 public override void onCollide(SceneObject caller, float damage)
 {
     if (parent != null && caller != parent)
     {
         QueuedRemoval = true;
         Active = false;
         CollisionBase.Active = false; // No more onCollides
     }
     else { }
 }
Пример #29
0
        public virtual void respawn(long _uniqueID, Vector3 _position, Quaternion _rotation, SceneObject _parent)
        {
            Position = _position;
            Rotation = _rotation;
            UniqueId = _uniqueID;
            QueuedRemoval = false;
            CollisionBase.Active = true;
            Active = true;

            parent = _parent;

            velocity = Vector3.Backward;

            velocity = Vector3.Transform(velocity, Rotation) * projectileSpeed;

            ttl = TTL;
        }
Пример #30
0
        public override void onCollide(SceneObject caller, float damage)
        {
            if (Parent != null && caller != null && Parent != caller)
            {
                burst();

                if (level == 0)
                {
                    ProjectileManager.addHalkAMissile(this);
                }
                else { }

                base.onCollide(caller, damage);
            }
            else { }
        }