private void ModifyHit(Player player, ref int damage, ref float knockBack, ref bool crit)
        {
            ModPlayerFists mpf = player.GetModPlayer <ModPlayerFists>();

            // Just periodically release more bees
            if (mpf.ComboCounter % 2 == 0)
            {
                float speedX = (float)Main.rand.Next(-35, 36) * 0.02f;
                float speedY = (float)Main.rand.Next(-35, 36) * 0.02f;
                Projectile.NewProjectile(player.position.X, player.position.Y, speedX, speedY, player.beeType(), player.beeDamage(7), player.beeKB(0f), Main.myPlayer, 0f, 0f);
            }

            // Parry for bees
            if (mpf.parryBuff)
            {
                if (mpf.GetParryBuff() >= 0)
                {
                    mpf.ClearParryBuff();
                }
                damage += 60;

                // THE BEES NOT THE BEES
                int numberOfBees = 2;
                if (mpf.ComboCounter >= mpf.ComboCounterMaxReal * 2)
                {
                    numberOfBees++;
                }
                if (mpf.ComboCounter >= mpf.ComboCounterMaxReal * 3)
                {
                    numberOfBees++;
                }
                if (mpf.ComboCounter >= mpf.ComboCounterMaxReal * 4)
                {
                    numberOfBees++;
                }
                if (player.strongBees && mpf.ComboCounter >= mpf.ComboCounterMaxReal * 5)
                {
                    numberOfBees++;
                }
                if (Main.rand.Next(3) == 0)
                {
                    numberOfBees++;
                }
                if (Main.rand.Next(3) == 0)
                {
                    numberOfBees++;
                }
                if (player.strongBees && Main.rand.Next(3) == 0)
                {
                    numberOfBees++;
                }
                for (int i = 0; i < numberOfBees; i++)
                {
                    float speedX = (float)Main.rand.Next(-35, 36) * 0.02f;
                    float speedY = (float)Main.rand.Next(-35, 36) * 0.02f;
                    Projectile.NewProjectile(player.position.X, player.position.Y, speedX, speedY, player.beeType(), player.beeDamage(7), player.beeKB(0f), Main.myPlayer, 0f, 0f);
                }
            }
        }
예제 #2
0
        private void ModifyHit(Player player, ref int damage, ref float knockBack, ref bool crit)
        {
            ModPlayerFists mpf = player.GetModPlayer <ModPlayerFists>();

            if (mpf.parryBuff)
            {
                if (mpf.GetParryBuff() >= 0)
                {
                    mpf.ClearParryBuff();
                }
                PlayerFX.LifeStealPlayer(player, 5, 5, 1f);
            }
        }
예제 #3
0
        private void ModifyHit(Player player, ref int damage, ref float knockBack, ref bool crit)
        {
            ModPlayerFists mpf = player.GetModPlayer <ModPlayerFists>();

            if (AltStats(player))
            {
                if (mpf.GetParryBuff() >= 0)
                {
                    mpf.ClearParryBuff();
                }
                damage += 150;
            }
        }
예제 #4
0
        // Parry
        public override void HoldItem(Player player)
        {
            ModPlayerFists mpf = player.GetModPlayer <ModPlayerFists>();

            if (mpf.parryBuff)
            {
                if (mpf.GetParryBuff() >= 0)
                {
                    mpf.ClearParryBuff();
                }
                player.immuneTime += 60;
            }
        }
예제 #5
0
        // Parry & Combo
        public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
        {
            ModPlayerFists mpf = player.GetModPlayer <ModPlayerFists>();

            if (AltStats(player))
            {
                if (mpf.GetParryBuff() >= 0)
                {
                    mpf.ClearParryBuff();
                }

                foreach (NPC npc in Main.npc)
                {
                    if (!npc.active || npc.friendly || npc.dontTakeDamage || npc.whoAmI == target.whoAmI)
                    {
                        continue;
                    }
                    if (npc.Distance(player.Center) < 256)
                    {
                        if (player.CanHit(npc))
                        {
                            Projectile.NewProjectile(npc.Center, new Vector2(-player.direction),
                                                     mod.ProjectileType <Projectiles.SpiritBeam>(), (int)(damage * 0.33f), 0f, player.whoAmI);
                        }
                    }
                }
            }
            if (mpf.IsComboActiveItemOnHit)
            {
                float distance   = 128;
                NPC   nextTarget = null;
                foreach (NPC npc in Main.npc)
                {
                    if (!npc.active || npc.friendly || npc.dontTakeDamage || npc.whoAmI == target.whoAmI)
                    {
                        continue;
                    }
                    float ndist = npc.Distance(player.Center);
                    if (ndist < distance)
                    {
                        nextTarget = npc;
                        distance   = ndist;
                    }
                }
                if (nextTarget != null)
                {
                    Projectile.NewProjectile(nextTarget.Center, new Vector2(-player.direction),
                                             mod.ProjectileType <Projectiles.SpiritBeam>(), damage, knockBack, player.whoAmI);
                }
            }
        }
예제 #6
0
        private void ModifyHit(Player player, ref int damage, ref float knockBack, ref bool crit)
        {
            ModPlayerFists mpf = player.GetModPlayer <ModPlayerFists>();

            if (AltStats(player))
            {
                if (mpf.GetParryBuff() >= 0)
                {
                    mpf.ClearParryBuff();
                }
                float bonus = 0.5f - 0.5f * ((float)player.statLife / player.statLifeMax2);
                damage = (int)((damage + player.HeldItem.damage * 10 * bonus) * bonus);
            }
        }
예제 #7
0
        private void ModifyHit(Player player, ref int damage, ref float knockBack, ref bool crit, int EnemyPower)
        {
            ModPlayerFists mpf = player.GetModPlayer <ModPlayerFists>();

            if (mpf.parryBuff)
            {
                if (mpf.GetParryBuff() >= 0)
                {
                    mpf.ClearParryBuff();
                }

                damage += 120 + EnemyPower * 2;
            }
        }
예제 #8
0
        private void ModifyHit(Player player, ref int damage, ref float knockBack, ref bool crit)
        {
            ModPlayerFists mpf = player.GetModPlayer <ModPlayerFists>();

            if (AltStats(player))
            {
                if (mpf.GetParryBuff() >= 0)
                {
                    mpf.ClearParryBuff();
                }
                // Increase by item damage, not buffed total damage
                damage += (int)(player.HeldItem.damage * 4f);
            }
        }
예제 #9
0
        private void ModifyHit(Player player, ref int damage, ref float knockBack, ref bool crit)
        {
            ModPlayerFists mpf = player.GetModPlayer <ModPlayerFists>();

            if (mpf.parryBuff)
            {
                if (mpf.GetParryBuff() >= 0)
                {
                    mpf.ClearParryBuff();
                }
                knockBack += 2f;
                player.armorPenetration += 20;
            }
        }
예제 #10
0
        private void ModifyHit(Player player, ref int damage, ref float knockBack, ref bool crit)
        {
            ModPlayerFists mpf = player.GetModPlayer <ModPlayerFists>();

            if (mpf.IsComboActiveItemOnHit)
            {
                damage += 2;
            }
            if (mpf.parryBuff)
            {
                if (mpf.GetParryBuff() >= 0)
                {
                    mpf.ClearParryBuff();
                }
                damage += 15;
            }
        }
예제 #11
0
        public override void OnHitPvp(Player player, Player target, int damage, bool crit)
        {
            ModPlayerFists mpf = player.GetModPlayer <ModPlayerFists>();

            if (AltStats(player)) // If counterstrike is available
            {
                if (mpf.GetParryBuff() >= 0)
                {
                    mpf.ClearParryBuff();                          // Consume counterstrike buff
                }
                // =================== BEHAVIOURS =================== //

                player.AddBuff(BuffID.OnFire, 600, false);

                // ^^^^^^^^^^^^^^^^^^^ BEHAVIOURS ^^^^^^^^^^^^^^^^^^^ //
            }
        }
예제 #12
0
        private void OnHit(Player player, Entity target, int damage, float knockBack, bool crit, bool detonate)
        {
            ModPlayerFists mpf        = player.GetModPlayer <ModPlayerFists>();
            int            parryIndex = mpf.GetParryBuff();

            if (detonate)
            {
                if (parryIndex >= 0)
                {
                    mpf.ClearParryBuff();
                }
                int dmg = 400;
                if (mpf.IsComboActiveItemOnHit)
                {
                    // Combo detonate causes delayed triple explosion
                    // This means if you can keep the target still enough you can mark the target
                    // BEFORE the last explosion triggers on it.
                    // For massive damage!!! chain reactions ftw
                    for (int i = 1; i < 3; i++)
                    {
                        Vector2 pos = new Vector2(
                            64 * Main.rand.NextFloatDirection(),
                            64 * Main.rand.NextFloatDirection()
                            );
                        Projectile.NewProjectile(target.Center + pos, new Vector2(), projID, dmg, 12f, player.whoAmI, -15f * i);
                    }
                }
                Projectile.NewProjectile(target.Center, new Vector2(), projID, dmg, 12f, player.whoAmI, 0f);
            }
            else
            {
                //quickly degrade parry buff
                if (parryIndex >= 0)
                {
                    player.buffTime[parryIndex] -= 120;
                    if (player.buffTime[parryIndex] < 1)
                    {
                        player.buffTime[parryIndex] = 1;
                    }
                }
            }
        }
예제 #13
0
        private void OnHit(Player player, Entity target, int damage, float knockBack, bool crit)
        {
            ModPlayerFists mpf = player.GetModPlayer <ModPlayerFists>();

            if (AltStats(player))
            {
                if (mpf.GetParryBuff() >= 0)
                {
                    mpf.ClearParryBuff();
                }
                for (int i = 0; i < 4; i++)
                {
                    float arg_1B2_0 = player.position.X + (float)(player.width / 2);
                    int   direction = player.direction;
                    float num       = Main.screenPosition.X;
                    if (direction < 0)
                    {
                        num += (float)Main.screenWidth;
                    }
                    float num2 = Main.screenPosition.Y;
                    num2 += (float)Main.rand.Next(Main.screenHeight);
                    Vector2 vector2 = new Vector2(num, num2);
                    float   num3    = target.position.X - vector2.X;
                    float   num4    = target.position.Y - vector2.Y;
                    num3 += (float)Main.rand.Next(-50, 51) * 0.1f;
                    num4 += (float)Main.rand.Next(-50, 51) * 0.1f;
                    int   num5 = 24;
                    float num6 = (float)Math.Sqrt((double)(num3 * num3 + num4 * num4));
                    num6  = (float)num5 / num6;
                    num6 *= 0.4f + 0.15f * i; // Reduce speed
                    num3 *= num6;
                    num4 *= num6;
                    Projectile.NewProjectile(num, num2, num3, num4, 221, 36, 0f, player.whoAmI, 0f, 0f);
                }
            }
        }