Пример #1
0
 public override void Explode()
 {
     SpecialEffectBuilder.ArmorProjectile2Explosion(FlipbookList[0].Position);
     base.Explode();
     ExplosionRadius = Parameter.ProjectileArmorS2EExplosionRadius;
     BaseDamage      = Parameter.ProjectileArmorS2EBaseDamage;
 }
Пример #2
0
        public override void Update()
        {
            //if the number of swords in trace is 0
            //or the last created sword reach its limit distance
            if (Helper.EuclideanDistance(Position, previousSESpawnPosition) > Parameter.ProjectileKnightTraceDistanceOffset)
            {
                previousSESpawnPosition = Position;

                //a new sword and sfx is appended to the trace
                SpecialEffect sword = SpecialEffectBuilder.KnightProjectileBullet1(Position, CurrentFlipbookRotation);

                swordTrace.Insert(0, sword);

                //Transparency
                initialAlpha = Parameter.ProjectileKnightInitialAlpha;

                foreach (SpecialEffect se in swordTrace)
                {
                    se.Flipbook.Color = FlipbookList[0].Color * initialAlpha;
                    initialAlpha     -= Parameter.ProjectileKnightTraceAlphaDecay + swordTrace.Count * Parameter.ProjectileKnightTraceAlphaDecayFactor;
                }
            }

            base.Update();
        }
Пример #3
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);
            }
        }
Пример #4
0
        public override void Explode()
        {
            base.Explode();

            SpecialEffectBuilder.ArmorProjectile2Explosion(FlipbookList[0].Position);
            SpecialEffectBuilder.CommonFlameSS(FlipbookList[0].Position, FlipbookList[0].Rotation);
        }
Пример #5
0
        /// <summary>
        /// Play the Shot animation and spawn a beam on the targetting position.
        /// </summary>
        /// <param name="position"></param>
        public void Shot(Vector2 position)
        {
            flipbook.AppendAnimationIntoCycle(thorStatePresets[ActorFlipbookState.ShootingS1], true);
            flipbook.AppendAnimationIntoCycle(thorStatePresets[ActorFlipbookState.Active]);

            SpecialEffectBuilder.ThorShot((cannonPosition + position) / 2, beamColor, (float)Helper.EuclideanDistance(cannonPosition, position) / 256, (float)Helper.AngleBetween(cannonPosition, position) - MathHelper.PiOver2);
        }
Пример #6
0
        protected override void UpdatePosition()
        {
            base.UpdatePosition();

            switch (bubbleAnimation)
            {
            case ProjectileAnimationState.Closed:
                if (totalTravelledTime < Parameter.ProjectileTurtleSSTransformTime)
                {
                    totalTravelledTime += Parameter.ProjectileMovementTotalTimeElapsed;
                }
                else
                {
                    IsAbleToRefreshPosition = false;
                    bubbleAnimation         = ProjectileAnimationState.Opening;
                }
                break;

            case ProjectileAnimationState.Opening:
                bubbleAnimation = ProjectileAnimationState.Opened;
                SpecialEffectBuilder.TurtleProjectile3Division(FlipbookList[0].Position, FlipbookList[0].Rotation);
                TurtleProjectileEmitter.Shot3((Turtle)Mobile, force, FlipbookList[0].Position, FlipbookList[0].Rotation, OnFinalizeExecutionAction);
                PlayExplosionSFX();
                GameScene.Camera.TrackObject(Mobile.LastCreatedProjectileList.First());
                IsAbleToRefreshPosition = true;
                break;

            case ProjectileAnimationState.Opened:
                base.Destroy();
                break;
            }
        }
Пример #7
0
        public Armor(Player player, Vector2 position) : base(player, position, MobileType.Armor)
        {
            Movement.CollisionOffset     = 25;
            Movement.MaximumStepsPerTurn = 90;

            CollisionBox = new CollisionBox(this, new Rectangle(0, 0, 30, 40), new Vector2(0, 10));

            smokeParticleEmitter = new ParticleEmitter(() => { SpecialEffectBuilder.RandomLowHealthSmokeParticle(CollisionBox.Center); }, 0);
        }
Пример #8
0
        public override void Explode()
        {
            base.Explode();
            PlayExplosionSFX();
            SpecialEffectBuilder.TeleportFlame1(previousPosition);
            SpecialEffectBuilder.TeleportFlame2(Mobile.Position);

            Mobile.ForceChangePosition(previousPosition.ToIntegerDomain());
        }
Пример #9
0
        protected override void UpdatePosition()
        {
            for (float i = 0; i < Parameter.ProjectileMovementTotalTimeElapsed; i += Parameter.ProjectileMovementTimeElapsedPerInteraction)
            {
                if (IsExternallyRefreshingPosition)
                {
                    offsetFactor = MathHelper.Max(offsetFactor - 2 * Parameter.ProjectileMovementTimeElapsedPerInteraction, 0);
                }
                else
                {
                    offsetFactor = MathHelper.Min(offsetFactor + 2 * Parameter.ProjectileMovementTimeElapsedPerInteraction, 1);
                }

                base.UpdateMovementIteraction(Parameter.ProjectileMovementTimeElapsedPerInteraction);

                rotationAngle -= 2 * Parameter.ProjectileMovementTimeElapsedPerInteraction * MathHelper.Pi;

                projectile.FlipbookList[0].Position = Position + offsetFactor * Vector2.Transform(offset * (float)Math.Sin(rotationAngle), Matrix.CreateRotationZ(FlipbookList[0].Rotation + MathHelper.PiOver2));

                if (projectile.CheckOutOfBounds(projectile.FlipbookList[0].Position) || projectile.UpdateCollider(projectile.FlipbookList[0].Position))
                {
                    Destroy();
                    break;
                }

                if (Helper.SquaredEuclideanDistance(lastSESpawnPosition, projectile.Position) > 500)
                {
                    specialEffectList.Add(SpecialEffectBuilder.RaonLauncherProjectile1(projectile.Position, projectile.CurrentFlipbookRotation));
                    lastSESpawnPosition = projectile.Position;
                }
            }

            //Animation
            float transparency = 1;

            for (int i = specialEffectList.Count - 1; i >= 0; i--)
            {
                specialEffectList[i].Flipbook.SetCurrentFrame(projectile.FlipbookList[0].GetCurrentFrame());
                //I am using color mult because of weakness
                specialEffectList[i].Flipbook.Color = projectile.FlipbookList[0].Color * (transparency -= 0.05f);

                if (specialEffectList[i].Flipbook.Color == Color.Transparent)
                {
                    toBeRemovedSpecialEffectList.Add(specialEffectList[i]);
                }
            }

            toBeRemovedSpecialEffectList.ForEach((x) => specialEffectList.Remove(x));
        }
Пример #10
0
        public override void Explode()
        {
            base.Explode();

            SpecialEffectBuilder.MageProjectile3Explosion(FlipbookList[0].Position, FlipbookList[0].Rotation);

            foreach (Mobile m in LevelScene.MobileList)
            {
                double distance = m.CollisionBox.GetDistance(FlipbookList[0].Position, ExplosionRadius);

                if (distance < Parameter.ProjectileMageSSEExplosionRadius)
                {
                    m.DepleteShield();
                }
            }
        }
Пример #11
0
        protected override void UpdatePosition()
        {
            //Interpolate Movement for collision
            for (float elapsedTime = 0; elapsedTime < Parameter.ProjectileMovementTotalTimeElapsed; elapsedTime += Parameter.ProjectileMovementTimeElapsedPerInteraction)
            {
                if (!hasExploded)
                {
                    UpdateMovementIteraction(Parameter.ProjectileMovementTimeElapsedPerInteraction);
                }

                if (CheckOutOfBounds(Position))
                {
                    break;
                }

                if (hasExploded || UpdateCollider(Position))
                {
                    if (!hasExploded)
                    {
                        hasExploded    = true;
                        baseCoordinate = Position;
                        baseRotation   = FlipbookList[0].Rotation;
                        SpecialEffectBuilder.TricoProjectile3Explosion(FlipbookList[0].Position);
                        FlipbookList[0].SetTransparency(0);
                    }

                    if ((explosionTimer += Parameter.ProjectileMovementTimeElapsedPerInteraction) > Parameter.ProjectileTricoSSExtraBlastTime)
                    {
                        explosionTimer = 0;

                        FlipbookList[0].Position = baseCoordinate +
                                                   Vector2.Transform(
                            Parameter.ProjectileTricoSSExplosionOffset,
                            Matrix.CreateRotationZ(
                                baseRotation + explosions * (explosions % 2 == 0 ? 1 : -1) * Parameter.ProjectileTricoSSRotationOffset * rotationExplosionOffset));

                        explosions++;
                        Explode();
                    }
                }
            }

#if Debug
            debugCrosshair.Update(FlipbookList[0].Position);
#endif
        }
Пример #12
0
 public virtual void UpdateProjectiles(GameTime gameTime)
 {
     //Foreach existing projectile that has interacted with the force
     for (int i = 0; i < forceInteraction.Count; i++)
     {
         //Spawn a new force particle special effect if its timer reaches zero
         if (forceInteraction[i].ParticleTimer <= 0)
         {
             forceInteraction[i].ParticleTimer = (Parameter.WeatherEffectForceSpawnParticleStartingTime + (float)Parameter.Random.NextDouble()) / 32f;
             SpecialEffectBuilder.ForceRandomParticle(forceInteraction[i].Projectile.Position + new Vector2(30 * (0.5f - (float)Parameter.Random.NextDouble()), 30 * (0.5f - (float)Parameter.Random.NextDouble())));
         }
         else
         {
             forceInteraction[i].ParticleTimer -= (float)gameTime.ElapsedGameTime.TotalSeconds;
         }
     }
 }
Пример #13
0
        public override void OnInteract(Projectile projectile)
        {
            //Checks if the projectile is already under influence of this weather
            if (CheckWeatherInfluence(projectile))
            {
                return;
            }

            //Passes this instance to any projectile's dependent projectile
            projectile.OnBeginElectricityInteraction(this);

            //If the project can't collide, it should not be taken into consideration for spawning/explosion effects
            if (!projectile.CanCollide)
            {
                return;
            }

            //Once added to the list, the projectile starts spawning electrical particles around it's flipbook
            SpecialEffect se = SpecialEffectBuilder.ElectricityParticle(projectile.Position);

            projectile.OnAfterUpdateAction += () =>
            {
                se.Flipbook.Position = projectile.Position;
                se.Flipbook.Rotation = projectile.CurrentFlipbookRotation;
            };

            //Install itself on the projectile explosion event forcing every exploding projectile to be removed from the spawning list
            Action removeParticle = () => SpecialEffectHandler.Remove(se);

            projectile.OnExplodeAction        += removeParticle;
            projectile.OnBeingDestroyedAction += removeParticle;

            projectile.OnExplodeAction += () =>
            {
                LightningBaseProjectile ep = new LightningBaseProjectile(projectile.Mobile, projectile.Position,
                                                                         MathHelper.PiOver2,
                                                                         Parameter.WeatherEffectElectricityExplosionRadius,
                                                                         Parameter.WeatherEffectElectricityEExplosionRadius,
                                                                         Parameter.WeatherEffectElectricityBaseDamage,
                                                                         Parameter.WeatherEffectElectricityEBaseDamage);

                ep.Update();

                AudioHandler.PlaySoundEffect("Audio/SFX/Tank/Blast/LightningS1");
            };
        }
Пример #14
0
        protected override void UpdatePosition()
        {
            base.UpdatePosition();

            Vector2 dist = (previousSESpawnPosition - FlipbookList[0].Position);

            currentDistance += Math.Abs(dist.X) + Math.Abs(dist.Y);

            if (currentDistance > Parameter.ProjectileParticleNewEmissionMaxDistance)
            {
                previousSESpawnPosition = FlipbookList[0].Position;
                currentDistance         = 0;

                SpecialEffect se = SpecialEffectBuilder.DragonProjectile1Explosion(FlipbookList[0].Position, (float)Parameter.Random.NextDouble() * MathHelper.TwoPi, FlipbookList[0].LayerDepth);
                se.Flipbook.Scale = Vector2.One / 3;
                se.Flipbook.Color = FlipbookList[0].Color;
                se.Flipbook.CurrentAnimationInstance.TimePerFrame = 1 / 60f;
            }
        }
Пример #15
0
        /// <summary>
        /// Checks if a tornado is colliding with the mine
        /// </summary>
        public void UpdateTornadoCollider()
        {
            foreach (Weather w in LevelScene.WeatherHandler.WeatherList)
            {
                if (w is Tornado && w.Intersects(this))
                {
                    if (Target == null)
                    {
                        SpecialEffectBuilder.RaonLauncherProjectile2DormantTornado(Position);
                    }
                    else
                    {
                        SpecialEffectBuilder.RaonLauncherProjectile2ActiveTornado(Position);
                    }

                    Die();
                }
            }
        }
Пример #16
0
        protected override void Destroy()
        {
            base.Destroy();

            //Destroy the trace
            SpecialEffectHandler.Remove(swordTrace);

            //If this shot is the last one the satellite should reappear
            if (Mobile.ProjectileList.Except(Mobile.UnusedProjectile).Count() == 0)
            {
                OnFinalizeExecutionAction?.Invoke();

                //Show element
                if (baseShotType != ShotType.SS)
                {
                    SpecialEffectBuilder.TeleportFlame2(((Knight)Mobile).Satellite.Flipbook.Position, 0.5f);
                }

                ((Knight)Mobile).Satellite.Flipbook.ShowElement();
            }
        }
Пример #17
0
        public override void Explode()
        {
            SpecialEffectBuilder.LightningProjectile3Explosion(FlipbookList[0].Position, FlipbookList[0].Rotation);
            base.Explode();

            foreach (Mobile m in LevelScene.MobileList)
            {
                double distance = m.CollisionBox.GetDistance(FlipbookList[0].Position, ExplosionRadius);

                if (distance < Parameter.ProjectileLightningSSEExplosionRadius)
                {
                    LightningBaseProjectile electricityProjectile =
                        new LightningBaseProjectile(Mobile, m.Position,
                                                    Parameter.ProjectileLightningSSElectricityAngle,
                                                    Parameter.ProjectileLightningSSElectricityExplosionRadius,
                                                    Parameter.ProjectileLightningSSElectricityEExplosionRadius,
                                                    Parameter.ProjectileLightningSSElectricityBaseDamage,
                                                    Parameter.ProjectileLightningSSElectricityEBaseDamage);
                    electricityProjectile.Update();
                }
            }
        }
Пример #18
0
 public override void Explode()
 {
     CheckCollisionWithWeather();
     base.Explode();
     SpecialEffectBuilder.RaonLauncherProjectile3Explosion(Position);
 }
Пример #19
0
 public override void Explode()
 {
     base.Explode();
     SpecialEffectBuilder.DragonProjectile1Explosion(FlipbookList[0].Position, FlipbookList[0].Rotation);
 }
Пример #20
0
 protected override void OnDealDamage(Mobile mobile, int damage)
 {
     base.OnDealDamage(mobile, damage);
     SpecialEffectBuilder.BlueSphereHitEffect(Position);
 }
Пример #21
0
 public override void Explode()
 {
     base.Explode();
     SpecialEffectBuilder.MageProjectile2Explosion(trace.Position, 0);
 }
Пример #22
0
 public override void Explode()
 {
     SpecialEffectBuilder.IceProjectile2Explosion(FlipbookList[0].Position, FlipbookList[0].Rotation);
     base.Explode();
 }
Пример #23
0
 public override void Explode()
 {
     base.Explode();
     SpecialEffectBuilder.IceProjectile1Explosion(FlipbookList[0].Position, (float)Parameter.Random.NextDouble() * MathHelper.TwoPi);
 }
Пример #24
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (InputHandler.IsBeingPressed(Keys.F1))
            {
                //CurrentTurnOwner.LoseTurn();
                MobileList[0].GrantTurn();
                MobileList[0].LayerDepth = 0.6f;
                MobileList.ForEach((x) => x.Movement.RemainingStepsThisTurn = 100000);
            }

            if (InputHandler.IsBeingPressed(Keys.F4))
            {
                MatchMetadata.WindForce        = r.Next(0, 35);
                MatchMetadata.WindAngleDegrees = r.Next(0, 360);
                HUD.WindCompass.ChangeWind(MatchMetadata.WindAngleDegrees, MatchMetadata.WindForce);
            }

            if (InputHandler.IsBeingPressed(Keys.F5))
            {
                WeatherHandler.Add(WeatherType.Mirror, new Vector2(-500, -Topography.MapHeight / 2));
                WeatherHandler.Add(WeatherType.Mirror, new Vector2(-300, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F6))
            {
                WeatherHandler.Add(WeatherType.Weakness, new Vector2(-400, -Topography.MapHeight / 2));
                WeatherHandler.Add(WeatherType.Weakness, new Vector2(0, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F7))
            {
                WeatherHandler.Add(WeatherType.Force, new Vector2(-300, -Topography.MapHeight / 2));
                WeatherHandler.Add(WeatherType.Force, new Vector2(0, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F8))
            {
                WeatherHandler.Add(WeatherType.Tornado, new Vector2(400, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F9))
            {
                WeatherHandler.Add(WeatherType.Electricity, new Vector2(-100, -Topography.MapHeight / 2));
                WeatherHandler.Add(WeatherType.Electricity, new Vector2(0, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F10))
            {
                WeatherHandler.Add(WeatherType.Random, WeatherType.Weakness, new Vector2(0, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F11))
            {
                Color green  = new Color(57, 255, 20, 255 / 4);
                Color blue   = new Color(27, 3, 163, 255 / 4);
                Color red    = new Color(255, 7, 58, 255 / 4);
                Color white  = new Color(255, 255, 255, 255 / 4);
                Color yellow = new Color(204, 255, 0, 255 / 4);

                Vector2 position = Vector2.Zero;

                for (int i = 0; i < 10; i++)
                {
                    SpecialEffectBuilder.ThorShot(position, Color.Lerp(green, blue, i / 9f), 6, 0);
                    position += Vector2.UnitX * 15;
                }

                for (int i = 0; i < 10; i++)
                {
                    SpecialEffectBuilder.ThorShot(position, Color.Lerp(blue, yellow, i / 9f), 6, 0);
                    position += Vector2.UnitX * 15;
                }

                for (int i = 0; i < 10; i++)
                {
                    SpecialEffectBuilder.ThorShot(position, Color.Lerp(yellow, red, i / 9f), 6, 0);
                    position += Vector2.UnitX * 15;
                }

                for (int i = 0; i < 10; i++)
                {
                    SpecialEffectBuilder.ThorShot(position, Color.Lerp(red, white, i / 9f), 6, 0);
                    position += Vector2.UnitX * 15;
                }
            }

            if (InputHandler.IsBeingPressed(Keys.F12))
            {
                MineList[0].GrantTurn();
            }

            if (InputHandler.IsBeingPressed(Keys.F2))
            {
                WeatherHandler.Add(WeatherType.Thor, WeatherType.Weakness, new Vector2(0, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F3))
            {
                SpecialEffectBuilder.RaonLauncherProjectile2ActiveTornado(MobileList[0].Position);
            }

            if (InputHandler.IsBeingPressed(Keys.D1))
            {
                SpecialEffectBuilder.RaonLauncherProjectile2DormantTornado(MobileList[0].Position);
            }

            if (InputHandler.IsBeingPressed(Keys.D2))
            {
                MobileList[3].Die();
            }

            if (InputHandler.IsBeingPressed(Keys.D3))
            {
                MobileList[0].ChangeFlipbookState(ActorFlipbookState.BeingDamaged2, true);
            }


            if (InputHandler.IsBeingPressed(Keys.D4))
            {
                new PopupSelectItem()
                {
                    ShouldRender = true
                };
            }

            if (InputHandler.IsBeingPressed(Keys.D5))
            {
                HUD.OnReceiveMessageAsyncCallback(new PlayerMessage()
                {
                    Player     = MobileList[0].Owner,
                    PlayerTeam = PlayerTeam.Red,
                    Text       = "Abiruindjo abirual"
                }, 0);

                HUD.OnReceiveMessageAsyncCallback(new CustomMessage()
                {
                    FontTextType    = FontTextType.Consolas10,
                    TextBorderColor = Color.Red.PackedValue,
                    TextColor       = Color.Blue.PackedValue,
                    Text            = "Abiruindjo abirual"
                }, 1);
            }

            if (InputHandler.IsBeingPressed(Keys.D6))
            {
                PopupHandler.Add(new PopupSelectItem()
                {
                    ShouldRender = true
                });
            }

            if (InputHandler.IsBeingPressed(Keys.D7))
            {
                SceneHandler.Instance.RequestSceneChange(SceneType.DebugScene, TransitionEffectType.RotatingRectangles);
            }

            if (InputHandler.IsBeingPressed(Keys.D8))
            {
                //SpecialEffectBuilder.HitEffect(new Vector2(100, 100), 4, MathHelper.TwoPi * (float)Parameter.Random.NextDouble());
                for (int i = 0; i < 8; i++)
                {
                    MobileList[0].Owner.Attribute[i] = 1;
                }
            }

            if (InputHandler.IsBeingPressed(Keys.D9))
            {
                //MobileList[0].ReceiveDamage(10);
                for (int i = 0; i < 8; i++)
                {
                    if (Parameter.Random.NextDouble() < 0.1)
                    {
                        MobileList[0].Owner.Attribute[i] =
                            Math.Sign(MobileList[0].Owner.Attribute[i]) *
                            (Math.Abs(MobileList[0].Owner.Attribute[i]) + 1) * -1;
                    }
                }

                //HUD.StatusBarDictionary.ForEach((x) => x.UpdateAttributeList());
            }

            if (InputHandler.IsBeingReleased(Keys.D0))
            {
                //tb = new TextBalloon(MobileList[0], "123123123 123123123 1231231234814812749817498174 71829741984712984721941928471924721984");
            }

            tb?.Update(gameTime);
        }
Пример #25
0
 public override void Explode()
 {
     base.Explode();
     SpecialEffectBuilder.ArmorProjectile1Explosion(FlipbookList[0].Position);
 }
Пример #26
0
 public override void Explode()
 {
     base.Explode();
     SpecialEffectBuilder.TurtleProjectile2Explosion(trace.Position, FlipbookList[0].Rotation);
 }
Пример #27
0
        public void UseItem(ItemType itemType)
        {
            switch (itemType)
            {
            case ItemType.Dual:
                ItemsUnderEffectList.Add(ItemType.Dual);
                OnGrantTurn += () => { ItemsUnderEffectList.Clear(); };
                break;

            case ItemType.DualPlus:
                ItemsUnderEffectList.Add(ItemType.DualPlus);
                OnGrantTurn += () => { ItemsUnderEffectList.Clear(); };
                break;

            case ItemType.Thunder:
                ItemsUnderEffectList.Add(ItemType.Thunder);
                OnGrantTurn += () => { ItemsUnderEffectList.Clear(); };
                break;

            case ItemType.Teleport:
                ItemsUnderEffectList.Add(ItemType.Teleport);
                OnGrantTurn += () => { ItemsUnderEffectList.Clear(); };
                break;

            case ItemType.EnergyUp1:
                Heal(NetworkObjectParameters.InGameItemEnergyUp1Value, NetworkObjectParameters.InGameItemEnergyUp1ExtraValue);
                break;

            case ItemType.EnergyUp2:
                Heal(NetworkObjectParameters.InGameItemEnergyUp2Value, NetworkObjectParameters.InGameItemEnergyUp2ExtraValue);
                break;

            case ItemType.BungeShot:
                Owner.Dig += (int)NetworkObjectParameters.InGameItemBungeShotValue;
                OnEndTurn += () => {
                    Owner.Dig -= (int)NetworkObjectParameters.InGameItemBungeShotValue;
                };
                break;

            case ItemType.PowerUp:
                Owner.Attack += (int)NetworkObjectParameters.InGameItemPowerUpValue;
                OnEndTurn    += () => {
                    Owner.Attack -= (int)NetworkObjectParameters.InGameItemPowerUpValue;
                };
                break;

            case ItemType.Blood:
                Owner.Attack += (int)NetworkObjectParameters.InGameItemBloodValue;
                OnEndTurn    += () => {
                    Owner.Attack -= (int)NetworkObjectParameters.InGameItemBloodValue;
                };
                MobileMetadata.CurrentHealth = (int)Math.Max(1, MobileMetadata.CurrentHealth - MobileMetadata.BaseHealth * NetworkObjectParameters.InGameItemBloodExtraValue / 100f);
                UpdateParticleEmitterInterval();
                break;

            case ItemType.ChangeWind:
                LevelScene.MatchMetadata.WindAngleDegrees += 180;
                LevelScene.HUD.WindCompass.ChangeWind(LevelScene.MatchMetadata.WindAngleDegrees, LevelScene.MatchMetadata.WindForce);
                break;

            case ItemType.TeamTeleport:
                Mobile tpMobile = LevelScene.MobileList
                                  .Where((x) => x != this && x.IsAlive && x.Owner.PlayerTeam == Owner.PlayerTeam)
                                  .OrderBy((x) => x.MobileMetadata.CurrentHealth).FirstOrDefault();

                if (tpMobile == null)
                {
                    SpecialEffectBuilder.TeleportFlame1(Position);
                    SpecialEffectBuilder.TeleportFlame2(Position);
                    AudioHandler.PlaySoundEffect("Audio/SFX/Tank/Blast/Teleport", pitch: 0.5f);
                    return;
                }

                Vector2 tmpPos = tpMobile.Position;

                //Other mobile
                SpecialEffectBuilder.TeleportFlame1(Position);
                SpecialEffectBuilder.TeleportFlame2(tpMobile.Position);

                tpMobile.ForceChangePosition(Position);
                ForceChangePosition(tmpPos);

                AudioHandler.PlaySoundEffect("Audio/SFX/Tank/Blast/Teleport", pitch: 0.5f);
                break;
            }

            //Refresh Status (if necessary)
            LevelScene.HUD.StatusBarDictionary[this].UpdateAttributeList();

            ChangeFlipbookState(ActorFlipbookState.UsingItem, true);

            if (IsHealthCritical)
            {
                MobileFlipbook.EnqueueAnimation(ActorFlipbookState.StandLowHealth);
            }
            else
            {
                MobileFlipbook.EnqueueAnimation(ActorFlipbookState.Stand);
            }
        }
Пример #28
0
 public override void Explode()
 {
     SpecialEffectBuilder.BigfootProjectile3Explosion(FlipbookList[0].Position);
     base.Explode();
 }