public override void UpdateEquip(Player player)
        {
            player.meleeCrit += 5;
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            mpf.comboResetTimeBonus += 60;
        }
示例#2
0
        public override void UpdateEquip(Player player)
        {
            player.moveSpeed += 0.05f;
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            mpf.comboCounterMaxBonus -= 1;
        }
示例#3
0
        public override void UpdateEquip(Player player)
        {
            player.meleeCrit += 5;
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            mpf.longParry = true;
        }
        public override void UpdateArmorSet(Player player)
        {
            ModPlayerFists mpf = ModPlayerFists.Get(player);
            PlayerFX       pfx = player.GetModPlayer <PlayerFX>();

            switch (armourSet)
            {
            case 1:
                player.setBonus              = "Combo attacks deal additional damage based on enemy life";
                pfx.millstone                = true;
                pfx.patienceBuildUpModifier += 0.1f;
                break;

            case 2:
                player.setBonus = "Taking damage grants yin, dealing damage grants yang, \nat the end of a combo yin increases melee damage, \nyang restores a portion of missing life";
                pfx.yinyang     = true;
                break;

            case 3:
                string button = Language.GetTextValue(Main.ReversedUpDownArmorSetBonuses ? "Key.UP" : "Key.DOWN");
                player.setBonus = "Build up momentum and double tap " + button + " to leap towards a location,\n"
                                  + "Increases running speed by 15 mph";
                pfx.buildMomentum   = true;
                pfx.momentumDash    = true;
                player.accRunSpeed += 3f;
                break;
            }
        }
示例#5
0
        public override void UpdateArmorSet(Player player)
        {
            ModPlayerFists mpf = ModPlayerFists.Get(player);
            PlayerFX       pfx = player.GetModPlayer <PlayerFX>();

            switch (armourSet)
            {
            case 1:
                player.setBonus              = WeaponOut.GetTranslationTextValue("FistMasterHeadPower");
                pfx.millstone                = true;
                pfx.patienceBuildUpModifier += 0.1f;
                break;

            case 2:
                player.setBonus = WeaponOut.GetTranslationTextValue("FistMasterHeadDefence");
                pfx.yinyang     = true;
                break;

            case 3:
                string button = Language.GetTextValue(Main.ReversedUpDownArmorSetBonuses ? "Key.UP" : "Key.DOWN");
                player.setBonus     = WeaponOut.GetTranslationTextValue("FistMasterHeadSpeed").Replace("$BUTTON", button);
                pfx.buildMomentum   = true;
                pfx.momentumDash    = true;
                player.accRunSpeed += 3f;
                break;
            }
        }
        public override void UpdateArmorSet(Player player)
        {
            ModPlayerFists mpf = ModPlayerFists.Get(player);
            PlayerFX       pfx = player.GetModPlayer <PlayerFX>();

            switch (armourSet)
            {
            case 1:
                player.setBonus = "Divekicks will steal life";
                player.GetModPlayer <PlayerFX>().diveKickHeal += 0.05f;
                pfx.patienceBuildUpModifier += 0.2f;
                break;

            case 2:
                player.setBonus     = Language.GetTextValue("ArmorSetBonus.Wood").Replace("1", "23") + ", damage taken is reduced by 5%,\ntemporarily reduces damage taken when not attacking";
                player.statDefense += 23;
                player.endurance   += 0.05f;
                pfx.yomiEndurance  += 0.45f;
                break;

            case 3:
                player.setBonus = "Maximum life acts as a second wind, restore maximum life with combos";
                pfx.secondWind  = true;
                break;
            }
        }
示例#7
0
        public override void UpdateArmorSet(Player player)
        {
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            switch (armourSet)
            {
            case 1:
                player.setBonus     = WeaponOut.GetTranslationTextValue("FistBoxingHelmetPower");
                player.statDefense += 3;
                break;

            case 2:
                player.setBonus     = WeaponOut.GetTranslationTextValue("FistBoxingHelmetDefence");
                player.statDefense += 6;
                break;

            case 3:
                player.setBonus     = WeaponOut.GetTranslationTextValue("FistBoxingHelmetSpeed");
                player.statDefense += 4;
                break;

            case 4:
                player.setBonus = WeaponOut.GetTranslationTextValue("FistBoxingHelmetGi");
                mpf.longParry   = true;
                break;
            }
        }
        public override void UpdateArmorSet(Player player)
        {
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            switch (armourSet)
            {
            case 1:
                player.setBonus  = Language.GetTextValue("ItemTooltip.LuckyHorseshoe");
                player.noFallDmg = true;
                break;

            case 2:
                player.setBonus    = Language.GetTextValue("ItemTooltip.CrossNecklace");
                player.longInvince = true;
                break;

            case 3:
                player.setBonus     = "Increases running speed by 10 mph";
                player.accRunSpeed += 2f;
                break;

            case 4:
                player.setBonus     = "50% increased uppercut and divekick damage";
                mpf.uppercutDamage += 0.5f;
                mpf.divekickDamage += 0.5f;
                break;
            }
        }
示例#9
0
        public override void UpdateArmorSet(Player player)
        {
            ModPlayerFists mpf = ModPlayerFists.Get(player);
            PlayerFX       pfx = player.GetModPlayer <PlayerFX>();

            switch (armourSet)
            {
            case 1:
                player.setBonus = WeaponOut.GetTranslationTextValue("ChampionLaurelsPower");
                player.GetModPlayer <PlayerFX>().diveKickHeal += 0.03f;
                pfx.patienceBuildUpModifier += 0.2f;
                break;

            case 2:
                player.setBonus     = WeaponOut.GetTranslationTextValue("ChampionLaurelsDefence");
                player.statDefense += 23;
                player.endurance   += 0.05f;
                pfx.yomiEndurance  += 0.45f;
                break;

            case 3:
                player.setBonus = WeaponOut.GetTranslationTextValue("ChampionLaurelsSpeed");
                pfx.secondWind  = true;
                break;
            }
        }
示例#10
0
        public override void UpdateArmorSet(Player player)
        {
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            switch (armourSet)
            {
            case 1:
                player.setBonus     = Language.GetTextValue("ArmorSetBonus.Wood").Replace("1", "3");
                player.statDefense += 3;
                break;

            case 2:
                player.setBonus     = Language.GetTextValue("ArmorSetBonus.Wood").Replace("1", "6");
                player.statDefense += 6;
                break;

            case 3:
                player.setBonus     = Language.GetTextValue("ArmorSetBonus.Wood").Replace("1", "4");
                player.statDefense += 4;
                break;

            case 4:
                player.setBonus = "Makes fist parries easier";
                mpf.longParry   = true;
                break;
            }
        }
示例#11
0
        public override void UpdateArmorSet(Player player)
        {
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            switch (armourSet)
            {
            case 1:
                player.setBonus  = WeaponOut.GetTranslationTextValue("FistMartialHeadPower");
                player.noFallDmg = true;
                break;

            case 2:
                player.setBonus    = WeaponOut.GetTranslationTextValue("FistMartialHeadDefence");
                player.longInvince = true;
                break;

            case 3:
                player.setBonus     = WeaponOut.GetTranslationTextValue("FistMartialHeadSpeed");
                player.accRunSpeed += 2f;
                break;

            case 4:
                player.setBonus     = WeaponOut.GetTranslationTextValue("FistMartialHeadGi");
                mpf.uppercutDamage += 0.5f;
                mpf.divekickDamage += 0.5f;
                break;
            }
        }
示例#12
0
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            mpf.comboCounterMaxBonus -= 2;
            if (player.controlUp && player.itemAnimation == 0 &&
                mpf.ComboCounter < 10 &&
                (player.HeldItem.melee || player.HeldItem.useStyle == ModPlayerFists.useStyle))
            {
                chargeTick++;
                if (chargeTick > chargeTime)
                {
                    chargeTick = chargeTimeConBonus;
                    mpf.ModifyComboCounter(1);
                    Main.PlaySound(SoundID.Item34.WithVolume(0.5f));
                }

                double  angle = Main.rand.NextFloat() * Math.PI * 2;
                Vector2 velo  = new Vector2((float)(10.0 * Math.Sin(angle)), (float)(10.0 * Math.Cos(angle)));
                Dust    d     = Dust.NewDustPerfect(player.Center, Main.rand.Next(2) == 0 ? 88 : 262, velo);
                d.position -= d.velocity * 5f;
                d.noGravity = true;
                d.scale     = 0.55f;
                d.velocity += player.velocity;
            }
            else
            {
                chargeTick = 0;
            }
        }
示例#13
0
        public override void UpdateEquip(Player player)
        {
            player.meleeCrit += 12;
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            mpf.parryLifesteal       += 0.1f;
            mpf.comboCounterMaxBonus -= 1;
        }
示例#14
0
        public override void UpdateEquip(Player player)
        {
            player.moveSpeed += 0.1f;
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            mpf.divekickDamage       += 0.5f;
            mpf.comboCounterMaxBonus -= 2;
        }
 public override void UpdateAccessory(Player player, bool hideVisual)
 {
     ModPlayerFists.Get(player).comboCounterMaxBonus -= 2;
     if (player.statLife < player.statLifeMax2 / 2)
     {
         ModPlayerFists.Get(player).comboCounterMaxBonus -= 4;
     }
 }
示例#16
0
        public override void UpdateEquip(Player player)
        {
            player.meleeSpeed += 0.05f;
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            mpf.uppercutDamage    += 1f;
            mpf.uppercutKnockback += 1f;
        }
示例#17
0
        public override void UpdateEquip(Player player)
        {
            player.meleeDamage += 0.05f;
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            mpf.divekickDamage    += 1f;
            mpf.divekickKnockback += 1f;
        }
示例#18
0
        public override void UpdateEquip(Player player)
        {
            player.minionDamage += 0.15f;
            player.meleeDamage  += 0.15f;
            player.maxMinions   += 1;
            ModPlayerFists.Get(player).uppercutDamage    += 1f;
            ModPlayerFists.Get(player).uppercutKnockback += 1f;

            Lighting.AddLight(player.Center, new Vector3(0.9f, 0.9f, 0.95f));
        }
示例#19
0
        // Combo duration extender
        public override void UpdateInventory(Player player)
        {
            if (player.HeldItem != item)
            {
                return;
            }

            ModPlayerFists mpf = ModPlayerFists.Get(player);

            mpf.comboResetTimeBonus += 300;
        }
示例#20
0
        public override void UpdateEquip(Player player)
        {
            player.minionDamage += 0.15f;
            player.moveSpeed    += 0.12f;
            player.meleeSpeed   += 0.12f;
            player.maxMinions   += 1;
            ModPlayerFists.Get(player).divekickDamage    += 1f;
            ModPlayerFists.Get(player).divekickKnockback += 1f;

            Lighting.AddLight(player.Center, new Vector3(0.9f, 0.9f, 0.95f));
        }
        public override void UpdateArmorSet(Player player)
        {
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            switch (armourSet)
            {
            case 1:
                if (!hardMode)
                {
                    player.setBonus = "10 defense per 100 missing life";
                    player.GetModPlayer <PlayerFX>().barbariousDefence = 10;
                }
                else
                {
                    player.setBonus = "16 defense per 100 missing life";
                    player.GetModPlayer <PlayerFX>().barbariousDefence = 6;
                }
                break;

            case 2:
                // Not so useful, but very good for not dying in expert (double damage lmao)
                player.setBonus = "Temporarily reduces damage taken when not attacking";
                if (!hardMode)
                {
                    player.GetModPlayer <PlayerFX>().yomiEndurance += 0.3f;
                }
                else
                {
                    player.GetModPlayer <PlayerFX>().yomiEndurance += 0.45f;
                }
                break;

            case 3:
                if (!hardMode)
                {    // Decent armour for protecting against most attacks (11 dmg reduction)
                    player.setBonus     = Language.GetTextValue("ArmorSetBonus.Wood").Replace("1", "15");
                    player.statDefense += 15;
                }
                else
                {    // Hardmode armour gets an extra 10 dmg reduction
                    player.setBonus     = Language.GetTextValue("ArmorSetBonus.Wood").Replace("1", "20");
                    player.statDefense += 20;
                }
                break;

            case 4:
                player.setBonus           = "Makes fist parries easier and reduces combo power cost by 1";
                mpf.longParry             = true;
                mpf.comboCounterMaxBonus -= 1;
                break;
            }
        }
示例#22
0
        public override void UpdateArmorSet(Player player)
        {
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            switch (armourSet)
            {
            case 1:
                if (!hardMode)
                {
                    player.setBonus = WeaponOut.GetTranslationTextValue("FistBoxingHelmetPlusPower");
                    player.GetModPlayer <PlayerFX>().barbariousDefence = 10;
                }
                else
                {
                    player.setBonus = WeaponOut.GetTranslationTextValue("FistBoxingHelmetPlusPowerHardmode");
                    player.GetModPlayer <PlayerFX>().barbariousDefence = 6;
                }
                break;

            case 2:
                // Not so useful, but very good for not dying in expert (double damage lmao)
                player.setBonus = WeaponOut.GetTranslationTextValue("FistBoxingHelmetPlusDefence");
                if (!hardMode)
                {
                    player.GetModPlayer <PlayerFX>().yomiEndurance += 0.3f;
                }
                else
                {
                    player.GetModPlayer <PlayerFX>().yomiEndurance += 0.45f;
                }
                break;

            case 3:
                if (!hardMode)
                {    // Decent armour for protecting against most attacks (11 dmg reduction)
                    player.setBonus     = WeaponOut.GetTranslationTextValue("FistBoxingHelmetPlusSpeed");
                    player.statDefense += 15;
                }
                else
                {    // Hardmode armour gets an extra 10 dmg reduction
                    player.setBonus     = WeaponOut.GetTranslationTextValue("FistBoxingHelmetPlusSpeedHardmode");
                    player.statDefense += 20;
                }
                break;

            case 4:
                player.setBonus           = WeaponOut.GetTranslationTextValue("FistBoxingHelmetPlusGi");
                mpf.longParry             = true;
                mpf.comboCounterMaxBonus -= 1;
                break;
            }
        }
示例#23
0
        private void ModifyHit(Player player, ref int damage, ref float knockBack, ref bool crit, int targetLife, Vector2 targetCentre, Vector2 targetVelocity)
        {
            // Dashing Bonus
            if (DashStats(player)) // If dashing
            {
                // =================== BEHAVIOURS =================== //

                knockBack = 0f; // No knockback

                // ^^^^^^^^^^^^^^^^^^^ BEHAVIOURS ^^^^^^^^^^^^^^^^^^^ //
            }

            // Combo Bonus
            ModPlayerFists mpf = player.GetModPlayer <ModPlayerFists>();

            if (ComboStats(player))
            {
                // =================== BEHAVIOURS =================== //

                int bIdx = player.FindBuffIndex(buffID);
                if (bIdx >= 0)
                {
                    // And back
                    Vector2 velo = player.Center - targetCentre;
                    velo.Normalize();
                    velo *= altDashSpeed;
                    velo += targetVelocity;

                    if (player.buffTime[bIdx] > flurryEndDelay)
                    {
                        damage    = (int)(damage * 0.9f); // flurry attack
                        knockBack = 0f;                   // no knockback
                        ModPlayerFists.Get(player).ModifyComboCounter(0, true);

                        player.velocity = (player.velocity * 2 + velo) / 3;
                    }
                    else
                    {
                        damage    = 1;  // little damage
                        knockBack = 0f; // no knockback
                        ModPlayerFists.Get(player).ModifyComboCounter(1, true);

                        player.velocity = velo;
                    }

                    // And back
                    NetMessage.SendData(MessageID.SyncPlayer, -1, player.whoAmI, null, player.whoAmI);
                }

                // ^^^^^^^^^^^^^^^^^^^ BEHAVIOURS ^^^^^^^^^^^^^^^^^^^ //
            }
        }
        public override void UpdateArmorSet(Player player)
        {
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            switch (armourSet)
            {
            case 1:
                if (!hardMode)
                {
                    player.setBonus = "Increases melee capabilities after being struck";
                }
                else
                {
                    player.setBonus = "Greatly increases melee capabilities after being struck";
                    player.GetModPlayer <PlayerFX>().doubleDamageUp = true;
                }
                player.GetModPlayer <PlayerFX>().taekwonCounter = true;
                break;

            case 2:
                if (!hardMode)
                {
                    player.setBonus = "Greatly increases life regeneration after being struck";
                }
                else
                {
                    player.setBonus    = Language.GetTextValue("ItemTooltip.CrossNecklace") + ", greatly increases life regeneration after being struck";
                    player.longInvince = true;
                }
                player.GetModPlayer <PlayerFX>().rapidRecovery = true;
                break;

            case 3:
                player.setBonus     = "Build up momentum to smash into enemies, increased movement speed";
                player.accRunSpeed += 2f;
                if (hardMode)
                {
                    player.accRunSpeed += 1f; player.moveSpeed += 0.15f;
                }
                player.GetModPlayer <PlayerFX>().buildMomentum = true;
                break;

            case 4:
                player.setBonus = "100% increased uppercut and divekick damage\n" +
                                  "Reduces combo power cost by 1";
                mpf.uppercutDamage       += 1f;
                mpf.divekickDamage       += 1f;
                mpf.comboCounterMaxBonus -= 1;
                break;
            }
        }
示例#25
0
        public override void UpdateArmorSet(Player player)
        {
            ModPlayerFists mpf = ModPlayerFists.Get(player);

            switch (armourSet)
            {
            case 1:
                if (!hardMode)
                {
                    player.setBonus = WeaponOut.GetTranslationTextValue("FistVeteranHeadPower");
                }
                else
                {
                    player.setBonus = WeaponOut.GetTranslationTextValue("FistVeteranHeadPowerHardmode");
                    player.GetModPlayer <PlayerFX>().doubleDamageUp = true;
                }
                player.GetModPlayer <PlayerFX>().taekwonCounter = true;
                break;

            case 2:
                if (!hardMode)
                {
                    player.setBonus = WeaponOut.GetTranslationTextValue("FistVeteranHeadDefence");
                }
                else
                {
                    player.setBonus    = WeaponOut.GetTranslationTextValue("FistVeteranHeadDefenceHardmode");
                    player.longInvince = true;
                }
                player.GetModPlayer <PlayerFX>().rapidRecovery = true;
                break;

            case 3:
                player.setBonus     = WeaponOut.GetTranslationTextValue("FistVeteranHeadSpeed");
                player.accRunSpeed += 2f;
                if (hardMode)
                {
                    player.accRunSpeed += 1f; player.moveSpeed += 0.15f;
                }
                player.GetModPlayer <PlayerFX>().buildMomentum = true;
                break;

            case 4:
                player.setBonus           = WeaponOut.GetTranslationTextValue("FistVeteranHeadGi");
                mpf.uppercutDamage       += 1f;
                mpf.divekickDamage       += 1f;
                mpf.comboCounterMaxBonus -= 1;
                break;
            }
        }
        public override void HitEffect(int hitDirection, double damage)
        {
            Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 3, 1f, 0f);
            if (npc.life <= 0)
            {
                // Do this here because in multiplayer client (which spawns these) doesn't run NPCLoot)
                Player player = Main.player[npc.target];
                ModPlayerFists.Get(player).ModifyComboCounter(1);
                for (int i = 0; i < 5; i++)
                {
                    Vector2 veloRand = Main.rand.NextVector2Square(-3f, 3f);
                    Projectile.NewProjectile(npc.Center + player.velocity * 2, player.velocity + veloRand, ProjectileID.FlaironBubble, player.HeldItem.damage / 5, 5f, npc.target, -10f, 0);
                }

                // Actual hit effect
                for (int i = 0; i < 60; i++)
                {
                    int     num209   = 25;
                    Vector2 vector10 = ((float)Main.rand.NextDouble() * 6.28318548f).ToRotationVector2() * (float)Main.rand.Next(24, 41) / 8f;
                    int     num210   = Dust.NewDust(npc.Center - Vector2.One * (float)num209, num209 * 2, num209 * 2, 212, 0f, 0f, 0, default(Color), 1f);
                    Dust    dust48   = Main.dust[num210];
                    Vector2 vector11 = Vector2.Normalize(dust48.position - npc.Center);
                    dust48.position = npc.Center + vector11 * 25f * npc.scale;
                    if (i < 30)
                    {
                        dust48.velocity = vector11 * dust48.velocity.Length();
                    }
                    else
                    {
                        dust48.velocity = vector11 * (float)Main.rand.Next(45, 91) / 10f;
                    }
                    dust48.color     = Main.hslToRgb((float)(0.40000000596046448 + Main.rand.NextDouble() * 0.20000000298023224), 0.9f, 0.5f);
                    dust48.color     = Color.Lerp(dust48.color, Color.White, 0.3f);
                    dust48.noGravity = true;
                    dust48.scale     = 0.7f;
                }
            }
        }
示例#27
0
 public override void UpdateAccessory(Player player, bool hideVisual)
 {
     ModPlayerFists.Get(player).comboCounterMaxBonus -= 2;
 }
示例#28
0
 public override void UpdateEquip(Player player)
 {
     player.meleeDamage += 0.05f;
     ModPlayerFists.Get(player).parryDamage += 0.5f;
 }
示例#29
0
        /// <summary> The method called during a combo. Use for ongoing dust and gore effects. </summary>
        public static void ComboEffects(Player player, Item item, bool initial)
        {
            if (initial)
            {
                player.AddBuff(buffID, flurryDuration + flurryEndDelay + comboDelay, false); // Flurry
                player.itemAnimation = player.itemAnimationMax + comboDelay;                 // Set initial combo animation delay
                player.GetModPlayer <ModPlayerFists>().jumpAgainUppercut = true;             // Hardmode combos reset uppercut
                Main.PlaySound(WeaponOut.mod.GetLegacySoundSlot
                                   (SoundType.Item, "Sounds/Item/HokutoActivate").WithPitchVariance(0f),
                               player.position);
            }
            // Charging (Hardmode)
            int       bIdx = player.FindBuffIndex(buffID);
            Rectangle r    = ModPlayerFists.UseItemGraphicbox(player, 16, altHitboxSize);

            player.statDefense += player.itemAnimation; // Bonus defence during special
            if (player.itemAnimation > player.itemAnimationMax)
            {
                // =================== BEHAVIOURS =================== //

                // Charge effect
                for (int i = 0; i < 2; i++)
                {
                    Dust d = Main.dust[Dust.NewDust(r.TopLeft(), 16, 16, 175, 0, 0, 0, default(Color), 1.5f)];
                    d.position -= d.velocity * 10f;
                    d.velocity /= 2;
                    d.noGravity = true;
                }

                // Final punch effect
                if (bIdx >= 0 && player.buffTime[bIdx] <= flurryEndDelay)
                {
                    player.velocity.Y -= player.gravity;
                    // Move towards mouse
                    if (player.whoAmI == Main.myPlayer && player.buffTime[bIdx] % 3 == 0)
                    {
                        Vector2 velo = Main.MouseWorld - player.Center;
                        velo.Normalize();
                        velo           *= altDashSpeed * 2f;
                        player.velocity = (player.velocity * 3 + velo) / 4;
                        NetMessage.SendData(MessageID.SyncPlayer, -1, player.whoAmI, null, player.whoAmI);
                    }
                }

                // ^^^^^^^^^^^^^^^^^^^ BEHAVIOURS ^^^^^^^^^^^^^^^^^^^ //
            }
            // Initial throw
            else if (player.itemAnimation == player.itemAnimationMax)
            {
                if (bIdx >= 0 && player.buffTime[bIdx] > flurryEndDelay)
                {
                    // Higher pitch for initiate
                    Main.PlaySound(WeaponOut.mod.GetLegacySoundSlot
                                       (SoundType.Item, "Sounds/Item/HokutoFlurry").WithPitchVariance(0f));
                }
                else
                {
                    // Boost otherwise
                    Vector2 velo = Main.MouseWorld - player.Center;
                    velo.Normalize();
                    velo           *= altDashSpeed;
                    player.velocity = velo;
                    NetMessage.SendData(MessageID.SyncPlayer, -1, player.whoAmI, null, player.whoAmI);
                }

                // =================== BEHAVIOURS =================== //

                // Swag dust ring
                for (int i = 0; i < 64; i++)
                {
                    double angle = Main.time + i / 10.0;
                    Dust   d     = Dust.NewDustPerfect(player.Center, i % 2 == 0 ? 173 : 162,
                                                       new Vector2((float)(5.0 * Math.Sin(angle)), (float)(5.0 * Math.Cos(angle))));
                    d.noGravity = true;
                    d.fadeIn    = 1.3f;
                    d.velocity *= 2f;
                }

                // ^^^^^^^^^^^^^^^^^^^ BEHAVIOURS ^^^^^^^^^^^^^^^^^^^ //
            }
            else
            {
                // =================== BEHAVIOURS =================== //

                // Reset
                bool bigPunch = false;
                if (bIdx >= 0)
                {
                    if (player.buffTime[bIdx] > flurryEndDelay)
                    {
                        if (player.itemAnimation <= player.itemAnimationMax / 2)
                        {
                            // Reset in flurry
                            player.itemAnimation = player.itemAnimationMax;
                            ModPlayerFists.Get(player).specialMove = 0;

                            // Move towards mouse
                            if (player.whoAmI == Main.myPlayer)
                            {
                                Vector2 velo = Main.MouseWorld - player.Center;
                                velo.Normalize();
                                velo           *= altDashSpeed;
                                player.velocity = (player.velocity * 2 + velo) / 3;
                                NetMessage.SendData(MessageID.SyncPlayer, -1, player.whoAmI, null, player.whoAmI);
                            }
                        }
                    }
                    else
                    {
                        if (player.buffTime[bIdx] == flurryEndDelay)
                        {
                            // Higher pitch for initiate
                            Main.PlaySound(WeaponOut.mod.GetLegacySoundSlot
                                               (SoundType.Item, "Sounds/Item/HokutoEnd").WithPitchVariance(0f));
                        }

                        // Last punch, double hitbox
                        player.itemAnimation = player.buffTime[bIdx] + 1;
                        r        = ModPlayerFists.UseItemGraphicbox(player, 16, altHitboxSize * 2);
                        bigPunch = true;
                    }
                }

                Vector2 pVelo    = (player.position - player.oldPosition);
                Vector2 velocity = ModPlayerFists.GetFistVelocity(player) * -3f + pVelo * 0.5f;
                Dust    d;

                for (int i = 0; i < 8; i++)
                {
                    d = Main.dust[Dust.NewDust(r.TopLeft(), r.Width, r.Height, 173,
                                               velocity.X, velocity.Y)];
                    d.velocity *= bigPunch ? 3f : 2f;
                    d.noGravity = true;
                    d.scale    *= bigPunch ? 4f : 1.5f;
                }

                // ^^^^^^^^^^^^^^^^^^^ BEHAVIOURS ^^^^^^^^^^^^^^^^^^^ //
            }
        }
示例#30
0
        private void DrawPumpkinMark(SpriteBatch spriteBatch)
        {
            if (!ModConf.enableFists)
            {
                return;
            }
            if (Main.gameMenu)
            {
                return;
            }

            int buffID = BuffType <Buffs.PumpkinMark>();
            Dictionary <Vector2, bool> drawPositions = new Dictionary <Vector2, bool>();

            foreach (NPC i in Main.npc)
            {
                if (!i.active || i.life <= 0)
                {
                    continue;
                }
                if (i.buffImmune.Length < buffID)
                {
                    continue;
                }

                int buffIndex = i.FindBuffIndex(buffID);

                // In case two NPCs occupy the same position
                Vector2 centre = i.Center + new Vector2(0, i.gfxOffY);
                if (buffIndex >= 0 && !drawPositions.ContainsKey(centre))
                {
                    drawPositions.Add(centre, i.buffTime[buffIndex] < 120);
                }
            }
            foreach (Player i in Main.player)
            {
                Vector2 centre = i.Center + new Vector2(0, i.gfxOffY);
                if (i.active && !i.dead && i.FindBuffIndex(buffID) >= 0 && !drawPositions.ContainsKey(centre))
                {
                    drawPositions.Add(i.Center + new Vector2(0, i.gfxOffY), false);
                }
            }

            if (drawPositions.Count > 0)
            {
                int frameHeight   = pumpkinMark.Height / 3;
                int frameY        = 0;
                int explodeFrameY = frameY;
                if ((int)(Main.time / 6) % 2 == 0)
                {
                    explodeFrameY = frameHeight;
                }
                else
                {
                    explodeFrameY = frameHeight * 2;
                }
                if (ModPlayerFists.Get(Main.LocalPlayer).GetParryBuff() >= 0)
                {
                    frameY = explodeFrameY;
                }
                spriteBatch.End();

                //spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullNone, null, Main.GameViewMatrix.ZoomMatrix);
                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, null, null, null, Main.GameViewMatrix.ZoomMatrix);
                foreach (KeyValuePair <Vector2, bool> kvp in drawPositions)
                {
                    spriteBatch.Draw(pumpkinMark, (kvp.Key - Main.screenPosition),
                                     new Rectangle(0, kvp.Value ? explodeFrameY : frameY, pumpkinMark.Width, frameHeight),
                                     new Color(0.8f, 0.8f, 0.8f, 0.5f), 0f, new Vector2(pumpkinMark.Width / 2, frameHeight / 2),
                                     1f, SpriteEffects.None, 0f);
                }
                spriteBatch.End();
                spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, Matrix.CreateScale(Main.UIScale, Main.UIScale, 1f));
            }
        }