示例#1
0
        internal void ExecuteOrders(float dt)
        {
            switch (MyState)
            {
            case State.ACTIVE:
                if (WeaponAbility != null && Aircraft.MyState != Aircraft.State.SHOT_DOWN)
                {
                    WeaponAbility.ExecuteOrders(dt);
                }
                if (ManeuverAbility != null && Aircraft.CloudFrameCountdown == 0)
                {
                    ManeuverAbility.ExecuteOrders(dt * (Aircraft.CLOUD_FRAME_COUNTDOWN + 1), PositionWorldspace, TotalRotation);
                }
                break;

            case State.DESTROYED:
                if (ManeuverAbility != null && Aircraft.CloudFrameCountdown == 0)
                {
                    ManeuverAbility.ExecuteOrders(dt * (Aircraft.CLOUD_FRAME_COUNTDOWN + 1), PositionWorldspace, TotalRotation, decayOnly: true);
                }
                break;
            }
            if (Aircraft.CloudFrameCountdown == 0)
            {
                foreach (var damageTail in DamageCloudTailNodes)
                {
                    damageTail.Advance(dt * (Aircraft.CLOUD_FRAME_COUNTDOWN + 1), PositionWorldspace, TotalRotation);
                }
            }
        }
示例#2
0
        public BodyJet() : base("bodyJet.png")
        {
            SetHealthAndMaxHealth(40);
            NormalAnchorPoint = CCPoint.AnchorMiddle;
            // set your types
            Types = new Type[] { Type.BODY };

            // add mount points for two single wings
            var wingMount1 = new PartMount(this, new CCPoint(ContentSize.Width * 0.4f, (ContentSize.Height / 2) + 5), Type.SINGLE_WING);
            var wingMount2 = new PartMount(this, new CCPoint(ContentSize.Width * 0.4f, (ContentSize.Height / 2) - 5), Type.SINGLE_WING);
            // add mount points for two rudders
            var rudderMount1 = new PartMount(this, new CCPoint(6f, (ContentSize.Height / 2) + 2), Type.RUDDER);
            var rudderMount2 = new PartMount(this, new CCPoint(6f, (ContentSize.Height / 2) - 2), Type.RUDDER);

            PartMounts = new PartMount[] { wingMount1, wingMount2, rudderMount1, rudderMount2 };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(80);

            // add a special maneuver ability! (jet propulsion :) )
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 2.75f, (float)Math.Pow(10, 5) * 35.0f);
            ManeuverAbility.CloudTailNode.ReferenceSize *= 2f;
        }
示例#3
0
        public TestEngine() : base("testEngine.png")
        {
            // set your types
            Types             = new Type[] { Type.ENGINE };
            NormalAnchorPoint = CCPoint.AnchorMiddle;

            // specify the mass points
            MassPoints = new MassPoint[] { new MassPoint(ContentSize.Width / 2, ContentSize.Height / 2, 30) };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the engine maneuver abilities
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 0.25f, (float)Math.Pow(10, 5) * 3.0f);//, (float)Math.Pow(10, 5)*0.1f, (float)Math.Pow(10, 5));
        }
示例#4
0
        public RudderBigBomberShiny() : base("rudderBigBomberShiny.png")
        {
            SetHealthAndMaxHealth(30);
            // set your types
            Types             = new Type[] { Type.RUDDER };
            NormalAnchorPoint = new CCPoint(0.5f, 0f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(35f);

            // specify the collision type
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rudder ManeuverAbility
            ManeuverAbility = new ManeuverAbility(0, 0, (float)Math.Pow(10, 5) * 5f, (float)Math.Pow(10, 5) * 10f);
        }
示例#5
0
        public TestRudder() : base("testRudder.png")
        {
            SetHealthAndMaxHealth(4);
            // set your types
            Types             = new Type[] { Type.RUDDER };
            NormalAnchorPoint = new CCPoint(0.5f, 0f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(5f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rotor ManeuverAbility
            ManeuverAbility = new ManeuverAbility(0, 0, (float)Math.Pow(10, 5) * 1f, (float)Math.Pow(10, 5) * 3.0f);
        }
示例#6
0
        public RudderJet() : base("rudderJet.png")
        {
            SetHealthAndMaxHealth(20);
            // set your types
            Types             = new Type[] { Type.RUDDER };
            NormalAnchorPoint = new CCPoint(5f / ContentSize.Width, 0f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(8f);

            // specify the collision type
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rudder ManeuverAbility
            ManeuverAbility = new ManeuverAbility(0, 0, (float)Math.Pow(10, 5) * 2.5f, (float)Math.Pow(10, 5) * 10f);
        }
        public TestRotorShiny() : base("rotorTestShiny.png")
        {
            SetHealthAndMaxHealth(11);
            // set your types
            Types             = new Type[] { Type.ROTOR };
            NormalAnchorPoint = new CCPoint(3 / ContentSize.Width, 0.5f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(11f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rotor ManeuverAbility
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 7.25f, (float)Math.Pow(10, 5) * 17.0f);
        }
示例#8
0
        public WingAngel() : base("wingAngel.png")
        {
            SetHealthAndMaxHealth(10);
            // set your types
            Types             = new Type[] { Type.SINGLE_WING };
            NormalAnchorPoint = new CCPoint(0.5f, 1 / ContentSize.Height);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(20f);

            // give it a maneuver ability
            ManeuverAbility = new ManeuverAbility(0, 0, 0, (float)Math.Pow(10, 5) * 3.75f);
        }
        public WingPotato() : base("wingPotato.png")
        {
            SetHealthAndMaxHealth(3);
            // set your types
            Types             = new Type[] { Type.SINGLE_WING };
            NormalAnchorPoint = new CCPoint(0.6f, 2 / ContentSize.Height);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(12f);

            // give it a maneuver ability!
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 1.25f, (float)Math.Pow(10, 5) * 2.0f, (float)Math.Pow(10, 5) * 0.45f, (float)Math.Pow(10, 5) * 0.75f);
            ManeuverAbility.CloudTailNode = null;
        }
示例#10
0
        public DoubleWingScrap() : base("doubleWingScrap.png")
        {
            SetHealthAndMaxHealth(22);
            // set your types
            Types             = new Type[] { Type.WINGS };
            NormalAnchorPoint = CCPoint.AnchorMiddle;

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the wings a special ManeuverAbility (allowing to glide forward even after the rotor has been hit)
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 4.25f, (float)Math.Pow(10, 5) * 4.3f);
            ManeuverAbility.CloudTailNode = null;

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(60);
        }
        public RotorBalloonShiny() : base("rotorBalloonShiny.png")
        {
            SetHealthAndMaxHealth(10);
            // set your types
            Types             = new Type[] { Type.ROTOR };
            NormalAnchorPoint = new CCPoint(0.35f, 0.5f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(12f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rotor ManeuverAbility
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 0.5f, (float)Math.Pow(10, 5) * 4.0f);
            ManeuverAbility.CloudTailNode.CloudDelay    = 0.35f;
            ManeuverAbility.CloudTailNode.CloudLifeTime = 1.0f;
        }
        public RotorPotato() : base("rotorPotato.png")
        {
            SetHealthAndMaxHealth(5);
            // set your types
            Types             = new Type[] { Type.ROTOR };
            NormalAnchorPoint = new CCPoint(3 / ContentSize.Width, 0.5f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(8f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rotor ManeuverAbility
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 0.75f, (float)Math.Pow(10, 5) * 2.0f);
            ManeuverAbility.CloudTailNode.CloudDelay    = 0.5f;
            ManeuverAbility.CloudTailNode.CloudLifeTime = 1.5f;
        }
示例#13
0
        public RotorBigBomberShiny() : base("rotorBigBomberShiny.png")
        {
            SetHealthAndMaxHealth(11);
            // set your types
            Types             = new Type[] { Type.ROTOR };
            NormalAnchorPoint = new CCPoint(3 / ContentSize.Width, 0.5f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(11f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rotor ManeuverAbility
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 3.0f, (float)Math.Pow(10, 5) * 11.0f);
            ManeuverAbility.CloudTailNode.CloudDelay    *= 2;
            ManeuverAbility.CloudTailNode.CloudLifeTime /= 2;
            ManeuverAbility.CloudTailNode.ReferenceSize  = 24f;
        }
示例#14
0
        public RotorBatShiny() : base("rotorBatShiny.png")
        {
            SetHealthAndMaxHealth(8);
            // set your types
            Types             = new Type[] { Type.ROTOR };
            NormalAnchorPoint = new CCPoint(1 / ContentSize.Width, 0.5f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(4f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rotor ManeuverAbility
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 0.35f, (float)Math.Pow(10, 5) * 3.5f);
            ManeuverAbility.CloudTailNode.CloudDelay    = 0.2f;
            ManeuverAbility.CloudTailNode.CloudLifeTime = 1.25f;
            ManeuverAbility.CloudTailNode.CloudColor    = new CCColor4B(1f, 0.8f, 1f, 1f);
        }
示例#15
0
        public WingPotatoShiny() : base("wingPotatoShiny.png")
        {
            SetHealthAndMaxHealth(3);
            // set your types
            Types             = new Type[] { Type.SINGLE_WING };
            NormalAnchorPoint = new CCPoint(0.6f, 2 / ContentSize.Height);

            // SHINY: add a mount point for a weapons
            var weaponMount = new PartMount(this, new CCPoint(ContentSize.Width - 6, ContentSize.Height - 7), Type.GUN);

            weaponMount.MaxTurningAngle = 90f;

            PartMounts = new PartMount[] { weaponMount };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(15f);

            // give it a maneuver ability!
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 0.95f, (float)Math.Pow(10, 5) * 3.0f, (float)Math.Pow(10, 5) * 0.45f, (float)Math.Pow(10, 5) * 0.75f);
            ManeuverAbility.CloudTailNode = null;
        }