Exemplo n.º 1
0
        public override void Update(GameTime gameTime, Player attackPlayer, NPC attackNPC)
        {
            for (int i = 0; i < 3; i++)
            {
                FireParticle particle = new FireParticle()
                {
                    Position        = CardGameUI.ToUIPos(Position) + new Vector2(0f, -10f),
                    Velocity        = Vector2.Zero,
                    UIPosition      = UIPosition,
                    Alpha           = 100,
                    IsPanelParticle = true
                };
                particle.Setup(Size, 1f, attackPlayer);
                particle.Velocity *= 0.85f;
                attackPlayer.GetModPlayer <EntrogicPlayer>()._particles.Add(particle);
            }
            Velocity.Y -= 0.1f;

            if (Vector2.Distance(CardGameUI.ToUIPos(Position + Size / 2f), TargetPosition + new Vector2(0, 12f)) < 10f)
            {
                IsRemoved = true;
                CardFightableNPC fightNPC = (CardFightableNPC)attackNPC.modNPC;
                fightNPC.CardGameHealth -= 46;
            }

            base.Update(gameTime, attackPlayer, attackNPC);
        }
Exemplo n.º 2
0
        public override void Kill(Player attackPlayer)
        {
            Vector2 screenCenter = new Vector2(Main.screenWidth, Main.screenHeight) / 2f + Main.screenPosition;

            Main.PlaySound(SoundID.Item10, (int)screenCenter.X, (int)screenCenter.Y + -30);
            Size.X     = 20;
            Size.Y     = 20;
            Position.X = CardGameUI.ToUIPos(Center).X - Size.X / 2f;
            Position.Y = CardGameUI.ToUIPos(Center).Y - Size.Y / 2f;
            for (int i = 0; i < 23; i++)
            {
                FireParticle particle = new FireParticle()
                {
                    Position        = Position,
                    UIPosition      = UIPosition,
                    Alpha           = 100,
                    IsPanelParticle = true
                };
                particle.Setup(Size, 1f, attackPlayer);
                if (Main.rand.Next(2) == 0)
                {
                    particle.Scale = 0.5f;
                }
                particle.Velocity *= 2f;
                attackPlayer.GetModPlayer <EntrogicPlayer>()._particles.Add(particle);
            }
            for (int j = 0; j < 20; j++)
            {
                FireParticle2 particle = new FireParticle2()
                {
                    Position        = Position,
                    UIPosition      = UIPosition,
                    Alpha           = 100,
                    IsPanelParticle = true
                };
                particle.Setup(Size, 1f, attackPlayer);
                particle.Velocity *= 2f;
                attackPlayer.GetModPlayer <EntrogicPlayer>()._particles.Add(particle);
            }
            for (int k = 0; k < Main.rand.Next(5, 7); k++)
            {
                float scaleFactor = 0.33f;
                if (k % 3 == 1)
                {
                    scaleFactor = 0.66f;
                }
                if (k % 3 == 1)
                {
                    scaleFactor = 1f;
                }
                StarParticle particle = new StarParticle()
                {
                    Position        = Position,
                    UIPosition      = UIPosition,
                    Alpha           = Main.rand.Next(140, 201),
                    IsPanelParticle = true
                };
                particle.Setup(Size, Main.rand.NextFloat() * 0.5f + 1f, attackPlayer);
                particle.Velocity *= scaleFactor;
                attackPlayer.GetModPlayer <EntrogicPlayer>()._particles.Add(particle);
            }
            //for (float rad = 0.0f; rad < 2 * 3.141f; rad += (float)Main.rand.Next(8, 14) / 10)
            //{
            //    Vector2 vec = new Vector2(120f, 0f);
            //    Vector2 finalVec = (vec.ToRotation() + rad).ToRotationVector2() * 16f;
            //    Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Main.rand.Next(-10, 11), Main.rand.Next(-10, 11), ProjectileType<PineapplePieces>(), 21, 0f, projectile.owner, 0f, 0f);
            //}
            base.Kill(attackPlayer);
        }
Exemplo n.º 3
0
        public override void Update(GameTime gameTime, Player attackPlayer, NPC attackNPC)
        {
            for (int extraUpdates = 0; extraUpdates < 2; extraUpdates++)
            {
                if (!State2)
                {
                    for (int i = 0; i < 8; i++)
                    {
                        FireParticle particle = new FireParticle()
                        {
                            Position        = CardGameUI.ToUIPos(Position) + new Vector2(0f, -10f),
                            Velocity        = Vector2.Zero,
                            UIPosition      = UIPosition,
                            Alpha           = 100,
                            IsPanelParticle = true
                        };
                        particle.Setup(Size, 1.2f, attackPlayer);
                        particle.Velocity *= 0.5f * 1.1f;
                        attackPlayer.GetModPlayer <EntrogicPlayer>()._particles.Add(particle);
                    }
                    Velocity += new Vector2(0f, -0.8f);
                }
                else
                {
                    if (localAI == 0f)
                    {
                        Vector2 screenCenter = new Vector2(Main.screenWidth, Main.screenHeight) / 2f + Main.screenPosition;
                        Main.PlaySound(SoundID.Item74, (int)screenCenter.X, (int)screenCenter.Y + -30);
                        localAI += 1f;
                    }
                    ai += 1f;
                    ai += 3f;
                    float num466 = 25f;
                    if (ai > 180f)
                    {
                        num466 -= (ai - 180f) / 2f;
                    }
                    num466 *= 0.7f;
                    int num467 = 0;
                    while ((float)num467 < num466)
                    {
                        float num468 = (float)Main.rand.Next(-10, 11);
                        float num469 = (float)Main.rand.Next(-10, 11);
                        float num470 = (float)Main.rand.Next(3, 9);
                        float num471 = (float)Math.Sqrt((double)(num468 * num468 + num469 * num469));
                        num471  = num470 / num471;
                        num468 *= num471;
                        num469 *= num471;

                        FireParticle particle = new FireParticle()
                        {
                            Position        = CardGameUI.ToUIPos(Position) + new Vector2(0f, -10f),
                            Velocity        = Vector2.Zero,
                            UIPosition      = UIPosition,
                            Alpha           = 100,
                            IsPanelParticle = true
                        };
                        particle.Setup(Size, 1.5f, attackPlayer);
                        particle.Position  = CardGameUI.ToUIPos(Position) + Size / 2f;
                        particle.Position += new Vector2(Main.rand.Next(-10, 11), Main.rand.Next(-10, 11));
                        particle.Velocity  = new Vector2(num468, num469) * 0.75f;
                        attackPlayer.GetModPlayer <EntrogicPlayer>()._particles.Add(particle);

                        int num3 = num467;
                        num467 = num3 + 1;
                    }
                    Velocity = Vector2.Zero;
                }

                base.Update(gameTime, attackPlayer, attackNPC);

                if (!State2 && Vector2.Distance(CardGameUI.ToUIPos(Position + Size / 2f), TargetPosition + new Vector2(0, 12f)) < 10f)
                {
                    State2 = true;
                    CardFightableNPC fightNPC = (CardFightableNPC)attackNPC.modNPC;
                    fightNPC.CardGameHealth -= GetDamage(Damage);
                }
            }
        }