Пример #1
0
        public override void OnFiring(Vector3 startPosition, Vector3 direction)
        {
            base.OnFiring(startPosition, direction);
            if (projectiles.Count < instanceCount)
            {
                UltraPhaserProjectile projectile = new UltraPhaserProjectile(Game, startPosition, direction, this, WeaponHolderType);
                Game.World.AddObject(projectile);
                projectiles.Add(projectile);
            }

            //TODO: Implement WeaponUpgrades
            #region Dreckiger Hack für Rotating DUAL Lasers (AUS ALTER ULTRAPHASER)

            //Vector3 left = Vector3.Cross(Vector3.Transform(Vector3.Up, Parent.GlobalRotation), dir);
            //left.Normalize();
            //Quaternion t = Quaternion.CreateFromAxisAngle(dir, weaponSpin);
            //Vector3 pos1 = Vector3.Transform(left*(0.3f), t);
            //Vector3 pos2 = Vector3.Transform(left*(-0.3f), t);

            //Vector3 left = Vector3.Cross(Vector3.Transform(Vector3.Up, Parent.GlobalRotation), dir);
            //left.Normalize();
            //Vector3 pos1 = left*(0.5f);
            //Vector3 pos2 = left*(-0.5f);

            //UltraPhaserProjectile projectile;

            //switcher = !switcher;
            //if (switcher)
            //    projectile = new UltraPhaserProjectile(game, pos1 + start, dir, this);
            //else
            //    projectile = new UltraPhaserProjectile(game, pos2 + start, dir, this);

            //if (projectiles.Count < instanceCount)
            //{
            //    projectile = new UltraPhaserProjectile(game, pos1 + start, dir, this, weaponHolderType);
            //    game.World.AddObject(projectile);
            //    projectiles.Add(projectile);
            //}

            //if (projectiles.Count < instanceCount)
            //{
            //    projectile = new UltraPhaserProjectile(game, pos2 + start, dir, this, weaponHolderType);
            //    game.World.AddObject(projectile);
            //    projectiles.Add(projectile);
            //}

            #endregion
        }
Пример #2
0
 public void RemoveProjectileReference(UltraPhaserProjectile projectile)
 {
     projectiles.Remove(projectile);
 }