示例#1
0
        public override void Explode()
        {
            base.Explode();

            Knight knight = (Knight)Mobile;

            //Hide Satellite
            SpecialEffectBuilder.TeleportFlame1(knight.Satellite.Flipbook.Position, 0.5f);
            knight.Satellite.Flipbook.HideElement();

            //Calculate the starting position of the shot
            Vector2 shotPos = knight.Position + ownerOffset;

            //Angle necessary to spawn the swords with the correct distance between each other
            float angle = (float)Helper.AngleBetween(shotPos, FlipbookList[0].Position) + MathHelper.PiOver2;

            //The offset between swords
            Vector2 offset = new Vector2(Parameter.ProjectileKnightDistanceBetweenShots * (float)Math.Cos(angle), Parameter.ProjectileKnightDistanceBetweenShots * (float)Math.Sin(angle));

            //Spawn 3 swords with offset distance between each other
            for (int i = -numberOfSwords / 2; i <= numberOfSwords / 2; i++)
            {
                KnightSatelliteProjectile ksp = new KnightSatelliteProjectile(knight, shotPos + offset * i,
                                                                              FlipbookList[0].Position, shotType, 0.08f * Math.Abs(i));
                ksp.OnFinalizeExecutionAction = OnFinalizeExecutionAction;
                knight.LastCreatedProjectileList.Add(ksp);
            }
        }
示例#2
0
        public override void Explode()
        {
            base.Explode();

            Knight knight = (Knight)Mobile;

            //Play the satellite animation
            knight.Satellite.StartSSAnimation();

            //Spawn the shots with spawningTime set based on the future satellite positions
            for (int i = 0; i < 7; i++)
            {
                KnightSatelliteProjectile ksp = new KnightSatelliteProjectile(knight,
                                                                              FlipbookList[0].Position + knight.Satellite.SSTargetOffset - Parameter.SatelliteSSAnimationMovementRange * ((float)Math.Cos(MathHelper.ToRadians(60 * i))),
                                                                              FlipbookList[0].Position, ShotType.SS,
                                                                              SpawnTime: Parameter.SatelliteSSAnimationTotalMotionTime + i / (3f * Parameter.StelliteAttackSpeedFactor));
                ksp.OnFinalizeExecutionAction = OnFinalizeExecutionAction;
                knight.LastCreatedProjectileList.Add(ksp);
            }
        }